users@glassfish.java.net

Cannot open connection - NameNotFoundException

From: <forums_at_java.net>
Date: Wed, 5 Oct 2011 09:04:02 -0500 (CDT)

 

Hi,

I have exception logged in my production Glassfish 3.1 deployment which say
that a DB connection could not be open because the JDBC pool was not found.

More specifically the top-most exception
is *org.hibernate.exception.GenericJDBCException: Cannot open connection
*and the inner most exception is *javax.naming.NameNotFoundException:
microsoft_sql_Aurora_aurora_userPool not found. *

the only strange thing is that this JDBC pool does exist and further request
are handled OK, go all the way to the DB and return good response.

This only happen sometimes and only when I use parallel requests from the
client application.

 

How can I diagnose such a problem?

I've post the full exception from the Glassfish log file below.

Thank you,

Ido. 

 

 

 

[#|2011-10-05T14:12:37.159+0100|WARNING|glassfish3.1|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=60;_ThreadName=Thread-1;|StandardWrapperValve[ServletAdaptor]:
PWC1406: Servlet.service() for servlet ServletAdaptor threw exception

javax.persistence.PersistenceException:
org.hibernate.exception.GenericJDBCException: Cannot open connection

at
org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:637)

at
org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:202)

at
com.sun.enterprise.container.common.impl.EntityManagerWrapper.find(EntityManagerWrapper.java:320)

at
org.dna.aurora.persistence.JpaEntityRepository.find(JpaEntityRepository.java:60)

at sun.reflect.GeneratedMethodAccessor177.invoke(Unknown Source)

at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at
org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1052)

at
org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1124)

at
com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:5367)

at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:619)

at
com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:801)

at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:571)

at
org.jboss.weld.ejb.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:46)

at sun.reflect.GeneratedMethodAccessor93.invoke(Unknown Source)

at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at
com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:862)

at
com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:801)

at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:571)

at
com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doAround(SystemInterceptorProxy.java:162)

at
com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:144)

at sun.reflect.GeneratedMethodAccessor92.invoke(Unknown Source)

at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at
com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:862)

at
com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:801)

at
com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:371)

at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5339)

at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5327)

at
com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:214)

at
com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:88)

at $Proxy156.find(Unknown Source)

at
org.dna.aurora.web.resources.BaseRepositoryEntityResource.getEntity(BaseRepositoryEntityResource.java:31)

at
org.dna.aurora.web.resources.BaseEntityResource.getConverter(BaseEntityResource.java:78)

at
org.dna.aurora.web.resources.BaseEntityResource.get(BaseEntityResource.java:55)

at sun.reflect.GeneratedMethodAccessor396.invoke(Unknown Source)

at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at
com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:167)

at
com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:70)

at
com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:279)

at
com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:121)

at
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:136)

at
com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:86)

at
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:136)

at
com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:74)

at
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1347)

at
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1279)

at
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1229)

at
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1219)

at
com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:419)

at
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537)

at
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:699)

at org.dna.aurora.web.MyContainer.service(MyContainer.java:35)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)

at
org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1534)

at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)

at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)

at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)

at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)

at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)

at
com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)

at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)

at
org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:326)

at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:227)

at
com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:170)

at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822)

at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)

at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)

at
com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)

at
com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)

at
com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)

at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)

at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)

at
com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)

at
com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)

at com.sun.grizzly.ContextTask.run(ContextTask.java:71)

at
com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)

at
com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)

at java.lang.Thread.run(Thread.java:662)

Caused by: org.hibernate.exception.GenericJDBCException: Cannot open
connection

at
org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)

at
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)

at
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)

at
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)

at
org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:426)

at
org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)

at
org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)

at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)

at org.hibernate.loader.Loader.doQuery(Loader.java:673)

at
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)

at org.hibernate.loader.Loader.loadEntity(Loader.java:1860)

at
org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:48)

at
org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:42)

at
org.hibernate.loader.entity.BatchingEntityLoader.load(BatchingEntityLoader.java:82)

at
org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3044)

at
org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:395)

at
org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:375)

at
org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:139)

at
org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:195)

at
org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:103)

at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878)

at org.hibernate.impl.SessionImpl.get(SessionImpl.java:815)

at org.hibernate.impl.SessionImpl.get(SessionImpl.java:808)

at
org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:182)

... 79 more

Caused by: java.sql.SQLException: This pool is not registered with the
runtime environment : microsoft_sql_Aurora_aurora_userPool

at
com.sun.enterprise.connectors.service.ConnectorConnectionPoolAdminServiceImpl.getConnection(ConnectorConnectionPoolAdminServiceImpl.java:1610)

at
com.sun.enterprise.connectors.ConnectorRuntime.getConnection(ConnectorRuntime.java:584)

at
com.sun.enterprise.connectors.service.ConnectorResourceAdminServiceImpl$MyDataSource.getConnection(ConnectorResourceAdminServiceImpl.java:277)

at
org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:47)

at
org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)

... 98 more

Caused by: javax.resource.ResourceException: This pool is not registered with
the runtime environment : microsoft_sql_Aurora_aurora_userPool

at
com.sun.enterprise.connectors.service.ConnectorConnectionPoolAdminServiceImpl.getUnpooledConnection(ConnectorConnectionPoolAdminServiceImpl.java:664)

at
com.sun.enterprise.connectors.service.ConnectorConnectionPoolAdminServiceImpl.getConnection(ConnectorConnectionPoolAdminServiceImpl.java:1602)

... 102 more

Caused by: com.sun.appserv.connectors.internal.api.ConnectorRuntimeException:
This pool is not bound in JNDI : microsoft_sql_Aurora_aurora_userPool

at
com.sun.enterprise.connectors.service.ConnectorConnectionPoolAdminServiceImpl.obtainManagedConnectionFactory(ConnectorConnectionPoolAdminServiceImpl.java:1089)

at
com.sun.enterprise.connectors.service.ConnectorConnectionPoolAdminServiceImpl.obtainManagedConnectionFactory(ConnectorConnectionPoolAdminServiceImpl.java:985)

at
com.sun.enterprise.connectors.service.ConnectorConnectionPoolAdminServiceImpl.getUnpooledConnection(ConnectorConnectionPoolAdminServiceImpl.java:657)

... 103 more

Caused by: javax.naming.NamingException: Lookup failed for
'__SYSTEM/pools/microsoft_sql_Aurora_aurora_userPool' in
SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory,
java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl,
java.naming.factory.url.pkgs=com.sun.enterprise.naming} [Root exception is
javax.naming.NameNotFoundException: microsoft_sql_Aurora_aurora_userPool not
found]

at
com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:518)

at
com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:455)

at javax.naming.InitialContext.lookup(InitialContext.java:392)

at javax.naming.InitialContext.lookup(InitialContext.java:392)

at
com.sun.appserv.connectors.internal.api.ResourceNamingService.lookup(ResourceNamingService.java:223)

at
com.sun.enterprise.connectors.service.ConnectorConnectionPoolAdminServiceImpl.getConnectorConnectionPool(ConnectorConnectionPoolAdminServiceImpl.java:872)

at
com.sun.enterprise.connectors.service.ConnectorConnectionPoolAdminServiceImpl.obtainManagedConnectionFactory(ConnectorConnectionPoolAdminServiceImpl.java:1005)

... 105 more

Caused by: javax.naming.NameNotFoundException:
microsoft_sql_Aurora_aurora_userPool not found

at
com.sun.enterprise.naming.impl.TransientContext.doLookup(TransientContext.java:248)

at
com.sun.enterprise.naming.impl.TransientContext.lookup(TransientContext.java:215)

at
com.sun.enterprise.naming.impl.TransientContext.lookup(TransientContext.java:219)

at
com.sun.enterprise.naming.impl.TransientContext.lookup(TransientContext.java:219)

at
com.sun.enterprise.naming.impl.SerialContextProviderImpl.lookup(SerialContextProviderImpl.java:77)

at
com.sun.enterprise.naming.impl.LocalSerialContextProviderImpl.lookup(LocalSerialContextProviderImpl.java:119)

at
com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:505)

 


--
[Message sent by forum member 'ido_ran']
View Post: http://forums.java.net/node/850230