datasource dependency
columod Apr 28, 2004 11:06 AMhi all,
i've deployed a (hibernate) sar which works fine, however if i restart jboss without deleting the sar from the deploy directory i get an error saying it could't find the databsource when jboss starts up.
if i delete the sar, restart jboss and then redeploy everything is fine leading me to believe i need to make my sar dependent on the datasource so that jboss doesn't attempt to load it until after the datasource is loaded.
does anybody know how i would do this? any help would be greatly appreciated.
===============================================
the error is as follows :
15:24:03,215 FATAL [DatasourceConnectionProvider] Could not find datasource: java:/cjdbc-gmmhDS
javax.naming.NameNotFoundException: cjdbc-gmmhDS not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
at org.jnp.server.NamingServer.getObject(NamingServer.java:509)
at org.jnp.server.NamingServer.lookup(NamingServer.java:282)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:528)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
note : the datasource is successfully loaded later in the startup :
5:24:10,571 INFO [TxConnectionManager] Started jboss.jca:service=LocalTxCM,name=cjdbc-gmmhDS
15:24:10,574 INFO [gmmhDS] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:service=LocalTxCM,name=gmmhDS to JNDI name 'java:/gmmhDS'
15:24:10,575 INFO [TxConnectionManager] Started jboss.jca:service=LocalTxCM,name=gmmhDS
===============================================
my jboss-service.xml file in the sar looks like this :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE server>
<!-- Generated file - Do not edit! -->
jboss.jca:service=RARDeployer
com/test/ReplyPath.hbm.xml
java:/hibernate/gmmh
java:/cjdbc-gmmhDS
net.sf.hibernate.dialect.MySQLDialect
true
true
UserTransaction
net.sf.hibernate.transaction.JTATransactionFactory
net.sf.hibernate.transaction.JBossTransactionManagerLookup