-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Could not find datasource
PostPosted: Sun Apr 11, 2010 5:12 pm 
Newbie

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


Top
 Profile  
 
 Post subject: Re: Could not find datasource
PostPosted: Mon Apr 12, 2010 8:12 am 
Beginner
Beginner

Joined: Fri Aug 24, 2007 9:47 am
Posts: 21
Look if datasource.xml is in your classpath?

_________________
recherche-programmeur.fr


Top
 Profile  
 
 Post subject: Re: Could not find datasource
PostPosted: Mon Apr 12, 2010 1:25 pm 
Newbie

Joined: Fri Dec 14, 2007 12:48 am
Posts: 4
Well, without that, jboss would not have listed it on JMX console. The file is right there in deploy directory.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.