Joined: Fri Dec 14, 2007 12:48 am Posts: 4
|
Hi,
I get this strange error when hibernate is trying to fetch Datasource using JNDI Name java:/myXaDS. This is the datasource.xml
<datasources> <xa-datasource> <jndi-name>myXaDS</jndi-name> <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class> <xa-datasource-property name="ServerName">myserver</xa-datasource-property> <xa-datasource-property name="PortNumber">5432</xa-datasource-property> <xa-datasource-property name="DatabaseName">test</xa-datasource-property> <security-domain>myRealm</security-domain>
<!-- pooling parameters --> <min-pool-size>5</min-pool-size> <max-pool-size>100</max-pool-size> <blocking-timeout-millis>5000</blocking-timeout-millis> <idle-timeout-minutes>15</idle-timeout-minutes>
<track-connection-by-tx>true</track-connection-by-tx> </xa-datasource>
</datasources>
I am using EJB3Configuration class and setting this property hibernate.connection.datasource to java:myXaDS. I logged into jboss jmx console and I can see the datasource listed in the JNDIView. I debugged hibernate source code from DatasourceConnectionProvider (3.3.2 GA) and found this line (at line number 75) -
ds = ( DataSource ) NamingHelper.getInitialContext( props ).lookup( jndiName ); is returning null.
So its not throwing a NamingException or anything of that sort. I am lost. Please help.
Using JBOss 4.3.0 GA
Getting the exception Caused by: org.hibernate.HibernateException: Could not find datasource: java:myXaDS
Thanks
|
|