Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
3.0.4
Mapping documents:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.datasource">jdbc/dbname</property>
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.WebSphereTransactionManagerLookup</property>
<property name="hibernate.cglib.use_reflection_optimizer">true</property>
<property name="hibernate.dialect">org.hibernate.dialect.DB2Dialect</property>
<property name="hibernate.show_sql">false</property>
<mapping resource="Languages.hbm.xml"/>
<mapping resource="Setlang.hbm.xml"/>
<mapping resource="Usedmachine.hbm.xml"/>
<mapping resource="Description.hbm.xml"/>
<mapping resource="Seller.hbm.xml"/>
<mapping resource="Lelyuser.hbm.xml"/>
<mapping resource="Category.hbm.xml"/>
<mapping resource="Images.hbm.xml"/>
</session-factory>
</hibernate-configuration>
Code between sessionFactory.openSession() and session.close():
session = HibernateUtil.currentSession();
Full stack trace of any exception that occurs:
[6/23/05 17:52:39:984 CEST] 4cf91d7b WsServer A WSVR0001I: Server server1 open for e-business
[6/23/05 17:53:17:375 CEST] 2b21dd61 SessionContex E SESN0043E: BackedHashtable: problem obtaining the configured datasource. Ensure that you have properly configured a datasource. When Session Manager persistence is enabled the Session Manager configuration must contain a valid datasource.
[6/23/05 17:53:17:375 CEST] 2b21dd61 SessionContex E Exception is: javax.naming.NameNotFoundException: jdbc/Sessions. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound
at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.do_resolve_complete_info(WsnOptimizedNamingImpl.java:964)
at com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase.resolve_complete_info(WsnOptimizedNamingImplBase.java:1416)
at com.ibm.WsnOptimizedNaming._NamingContextStub.resolve_complete_info(Unknown Source)
at com.ibm.ws.naming.jndicos.CNContextImpl.cosResolve(CNContextImpl.java:3537)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1568)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1528)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:1228)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:144)
at javax.naming.InitialContext.lookup(InitialContext.java:359)
at com.ibm.ws.webcontainer.httpsession.BackedHashtable.getDataSource(BackedHashtable.java:473)
at com.ibm.ws.webcontainer.httpsession.BackedHashtable.getConnection(BackedHashtable.java:1040)
at com.ibm.ws.webcontainer.httpsession.BackedHashtable.readFromExternal(BackedHashtable.java:1822)
at com.ibm.ws.webcontainer.httpsession.BackedHashtable.retrieveSession(BackedHashtable.java:1620)
at com.ibm.ws.webcontainer.httpsession.BackedHashtable.getSession(BackedHashtable.java:1574)
at com.ibm.ws.webcontainer.httpsession.BackedHashtable.get(BackedHashtable.java:1974)
at com.ibm.ws.webcontainer.httpsession.SessionContext.tableGet(SessionContext.java:2119)
at com.ibm.ws.webcontainer.httpsession.SessionContext.findSession(SessionContext.java:1355)
at com.ibm.ws.webcontainer.httpsession.SessionContext.getIHttpSession(SessionContext.java:1392)
at com.ibm.ws.webcontainer.httpsession.SessionContext.getIHttpSession(SessionContext.java:2365)
at com.ibm.ws.webcontainer.webapp.WebAppDispatcherContext.getSession(WebAppDispatcherContext.java:178)
at com.ibm.ws.webcontainer.webapp.WebAppDispatcherContext.encodeURL(WebAppDispatcherContext.java:237)
at com.ibm.ws.webcontainer.srt.SRTServletResponseContext.encodeURL(SRTServletResponseContext.java:378)
at com.ibm.ws.webcontainer.srt.SRTServletResponse.encodeURL(SRTServletResponse.java:342)
at com.ibm.ws.webcontainer.srt.SRTServletResponse.encodeRedirectURL(SRTServletResponse.java:331)
at com.ibm.ws.webcontainer.webapp.WebAppRootDispatcher.handleWebAppDispatch(WebAppRootDispatcher.java:42)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:598)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:206)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:80)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:214)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:622)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:447)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:672)
Name and version of the database you are using:
DB2 8.2.1
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
i configured the DS 5 in Websphere and tested the connection and it runs.