-->
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.  [ 2 posts ] 
Author Message
 Post subject: Hibernate Datasource access issues
PostPosted: Tue Nov 09, 2004 12:01 pm 
Newbie

Joined: Fri Oct 01, 2004 11:48 am
Posts: 3
Hibernate version: 2.1.4

Mapping documents:
<hibernate-configuration>

<!-- a SessionFactory instance listed as /jndi/name -->
<session-factory
name="java:comp/env/hibernate/SessionFactory">

<!-- properties -->

<property name="hibernate.jndi.url">iiop://localhost:2809/</property>
<property name="hibernate.jndi.class">com.ibm.websphere.naming.WsnInitialContextFactory</property>

<property name="connection.datasource">jdbc/AX1</property>
<property name="dialect">net.sf.hibernate.dialect.OracleDialect</property>
<property name="show_sql">true</property>
<property name="use_outer_join">true</property>
<property name="transaction.factory_class">
net.sf.hibernate.transaction.JTATransactionFactory
</property>
<property name="jta.UserTransaction">java:comp/UserTransaction</property>

<!-- mapping files -->
<mapping resource="client/data/Employee.hbm.xml"/>
</session-factory>

</hibernate-configuration>


I get this error when initializing Hibernate

Hibernate ExceptionCould not find datasource
Exception in thread "P=824628:O=0:CT" java.lang.RuntimeException: Could not find datasource.

I am trying to access a Datasource defined in WebSphere from a native java application. I know i am doing something wrong or have the wrong configuration file.

Please advise or direct me to resolve this.

Thanks

-Naren


Top
 Profile  
 
 Post subject: Help please
PostPosted: Tue Nov 09, 2004 1:24 pm 
Newbie

Joined: Fri Oct 01, 2004 11:48 am
Posts: 3
Can someone help???

How to setup cfg.xml to access datasource using a JNDI name from a Java application running outside AppServer (Websphere)

It works fine without JNDI name using hibernate.properties. But i would like to use JNDI names since i need to connect to more than one datasource depending on the user requirement. Moreover i cannot provide the URL, username, password since this could change and is ideally setup as part of JNDI setup by the WebSphere admistrator.

Any examples??

Thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.