Hibernate version:3
Changes made to hibernate.properties.
hibernate.jndi.Context.INITIAL_CONTEXT_FACTORY weblogic.jndi.WLInitialContextFactory
hibernate.jndi.Context.PROVIDER_URL
t3://localhost:7001
hibernate.connection.datasource java:comp/env/jdbc/test
created datasource in weblogic
datasource in Weblogic:
Name: Test_JDBCDataSource
JNDI Name: jdbc/test
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
14:19:03,968 INFO NamingHelper:26 - JNDI InitialContext properties:{Context.PRO
VIDER_URL=t3://localhost:7001, Context.INITIAL_CONTEXT_FACTORY=weblogic.jndi.WLI
nitialContextFactory}
14:19:03,984 FATAL DatasourceConnectionProvider:47 - Could not find datasource:
java:comp/env/jdbc/test
javax.naming.NameNotFoundException: While trying to look up comp/env/jdbc/test
in /app/webapp/iquest/3579868.; remaining name 'comp/env/jdbc/test'
at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(Basic
NamingNode.java:897)
at weblogic.jndi.internal.ApplicationNamingNode.lookup(ApplicationNaming
Node.java:150)
at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.j
ava:256)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:357)
at weblogic.jndi.factories.java.ReadOnlyContextWrapper.lookup(ReadOnlyCo
ntextWrapper.java:45)
at weblogic.jndi.internal.AbstractURLContext.lookup(AbstractURLContext.j
ava:130)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at org.hibernate.connection.DatasourceConnectionProvider.configure(Datas
ourceConnectionProvider.java:44)
at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvi
der(ConnectionProviderFactory.java:80)
at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFa
ctory.java:295)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:
110)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1485
)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.jav
a:1029)
at .dataaccess.HibernateUtil.<clinit>(HibernateUtil.java
:40)
at servlet.StartUpShutDownServlet.init(StartUpShutDownS
ervlet.java:28)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at weblogic.servlet.internal.ServletStubImpl$ServletInitAction.run(Servl
etStubImpl.java:1018)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
118)
at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubIm
pl.java:894)
at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStub
Impl.java:873)
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI
mpl.java:812)
at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppS
ervletContext.java:3281)
at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebApp
ServletContext.java:3226)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAp
pServletContext.java:3207)
at weblogic.servlet.internal.HttpServer.preloadResources(HttpServer.java
:694)
at weblogic.servlet.internal.WebService.preloadResources(WebService.java
:483)
at weblogic.servlet.internal.ServletInitService.resume(ServletInitServic
e.java:30)
at weblogic.t3.srvr.SubsystemManager.resume(SubsystemManager.java:131)
at weblogic.t3.srvr.T3Srvr.resume(T3Srvr.java:966)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:361)
at weblogic.Server.main(Server.java:32)
14:19:04,000 ERROR HibernateUtil:46 - Building SessionFactory failed.
org.hibernate.HibernateException: Could not find datasource
at org.hibernate.connection.DatasourceConnectionProvider.configure(Datas
ourceConnectionProvider.java:48)
at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvi
der(ConnectionProviderFactory.java:80)
at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFa
ctory.java:295)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:
110)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1485
)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.jav
a:1029)
at dataaccess.HibernateUtil.<clinit>(HibernateUtil.java
:40)
at servlet.StartUpShutDownServlet.init(StartUpShutDownS
ervlet.java:28)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at weblogic.servlet.internal.ServletStubImpl$ServletInitAction.run(Servl
etStubImpl.java:1018)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
118)
at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubIm
pl.java:894)
at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStub
Impl.java:873)
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI
mpl.java:812)
at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppS
ervletContext.java:3281)
at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebApp
ServletContext.java:3226)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAp
pServletContext.java:3207)
at weblogic.servlet.internal.HttpServer.preloadResources(HttpServer.java
:694)
at weblogic.servlet.internal.WebService.preloadResources(WebService.java
:483)
at weblogic.servlet.internal.ServletInitService.resume(ServletInitServic
e.java:30)
at weblogic.t3.srvr.SubsystemManager.resume(SubsystemManager.java:131)
at weblogic.t3.srvr.T3Srvr.resume(T3Srvr.java:966)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:361)
at weblogic.Server.main(Server.java:32)
Caused by: javax.naming.NameNotFoundException: While trying to look up comp/env/
jdbc/test in /app/webapp/iquest/3579868.; remaining name 'comp/env/jdbc/test
'
at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(Basic
NamingNode.java:897)
at weblogic.jndi.internal.ApplicationNamingNode.lookup(ApplicationNaming
Node.java:150)
at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.j
ava:256)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:357)
at weblogic.jndi.factories.java.ReadOnlyContextWrapper.lookup(ReadOnlyCo
ntextWrapper.java:45)
at weblogic.jndi.internal.AbstractURLContext.lookup(AbstractURLContext.j
ava:130)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at org.hibernate.connection.DatasourceConnectionProvider.configure(Datas
ourceConnectionProvider.java:44)
... 24 more
Exception : org.hibernate.HibernateException: Could not find datasource
<Mar 17, 2005 2:19:04 PM GMT+05:30> <Error> <HTTP> <BEA-101216> <Servlet: "Start
UpShutDownServlet" failed to preload on startup in Web application: "iquest".
javax.servlet.ServletException
at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubIm
pl.java:909)
at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStub
Impl.java:873)
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI
mpl.java:812)
at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppS
ervletContext.java:3281)
at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebApp
ServletContext.java:3226)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAp
pServletContext.java:3207)
at weblogic.servlet.internal.HttpServer.preloadResources(HttpServer.java
:694)
at weblogic.servlet.internal.WebService.preloadResources(WebService.java
:483)
at weblogic.servlet.internal.ServletInitService.resume(ServletInitServic
e.java:30)
at weblogic.t3.srvr.SubsystemManager.resume(SubsystemManager.java:131)
at weblogic.t3.srvr.T3Srvr.resume(T3Srvr.java:966)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:361)
at weblogic.Server.main(Server.java:32)
>
Name and version of the database you are using: oracle 9i
The generated SQL (show_sql=true):