HI all,
I am creating my first hibernate prog with using Struts1.1, oracle-8I and weblogic 8.1.but i am getting the following exception
java.lang.RuntimeException: Exception building SessionFactory : Could not find datasource at com.mindspeed.feedback.lms.student.data.HibernateUtil.currentSession(HibernateUtil.java:31) at com.mindspeed.feedback.lms.student.action.AddQuestionAction.updateDatabase(AddQuestionAction.java:60)at com.mindspeed.feedback.lms.student.action.AddQuestionAction.execute(AddQuestionAction.java:39)
Caused by: net.sf.hibernate.HibernateException: Could not find datasource
at net.sf.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:48)
at net.sf.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:83)
at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:64)
at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1132)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:766)
at com.mindspeed.feedback.lms.student.data.HibernateUtil.currentSession(HibernateUtil.java:28)
... 18 more
Caused by: javax.naming.NameNotFoundException: Unable to resolve 'feedback_ds' Resolved ; remaining name 'feedback_ds'
at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:186)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:284)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:244)
at weblogic.jndi.internal.ServerNamingNode_811_WLStub.lookup(Unknown Source)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:338)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:333)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at net.sf.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:44)
... 23 more
I created a datasource name "feedback_ds", and i mapped it in hibernate.cfg.xml as follow:
<session-factory>
<!-- datasource connection properties -->
<property name="connection.datasource">feedback_ds</property>
<property name="hibernate.show_sql">false</property>
<property name="hibernate.use_outer_join">true</property>
<property name="hibernate.transaction.factory_class">net.sf.hibernate.transaction.WeblogicTransactionManagerLookup</property>
<property name="jta.UserTransaction">java:comp/UserTransaction</property>
<property name="dialect">net.sf.hibernate.dialect.OracleDialect</property>
<mapping resource="LmsFeedback.hbm" />
<mapping resource="FeedbackQuestion.hbm" />
</session-factory>
Please do the needful. i stuck in this from last night. Thanx in advance.
Regards
Sachin
-
Could not find datasource using hibernate2.1 (2 messages)
- Posted by: sachin sisodia
- Posted on: September 14 2004 08:41 EDT
Threaded Messages (2)
- Could not find datasource using hibernate2.1 by sachin sisodia on September 15 2004 06:53 EDT
- Best bet is to post this in the Hibernate forum by Dennis Graham on November 04 2004 08:13 EST
-
Could not find datasource using hibernate2.1[ Go to top ]
- Posted by: sachin sisodia
- Posted on: September 15 2004 06:53 EDT
- in response to sachin sisodia
Please any one can help me out.
Regards
Sachin -
Best bet is to post this in the Hibernate forum[ Go to top ]
- Posted by: Dennis Graham
- Posted on: November 04 2004 08:13 EST
- in response to sachin sisodia