[jboss-user] [Datasource Configuration] - Configuring oracle datasource in JBoss 6.0.0 CR1

Sam Tsang do-not-reply at jboss.com
Thu Dec 16 00:00:31 EST 2010


Sam Tsang [http://community.jboss.org/people/newguy2010] created the discussion

"Configuring oracle datasource in JBoss 6.0.0 CR1"

To view the discussion, visit: http://community.jboss.org/message/576299#576299

--------------------------------------------------------------
| # favorite | I have a J2EE application which uses Spring 3.0 + latest version of Hibernate (3.6) and I want to deploy it on JBoss 6 CR1.
But I came across an exception stating that the datasource is not found when I deployed the application.
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [javax.sql.DataSource] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}
 at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:920) [:3.0.5.RELEASE]
 at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:789) [:3.0.5.RELEASE]
 at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:703) [:3.0.5.RELEASE]
 at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:795) [:3.0.5.RELEASE]
 at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:723) [:3.0.5.RELEASE]
 ... 159 more

I have checked the JMX console of JBoss Application Server and the datasource I declared in Spring is under java namespace.
I delcared the datasource in my application-context.xml as
<jee:jndi-lookup id="dataSource" jndi-name="java:ThisIsMyDataSource"/>

In persistence.xml file I declared:
<persistence-unit name="persistenceUnit" transaction-type="JTA">
        <provider>org.hibernate.ejb.HibernatePersistence</provider>
        <jta-data-source>java:/ThisIsMyDataSource</jta-data-source>
</persistence-unit>

A datasource with a name called ThisIsMyDataSource is in the deploy folder of /jboss/server/default/deploy
It looks like my application was trying to look for the bean for  javax.sql.datasource to autowire into some other classes' constructors  and failed.
Does anyone know how to resolve this? |
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/576299#576299]

Start a new discussion in Datasource Configuration at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2077]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20101216/1a7bbac5/attachment.html 


More information about the jboss-user mailing list