I am trying to setup Hibernate2 in JBoss4.0.2.
I have a SAR file for hibernate service with the following contents:
-----------------------------------------------------------------------------
/meta-inf/jboss-service.xml
<server>
| <mbean code="net.sf.hibernate.jmx.HibernateService"
name="OneNetwork.SSO:Database Manager=SSO Hibernate Service">
| <depends>jboss.jca:service=RARDeployer</depends>
| <depends>jboss.jca:service=LocalTxCM,name=OracleDS</depends>
| <attribute name="MapResources">
| model/Application.hbm.xml,
| </attribute>
| <attribute name="JndiName">java:/hibernate/HibernateFactory</attribute>
| <attribute name="Datasource">java:/OracleDS</attribute>
| <attribute
name="Dialect">net.sf.hibernate.dialect.Oracle9Dialect</attribute>
| <attribute
name="TransactionStrategy">net.sf.hibernate.transaction.JTATransactionFactory</attribute>
| <attribute
name="TransactionManagerLookupStrategy">net.sf.hibernate.transaction.JBossTransactionManagerLookup</attribute>
| <attribute name="MaximumFetchDepth">0</attribute>
| <attribute name="ShowSql">false</attribute>
| </mbean>
| </server>
|
/lib
cglib-full-2.0.2.jar
classes12.jar
commons-collections-2.1.1.jar
commons-logging-1.0.4.jar
dom4j-1.4.jar
ehcache-0.9.jar
hibernate2.jar
odmg-3.0.jar
..and my application classes..
When I start JBOss, I see the following error:
08:04:47,228 FATAL [DatasourceConnectionProvider] Could not find datasource:
java:/OracleDS
javax.naming.NameNotFoundException: OracleDS not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:491)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:499)
at org.jnp.server.NamingServer.getObject(NamingServer.java:505)
at org.jnp.server.NamingServer.lookup(NamingServer.java:278)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:610)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at
net.sf.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:44)
The weird thing is I see the following message after the abover error:
08:04:47,389 INFO [WrapperDataSourceService] Bound connection factory for
resource adapter for ConnectionManager 'jboss
.jca:name=OracleDS,service=DataSourceBinding to JNDI name 'java:OracleDS'
It's odd to see hibernate service being initialized before initializing
OracleDS. I have defined a dependency in hibernate service to wait until
OracleDS is ready.
This exact hibernate configuration works fine in JBoss 3.0.4. The only
difference between my JBoss3.0.4 and JBoss4.0.2 is the way we define OracleDS.
In JBoss3.0.4 we used oracle-service.xml, in JBoss4.0.2 we used oracle-ds.xml.
Here is my oracle-ds.xml:
<datasources>
| <local-tx-datasource>
| <jndi-name>OracleDS</jndi-name>
| <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
| <user-name>dtb62</user-name>
| <password>password</password>
| </local-tx-datasource>
| </datasources>
I am stuck with this problem. Any help is appreciated.
Thanks.
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3887059#3887059
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3887059
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September
19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user