Мул, пружина, Mybatis - не смог получить базу данных от DataSourceJAVA

Программисты JAVA общаются здесь
Ответить Пред. темаСлед. тема
Anonymous
 Мул, пружина, Mybatis - не смог получить базу данных от DataSource

Сообщение Anonymous »

Я пытаюсь создать простую службу Rest Mule на основе приложения Spring+Mybatis, которое я создал ранее. Приложение Spring работало так же, как это должно было (транзакции работали должным образом), но после интеграции кода в компонент Mule Rest и запустив приложение, я получаю следующее журнал с ошибкой: < /p>

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Initializing app 'test_rest' +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
INFO 2014-05-19 09:51:58,651 [main] org.mule.lifecycle.AbstractLifecycleManager: Initialising RegistryBroker
INFO 2014-05-19 09:51:58,813 [main] org.mule.config.spring.MuleApplicationContext: Refreshing org.mule.config.spring.MuleApplicationContext@6b1de1c2: startup date [Mon May 19 09:51:58 CEST 2014]; root of context hierarchy
INFO 2014-05-19 09:52:00,762 [main] org.mule.config.spring.MuleApplicationContext: Bean 'org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0' of type [class org.springframework.transaction.annotation.AnnotationTransactionAttributeSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
INFO 2014-05-19 09:52:00,766 [main] org.mule.config.spring.MuleApplicationContext: Bean 'org.springframework.transaction.config.internalTransactionAdvisor' of type [class org.springframework.transaction.interceptor.BeanFactoryTransactionAttributeSourceAdvisor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
INFO 2014-05-19 09:52:01,291 [main] org.springframework.jdbc.datasource.DriverManagerDataSource: Loaded JDBC driver: oracle.jdbc.OracleDriver
ERROR 2014-05-19 09:52:01,408 [main] org.apache.ibatis.executor.BaseExecutor: Could not get a databaseId from dataSource
java.sql.SQLException: N o s u i t a b l e d r i v e r f o u n d f o r j d b c : o r a c l e : t h i n : @ / / 1 9 2 . 1 6 8 . 2 0 0 . 1 0 : 1 5 2 2 / O R C L < b r / > a t j a v a . s q l . D r i v e r M a n a g e r . g e t C o n n e c t i o n ( U n k n o w n S o u r c e ) < b r / > a t j a v a . s q l . D r i v e r M a n a g e r . g e t C o n n e c t i o n ( U n k n o w n S o u r c e ) < b r / > a t o r g . s p r i n g f r a m e w o r k . j d b c . d a t a s o u r c e . D r i v e r M a n a g e r D a t a S o u r c e . g e t C o n n e c t i o n F r o m D r i v e r M a n a g e r ( D r i v e r M a n a g e r D a t a S o u r c e . j a v a : 1 7 3 ) < b r / > a t o r g . s p r i n g f r a m e w o r k . j d b c . d a t a s o u r c e . D r i v e r M a n a g e r D a t a S o u r c e . g e t C o n n e c t i o n F r o m D r i v e r ( D r i v e r M a n a g e r D a t a S o u r c e . j a v a : 1 6 4 ) < b r / > a t o r g . s p r i n g f r a m e w o r k . j d b c . d a t a s o u r c e . A b s t r a c t D r i v e r B a s e d D a t a S o u r c e . g e t C o n n e c t i o n F r o m D r i v e r ( A b s t r a c t D r i v e r B a s e d D a t a S o u r c e . j a v a : 1 5 3 ) < b r / > a t o r g . s p r i n g f r a m e w o r k . j d b c . d a t a s o u r c e . A b s t r a c t D r i v e r B a s e d D a t a S o u r c e . g e t C o n n e c t i o n ( A b s t r a c t D r i v e r B a s e d D a t a S o u r c e . j a v a : 1 1 9 ) < b r / > a t o r g . a p a c h e . i b a t i s . m a p p i n g . V e n d o r D a t a b a s e I d P r o v i d e r . g e t D a t a b a s e P r o d u c t N a m e ( V e n d o r D a t a b a s e I d P r o v i d e r . j a v a : 7 6 ) < b r / > a t o r g . a p a c h e . i b a t i s . m a p p i n g . V e n d o r D a t a b a s e I d P r o v i d e r . g e t D a t a b a s e N a m e ( V e n d o r D a t a b a s e I d P r o v i d e r . j a v a : 6 1 ) < b r / > a t o r g . a p a c h e . i b a t i s . m a p p i n g . V e n d o r D a t a b a s e I d P r o v i d e r . g e t D a t a b a s e I d ( V e n d o r D a t a b a s e I d P r o v i d e r . j a v a : 4 9 ) < b r / > a t o r g . m y b a t i s . s p r i n g . S q l S e s s i o n F a c t o r y B e a n . b u i l d S q l S e s s i o n F a c t o r y ( S q l S e s s i o n F a c t o r y B e a n . j a v a : 3 9 5 ) < b r / > a t o r g . m y b a t i s . s p r i n g . S q l S e s s i o n F a c t o r y B e a n . a f t e r P r o p e r t i e s S e t ( S q l S e s s i o n F a c t o r y B e a n . j a v a : 2 9 5 ) < b r / > a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . i n v o k e I n i t M e t h o d s ( A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . j a v a : 1 5 4 5 ) < b r / > a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . i n i t i a l i z e B e a n ( A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . j a v a : 1 4 8 3 ) < b r / > a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . d o C r e a t e B e a n ( A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . j a v a : 5 2 4 ) < b r / > a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . c r e a t e B e a n ( A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . j a v a : 4 6 1 ) < b r / > a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t B e a n F a c t o r y $ 1 . g e t O b j e c t ( A b s t r a c t B e a n F a c t o r y . j a v a : 2 9 5 ) < b r / > a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . D e f a u l t S i n g l e t o n B e a n R e g i s t r y . g e t S i n g l e t o n ( D e f a u l t S i n g l e t o n B e a n R e g i s t r y . j a v a : 2 2 3 ) < b r / > a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t B e a n F a c t o r y . d o G e t B e a n ( A b s t r a c t B e a n F a c t o r y . j a v a : 2 9 2 ) < b r / > a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t B e a n F a c t o r y . g e t B e a n ( A b s t r a c t B e a n F a c t o r y . j a v a : 1 9 4 ) < b r / > a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . B e a n D e f i n i t i o n V a l u e R e s o l v e r . r e s o l v e R e f e r e n c e ( B e a n D e f i n i t i o n V a l u e R e s o l v e r . j a v a : 3 2 3 ) < b r / > a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . B e a n D e f i n i t i o n V a l u e R e s o l v e r . r e s o l v e V a l u e I f N e c e s s a r y ( B e a n D e f i n i t i o n V a l u e R e s o l v e r . j a v a : 1 0 7 ) < b r / > a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . a p p l y P r o p e r t y V a l u e s ( A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . j a v a : 1 3 9 1 ) < b r / > a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . p o p u l a t e B e a n ( A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . j a v a : 1 1 3 2 ) < b r / > a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . d o C r e a t e B e a n ( A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . j a v a : 5 2 2 ) < b r / > a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . c r e a t e B e a n ( A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . j a v a : 4 6 1 ) < b r / > a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t B e a n F a c t o r y $ 1 . g e t O b j e c t ( A b s t r a c t B e a n F a c t o r y . j a v a : 2 9 5 ) < b r / > a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . D e f a u l t S i n g l e t o n B e a n R e g i s t r y . g e t S i n g l e t o n ( D e f a u l t S i n g l e t o n B e a n R e g i s t r y . j a v a : 2 2 3 ) < b r / > a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t B e a n F a c t o r y . d o G e t B e a n ( A b s t r a c t B e a n F a c t o r y . j a v a : 2 9 2 ) < b r / > a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t B e a n F a c t o r y . g e t T y p e F o r F a c t o r y B e a n ( A b s t r a c t B e a n F a c t o r y . j a v a : 1 3 6 0 ) < b r / > a t o r g . s p r i n g f r a m e w o r k . beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryBean(AbstractAutowireCapableBeanFactory.java:724)
at org.springframework.beans.factory.support.AbstractBeanFactory.isTypeMatch(AbstractBeanFactory.java:520)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:357)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:435)
at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1188)
at org.mule.config.spring.SpringRegistry.internalLookupByType(SpringRegistry.java:178)
at org.mule.config.spring.SpringRegistry.lookupByType(SpringRegistry.java:171)
at org.mule.registry.AbstractRegistryBroker.lookupByType(AbstractRegistryBroker.java:160)
at org.mule.registry.MuleRegistryHelper.lookupByType(MuleRegistryHelper.java:709)
at org.mule.config.bootstrap.SimpleRegistryBootstrap.registerTransformers(SimpleRegistryBootstrap.java:322)
at org.mule.config.bootstrap.SimpleRegistryBootstrap.initialise(SimpleRegistryBootstrap.java:185)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1612)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1553)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1483)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:524)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:626)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
at org.mule.config.spring.SpringRegistry.doInitialise(SpringRegistry.java:89)
at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:109)
at org.mule.config.spring.SpringXmlConfigurationBuilder.createSpringRegistry(SpringXmlConfigurationBuilder.java:119)
at org.mule.config.spring.SpringXmlConfigurationBuilder.doConfigure(SpringXmlConfigurationBuilder.java:73)
at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:46)
at org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:78)
at org.mule.config.builders.AutoConfigurationBuilder.autoConfigure(AutoConfigurationBuilder.java:101)
at org.mule.config.builders.AutoConfigurationBuilder.doConfigure(AutoConfigurationBuilder.java:57)
at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:46)
at org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:78)
at org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:84)
at org.mule.module.launcher.application.DefaultMuleApplication.init(DefaultMuleApplication.java:207)
at org.mule.module.launcher.application.ApplicationWrapper.init(ApplicationWrapper.java:64)
at org.mule.module.launcher.DefaultMuleDeployer.deploy(DefaultMuleDeployer.java:47)
at org.mule.tooling.server.application.ApplicationDeployer.main(ApplicationDeployer.java:127)
< /code>

Моя пружинная конфигурация выглядит так: < /p>


























< /code>

my mule config xml: < /p>

















< /code>

Классы, упомянутые в файлах XML, Mapper: < /p>

package com.example.mapper;

import java.util.List;

import com.example.vo.Person;

public interface Mapper {
public List selectAllPerson();
public int insertPerson(Person person);
}
< /code>

Service: < /p>

package com.example.service;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import com.example.mapper.Mapper;
import com.example.vo.Person;
import javax.ws.rs.*;

@Path("/person")
public class Service {

@Autowired
private Mapper mapper;

@GET
@Path("/select")
@Produces("text/plain")
public String selectAllPerson() {
return mapper.selectAllPerson().toString();
}

public void insertPerson(Person person) {
mapper.insertPerson(person);
}
}
< /code>

человек: < /p>

package com.example.vo;

public class Person {
private int id;
private String name;

public int getId() {return id;};
public void setId(int id) {this.id = id;}
public String getName() {return name;};
public void setName(String name) {this.name = name;}

public String toString() {return "id: " + id + " name: " + name;}
}


Подробнее здесь: https://stackoverflow.com/questions/237 ... datasource
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «JAVA»