[GLASSFISH-21541] Duplicate Class Error when Undeploying/Redeploying Web App Created: 11/May/16  Updated: 11/May/16

Status: Open
Project: glassfish
Component/s: admin_gui, jdbc
Affects Version/s: 4.1, 4.1.1
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: seaunicornislit Assignee: Anissa Lam
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Java, Netbeans


Tags: ear, ejb, svnkit

 Description   

When I try to undeploy/redeploy my Web Application in the Glassfish Admin GUI I receive an error: java.lang.LinkageError: loader (instance of org/glassfish/web/loader/WebappClassLoader): attempted duplicate class definition for name: "org/glassfish/web/loader/JdbcLeakPrevention" (I will put the full stack trace at the very bottom). It may have something to do with SVNKit.

Exception while running a command
java.lang.LinkageError: loader (instance of org/glassfish/web/loader/WebappClassLoader): attempted duplicate class definition for name: "org/glassfish/web/loader/JdbcLeakPrevention"
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at org.glassfish.web.loader.WebappClassLoader.clearReferencesJdbc(WebappClassLoader.java:2121)
at org.glassfish.web.loader.WebappClassLoader.clearReferences(WebappClassLoader.java:2056)
at org.glassfish.web.loader.WebappClassLoader.stop(WebappClassLoader.java:1960)
at org.glassfish.web.loader.WebappClassLoader.preDestroy(WebappClassLoader.java:1929)
at org.glassfish.internal.data.ApplicationInfo.clean(ApplicationInfo.java:465)
at com.sun.enterprise.v3.server.ApplicationLifecycle.unload(ApplicationLifecycle.java:1071)
at com.sun.enterprise.v3.server.ApplicationLifecycle.undeploy(ApplicationLifecycle.java:1099)
at org.glassfish.deployment.admin.UndeployCommand.execute(UndeployCommand.java:412)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:539)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:535)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Unknown Source)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:534)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:565)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:557)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Unknown Source)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:556)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1464)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:109)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1846)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1722)
at org.glassfish.deployment.admin.DeployCommand.handleRedeploy(DeployCommand.java:724)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:365)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:539)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:535)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Unknown Source)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:534)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:565)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:557)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Unknown Source)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:556)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1464)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:109)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1846)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1722)
at org.glassfish.admin.rest.utils.ResourceUtil.runCommand(ResourceUtil.java:253)
at org.glassfish.admin.rest.utils.ResourceUtil.runCommand(ResourceUtil.java:231)
at org.glassfish.admin.rest.utils.ResourceUtil.runCommand(ResourceUtil.java:275)
at org.glassfish.admin.rest.resources.TemplateListOfResource.createResource(TemplateListOfResource.java:133)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:160)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:309)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:292)
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1139)
at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:375)
at org.glassfish.admin.rest.adapter.RestAdapter$2.service(RestAdapter.java:316)
at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:179)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:206)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:180)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:283)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:132)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:111)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:536)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:591)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:571)
at java.lang.Thread.run(Unknown Source)






[GLASSFISH-21536] NPE at "org.glassfish.api.jdbc.SQLTraceRecord.toString(SQLTraceRecord.java:231)" Created: 15/Apr/16  Updated: 15/Apr/16

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: 4.1.1
Fix Version/s: None

Type: Bug Priority: Critical
Reporter: cistox Assignee: sfelts
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Any



 Description   

The following code generates a NPE:
Class: SQLTraceRecord.java
Reason: The "param.toString()" is unsafe because it is quite normal that an SQL UPDATE provides a NULL param to force a NULL value in a given database table column.
As this is a trace the null should be simply printed as string "null".

@Override
public String toString() {
StringBuffer sb = new StringBuffer();
sb.append("ThreadID=" + getThreadID() + " | ");
sb.append("ThreadName=" + getThreadName() + " | ");
sb.append("TimeStamp=" + getTimeStamp() + " | ");
sb.append("ClassName=" + getClassName() + " | ");
sb.append("MethodName=" + getMethodName() + " | ");
if(params != null && params.length > 0) {
int index = 0;
for(Object param : params)

{ sb.append("arg[" + index++ + "]=" + param.toString() + " | "); // ERROR IS HERE }

}
//TODO add poolNames and other fields of this record.
return sb.toString();
}

This is the NPE trace:

Severe: java.lang.NullPointerException
at org.glassfish.api.jdbc.SQLTraceRecord.toString(SQLTraceRecord.java:231)
at com.sun.gjc.util.SQLTraceLogger.sqlTrace(SQLTraceLogger.java:69)
at com.sun.gjc.util.SQLTraceDelegator.sqlTrace(SQLTraceDelegator.java:94)
at com.sun.gjc.spi.JdbcObjectsFactory$1.invoke(JdbcObjectsFactory.java:142)
at com.sun.proxy.$Proxy244.prepareStatement(Unknown Source)






[GLASSFISH-21483] "Connection closed" ConnectionHolder.checkValidity Created: 14/Jan/16  Updated: 14/Jan/16

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: 3.1.2, 3.1.2.2, 4.1
Fix Version/s: None

Type: Bug Priority: Major
Reporter: joyli Assignee: sfelts
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

We have problem,used the prepareStatement database connection to get the getMetaData,
“Initial and Minimum Pool Size:” 、“Maximum Pool Size:” and “Statement Cache Size:” are 1,
code:
DataSource dn = (DataSource) initContext.lookup("DB");
Connection ccon = dn.getConnection();
PrepareStatement pstam = ccon.prepareStatement(sql);
ResultSet rs = pstam.executeQuery();
pstam.getConnection().getMetaData();

the concurrent situation,appear:
java.sql.SQLException: Connection closed
at com.sun.gjc.spi.base.ConnectionHolder.checkValidity(ConnectionHolder.java:774)
at com.sun.gjc.spi.base.ConnectionHolder.getMetaData(ConnectionHolder.java:388)
at com.sun.gjc.spi.jdbc40.ConnectionWrapper40.getMetaData(ConnectionWrapper40.java:114)
at jdbc1.Servese1.serverdd(Servese1.java:122)
at jdbc1.Servese1.doGet(Servese1.java:58)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:286)
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 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:336)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:236)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
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:619)






[GLASSFISH-21456] javax.naming.NameNotFoundException: jdbc Created: 30/Oct/15  Updated: 30/Oct/15

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: 4.1
Fix Version/s: None

Type: Bug Priority: Major
Reporter: jroberts66z Assignee: sfelts
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Mac OSX, Java 1.8



 Description   

Hi, I have a web application written in Netbeans that does a JNDI lookup of jdbc/SomeName and it works fine in GF 4.1 when using jvm 1.7.

When I switch GF to use jvm 1.8 I encounter the following stack trace:

2015-10-29 20:29:10,312-ERROR-[RunLevelControllerThread-1446164949966]-[DBAuthenticator.java:56]-com.ge.de.security.authentication.implementation.database.DBAuthenticator.setProperties: javax.naming.NamingException: Lookup failed for 'jdbc/CDBDataSource' 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: jdbc]
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:491)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:438)
at javax.naming.InitialContext.lookup(InitialContext.java:417)
at javax.naming.InitialContext.lookup(InitialContext.java:417)
at com.ge.de.cnms.db.jndi.JNDIDataSourceFactory.getDataSource(JNDIDataSourceFactory.java:159)



 Comments   
Comment by jroberts66z [ 30/Oct/15 ]

Per what I know about JNDI lookups, it should have worked just fine in 1.8, so I am assuming this is a bug in GF. The Web application is using <class-loader delegate="false"/> in glassfish-web.xml and the JARs inside the lib directory are:

WEB-INF/lib/CoverityWS.jar
WEB-INF/lib/activation-1.1.jar
WEB-INF/lib/all-themes-1.0.10.jar
WEB-INF/lib/cnms-dao.jar
WEB-INF/lib/cnms-db.jar
WEB-INF/lib/cnms-entity.jar
WEB-INF/lib/cnms-transaction.jar
WEB-INF/lib/cnms-util.jar
WEB-INF/lib/com.ge.de.authenticator.jar
WEB-INF/lib/com.ge.de.cov.reports.jar
WEB-INF/lib/com.ge.de.email.jar
WEB-INF/lib/com.ge.de.entity.jar
WEB-INF/lib/commons-codec-1.2.jar
WEB-INF/lib/commons-dbcp-1.4.jar
WEB-INF/lib/commons-digester-1.8.jar
WEB-INF/lib/commons-fileupload-1.2.jar
WEB-INF/lib/commons-httpclient-3.1.jar
WEB-INF/lib/commons-io-1.4.jar
WEB-INF/lib/commons-lang-2.3.jar
WEB-INF/lib/commons-logging-1.1.jar
WEB-INF/lib/commons-pool-1.5.5.jar
WEB-INF/lib/esapi-2.1.0.jar
WEB-INF/lib/fscontext.jar
WEB-INF/lib/jcommon-1.0.23.jar
WEB-INF/lib/jfreechart-1.0.19.jar
WEB-INF/lib/jndi.jar
WEB-INF/lib/log4j-1.2.16.jar
WEB-INF/lib/mail-1.4.jar
WEB-INF/lib/omnifaces-1.11.jar
WEB-INF/lib/primefaces-5.2.jar
WEB-INF/lib/providerutil.jar
WEB-INF/lib/quartz-2.2.1.jar
WEB-INF/lib/quartz-jobs-2.2.1.jar
WEB-INF/lib/slf4j-api-1.6.6.jar
WEB-INF/lib/slf4j-log4j12-1.6.6.jar
WEB-INF/lib/xchart-2.4.3.jar

There are also the following JAR files in domains/domain1/lib directory:

rw-rr- 1 carlroberts staff 15032 Oct 29 18:45 ../domains/domain1/lib/DatabaseRealm.jar
rw-rr- 1 carlroberts staff 39945 Oct 29 18:45 ../domains/domain1/lib/cnms-dao.jar
rw-rr- 1 carlroberts staff 44052 Oct 29 18:45 ../domains/domain1/lib/cnms-db.jar
rw-rr- 1 carlroberts staff 4774 Oct 29 18:45 ../domains/domain1/lib/cnms-entity.jar
rw-rr- 1 carlroberts staff 16725 Oct 29 18:45 ../domains/domain1/lib/cnms-transaction.jar
rw-rr- 1 carlroberts staff 61395 Oct 29 18:45 ../domains/domain1/lib/cnms-util.jar
rw-rr- 1 carlroberts staff 54932 Oct 29 18:45 ../domains/domain1/lib/com.ge.de.authenticator.jar
rw-rr- 1 carlroberts staff 138433 Oct 29 18:45 ../domains/domain1/lib/com.ge.de.entity.jar
rw-rr- 1 carlroberts staff 30085 Oct 29 18:45 ../domains/domain1/lib/commons-codec-1.2.jar
rw-rr- 1 carlroberts staff 571259 Oct 29 18:45 ../domains/domain1/lib/commons-collections-3.2.jar
-rwxr-xr-x 1 carlroberts staff 160519 Oct 29 18:45 ../domains/domain1/lib/commons-dbcp-1.4.jar
rw-rr- 1 carlroberts staff 143602 Oct 29 18:45 ../domains/domain1/lib/commons-digester-1.8.jar
rw-rr- 1 carlroberts staff 53082 Oct 29 18:45 ../domains/domain1/lib/commons-fileupload-1.2.jar
rw-rr- 1 carlroberts staff 305001 Oct 29 18:45 ../domains/domain1/lib/commons-httpclient-3.1.jar
rw-rr- 1 carlroberts staff 245274 Oct 29 18:45 ../domains/domain1/lib/commons-lang-2.3.jar
rw-rr- 1 carlroberts staff 52915 Oct 29 18:45 ../domains/domain1/lib/commons-logging-1.1.jar
-rwxr-xr-x 1 carlroberts staff 100193 Oct 29 18:45 ../domains/domain1/lib/commons-pool-1.5.5.jar
rw-rr- 1 carlroberts staff 367021 Oct 29 18:45 ../domains/domain1/lib/esapi-2.1.0.jar
-rwxr-xr-x 1 carlroberts staff 22769 Oct 29 18:45 ../domains/domain1/lib/fscontext.jar
-rwxr-xr-x 1 carlroberts staff 98496 Oct 29 18:45 ../domains/domain1/lib/jndi.jar
rw-rr- 1 carlroberts staff 481534 Oct 29 18:45 ../domains/domain1/lib/log4j-1.2.16.jar
rw-rr- 1 carlroberts staff 968670 Oct 29 18:45 ../domains/domain1/lib/mysql-connector-java-5.1.35-bin.jar
-rwxr-xr-x 1 carlroberts staff 77116 Oct 29 18:45 ../domains/domain1/lib/providerutil.jar





[GLASSFISH-21361] java.util.ConcurrentModificationException is thrown when using JDBC pool with associate-with-thread option turned on (AssocWithThreadResourcePool pool class). Created: 20/May/15  Updated: 20/May/15

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: 4.0, 4.1
Fix Version/s: None

Type: Bug Priority: Major
Reporter: jiggster Assignee: sfelts
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

SunOS 5.11 11.2 sun4v sparc sun4v


Tags: jdbc

 Description   

We observe, from time to time, the below stack trace in our application's log file when our system is under heavy load. Our short investigation of the problem lead us to conclusion that its root cause lies in insufficient synchronization of ds field in class AssocWithThreadResourcePool. Below is the snippet from the mentioned class where the problem occurs.

Caused by: java.util.ConcurrentModificationException: null
        at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:901) ~[na:1.8.0_40]
        at java.util.ArrayList$Itr.next(ArrayList.java:851) ~[na:1.8.0_40]
        at com.sun.enterprise.resource.pool.AssocWithThreadResourcePool.getUnenlistedResource(AssocWithThreadResourcePool.java:225) ~[connectors-runtime.jar:na]
        at com.sun.enterprise.resource.pool.ConnectionPool.internalGetResource(ConnectionPool.java:526) ~[connectors-runtime.jar:na]
        at com.sun.enterprise.resource.pool.ConnectionPool.getResource(ConnectionPool.java:381) ~[connectors-runtime.jar:na]
        at com.sun.enterprise.resource.pool.PoolManagerImpl.getResourceFromPool(PoolManagerImpl.java:245) ~[connectors-runtime.jar:na]
        at com.sun.enterprise.resource.pool.PoolManagerImpl.getResource(PoolManagerImpl.java:170) ~[connectors-runtime.jar:na]
        at com.sun.enterprise.connectors.ConnectionManagerImpl.getResource(ConnectionManagerImpl.java:354) ~[connectors-runtime.jar:na]
        at com.sun.enterprise.connectors.ConnectionManagerImpl.internalGetConnection(ConnectionManagerImpl.java:307) ~[connectors-runtime.jar:na]
        at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:196) ~[connectors-runtime.jar:na]
        at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:171) ~[connectors-runtime.jar:na]
        at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:166) ~[connectors-runtime.jar:na]
        at com.sun.gjc.spi.base.AbstractDataSource.getConnection(AbstractDataSource.java:114) ~[__ds_jdbc_ra.jar:na]
        at org.eclipse.persistence.sessions.JNDIConnector.connect(JNDIConnector.java:135) ~[org.eclipse.persistence.core_2.6.0.v20150309-bf26070.jar:na]
        at org.eclipse.persistence.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:162) ~[org.eclipse.persistence.core_2.6.0.v20150309-bf26070.jar:na]
        at org.eclipse.persistence.internal.databaseaccess.DatasourceAccessor.connectInternal(DatasourceAccessor.java:346) ~[org.eclipse.persistence.core_2.6.0.v20150309-bf26070.jar:na]
        at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.connectInternal(DatabaseAccessor.java:309) ~[org.eclipse.persistence.core_2.6.0.v20150309-bf26070.jar:na]
        at org.eclipse.persistence.internal.databaseaccess.DatasourceAccessor.reconnect(DatasourceAccessor.java:581) ~[org.eclipse.persistence.core_2.6.0.v20150309-bf26070.jar:na]
        at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.reconnect(DatabaseAccessor.java:1634) ~[org.eclipse.persistence.core_2.6.0.v20150309-bf26070.jar:na]
        at org.eclipse.persistence.internal.databaseaccess.DatasourceAccessor.incrementCallCount(DatasourceAccessor.java:321) ~[org.eclipse.persistence.core_2.6.0.v20150309-bf26070.jar:na]
        at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:615) ~[org.eclipse.persistence.core_2.6.0.v20150309-bf26070.jar:na]
        at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:560) ~[org.eclipse.persistence.core_2.6.0.v20150309-bf26070.jar:na]
        at org.eclipse.persistence.internal.sessions.AbstractSession.basicExecuteCall(AbstractSession.java:2055) ~[org.eclipse.persistence.core_2.6.0.v20150309-bf26070.jar:na]
        at org.eclipse.persistence.sessions.server.ServerSession.executeCall(ServerSession.java:570) ~[org.eclipse.persistence.core_2.6.0.v20150309-bf26070.jar:na]
        at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:242) ~[org.eclipse.persistence.core_2.6.0.v20150309-bf26070.jar:na]
        at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:228) ~[org.eclipse.persistence.core_2.6.0.v20150309-bf26070.jar:na]
        at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeSelectCall(DatasourceCallQueryMechanism.java:299) ~[org.eclipse.persistence.core_2.6.0.v20150309-bf26070.jar:na]
        at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.selectAllRows(DatasourceCallQueryMechanism.java:694) ~[org.eclipse.persistence.core_2.6.0.v20150309-bf26070.jar:na]
        at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectAllRowsFromTable(ExpressionQueryMechanism.java:2740) ~[org.eclipse.persistence.core_2.6.0.v20150309-bf26070.jar:na]
        at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectAllReportQueryRows(ExpressionQueryMechanism.java:2677) ~[org.eclipse.persistence.core_2.6.0.v20150309-bf26070.jar:na]
        at org.eclipse.persistence.queries.ReportQuery.executeDatabaseQuery(ReportQuery.java:852) ~[org.eclipse.persistence.core_2.6.0.v20150309-bf26070.jar:na]
        at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:904) ~[org.eclipse.persistence.core_2.6.0.v20150309-bf26070.jar:na]
        at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:1132) ~[org.eclipse.persistence.core_2.6.0.v20150309-bf26070.jar:na]
        at org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAllQuery.java:442) ~[org.eclipse.persistence.core_2.6.0.v20150309-bf26070.jar:na]
        at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:1220) ~[org.eclipse.persistence.core_2.6.0.v20150309-bf26070.jar:na]
        at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2896) ~[org.eclipse.persistence.core_2.6.0.v20150309-bf26070.jar:na]
        at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1857) ~[org.eclipse.persistence.core_2.6.0.v20150309-bf26070.jar:na]
        at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1839) ~[org.eclipse.persistence.core_2.6.0.v20150309-bf26070.jar:na]
        at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1804) ~[org.eclipse.persistence.core_2.6.0.v20150309-bf26070.jar:na]
        at org.eclipse.persistence.internal.jpa.QueryImpl.executeReadQuery(QueryImpl.java:258) ~[org.eclipse.persistence.jpa_2.6.0.v20150309-bf26070.jar:na]
        at org.eclipse.persistence.internal.jpa.QueryImpl.getSingleResult(QueryImpl.java:521) ~[org.eclipse.persistence.jpa_2.6.0.v20150309-bf26070.jar:na]
        ... 68 common frames omitted
AssocWithThreadResourcePool.java
//DISASSOCIATE
if (result == null) {
  synchronized (this) {

    for (ResourceHandle resource : ds.getAllResources()) {
      synchronized (resource.lock) {
        //though we are checking resources from within the free list,
        //we could have a situation where the resource was free upto
        //this point, put just before we entered the synchronized block,
        //the resource "h" got used by the thread that was associating it
        //so we need to check for isFree also

        if (resource.getResourceState().isUnenlisted() &&
          resource.getResourceState().isFree() &&
          !(((AssocWithThreadResourceHandle) resource).isDirty())) {
          if (!matchConnection(resource, alloc)) {
            continue;
          }

          if (resource.hasConnectionErrorOccurred()) {
            continue;
          }
          result = resource;
          setResourceStateToBusy(result);
          ((AssocWithThreadResourceHandle) result).setAssociated(false);

          break;
        }
      }
    }
  }
}





[GLASSFISH-21078] Connection pool throws IllegalStateException Created: 30/May/14  Updated: 31/May/14

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: 3.1.2_b23
Fix Version/s: None

Type: Bug Priority: Major
Reporter: emailnbw Assignee: sfelts
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Glassfish 3.1.2 b23 / Windows Server 2008 R2 x64 / JDK1.7.0_45 x64 / Oracle 11gr2 / Oracle ojdbc6 driver


Tags: connectionpool

 Description   

I am getting the following exception from Glassfish's connection pool code:

Caused by: java.lang.IllegalStateException: state.isBusy() : false
at com.sun.enterprise.resource.pool.ConnectionPool.resourceClosed(ConnectionPool.java:1008)
at com.sun.enterprise.resource.pool.PoolManagerImpl.putbackResourceToPool(PoolManagerImpl.java:428)
at com.sun.enterprise.resource.pool.PoolManagerImpl.resourceClosed(PoolManagerImpl.java:382)
at com.sun.enterprise.resource.listener.LocalTxConnectionEventListener.connectionClosed(LocalTxConnectionEventListener.java:77)
at com.sun.gjc.spi.ManagedConnection.connectionClosed(ManagedConnection.java:784)
at com.sun.gjc.spi.base.ConnectionHolder.close(ConnectionHolder.java:217)
at com.sun.gjc.spi.jdbc40.ConnectionHolder40.close(ConnectionHolder40.java:587)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.closeDatasourceConnection(DatabaseAccessor.java:473)
at org.eclipse.persistence.internal.databaseaccess.DatasourceAccessor.closeConnection(DatasourceAccessor.java:504)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.closeConnection(DatabaseAccessor.java:496)
at org.eclipse.persistence.internal.databaseaccess.DatasourceAccessor.decrementCallCount(DatasourceAccessor.java:274)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.closeStatement(DatabaseAccessor.java:394)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.releaseStatement(DatabaseAccessor.java:1543)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:665)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:535)
at org.eclipse.persistence.internal.sessions.AbstractSession.basicExecuteCall(AbstractSession.java:1717)
at org.eclipse.persistence.sessions.server.ServerSession.executeCall(ServerSession.java:566)
at org.eclipse.persistence.sessions.server.ClientSession.executeCall(ClientSession.java:207)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:207)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:193)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeSelectCall(DatasourceCallQueryMechanism.java:264)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeSelect(DatasourceCallQueryMechanism.java:246)
at org.eclipse.persistence.queries.DataReadQuery.executeNonCursor(DataReadQuery.java:197)
at org.eclipse.persistence.queries.DataReadQuery.executeDatabaseQuery(DataReadQuery.java:152)
at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:844)
at org.eclipse.persistence.queries.DataReadQuery.execute(DataReadQuery.java:137)
at org.eclipse.persistence.internal.sessions.AbstractSession.internalExecuteQuery(AbstractSession.java:2831)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1516)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1498)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1449)
at org.eclipse.persistence.sequencing.QuerySequence.select(QuerySequence.java:309)
at org.eclipse.persistence.sequencing.QuerySequence.updateAndSelectSequence(QuerySequence.java:254)
at org.eclipse.persistence.sequencing.StandardSequence.getGeneratedVector(StandardSequence.java:71)
at org.eclipse.persistence.sequencing.Sequence.getGeneratedVector(Sequence.java:257)
at org.eclipse.persistence.internal.sequencing.SequencingManager$Preallocation_NoTransaction_State.getNextValue(SequencingManager.java:664)
at org.eclipse.persistence.internal.sequencing.SequencingManager.getNextValue(SequencingManager.java:1067)
at org.eclipse.persistence.internal.sequencing.ClientSessionSequencing.getNextValue(ClientSessionSequencing.java:70)
at org.eclipse.persistence.internal.descriptors.ObjectBuilder.assignSequenceNumber(ObjectBuilder.java:349)
at org.eclipse.persistence.internal.descriptors.ObjectBuilder.assignSequenceNumber(ObjectBuilder.java:308)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.assignSequenceNumber(UnitOfWorkImpl.java:465)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.registerNotRegisteredNewObjectForPersist(UnitOfWorkImpl.java:4231)
at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.registerNotRegisteredNewObjectForPersist(RepeatableWriteUnitOfWork.java:513)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.registerNewObjectForPersist(UnitOfWorkImpl.java:4176)
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.persist(EntityManagerImpl.java:440)
at com.sun.enterprise.container.common.impl.EntityManagerWrapper.persist(EntityManagerWrapper.java:269)



 Comments   
Comment by emailnbw [ 30/May/14 ]

I don't see where I can upload a file as I'd like to upload my connection pool settings so I'll just paste them in here. Hopefully they are readable.

<jdbc-connection-pool validation-table-name="TABLEVALIDATION" allow-non-component-callers="true" statement-cache-size="200" associate-with-thread="true" statement-timeout-in-seconds="300" idle-timeout-in-seconds="0" lazy-connection-association="true" max-wait-time-in-millis="0" connection-creation-retry-attempts="90" validate-atmost-once-period-in-seconds="120" lazy-connection-enlistment="true" datasource-classname="oracle.jdbc.pool.OracleDataSource" res-type="javax.sql.DataSource" name="FooPool" is-connection-validation-required="true">
<property name="DataSourceName" value="OracleDataSource"></property>
<property name="ImplicitCachingEnabled" value="false"></property>
<property name="NetworkProtocol" value="tcp"></property>
<property name="DatabaseName" value="foo"></property>
<property name="LoginTimeout" value="0"></property>
<property name="Password" value="password"></property>
<property name="URL" value="jdbc:oracle:thin:@host:1521:orcl"></property>
<property name="User" value="bar"></property>
<property name="ExplicitCachingEnabled" value="false"></property>
<property name="PortNumber" value="1521"></property>
<property name="dynamic-reconfiguration-wait-timeout-in-seconds" value="960"></property>
<property name="MaxStatements" value="0"></property>
</jdbc-connection-pool>





[GLASSFISH-21051] ConnectionPoolEmitterImpl is not thread safe. Misuse of HashMap (resourceAppAssociationMap) Created: 25/Apr/14  Updated: 03/Jun/14

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: 3.1.2.2
Fix Version/s: None

Type: Bug Priority: Major
Reporter: syangjava Assignee: Jagadish
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: 3 hours
Time Spent: Not Specified
Original Estimate: 3 hours
Environment:

REDHAT Linux 6


Tags: 4_0_1-reviewed

 Description   

We configured max thread pool size to be 150 in glassfish 3.1.2.2. We noticed most thread were blocked after a while, and there was an exception like this: 'java.util.concurrent.RejectedExecutionException: The thread pool's task queue is full, limit: 4096'. We did thread dump analysis and heapdump analysis. There were a couple of threads in runnable state with stacktrace like this:

(first thread)
"connector-timer-proxy" daemon prio=5 tid=69 RUNNABLE
at java.util.HashMap.removeEntryForKey(HashMap.java:569)
Local Variable: java.util.HashMap$Entry#3068822
Local Variable: java.util.HashMap$Entry#2436928
at java.util.HashMap.remove(HashMap.java:538)
Local Variable: java.util.HashMap#166939
Local Variable: java.lang.Long#267315
at com.sun.enterprise.resource.pool.monitor.ConnectionPoolEmitterImpl.connectionDestroyed(ConnectionPoolEmitterImpl.java:184)
Local Variable: com.sun.enterprise.resource.pool.monitor.ConnectionPoolEmitterImpl#1
at com.sun.enterprise.resource.pool.PoolLifeCycleListenerRegistry.connectionDestroyed(PoolLifeCycleListenerRegistry.java:151)
Local Variable: java.util.AbstractList$Itr#106505
at com.sun.enterprise.resource.pool.ConnectionPool.deleteResource(ConnectionPool.java:974)
at com.sun.enterprise.resource.pool.datastructure.RWLockDataStructure.removeResource(RWLockDataStructure.java:153)
Local Variable: com.sun.enterprise.resource.pool.datastructure.RWLockDataStructure#1
at com.sun.enterprise.resource.pool.ConnectionPool.reclaimConnection(ConnectionPool.java:1643)
Local Variable: java.lang.String#1077104
at com.sun.enterprise.resource.pool.ConnectionLeakDetector.potentialConnectionLeakFound(ConnectionLeakDetector.java:161)
Local Variable: java.lang.StackTraceElement[]#2777
Local Variable: com.sun.enterprise.resource.pool.ConnectionPool#1
at com.sun.enterprise.resource.pool.ConnectionLeakDetector.access$000(ConnectionLeakDetector.java:60)
Local Variable: com.sun.enterprise.resource.ResourceHandle#88
Local Variable: com.sun.enterprise.resource.pool.ConnectionLeakDetector#1
at com.sun.enterprise.resource.pool.ConnectionLeakDetector$ConnectionLeakTask.run(ConnectionLeakDetector.java:222)
Local Variable: com.sun.enterprise.resource.pool.ConnectionLeakDetector$ConnectionLeakTask#1
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)

(second thread)
"http-thread-pool-8009(56)" daemon prio=5 tid=296 RUNNABLE
at java.util.HashMap.transfer(HashMap.java:484)
Local Variable: java.util.HashMap$Entry#3402865
at java.util.HashMap.resize(HashMap.java:463)
Local Variable: java.util.HashMap$Entry[]#800390
at java.util.HashMap.addEntry(HashMap.java:755)
at java.util.HashMap.put(HashMap.java:385)
at com.sun.enterprise.resource.pool.monitor.ConnectionPoolEmitterImpl.getAppName(ConnectionPoolEmitterImpl.java:320)
at com.sun.enterprise.resource.pool.monitor.ConnectionPoolEmitterImpl.connectionUsed(ConnectionPoolEmitterImpl.java:234)
at com.sun.enterprise.resource.pool.PoolLifeCycleListenerRegistry.connectionUsed(PoolLifeCycleListenerRegistry.java:145)
Local Variable: java.util.AbstractList$Itr#106556
at com.sun.enterprise.resource.pool.ConnectionPool.internalGetResource(ConnectionPool.java:532)
Local Variable: com.sun.enterprise.resource.ResourceHandle#377
at com.sun.enterprise.resource.pool.ConnectionPool.getResource(ConnectionPool.java:381)
Local Variable: com.sun.enterprise.resource.allocator.LocalTxConnectorAllocator#166
at com.sun.enterprise.resource.pool.PoolManagerImpl.getResourceFromPool(PoolManagerImpl.java:245)
at com.sun.enterprise.resource.pool.PoolManagerImpl.getResource(PoolManagerImpl.java:170)
Local Variable: com.sun.enterprise.resource.ResourceSpec#504
at com.sun.enterprise.connectors.ConnectionManagerImpl.getResource(ConnectionManagerImpl.java:338)
at com.sun.enterprise.connectors.ConnectionManagerImpl.internalGetConnection(ConnectionManagerImpl.java:301)
at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:190)
at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:165)
at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:160)
at com.sun.gjc.spi.base.DataSource.getConnection(DataSource.java:113)

(third thread)
"http-thread-pool-8009(138)" daemon prio=5 tid=378 RUNNABLE
at java.util.HashMap.get(HashMap.java:303)
Local Variable: java.lang.Long#267316
at com.sun.enterprise.resource.pool.monitor.ConnectionPoolEmitterImpl.getAppName(ConnectionPoolEmitterImpl.java:313)
at com.sun.enterprise.resource.pool.monitor.ConnectionPoolEmitterImpl.connectionUsed(ConnectionPoolEmitterImpl.java:234)
at com.sun.enterprise.resource.pool.PoolLifeCycleListenerRegistry.connectionUsed(PoolLifeCycleListenerRegistry.java:145)
Local Variable: java.util.AbstractList$Itr#106506
at com.sun.enterprise.resource.pool.ConnectionPool.internalGetResource(ConnectionPool.java:532)
at com.sun.enterprise.resource.pool.ConnectionPool.getResource(ConnectionPool.java:381)
Local Variable: com.sun.enterprise.resource.allocator.LocalTxConnectorAllocator#79
at com.sun.enterprise.resource.pool.PoolManagerImpl.getResourceFromPool(PoolManagerImpl.java:245)
at com.sun.enterprise.resource.pool.PoolManagerImpl.getResource(PoolManagerImpl.java:170)
Local Variable: com.sun.enterprise.resource.ResourceSpec#96
at com.sun.enterprise.connectors.ConnectionManagerImpl.getResource(ConnectionManagerImpl.java:338)
at com.sun.enterprise.connectors.ConnectionManagerImpl.internalGetConnection(ConnectionManagerImpl.java:301)
at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:190)
at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:165)
at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:160)
at com.sun.gjc.spi.base.DataSource.getConnection(DataSource.java:113)

(fourth thread)
"http-thread-pool-8009(11)" daemon prio=5 tid=251 RUNNABLE
at java.util.HashMap.transfer(HashMap.java:484)
Local Variable: java.util.HashMap$Entry[]#943178
Local Variable: java.util.HashMap$Entry#3075959
at java.util.HashMap.resize(HashMap.java:463)
Local Variable: java.util.HashMap$Entry[]#1092899
at java.util.HashMap.addEntry(HashMap.java:755)
at java.util.HashMap.put(HashMap.java:385)
at com.sun.enterprise.resource.pool.monitor.ConnectionPoolEmitterImpl.getAppName(ConnectionPoolEmitterImpl.java:320)
Local Variable: java.lang.String#1256767
at com.sun.enterprise.resource.pool.monitor.ConnectionPoolEmitterImpl.connectionUsed(ConnectionPoolEmitterImpl.java:234)
at com.sun.enterprise.resource.pool.PoolLifeCycleListenerRegistry.connectionUsed(PoolLifeCycleListenerRegistry.java:145)
Local Variable: java.util.AbstractList$Itr#106557
at com.sun.enterprise.resource.pool.ConnectionPool.internalGetResource(ConnectionPool.java:532)
Local Variable: com.sun.enterprise.resource.ResourceHandle#351
at com.sun.enterprise.resource.pool.ConnectionPool.getResource(ConnectionPool.java:381)
Local Variable: com.sun.enterprise.resource.allocator.LocalTxConnectorAllocator#165
at com.sun.enterprise.resource.pool.PoolManagerImpl.getResourceFromPool(PoolManagerImpl.java:245)
at com.sun.enterprise.resource.pool.PoolManagerImpl.getResource(PoolManagerImpl.java:170)
Local Variable: com.sun.enterprise.resource.ResourceSpec#503
at com.sun.enterprise.connectors.ConnectionManagerImpl.getResource(ConnectionManagerImpl.java:338)
at com.sun.enterprise.connectors.ConnectionManagerImpl.internalGetConnection(ConnectionManagerImpl.java:301)
at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:190)
at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:165)
at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:160)
at com.sun.gjc.spi.base.DataSource.getConnection(DataSource.java:113)

The CPU usage was way higher than normal. And all blocked threads were blocked on the same java lock and the same line of code. The following is an example.

"http-thread-pool-8009(96)" daemon prio=5 tid=336 BLOCKED
at com.sun.enterprise.resource.pool.ConnectionLeakDetector.startConnectionLeakTracing(ConnectionLeakDetector.java:113)
at com.sun.enterprise.resource.pool.ConnectionPool.setResourceStateToBusy(ConnectionPool.java:324)

Basically all 3 threads were running in infinite loop. The cause was the misuse of a HashMap object (resourceAppAssociationMap) in a concurrent environment in ConnectionPoolEmitterImpl. This is a related article.
http://mailinator.blogspot.com/2009/06/beautiful-race-condition.html

The fix actually should be quite easy. Just use ConcurrentHashMap instead of HashMap for resourceAppAssociationMap.

Can we get a patch soon on this?



 Comments   
Comment by reza_rahman [ 25/Apr/14 ]

Note that this is now under review for 4.0.1

Comment by syangjava [ 25/Apr/14 ]

So there is no plan to have a release after 3.1.2.2?

Is there a way we can get a patch?

Comment by reza_rahman [ 25/Apr/14 ]

Not sure if it will be back-ported. The only way to get an individual patch is through GlassFish 3 commercial support if you have purchased it.

Comment by Jagadish [ 26/Apr/14 ]

Same as issue :
https://java.net/jira/browse/GLASSFISH-19190

Comment by syangjava [ 28/Apr/14 ]

So this problem was known in the '3.1.2_b14' release and never fixed? Is there any plan to make another glassfish 3 release soon, for example, 3.1.2.3 with this fix?

Comment by reza_rahman [ 28/Apr/14 ]

As you may be aware, we are currently very focused on GlassFish 4.0.1. Although a further GlassFish 3 release may happen, it's not currently in planning that I know of. If this is a critical production issue that needs to be addressed quickly your best bet is really talking to your Oracle sales rep or perhaps patching it yourself?

Comment by syangjava [ 28/Apr/14 ]

We think it is possible we can patch this ourselves. Is there any legal restrictions on this?

Comment by reza_rahman [ 28/Apr/14 ]

I would just review the CDDL/licensing terms that should be very lightweight and well understood in your case? BTW, the safest bet is probably just contributing the patch back.





[GLASSFISH-20961] Closed Connection Created: 21/Jan/14  Updated: 15/Apr/14

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: 3.1.2.2
Fix Version/s: None

Type: Bug Priority: Major
Reporter: rkatkuri Assignee: sfelts
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows Server 2008 R2 Enterprise



 Description   

Application is crashing with out any pattern. Below is the error log

ERROR [JDBCTransaction:begin] JDBC begin failed
java.sql.SQLException: Closed Connection
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:113)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:147)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:209)
at oracle.jdbc.driver.PhysicalConnection.setAutoCommit(PhysicalConnection.java:1087)
at com.sun.gjc.spi.base.ConnectionHolder.setAutoCommit(ConnectionHolder.java:651)
at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:63)
at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1326)
at org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:558)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:374)
at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:263)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:101)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at com.sun.proxy.$Proxy140.getCustomerCredentials(Unknown Source)
at iwas.service.security.UserAuthenticationService.loadUserByUsername(Unknown Source)
at org.springframework.security.providers.dao.DaoAuthenticationProvider.retrieveUser(DaoAuthenticationProvider.java:83)
at org.springframework.security.providers.dao.AbstractUserDetailsAuthenticationProvider.authenticate(AbstractUserDetailsAuthenticationProvider.java:121)
at org.springframework.security.providers.ProviderManager.doAuthentication(ProviderManager.java:195)
at org.springframework.security.AbstractAuthenticationManager.authenticate(AbstractAuthenticationManager.java:46)
at org.springframework.security.ui.webapp.AuthenticationProcessingFilter.attemptAuthentication(AuthenticationProcessingFilter.java:81)
at org.springframework.security.ui.AbstractProcessingFilter.doFilterHttp(AbstractProcessingFilter.java:249)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
at org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:192)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
at iwas.service.security.filter.MalicousRequestFilter.doFilter(Unknown Source)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
at org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:174)
at org.springframework.security.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:99)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:807)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:671)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:505)
at org.apache.catalina.core.ApplicationDispatcher.doDispatch(ApplicationDispatcher.java:476)
at org.apache.catalina.core.ApplicationDispatcher.dispatch(ApplicationDispatcher.java:355)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:305)
at iwas.control.CustomerAuthenticationController.authentiacte(Unknown Source)
at sun.reflect.GeneratedMethodAccessor300.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.doInvokeMethod(HandlerMethodInvoker.java:421)
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:136)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:326)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:313)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:359)
at org.springframework.security.concurrent.ConcurrentSessionFilter.doFilterHttp(ConcurrentSessionFilter.java:97)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
at org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
at org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
at org.springframework.security.ui.ExceptionTranslationFilter.doFilterHttp(ExceptionTranslationFilter.java:101)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
at org.springframework.security.ui.logout.LogoutFilter.doFilterHttp(LogoutFilter.java:87)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
at org.springframework.security.ui.logout.LogoutFilter.doFilterHttp(LogoutFilter.java:87)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
at org.springframework.security.ui.AbstractProcessingFilter.doFilterHttp(AbstractProcessingFilter.java:268)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
at org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:235)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
at iwas.service.security.filter.MalicousRequestFilter.doFilter(Unknown Source)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
at org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:174)
at org.springframework.security.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:99)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
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 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
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)
2014-01-21 07:54:23,742 INFO [CustomerAuthenticationController:authentiacte] Authenticating Customer
2014-01-21 07:54:23,742 DEBUG [AbstractProcessingFilter:doFilterHttp] Request is to process authentication
2014-01-21 07:54:23,742 DEBUG [UserAuthenticationService:loadUserByUsername] loadUserByUsername(1054976)
2014-01-21 07:54:23,758 ERROR [JDBCTransaction:begin] JDBC begin failed
java.sql.SQLException: Closed Connection
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:113)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:147)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:209)
at oracle.jdbc.driver.PhysicalConnection.setAutoCommit(PhysicalConnection.java:1087)
at com.sun.gjc.spi.base.ConnectionHolder.setAutoCommit(ConnectionHolder.java:651)
at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:63)
at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1326)
at org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:558)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:374)
at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:263)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:101)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at com.sun.proxy.$Proxy140.getCustomerCredentials(Unknown Source)
at iwas.service.security.UserAuthenticationService.loadUserByUsername(Unknown Source)
at org.springframework.security.providers.dao.DaoAuthenticationProvider.retrieveUser(DaoAuthenticationProvider.java:83)
at org.springframework.security.providers.dao.AbstractUserDetailsAuthenticationProvider.authenticate(AbstractUserDetailsAuthenticationProvider.java:121)
at org.springframework.security.providers.ProviderManager.doAuthentication(ProviderManager.java:195)
at org.springframework.security.AbstractAuthenticationManager.authenticate(AbstractAuthenticationManager.java:46)
at org.springframework.security.ui.webapp.AuthenticationProcessingFilter.attemptAuthentication(AuthenticationProcessingFilter.java:81)
at org.springframework.security.ui.AbstractProcessingFilter.doFilterHttp(AbstractProcessingFilter.java:249)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
at org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:192)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
at iwas.service.security.filter.MalicousRequestFilter.doFilter(Unknown Source)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
at org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:174)
at org.springframework.security.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:99)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:807)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:671)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:505)
at org.apache.catalina.core.ApplicationDispatcher.doDispatch(ApplicationDispatcher.java:476)
at org.apache.catalina.core.ApplicationDispatcher.dispatch(ApplicationDispatcher.java:355)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:305)
at iwas.control.CustomerAuthenticationController.authentiacte(Unknown Source)
at sun.reflect.GeneratedMethodAccessor300.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.doInvokeMethod(HandlerMethodInvoker.java:421)
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:136)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:326)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:313)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:359)
at org.springframework.security.concurrent.ConcurrentSessionFilter.doFilterHttp(ConcurrentSessionFilter.java:97)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
at org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
at org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
at org.springframework.security.ui.ExceptionTranslationFilter.doFilterHttp(ExceptionTranslationFilter.java:101)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
at org.springframework.security.ui.logout.LogoutFilter.doFilterHttp(LogoutFilter.java:87)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
at org.springframework.security.ui.logout.LogoutFilter.doFilterHttp(LogoutFilter.java:87)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
at org.springframework.security.ui.AbstractProcessingFilter.doFilterHttp(AbstractProcessingFilter.java:268)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
at org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:235)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
at iwas.service.security.filter.MalicousRequestFilter.doFilter(Unknown Source)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
at org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:174)
at org.springframework.security.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:99)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
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 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
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)






[GLASSFISH-20938] GlassFish password aliases failing Created: 19/Dec/13  Updated: 19/Sep/14  Resolved: 30/Dec/13

Status: Resolved
Project: glassfish
Component/s: admin, configuration, jdbc, security
Affects Version/s: 4.0_b89_RC5
Fix Version/s: 4.1

Type: Bug Priority: Critical
Reporter: Kevin Dean Assignee: Tim Quinn
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 7 64-bit, JDK 1.7.0_45


Issue Links:
Duplicate
is duplicated by GLASSFISH-21065 Password aliasing: Some passwords not... Resolved
is duplicated by GLASSFISH-20491 Cannot login when username and passwo... Closed
Tags: 4_0_1-review

 Description   

I use the password alias feature to configure JDBC connections and other sensitive artefacts. I have just started work with GlassFish 4.0 and have found that it doesn't handle password aliases properly. It accepts them (using the GUI or create-password-alias), it accepts JDBC resources that use them (using the GUI or create-jdbc-connection-pool), but it can't use them. Any attempt to use the connection pool (e.g. through the "Ping" command) fails with "Connection could not be allocated because: Access denied for user 'ff_read_write'@'localhost' (using password: YES)]]". Once I replace the password alias with the plain-text password, everything works fine.

I turned up logging on everything security-related I could find and there's an exception logging into a file realm. See log attached.

Appears to be related to:

https://java.net/jira/browse/GLASSFISH-20675

Definitely related to:

https://java.net/jira/browse/GLASSFISH-20873



 Comments   
Comment by Kevin Dean [ 19/Dec/13 ]

[2013-12-19T17:50:57.499+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security.com.sun.enterprise.security.ssl] [tid: _ThreadID=234 _ThreadName=admin-listener(43)] [timeMillis: 1387475457499] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.ssl.J2EEKeyManager] [METHODNAME: getPrivateKey] [[
Getting private key for alias:s1as]]

[2013-12-19T17:50:57.500+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security.com.sun.enterprise.security.ssl] [tid: _ThreadID=234 _ThreadName=admin-listener(43)] [timeMillis: 1387475457500] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.ssl.J2EEKeyManager] [METHODNAME: getCertificateChain] [[
Getting certificate chain]]

[2013-12-19T17:50:57.500+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security.com.sun.enterprise.security.ssl] [tid: _ThreadID=234 _ThreadName=admin-listener(43)] [timeMillis: 1387475457500] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.ssl.J2EEKeyManager] [METHODNAME: getPrivateKey] [[
Getting private key for alias:s1as]]

[2013-12-19T17:50:57.500+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security.com.sun.enterprise.security.ssl] [tid: _ThreadID=234 _ThreadName=admin-listener(43)] [timeMillis: 1387475457500] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.ssl.J2EEKeyManager] [METHODNAME: getCertificateChain] [[
Getting certificate chain]]

[2013-12-19T17:50:57.515+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm] [tid: _ThreadID=130 _ThreadName=admin-listener(14)] [timeMillis: 1387475457515] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.auth.realm.file.FileRealm] [METHODNAME: init] [[
FileRealm : file=D:\Users\KDean\projects\FeeFracture\trunk\servers\glassfish4\glassfish\domains\feefracture\config\admin-keyfile]]

[2013-12-19T17:50:57.515+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm] [tid: _ThreadID=130 _ThreadName=admin-listener(14)] [timeMillis: 1387475457515] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.auth.realm.file.FileRealm] [METHODNAME: init] [[
FileRealm : jaas-context=ignore]]

[2013-12-19T17:50:57.516+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security.com.sun.enterprise.security] [tid: _ThreadID=130 _ThreadName=admin-listener(14)] [timeMillis: 1387475457516] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.BasePasswordLoginModule] [METHODNAME: initialize] [[
Login module initialized: class com.sun.enterprise.security.auth.login.FileLoginModule]]

[2013-12-19T17:50:57.517+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security.com.sun.enterprise.security] [tid: _ThreadID=130 _ThreadName=admin-listener(14)] [timeMillis: 1387475457517] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.auth.login.FileLoginModule] [METHODNAME: authenticate] [[
File login succeeded for: admin]]

[2013-12-19T17:50:57.517+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security.com.sun.enterprise.security] [tid: _ThreadID=130 _ThreadName=admin-listener(14)] [timeMillis: 1387475457517] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.BasePasswordLoginModule] [METHODNAME: login] [[
JAAS login complete.]]

[2013-12-19T17:50:57.517+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security.com.sun.enterprise.security] [tid: _ThreadID=130 _ThreadName=admin-listener(14)] [timeMillis: 1387475457517] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.BasePasswordLoginModule] [METHODNAME: commit] [[
JAAS authentication committed.]]

[2013-12-19T17:50:57.518+0000] [glassfish 4.0] [FINEST] [] [javax.enterprise.system.core.security.org.glassfish.security.services.impl.authorization] [tid: _ThreadID=130 _ThreadName=admin-listener(14)] [timeMillis: 1387475457518] [levelValue: 300] [CLASSNAME: org.glassfish.security.services.impl.authorization.AuthorizationServiceImpl] [METHODNAME: getAuthorizationDecision] [[
Authorization Service result for Subject:
Principal: admin
Principal: asadmin
Private Credential: Realm=admin-realm Username=admin Password=######## TargetName =
was status=OK, decision=[1].]]

[2013-12-19T17:50:58.226+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security] [tid: _ThreadID=124 _ThreadName=admin-listener(8)] [timeMillis: 1387475458226] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.web.integration.WebSecurityManager] [METHODNAME: setPolicyContext] [[
[Web-Security] Setting Policy Context ID: old = null ctxID = _admingui/_admingui]]

[2013-12-19T17:50:58.226+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security] [tid: _ThreadID=124 _ThreadName=admin-listener(8)] [timeMillis: 1387475458226] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.web.integration.WebSecurityManager] [METHODNAME: checkPermissionWithoutCache] [[
[Web-Security] Codesource with Web URL: file:/__admingui/__admingui]]

[2013-12-19T17:50:58.226+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security] [tid: _ThreadID=124 _ThreadName=admin-listener(8)] [timeMillis: 1387475458226] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.web.integration.WebSecurityManager] [METHODNAME: checkPermissionWithoutCache] [[
[Web-Security] Checking Web Permission with Principals : null]]

[2013-12-19T17:50:58.226+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security] [tid: _ThreadID=124 _ThreadName=admin-listener(8)] [timeMillis: 1387475458226] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.web.integration.WebSecurityManager] [METHODNAME: checkPermissionWithoutCache] [[
[Web-Security] Web Permission = ("javax.security.jacc.WebResourcePermission" "/jdbc/jdbcConnectionPoolEdit.jsf" "GET")]]

[2013-12-19T17:50:58.226+0000] [glassfish 4.0] [FINEST] [] [javax.enterprise.system.core.security] [tid: _ThreadID=124 _ThreadName=admin-listener(8)] [timeMillis: 1387475458226] [levelValue: 300] [CLASSNAME: com.sun.enterprise.security.provider.BasePolicyWrapper] [METHODNAME: doImplies] [[
JACC Policy Provider: PolicyWrapper.implies, context (_admingui/_admingui)- result was(false) permission (("javax.security.jacc.WebResourcePermission" "/jdbc/jdbcConnectionPoolEdit.jsf" "GET"))]]

[2013-12-19T17:50:58.226+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security.com.sun.enterprise.security.jmac.config] [tid: _ThreadID=124 _ThreadName=admin-listener(8)] [timeMillis: 1387475458226] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.jmac.config.GFServerConfigProvider] [METHODNAME: getEntry] [[
getEntry for: HttpServlet – GFConsoleAuthModule
module class: org.glassfish.admingui.common.security.AdminConsoleAuthModule
options:

{loginErrorPage=/loginError.jsf, loginPage=/login.jsf}
request policy: javax.security.auth.message.MessagePolicy@de1d100
response policy: null]]

[2013-12-19T17:50:58.226+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security] [tid: _ThreadID=124 _ThreadName=admin-listener(8)] [timeMillis: 1387475458226] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.web.integration.WebSecurityManager] [METHODNAME: setPolicyContext] [[
[Web-Security] Policy Context ID was: _admingui/_admingui]]

[2013-12-19T17:50:58.227+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security] [tid: _ThreadID=124 _ThreadName=admin-listener(8)] [timeMillis: 1387475458227] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.web.integration.WebSecurityManager] [METHODNAME: checkPermissionWithoutCache] [[
[Web-Security] Codesource with Web URL: file:/__admingui/__admingui]]

[2013-12-19T17:50:58.227+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security] [tid: _ThreadID=124 _ThreadName=admin-listener(8)] [timeMillis: 1387475458227] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.web.integration.WebSecurityManager] [METHODNAME: checkPermissionWithoutCache] [[
[Web-Security] Checking Web Permission with Principals : asadmin, admin]]

[2013-12-19T17:50:58.227+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security] [tid: _ThreadID=124 _ThreadName=admin-listener(8)] [timeMillis: 1387475458227] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.web.integration.WebSecurityManager] [METHODNAME: checkPermissionWithoutCache] [[
[Web-Security] Web Permission = ("javax.security.jacc.WebResourcePermission" "/jdbc/jdbcConnectionPoolEdit.jsf" "GET")]]

[2013-12-19T17:50:58.227+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security] [tid: _ThreadID=124 _ThreadName=admin-listener(8)] [timeMillis: 1387475458227] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.web.integration.WebSecurityManager] [METHODNAME: hasResourcePermission] [[
[Web-Security] hasResource isGranted: true]]

[2013-12-19T17:50:58.227+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security] [tid: _ThreadID=124 _ThreadName=admin-listener(8)] [timeMillis: 1387475458227] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.web.integration.WebSecurityManager] [METHODNAME: hasResourcePermission] [[
[Web-Security] hasResource perm: ("javax.security.jacc.WebResourcePermission" "/jdbc/jdbcConnectionPoolEdit.jsf" "GET")]]

[2013-12-19T17:50:58.246+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm] [tid: _ThreadID=38 _ThreadName=admin-listener(4)] [timeMillis: 1387475458246] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.auth.realm.file.FileRealm] [METHODNAME: init] [[
FileRealm : file=D:\Users\KDean\projects\FeeFracture\trunk\servers\glassfish4\glassfish\domains\feefracture\config\admin-keyfile]]

[2013-12-19T17:50:58.246+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm] [tid: _ThreadID=38 _ThreadName=admin-listener(4)] [timeMillis: 1387475458246] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.auth.realm.file.FileRealm] [METHODNAME: init] [[
FileRealm : jaas-context=ignore]]

[2013-12-19T17:50:58.331+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm] [tid: _ThreadID=237 _ThreadName=admin-listener(46)] [timeMillis: 1387475458331] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.auth.realm.file.FileRealm] [METHODNAME: init] [[
FileRealm : file=D:\Users\KDean\projects\FeeFracture\trunk\servers\glassfish4\glassfish\domains\feefracture\config\admin-keyfile]]

[2013-12-19T17:50:58.331+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm] [tid: _ThreadID=237 _ThreadName=admin-listener(46)] [timeMillis: 1387475458331] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.auth.realm.file.FileRealm] [METHODNAME: init] [[
FileRealm : jaas-context=ignore]]

[2013-12-19T17:50:58.352+0000] [glassfish 4.0] [FINEST] [] [javax.enterprise.system.core.security.org.glassfish.security.services.impl.authorization] [tid: _ThreadID=237 _ThreadName=admin-listener(46)] [timeMillis: 1387475458352] [levelValue: 300] [CLASSNAME: org.glassfish.security.services.impl.authorization.AuthorizationServiceImpl] [METHODNAME: getAuthorizationDecision] [[
Authorization Service result for Subject:
Principal: admin
Principal: asadmin
Private Credential: Realm=admin-realm Username=admin Password=######## TargetName =
Private Credential: Realm=admin-realm Username=admin Password=######## TargetName =
was status=OK, decision=[1].]]

[2013-12-19T17:50:58.360+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm] [tid: _ThreadID=225 _ThreadName=admin-listener(34)] [timeMillis: 1387475458360] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.auth.realm.file.FileRealm] [METHODNAME: init] [[
FileRealm : file=D:\Users\KDean\projects\FeeFracture\trunk\servers\glassfish4\glassfish\domains\feefracture\config\admin-keyfile]]

[2013-12-19T17:50:58.361+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm] [tid: _ThreadID=225 _ThreadName=admin-listener(34)] [timeMillis: 1387475458361] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.auth.realm.file.FileRealm] [METHODNAME: init] [[
FileRealm : jaas-context=ignore]]

[2013-12-19T17:50:58.382+0000] [glassfish 4.0] [FINEST] [] [javax.enterprise.system.core.security.org.glassfish.security.services.impl.authorization] [tid: _ThreadID=225 _ThreadName=admin-listener(34)] [timeMillis: 1387475458382] [levelValue: 300] [CLASSNAME: org.glassfish.security.services.impl.authorization.AuthorizationServiceImpl] [METHODNAME: getAuthorizationDecision] [[
Authorization Service result for Subject:
Principal: admin
Principal: asadmin
Private Credential: Realm=admin-realm Username=admin Password=######## TargetName =
Private Credential: Realm=admin-realm Username=admin Password=######## TargetName =
was status=OK, decision=[1].]]

[2013-12-19T17:50:58.384+0000] [glassfish 4.0] [FINEST] [] [javax.enterprise.system.core.security.com.sun.enterprise.security.auth.login] [tid: _ThreadID=225 _ThreadName=admin-listener(34)] [timeMillis: 1387475458384] [levelValue: 300] [CLASSNAME: com.sun.enterprise.security.auth.login.LoginContextDriver] [METHODNAME: login] [[
Processing login with credentials of type: class com.sun.enterprise.security.auth.login.common.PasswordCredential]]

[2013-12-19T17:50:58.384+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security.com.sun.enterprise.security.auth.login] [tid: _ThreadID=225 _ThreadName=admin-listener(34)] [timeMillis: 1387475458384] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.auth.login.LoginContextDriver] [METHODNAME: doPasswordLogin] [[
Logging in user [admin] into realm: admin-realm using JAAS module: fileRealm]]

[2013-12-19T17:50:58.384+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security.com.sun.enterprise.security] [tid: _ThreadID=225 _ThreadName=admin-listener(34)] [timeMillis: 1387475458384] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.BasePasswordLoginModule] [METHODNAME: initialize] [[
Login module initialized: class com.sun.enterprise.security.auth.login.FileLoginModule]]

[2013-12-19T17:50:58.384+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security.com.sun.enterprise.security] [tid: _ThreadID=225 _ThreadName=admin-listener(34)] [timeMillis: 1387475458384] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.BasePasswordLoginModule] [METHODNAME: abort] [[
JAAS authentication aborted.]]

[2013-12-19T17:50:58.384+0000] [glassfish 4.0] [FINEST] [] [javax.enterprise.system.core.security.com.sun.enterprise.security.auth.login] [tid: _ThreadID=225 _ThreadName=admin-listener(34)] [timeMillis: 1387475458384] [levelValue: 300] [CLASSNAME: com.sun.enterprise.security.auth.login.LoginContextDriver] [METHODNAME: doPasswordLogin] [[
doPasswordLogin fails
javax.security.auth.login.LoginException: Failed file login for admin.
at com.sun.enterprise.security.auth.login.FileLoginModule.authenticate(FileLoginModule.java:84)
at com.sun.enterprise.security.auth.login.PasswordLoginModule.authenticateUser(PasswordLoginModule.java:116)
at com.sun.enterprise.security.BasePasswordLoginModule.login(BasePasswordLoginModule.java:146)
at sun.reflect.GeneratedMethodAccessor40.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at javax.security.auth.login.LoginContext.invoke(LoginContext.java:784)
at javax.security.auth.login.LoginContext.access$000(LoginContext.java:203)
at javax.security.auth.login.LoginContext$4.run(LoginContext.java:698)
at javax.security.auth.login.LoginContext$4.run(LoginContext.java:696)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:695)
at javax.security.auth.login.LoginContext.login(LoginContext.java:594)
at com.sun.enterprise.security.auth.login.LoginContextDriver.doPasswordLogin(LoginContextDriver.java:383)
at com.sun.enterprise.security.auth.login.LoginContextDriver.login(LoginContextDriver.java:241)
at com.sun.enterprise.security.auth.login.LoginContextDriver.login(LoginContextDriver.java:154)
at org.glassfish.admin.rest.cli.SecurityUtil.getAnonymousUser(SecurityUtil.java:344)
at org.glassfish.admin.rest.cli.IsAnonymousUserEnabledCommand.execute(IsAnonymousUserEnabledCommand.java:78)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:356)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
at org.glassfish.admin.rest.utils.ResourceUtil.runCommand(ResourceUtil.java:235)
at org.glassfish.admin.rest.resources.TemplateExecCommand.executeCommandLegacyFormat(TemplateExecCommand.java:161)
at org.glassfish.admin.rest.resources.TemplateCommandGetResource.processGetLegacyFormat(TemplateCommandGetResource.java:75)
at sun.reflect.GeneratedMethodAccessor152.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:125)
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:152)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:91)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:346)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:341)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:101)
at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:224)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:198)
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:946)
at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:331)
at org.glassfish.admin.rest.adapter.RestAdapter$2.service(RestAdapter.java:318)
at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:181)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.portunif.PUFilter.handleRead(PUFilter.java:231)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.portunif.PUFilter.handleRead(PUFilter.java:231)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
at java.lang.Thread.run(Thread.java:744)
]]

[2013-12-19T17:50:59.808+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security] [tid: _ThreadID=215 _ThreadName=admin-listener(24)] [timeMillis: 1387475459808] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.web.integration.WebSecurityManager] [METHODNAME: setPolicyContext] [[
[Web-Security] Setting Policy Context ID: old = null ctxID = _admingui/_admingui]]

[2013-12-19T17:50:59.808+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security] [tid: _ThreadID=215 _ThreadName=admin-listener(24)] [timeMillis: 1387475459808] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.web.integration.WebSecurityManager] [METHODNAME: checkPermissionWithoutCache] [[
[Web-Security] Codesource with Web URL: file:/__admingui/__admingui]]

[2013-12-19T17:50:59.808+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security] [tid: _ThreadID=215 _ThreadName=admin-listener(24)] [timeMillis: 1387475459808] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.web.integration.WebSecurityManager] [METHODNAME: checkPermissionWithoutCache] [[
[Web-Security] Checking Web Permission with Principals : null]]

[2013-12-19T17:50:59.808+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security] [tid: _ThreadID=215 _ThreadName=admin-listener(24)] [timeMillis: 1387475459808] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.web.integration.WebSecurityManager] [METHODNAME: checkPermissionWithoutCache] [[
[Web-Security] Web Permission = ("javax.security.jacc.WebResourcePermission" "/jdbc/jdbcConnectionPoolEdit.jsf" "POST")]]

[2013-12-19T17:50:59.808+0000] [glassfish 4.0] [FINEST] [] [javax.enterprise.system.core.security] [tid: _ThreadID=215 _ThreadName=admin-listener(24)] [timeMillis: 1387475459808] [levelValue: 300] [CLASSNAME: com.sun.enterprise.security.provider.BasePolicyWrapper] [METHODNAME: doImplies] [[
JACC Policy Provider: PolicyWrapper.implies, context (_admingui/_admingui)- result was(false) permission (("javax.security.jacc.WebResourcePermission" "/jdbc/jdbcConnectionPoolEdit.jsf" "POST"))]]

[2013-12-19T17:50:59.808+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security.com.sun.enterprise.security.jmac.config] [tid: _ThreadID=215 _ThreadName=admin-listener(24)] [timeMillis: 1387475459808] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.jmac.config.GFServerConfigProvider] [METHODNAME: getEntry] [[
getEntry for: HttpServlet – GFConsoleAuthModule
module class: org.glassfish.admingui.common.security.AdminConsoleAuthModule
options: {loginErrorPage=/loginError.jsf, loginPage=/login.jsf}

request policy: javax.security.auth.message.MessagePolicy@de1d100
response policy: null]]

[2013-12-19T17:50:59.809+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security] [tid: _ThreadID=215 _ThreadName=admin-listener(24)] [timeMillis: 1387475459809] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.web.integration.WebSecurityManager] [METHODNAME: setPolicyContext] [[
[Web-Security] Policy Context ID was: _admingui/_admingui]]

[2013-12-19T17:50:59.809+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security] [tid: _ThreadID=215 _ThreadName=admin-listener(24)] [timeMillis: 1387475459809] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.web.integration.WebSecurityManager] [METHODNAME: checkPermissionWithoutCache] [[
[Web-Security] Codesource with Web URL: file:/__admingui/__admingui]]

[2013-12-19T17:50:59.809+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security] [tid: _ThreadID=215 _ThreadName=admin-listener(24)] [timeMillis: 1387475459809] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.web.integration.WebSecurityManager] [METHODNAME: checkPermissionWithoutCache] [[
[Web-Security] Checking Web Permission with Principals : asadmin, admin]]

[2013-12-19T17:50:59.809+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security] [tid: _ThreadID=215 _ThreadName=admin-listener(24)] [timeMillis: 1387475459809] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.web.integration.WebSecurityManager] [METHODNAME: checkPermissionWithoutCache] [[
[Web-Security] Web Permission = ("javax.security.jacc.WebResourcePermission" "/jdbc/jdbcConnectionPoolEdit.jsf" "POST")]]

[2013-12-19T17:50:59.809+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security] [tid: _ThreadID=215 _ThreadName=admin-listener(24)] [timeMillis: 1387475459809] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.web.integration.WebSecurityManager] [METHODNAME: hasResourcePermission] [[
[Web-Security] hasResource isGranted: true]]

[2013-12-19T17:50:59.809+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security] [tid: _ThreadID=215 _ThreadName=admin-listener(24)] [timeMillis: 1387475459809] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.web.integration.WebSecurityManager] [METHODNAME: hasResourcePermission] [[
[Web-Security] hasResource perm: ("javax.security.jacc.WebResourcePermission" "/jdbc/jdbcConnectionPoolEdit.jsf" "POST")]]

[2013-12-19T17:50:59.834+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm] [tid: _ThreadID=223 _ThreadName=admin-listener(32)] [timeMillis: 1387475459834] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.auth.realm.file.FileRealm] [METHODNAME: init] [[
FileRealm : file=D:\Users\KDean\projects\FeeFracture\trunk\servers\glassfish4\glassfish\domains\feefracture\config\admin-keyfile]]

[2013-12-19T17:50:59.834+0000] [glassfish 4.0] [FINE] [] [javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm] [tid: _ThreadID=223 _ThreadName=admin-listener(32)] [timeMillis: 1387475459834] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.auth.realm.file.FileRealm] [METHODNAME: init] [[
FileRealm : jaas-context=ignore]]

[2013-12-19T17:50:59.888+0000] [glassfish 4.0] [FINEST] [] [javax.enterprise.system.core.security.org.glassfish.security.services.impl.authorization] [tid: _ThreadID=223 _ThreadName=admin-listener(32)] [timeMillis: 1387475459888] [levelValue: 300] [CLASSNAME: org.glassfish.security.services.impl.authorization.AuthorizationServiceImpl] [METHODNAME: getAuthorizationDecision] [[
Authorization Service result for Subject:
Principal: admin
Principal: asadmin
Private Credential: Realm=admin-realm Username=admin Password=######## TargetName =
Private Credential: Realm=admin-realm Username=admin Password=######## TargetName =
was status=OK, decision=[1].]]

[2013-12-19T17:50:59.936+0000] [glassfish 4.0] [WARNING] [test.connection.pool.failed] [javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors.service] [tid: _ThreadID=223 _ThreadName=admin-listener(32)] [timeMillis: 1387475459936] [levelValue: 900] [[
RAR8054: Exception while creating an unpooled [test] connection for pool [ X ], Connection could not be allocated because: Access denied for user 'ff_read_write'@'localhost' (using password: YES)]]

[2013-12-19T17:50:59.938+0000] [glassfish 4.0] [SEVERE] [] [org.glassfish.admingui] [tid: _ThreadID=215 _ThreadName=admin-listener(24)] [timeMillis: 1387475459938] [levelValue: 1000] [[
RestResponse.getResponse() gives FAILURE. endpoint = 'https://localhost:4848/management/domain/resources/ping-connection-pool.json'; attrs = '

{id=X}

']]

Comment by Kevin Dean [ 19/Dec/13 ]

After bashing my head against the wall trying to figure out how to enable tracing in GlassFish or the MySQL JDBC driver that would log the aliased password, I finally took the easy route and wrote my own connection pool data source that extended MySQL's connection pool data source. I then overrode the "setPassword" method to log the password and lo and behold, we have an answer!!!

It seems that either the encryption or the decryption process mangles the password. Any password less than 10 characters long is fine, but the moment you hit ten characters, the process appends a single space character to the end. That space character remains until you hit 20 characters, at which point you have not one but TWO space characters at the end.

Comment by kumara [ 20/Dec/13 ]

Thanks for the detailed analysis and getting to the root cause. Need to investigate further. Problem demonstrated by following test code ...

import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.Charset;

public class Test {

    private final static Charset utf8 = Charset.forName("UTF-8");

    private static String getBytesInHex(byte[] bytes) {
        StringBuilder sb = new StringBuilder();
        for (byte b: bytes) {
             sb.append(String.format("%02X", b));
        }
        return sb.toString();
    }

    private static void encodeAndPrint(String password) {
        final ByteBuffer byteBuffer = utf8.encode(password);
        System.out.println("Encoded \"" + password + "\" to \"" + getBytesInHex(byteBuffer.array()) + "\"");
    }

    public static void main(String[] args) { 
        for (String s: args) {
             encodeAndPrint(s);
        }
    }
}

java Test abcd12345 abdcde12345 abcdefghij012345678 abcdefghij0123456789
Encoded "abcd12345" to "616263643132333435"
Encoded "abdcde12345" to "616264636465313233343500"
Encoded "abcdefghij012345678" to "6162636465666768696A30313233343536373800"
Encoded "abcdefghij0123456789" to "6162636465666768696A303132333435363738390000"

Need to dig deeper in utf8.encode() ...

Comment by Tim Quinn [ 20/Dec/13 ]

The problem turns out not to be in utf8.encode but in how GlassFish and the test code use the return value from array().

That method returns the entire array that is the backing store for the buffer, not just the valid portion that contains legitimate data.

For example, the test code should convert the byte buffer to a readable string this way:

    private static String getBytesInHex(final ByteBuffer bb) {
        final StringBuilder sb = new StringBuilder();
        while (bb.hasRemaining()) {
            sb.append(String.format("%02X", bb.get()));
        }
        return sb.toString();
    }

Note the use of hasRemaining() and get().

I'm already at work on a fix to the JCEKSPasswordAliasStore class (which contains the same incorrect use the array() method).

Comment by Tim Quinn [ 30/Dec/13 ]

Fix checked in.

Project: glassfish
Repository: svn
Revision: 63048
Author: tjquinn
Date: 2013-12-30 21:21:57 UTC
Link:

Log Message:
------------
GLASSFISH-20938 - GlassFish password aliases failing

Symptom: Password aliases longer than just a few characters were incorrectly handled.

Cause: Places in the new alias handling code use ByteBuffer and CharBuffer objects and the array() method. That method returns the entire backing array, not just the valid portion of the backing array. As longer password strings were created the xxxBuffer would legitimately allocate more bytes than the length of the password. The GlassFish code which uses the entire backing array would use the invalidate bytes in the backing array as well as the valid ones.

Fix: Change the code to use the position() and remaining() methods on ByteBuffer (one solution) and toString on CharBuffer to work with only the valid portion data in the buffer.

Tests: new unit test; remote queue EJB, deployment devtests; QL; others

Revisions:
----------
63048

Modified Paths:
---------------
trunk/main/nucleus/common/common-util/src/main/java/com/sun/enterprise/util/Utility.java
trunk/main/nucleus/security/services/src/main/java/org/glassfish/security/services/impl/JCEKSPasswordAliasStore.java

Added Paths:
------------
trunk/main/nucleus/security/services/src/test/java/org/glassfish/security/services/impl/PasswordAliasTest.java





[GLASSFISH-20846] MySQL connection pool is not working Created: 05/Oct/13  Updated: 19/Oct/13  Resolved: 19/Oct/13

Status: Closed
Project: glassfish
Component/s: jdbc
Affects Version/s: 4.0_b89_RC5
Fix Version/s: None

Type: Bug Priority: Blocker
Reporter: ajeh Assignee: sfelts
Resolution: Works as designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

GlassFish Server Open Source Edition 4.0 (build 89)
Linux 2.6.35.14-96.fc14.x86_64 #6 SMP PREEMPT Mon Jan 16 14:47:34 EST 2012 x86_64 x86_64 x86_64 GNU/Linux



 Description   

GF adds @localhost to any value of MySQL 'user' additional property of jdbc connection pool and that fails connection.
Error:

An error has occurred Ping Connection Pool failed for BuilderDBPool. Connection could not be allocated because: Access denied for user 'jdbcGB'@'localhost' (using password: YES) Please check the server.log for more details. An error has occurred
Ping Connection Pool failed for blanketBuilderDBPool. Connection could not be allocated because: Access denied for user 'jdbcGB'@'localhost' (using password: YES) Please check the server.log for more details.



 Comments   
Comment by ajeh [ 09/Oct/13 ]

This can be closed. The issue was that undocumented, but recommended to me 'URL' additional property overrode the documented additional properties.

Comment by sfelts [ 19/Oct/13 ]

Originator fixed problem in configuration.





[GLASSFISH-20795] EclipseLink 2.5.0 JPQL Parser breaks column alias handling in ORDER BY clause Created: 04/Sep/13  Updated: 05/Sep/13

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: 4.0
Fix Version/s: None

Type: Bug Priority: Blocker
Reporter: dimaki Assignee: sfelts
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Glassfish 4 (b89), EclipseLink 2.5.0 (included)


Tags: eclipselink, jpa, jpql

 Description   

Column alias (result_variable) handling as defined in JPA Spec 2.1 (JSR-338) "4.9 ORDER BY Clause" is not working with the default EclipseLink 2.5.0 JPQL Parser (Hermes) provided in Glassfish 4.0 (b89). If a basic JPQL query contains two column aliases and there is an ORDER BY clause on the first alias, EclipseLink returns the following exception:

Exception Description: Problem compiling [SELECT c.cuNumber, c.nameLast AS last_name, c.nameFirst AS first_name FROM Customer c ORDER BY last_name].
[70, 79] The identification variable 'last_name' is not defined in the FROM clause.

Example:
========
Create an entity 'Customer' similar to:

@Entity
@Access(AccessType.FIELD)
@Table(name = "CUSTOMER")
public class Customer implements Serializable {

...
@Column(name = "CU_NUMBER")
private String cuNumber;
@Column(name = "HY_NAME_LAST")
private String nameLast;
@Column(name = "HY_NAME_FIRST")
private String nameFirst;
...
}

In a SLSB use:

...
@PersistenceContext(unitName = "TEST_PU")
EntityManager em;
...

Query query = em.createQuery("SELECT c.cuNumber, c.nameLast AS last_name, c.nameFirst AS first_name FROM Customer c ORDER BY last_name");
...

This fails with:
Exception Description: Problem compiling [SELECT c.cuNumber, c.nameLast AS last_name, c.nameFirst AS first_name FROM Customer c ORDER BY last_name].
[70, 79] The identification variable 'last_name' is not defined in the FROM clause.

If you use the second alias in the order by clause the query is executed successfully.
The same query is running without any error in Glassfish 3.1.2.2 using supplied EclipseLink version.

It seems to be a EclipseLink JPQL Parser Bug.
As a workaround you can switch back to the prior EclipseLink 2.4 JPQL Parser by using the following configuration in your persistence.xml:
<property name="eclipselink.jpql.parser" value="org.eclipse.persistence.queries.ANTLRQueryBuilder"/>
But I don't think the old JPQL parser is JEE 7 compliant.



 Comments   
Comment by dimaki [ 04/Sep/13 ]

See also here: http://www.eclipse.org/forums/index.php/t/489531/

Comment by PascalFilion [ 05/Sep/13 ]

The bug has been fixed and will be part of the next patch release (2.4.3 and 2.5.1). A nightly build can be picked up if required.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=410808





[GLASSFISH-20773] <data-source> defintion doesn't parse <url> correctly with Java DB/Derby Created: 20/Aug/13  Updated: 20/Aug/13

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: 4.0_b89_RC5
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Ian Evans Assignee: sfelts
Resolution: Unresolved Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Java: 1.7.0_25; Java HotSpot(TM) 64-Bit Server VM 23.25-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_25-b17
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)


Attachments: Zip Archive dataSourceTest.zip    

 Description   

For an application with the following data-source definition in the deployment descriptor:

    <data-source>
        <description>Test data source.</description>
        <name>java:app/TestDataSource</name>
        <class-name>org.apache.derby.jdbc.ClientDataSource</class-name>
        <url>jdbc:derby://localhost:1527/test;create=true</url>
    </data-source>

GlassFish throws the following error on deployment:

INFO:   EclipseLink, version: Eclipse Persistence Services - 2.5.0.v20130507-3faac2b
WARNING:   RAR5038:Unexpected exception while creating resource for pool __SYSTEM/pools/__datasource_definition/dataSourceTest/java:app/TestDataSource. Exception : javax.resource.spi.ResourceAllocationException: Connection could not be allocated because: Required Derby DataSource property databaseName not set.
WARNING:   RAR5117 : Failed to obtain/create connection from connection pool [ __SYSTEM/pools/__datasource_definition/dataSourceTest/java:app/TestDataSource ]. Reason : com.sun.appserv.connectors.internal.api.PoolingException: Connection could not be allocated because: Required Derby DataSource property databaseName not set.
WARNING:   RAR5114 : Error allocating connection : [Error in allocating a connection. Cause: Connection could not be allocated because: Required Derby DataSource property databaseName not set.]
SEVERE:   Local Exception Stack: 
Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.0.v20130507-3faac2b): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: Required Derby DataSource property databaseName not set.
Error Code: 0
	at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:316)
	at org.eclipse.persistence.sessions.JNDIConnector.connect(JNDIConnector.java:135)
	at org.eclipse.persistence.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:162)
	at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.setOrDetectDatasource(DatabaseSessionImpl.java:203)
	at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:734)
	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:239)
	at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:681)
	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getAbstractSession(EntityManagerFactoryDelegate.java:204)
	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getDatabaseSession(EntityManagerFactoryDelegate.java:182)
	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getDatabaseSession(EntityManagerFactoryImpl.java:527)
	at org.eclipse.persistence.jpa.PersistenceProvider.createContainerEntityManagerFactory(PersistenceProvider.java:358)
	at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:199)
	at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:107)
	at org.glassfish.persistence.jpa.JPADeployer$1.visitPUD(JPADeployer.java:223)
	at org.glassfish.persistence.jpa.JPADeployer$PersistenceUnitDescriptorIterator.iteratePUDs(JPADeployer.java:510)
	at org.glassfish.persistence.jpa.JPADeployer.createEMFs(JPADeployer.java:230)
	at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:168)
	at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:922)
	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:431)
	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
	at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.Subject.doAs(Subject.java:356)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
	at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)
	at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)
	at org.glassfish.grizzly.http.server.StaticHttpHandler.service(StaticHttpHandler.java:297)
	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)
	at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
	at java.lang.Thread.run(Thread.java:724)
...

Replacing <url> with the following works correctly:

    <data-source>
        <description>Test data source.</description>
        <name>java:app/TestDataSource</name>
        <class-name>org.apache.derby.jdbc.ClientDataSource</class-name>
        <server-name>localhost</server-name>
        <port-number>1527</port-number>
        <database-name>test</database-name>
        <user>app</user>
        <password>app</password>
        <property>
            <name>connectionAttributes</name>
            <value>;create=true</value>
        </property>
    </data-source>

The server should be able to correctly parse the JDBC URL, including the attributes, from within the <data-source> definition.



 Comments   
Comment by Ian Evans [ 20/Aug/13 ]

Maven WAR project that demonstrates the error.





[GLASSFISH-20688] missing resource-ref in domain.xml breaks connection pooling Created: 08/Jul/13  Updated: 08/Jul/13

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: 3.1.1, 3.1.2
Fix Version/s: None

Type: Bug Priority: Major
Reporter: wrschneider99 Assignee: sfelts
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Related to GLASSFISH-18166, but different failure mode

If you are missing resource-ref in domain.xml, then you can still get connections from JNDI but they won't be pooled, and the "Monitor" tab in the admin console won't work - returns all zeros.

Silent failure is bad.






[GLASSFISH-20329] RAR7093 : Error while cleaning up ManagedConnection Created: 17/Apr/13  Updated: 16/Sep/13

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: 3.1.2_b05
Fix Version/s: None

Type: Bug Priority: Major
Reporter: simon_park_java Assignee: sfelts
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OS: Solaris 5.10 on SPARC
JRE: 1.6.0_38 running as 32 bit (-d32 set)
JDBC: Sybase jConnect 7.07
DB: Sybase 15.5.0.0


Tags: connectionpool, glassfish-3-1-2-2, jdbc, sybase

 Description   

I found this issue had previously been raised, yet had been closed due to the fact that it couldn't be reproduced: http://java.net/jira/browse/GLASSFISH-16778. Since there was no further mention of the error code (RAR7093) elsewhere in JIRA I have assumed that the issue may remain.

JDBC Connection Pool config extract from domain.xml:

<jdbc-connection-pool connection-creation-retry-interval-in-seconds="30" datasource-classname="com.sybase.jdbc4.jdbc.SybConnectionPoolDataSource" res-type="javax.sql.ConnectionPoolDataSource" description="connection pool" associate-with-thread="true" statement-cache-size="64" name="jdbc/appPool" non-transactional-connections="true" connection-creation-retry-attempts="100" ping="true">
<property name="DYNAMIC_PREPARE" value="true"></property>
<property name="FAKE_METADATA" value="true"></property>
<property name="user" value="user"></property>
<property name="password" value="password"></property>
<property name="BE_AS_JDBC_COMPLIANT_AS_POSSIBLE" value="true"></property>
<property name="portNumber" value="4000"></property>
<property name="databaseName" value="database"></property>
<property name="serverName" value="server"></property>
</jdbc-connection-pool>
<jdbc-resource pool-name="jdbc/appPool" jndi-name="jdbc/appPoolDataSource"></jdbc-resource>

The above is the configuration for just one of several pools, each backed by a different database.

For this particular pool, each Connection obtained from the pool has AutoCommit explicitly set to true (this is a legacy app that I have severely limited scope to change). Connections are returned to the pool via a call to Connection.close(), within finally blocks. Below are the 3 sequential entries excerpted from the server.log file. The first indicates that something has gone awry and that's a separate problem for me to solve; this entry is incidental to the issue with the failure of the GlassFish JDBC pool implementation to close the Connection cleanly and is provided only for context.

[#|2013-04-17T03:02:41.079-0400|INFO|oracle-glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=26;_ThreadName=Th
read-3;|java.sql.SQLException: JZ006: Caught IOException: java.io.IOException: JZ0PA: The query has been cancelled and the response discarded. The
cancel was probably issued by another statement on the connection.
at com.sybase.jdbc4.jdbc.SybConnection.getAllExceptions(Unknown Source)
at com.sybase.jdbc4.jdbc.SybStatement.handleSQLE(Unknown Source)
at com.sybase.jdbc4.jdbc.SybStatement.nextResult(Unknown Source)
at com.sybase.jdbc4.jdbc.SybStatement.nextResult(Unknown Source)
at com.sybase.jdbc4.jdbc.SybStatement.queryLoop(Unknown Source)
at com.sybase.jdbc4.jdbc.SybStatement.executeQuery(Unknown Source)
at com.sybase.jdbc4.jdbc.SybPreparedStatement.executeQuery(Unknown Source)
at com.sun.gjc.spi.jdbc40.PreparedStatementWrapper40.executeQuery(PreparedStatementWrapper40.java:642)
at crisk.server.trades.listeners.ATFeedFXListenerBean.process(ATFeedFXListenerBean.java:55)
at crisk.server.PollingBean.poll(PollingBean.java:21)
at sun.reflect.GeneratedMethodAccessor117.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:5388)
at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:619)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
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.aroundTimeout(SystemInterceptorProxy.java:149)
at sun.reflect.GeneratedMethodAccessor116.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:861)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:370)
at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5360)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5348)
at com.sun.ejb.containers.BaseContainer.callEJBTimeout(BaseContainer.java:4058)
at com.sun.ejb.containers.EJBTimerService.deliverTimeout(EJBTimerService.java:1832)
at com.sun.ejb.containers.EJBTimerService.access$100(EJBTimerService.java:108)
at com.sun.ejb.containers.EJBTimerService$TaskExpiredWork.run(EJBTimerService.java:2646)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)

#]

[#|2013-04-17T03:02:41.108-0400|WARNING|oracle-glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource.allocator|_Threa
dID=26;_ThreadName=Thread-3;|RAR7093 : Error while cleaning up ManagedConnection
java.lang.NullPointerException
at com.sun.gjc.spi.ManagedConnection.getActualConnection(ManagedConnection.java:717)
at com.sun.gjc.spi.ManagedConnectionFactory.resetIsolation(ManagedConnectionFactory.java:513)
at com.sun.gjc.spi.ManagedConnection.resetConnectionProperties(ManagedConnection.java:496)
at com.sun.gjc.spi.ManagedConnection.cleanup(ManagedConnection.java:348)
at com.sun.enterprise.resource.allocator.AbstractConnectorAllocator.cleanup(AbstractConnectorAllocator.java:166)
at com.sun.enterprise.resource.pool.ConnectionPool.cleanupResource(ConnectionPool.java:1082)
at com.sun.enterprise.resource.pool.AssocWithThreadResourcePool.freeUnenlistedResource(AssocWithThreadResourcePool.java:262)
at com.sun.enterprise.resource.pool.ConnectionPool.resourceClosed(ConnectionPool.java:1017)
at com.sun.enterprise.resource.pool.PoolManagerImpl.putbackResourceToPool(PoolManagerImpl.java:428)
at com.sun.enterprise.resource.pool.PoolManagerImpl.resourceClosed(PoolManagerImpl.java:382)
at com.sun.enterprise.resource.listener.LocalTxConnectionEventListener.connectionClosed(LocalTxConnectionEventListener.java:77)
at com.sun.gjc.spi.ManagedConnection.connectionClosed(ManagedConnection.java:784)
at com.sun.gjc.spi.base.ConnectionHolder.close(ConnectionHolder.java:217)
at com.sun.gjc.spi.jdbc40.ConnectionHolder40.close(ConnectionHolder40.java:587)
at crisk.utils.jdbc.JdbcResourceUtil.cleanup(JdbcResourceUtil.java:21)
at crisk.server.trades.listeners.ATFeedFXListenerBean.process(ATFeedFXListenerBean.java:151)
at crisk.server.PollingBean.poll(PollingBean.java:21)
at sun.reflect.GeneratedMethodAccessor117.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:5388)
at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:619)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
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.aroundTimeout(SystemInterceptorProxy.java:149)
at sun.reflect.GeneratedMethodAccessor116.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:861)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:370)
at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5360)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5348)
at com.sun.ejb.containers.BaseContainer.callEJBTimeout(BaseContainer.java:4058)
at com.sun.ejb.containers.EJBTimerService.deliverTimeout(EJBTimerService.java:1832)
at com.sun.ejb.containers.EJBTimerService.access$100(EJBTimerService.java:108)
at com.sun.ejb.containers.EJBTimerService$TaskExpiredWork.run(EJBTimerService.java:2646)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)

#]

[#|2013-04-17T03:02:41.119-0400|WARNING|oracle-glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource.pool|_ThreadID=2
6;_ThreadName=Thread-3;|RAR8066: Cleanup of a resource from pool [ jdbc/appPool ] failed. Exception : com.sun.appserv.connec
tors.internal.api.PoolingException: java.lang.NullPointerException|#]



 Comments   
Comment by jirout.jak [ 16/Sep/13 ]

I found the same problem on GF 3.1.2.2 b5.

I had this configuration od pool:

<jdbc-connection-pool validation-table-name="dual" steady-pool-size="4" idle-timeout-in-seconds="600" connection-leak-reclaim="true" validate-atmost-once-period-in-seconds="60" is-isolation-level-guaranteed="false" datasource-classname="oracle.jdbc.xa.client.OracleXADataSource" max-pool-size="100" res-type="javax.sql.XADataSource" connection-leak-timeout-in-seconds="120" name="sdp2RwOraPool" is-connection-validation-required="true" transaction-isolation-level="read-committed">
<property name="user" value="sdp2_prod"></property>
<property name="url" value="jdbc:oracle:thin:@zsdpdb01.sdp.local:1521:sdp"></property>
<property name="password" value="sdp2_prod"></property>
<property name="TestConnectionsOnReserve" value="false"></property>
<property name="TestConnectionsOnRelease" value="false"></property>
</jdbc-connection-pool>

Probably it is related to higher load od application server. It seems, that reaised randomly when the load of AS is high. Here is detailed message:

[#|2013-09-09T09:20:51.928+0200|WARNING|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource.pool|_ThreadID=33;_ThreadName=Thread-2;|A potential connection leak detected for connection pool sdp2RwOraPool. The stack trace of the thread is provided below :
com.sun.enterprise.resource.pool.ConnectionPool.setResourceStateToBusy(ConnectionPool.java:324)
com.sun.enterprise.resource.pool.ConnectionPool.getResourceFromTransaction(ConnectionPool.java:603)
com.sun.enterprise.resource.pool.ConnectionPool.internalGetResource(ConnectionPool.java:515)
com.sun.enterprise.resource.pool.ConnectionPool.getResource(ConnectionPool.java:381)
com.sun.enterprise.resource.pool.PoolManagerImpl.getResourceFromPool(PoolManagerImpl.java:245)
com.sun.enterprise.resource.pool.PoolManagerImpl.getResource(PoolManagerImpl.java:170)
com.sun.enterprise.connectors.ConnectionManagerImpl.getResource(ConnectionManagerImpl.java:332)
com.sun.enterprise.connectors.ConnectionManagerImpl.internalGetConnection(ConnectionManagerImpl.java:301)
com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:190)
com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:165)
com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:160)
com.sun.gjc.spi.base.DataSource.getConnection(DataSource.java:113)
org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:46)
org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)
org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161)
org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1573)
org.hibernate.loader.Loader.doQuery(Loader.java:696)
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
org.hibernate.loader.Loader.doList(Loader.java:2228)
org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2125)
org.hibernate.loader.Loader.list(Loader.java:2120)
org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)
org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:361)
org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
org.hibernate.impl.SessionImpl.list(SessionImpl.java:1148)
org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:67)
cz.i.sdp.papi.ejb.dao.PohledavkaDaoBean.findPohledavkaByAkceTypIds(PohledavkaDaoBean.java:108)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1052)
org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1124)
com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:5388)
com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:619)
com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:571)
com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doAround(SystemInterceptorProxy.java:162)
com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:144)
sun.reflect.GeneratedMethodAccessor108.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:861)
com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:370)
com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5360)
com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5348)
com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:214)
com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:89)
$Proxy777.findPohledavkaByAkceTypIds(Unknown Source)
cz.i.sdp.papi.action.ejb.ActionExecutorBean.applyActionWhereApplicable(ActionExecutorBean.java:336)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1052)
org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1124)
com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:5388)
com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:619)
com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:571)
com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doAround(SystemInterceptorProxy.java:162)
com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:144)
sun.reflect.GeneratedMethodAccessor108.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:861)
com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:370)
com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5360)
com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5348)
com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:214)
com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:89)
$Proxy582.applyActionWhereApplicable(Unknown Source)
cz.i.sdp.papi.ejb.batch.helper.LineBatchExportImport.exportData(LineBatchExportImport.java:302)
cz.i.sdp.papi.ejb.batch.fenix.ExportImportFenixEPSBean.exportData(ExportImportFenixEPSBean.java:94)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1052)
org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1124)
com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:5388)
com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:619)
com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:571)
com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doAround(SystemInterceptorProxy.java:162)
com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:144)
sun.reflect.GeneratedMethodAccessor108.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:861)
com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:370)
com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5360)
com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5348)
com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:214)
com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:89)
$Proxy493.exportData(Unknown Source)
cz.i.sdp.sdp2.async.ejb.PapiExportDataBean.execute(PapiExportDataBean.java:49)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1052)
org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1124)
com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:5388)
com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:619)
com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:571)
com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doAround(SystemInterceptorProxy.java:162)
com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:144)
sun.reflect.GeneratedMethodAccessor108.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:861)
com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:370)
com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5360)
com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5348)
com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:214)
com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:89)
$Proxy925.execute(Unknown Source)
cz.i.sdp.sdp2.async.generic.TaskProcessorAssistantBean.processRequest(TaskProcessorAssistantBean.java:57)
sun.reflect.GeneratedMethodAccessor1565.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1052)
org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1124)
com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:5388)
com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:619)
com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:571)
cz.i.sdp.sdp2.ejb.interceptor.ExceptionInterceptor.intercept(ExceptionInterceptor.java:31)
sun.reflect.GeneratedMethodAccessor192.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:861)
com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:571)
cz.i.sdp.sdp2.ejb.interceptor.PersistenceInterceptor.intercept(PersistenceInterceptor.java:33)
sun.reflect.GeneratedMethodAccessor191.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:861)
com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:571)
cz.i.sdp.sdp2.ejb.interceptor.LoggerInterceptor.intercept(LoggerInterceptor.java:27)
sun.reflect.GeneratedMethodAccessor207.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:861)
com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:571)
com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doAround(SystemInterceptorProxy.java:162)
com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:144)
sun.reflect.GeneratedMethodAccessor108.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:861)
com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:370)
com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5360)
com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5348)
com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:214)
com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:89)
$Proxy702.processRequest(Unknown Source)
cz.i.sdp.sdp2.async.mdb.BaseTaskProcessorBean.process(BaseTaskProcessorBean.java:30)
cz.i.sdp.taskmanager.processor.AbstractTaskProcessor.processPayload(AbstractTaskProcessor.java:79)
cz.i.sdp.taskmanager.processor.AbstractTaskProcessor.onMessage(AbstractTaskProcessor.java:51)
sun.reflect.GeneratedMethodAccessor1508.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1052)
org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1124)
com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:4180)
com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5368)
com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5348)
com.sun.ejb.containers.MessageBeanContainer.deliverMessage(MessageBeanContainer.java:1099)
com.sun.ejb.containers.MessageBeanListenerImpl.deliverMessage(MessageBeanListenerImpl.java:81)
com.sun.enterprise.connectors.inbound.MessageEndpointInvocationHandler.invoke(MessageEndpointInvocationHandler.java:171)
$Proxy981.onMessage(Unknown Source)
com.sun.messaging.jms.ra.OnMessageRunner.run(OnMessageRunner.java:260)
com.sun.enterprise.connectors.work.OneWork.doWork(OneWork.java:114)
com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.performWork(ThreadPoolImpl.java:497)
com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:540)

Monitoring Statistics :

Monitoring Statistics for
sdp2RwOraPool|#]

me time|#]

n,boolean)|#]

wn from bean
at com.sun.ejb.containers.BaseContainer.checkExceptionClientTx(BaseContainer.java:5071)
at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:4906)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:2045)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1994)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:222)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:89)
at $Proxy777.findPohledavkaByAkceTypIds(Unknown Source)
at cz.i.sdp.papi.action.ejb.ActionExecutorBean.applyActionWhereApplicable(ActionExecutorBean.java:336)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
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:5388)
at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:619)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
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.GeneratedMethodAccessor108.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
.....

[#|2013-09-09T09:21:23.442+0200|WARNING|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource.pool|_ThreadID=32;_ThreadName=Thread-2;|RAR8066: Cleanup of a resource from pool [ sdp2
RwOraPool ] failed. Exception : com.sun.appserv.connectors.internal.api.PoolingException: java.lang.NullPointerException|#]





[GLASSFISH-20137]  The option"connection-leak-reclaim"of Jdbc connection pool seems do not work fine Created: 03/Apr/13  Updated: 03/Apr/13

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: 3.1.1
Fix Version/s: None

Type: Bug Priority: Major
Reporter: jifeng Assignee: sfelts
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Hi sfelts

In v3.1.1,when i use the connection-leak-reclaim function, my program is always hung up.
operations are as follows:
---------
[APS]:

1. create two jdbc connection pool:oracle_pool1,oracle_pool2//oracle_pool1,oracle_pool2 use the same database。
2. create two jdbc resource:jdbc/pool1(poolid =oracle_pool1),jdbc/pool2(poolid=oracle_pool2)
3. execute commands as follows:

set resources.jdbc-connection-pool.oracle_pool2.connection-leak-timeout-in-seconds=10
set resources.jdbc-connection-pool.oracle_pool2.connection-leak-reclaim=true

[APP]:
The main thread get con1 and con2 from the different jdbc resource (jdbc/pool1 and jdbc/pool2)

The sub thread use con1 and con2 to execute the following operations:

con1.setAutoCommit(false)
↓
con1.createStatement().execute("select * from test_table where ID = '1' for update");
↓
con2.createStatement().execute("update test_table set NAME='test' where ID = '1'");


The main thread sleep (sleep time > leak-timeout)※
※leakTimeOut happens in con2, ConnectionLeakDetector.potentialConnectionLeakFound methed should be executed
※The lock(connectionLeakLock) would be occupied

the main thread close con2※
ConnectionLeakDetector.stopConnectionLeakTracing methed should be executed ,in this method the lock(connectionLeakLock) can not be obtained★

The main thread close con1

end
---------
the code which is marked as "★" is always hung up

I found that there is some changes about the reclaimed Connection in ConnectionLeakDetector.potentialConnectionLeakFound() between V2.x and V3.x:

the processing logic in v2.x as following.
====
synchronized(connectionLeakLock){
......
}

synchronized(this) {
......
destroyResourceForConnectionLeak(resourceHandle);// reclaim Connection
......
}
====

but in v3.x the processing logic has been changed as following.
====
synchronized (connectionLeakLock){synchronized object has been changed

connLeakListener.reclaimConnection(resourceHandle);// reclaim Connection

}
====

there is some special consideration about the change?






[GLASSFISH-20091] Give us DB-Library automatically Created: 28/Mar/13  Updated: 28/Mar/13

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: 4.0_b81
Fix Version/s: None

Type: Improvement Priority: Major
Reporter: joshie007 Assignee: sfelts
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 7, NetBeans 7.3


Tags: database, libraries

 Description   

Hi,

I'm building an EAR project through GlassFish 4.b-81 promoted build. At first, when I'm using EclipseLink JPA 2.1 and Java-EE 7 to access PostgreSQL Database, the log throws NoClassDefFound: PostgreSQL jdbc4 PreparedStatement.

Now I know that to fix the error is put my postgresql library to <GLASSFISH_INSTALLATION>/glassfish/domains/<MY DOMAIN>/lib/

But, what about if GlassFish team has put some popular Database driver, so we don't have to do it like that? It's just an advice though, so it will make the developing enterprise application become easier.






[GLASSFISH-20052] Unable to delete default resources Created: 26/Mar/13  Updated: 28/Mar/13  Resolved: 28/Mar/13

Status: Closed
Project: glassfish
Component/s: admin, concurrency, jdbc, jms
Affects Version/s: 4.0_b81
Fix Version/s: 4.0

Type: Bug Priority: Critical
Reporter: Sanjeeb Sahoo Assignee: Tom Mueller
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

As a user I should be able to configure the system to have as minimal configuration as possible. As part of default domain template, we define a number of default resources like this:
concurrent/__defaultManagedScheduledExecutorService
concurrent/__defaultContextService
jdbc/__default
jms/__defaultConnectionFactory

All these resources are marked with an object-type=system-all-req which means they can't be deleted. Why should an administrator not be allowed to delete them if they are sure they don't need them?



 Comments   
Comment by Tom Mueller [ 26/Mar/13 ]

A Java EE 7 compliant server (which GlassFish is) is required to have these default resources. This is why they cannot be removed.

If someone really wants to create a non-compliant server, they could edit the domain.xml, but the public GlassFish interface cannot allow creating a non-compliant server.

Comment by Sanjeeb Sahoo [ 27/Mar/13 ]

The compatibility rules do allow such resource to be deleted by a user. It's the factory configuration that needs to have them. So, please provide a better justification for why you don't want these resource to be deleted. The current technique of system-all-req is not sufficient protection anyway, because one can disable those resources, use a set command to change their type, etc.

Comment by Tom Mueller [ 27/Mar/13 ]

See Bill's response on this. Bill wrote:

Let's start with the most basic Java compatibility principle:

Always compatible, all the time

If you start from that point, you'll be pretty close to correct.

But let's look at some of the subtleties...

If I download GlassFish and remove some of the jar files, some stuff
will break and it won't be compatible. Does that mean we have to
prevent you from removing those jar files?

No.

If I misconfigure the System CLASSPATH I can break things and it won't
be compatible. Does that mean we have to verify that the System CLASSPATH
is only configured to "correct" values?

No.

What matters is what we tell people to do.

If we tell people that you can set the property "FOO" to the values
"bar" or "bletch", and that these different values have certain effects,
then the product has to be compatible no matter which way you set the
"FOO" property.

We don't have to prevent all misconfiguration of the product.

But we do have to ensure that all defined, documented configurations of
the product meet the Java compatibility requirements.

If we tell you that you can delete resources, then it's your responsibility
to not delete any resources necessary for the correct operation of the
product.

If we tell you that you can delete the "jdbc/__default" resource, then it's
our responsibility to ensure that the system still operates correctly if
you do that.

So, I don't think it's required that we prevent deleting these resources,
but it does seem to be a good thing to prevent that.

If jdbc/__default or any of the other default resources are removed, then the Java EE 7 standard JNDI names will no longer resolve properly, i.e., the system will not work correctly. So we have chosen for GlassFish 4.0 to not allow these to be deleted. The system is working as designed so this bug is invalid.

Comment by Sanjeeb Sahoo [ 28/Mar/13 ]

If I am reading Bill's answer correctly, then he clearly states the following:

So, I don't think it's required that we prevent deleting these resources,
but it does seem to be a good thing to prevent that.

So, it's not a requirement as opposed to what you said first while closing the bug. Whether it's a good thing to prevent deletion is subjective.

Comment by Sanjeeb Sahoo [ 28/Mar/13 ]

I didn't mean to reopen the bug last time.





[GLASSFISH-20050] Support "system-all-req" object-type for default jdbc resource Created: 26/Mar/13  Updated: 31/Mar/13  Resolved: 31/Mar/13

Status: Resolved
Project: glassfish
Component/s: jdbc
Affects Version/s: None
Fix Version/s: 4.0_b83

Type: Improvement Priority: Major
Reporter: Jagadish Assignee: Jagadish
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Java EE 7 introduces "default datasource" support that is supported in GlassFish 4.0 today.

i) As part of it, making the resource's object-type as "system-all-req" will make sure that the resource will be automatically available in all instances/clusters.
ii) Also, this resource (of object-type "system-all-req") cannot be deleted.

jdbc/__default is the name of the jdbc-resource that is used by default datasource feature.

Creating this issue to handle and (ii).



 Comments   
Comment by Sanjeeb Sahoo [ 26/Mar/13 ]

I am sorry to say that this breaks compatibility. Earlier one could delete jdbc/__default resource. Now they can't. So, please revert your change and discuss the issue in CCC.

Comment by Jagadish [ 26/Mar/13 ]

you can still delete it if you set the object-type to something else. (eg: "user").

Comment by Sanjeeb Sahoo [ 26/Mar/13 ]

So, now we require user to first update the resource's object type using an asadmin set operation before they can delete as opposed to what they could do earlier. Isn't it still an incompatibile change? BTW, I came across this issue because in my test suite, I reconfigure jdbc/__default to point to a different pool and since there is no update-jdbc-resource command, I do delete followed by a create. The delete has started to fail. It just highlights the kind of issue a customer will face.

Comment by Sanjeeb Sahoo [ 26/Mar/13 ]

Created GLASSFISH-20052 to track behavior of other resources.

Comment by Jagadish [ 31/Mar/13 ]

In the CCC, it was decided that "system-all" is sufficient than "system-all-req".

Also, provided the GUI specific "extraProperties" in the CLI so that GUI can make use of it.

FIX INFORMATION :

1)
svn log -v -r 60809
------------------------------------------------------------------------
r60809 | jr158900 | 2013-03-26 10:44:49 +0530 (Tue, 26 Mar 2013) | 4 lines
Changed paths:
M /trunk/main/appserver/admin/template/src/main/resources/config/domain.xml
M /trunk/main/appserver/jdbc/admin/src/main/java/org/glassfish/jdbc/admin/cli/JDBCResourceManager.java
M /trunk/main/appserver/jdbc/admin/src/main/java/org/glassfish/jdbc/admin/cli/LocalStrings.properties
M /trunk/main/nucleus/core/kernel/src/main/resources/org/glassfish/embed/domain.xml

2)
svn log -v -r 60826
------------------------------------------------------------------------
r60826 | jr158900 | 2013-03-26 18:24:24 +0530 (Tue, 26 Mar 2013) | 2 lines
Changed paths:
M /trunk/main/appserver/admin/template/src/main/resources/config/domain.xml
M /trunk/main/nucleus/core/kernel/src/main/resources/org/glassfish/embed/domain.xml

3) GUI specific support
svn log -v -r 61032
------------------------------------------------------------------------
r61032 | jr158900 | 2013-03-29 23:22:24 +0530 (Fri, 29 Mar 2013) | 5 lines
Changed paths:
M /trunk/main/appserver/jdbc/admin/src/main/java/org/glassfish/jdbc/admin/cli/ListJdbcResources.java

Comment by Anissa Lam [ 31/Mar/13 ]

In console, the JDBC resources table now shows the logical Jndi Name for the resource if it's available.
This is resolved in GLASSFISH-20105.





[GLASSFISH-19683] classpath issue for javax.transaction-api.jar in glassfish-4.0-web-b76.zip Created: 15/Feb/13  Updated: 22/Feb/13  Resolved: 15/Feb/13

Status: Resolved
Project: glassfish
Component/s: jdbc
Affects Version/s: 4.0_b76_EE7MS5
Fix Version/s: 4.0_b77

Type: Bug Priority: Major
Reporter: sherryshen Assignee: Romain Grécourt
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OEL6 and JDK1.7.0_10



 Description   

glassfish-4.0-web-b76.zip

The compile error is observed in jdbc tests.
[javac] /root/.hudson/jobs/core-das/workspace/appserver-sqe/pe/jdbc/TP2/JDBC-test1/web/ServletClient.java:19:
error: cannot find symbol
[javac] import javax.transaction.UserTransaction;
[javac] ^

The same test passed on glassfish-4.0-b76.zip.
Both glassfish-4.0-web-b76.zip and glassfish-4.0-b76.zip has glassfish3/glassfish/javax.transaction-api.jar
including UserTransaction.class.

Is there a classpath issue for javax.transaction-api.jar for classpath in glassfish-4.0-web-b76.zip?



 Comments   
Comment by Romain Grécourt [ 15/Feb/13 ]

What does you compile classpath look like ? Are you using lib/javaee-api.jar ?

Comment by sherryshen [ 15/Feb/13 ]

jdbc tests passed on glassfish-4.0-web-b76.zip with the workaround.

	/m/jws/appserver-sqe/build-config/sqe-properties.xml,v From Revision 1.102 to 1.103


***************
*** 251,256 ****
--- 251,259 ----
  <!-- Following jar added by Sonia,it's required for GF4.0 serlvet3.1 test -->
      <fileset dir="${env.S1AS_HOME}/modules" includes="javax.servlet-api.jar"/>
  
+ <!-- Following jar added by Sherry, to debug jdbc compile issue on 4.0 b76 web.zip -->
+     <fileset dir="${env.S1AS_HOME}/modules" includes="javax.transaction-api.jar"/>
+ 
Comment by Romain Grécourt [ 15/Feb/13 ]

Why are not you using lib/javaee.jar ? It provides you the classpath for all JavaEE APIs.

Comment by sherryshen [ 15/Feb/13 ]

sqe-common.xml has $

{env.S1AS_HOME}

/lib/javaee.jar is in classpath.

I did not find javax.transaction-api.jar in javaee.jar, e.g.

META-INF/maven/org.glassfish.main.extras/javaee/pom.xml

<Class-Path>../modules/javax.servlet-api.jar ../modules/endorsed/javax.annotation-api.jar ../modules/javax.ejb.jar ../modules/javax.transaction.jar ../modules/javax.enterprise.deploy-api.jar ../modules/javax.management.j2ee-api.jar ../modules/javax.resource.jar ../modules/javax.security.auth.message.jar ../modules/javax.security.jacc.jar ../modules/webservices-osgi.jar ../modules/jaxb-osgi.jar ../modules/endorsed/jaxb-api-osgi.jar ../modules/endorsed/webservices-api-osgi.jar ../modules/javax.xml.rpc-api.jar ../modules/javax.xml.registry-api.jar ../modules/javax.mail.jar ../modules/javax.faces.jar ../modules/javax.servlet.jsp-api.jar ../modules/javax.el.jar ../modules/javax.servlet.jsp.jstl-api.jar ../modules/javax.persistence.jar ../modules/javax.jms-api.jar ../modules/bean-validator.jar ../modules/weld-osgi-bundle.jar ../../mq/lib/jaxm-api.jar ../modules/javax.ws.rs-api.jar ../modules/javax.json.jar ../modules/javax.websocket-api.jar</Class-Path>
Comment by Romain Grécourt [ 15/Feb/13 ]

ok, ../modules/javax.transaction.jar should be renamed to ../modules/javax.transaction-api.jar

Comment by Romain Grécourt [ 15/Feb/13 ]

Fixed.... Please re-open if you still see the issue with b77

Project:    glassfish
Repository: svn
Revision:   59528
Author:     romain_grecourt
Date:       2013-02-15 15:02:09 UTC
Link:       

Log Message:
------------
fix for http://java.net/jira/browse/GLASSFISH-19683


Revisions:
----------
59528


Modified Paths:
---------------
trunk/main/appserver/extras/javaee/manifest-jar/pom.xml


Diffs:
------
Index: trunk/main/appserver/extras/javaee/manifest-jar/pom.xml
===================================================================
--- trunk/main/appserver/extras/javaee/manifest-jar/pom.xml	(revision 59527)
+++ trunk/main/appserver/extras/javaee/manifest-jar/pom.xml	(revision 59528)
@@ -59,7 +59,7 @@
                 <configuration>
                     <archive>
 	                <manifestEntries>
-				<Class-Path>../modules/javax.servlet-api.jar ../modules/endorsed/javax.annotation-api.jar ../modules/javax.ejb.jar ../modules/javax.transaction.jar ../modules/javax.enterprise.deploy-api.jar ../modules/javax.management.j2ee-api.jar ../modules/javax.resource.jar ../modules/javax.security.auth.message.jar ../modules/javax.security.jacc.jar ../modules/webservices-osgi.jar ../modules/jaxb-osgi.jar ../modules/endorsed/jaxb-api-osgi.jar ../modules/endorsed/webservices-api-osgi.jar ../modules/javax.xml.rpc-api.jar ../modules/javax.xml.registry-api.jar ../modules/javax.mail.jar ../modules/javax.faces.jar ../modules/javax.servlet.jsp-api.jar ../modules/javax.el.jar ../modules/javax.servlet.jsp.jstl-api.jar ../modules/javax.persistence.jar ../modules/javax.jms-api.jar ../modules/bean-validator.jar ../modules/weld-osgi-bundle.jar ../../mq/lib/jaxm-api.jar ../modules/javax.ws.rs-api.jar ../modules/javax.json.jar ../modules/javax.websocket-api.jar</Class-Path>
+				<Class-Path>../modules/javax.servlet-api.jar ../modules/endorsed/javax.annotation-api.jar ../modules/javax.ejb.jar ../modules/javax.transaction-api.jar ../modules/javax.enterprise.deploy-api.jar ../modules/javax.management.j2ee-api.jar ../modules/javax.resource-api.jar ../modules/javax.security.auth.message.jar ../modules/javax.security.jacc.jar ../modules/webservices-osgi.jar ../modules/jaxb-osgi.jar ../modules/endorsed/jaxb-api-osgi.jar ../modules/endorsed/webservices-api-osgi.jar ../modules/javax.xml.rpc-api.jar ../modules/javax.xml.registry-api.jar ../modules/javax.mail.jar ../modules/javax.faces.jar ../modules/javax.servlet.jsp-api.jar ../modules/javax.el.jar ../modules/javax.servlet.jsp.jstl-api.jar ../modules/javax.persistence.jar ../modules/javax.jms-api.jar ../modules/bean-validator.jar ../modules/weld-osgi-bundle.jar ../../mq/lib/jaxm-api.jar ../modules/javax.ws.rs-api.jar ../modules/javax.json.jar ../modules/javax.websocket-api.jar</Class-Path>
 	                    <GlassFish-ServerExcluded>true</GlassFish-ServerExcluded>
 	                </manifestEntries>
                     </archive>
Comment by sherryshen [ 22/Feb/13 ]

Verified the fix on b77 promoted.





[GLASSFISH-19615] GlassFish JDBC resource should make it possible to setup Properties attributes. Created: 01/Feb/13  Updated: 10/Feb/13

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: gfuser9999 Assignee: sfelts
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Config: GlassFish 2.1.x, GlassFish 3.x and possible BG
OS: Any
Database: Oracle RAC and any Database API have setXXXX(Properties p)


Tags: FCF, Fast, JDBC, Oracle, Properties, RAC, UCP, connection, failover, injection, setter

 Comments   
Comment by gfuser9999 [ 01/Feb/13 ]

Configuration: GFv211 and all GFv31x and also BG (currently)
Problem:

  • For Oracle RAC Connection pool, one will need to use Fast Connection
    Failover or UCP Connection pool for Oracle 12c HA.
    However, w/o the possible to do

For FCF
http://download.oracle.com/otn_hosted_doc/jdeveloper/905/jdbc-javadoc/oracle/jdbc/pool/OracleDataSource.html
setConnectionCacheProperties(java.util.Properties cp)
[see http://keremerkan.net/posts/supporting-oracle-fcf-in-tomcat/
example for the ConnectionCacheProperties

or for UCP
http://docs.oracle.com/cd/E18283_01/java.112/e12826/oracle/ucp/jdbc/PoolDataSource.html to set the UCP pool
But this is doable in Tomcat for passing ConnectionProperties.

com.sun.gjc.util.MethodExecutor.java (diff)
--- MethodExecutor.java-orig	Fri Feb  1 16:40:54 2013
+++ MethodExecutor.java	Fri Feb  1 17:26:49 2013
@@ -48,6 +48,7 @@
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.util.Vector;
+import java.util.Properties;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -67,6 +68,8 @@
 
     private boolean debug = false;
 
+    private final String newline = System.getProperty("line.separator");
+
     private static StringManager sm = StringManager.getManager(
             DataSourceObjectBuilder.class);
 
@@ -206,6 +209,11 @@
                 return Boolean.valueOf(parameter);
             }
 
+            if (typeName.equals("java.util.Properties")) {
+                Properties p = stringToProperties(parameter);
+                if (p!= null) return p;
+            }
+
             return parameter;
         } catch (NumberFormatException nfe) {
             _logger.log(Level.SEVERE, "jdbc.exc_nfe", parameter);
@@ -238,6 +246,48 @@
         }
         return returnValue;
     }
+
+    private Properties stringToProperties(String parameter)
+    {
+         if (parameter == null) return null;
+         String s = parameter.trim();
+         if (!((s.startsWith("(") && s.endsWith(")")))) {
+            return null; // not a "( .... )" syntax
+         }
+         s = s.substring(1,s.length()-2);
+         s = s.replaceAll("(?<!\\\\),",newline);
+
+         Properties p = new Properties();
+         Properties prop = new Properties();
+         try {
+            p.load(new java.io.StringBufferInputStream(s));
+         } catch (java.io.IOException ex) {
+            if (_logger.isLoggable(Level.FINEST)) {
+               _logger.log(Level.FINEST,
+                "Parsing string to properties: "+ex.getMessage());
+            }
+            return null;
+         }
+         // cleanup trailing whitespace in value
+         for (java.util.Enumeration propKeys = p.propertyNames();
+               propKeys.hasMoreElements();) {
+             String tmpKey = (String)propKeys.nextElement();
+             String tmpValue = p.getProperty(tmpKey);
+             // Trim spaces
+             tmpValue = tmpValue.trim();
+             // Quoted string.
+             if (tmpValue.length() > 1 && tmpValue.startsWith("\"")
+                 && tmpValue.endsWith("\"")) {
+                tmpValue = tmpValue.substring(1,tmpValue.length()-2);
+             }
+             prop.put(tmpKey, tmpValue);
+         }
+         if (_logger.isLoggable(Level.FINEST)) {
+               _logger.log(Level.FINEST,
+                "Parsing string to properties: "+prop+" size:"+prop.size());
+         }
+         return prop;
+    }
 }  




[GLASSFISH-19548] The option"allow-non-component-callers"of Jdbc connection pool seems do not work fine Created: 17/Jan/13  Updated: 01/Aug/13

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: V3
Fix Version/s: None

Type: Bug Priority: Major
Reporter: jifeng Assignee: sfelts
Resolution: Unresolved Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

In glassfish Server 3.1 Application Development Guide,the description of "allow-non-component-callers" are as follows:

 
Connections obtained by non-component callers are not automatically closed at the end of a transaction by the 
container.They must be explicitly closed by the caller. "★"

But we find that the function of " allow-non-component-callers" does not like "★" when looked into the related code.
If the value of "allow-non-component-callers" is false,the connection which get before transaction should be enlisted into the transaction context.
For example:part1

  

con1 = datasource.getConnection;// enlisted into the transaction
ut.begin();
con2 = datasource.getConnection;// enlisted into the transaction
......
ut.commit();

If the value of "allow-non-component-callers" is true,the connection which is got before transaction will not be enlisted into the transaction context.
For example:part2

 
con1 = datasource.getConnection;// will not be enlisted into the transaction
ut.begin();
con2 = datasource.getConnection;// enlisted into the transaction
......
ut.commit();

in part2,if execute con1.close before ut.commit() method.
For example:

con1 = datasource.getConnection()
ut.begin();
con1.close();"★"
ut.commit();

When execute con1.close() method ,the program is throwing exception :

[#|2013-01-17T16:42:20.994+0800|SEVERE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource|_Thread
ID=93;_ThreadName=Thread-2;|RAR5031:System Exception
java.lang.NullPointerException
	at com.sun.enterprise.resource.ConnectorXAResource.getResourceHandle(ConnectorXAResource.java:246)
	at com.sun.enterprise.resource.ConnectorXAResource.end(ConnectorXAResource.java:159)
	at com.sun.enterprise.transaction.JavaEETransactionManagerSimplified.delistResource(JavaEETransactionManagerSimplified.java:528)
	at com.sun.enterprise.resource.rm.SystemResourceManagerImpl.delistResource(SystemResourceManagerImpl.java:145)
	at com.sun.enterprise.resource.pool.PoolManagerImpl.resourceClosed(PoolManagerImpl.java:381)
	at com.sun.enterprise.resource.listener.LocalTxConnectionEventListener.connectionClosed(LocalTxConnectionEventListener.java:77)
	at com.sun.gjc.spi.ManagedConnection.connectionClosed(ManagedConnection.java:784)
	at com.sun.gjc.spi.base.ConnectionHolder.close(ConnectionHolder.java:217)
	at com.sun.gjc.spi.jdbc40.ConnectionHolder40.close(ConnectionHolder40.java:587)
java.lang.RuntimeException: Got exception during XAResource.end: javax.transaction.xa.XAException: 
com.sun.appserv.connectors.internal.api.PoolingException: java.lang.NullPointerException
	at com.sun.enterprise.transaction.JavaEETransactionManagerSimplified.delistResource(JavaEETransactionManagerSimplified.java:530)
	at com.sun.enterprise.resource.rm.SystemResourceManagerImpl.delistResource(SystemResourceManagerImpl.java:145)
	at com.sun.enterprise.resource.pool.PoolManagerImpl.resourceClosed(PoolManagerImpl.java:381)
	at com.sun.enterprise.resource.listener.LocalTxConnectionEventListener.connectionClosed(LocalTxConnectionEventListener.java:77)
	at com.sun.gjc.spi.ManagedConnection.connectionClosed(ManagedConnection.java:784)
	at com.sun.gjc.spi.base.ConnectionHolder.close(ConnectionHolder.java:217)
	at com.sun.gjc.spi.jdbc40.ConnectionHolder40.close(ConnectionHolder40.java:587)



 Comments   
Comment by jifeng [ 17/Jan/13 ]

JavaEETransactionManagerSimplified #enlistResourcet():enlisted resource into the transaction context

JavaEETransactionManagerSimplified # delistResource():dissociate resource from the transaction context

if the value of “allow-non-component-callers” is true, when the program get the connection ,JavaEETransactionManagerSimplified #enlistResourcet() method will not be executed.And then the program close the connection,JavaEETransactionManagerSimplified #delistResource () method will still be executed.
Because there is no resource enlisted into the transaction context, so the code which is marked as "★" will throw the NullPointerException:

ConnectorXAResource.java
private ResourceHandle getResourceHandle() throws PoolingException {
        try {
            ResourceHandle h = null;
            JavaEETransaction j2eetran = getCurrentTransaction();
            if (j2eetran == null) {      
                h = localHandle_;        
            } else {
                h = (ResourceHandle)j2eetran.getNonXAResource();//no resource in transaction, h is null
                ......
            }
            if (h.getResourceState().isUnenlisted()) {★
                ManagedConnection mc = (ManagedConnection) h.getResource();
                mc.getLocalTransaction().begin();
            }
            return h;
        } catch (Exception ex) {
            _logger.log(Level.SEVERE, "poolmgr.system_exception", ex);
            throw new PoolingException(ex.toString(), ex);
        }
    }
Comment by jifeng [ 17/Jan/13 ]

I modify the code which is marked as "★" , and it works fine.

com.sun.enterprise.resource.rm.SystemResourceManagerImpl
public void delistResource(ResourceHandle h, int xaresFlag) {
        try {
        JavaEETransactionManager tm = ConnectorRuntime.getRuntime().getTransactionManager();
            Transaction tran = tm.getTransaction();
	    if (tran != null) {
	        if (h.isTransactional() && h.isEnlisted()) {★
	            tm.delistResource(tran, h, xaresFlag);
  	        }
           }		
        } catch (SystemException ex) {
            _logger.log(Level.WARNING,"poolmgr.system_exception",ex);
        } catch (IllegalStateException ex) {
            // ignore
        }            
    }  
Comment by jifeng [ 01/Aug/13 ]

Hi:
sfelts

I find This phenomenon also occurs in glassfish v4 .

when i used the way as above, it works fine

could you please confirm it and give me some suggestions?





[GLASSFISH-19489] JDBC connections to Oracle with Wallet fail Created: 02/Jan/13  Updated: 31/Jul/14

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: 3.1.2.2
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: krzysp Assignee: sfelts
Resolution: Unresolved Votes: 3
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

GlassFish Server Open Source Edition 3.1.2.2 (build 4)
Windows 7 64
AIX 6.1
Oracle JDBC 11.2.0.2
Oracle database 11.2.0.2 with configured Wallet (External Password Store)
http://www.oracle.com/technetwork/database/enterprise-edition/wp-oracle-jdbc-thin-ssl-130128.pdf


Tags: JDBC, Oracle, Wallet

 Description   

Oracle JDBC 11.2.0.2
/gf/glassfish/lib\ojdbc6.jar
/gf/glassfish/lib\oraclepki.jar
/gf/glassfish/lib\osdt_cert.jar
/gf/glassfish/lib\osdt_core.jar

/ora/admin/wallet/ewallet.p12
/ora/admin/wallet/cwallet.sso
/ora/admin/tnsnames.ora

-Doracle.net.tns_admin=/ora/admin
-Doracle.net.wallet_location=/ora/admin/wallet

<jdbc-connection-pool res-type="javax.sql.DataSource" datasource-classname="oracle.jdbc.pool.OracleDataSource" name="DBpool" driver-classname="oracle.jdbc.OracleDriver">
<property value="jdbc:oracle:thin:/@DB" name="URL"></property>
</jdbc-connection-pool>
<jdbc-resource pool-name="DBpool" description="" jndi-name="DBRES"></jdbc-resource>

Please take a note that there is no user and password

Simple test is working correctly
OracleDataSource dsOracle = new OracleDataSource();
dsOracle.setURL("jdbc:oracle:thin:/@DB");
conn = dsOracle.getConnection(null,null);
or conn = dsOracle.getConnection();

But using connection pool not

Context initContext = new InitialContext();
DataSource ds = (DataSource)initContext.lookup("DBRES");
ds.getConnection()

We are getting exception
" Connection could not be allocated because: ORA-01017: invalid username/password; logon denied Please check the server.log for more details. "

While debugging I discovered that glassfish is passing to OracleDataSource
empty string "" for "user" instead of null
and empty string "" for password instead of null
This is changing logic inside OracleDriver connected to reading user and password from secret store /ora/admin/wallet/cwallet.sso



 Comments   
Comment by lgacs [ 31/Jul/14 ]

Do you have any solution/workaround for this issue ?

Comment by kazikk [ 31/Jul/14 ]

Not really . We had to disable oracle wallet?





[GLASSFISH-19476] Resources leak in pool resizer with preferValidateOverRecreate Created: 21/Dec/12  Updated: 15/Jul/14

Status: Open
Project: glassfish
Component/s: jca, jdbc
Affects Version/s: 3.1.2, 4.0
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Arkadiusz Orzechowski Assignee: David Delabassee
Resolution: Unresolved Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: 4_0_1-reviewed, connectors, connectors-runtime, fishcat

 Description   

Hi,

I've been recently tracing a strange jdbc connection leak in our production server (gf 3.1.2), which we first observed quite some time ago, but which increased after some reconfiguration/tuning of our connection pools.

We don't use jdbc directly anywhere in our code - only JPA/eclipselink and Activiti(5.9) which uses iBATIS underneath.

Analysing heap dump I found out that we have lot of ResourceHandles not enlisted in any transaction and having state.busy==false while at the same time having busy flag set to true (ie. not "free" according to RWLockDataStructure)

OQL query used to find the leaked resources:

select c from com.sun.enterprise.resource.ResourceHandle c
where c.busy == true && c.state.busy==false && c.state.enlisted==false
&& /jdbc.POOL_NAME.*/(c.spec.resourceId.toString())

I first suspected transaction manager not closing resources after finishing transaction, but I wasn't able to spot any flaw. And the leak was not very repeatable (not after every transaction).

Playing with pools settings I noticed that the leaks did not occur when I set prefer-validate-over-recreate property to false (default). So the quick workaround was to just disable preferValidateOverRecreate.

Further looking into the code I located probable bug responsible for the leak. In com.sun.enterprise.resource.pool.resizer.Resizer, removeIdleAndInvalidResources method, when the resource is not eligible for removal (!isResourceEligibleForRemoval) we neither remove the resource nor mark it as active(so it's not closed later in the finally block).

In our local glassfish build(3.1.2) I verified that adding activeResources.add(h); in line 200 of: Resizer.java fixes the problem.

I did not build any other gf version to verify, but it seems that in current trunk the issue is still present, so I checked 3.1.2 and 4.0 as affected version.

I chose jdbc and jca as components for this issue - hope jca stands for Connector here, not Cryptography



 Comments   
Comment by gfuser9999 [ 04/Jul/14 ]

Can this be fixed fro 4.0.1 since w/o this it greatly limit
JDBC scalability as this switch cannot be used.
(Due to heavy contention as large JDBC pool will
need to wait for a slow JDBC creation * free connection
==> Not usable .

Would be good to have this fix as it is simple.

Comment by David Delabassee [ 09/Jul/14 ]

Is it possible to quickly test this on 4.0.1 and confirm that you sill have the leak?

Comment by gfuser9999 [ 12/Jul/14 ]

Yes still there. By the way 312p08 fixed this.

Comment by David Delabassee [ 15/Jul/14 ]

Thanks, will be fixed for 4.0.1!
The fix has been integrated, can you confirm it works for you?
--8<-
svn log appserver/connectors/connectors-runtime/src/main/java/com/sun/enterprise/resource/pool/resizer/Resizer.java
r63492 | kdevaras | 2014-07-15 04:34:42 +0200 (Tue, 15 Jul 2014)





[GLASSFISH-19475] "Connection closed" despite connection validation Created: 21/Dec/12  Updated: 19/Aug/16

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: 3.1.2_b23
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Heikki Salokanto Assignee: sfelts
Resolution: Unresolved Votes: 4
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

GlassFish 3.1.2 b23 on CentOS 6.2 x86_64
Oracle 10.2.0.5 RAC ia64, 2 nodes


Tags: closed, connection, validation

 Description   

We were having occasional connection problems and therefore switched on connection validation, with a dummy query to DUAL. It validates at most every 60 seconds and will not close all connections on failure.

However, it seems that ConnectionHolder.checkValidity() throws a 'connection closed' which then goes all the way to the application. I was in belief that connection validation was the thing exactly designed to prevent this, is it not? If validation failed, it would automatically reconnect before handing out the connection?

The connection is indeed validated, but there's no effort to fix the connection when the validation fails:

[#|2012-12-21T04:56:03.707+0200|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=45;_ThreadName=Thread-2;|
        at fi.foo.bar.AvepsiKuittausDAO.hae(AvepsiKuittausDAO.java:67)
        at fi.foo.bar.AvepsiSanomaKasittelija.hae(AvepsiSanomaKasittelija.java:56)
        at sun.reflect.GeneratedMethodAccessor222.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        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:5388)
        at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:619)
        at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
        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.GeneratedMethodAccessor117.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:861)
        at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
        at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:370)
        at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5360)
        at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5348)
        at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:214)
        at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:88)
        at $Proxy244.hae(Unknown Source)
        at fi.foo.bar.__EJB31_Generated__AvepsiSanomaKasittelija__Intf____Bean__.hae(Unknown Source)
        at fi.foo.bar.baz.JmsToXml.<init>(JmsToXml.java:70)
        at fi.foo.bar.baz.PerusvalvontadataKasittelijaMDB.onMessage(PerusvalvontadataKasittelijaMDB.java:87)
        at sun.reflect.GeneratedMethodAccessor676.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        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.invokeTargetBeanMethod(BaseContainer.java:4180)
        at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5368)
        at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5348)
        at com.sun.ejb.containers.MessageBeanContainer.deliverMessage(MessageBeanContainer.java:1099)
        at com.sun.ejb.containers.MessageBeanListenerImpl.deliverMessage(MessageBeanListenerImpl.java:81)
        at com.sun.enterprise.connectors.inbound.MessageEndpointInvocationHandler.invoke(MessageEndpointInvocationHandler.java:171)
        at $Proxy333.onMessage(Unknown Source)
        at com.sun.messaging.jms.ra.OnMessageRunner.run(OnMessageRunner.java:260)
        at com.sun.enterprise.connectors.work.OneWork.doWork(OneWork.java:114)
        at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.performWork(ThreadPoolImpl.java:497)
        at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:540)
Caused by: org.hibernate.exception.GenericJDBCException: could not load an entity:
[fi.foo.bar.AvepsiKuittaus#component[sanomaId,kasittelija]{kasittelija=Perusvalvonta, sanomaId=69618960}]
        at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140)
        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:128)
        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
        at org.hibernate.loader.Loader.loadEntity(Loader.java:2041)
        at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:86)
        at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:76)
        at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3293)
        at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:496)
        at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:477)
        at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:227)
        at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:285)
        at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:152)
        at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:1090)
        at org.hibernate.impl.SessionImpl.get(SessionImpl.java:1005)
        at org.hibernate.impl.SessionImpl.get(SessionImpl.java:998)
        at fi.foo.bar.AvepsiKuittausDAO.hae(AvepsiKuittausDAO.java:59)
        ... 42 more
Caused by: java.sql.SQLException: Connection closed
        at com.sun.gjc.spi.base.ConnectionHolder.checkValidity(ConnectionHolder.java:730)
        at com.sun.gjc.spi.base.ConnectionHolder.prepareStatement(ConnectionHolder.java:560)
        at com.sun.gjc.spi.jdbc40.ConnectionWrapper40.prepareCachedStatement(ConnectionWrapper40.java:255)
        at com.sun.gjc.spi.jdbc40.ConnectionWrapper40.prepareCachedStatement(ConnectionWrapper40.java:52)
        at com.sun.gjc.spi.ManagedConnection.prepareCachedStatement(ManagedConnection.java:993)
        at com.sun.gjc.spi.jdbc40.ConnectionWrapper40.prepareStatement(ConnectionWrapper40.java:173)
        at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:534)
        at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:452)
        at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161)
        at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1700)
        at org.hibernate.loader.Loader.doQuery(Loader.java:801)
        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
        at org.hibernate.loader.Loader.loadEntity(Loader.java:2037)
        ... 54 more
|#]


 Comments   
Comment by jifeng [ 01/Mar/13 ]

if you execute the following logic in you application :
step1: connection.close();

step2: connection.prepareStatement();

there will be throw this exception :

Caused by: java.sql.SQLException: Connection closed
at com.sun.gjc.spi.base.ConnectionHolder.checkValidity(ConnectionHolder.java:730)

because the logic connectin(connectionHolder) is closed
ConnectionHolder.checkValidity() is used to check the connection is closed or not

Comment by Heikki Salokanto [ 01/Mar/13 ]

Quite obviously, yes, but we are never doing a connection.close() in the application. Connections are pooled and the JDBC Connection Pools are managed by GlassFish. It opens new connections as required and closes those that have been idle for some time.

The problem here is that the connections are getting closed suddenly for an unknown reason and GlassFish's connection validator is not capable of handling that. Connections getting closed suddenly also looks like a GlassFish problem since we're not experiencing that with any other (sort of) application.

Comment by sfelts [ 01/Mar/13 ]

This is working as expected. Based on the stack trace, you are not in the process of getting a connection. You are in the process of using a connection that you already reserved to do a prepared statement. Since GF and the driver don't know what other operations have been executed on the connection before this, we can't just give out a new connection and hope that everything is OK.

To do something like that, you would need to run with the Application continuity feature that was announced at Oracle Open World for Oracle 12c. In that case, the driver and database actually do keep track of what has been executed on the connection so it can be replayed on the new connection.

Comment by hrstoyanov [ 09/Mar/13 ]

This is, indeed, a major bug in GlassFish Server Open Source Edition 3.1.2.2 (build 5). The workaround that works for me is to disable statement cache (Statement Cache Size: 0, Advanced Tab) - the behaviour of this mug made me believe that this is some statements cache mess. Note, that I have not configured connection validation as described in the initial bug report, neverthless, the issue is still present.

Here is another manifestation of the same issue as seen in the SmartGWT product:

http://forums.smartclient.com/showthread.php?t=25771

"...Best guess, this is an application server or JDBC driver bug or misconfiguration at the JDBC driver or application server level, hence out of our control.

What's happening is: we successfully execute your SQL ("INSERT INTO batch_job_share...") using PreparedStatement.executeUpdate(). Then, a few lines later, using the same preparedStatement object, we are calling preparedStatement.getConnection().getMetaData().

At this point, your JDBC driver - well actually, some wrapper around it, looks like a manager class from Glassfish? - throws an Exception indicating the connection we just successfully used for an update is now closed. So it seems like it's either configured to auto-close connections right after certain SQL operations are executed, or your JDBC driver has some kind of bug where it get mixed up about which Connection belongs with which Statement, or the wrapper classes in use are not correctly tracking the open/closed state of the wrapped connections."

Comment by sfelts [ 09/Mar/13 ]

The connection close is not caused by the connection validation feature. My point was that turning on the connection validation feature doesn't prevent this from happening.

Here's an example that I ran into this week with the Oracle thin driver. The application configured oracle.jdbc.ReadTimeout. When the database was slow and the read timeout was exceeded, the applcation got a mysterious "SQLRecoverableException: Closed Connection".

I have also found that the expected new JDBC auto-close behavior leads to some surprises (IMO) but I don't think that is the case here.

If the driver has a debug feature to log all SQL operations, that would be the way to check if close is explicitly closed.

Comment by Heikki Salokanto [ 12/Mar/13 ]

Thank you for your ideas.

hrstoyanov: Last time I tried, setting up statement caching on the Advanced tab just completely messed up everything. I found out on some forums that it has to be configured on the Additional properties tab with "ImplicitCachingEnabled=true" and "MaxStatements=nnn". At least it didn't fill up all the logs with errors anymore, but I never benchmarked if it was actually in use then.

sfelts: I wasn't saying that 'Connection closed' was caused by the connection validation, but despite it. I now understand that it cannot solve the problem, in the current design at least.

I am running out of ideas, though. I'm getting the occasional 'Connection closed' on different application servers (physical servers, virtual servers), different Oracle RACs (10.2.0.5 and 11.2.0.3), different Oracle JDBC drivers (10.2.0.5 and 11.2.0.3) as well as with and without statement caching. The only thing common to all the setups is now GlassFish 3.1.2.2 (build 5).

Furthermore, I am not getting my connections closed in a Tomcat webapp using the same databases and drivers.

Comment by hrstoyanov [ 14/Mar/13 ]

sfelts:
1. I am using MS SQL JDBC Type 4 driver
2. It can not be a timing issue (look at the URL I provided and description of events). The SmartGWT comments indicated error in the Wrpper/Caching , which lead me to teh workaround.

Comment by samyomar82 [ 27/Jul/14 ]

Currently I am facing the same issue , (using GF 3.1.2.2 and Oracle 10G)
I am getting my Connection object from GlassFish connection Pool and I get this issue when the result set expected to return around 1/2 million records, but I did not get this exception when the result set contains lower set of records.

My poor workaround is to use a traditional JDBC connection instead of getting the connection object from Data Source It worked fine.

Has anybody a solution or workaround ?
Also we dont know if this bug is going to be fixed or not

Comment by joyli [ 30/Dec/15 ]

We have the same problem,used the prepareStatement database connection to get the getMetaData,
“Initial and Minimum Pool Size:” 、“Maximum Pool Size:” and “Statement Cache Size:” are 1,
code:
DataSource dn = (DataSource) initContext.lookup("DB");
Connection ccon = dn.getConnection();
PrepareStatement pstam = ccon.prepareStatement(sql);
ResultSet rs = pstam.executeQuery();
pstam.getConnection().getMetaData();

the concurrent situation,appear:
java.sql.SQLException: Connection closed
at com.sun.gjc.spi.base.ConnectionHolder.checkValidity(ConnectionHolder.java:774)
at com.sun.gjc.spi.base.ConnectionHolder.getMetaData(ConnectionHolder.java:388)
at com.sun.gjc.spi.jdbc40.ConnectionWrapper40.getMetaData(ConnectionWrapper40.java:114)
at jdbc1.Servese1.serverdd(Servese1.java:122)
at jdbc1.Servese1.doGet(Servese1.java:58)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:286)
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 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:336)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:236)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
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:619)

Comment by joyli [ 04/Jan/16 ]

Glassfish 4.1 has the same problem.

Comment by sahlix [ 19/Aug/16 ]

I had the same problem. After updating the oracle driver to version 11g 2.0.4.0 it vanished away without further interference!





[GLASSFISH-19470] RAR5031:System Exception -> NPE Created: 18/Dec/12  Updated: 13/Jul/16

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: 3.1.2_b23
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Heikki Salokanto Assignee: sfelts
Resolution: Unresolved Votes: 3
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

GlassFish 3.1.2 build 23
Oracle 10.2.0.5 ia64 2-node RAC


Tags: JDBC, NullPointerException, RAR5031, connection, pool

 Description   

We are getting occasional "RAR5031" System Exceptions followed by a NullPointerException. This looks somewhat similar to GLASSFISH-13390.

It appears to have something to do with the JDBC connections or connection pools but the trace is all but clear. The DB is a 2-node RAC of 10.2.0.5.

2012-12-18T03:55:26.350+0200|SEVERE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource|
_ThreadID=24;_ThreadName=Thread-2;|RAR5031:System Exception
java.lang.NullPointerException

2012-12-18T03:55:26.350+0200|SEVERE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource|
_ThreadID=24;_ThreadName=Thread-2;|RAR5031:System Exception
com.sun.appserv.connectors.internal.api.PoolingException: java.lang.NullPointerException
        at com.sun.enterprise.resource.ConnectorXAResource.getResourceHandle(ConnectorXAResource.java:255)
        at com.sun.enterprise.resource.ConnectorXAResource.end(ConnectorXAResource.java:159)
        at com.sun.enterprise.transaction.JavaEETransactionManagerSimplified.delistResource(JavaEETransactionManagerSimplified.java:528)
        at com.sun.enterprise.resource.rm.SystemResourceManagerImpl.delistResource(SystemResourceManagerImpl.java:145)
        at com.sun.enterprise.resource.pool.PoolManagerImpl.resourceClosed(PoolManagerImpl.java:381)
        at com.sun.enterprise.resource.listener.LocalTxConnectionEventListener.connectionClosed(LocalTxConnectionEventListener.java:77)
        at com.sun.gjc.spi.ManagedConnection.connectionClosed(ManagedConnection.java:784)
        at com.sun.gjc.spi.base.ConnectionHolder.close(ConnectionHolder.java:217)
        at com.sun.gjc.spi.jdbc40.ConnectionHolder40.close(ConnectionHolder40.java:587)
        at org.hibernate.connection.DatasourceConnectionProvider.closeConnection(DatasourceConnectionProvider.java:97)
        at org.hibernate.jdbc.ConnectionManager.closeConnection(ConnectionManager.java:474)
        at org.hibernate.jdbc.ConnectionManager.aggressiveRelease(ConnectionManager.java:429)
        at org.hibernate.jdbc.ConnectionManager.afterStatement(ConnectionManager.java:304)
        at org.hibernate.jdbc.AbstractBatcher.closePreparedStatement(AbstractBatcher.java:572)
        at org.hibernate.jdbc.AbstractBatcher.closeStatement(AbstractBatcher.java:291)
        at org.hibernate.jdbc.AbstractBatcher.closeQueryStatement(AbstractBatcher.java:307)
        at org.hibernate.jdbc.AbstractBatcher.closeQueryStatement(AbstractBatcher.java:234)
        at org.hibernate.loader.Loader.doQuery(Loader.java:854)
        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
        at org.hibernate.loader.Loader.doList(Loader.java:2533)
        at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276)
        at org.hibernate.loader.Loader.list(Loader.java:2271)
        at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:119)
        at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1716)
        at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:347)
        at my.own.dao.package.MyOwnDAO.selaa(MyOwnDAO.java:126)
        at my.own.package.MyClass.selaa(MyClass.java:42)
        at sun.reflect.GeneratedMethodAccessor606.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        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:5388)
        at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:619)
        at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
        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.GeneratedMethodAccessor117.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:861)
        at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
        at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:370)
        at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5360)
        at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5348)
        at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:214)
        at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:88)
        at $Proxy246.selaa(Unknown Source)
        at my.own.package.__EJB31_Generated__MyOwnClass__Intf____Bean__.selaa(Unknown Source)
        at my.another.package.AnotherClass.onMessage(AnotherClass.java:145)
        at sun.reflect.GeneratedMethodAccessor604.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        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.invokeTargetBeanMethod(BaseContainer.java:4180)
        at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5368)
        at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5348)
        at com.sun.ejb.containers.MessageBeanContainer.deliverMessage(MessageBeanContainer.java:1099)
        at com.sun.ejb.containers.MessageBeanListenerImpl.deliverMessage(MessageBeanListenerImpl.java:81)
        at com.sun.enterprise.connectors.inbound.MessageEndpointInvocationHandler.invoke(MessageEndpointInvocationHandler.java:171)
        at $Proxy336.onMessage(Unknown Source)
        at com.sun.messaging.jms.ra.OnMessageRunner.run(OnMessageRunner.java:260)
        at com.sun.enterprise.connectors.work.OneWork.doWork(OneWork.java:114)
        at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.performWork(ThreadPoolImpl.java:497)
        at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:540)
Caused by: java.lang.NullPointerException

The method MyOwnDAO.selaa() (=browse) is as follows. Exception is thrown on line 126 which is criteria.list().

    public static List<AGame> selaa(String serialnumber, boolean onlyActive) throws AvepsiDAOException {
        Session session = HibernateUtil.getNMSession();
        Transaction tx = null;
        try {
            tx = session.beginTransaction();
            Criteria criteria = session.createCriteria(AGame.class);
            criteria.add(Restrictions.eq("serialnumber", serialnumber));
            if (onlyActive) {
                criteria.add(Restrictions.eq("active", 1));
            }
            List list = criteria.list();
            tx.commit();
            return list;
        } catch (HibernateException e) {
            rollbackIfActive(tx);
            throw new AvepsiDAOException(e, serialnumber);            
        }
    }

Connection validation is 'on'.



 Comments   
Comment by emailnbw [ 29/May/14 ]

Occasionally seeing the same thing. Glassfish 3.1.2 b23 w/Oracle ojdbc6 driver.

Comment by sekmiller [ 18/Mar/16 ]

We are still seeing this in Glassfish 4.1

Comment by adrienb [ 13/Jul/16 ]

We are still seeing this in Glassfish 3.1.2.12. Could you resolve this bug ?





[GLASSFISH-19451] Allow JDBC driver to be loaded from application archive Created: 15/Dec/12  Updated: 23/Feb/14

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Major
Reporter: arjan tijms Assignee: Shalini
Resolution: Unresolved Votes: 7
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: datasource, ear, embedded, jdbc, war

 Description   

As one of the few application servers, GlassFish does not allow a JDBC driver to be loaded from a .war or .ear (see http://henk53.wordpress.com/2012/06/30/the-state-of-datasourcedefinition-in-java-ee). Instead, the driver is required to be stored inside the GlassFish installation directory.

Especially for applications that use an embedded database and an application scoped datasource (specifically those using @DataSourceDefinition), this is not convenient. Those applications can be coded to be almost portable, with the exception that for GlassFish a jar (the JDBC driver) has to be copied from the archive to the AS installation directory.

I would like to ask for the ability to load said JDBC driver directly from an application archive such as .war and .ear.



 Comments   
Comment by Darious3 [ 20/Dec/12 ]

You can now include glassfish-resources.xml in your war, where you can define JDBC resources. These resources have a lifetime scoped to the WAR (created and destroyed when the WAR is deployed/undeployed).

This behavior really should apply to the JDBC driver as well.

Comment by Darious3 [ 04/Apr/13 ]

Has anything happened for this yet?

Comment by arjan tijms [ 16/Dec/13 ]

This seems to have been "silently" fixed in GlassFish 4. The following unit test in the Java EE samples project shows this: https://github.com/javaee-samples/javaee7-samples/blob/master/jpa/datasourcedefinition/src/test/java/org/javaee7/jpa/datasourcedefinition/DataSourceDefinitionTest.java

This test addresses the exact use case this issue is about and puts the JDBC driver into the application archive. The test passes on a stock (embedded) GlassFish 4.

Maybe it should also be tested on a standalone GlassFish 4, but hopefully this shouldn't make any difference.

Comment by martinandersson.com [ 23/Feb/14 ]

The github example you give inject the datasource. I must use a persistence.xml file to declare the persistence unit that relies on my @DataSourceDefinition. With this requirement I can't get my application to work. Another way for me since Java EE 7 is to use the default data source, but then of course, my application still don't deploy deploy and work properly since GlassFish doesn't start his Derby database automatically. For me, I refuse to manually copy-paste jar files to the glassfish installation direction as much as I refuse to manually start the derby database. I can happily do that for a production environment, but until then, as what is my issue now, I'm using Arquillian to do real proper integration tests.

Comment by arjan tijms [ 23/Feb/14 ]

I must use a persistence.xml file to declare the persistence unit that relies on my @DataSourceDefinition. With this requirement I can't get my application to work.

You're most likely being affected by this bug: GLASSFISH-20944

The driver seems to load, but then because of a timing issue of some sorts, or maybe a scoping issue, the JPA boot code can't locate the datasource. Very unfortunate indeed! (please vote for that issue if you think it impacts you). See also JAVAEE_SPEC-30

my applications still don't deploy deploy and work properly since GlassFish doesn't start his Derby database automatically. For me, I refuse to manually copy-paste jar files to the glassfish installation direction as much as I refuse to manually start the derby database.

I agree. This shouldn't be required. I logged issue JAVAEE_SPEC-34 for precisely this a short while ago. There's a corresponding GlassFish specific issue at GLASSFISH-20666

If you care for getting those solved, please vote for them as well

Comment by martinandersson.com [ 23/Feb/14 ]

Thank you Arjan for your feedback, you seem to be a real good spirit. Keep it up! Yeah I did vote for those other issues =)

Comment by reza_rahman [ 23/Feb/14 ]

I think this could be a pretty nice community contribution .





[GLASSFISH-19427] connection leak reclaim does not work Created: 11/Dec/12  Updated: 04/Jun/14

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: 3.1
Fix Version/s: None

Type: Bug Priority: Major
Reporter: jifeng Assignee: Jagadish
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File LeakTimeout.war    
Tags: 4_0_1-reviewed

 Description   

I execute under three commands:

1.resources.jdbc-connection-pool.oracle_pool.pooling=false
2.set resources.jdbc-connection-pool.oracle_pool.connection-leak-timeout-in-seconds=10
3.set resources.jdbc-connection-pool.oracle_pool.connection-leak-reclaim=true

then I get jdbc connection from "oracle_pool" by my application,the connection that is not return back to the pool by my application within the specified period(leak-timeout), after 10 second, the function of connection-leak-reclaim does not work ,it is a pattern or a bug ?



 Comments   
Comment by jifeng [ 11/Dec/12 ]

test guide

1. create jdbc resource

asadmin start-database
asadmin create-jdbc-connection-pool --datasourceclassname org.apache.derby.jdbc.ClientDataSource --restype javax.sql.DataSource --isconnectvalidatereq=false --property User=APP:Password=APP:DatabaseName=EJB:PortNumber=1527:serverName=localhost:connectionAttributes=\\;create\\=true oracle_pool
asadmin set resources.jdbc-connection-pool.oracle_pool.pooling=false
asadmin set resources.jdbc-connection-pool.oracle_pool.connection-leak-timeout-in-seconds=10
asadmin set resources.jdbc-connection-pool.oracle_pool.connection-leak-reclaim=true
asadmin create-jdbc-resource  --target server --connectionpoolid oracle_pool jdbc/oracle

2.please download the attachment and deploy it

 
asadmin deploy --target server ./LeakTimeout.war

3.call:http://localhost:28282/LeakTimeout/UseConnection?sleepTime=20000

Comment by jifeng [ 04/Jan/13 ]

I think it is a bug:

com.sun.enterprise.resource.pool.datastructure.RWLockDataStructure
public void removeResource(ResourceHandle resource) {
    boolean removed = false;
    writeLock.lock();
    try {
        removed = resources.remove(resource); "★"
    } finally {
        writeLock.unlock();
    }
    if(removed) {
       handler.deleteResource(resource);//not execute when the state of pool is unpooling

    }
}

the code which is marked as "★" has problem,because there is no connection in the pool when the state of pool is unpooling, so "handler.deleteResource(resource)" does not execute

I changed the code and it works fine

com.sun.enterprise.resource.pool.datastructure.RWLockDataStructure
public void removeResource(ResourceHandle resource) {
    writeLock.lock();
    try {
        resources.remove(resource); 
    } finally {
        writeLock.unlock();
    }
    handler.deleteResource(resource)  
 }
}
Comment by jifeng [ 01/Aug/13 ]

Hi:
sfelts

This phenomenon also occurs in glassfish v4 .

when i used the way as above, it works fine

could you please confirm it and give me some suggestions?





[GLASSFISH-19248] Dynamic Proxy generation in GlassFish JDBC connection pool Created: 26/Oct/12  Updated: 26/Oct/12

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: future release
Fix Version/s: None

Type: New Feature Priority: Major
Reporter: Shalini Assignee: Shalini
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

In GlassFish, as of now, when SQL tracing feature is enabled, a dynamic proxy is created for all java.sql.Statement objects.

This new feature must provide an extension of providing the dynamic proxy for other java.sql.* objects viz., java.sql.ResultSet and java.sql.<ALL_DATA_TYPES>.

A common pre/post/exception handling logic inside the dynamic proxy is implemented in the dynamic proxy for all invocations on every java.sql.* object. This feature should allow for a complete tracing in addition to the calls that are vendor specific, reducing the overhead while debugging and exception handling.

When any java.sql.* object is unwrapped, the dynamic proxy will not be used and hence tracing will be skipped for that object.






[GLASSFISH-19247] JDBC runtime separation from JCA in GlassFish Created: 26/Oct/12  Updated: 26/Oct/12  Resolved: 26/Oct/12

Status: Resolved
Project: glassfish
Component/s: jdbc
Affects Version/s: 4.0
Fix Version/s: 4.0

Type: New Feature Priority: Major
Reporter: Shalini Assignee: Shalini
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

JDBC related functionality must be separated from the JCA module in GlassFish to a new module called jdbc-runtime. Following are a must :

1. DSD annotation handler and implementation
2. Hidden CLIs for GUI functionality
3. JDBC resource recovery handler
4. Config serverbeans like JdbcConnectionPool and JdbcResource
5. Jdbc Pool/Resource Monitoring Statisitics



 Comments   
Comment by Shalini [ 26/Oct/12 ]

Decoupled the JDBC runtime related features from JCA module. Created a new module jdbc-runtime to that effect.

Rev : 54786.

Changes:

trunk/main/appserver/connectors/connectors-runtime/src/main/java/com/sun/enterprise/connectors/service/ConnectorConnectionPoolAdminServiceImpl.java
trunk/main/appserver/connectors/connectors-internal-api/src/test/resources/PasswordAliasTest.xml
trunk/main/appserver/connectors/admin/src/main/java/org/glassfish/connectors/admin/cli/FlushConnectionPool.java
trunk/main/appserver/jdbc/pom.xml
trunk/main/appserver/connectors/admin/src/main/java/org/glassfish/connectors/admin/cli/PingConnectionPool.java
trunk/main/appserver/connectors/connectors-internal-api/src/main/java/com/sun/appserv/connectors/internal/api/ConnectorsUtil.java
trunk/main/appserver/persistence/cmp/support-sqlstore/pom.xml
trunk/main/appserver/connectors/connectors-internal-api/src/main/java/com/sun/appserv/connectors/internal/ConnectorResourceManagerLifecycleListener.java
trunk/main/appserver/jdbc/admin/src/main/java/org/glassfish/jdbc/admin/cli/internal/GetValidationClassNames.java
trunk/main/appserver/jdbc/admin/src/main/java/org/glassfish/jdbc/admin/cli/JDBCConnectionPoolManager.java
trunk/main/appserver/jdbc/admin/src/test/java/org/glassfish/jdbc/admin/cli/CreateJdbcResourceTest.java
trunk/main/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ResourcePool.java
trunk/main/appserver/connectors/connectors-runtime/osgi.bundle
trunk/main/appserver/connectors/admin/pom.xml
trunk/main/appserver/connectors/connectors-runtime/pom.xml
trunk/main/appserver/connectors/connectors-runtime/src/main/java/com/sun/enterprise/connectors/DeferredResourceConfig.java
trunk/main/appserver/persistence/cmp/support-sqlstore/src/main/java/com/sun/jdo/spi/persistence/support/sqlstore/utility/PersistenceManagerFactoryResourceMigrator.java
trunk/main/appserver/jdbc/admin/src/main/java/org/glassfish/jdbc/admin/cli/internal/GetValidationTableNames.java
trunk/main/appserver/jdbc/admin/src/main/java/org/glassfish/jdbc/admin/cli/ListJdbcResources.java
trunk/main/appserver/connectors/connectors-runtime/src/main/java/com/sun/enterprise/connectors/module/RarHandler.java
trunk/main/appserver/connectors/connectors-internal-api/src/main/java/com/sun/appserv/connectors/internal/api/ConnectorRuntime.java
trunk/main/appserver/connectors/connectors-runtime/src/main/java/com/sun/enterprise/resource/pool/monitor/ConnectionPoolStatsProviderBootstrap.java
trunk/main/appserver/connectors/admin/src/main/java/org/glassfish/connectors/admin/cli/ListResources.java
trunk/main/appserver/connectors/connectors-runtime/src/main/java/com/sun/enterprise/connectors/service/ConnectorAdminServicesFactory.java
trunk/main/appserver/connectors/connectors-runtime/src/main/java/com/sun/enterprise/connectors/util/ResourcesUtil.java
trunk/main/appserver/jdbc/admin/src/test/java/org/glassfish/jdbc/admin/cli/DeleteJdbcResourceTest.java
trunk/main/appserver/connectors/connectors-internal-api/src/main/java/org/glassfish/connectors/config/validators/ConnectionPoolValidator.java
trunk/main/appserver/connectors/connectors-internal-api/src/main/java/org/glassfish/connectors/config/ConnectorConnectionPool.java
trunk/main/appserver/jdbc/admin/src/test/java/org/glassfish/jdbc/config/JdbcConnectionPoolDefaultsTest.java
trunk/main/appserver/connectors/connectors-internal-api/src/test/resources/DomainTest.xml
trunk/main/appserver/connectors/connectors-runtime/src/main/java/com/sun/enterprise/resource/naming/ConnectorNamingUtils.java
trunk/main/appserver/jdbc/admin/src/main/java/org/glassfish/jdbc/admin/cli/JDBCResourceManager.java
trunk/main/appserver/jdbc/admin/src/test/java/org/glassfish/jdbc/admin/cli/ListJdbcResourcesTest.java
trunk/main/appserver/connectors/connectors-runtime/src/main/java/com/sun/enterprise/connectors/service/ConnectorResourceAdminServiceImpl.java
trunk/main/appserver/connectors/connectors-runtime/src/main/java/com/sun/enterprise/connectors/ConnectorRuntime.java
trunk/main/appserver/jdbc/admin/src/test/java/org/glassfish/jdbc/config/JdbcConnectionPoolValidationTest.java
trunk/main/appserver/connectors/connectors-runtime/src/main/java/com/sun/enterprise/resource/pool/monitor/ConnectionPoolEmitterImpl.java
trunk/main/appserver/connectors/connectors-runtime/src/main/java/com/sun/enterprise/resource/pool/monitor/ConnectionPoolProbeProviderUtil.java
trunk/main/appserver/jdbc/admin/pom.xml
trunk/main/appserver/jdbc/admin/src/main/java/org/glassfish/jdbc/admin/cli/ListJdbcConnectionPools.java
trunk/main/appserver/connectors/connectors-runtime/src/main/java/com/sun/enterprise/connectors/service/ConnectorService.java
trunk/main/appserver/jdbc/admin/src/test/java/org/glassfish/jdbc/config/ConcurrentModificationsTest.java

Added Paths:
------------
trunk/main/appserver/jdbc/jdbc-runtime/src/main/java/org/glassfish/jdbc/deployer/DataSourceDefinitionDeployer.java
trunk/main/appserver/jdbc/jdbc-runtime/src/main/java/org/glassfish/jdbc/config/validators
trunk/main/appserver/jdbc/jdbc-runtime/src/main/java/org/glassfish/jdbc/deployer/JdbcConnectionPoolDeployer.java
trunk/main/appserver/jdbc/jdbc-runtime/src/main/java/org/glassfish/jdbcruntime/service/JdbcAdminServiceImpl.java
trunk/main/appserver/jdbc/jdbc-config/src/main/java/org/glassfish/jdbc/config/JdbcResource.java
trunk/main/appserver/jdbc/jdbc-runtime/src/main/java/org/glassfish/jdbc/pool/monitor/JdbcConnPoolProbeProvider.java
trunk/main/appserver/jdbc/jdbc-config/src/main/java/org
trunk/main/appserver/jdbc/jdbc-runtime/src/main/java/org/glassfish/jdbcruntime/service/JdbcDataSource.java
trunk/main/appserver/jdbc/jdbc-runtime/src/main/resources/org/glassfish/jdbc/deployer/LocalStrings.properties
trunk/main/appserver/jdbc/jdbc-runtime/src/main/java/org/glassfish/jdbcruntime/deployment/annotation
trunk/main/appserver/jdbc/jdbc-runtime/src/main/java/org/glassfish/jdbc
trunk/main/appserver/jdbc/jdbc-runtime/src/test/resources
trunk/main/appserver/jdbc/jdbc-config/src/main/java/org/glassfish/jdbc
trunk/main/appserver/jdbc/jdbc-runtime/pom.xml
trunk/main/appserver/jdbc/jdbc-config
trunk/main/appserver/connectors/connectors-runtime/src/main/java/com/sun/enterprise/connectors/ConnectorRuntimeExtension.java
trunk/main/appserver/jdbc/jdbc-runtime/src/main/resources/org
trunk/main/appserver/jdbc/jdbc-runtime/src/main/java/org/glassfish/jdbc/pool/monitor/JdbcConnPoolStatsProvider.java
trunk/main/appserver/jdbc/jdbc-runtime/src/test/java/org/glassfish
trunk/main/appserver/jdbc/jdbc-runtime/src/main/java/org/glassfish/jdbcruntime/JdbcRuntimeExtension.java
trunk/main/appserver/jdbc/jdbc-runtime/src/main/resources/org/glassfish
trunk/main/appserver/jdbc/jdbc-runtime/osgi.bundle
trunk/main/appserver/jdbc/jdbc-runtime/src/test/java/org
trunk/main/appserver/jdbc/jdbc-runtime/src/test/java/org/glassfish/jdbcruntime/config
trunk/main/appserver/jdbc/jdbc-runtime/src/main/java
trunk/main/appserver/jdbc/jdbc-config/src/main/java
trunk/main/appserver/jdbc/jdbc-runtime/src/main/java/org/glassfish/jdbc/recovery/JdbcRecoveryResourceHandler.java
trunk/main/appserver/jdbc/jdbc-runtime/src/main/java/org/glassfish/jdbc/pool/monitor
trunk/main/appserver/jdbc/jdbc-runtime/src/main/java/org/glassfish/jdbcruntime/deployment/annotation/handlers
trunk/main/appserver/jdbc/jdbc-runtime/src/main/java/org/glassfish/jdbcruntime/service
trunk/main/appserver/jdbc/jdbc-runtime/src/main/java/org/glassfish/jdbc/deployer
trunk/main/appserver/jdbc/jdbc-config/osgi.bundle
trunk/main/appserver/jdbc/jdbc-config/pom.xml
trunk/main/appserver/jdbc/jdbc-runtime/src/main/java/org/glassfish/jdbc/pool/monitor/JdbcConnPoolAppProbeProvider.java
trunk/main/appserver/jdbc/jdbc-runtime/src/main/java/org/glassfish/jdbc/util/JdbcResourcesUtil.java
trunk/main/appserver/jdbc/jdbc-runtime/src/main/resources
trunk/main/appserver/jdbc/jdbc-runtime/src/main/java/org/glassfish/jdbc/util
trunk/main/appserver/jdbc/jdbc-runtime/src/main/resources/org/glassfish/jdbc
trunk/main/appserver/jdbc/jdbc-config/src/main/java/org/glassfish/jdbc/config/validators/JdbcConnectionPoolValidator.java
trunk/main/appserver/jdbc/jdbc-runtime/src/main/resources/org/glassfish/jdbc/deployer
trunk/main/appserver/jdbc/jdbc-runtime/src/main
trunk/main/appserver/jdbc/jdbc-runtime/src/test/java/org/glassfish/jdbcruntime
trunk/main/appserver/jdbc/jdbc-runtime/src/main/java/org/glassfish/jdbcruntime/deployment/annotation/handlers/DataSourceDefinitionHandler.java
trunk/main/appserver/jdbc/jdbc-config/src/main/java/org/glassfish/jdbc/config/validators/JdbcConnectionPoolConstraints.java
trunk/main/appserver/jdbc/jdbc-runtime/src/main/java/org/glassfish/jdbc/deployer/JdbcResourceDeployer.java
trunk/main/appserver/jdbc/jdbc-runtime/src/main/java/org/glassfish
trunk/main/appserver/jdbc/jdbc-runtime/src/main/java/org/glassfish/jdbc/recovery
trunk/main/appserver/jdbc/jdbc-runtime/src/test/java/org/glassfish/jdbcruntime/config/validation/ReferenceConstrainTest.java
trunk/main/appserver/jdbc/jdbc-config/src/main/java/org/glassfish
trunk/main/appserver/jdbc/jdbc-runtime/src/test/java
trunk/main/appserver/jdbc/jdbc-config/src/main/java/org/glassfish/jdbc/config/JdbcConnectionPool.java
trunk/main/appserver/jdbc/jdbc-runtime/src/main/java/org/glassfish/jdbc/config
trunk/main/appserver/jdbc/jdbc-config/src/main/java/org/glassfish/jdbc/config
trunk/main/appserver/jdbc/jdbc-runtime/src/test/java/org/glassfish/jdbcruntime/config/validation
trunk/main/appserver/jdbc/jdbc-runtime/src/main/java/org/glassfish/jdbc/pool
trunk/main/appserver/jdbc/jdbc-config/src/main/java/org/glassfish/jdbc/config/validators/JdbcConnectionPoolConstraint.java
trunk/main/appserver/jdbc/jdbc-runtime/src/main/java/org/glassfish/jdbc/pool/monitor/JdbcConnPoolAppStatsProvider.java
trunk/main/appserver/jdbc/jdbc-runtime/src/test/java/org/glassfish/jdbcruntime/config/ConfigApiTest.java
trunk/main/appserver/jdbc/jdbc-runtime/src
trunk/main/appserver/jdbc/jdbc-runtime/src/main/java/org/glassfish/jdbcruntime
trunk/main/appserver/jdbc/jdbc-runtime/src/main/java/org
trunk/main/appserver/jdbc/jdbc-runtime/src/main/java/org/glassfish/jdbcruntime/deployment/annotation/handlers/DataSourceDefinitionsHandler.java
trunk/main/appserver/jdbc/jdbc-config/src
trunk/main/appserver/jdbc/jdbc-config/src/main
trunk/main/appserver/jdbc/jdbc-runtime/src/test
trunk/main/appserver/jdbc/jdbc-runtime
trunk/main/appserver/connectors/connectors-runtime/src/main/java/com/sun/enterprise/connectors/ConnectionPoolMonitoringExtension.java
trunk/main/appserver/jdbc/jdbc-runtime/src/test/resources/DomainTest.xml
trunk/main/appserver/jdbc/jdbc-runtime/src/main/java/org/glassfish/jdbcruntime/JdbcPoolMonitoringExtension.java
trunk/main/appserver/jdbc/jdbc-runtime/src/main/java/org/glassfish/jdbcruntime/deployment
trunk/main/appserver/jdbc/jdbc-config/src/main/java/org/glassfish/jdbc/config/validators





[GLASSFISH-19246] Removing Infected connections feature in glassfish jdbc connection pool Created: 26/Oct/12  Updated: 26/Oct/12

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: future release
Fix Version/s: None

Type: New Feature Priority: Major
Reporter: Shalini Assignee: Shalini
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Remove infected connections is a feature to configure whether or not unwrapping implies that a connection should be considered infected and not reused. When a connection is unwrapped, this connection is marked for deletion on returning to the connection pool. When an application closes a logical connection, the underlying physical connection is not returned to the connection pool. Instead, the physical connection is closed and recreated.

This parameter must be applicable only if an application gets a connection from the connection pool and does an unwrap() on that object. The unwrap() method returns a vendor specific connection to the caller which might leave the connection pool in an inconsistent state.

The new attribute remove-infected-connections must remove such connections from the connection pool. Default value of this attribute should be false.






[GLASSFISH-19245] FIXED type of statement caching support in glassfish jdbc connection pool Created: 26/Oct/12  Updated: 26/Oct/12

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: future release
Fix Version/s: None

Type: New Feature Priority: Major
Reporter: Shalini Assignee: Shalini
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Statement caching feature allows for an application to cache highly-used statements, prepared statements and callable statements during start-up processing.

A new statement cache eviction strategy FIXED maintains the statement cache size based on an existing attribute statement-cache-size unless the cache is manually cleared. The statements executed by applications on the connection are cached until the statement-cache-size is reached. When additional statements are used, they are not cached.

A new attribute statement-cache-type should be introduced which will indicate the type of statement cache type to be used by applications. Default value of this attribute is LRU (Least Recently Used) where the least recently used statement is removed when a new statement is used.






[GLASSFISH-19244] Seconds to trust support in GlassFish jdbc connection pool Created: 26/Oct/12  Updated: 26/Oct/12

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: future release
Fix Version/s: None

Type: New Feature Priority: Major
Reporter: Shalini Assignee: Shalini
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Seconds to trust is an enhancement to validate-atmost-once attribute that indicates the number of seconds within a connection usage that the connection is trusted as valid and connection validation test is skipped.

Based on the last validated or last time usage of the connection, if the time interval between two connection acquisitions is less than seconds-to-trust configuration, the connection validation must be skipped.

Seconds to trust feature can be enabled by setting the connection pool configuration attribute validate-atmost-once. Default value of this attribute is zero, indicating that the seconds to trust feature is turned off.






[GLASSFISH-19243] Validation table name enhancement in GlassFish jdbc connection pool Created: 26/Oct/12  Updated: 26/Oct/12

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: future release
Fix Version/s: None

Type: New Feature Priority: Major
Reporter: Shalini Assignee: Shalini
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The attribute validation-table-name in glassfish jdbc-connection-pool accepts only a table name as input. This must be enhanced to accept as input, a string "SQL" followed by a space and sql code.

This feature is only applicable when is-connection-validation-required attribute is set to true and connection-validation-method is table.

This feature provides a means of performing connection validation test when there is a sql code specified.






[GLASSFISH-19242] Fatal error code handling Created: 26/Oct/12  Updated: 26/Oct/12

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: future release
Fix Version/s: None

Type: New Feature Priority: Major
Reporter: Shalini Assignee: Shalini
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Fatal error codes is a new feature that indicates that the back-end database with which the datasource communicates is no longer accessible on a connection. The connection is marked invalid and is removed from the connection pool. This feature ensures to keep bad connections out of the pool.

Pre-defined error codes for Oracle JDBC driver and Derby should be added. Additionally, a mechanism for adding error codes for other JDBC drivers should be provided.

A new attribute called fatal-error-codes should be introduced for glassfish jdbc-connection-pool that can take in user input of fatal error codes. When any of these error codes occur, the connection is marked as bad.






[GLASSFISH-19241] EE7: Default Data Source Created: 25/Oct/12  Updated: 26/Oct/12  Resolved: 26/Oct/12

Status: Closed
Project: glassfish
Component/s: jdbc
Affects Version/s: None
Fix Version/s: 4.0

Type: New Feature Priority: Major
Reporter: Tom Mueller Assignee: Shalini
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: ee7platspec

 Description   

This RFE is for implementing in GlassFish Java EE 7 section EE.5.20, "Default Data Source," which requires that a default data source be made available to the application.



 Comments   
Comment by Shalini [ 26/Oct/12 ]

Duplicate of JIRA 19187.





[GLASSFISH-19218] Error Creating Oracle data-source on GlassFish 4 Build 59 Created: 23/Oct/12  Updated: 10/Feb/13

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: 4.0_b59
Fix Version/s: None

Type: Bug Priority: Major
Reporter: tware Assignee: sfelts
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows XP - 32 bit. GlassFish installed from zip file. Oracle 11.2.0.2 DB.



 Description   

We are trying to create a datasource that uses Oracle in GlassFish 4 build 59. We put the JDBC driver in <domain>/lib/ext.

Using defaults when setting up the Oracle data-source.

javax.sql.DataSource

oracle.jdbc.pool.OracleDataSource -> is definitely in our jdbc jar

On Build 55 this succeeds.

In Build 59, when I try to ping the DB in this config, I get:

Ping Connection Pool failed for ottvm035. Class name is wrong or classpath is not set for : oracle.jdbc.pool.OracleDataSource Please check the server.log for more details.

The logged exception is:

[#|2012-10-23T14:35:22.869-0400|SEVERE|44.0|javax.enterprise.resource.resourceadapter.com.sun.gjc.util|_ThreadID=16;_ThreadName=admin-listener(3);_TimeMillis=1351017322869;_LevelValue=1000;_MessageID=jdbc.exc_cnfe_ds;|RAR5099 : Wrong class name or classpath for Datasource Object
java.lang.ClassNotFoundException: oracle.jdbc.pool.OracleDataSource
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at com.sun.gjc.common.DataSourceObjectBuilder.getDataSourceObject(DataSourceObjectBuilder.java:285)
at com.sun.gjc.common.DataSourceObjectBuilder.constructDataSourceObject(DataSourceObjectBuilder.java:114)
at com.sun.gjc.spi.ManagedConnectionFactoryImpl.getDataSource(ManagedConnectionFactoryImpl.java:1300)
at com.sun.gjc.spi.DSManagedConnectionFactory.getDataSource(DSManagedConnectionFactory.java:163)
at com.sun.gjc.spi.DSManagedConnectionFactory.createManagedConnection(DSManagedConnectionFactory.java:102)
at com.sun.enterprise.connectors.service.ConnectorConnectionPoolAdminServiceImpl.getUnpooledConnection(ConnectorConnectionPoolAdminServiceImpl.java:696)
at com.sun.enterprise.connectors.service.ConnectorConnectionPoolAdminServiceImpl.testConnectionPool(ConnectorConnectionPoolAdminServiceImpl.java:425)
at com.sun.enterprise.connectors.ConnectorRuntime.pingConnectionPool(ConnectorRuntime.java:1143)
at org.glassfish.connectors.admin.cli.PingConnectionPool.execute(PingConnectionPool.java:143)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:549)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:570)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1450)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:118)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1760)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1710)
at org.glassfish.admin.rest.utils.ResourceUtil.runCommand(ResourceUtil.java:260)
at org.glassfish.admin.rest.utils.ResourceUtil.runCommand(ResourceUtil.java:249)
at org.glassfish.admin.rest.utils.ResourceUtil.runCommand(ResourceUtil.java:240)
at org.glassfish.admin.rest.resources.TemplateExecCommand.executeCommand(TemplateExecCommand.java:150)
at org.glassfish.admin.rest.resources.TemplateCommandGetResource.processGet(TemplateCommandGetResource.java:77)
at sun.reflect.GeneratedMethodAccessor151.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.glassfish.jersey.server.model.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:80)
at org.glassfish.jersey.server.model.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:107)
at org.glassfish.jersey.server.model.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:146)
at org.glassfish.jersey.server.model.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:80)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:304)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:299)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:90)
at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:198)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:316)
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:174)
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:761)
at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:306)
at org.glassfish.admin.rest.adapter.RestAdapter$1.service(RestAdapter.java:327)
at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:189)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispatch(HK2Dispatcher.java:113)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:236)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:164)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:175)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:265)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:134)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:781)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:578)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:558)
at java.lang.Thread.run(Thread.java:662)

#]


 Comments   
Comment by shreedhar_ganapathy [ 13/Dec/12 ]

-> JDBC
-> Michael for appropriate reassigning





[GLASSFISH-19187] Implement support for Java EE platform default datasource Created: 19/Oct/12  Updated: 15/Dec/12  Resolved: 14/Dec/12

Status: Resolved
Project: glassfish
Component/s: jdbc
Affects Version/s: 4.0
Fix Version/s: 4.0

Type: New Feature Priority: Major
Reporter: Shalini Assignee: Shalini
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: ee7platspec

 Description   

The Default Datasource as mentioned by the Java EE 7 spec : EE 5.18 http://java.net/projects/javaee-spec/downloads/download/JavaEE_Platform_Spec_EDR.pdf

The specification states the following :

The Java EE Product Provider must also provide a preconfigured, default data source for use by the application in accessing this database.

The Application Component Provider or Deployer may explicitly bind a DataSource resource reference to the default data source using the lookup element of the Resource annotation or the lookup-name element of the resource-ref deployment descriptor element. For example,

@Resource(name="myDataSource",
lookup="java:comp/defaultDataSource")
DataSource myDS;

In the absence of such a binding for a data source resource reference, the reference will map to a preconfigured data source for the product's default database.

For example, the following will map to a preconfigured data source for the product's default database:

@Resource(name="myDataSource")
DataSource myDS;


 Comments   
Comment by Shalini [ 14/Dec/12 ]

As per http://java.net/projects/javaee-spec/downloads/download/JavaEE_Platform_Spec_EDR2_candidate.pdf the default datasource JNDI name has changed to java:comp/DefaultDataSource.

Comment by Shalini [ 14/Dec/12 ]

Added support for the default datasource implementation. Tested both the @Resource annotation as well as descriptor use-cases, where lookup-name is present/absent.
The default datasource resource reference is bound to jdbc/__default internally.

Sending appserver/deployment/dol/src/main/java/com/sun/enterprise/deployment/util/ComponentValidator.java
Adding appserver/jdbc/jdbc-runtime/src/main/java/org/glassfish/jdbcruntime/DefaultDataSource.java
Transmitting file data ..
Committed revision 57565.

Comment by Antonio Goncalves [ 15/Dec/12 ]

We also mentioned having default producers. Will this be possible : @Inject DataSource myDS





[GLASSFISH-19120] "Unable to get ClientInfo for connection" logged at INFO level zillions of times with Sybase jConnect v7 Created: 02/Oct/12  Updated: 22/Jan/15

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: hanafey Assignee: sfelts
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Comments   
Comment by hanafey [ 02/Oct/12 ]

The following is a sample of the logged messages:

[#|2012-10-02T13:10:16.392-0400|INFO|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.spi|_ThreadID=103;_ThreadName=Thread-2;|
RAR7114: Unable to get ClientInfo for connection |#]

[#|2012-10-02T13:10:16.399-0400|INFO|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.spi|_ThreadID=103;_ThreadName=Thread-2;|
RAR7115: Unable to set ClientInfo for connection|#]

[#|2012-10-02T13:10:16.402-0400|INFO|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.spi|_ThreadID=103;_ThreadName=Thread-2;|
RAR7114: Unable to get ClientInfo for connection |#]

[#|2012-10-02T13:10:16.403-0400|INFO|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.spi|_ThreadID=103;_ThreadName=Thread-2;|
RAR7115: Unable to set ClientInfo for connection|#]

The INFO level logging happens with Sybase jConnect 7 because in the method below (in ConnectionHolder40), the "getClientInfoProperties" method throws "com.sybase.jdbc4.utils.UnimplementedOperationException: The method com.sybase.jdbc4.jdbc.SybDatabaseMetaData.public ResultSet getClientInfoProperties() has not been completed and should not be called."

If this statement was moved inside of the try block, then the logging would only happen at level FINEST (but the catch block would need a more general exception since the Sybase exception extends java.lang.UnsupportedOperationException.

    private boolean isSupportClientInfo() throws ResourceException, SQLException {
        Boolean isSupportClientInfo = getManagedConnection().isClientInfoSupported();
        if (isSupportClientInfo != null) {
            return isSupportClientInfo;
        } else {
            ResultSet rs = getManagedConnection().getCachedDatabaseMetaData().getClientInfoProperties();  <<<==============
            try {
                isSupportClientInfo = rs.next();
                getManagedConnection().setClientInfoSupported(isSupportClientInfo);
                return isSupportClientInfo;
            } finally {
                try {
                rs.close();
                } catch(SQLException ex) {
                    if(_logger.isLoggable(Level.FINEST)) {
                        _logger.log(Level.FINEST, "jdbc.unable_to_get_client_info", ex);
                    }
                    return false;
                }
            }
        }
    }
Comment by kithouna [ 05/Apr/13 ]

The H2 Database driver (1.3.170) has the exact same issue. It's rather annoying...

Comment by andykaufmann [ 10/Dec/13 ]

GlassFish 4.0 and h2 version 1.3.172 same warning:

Information: RAR7114: Unable to get ClientInfo for connection
Information: RAR7115: Unable to set ClientInfo for connection

If someone knows how to disable this.. thank you

Comment by jifeng [ 22/Jan/15 ]

Hi
andykaufmann

>If someone knows how to disable this.. thank you
If you are using the JDBC3.0 driver , the messages will not happen.





[GLASSFISH-19086] problem about enabing jdbc resource on a stopped cluster instance Created: 19/Sep/12  Updated: 10/Feb/13

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: TangYong Assignee: sfelts
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

1 Windows XP
2 gf trunk 2012/09/18



 Description   

On admin console, while enabling JDBC Resource(jdbc/__default) on cluster target, page displayed the following error message:

An error occurred during replication Failure: Command create-resource-ref failed on server instance in1: javax.ws.rs.client.ClientException: java.net.ConnectException: Connection refused: connect Failure: Command create-resource-ref failed on server instance in1: javax.ws.rs.client.ClientException: java.net.ConnectException: Connection refused: connect

However, when openning domain.xml, you will find that the following tag has been added into cluster and cluster instance's configuration.

<resource-ref ref="jdbc/__default"></resource-ref>



 Comments   
Comment by Anissa Lam [ 19/Sep/12 ]

Thats an error from the backend. Transfer to jdbc for initial evaluation.





[GLASSFISH-19056] Deadlock with failing connection pool and associate-with-thread="true" Created: 05/Sep/12  Updated: 10/Feb/13

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: 3.1, 3.1.2
Fix Version/s: None

Type: Bug Priority: Major
Reporter: ancoron Assignee: sfelts
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

When configuring a JDBC connection pool with attribute associate-with-thread="true" and then failing stopping the DBMS ungracefully the following thread deadlock can appear if the container is under parallel load:

Found one Java-level deadlock:
=============================
"TP-Processor68":
  waiting to lock monitor 0x0000000041dd4f68 (object 0x0000000463c52d60, a java.lang.Object),
  which is held by "TP-Processor42"
"TP-Processor42":
  waiting to lock monitor 0x000000004363e490 (object 0x0000000403ae9318, a java.util.ArrayList),
  which is held by "TP-Processor68"

The offending thread stacks:

"TP-Processor68":
        at com.sun.enterprise.resource.pool.AssocWithThreadResourcePool.deleteResource(AssocWithThreadResourcePool.java:296)
        - waiting to lock <0x0000000463c52d60> (a java.lang.Object)
        at com.sun.enterprise.resource.pool.datastructure.ListDataStructure.removeAll(ListDataStructure.java:213)
        - locked <0x0000000403ae8d78> (a java.util.ArrayList)
        - locked <0x0000000403ae9318> (a java.util.ArrayList)
        at com.sun.enterprise.resource.pool.ConnectionPool.emptyPool(ConnectionPool.java:1254)
        at com.sun.enterprise.resource.pool.ConnectionPool.doFailAllConnectionsProcessing(ConnectionPool.java:1135)
        at com.sun.enterprise.resource.pool.ConnectionPool.resourceErrorOccurred(ConnectionPool.java:1091)
        at com.sun.enterprise.resource.pool.PoolManagerImpl.putbackResourceToPool(PoolManagerImpl.java:417)
        at com.sun.enterprise.resource.pool.PoolManagerImpl.resourceErrorOccurred(PoolManagerImpl.java:389)
        at com.sun.enterprise.resource.allocator.ConnectorAllocator$ConnectionListenerImpl.connectionErrorOccurred(ConnectorAllocator.java:108)
        at com.sun.gjc.spi.ManagedConnection.connectionErrorOccurred(ManagedConnection.java:792)
        at com.sun.gjc.spi.ManagedConnectionFactory.getInvalidConnections(ManagedConnectionFactory.java:280)
        at com.sun.enterprise.resource.allocator.AbstractConnectorAllocator.getInvalidConnections(AbstractConnectorAllocator.java:111)
        at com.sun.enterprise.resource.allocator.AbstractConnectorAllocator.isConnectionValid(AbstractConnectorAllocator.java:122)
        at com.sun.enterprise.resource.pool.ConnectionPool.isConnectionValid(ConnectionPool.java:662)
        at com.sun.enterprise.resource.pool.AssocWithThreadResourcePool.prefetch(AssocWithThreadResourcePool.java:130)
        - locked <0x00000004644b2cc0> (a java.lang.Object)
        at com.sun.enterprise.resource.pool.ConnectionPool.internalGetResource(ConnectionPool.java:520)
        at com.sun.enterprise.resource.pool.ConnectionPool.getResource(ConnectionPool.java:381)
        at com.sun.enterprise.resource.pool.PoolManagerImpl.getResourceFromPool(PoolManagerImpl.java:242)
        at com.sun.enterprise.resource.pool.PoolManagerImpl.getResource(PoolManagerImpl.java:167)
        at com.sun.enterprise.connectors.ConnectionManagerImpl.getResource(ConnectionManagerImpl.java:335)
        at com.sun.enterprise.connectors.ConnectionManagerImpl.internalGetConnection(ConnectionManagerImpl.java:304)
        at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:190)
        at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:165)
        at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:160)
        at com.sun.gjc.spi.base.DataSource.getConnection(DataSource.java:110)
        at org.apache.ibatis.session.defaults.DefaultSqlSessionFactory.openSessionFromDataSource(DefaultSqlSessionFactory.java:73)
        at org.apache.ibatis.session.defaults.DefaultSqlSessionFactory.openSession(DefaultSqlSessionFactory.java:36)
        at org.activiti.engine.impl.db.DbSqlSession.<init>(DbSqlSession.java:86)
        at org.activiti.engine.impl.db.DbSqlSessionFactory.openSession(DbSqlSessionFactory.java:80)
        at org.activiti.engine.impl.interceptor.CommandContext.getSession(CommandContext.java:179)
        at org.activiti.engine.impl.persistence.AbstractManager.getSession(AbstractManager.java:56)
        at org.activiti.engine.impl.persistence.AbstractManager.getDbSqlSession(AbstractManager.java:52)
        at org.activiti.engine.impl.persistence.entity.TaskManager.findTasksByQueryCriteria(TaskManager.java:91)
        at org.activiti.engine.impl.TaskQueryImpl.executeList(TaskQueryImpl.java:368)
        at org.activiti.engine.impl.AbstractQuery.execute(AbstractQuery.java:138)
        at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
        at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:42)
        at org.activiti.engine.impl.interceptor.JtaTransactionInterceptor.execute(JtaTransactionInterceptor.java:59)
        at org.activiti.engine.impl.interceptor.JtaRetryInterceptor.skipRetry(JtaRetryInterceptor.java:53)
        at org.activiti.engine.impl.interceptor.JtaRetryInterceptor.execute(JtaRetryInterceptor.java:46)
        at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
        at org.activiti.engine.impl.AbstractQuery.list(AbstractQuery.java:112)
        at com.profitbricks.process.impl.BusinessProcessManagementServiceImpl$1.call(BusinessProcessManagementServiceImpl.java:124)
        at com.profitbricks.process.impl.BusinessProcessManagementServiceImpl$1.call(BusinessProcessManagementServiceImpl.java:120)
        at com.profitbricks.process.impl.BusinessProcessManagementServiceImpl.execute(BusinessProcessManagementServiceImpl.java:361)
        at com.profitbricks.process.impl.BusinessProcessManagementServiceImpl.getUserTasksByTaskVariable(BusinessProcessManagementServiceImpl.java:129)
        at sun.reflect.GeneratedMethodAccessor441.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 com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doAround(SystemInterceptorProxy.java:162)
        at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:144)
        at sun.reflect.GeneratedMethodAccessor175.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 $Proxy262.getUserTasksByTaskVariable(Unknown Source)
        at com.profitbricks.provisioning.impl.ws.ProvisioningServiceWS.waitForProcess(ProvisioningServiceWS.java:114)
        at com.profitbricks.provisioning.impl.ws.ProvisioningServiceWS.addInfo(ProvisioningServiceWS.java:84)
        at sun.reflect.GeneratedMethodAccessor353.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.glassfish.webservices.InstanceResolverImpl$1.invoke(InstanceResolverImpl.java:143)
        at com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:150)
        at com.sun.xml.ws.server.sei.EndpointMethodHandler.invoke(EndpointMethodHandler.java:261)
        at com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:100)
        at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:641)
        at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:600)
        at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:585)
        at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:482)
        - locked <0x0000000463c93748> (a com.sun.xml.ws.api.pipe.Fiber)
        at com.sun.xml.ws.api.pipe.helper.AbstractTubeImpl.process(AbstractTubeImpl.java:116)
        at org.glassfish.webservices.MonitoringPipe.process(MonitoringPipe.java:142)
        at com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:119)
        at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:641)
        at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:600)
        at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:585)
        at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:482)
        - locked <0x0000000463c93748> (a com.sun.xml.ws.api.pipe.Fiber)
        at com.sun.xml.ws.api.pipe.helper.AbstractTubeImpl.process(AbstractTubeImpl.java:116)
        at com.sun.enterprise.security.webservices.CommonServerSecurityPipe.processRequest(CommonServerSecurityPipe.java:212)
        at com.sun.enterprise.security.webservices.CommonServerSecurityPipe.process(CommonServerSecurityPipe.java:144)
        at com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:119)
        at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:641)
        at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:600)
        at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:585)
        at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:482)
        - locked <0x0000000463c93748> (a com.sun.xml.ws.api.pipe.Fiber)
        at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:314)
        at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:608)
        at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:259)
        at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:162)
        at org.glassfish.webservices.JAXWSServlet.doPost(JAXWSServlet.java:145)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
        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.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
        at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:323)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:227)
        at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:232)
        at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:337)
        at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:817)
        at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:746)
        at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:939)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
        at java.lang.Thread.run(Thread.java:662)
"TP-Processor42":
        at com.sun.enterprise.resource.pool.datastructure.ListDataStructure.removeAll(ListDataStructure.java:208)
        - waiting to lock <0x0000000403ae9318> (a java.util.ArrayList)
        at com.sun.enterprise.resource.pool.ConnectionPool.emptyPool(ConnectionPool.java:1254)
        at com.sun.enterprise.resource.pool.ConnectionPool.doFailAllConnectionsProcessing(ConnectionPool.java:1135)
        at com.sun.enterprise.resource.pool.ConnectionPool.resourceErrorOccurred(ConnectionPool.java:1091)
        at com.sun.enterprise.resource.pool.PoolManagerImpl.putbackResourceToPool(PoolManagerImpl.java:417)
        at com.sun.enterprise.resource.pool.PoolManagerImpl.resourceErrorOccurred(PoolManagerImpl.java:389)
        at com.sun.enterprise.resource.allocator.ConnectorAllocator$ConnectionListenerImpl.connectionErrorOccurred(ConnectorAllocator.java:108)
        at com.sun.gjc.spi.ManagedConnection.connectionErrorOccurred(ManagedConnection.java:792)
        at com.sun.gjc.spi.ManagedConnectionFactory.getInvalidConnections(ManagedConnectionFactory.java:280)
        at com.sun.enterprise.resource.allocator.AbstractConnectorAllocator.getInvalidConnections(AbstractConnectorAllocator.java:111)
        at com.sun.enterprise.resource.allocator.AbstractConnectorAllocator.isConnectionValid(AbstractConnectorAllocator.java:122)
        at com.sun.enterprise.resource.pool.ConnectionPool.isConnectionValid(ConnectionPool.java:662)
        at com.sun.enterprise.resource.pool.AssocWithThreadResourcePool.prefetch(AssocWithThreadResourcePool.java:130)
        - locked <0x0000000463c52d60> (a java.lang.Object)
        at com.sun.enterprise.resource.pool.ConnectionPool.internalGetResource(ConnectionPool.java:520)
        at com.sun.enterprise.resource.pool.ConnectionPool.getResource(ConnectionPool.java:381)
        at com.sun.enterprise.resource.pool.PoolManagerImpl.getResourceFromPool(PoolManagerImpl.java:242)
        at com.sun.enterprise.resource.pool.PoolManagerImpl.getResource(PoolManagerImpl.java:167)
        at com.sun.enterprise.connectors.ConnectionManagerImpl.getResource(ConnectionManagerImpl.java:335)
        at com.sun.enterprise.connectors.ConnectionManagerImpl.internalGetConnection(ConnectionManagerImpl.java:304)
        at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:190)
        at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:165)
        at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:160)
        at com.sun.gjc.spi.base.DataSource.getConnection(DataSource.java:110)
        at org.apache.ibatis.session.defaults.DefaultSqlSessionFactory.openSessionFromDataSource(DefaultSqlSessionFactory.java:73)
        at org.apache.ibatis.session.defaults.DefaultSqlSessionFactory.openSession(DefaultSqlSessionFactory.java:36)
        at org.activiti.engine.impl.db.DbSqlSession.<init>(DbSqlSession.java:86)
        at org.activiti.engine.impl.db.DbSqlSessionFactory.openSession(DbSqlSessionFactory.java:80)
        at org.activiti.engine.impl.interceptor.CommandContext.getSession(CommandContext.java:179)
        at org.activiti.engine.impl.persistence.AbstractManager.getSession(AbstractManager.java:56)
        at org.activiti.engine.impl.persistence.AbstractManager.getDbSqlSession(AbstractManager.java:52)
        at org.activiti.engine.impl.persistence.entity.TaskManager.findTasksByQueryCriteria(TaskManager.java:91)
        at org.activiti.engine.impl.TaskQueryImpl.executeList(TaskQueryImpl.java:368)
        at org.activiti.engine.impl.AbstractQuery.execute(AbstractQuery.java:138)
        at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
        at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:42)
        at org.activiti.engine.impl.interceptor.JtaTransactionInterceptor.execute(JtaTransactionInterceptor.java:59)
        at org.activiti.engine.impl.interceptor.JtaRetryInterceptor.skipRetry(JtaRetryInterceptor.java:53)
        at org.activiti.engine.impl.interceptor.JtaRetryInterceptor.execute(JtaRetryInterceptor.java:46)
        at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
        at org.activiti.engine.impl.AbstractQuery.list(AbstractQuery.java:112)
        at com.profitbricks.process.impl.BusinessProcessManagementServiceImpl$1.call(BusinessProcessManagementServiceImpl.java:124)
        at com.profitbricks.process.impl.BusinessProcessManagementServiceImpl$1.call(BusinessProcessManagementServiceImpl.java:120)
        at com.profitbricks.process.impl.BusinessProcessManagementServiceImpl.execute(BusinessProcessManagementServiceImpl.java:361)
        at com.profitbricks.process.impl.BusinessProcessManagementServiceImpl.getUserTasksByTaskVariable(BusinessProcessManagementServiceImpl.java:129)
        at sun.reflect.GeneratedMethodAccessor441.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 com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doAround(SystemInterceptorProxy.java:162)
        at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:144)
        at sun.reflect.GeneratedMethodAccessor175.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 $Proxy262.getUserTasksByTaskVariable(Unknown Source)
        at com.profitbricks.provisioning.impl.ws.ProvisioningServiceWS.waitForProcess(ProvisioningServiceWS.java:114)
        at com.profitbricks.provisioning.impl.ws.ProvisioningServiceWS.addInfo(ProvisioningServiceWS.java:84)
        at sun.reflect.GeneratedMethodAccessor353.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.glassfish.webservices.InstanceResolverImpl$1.invoke(InstanceResolverImpl.java:143)
        at com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:150)
        at com.sun.xml.ws.server.sei.EndpointMethodHandler.invoke(EndpointMethodHandler.java:261)
        at com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:100)
        at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:641)
        at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:600)
        at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:585)
        at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:482)
        - locked <0x000000046439ce68> (a com.sun.xml.ws.api.pipe.Fiber)
        at com.sun.xml.ws.api.pipe.helper.AbstractTubeImpl.process(AbstractTubeImpl.java:116)
        at org.glassfish.webservices.MonitoringPipe.process(MonitoringPipe.java:142)
        at com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:119)
        at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:641)
        at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:600)
        at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:585)
        at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:482)
        - locked <0x000000046439ce68> (a com.sun.xml.ws.api.pipe.Fiber)
        at com.sun.xml.ws.api.pipe.helper.AbstractTubeImpl.process(AbstractTubeImpl.java:116)
        at com.sun.enterprise.security.webservices.CommonServerSecurityPipe.processRequest(CommonServerSecurityPipe.java:212)
        at com.sun.enterprise.security.webservices.CommonServerSecurityPipe.process(CommonServerSecurityPipe.java:144)
        at com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:119)
        at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:641)
        at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:600)
        at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:585)
        at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:482)
        - locked <0x000000046439ce68> (a com.sun.xml.ws.api.pipe.Fiber)
        at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:314)
        at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:608)
        at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:259)
        at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:162)
        at org.glassfish.webservices.JAXWSServlet.doPost(JAXWSServlet.java:145)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
        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.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
        at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:323)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:227)
        at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:232)
        at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:337)
        at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:817)
        at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:746)
        at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:939)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
        at java.lang.Thread.run(Thread.java:662)


Although the thread stacks are from a GlassFish 3.1 installation I see the same problem at least in GlassFish 3.1.2.



 Comments   
Comment by shreedhar_ganapathy [ 13/Dec/12 ]

-> Michael Chen for appropriate reassignment and triaging





[GLASSFISH-19019] Unable to Create/Edit JDBC Connection Pool Properties Created: 19/Aug/12  Updated: 10/Feb/13

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: 4.0_b50_ms4
Fix Version/s: None

Type: Bug Priority: Major
Reporter: dbeltz Assignee: sfelts
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 7 64bit, Mysql 5.5 with GlassFish Server Open Source Edition 4.0 (build 50) C:\glassfish3\glassfish\domains\domain1\lib\ext\mysql-connector-java-5.1.21-bin.jar



 Description   

I have had no problems with glassfish 3.1 and figured I would start working with 4.0 on a new application I am building. Removed Glassfish 3.1 and Installed 4.0 B50 and can not create my database connector. The same connector I had under 3.1. Mysql has not changed nor has my apache.

When I attempt to create a pool I get "An error has occurred"

with a log of

Log Entry Detail

Timestamp
Aug 19, 2012 14:41:23.946 Aug 19, 2012 14:40:47.733 Aug 19, 2012 14:40:31.820 Aug 19, 2012 14:40:31.490 Aug 19, 2012 14:40:24.515 Aug 19, 2012 14:40:24.510 Aug 19, 2012 14:40:24.398 Aug 19, 2012 14:40:10.555 Aug 19, 2012 14:40:08.558 Aug 19, 2012 14:40:08.437 Aug 19, 2012 14:40:06.922 Aug 19, 2012 14:40:06.795 Aug 19, 2012 14:39:59.652 Aug 19, 2012 14:39:59.650 Aug 19, 2012 14:39:59.571 Aug 19, 2012 14:39:26.819 Aug 19, 2012 14:39:26.553 Aug 19, 2012 14:39:18.660 Aug 19, 2012 14:39:18.653 Aug 19, 2012 14:39:18.537 Aug 19, 2012 14:39:05.670 Aug 19, 2012 14:39:03.211 Aug 19, 2012 14:39:03.053 Aug 19, 2012 14:39:00.194 Aug 19, 2012 14:38:55.399 Aug 19, 2012 14:38:55.252 Aug 19, 2012 14:37:24.704 Aug 19, 2012 14:37:24.374 Aug 19, 2012 14:37:05.382 Aug 19, 2012 14:37:05.087 Aug 19, 2012 14:36:52.451 Aug 19, 2012 14:36:52.140 Aug 19, 2012 14:36:39.945 Aug 19, 2012 14:36:39.689 Aug 19, 2012 14:36:27.217 Aug 19, 2012 14:36:26.943 Aug 19, 2012 14:36:19.718 Aug 19, 2012 14:36:19.712 Aug 19, 2012 14:36:19.537 Aug 19, 2012 14:35:58.770
Log Level
WARNING
Logger
javax.enterprise.resource.webcontainer.jsf.context javax.enterprise.resource.webcontainer.jsf.context javax.enterprise.resource.webcontainer.jsf.context javax.enterprise.resource.webcontainer.jsf.context org.glassfish.admingui org.glassfish.jersey.server.ApplicationHandler javax.enterprise.resource.webcontainer.jsf.context javax.enterprise.resource.webcontainer.jsf.context javax.enterprise.resource.webcontainer.jsf.context javax.enterprise.resource.webcontainer.jsf.context javax.enterprise.resource.webcontainer.jsf.context javax.enterprise.resource.webcontainer.jsf.context org.glassfish.admingui org.glassfish.jersey.server.ApplicationHandler javax.enterprise.resource.webcontainer.jsf.context javax.enterprise.resource.webcontainer.jsf.context javax.enterprise.resource.webcontainer.jsf.context org.glassfish.admingui org.glassfish.jersey.server.ApplicationHandler javax.enterprise.resource.webcontainer.jsf.context javax.enterprise.resource.webcontainer.jsf.context javax.enterprise.resource.webcontainer.jsf.context javax.enterprise.resource.webcontainer.jsf.context javax.enterprise.resource.webcontainer.jsf.context javax.enterprise.resource.webcontainer.jsf.context javax.enterprise.resource.webcontainer.jsf.context javax.enterprise.resource.webcontainer.jsf.context javax.enterprise.resource.webcontainer.jsf.context javax.enterprise.resource.webcontainer.jsf.context javax.enterprise.resource.webcontainer.jsf.context javax.enterprise.resource.webcontainer.jsf.context javax.enterprise.resource.webcontainer.jsf.context javax.enterprise.resource.webcontainer.jsf.context javax.enterprise.resource.webcontainer.jsf.context javax.enterprise.resource.webcontainer.jsf.context javax.enterprise.resource.webcontainer.jsf.context javax.enterprise.system.container.web.com.sun.enterprise.web javax.enterprise.resource.webcontainer.jsf.context javax.enterprise.resource.webcontainer.jsf.context javax.enterprise.resource.webcontainer.jsf.context
Name-Value Pairs
_ThreadID=52;_ThreadName=Thread-2; _ThreadID=611;_ThreadName=Thread-2; _ThreadID=52;_ThreadName=Thread-2; _ThreadID=52;_ThreadName=Thread-2; _ThreadID=611;_ThreadName=Thread-2; _ThreadID=52;_ThreadName=Thread-2; _ThreadID=611;_ThreadName=Thread-2; _ThreadID=52;_ThreadName=Thread-2; _ThreadID=611;_ThreadName=Thread-2; _ThreadID=70;_ThreadName=Thread-2; _ThreadID=52;_ThreadName=Thread-2; _ThreadID=611;_ThreadName=Thread-2; _ThreadID=70;_ThreadName=Thread-2; _ThreadID=52;_ThreadName=Thread-2; _ThreadID=70;_ThreadName=Thread-2; _ThreadID=52;_ThreadName=Thread-2; _ThreadID=52;_ThreadName=Thread-2; _ThreadID=611;_ThreadName=Thread-2; _ThreadID=70;_ThreadName=Thread-2; _ThreadID=611;_ThreadName=Thread-2; _ThreadID=70;_ThreadName=Thread-2; _ThreadID=611;_ThreadName=Thread-2; _ThreadID=52;_ThreadName=Thread-2; _ThreadID=70;_ThreadName=Thread-2; _ThreadID=52;_ThreadName=Thread-2; _ThreadID=52;_ThreadName=Thread-2; _ThreadID=611;_ThreadName=Thread-2; _ThreadID=611;_ThreadName=Thread-2; _ThreadID=70;_ThreadName=Thread-2; _ThreadID=70;_ThreadName=Thread-2; _ThreadID=52;_ThreadName=Thread-2; _ThreadID=52;_ThreadName=Thread-2; _ThreadID=611;_ThreadName=Thread-2; _ThreadID=611;_ThreadName=Thread-2; _ThreadID=70;_ThreadName=Thread-2; _ThreadID=70;_ThreadName=Thread-2; _ThreadID=52;_ThreadName=Thread-2; _ThreadID=52;_ThreadName=Thread-2; _ThreadID=52;_ThreadName=Thread-2; _ThreadID=611;_ThreadName=Thread-2;
Record Number
346 345 344 343 342 341 340 339 338 337 336 335 334 333 332 331 330 329 328 327 326 325 324 323 322 321 320 319 318 317 316 315 314 313 312 311 310 309 308 307
Message ID
JSF1091 JSF1091 JSF1091 JSF1091 JSF1091 JSF1091 JSF1091 JSF1091 JSF1091 JSF1091 JSF1091 JSF1091 JSF1091 JSF1091 JSF1091 JSF1091 JSF1091 JSF1091 JSF1091 JSF1091 JSF1091 JSF1091 JSF1091 JSF1091 JSF1091 JSF1091 JSF1091 JSF1091 JSF1091 JSF1091 JSF1091 JSF1091
Complete Message
No mime type could be found for file /common/logViewer/logEntryDetail.jsp. To resolve this, add a mime-type mapping to the applications web.xml. No mime type could be found for file /common/logViewer/logEntryDetail.jsp. To resolve this, add a mime-type mapping to the applications web.xml. No mime type could be found for file /common/logViewer/logViewer.jsp. To resolve this, add a mime-type mapping to the applications web.xml. No mime type could be found for file /common/logViewer/logViewer.jsp. To resolve this, add a mime-type mapping to the applications web.xml. RestResponse.getResponse() gives FAILURE. endpoint = 'http://localhost:4949/management/domain/resources/jdbc-connection-pool/premiercals/property.json'; attrs = '[

{"description":"","name":"user","value":"premiercals"}

]' Exception obtaining parameters org.glassfish.jersey.internal.ProcessingException: Exception obtaining parameters at org.glassfish.jersey.server.spi.internal.ParameterValueHelper.getParameterValues(ParameterValueHelper.java:90) at org.glassfish.jersey.server.model.AbstractJavaResourceMethodDispatcherProvider$AbstractMethodParamInvoker.getParamValues(AbstractJavaResourceMethodDispatcherProvider.java:145) at org.glassfish.jersey.server.model.AbstractJavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(AbstractJavaResourceMethodDispatcherProvider.java:219) at org.glassfish.jersey.server.model.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:79) at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:262) at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:82) at org.glassfish.jersey.process.internal.RequestInvoker$AcceptingInvoker.apply(RequestInvoker.java:241) at org.glassfish.jersey.process.internal.AsyncInflectorAdapter.apply(AsyncInflectorAdapter.java:156) at org.glassfish.jersey.process.internal.RequestInvoker$2.run(RequestInvoker.java:188) at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:283) at org.glassfish.jersey.process.internal.RequestInvoker$3.run(RequestInvoker.java:201) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:253) at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:44) at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:41) at org.glassfish.jersey.process.internal.RequestInvoker.apply(RequestInvoker.java:197) at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:752) at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:298) at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:203) at com.sun.enterprise.v3.server.HK2Dispatcher.dispatch(HK2Dispatcher.java:113) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:236) at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:164) at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:169) at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:265) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200) at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:134) at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112) at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:78) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:815) at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:567) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:547) at java.lang.Thread.run(Thread.java:722) Caused by: java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl cannot be cast to java.lang.Class at org.glassfish.admin.rest.utils.Util.getFirstGenericType(Util.java:527) at org.glassfish.admin.rest.readers.JsonPropertyListReader.isReadable(JsonPropertyListReader.java:72) at org.glassfish.jersey.message.internal.MessageBodyFactory._getMessageBodyReader(MessageBodyFactory.java:466) at org.glassfish.jersey.message.internal.MessageBodyFactory._getMessageBodyReader(MessageBodyFactory.java:442) at org.glassfish.jersey.message.internal.MessageBodyFactory.getMessageBodyReader(MessageBodyFactory.java:404) at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$TerminalReaderInterceptor.aroundReadFrom(ReaderInterceptorExecutor.java:194) at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor.proceed(ReaderInterceptorExecutor.java:158) at org.glassfish.jersey.message.internal.MessageBodyFactory.readFrom(MessageBodyFactory.java:612) at org.glassfish.jersey.message.internal.InboundMessageContext.readEntity(InboundMessageContext.java:901) at org.glassfish.jersey.server.ContainerRequest.readEntity(ContainerRequest.java:231) at org.glassfish.jersey.server.internal.inject.EntityParamValueFactoryProvider$EntityValueFactory.get(EntityParamValueFactoryProvider.java:86) at org.glassfish.jersey.server.internal.inject.AbstractHttpContextValueFactory.provide(AbstractHttpContextValueFactory.java:65) at org.glassfish.jersey.server.spi.internal.ParameterValueHelper.getParameterValues(ParameterValueHelper.java:80) ... 38 more No mime type could be found for file /jdbc/jdbcConnectionPoolProperty.jsp. To resolve this, add a mime-type mapping to the applications web.xml. No mime type could be found for file /jdbc/jdbcConnectionPoolProperty.jsp. To resolve this, add a mime-type mapping to the applications web.xml. No mime type could be found for file /jdbc/jdbcConnectionPoolProperty.jsp. To resolve this, add a mime-type mapping to the applications web.xml. No mime type could be found for file /jdbc/jdbcConnectionPoolAdvance.jsp. To resolve this, add a mime-type mapping to the applications web.xml. No mime type could be found for file /jdbc/jdbcConnectionPoolAdvance.jsp. To resolve this, add a mime-type mapping to the applications web.xml. No mime type could be found for file /jdbc/jdbcConnectionPoolProperty.jsp. To resolve this, add a mime-type mapping to the applications web.xml. RestResponse.getResponse() gives FAILURE. endpoint = 'http://localhost:4949/management/domain/resources/jdbc-connection-pool/premiercals/property.json'; attrs = '[

{"description":"","name":"user","value":"premiercals"}

]' Exception obtaining parameters org.glassfish.jersey.internal.ProcessingException: Exception obtaining parameters at org.glassfish.jersey.server.spi.internal.ParameterValueHelper.getParameterValues(ParameterValueHelper.java:90) at org.glassfish.jersey.server.model.AbstractJavaResourceMethodDispatcherProvider$AbstractMethodParamInvoker.getParamValues(AbstractJavaResourceMethodDispatcherProvider.java:145) at org.glassfish.jersey.server.model.AbstractJavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(AbstractJavaResourceMethodDispatcherProvider.java:219) at org.glassfish.jersey.server.model.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:79) at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:262) at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:82) at org.glassfish.jersey.process.internal.RequestInvoker$AcceptingInvoker.apply(RequestInvoker.java:241) at org.glassfish.jersey.process.internal.AsyncInflectorAdapter.apply(AsyncInflectorAdapter.java:156) at org.glassfish.jersey.process.internal.RequestInvoker$2.run(RequestInvoker.java:188) at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:283) at org.glassfish.jersey.process.internal.RequestInvoker$3.run(RequestInvoker.java:201) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:253) at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:44) at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:41) at org.glassfish.jersey.process.internal.RequestInvoker.apply(RequestInvoker.java:197) at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:752) at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:298) at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:203) at com.sun.enterprise.v3.server.HK2Dispatcher.dispatch(HK2Dispatcher.java:113) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:236) at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:164) at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:169) at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:265) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200) at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:134) at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112) at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:78) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:815) at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:567) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:547) at java.lang.Thread.run(Thread.java:722) Caused by: java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl cannot be cast to java.lang.Class at org.glassfish.admin.rest.utils.Util.getFirstGenericType(Util.java:527) at org.glassfish.admin.rest.readers.JsonPropertyListReader.isReadable(JsonPropertyListReader.java:72) at org.glassfish.jersey.message.internal.MessageBodyFactory._getMessageBodyReader(MessageBodyFactory.java:466) at org.glassfish.jersey.message.internal.MessageBodyFactory._getMessageBodyReader(MessageBodyFactory.java:442) at org.glassfish.jersey.message.internal.MessageBodyFactory.getMessageBodyReader(MessageBodyFactory.java:404) at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$TerminalReaderInterceptor.aroundReadFrom(ReaderInterceptorExecutor.java:194) at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor.proceed(ReaderInterceptorExecutor.java:158) at org.glassfish.jersey.message.internal.MessageBodyFactory.readFrom(MessageBodyFactory.java:612) at org.glassfish.jersey.message.internal.InboundMessageContext.readEntity(InboundMessageContext.java:901) at org.glassfish.jersey.server.ContainerRequest.readEntity(ContainerRequest.java:231) at org.glassfish.jersey.server.internal.inject.EntityParamValueFactoryProvider$EntityValueFactory.get(EntityParamValueFactoryProvider.java:86) at org.glassfish.jersey.server.internal.inject.AbstractHttpContextValueFactory.provide(AbstractHttpContextValueFactory.java:65) at org.glassfish.jersey.server.spi.internal.ParameterValueHelper.getParameterValues(ParameterValueHelper.java:80) ... 38 more No mime type could be found for file /jdbc/jdbcConnectionPoolProperty.jsp. To resolve this, add a mime-type mapping to the applications web.xml. No mime type could be found for file /common/logViewer/logViewer.jsp. To resolve this, add a mime-type mapping to the applications web.xml. No mime type could be found for file /common/logViewer/logViewer.jsp. To resolve this, add a mime-type mapping to the applications web.xml. RestResponse.getResponse() gives FAILURE. endpoint = 'http://localhost:4949/management/domain/resources/jdbc-connection-pool/premiercals/property.json'; attrs = '[

{"description":"","name":"user","value":"premiercals"}

]' Exception obtaining parameters org.glassfish.jersey.internal.ProcessingException: Exception obtaining parameters at org.glassfish.jersey.server.spi.internal.ParameterValueHelper.getParameterValues(ParameterValueHelper.java:90) at org.glassfish.jersey.server.model.AbstractJavaResourceMethodDispatcherProvider$AbstractMethodParamInvoker.getParamValues(AbstractJavaResourceMethodDispatcherProvider.java:145) at org.glassfish.jersey.server.model.AbstractJavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(AbstractJavaResourceMethodDispatcherProvider.java:219) at org.glassfish.jersey.server.model.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:79) at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:262) at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:82) at org.glassfish.jersey.process.internal.RequestInvoker$AcceptingInvoker.apply(RequestInvoker.java:241) at org.glassfish.jersey.process.internal.AsyncInflectorAdapter.apply(AsyncInflectorAdapter.java:156) at org.glassfish.jersey.process.internal.RequestInvoker$2.run(RequestInvoker.java:188) at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:283) at org.glassfish.jersey.process.internal.RequestInvoker$3.run(RequestInvoker.java:201) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:253) at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:44) at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:41) at org.glassfish.jersey.process.internal.RequestInvoker.apply(RequestInvoker.java:197) at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:752) at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:298) at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:203) at com.sun.enterprise.v3.server.HK2Dispatcher.dispatch(HK2Dispatcher.java:113) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:236) at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:164) at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:169) at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:265) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200) at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:134) at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112) at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:78) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:815) at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:567) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:547) at java.lang.Thread.run(Thread.java:722) Caused by: java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl cannot be cast to java.lang.Class at org.glassfish.admin.rest.utils.Util.getFirstGenericType(Util.java:527) at org.glassfish.admin.rest.readers.JsonPropertyListReader.isReadable(JsonPropertyListReader.java:72) at org.glassfish.jersey.message.internal.MessageBodyFactory._getMessageBodyReader(MessageBodyFactory.java:466) at org.glassfish.jersey.message.internal.MessageBodyFactory._getMessageBodyReader(MessageBodyFactory.java:442) at org.glassfish.jersey.message.internal.MessageBodyFactory.getMessageBodyReader(MessageBodyFactory.java:404) at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$TerminalReaderInterceptor.aroundReadFrom(ReaderInterceptorExecutor.java:194) at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor.proceed(ReaderInterceptorExecutor.java:158) at org.glassfish.jersey.message.internal.MessageBodyFactory.readFrom(MessageBodyFactory.java:612) at org.glassfish.jersey.message.internal.InboundMessageContext.readEntity(InboundMessageContext.java:901) at org.glassfish.jersey.server.ContainerRequest.readEntity(ContainerRequest.java:231) at org.glassfish.jersey.server.internal.inject.EntityParamValueFactoryProvider$EntityValueFactory.get(EntityParamValueFactoryProvider.java:86) at org.glassfish.jersey.server.internal.inject.AbstractHttpContextValueFactory.provide(AbstractHttpContextValueFactory.java:65) at org.glassfish.jersey.server.spi.internal.ParameterValueHelper.getParameterValues(ParameterValueHelper.java:80) ... 38 more No mime type could be found for file /jdbc/jdbcConnectionPoolProperty.jsp. To resolve this, add a mime-type mapping to the applications web.xml. No mime type could be found for file /jdbc/jdbcConnectionPoolProperty.jsp. To resolve this, add a mime-type mapping to the applications web.xml. No mime type could be found for file /jdbc/jdbcConnectionPoolProperty.jsp. To resolve this, add a mime-type mapping to the applications web.xml. No mime type could be found for file /jdbc/jdbcConnectionPoolEdit.jsp. To resolve this, add a mime-type mapping to the applications web.xml. No mime type could be found for file /jdbc/jdbcConnectionPoolEdit.jsp. To resolve this, add a mime-type mapping to the applications web.xml. No mime type could be found for file /jdbc/jdbcConnectionPoolProperty.jsp. To resolve this, add a mime-type mapping to the applications web.xml. No mime type could be found for file /jdbc/jdbcConnectionPoolProperty.jsp. To resolve this, add a mime-type mapping to the applications web.xml. No mime type could be found for file /common/logViewer/logViewer.jsp. To resolve this, add a mime-type mapping to the applications web.xml. No mime type could be found for file /common/logViewer/logViewer.jsp. To resolve this, add a mime-type mapping to the applications web.xml. No mime type could be found for file /common/logViewer/logViewer.jsp. To resolve this, add a mime-type mapping to the applications web.xml. No mime type could be found for file /common/logViewer/logViewer.jsp. To resolve this, add a mime-type mapping to the applications web.xml. No mime type could be found for file /common/logViewer/logViewer.jsp. To resolve this, add a mime-type mapping to the applications web.xml. No mime type could be found for file /common/logViewer/logViewer.jsp. To resolve this, add a mime-type mapping to the applications web.xml. No mime type could be found for file /common/logViewer/logViewer.jsp. To resolve this, add a mime-type mapping to the applications web.xml. No mime type could be found for file /common/logViewer/logViewer.jsp. To resolve this, add a mime-type mapping to the applications web.xml. No mime type could be found for file /common/logViewer/logViewer.jsp. To resolve this, add a mime-type mapping to the applications web.xml. No mime type could be found for file /common/logViewer/logViewer.jsp. To resolve this, add a mime-type mapping to the applications web.xml. StandardWrapperValve[FacesServlet]: PWC1406: Servlet.service() for servlet FacesServlet threw exception java.io.IOException: An established connection was aborted by the software in your host machine at sun.nio.ch.SocketDispatcher.write0(Native Method) at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:51) at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:89) at sun.nio.ch.IOUtil.write(IOUtil.java:46) at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:450) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.flushByteBuffer(TCPNIOTransport.java:1232) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.writeGathered(TCPNIOTransport.java:1177) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.write(TCPNIOTransport.java:1070) at org.glassfish.grizzly.nio.transport.TCPNIOTemporarySelectorWriter.writeNow0(TCPNIOTemporarySelectorWriter.java:65) at org.glassfish.grizzly.nio.tmpselectors.TemporarySelectorWriter.write0(TemporarySelectorWriter.java:167) at org.glassfish.grizzly.nio.tmpselectors.TemporarySelectorWriter.write(TemporarySelectorWriter.java:118) at org.glassfish.grizzly.nio.tmpselectors.TemporarySelectorWriter.write(TemporarySelectorWriter.java:77) at org.glassfish.grizzly.nio.tmpselectors.TemporarySelectorWriter.write(TemporarySelectorWriter.java:58) at org.glassfish.grizzly.nio.transport.TCPNIOTransportFilter.handleWrite(TCPNIOTransportFilter.java:130) at org.glassfish.grizzly.filterchain.TransportFilter.handleWrite(TransportFilter.java:191) at org.glassfish.grizzly.filterchain.ExecutorResolver$8.execute(ExecutorResolver.java:111) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:265) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200) at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:134) at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112) at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:78) at org.glassfish.grizzly.filterchain.FilterChainContext.write(FilterChainContext.java:652) at org.glassfish.grizzly.http.server.io.OutputBuffer.writeContentBuffer0(OutputBuffer.java:867) at org.glassfish.grizzly.http.server.io.OutputBuffer.write(OutputBuffer.java:602) at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:352) at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:339) at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:161) at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221) at sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:282) at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:125) at java.io.OutputStreamWriter.write(OutputStreamWriter.java:207) at com.sun.faces.renderkit.html_basic.HtmlResponseWriter.flushAttributes(HtmlResponseWriter.java:1168) at com.sun.faces.renderkit.html_basic.HtmlResponseWriter.closeStartIfNecessary(HtmlResponseWriter.java:1083) at com.sun.faces.renderkit.html_basic.HtmlResponseWriter.write(HtmlResponseWriter.java:691) at com.sun.webui.jsf.renderkit.html.StaticTextRenderer.renderEnd(StaticTextRenderer.java:153) at com.sun.webui.jsf.renderkit.html.AbstractRenderer.encodeEnd(AbstractRenderer.java:225) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:924) at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.encodeChild(LayoutElementBase.java:558) at com.sun.jsftemplating.layout.descriptors.LayoutComponent.encode(LayoutComponent.java:243) at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.encode(LayoutElementBase.java:348) at com.sun.jsftemplating.layout.descriptors.LayoutComponent.encode(LayoutComponent.java:201) at com.sun.jsftemplating.layout.descriptors.LayoutForEach.encode(LayoutForEach.java:178) at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.encode(LayoutElementBase.java:348) at com.sun.jsftemplating.layout.descriptors.LayoutComponent.encode(LayoutComponent.java:201) at com.sun.jsftemplating.layout.descriptors.LayoutForEach.encode(LayoutForEach.java:178) at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.encode(LayoutElementBase.java:348) at com.sun.jsftemplating.layout.descriptors.LayoutDefinition.encode(LayoutDefinition.java:250) at com.sun.jsftemplating.renderer.TemplateRenderer.encodeEnd(TemplateRenderer.java:139) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:924) at com.sun.webui.jsf.util.RenderingUtilities.renderComponent(RenderingUtilities.java:99) at com.sun.webui.jsf.renderkit.html.PropertyRenderer.renderPropertyComponents(PropertyRenderer.java:195) at com.sun.webui.jsf.renderkit.html.PropertyRenderer.encodeEnd(PropertyRenderer.java:156) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:924) at com.sun.webui.jsf.util.RenderingUtilities.renderComponent(RenderingUtilities.java:99) at com.sun.webui.jsf.renderkit.html.PropertySheetSectionRenderer.renderProperties(PropertySheetSectionRenderer.java:184) at com.sun.webui.jsf.renderkit.html.PropertySheetSectionRenderer.renderPropertySheetSection(PropertySheetSectionRenderer.java:143) at com.sun.webui.jsf.renderkit.html.PropertySheetSectionRenderer.encodeEnd(PropertySheetSectionRenderer.java:86) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:924) at com.sun.webui.jsf.util.RenderingUtilities.renderComponent(RenderingUtilities.java:99) at com.sun.webui.jsf.renderkit.html.PropertySheetRenderer.renderPropertySheetSections(PropertySheetRenderer.java:164) at com.sun.webui.jsf.renderkit.html.PropertySheetRenderer.encodeEnd(PropertySheetRenderer.java:114) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:924) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1854) at javax.faces.render.Renderer.encodeChildren(Renderer.java:176) at com.sun.webui.jsf.renderkit.html.ContentPageTitleRenderer.encodeChildren(ContentPageTitleRenderer.java:169) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:894) at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.encodeChild(LayoutElementBase.java:551) at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.encodeChild(LayoutElementBase.java:555) at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.encodeChild(LayoutElementBase.java:555) at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.encodeChild(LayoutElementBase.java:555) at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.encodeChild(LayoutElementBase.java:555) at com.sun.jsftemplating.layout.descriptors.LayoutComponent.encode(LayoutComponent.java:243) at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.encode(LayoutElementBase.java:348) at com.sun.jsftemplating.layout.descriptors.LayoutDefinition.encode(LayoutDefinition.java:246) at com.sun.jsftemplating.layout.LayoutViewHandler.renderView(LayoutViewHandler.java:683) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:202) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:642) at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1593) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:339) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at com.sun.webui.jsf.util.UploadFilter.doFilter(UploadFilter.java:233) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:283) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:660) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:600) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162) at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:337) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:240) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:230) at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:164) at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:169) at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:265) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200) at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:134) at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112) at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:78) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:815) at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:567) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:547) at java.lang.Thread.run(Thread.java:722) Exception when handling error trying to reset the response. java.io.IOException: An established connection was aborted by the software in your host machine at sun.nio.ch.SocketDispatcher.write0(Native Method) at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:51) at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:89) at sun.nio.ch.IOUtil.write(IOUtil.java:46) at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:450) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.flushByteBuffer(TCPNIOTransport.java:1232) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.writeGathered(TCPNIOTransport.java:1177) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.write(TCPNIOTransport.java:1070) at org.glassfish.grizzly.nio.transport.TCPNIOTemporarySelectorWriter.writeNow0(TCPNIOTemporarySelectorWriter.java:65) at org.glassfish.grizzly.nio.tmpselectors.TemporarySelectorWriter.write0(TemporarySelectorWriter.java:167) at org.glassfish.grizzly.nio.tmpselectors.TemporarySelectorWriter.write(TemporarySelectorWriter.java:118) at org.glassfish.grizzly.nio.tmpselectors.TemporarySelectorWriter.write(TemporarySelectorWriter.java:77) at org.glassfish.grizzly.nio.tmpselectors.TemporarySelectorWriter.write(TemporarySelectorWriter.java:58) at org.glassfish.grizzly.nio.transport.TCPNIOTransportFilter.handleWrite(TCPNIOTransportFilter.java:130) at org.glassfish.grizzly.filterchain.TransportFilter.handleWrite(TransportFilter.java:191) at org.glassfish.grizzly.filterchain.ExecutorResolver$8.execute(ExecutorResolver.java:111) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:265) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200) at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:134) at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112) at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:78) at org.glassfish.grizzly.filterchain.FilterChainContext.write(FilterChainContext.java:652) at org.glassfish.grizzly.http.server.io.OutputBuffer.writeContentBuffer0(OutputBuffer.java:867) at org.glassfish.grizzly.http.server.io.OutputBuffer.write(OutputBuffer.java:602) at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:352) at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:339) at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:161) at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221) at sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:282) at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:125) at java.io.OutputStreamWriter.write(OutputStreamWriter.java:207) at com.sun.faces.renderkit.html_basic.HtmlResponseWriter.flushAttributes(HtmlResponseWriter.java:1168) at com.sun.faces.renderkit.html_basic.HtmlResponseWriter.closeStartIfNecessary(HtmlResponseWriter.java:1083) at com.sun.faces.renderkit.html_basic.HtmlResponseWriter.write(HtmlResponseWriter.java:691) at com.sun.webui.jsf.renderkit.html.StaticTextRenderer.renderEnd(StaticTextRenderer.java:153) at com.sun.webui.jsf.renderkit.html.AbstractRenderer.encodeEnd(AbstractRenderer.java:225) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:924) at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.encodeChild(LayoutElementBase.java:558) at com.sun.jsftemplating.layout.descriptors.LayoutComponent.encode(LayoutComponent.java:243) at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.encode(LayoutElementBase.java:348) at com.sun.jsftemplating.layout.descriptors.LayoutComponent.encode(LayoutComponent.java:201) at com.sun.jsftemplating.layout.descriptors.LayoutForEach.encode(LayoutForEach.java:178) at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.encode(LayoutElementBase.java:348) at com.sun.jsftemplating.layout.descriptors.LayoutComponent.encode(LayoutComponent.java:201) at com.sun.jsftemplating.layout.descriptors.LayoutForEach.encode(LayoutForEach.java:178) at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.encode(LayoutElementBase.java:348) at com.sun.jsftemplating.layout.descriptors.LayoutDefinition.encode(LayoutDefinition.java:250) at com.sun.jsftemplating.renderer.TemplateRenderer.encodeEnd(TemplateRenderer.java:139) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:924) at com.sun.webui.jsf.util.RenderingUtilities.renderComponent(RenderingUtilities.java:99) at com.sun.webui.jsf.renderkit.html.PropertyRenderer.renderPropertyComponents(PropertyRenderer.java:195) at com.sun.webui.jsf.renderkit.html.PropertyRenderer.encodeEnd(PropertyRenderer.java:156) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:924) at com.sun.webui.jsf.util.RenderingUtilities.renderComponent(RenderingUtilities.java:99) at com.sun.webui.jsf.renderkit.html.PropertySheetSectionRenderer.renderProperties(PropertySheetSectionRenderer.java:184) at com.sun.webui.jsf.renderkit.html.PropertySheetSectionRenderer.renderPropertySheetSection(PropertySheetSectionRenderer.java:143) at com.sun.webui.jsf.renderkit.html.PropertySheetSectionRenderer.encodeEnd(PropertySheetSectionRenderer.java:86) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:924) at com.sun.webui.jsf.util.RenderingUtilities.renderComponent(RenderingUtilities.java:99) at com.sun.webui.jsf.renderkit.html.PropertySheetRenderer.renderPropertySheetSections(PropertySheetRenderer.java:164) at com.sun.webui.jsf.renderkit.html.PropertySheetRenderer.encodeEnd(PropertySheetRenderer.java:114) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:924) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1854) at javax.faces.render.Renderer.encodeChildren(Renderer.java:176) at com.sun.webui.jsf.renderkit.html.ContentPageTitleRenderer.encodeChildren(ContentPageTitleRenderer.java:169) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:894) at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.encodeChild(LayoutElementBase.java:551) at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.encodeChild(LayoutElementBase.java:555) at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.encodeChild(LayoutElementBase.java:555) at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.encodeChild(LayoutElementBase.java:555) at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.encodeChild(LayoutElementBase.java:555) at com.sun.jsftemplating.layout.descriptors.LayoutComponent.encode(LayoutComponent.java:243) at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.encode(LayoutElementBase.java:348) at com.sun.jsftemplating.layout.descriptors.LayoutDefinition.encode(LayoutDefinition.java:246) at com.sun.jsftemplating.layout.LayoutViewHandler.renderView(LayoutViewHandler.java:683) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:202) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:642) at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1593) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:339) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at com.sun.webui.jsf.util.UploadFilter.doFilter(UploadFilter.java:233) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:283) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:660) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:600) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162) at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:337) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:240) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:230) at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:164) at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:169) at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:265) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200) at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:134) at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112) at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:78) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:815) at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:567) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:547) at java.lang.Thread.run(Thread.java:722) No mime type could be found for file /common/logViewer/logEntryDetail.jsp. To resolve this, add a mime-type mapping to the applications web.xml. No mime type could be found for file /common/logViewer/logEntryDetail.jsp. To resolve this, add a mime-type mapping to the applications web.xml.






[GLASSFISH-19007] Missed query timeout while connection validation by table query Created: 16/Aug/12  Updated: 16/Aug/12

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major
Reporter: evgeniya Assignee: Shalini
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Hi,

See please
http://java.net/projects/glassfish/sources/svn/content/trunk/main/appserver/jdbc/jdbc-ra/jdbc-core/src/main/java/com/sun/gjc/spi/ManagedConnectionFactory.java?rev=53670:

protected void isValidByTableQuery(java.sql.Connection con, String tableName) throws ResourceException {
...
final String statement = "SELECT COUNT FROM " + tableName;
stmt = con.prepareStatement(statement);
rs = stmt.executeQuery();
...
}

It would be great to have query timeout here (with some default value, that can be changed, say, by some JVM option). (http://docs.oracle.com/javase/6/docs/api/java/sql/Statement.html#setQueryTimeout(int))

Actually, we had server outage in our production because of lack of this timeout (see details here: http://perfstories.wordpress.com/2012/05/15/yet-another-hanging-java-net-socketinputstream-socketread0/)

Thank you,

Evgeniya






[GLASSFISH-19006] Default values of essential vendor specific properties in domain.xml Created: 16/Aug/12  Updated: 16/Aug/12

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major
Reporter: evgeniya Assignee: Shalini
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Hi,
In particular, I mean, at least:
a) socket timeouts for Oracle clients (sun.net.client.defaultConnectTimeout, Dsun.net.client.defaultReadTimeout);
b) socket timeouts for Oracle JDBC Driver(oracle.jdbc.ReadTimeout).

(they could be set as JVM properties, -D<property name>=<value in millisec, say, 60000>)

These are really essential properties. We have a lot of emergencies because we didn't know them. Actually, we used Glassfish 2.1.1, but I didn't find notes about these options in further versions of Glassfish too.
I would say there should be default values for these options in domain.xml.

These properties are really important, as they could prevent our Glassfish server outage, see for example, here http://perfstories.wordpress.com/2012/08/14/be-aware-of-sun-oracle-networking-properties/.

Thank you,

Evgeniya






[GLASSFISH-18954] Cannot create a truly global JDBC resource except by hand-editing domain.xml Created: 27/Jul/12  Updated: 10/Feb/13

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: 3.1.2, 3.1.2.2
Fix Version/s: None

Type: Bug Priority: Major
Reporter: ljnelson Assignee: sfelts
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: asadmin, create-jdbc-resource

 Description   

I am using embedded GlassFish for testing. I am trying to set up a global JDBC resource using asadmin create-jdbc-resource (by way of the CommandRunner class).

If I create a resource named jdbc/foo, it is created in the java:comp/env namespace. That is not what I want.

If I try to create a resource named java:global/jdbc/foo, create-jdbc-resource will not let me do it, claiming the colon is not a permitted character. Escaping the colon has no effect.

If I try to add the resource in via the add-resources command, I (eventually) get a runtime exception at deployment:

java.lang.RuntimeException: Invalid resource : java:global/jdbc/H2Test__pm
	at com.sun.enterprise.connectors.ConnectorRuntime.lookupDataSourceInDAS(ConnectorRuntime.java:540)
	at com.sun.enterprise.connectors.ConnectorRuntime.lookupPMResource(ConnectorRuntime.java:469)
	at org.glassfish.persistence.common.PersistenceHelper.lookupPMResource(PersistenceHelper.java:63)
	at org.glassfish.persistence.jpa.ProviderContainerContractInfoBase.lookupDataSource(ProviderContainerContractInfoBase.java:71)
	at org.glassfish.persistence.jpa.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:108)
	at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:155)
	at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:120)
	at org.glassfish.persistence.jpa.JPADeployer$1.visitPUD(JPADeployer.java:224)
	at org.glassfish.persistence.jpa.JPADeployer$PersistenceUnitDescriptorIterator.iteratePUDs(JPADeployer.java:495)
	at org.glassfish.persistence.jpa.JPADeployer.createEMFs(JPADeployer.java:233)
	at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:168)
	at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:871)
	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:410)
	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
	at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)


 Comments   
Comment by ljnelson [ 07/Aug/12 ]

Even if this bug is not fixed, could you kindly tell me whether this should be allowed? That is, should I be able to create a JDBC resource with a java:global/ prefix using the asadmin create-jdbc-resource command?

Comment by Shalini [ 08/Aug/12 ]

Its not possible to create-jdbc-resource like "java:global/jdbc/foo" . This is not allowed. However, this functionality could be achieved by means of adding the resource-ref in web.xml and glassfish-web.xml like mentioned below :

asadmin create-jdbc-resource ... jdbc/foo

web.xml :

<resource-ref>
<res-ref-name>java:global/jdbc/foo</res-ref-name>
<res-type>javax.sql.DataSource</res-type>

glassfish-web.xml :

<resource-ref>
<res-ref-name>java:global/jdbc/foo</res-ref-name>
<jndi-name>foo</jndi-name>
</resource-ref>

Hope this helps.

Comment by Shalini [ 08/Aug/12 ]

Please refer https://blogs.oracle.com/JagadishPrasath/entry/applying_scope_for_jdbc_resources for more details.





[GLASSFISH-18914] [PERF] Database statement caching parameters no longer honored Created: 17/Jul/12  Updated: 10/Feb/13

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: 4.0_b41
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Scott Oaks Assignee: sfelts
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: PSRBUG

 Description   

Sometime after build 39, performance of JDBC calls from our servlets has severely regressed. Looking at the database logs, the issue is with statement caching: in build 39 and prior, statements were effectively cached and the database spent no time parsing statements. In build 41 and following builds, the database spends a huge amount of time parsing the statements. [No data is available from build 40.]

The database configuration in all cases looks like this:
<jdbc-connection-pool datasource-classname="oracle.jdbc.pool.OracleDataSource" max-pool-size="200" steady-pool-size="200" name="tpcw">
<property name="URL" value="jdbc:oracle:thin:@perf-x4600-1:1521:benchdb"></property>
<property name="Password" value="tpcw"></property>
<property name="User" value="tpcw"></property>
<property name="ImplicitCachingEnabled" value="true"></property>
<property name="MaxStatements" value="200"></property>
</jdbc-connection-pool>

So I guess the most likely thing is that the caching properties here are not being passed to the oracle driver correctly, though I guess also some change in the statement wrappers in glassfish could also be affecting this as well. The application use is basic JDBC calls:

con = datasource.getConnection(); // datasource retrieved via JDNI lookup
pstmt = con.prepareStatement(...static final string...);
pstmt.set* calls;
rs = pstmt.executeQuery();
.. process rs ..
pstmt.close();
con.close();

We do not see this change in our JPA-based tests; only with the servlet that uses JDBC.






[GLASSFISH-18712] SQLTraceListeners do not work Created: 10/May/12  Updated: 18/Apr/14

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: 3.1.1
Fix Version/s: None

Type: Bug Priority: Major
Reporter: ztangm Assignee: sfelts
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

CentOs



 Description   

I define my db pool like

<jdbc-connection-pool validation-table-name="DUAL" datasource-classname="oracle.jdbc.pool.OracleConnectionPoolDataSource" is-isolation-level-guaranteed="false" res-type="javax.sql.ConnectionPoolDataSource" sql-trace-listeners="de.xyz.platform.sqllogger.SQLTraceListenerImpl" name="OraclePool" is-connection-validation-required="true">

and define my sql tracer like

public class SQLTraceListenerImpl implements SQLTraceListener {

private final static Logger logger = Logger.getLogger(SQLTraceListenerImpl.class);

@Override
public void sqlTrace(SQLTraceRecord record)

{ logger.info(record); }

}

and the only thing I get in the server log is

[#|2012-05-10T10:41:31.922+0200|WARNING|glassfish3.1.1|javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors.util|_ThreadID=16;_ThreadName=Thread-2;|RAR7096: Exception null while trying to set the value de.xyz.platform.sqllogger.SQLTraceListenerImpl on property SqlTraceListeners |#]

One thing would be to know what I did wrong and the other thing would be to improve this exception.



 Comments   
Comment by shreedhar_ganapathy [ 13/Feb/13 ]

->Jagadish for eval and targeting for a release.





[GLASSFISH-18700] Connection pool issue with oracle Created: 08/May/12  Updated: 10/Feb/13

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: v2.1.1
Fix Version/s: None

Type: Task Priority: Critical
Reporter: msr Assignee: sfelts
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Solaris


Attachments: Text File domain.xml related to connection pool.txt     Text File Error logs.txt     Text File server.log    

 Description   

Hi Team ,

while creating oracle connection pool in glassfish v2.1.1 getting the below error

sun-appserver2.1|javax.enterprise.system.stream.err|_ThreadID=23;_ThreadName=httpWorkerThread-8001-4;_RequestID=55bd50e7-6738-4444-a558-7
8b0f9ad0d8b;|
java.lang.RuntimeException: javax.resource.ResourceException: 4
at com.sun.enterprise.tools.admingui.util.JMXUtil.invoke(JMXUtil.java:124)
at com.sun.enterprise.tools.admingui.util.JMXUtil.invoke(JMXUtil.java:75)
at com.sun.enterprise.tools.admingui.handlers.JdbcHandlers.pingJdbcConnectionPool(JdbcHandlers.java:530)
at sun.reflect.GeneratedMethodAccessor2055.invoke(Unknown Source)

Please find the attached logs for more information.

your help is highly appreciated .



 Comments   
Comment by Shalini [ 08/May/12 ]

Could you please attach the domain.xml configuration for this jdbc connection pool? And the full server.log would help as I am unable to see the actual cause of the exception.

Comment by Shalini [ 08/May/12 ]

Could you try specifying something like jdbc:oracle:thin:@DB_HOSTNAME:1521:DATABASE_NAME for the URL? Looks like URL property is erroneous.

Comment by msr [ 08/May/12 ]

i tried the url which mentioned the above , stilll getting same issue

Comment by gtulasidhar [ 28/May/12 ]

Hi Shalini I am also getting same error,if possible escalate to next level.
your help is highly appreciated .

Thanks,
Tulasidhar

Comment by Shalini [ 29/May/12 ]

Please post the exact domain.xml configuration of the jdbc connection pool you are trying to use.

Comment by gtulasidhar [ 07/Sep/12 ]

below is the domain.xml.

<jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds=
"10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="table" datasource-classname="oracle.jdbc.pool.OracleDataSource" fail-al
l-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="true" is-isolation-level-guaranteed="false" lazy-connection-association="false" lazy-conne
ction-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="32" max-wait-time-in-millis="60000" name="test_ds" non-transactional-connection
s="false" pool-resize-quantity="2" res-type="javax.sql.DataSource" statement-timeout-in-seconds="-1" steady-pool-size="8" validate-atmost-once-period-in-seconds="0" validation-t
able-name="DUAL" wrap-jdbc-objects="false">
<property name="DataSourceName" value="OracleDataSource"/>
<property name="ImplicitCachingEnabled" value="false"/>
<property name="NetworkProtocol" value="tcp"/>
<property name="Password" value="ehelp"/>
<property name="LoginTimeout" value="0"/>
<property name="URL" value="jdbc:oracle:thin:@(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = hostname)(PORT = 1521)) )(CONNECT_DATA =(SERV
ICE_NAME = test) ) )"/>
<property name="User" value="test"/>
<property name="ExplicitCachingEnabled" value="false"/>
<property name="PortNumber" value="0"/>
<property name="MaxStatements" value="0"/>
</jdbc-connection-pool>





[GLASSFISH-18607] JDBC ping fails with aliased password Created: 09/Apr/12  Updated: 10/Feb/13

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: 3.1.2
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: dhcavalcanti Assignee: sfelts
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows


Tags: JDBC, alias, password, ping

 Description   

The ping function fails for a JDBC connection whose password is aliased as specified here: http://docs.oracle.com/cd/E19798-01/821-1751/ghgqc/index.html.

If I place the actual password instead of the aliased password in the proper format, the ping works correctly.






[GLASSFISH-18559] DatabaseMetaData.getColumns() returns SCOPE_CATLOG instead of SCOPE_CATALOG Created: 26/Mar/12  Updated: 10/Feb/13

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: 4.0_b29
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Dennis MacConnell Assignee: sfelts
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

I believe that JDBC 4.1 fixed the typo and there is a CTS test that tests for it.

Here is the output from the test:
03-26-2012 14:09:35: ***************************************
03-26-2012 14:09:35: Calling DatabaseMetaData.getColumns
03-26-2012 14:09:35: Call columnCompare for the exact match of column names
03-26-2012 14:09:35: Minimum Column Count is:24
03-26-2012 14:09:35: Comparing Column Names...
03-26-2012 14:09:35: *** Error Expected Column name:SCOPE_CATALOG, Received column:SCOPE_CATLOG
03-26-2012 14:09:35: ***************************************

I ran the test against glassfish V4 (B29) with the bundled javadb

I think this issue is fixed in a later version of Derby.
There is a reference to the issue at:
https://issues.apache.org/jira/browse/DERBY-5488






[GLASSFISH-18442] ClassNotFoundException in GlassFish 3.1.2 Created: 02/Mar/12  Updated: 10/Feb/13

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: 3.1.2, 3.1.2.2
Fix Version/s: None

Type: Bug Priority: Major
Reporter: steve_taylor Assignee: sfelts
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 7 x64, Java 7u1, Maven 2



 Description   

I have a Java EE 6 (JSF/EJB/JPA/JAX-RS) app that runs in 3.1.1 but fails in 3.1.2. Specifically, it cannot load the JDBC drivers for PostgreSQL. The app is built using Maven 2.

Stack trace:

java.lang.ClassNotFoundException: org.postgresql.jdbc4.Jdbc4PreparedStatement
    at com.sun.enterprise.loader.ASURLClassLoader.findClassData(ASURLClassLoader.java:782)
    at com.sun.enterprise.loader.ASURLClassLoader.findClass(ASURLClassLoader.java:696)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:356)

It has been suggested to me that I add the PostgreSQL drivers to the GlassFish installation directory. However, I have definitely not had to do that with 3.1.1. If that is now the case for 3.1.2, then it is a major backward step. (I blow away the GlassFish installation on a regular basis, replacing it with a clean one each time, so I know for sure I'm not adding the PostgreSQL JDBC drivers manually.)



 Comments   
Comment by Mischa81 [ 05/Dec/12 ]

I'm facing exactly the same issue on version 3.1.2.2. (build 5). In my opinion bundling the PostgreSQL-driver with the EAR is common practice. Otherwise updating the driver implies multiple manual update on all the servers used in the project (dev, test, prod...).

Comment by shreedhar_ganapathy [ 13/Dec/12 ]

Reassigning to JDBC component, and to Michael so as to reassign to the right engineer.





[GLASSFISH-18439] Statement-leak-timeout and statement-leak-reclaim values do not persist in domain.xml when created with asadmin add-resources Created: 01/Mar/12  Updated: 01/Jul/13

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: 3.1.2_b23
Fix Version/s: None

Type: Bug Priority: Major
Reporter: emailnbw Assignee: sfelts
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 7 x64, Glassfish 3.1.2_b23, JDK 1.7.0_u3 x64


Attachments: XML File glassfish-resources.xml     Text File jdbc-rm-statement-leak.patch    
Tags: asadmin

 Description   

This looks like an issue that is very related to GLASSFISH-18026 which was marked as resolved. In this case if I try to create a jdbc-connection-pool using the command 'asadmin add-resources glassfish-resources.xml' and the jdbc-connection-pool element in that XML file have the statement-leak-timeout-in-seconds and statement-leak-reclaim attributes set the resultant JDBC connection pool created will not. I've attached a sample persistence.xml file which demonstrates this.



 Comments   
Comment by ancoron [ 27/Aug/12 ]

Attached a patch jdbc-rm-statement-leak.patch for review and inclusion. it fixes the problem at the source - the resources manager.

Comment by ancoron [ 27/Aug/12 ]

The above patch applies to the 3.1.2 tag but should (with path modification) also apply to trunk.

Comment by emailnbw [ 01/Jul/13 ]

Has this been fixed in GF4 FCS?





[GLASSFISH-18417] JDBC RA: Inspect JDK 7 getMethods()/getDeclaredMethods() usage Created: 28/Feb/12  Updated: 10/Feb/13

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: 4.0_b25
Fix Version/s: None

Type: Task Priority: Major
Reporter: Joe Di Pol Assignee: sfelts
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Recent JDK 7 releases have altered the order of methods returned by the
Class.getMethods() and Class.getDeclaredMethods() calls. The order is
no longer stable and can change from one JVM run to the next.

This caused a number of sporadic bugs to appear during 3.1.2 development
when running with JDK 7. Those have been fixed, but further inspection
of the source has found a number of cases where we use getMethods() and
getDeclaredMethods().

Each of these cases should be visually inspected to see if the code is
making any assumptions on the order of methods returned by get*Methods().
In particular it should handle the case of multiple methods having the
same name.

For more details on what to look for and how to fix it see this document:

https://wikis.oracle.com/display/GlassFish/Method+Ordering+from+Class.getMethods

Please inspect the following files for their use of getMethods() /
getDeclaredMethods() to ensure the code is not making any assumptions
with respect to the order of methods returned. Create bugs for
any issues that need to be fixed and link them to this task. Once you
have completed inspection update this task with status and close it.

Core JDBC Resource Adapter classes
    DataSourceObjectBuilder.java





[GLASSFISH-18394] Datasource properties not passed to database connection (Oracle database) Created: 22/Feb/12  Updated: 23/Feb/12

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: 3.1.1
Fix Version/s: None

Type: Improvement Priority: Major
Reporter: Thomas Andres Assignee: Shalini
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Java Archive File ojdbc6.jar     PNG File Screen shot 2012-02-22 at 14.16.27.png    

 Description   

I've recently discovered a jdbc performance issue with Queries that fetch many (thousands to millions) of small records from a oracle database. To solve that, the property "defaultRowPrefech" can be specified to increase the prefetch from 10 to some more reasonable value.

This worked well, when I opened a connection directly and also on a jboss server. When I changed the jdbc resource pool in my glassfish, this property apparently wasn't passed to the database connection.

I debugged the problem and saw that the configuration was available in the datasource. I got a DataSource40 containing a DSManagedConnectionFactory with a DataSourceSpec. There was a map that contained amongst other infos:
19=setURL#jdbc:oracle:thin:@zapf.ergon.ch:1521:ZAPF##setlanguage#english##setdefaultRowPrefetch#1000##
There are exactly the properties specified in the admin console. (apart from the "set" prefixes)

However, the database connection created from this datasource still had defaultRowPrefetch set to 10.

Am I doing something wrong and is there some other way this should be configured or is this a bug, that this attribute isn't passed to the database connection?



 Comments   
Comment by Thomas Andres [ 22/Feb/12 ]

added screenshot of the configuration in the admin console

Comment by Shalini [ 23/Feb/12 ]

Could you attach the jdbc connection pool configuration from your domain.xml file? I am speficifically looking for the datasource classname you set and also the jdbc driver you are using.

Comment by Thomas Andres [ 23/Feb/12 ]

The configuration is:

    <jdbc-connection-pool validation-table-name="CUSTOMER" 
datasource-classname="oracle.jdbc.pool.OracleDataSource" max-pool-size="300" wrap-jdbc-objects="false" 
res-type="javax.sql.DataSource" steady-pool-size="5" allow-non-component-callers="true" 
name="newom_dev3_pool" is-connection-validation-required="true" 
validate-atmost-once-period-in-seconds="300">
      <property name="URL" value="jdbc:oracle:thin:@zapf.ergon.ch:1521:ZAPF"></property>
      <property name="user" value="NEWOM_DEV3"></property>
      <property name="password" value="password"></property>
      <property name="language" value="english"></property>
      <property name="defaultRowPrefetch" value="1000"></property>
    </jdbc-connection-pool>

The jdbc driver is the standard ojdbc6.jar. I'll attach the version I'm using in case there are different versions of this I'm not aware of.

Comment by Thomas Andres [ 23/Feb/12 ]

used oracle driver

Comment by Shalini [ 23/Feb/12 ]

As per http://docs.oracle.com/cd/A97335_02/apps.102/a83724/oraperf2.htm :

"Use the setDefaultRowPrefetch() method of your OracleConnection object
to set the default number of rows to prefetch, passing in an integer that
specifies the desired default. "

The properties user, password are passed in the jdbc connection pool as
properties of the OracleDataSource object, whereas the defaultRowPrefetch
should be set on an OracleConnection object.

Alternatively, while getting the connection in your application, you could
unwrap the connection got, to get the OracleConnection object and then
set this property on the connection object. GlassFish provides an ability to
unwrap a connection object :

http://docs.oracle.com/cd/E19798-01/821-1752/ggrum/index.html

As per the above, this is not an issue.

Comment by Thomas Andres [ 23/Feb/12 ]

I strongly disagree. I'm well aware, that I can set the property from the code on the connection or statement. The point of doing this in the datasource is to make it easily configurable without code changes. Also to make the default apply regardless of who (my code, JPA, ...) opens the connection.
I did the same in a JBoss server that we use for an older version of our application and had no problem setting a property in the datasource to pass it along.

Also from your reference:

Equivalently, instead of calling setDefaultRowPrefetch(), you can set the defaultRowPrefetch Java property if you use a Java Properties object in establishing the connection. See "Specifying a Database URL and Properties Object".

In my opinon, the properties on the data source should also be used as if I use DriverManager.getConnection() with properties. Why do you provide a way to add additional properties for a datasource that are then ignored? There is no reason to treat username, password any different from any other property if all properties are passed on to create the connection. The only thing that is a property here and needs to be treated differently is the URL. I would prefer to see the URL parameter moved to the general configuration tab (don't think there is much chance to get a connection without an URL anyway) and pass all additional properties on to the driver to create the database connection. That is much cleaner and provides flexible, driver independent configuration.

If you don't pass along properties, you should scrap the additional properties entirely and just provide a static UI with fixed fields that you actually support.

Comment by Shalini [ 23/Feb/12 ]

The OracleDataSource.java does not have a method called setDefaultRowPrefetch(). However, the defaultRowPrefetch could be set as a Properties object on a setConnectionProperties() method. In GlassFish currently, we support only key value pairs as additional properties. For example, you could set MaxStatements property directly in additional properties.

We would consider this as an RFE, to parse the Properties object passed thereby reflecting this in database connection.





[GLASSFISH-18380] Use JSR 330 annotations in GlassFish JDBC Created: 20/Feb/12  Updated: 07/Mar/12  Resolved: 07/Mar/12

Status: Closed
Project: glassfish
Component/s: jdbc
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major
Reporter: tbeerbower Assignee: tbeerbower
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

GlassFish modules should move away from using non standard Classes like Habitat and use standards based annotations and classes as specified by jsr 330(javax.inject.Inject, javax.inject.Provider etc.). To quote Jerome: "Classes like Habitat exposes too many APIs available to the users that makes the hk2 evolution very difficult. " Also some of the APIs are unclear (when to use habitat.getComponent() versus habitat.getByType() /habitat.getByContract() ).

So, the first step is to move away from Habitat (where ever possible) and use jsr 330 interface and annotations.

In order to do this, the hk2 team will be making the following changes to the GlassFish modules.

1. Move away from org.jvnet.hk2.annotations.Inject to javax.inject.Inject

1.1 We will convert

@org.jvnet.hk2.annotations.Inject Foo foo

to

@javax.inject.Inject 
Foo foo;

1.2 We will convert

@org.jvnet.hk2.annotations.Inject(name="foo") Foo foo

to

@javax.inject.Inject
@javax.inject.Named("foo")
Foo foo;

1.3 We will convert

@org.jvnet.hk2.annotations.Inject(optional=true) Foo foo

to

@javax.inject.Inject
@org.jvnet.hk2.annotations.Optional
Foo foo;

1.4 We will convert

@org.jvnet.hk2.annotations.Inject(name="foo", option=true) Foo foo

to

@javax.inject.Inject
@javax.inject.Named("foo")
@org.jvnet.hk2.annotations.Optional
Foo foo;

2. If we find that a class injects Habitat (or Services) and uses

habitat.getByContract(Foo.class)

or

service.forContract(Foo.class).get()

then we will do the following:

2.1 Introduce a new injection:

@javax.inject.Inject
javax.inject.Provider<Foo>  fooProvider;

2.2 replace the getBycontract() / forContract() calls with:

fooProvider.get();

3. If we find that a class...

a) implements PostConstruct,
b) injects Habitat (or Services) and
c) uses habitat.getByContract(Foo.class) or services.forContract(Foo.class).get() in the postConstruct method,

...then we will do the following:

3.1 replace the getBycontract() / forConttract() calls with:

@javax.inject.Inject Foo foo;

3.2 Obviously, we will talk to the module owner to find out why the injection was not made in the first place.



 Comments   
Comment by tbeerbower [ 21/Feb/12 ]

First pass - Committed revision 52642.

Quicklook and JDBC dev-tests pass. Approved by Shalini.

Comment by tbeerbower [ 21/Feb/12 ]

The above replaces all usages of

org.jvnet.hk2.annotations.Inject

with

javax.inject.Inject

The following remaining usages of Habitat need to be looked at ...

Tests

habitat acquired through Utils.getHabitat();




[GLASSFISH-18105] "No PasswordCredential" error message for incorrect serverName in jdbc resource Created: 30/Dec/11  Updated: 09/Jan/12  Resolved: 09/Jan/12

Status: Closed
Project: glassfish
Component/s: jdbc
Affects Version/s: 3.1.1_b12
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Bobby Bissett Assignee: Shalini
Resolution: Works as designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Am not sure whether this is an issue in admin or jdbc.

We were changing the 'serverName' property of a JDBC connection pool to point our application to a new database. I used 'asadmin set' to change the value, not the console. After a few seconds, I saw:

"RAR7099: The mcf being used to allocate the connection and the MCF in the pool are not equal."

...which I expected. But then:

WARNING|glassfish3.1.1|javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource.allocator|_ThreadID=19;_ThreadName=Thread-3;|RAR5038:Unexpected exception while creating resource for pool pcsconfig-pool. Exception : javax.resource.spi.SecurityException: No PasswordCredential found

The username/password information was correct as far as I could tell, and after trying to see if it was even attempting a connection, I changed the serverName property to a non-existent host:

asadmin set resources.jdbc-connection-pool.pcsconfig-pool.property.serverName=notarealserver

The error message is the same "No PasswordCredential found" message, when I would expect something about the server not being found so that I could debug my JDBC connection issue.



 Comments   
Comment by Bobby Bissett [ 30/Dec/11 ]

Note that wen I set the serverName back to the original DB, where I know the user password are ok, I still get the same error. Restarting GF fixes the problem, but it would be nice to have some kind of message like "Please restart GF" rather than this password credential message which is confusing.

Out of curiosity, is it possible to change something like this without a restart?

Comment by Tom Mueller [ 03/Jan/12 ]

Changing the category to jdbc.

Comment by Shalini [ 09/Jan/12 ]

The diagnostic cause of RAR7099 says that the application should be redeployed when properties of a connection pool are modified. If you redeploy your application, you would see the error message.

Please go ahead and close this issue if you feel this is not an issue anymore.

Comment by Bobby Bissett [ 09/Jan/12 ]

Can you tell me where this diagnostic information is? In the server log, there are only the messages about the wrong credentials, which are misleading if instead it could tell the user to redeploy the app instead.

Comment by Shalini [ 09/Jan/12 ]

Please refer http://docs.oracle.com/cd/E19226-01/820-7700/gjkmp/index.html for the error message codes and diagnostic information.

Comment by Bobby Bissett [ 09/Jan/12 ]

Thanks. Will close this, but I'm not really satisfied with the user experience. Even having worked on GF all those years, I forgot there were separate messages that needed to be looked up online.





[GLASSFISH-18087] Flush connection pool fails to work when connection is leaked Created: 26/Dec/11  Updated: 27/Dec/11  Resolved: 27/Dec/11

Status: Resolved
Project: glassfish
Component/s: jdbc
Affects Version/s: 3.1.2, 4.0
Fix Version/s: 3.1.2_b16, 4.0

Type: Bug Priority: Major
Reporter: Shalini Assignee: Shalini
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: 3_1_2-approved

 Description   

When connection leak tracing is ON and the pool is used by the application, in a case when connection is leaked by the application and flush-connection-pool is done to reset the connections in the pool, expected behavior is not seen.

As per the flush connection pool description :

"The flush-connection-pool subcommand resets a JDBC connection
pool or a
connector connection pool to its initial state. Any existing
live
connections are destroyed, which means that the transactions
associated with
these connections are lost. The subcommand then recreates the
initial
connections for the pool, and restores the pool to its steady
pool size. "

the active live connections in the connection pool must be destroyed.

This should be fixed.



 Comments   
Comment by Shalini [ 26/Dec/11 ]
  • What is the impact on the customer of the bug?

Customers who use flush-connection-pool command while leak tracing is ON will not observe expected behavior. Hence live connections given to the application should be destroyed as per the flush connection pool feature.

  • How likely is it that a customer will see the bug and how serious is the bug?

Users will notice this when flush command is used and connection leak tracing is ON.

  • Is it a regression? Does it meet other bug fix criteria (security, performance, etc.)?

No, this is not a regression.

  • What is the cost/risk of fixing the bug?

How risky is the fix? How much work is the fix? Is the fix complicated?

Fix is not complicated. Fix is only in the areas of code where flush connection pool command is executed.

  • Is there an impact on documentation or message strings?

No, it is already documented that the flush connection pool will destroy live connections.

  • Which tests should QA (re)run to verify the fix did not destabilize GlassFish?

A flush-connection-pool command on a pool used by an application that has leaked a connection.

  • Which is the targeted build of 3.1.2 for this fix?

b16.

Comment by Shalini [ 27/Dec/11 ]

Modifying the flush connection pool behavior to remove all the active live connections from a pool when this operation is done. As a part of this operation, all the physical connection handles to the db are destroyed.

Fixed in trunk

Sending appserver/connectors/connectors-runtime/src/main/java/com/sun/enterprise/resource/pool/ConnectionPool.java
Transmitting file data .
Committed revision 51762.

Fixed in 3.1.2 branch.

Sending connectors/connectors-runtime/src/main/java/com/sun/enterprise/resource/pool/ConnectionPool.java
Transmitting file data .
Committed revision 51765.





[GLASSFISH-18026] Statement leak timeout and statement leak reclaim fields are not persisting, while creating a JDBC Connection pool. Created: 16/Dec/11  Updated: 27/Dec/11  Resolved: 27/Dec/11

Status: Resolved
Project: glassfish
Component/s: jdbc
Affects Version/s: None
Fix Version/s: 3.1.2_b16, 4.0

Type: Bug Priority: Major
Reporter: sumasri Assignee: Shalini
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: 3_1_2-approved

 Description   

Even though we pass the Statement leak timeout and statement leak reclaim values through CLI for create-jdbc-connection-pool, the values are not persisting in domain.xml.

These 2 parameters are missing in CreateJDBC** command class.



 Comments   
Comment by Shalini [ 20/Dec/11 ]

When asadmin create-jdbc-connection-pool --help is done, the attributes statement-leak-timeout-in-seconds and statement-leak-reclaim are displayed. However the CreateJdbcConnectionPool command does not have these parameters.

This will impact the users of this command. Fix for this issue is only in this command class, since the documentation and man pages already have the attributes. 3.1.1 features will still be available and are not changed after this fix.

The default value for the statement-leak-timeout is 0 seconds and statement-leak-reclaim is false. When create-jdbc-connection-pool command is not used and these attributes are set using asadmin set commands, the functionality works fine. Hence QA should run any tests that use create-jdbc-connection-pool command to test this feature.

Comment by Shalini [ 27/Dec/11 ]

Added the 2 missing attributes "statement-leak-timeout-in-seconds" and "statement-leak-reclaim" to the create-jdbc-connection-pool command.

Fixed in trunk.
Sending appserver/jdbc/admin/src/main/java/org/glassfish/jdbc/admin/cli/CreateJdbcConnectionPool.java
Transmitting file data .
Committed revision 51767.

Fixed in 3.1.2
Sending jdbc/admin/src/main/java/org/glassfish/jdbc/admin/cli/CreateJdbcConnectionPool.java
Transmitting file data .
Committed revision 51768.





[GLASSFISH-17973] Connection leaks when using max-connection-usage-count Created: 12/Dec/11  Updated: 09/Jan/12  Resolved: 09/Jan/12

Status: Resolved
Project: glassfish
Component/s: jdbc
Affects Version/s: 3.1, 3.1.1, 3.1.2_b12, 3.1.2_b13
Fix Version/s: 3.1.2_b17, 4.0

Type: Bug Priority: Major
Reporter: chaoslayer Assignee: Shalini
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: GZip Archive server-increased-timeout.log.gz     Text File server-thread43.log     GZip Archive server-usage-count-10.log.gz     GZip Archive server-validate-fine-b14.log.gz     GZip Archive server-validation-fine.log.gz     GZip Archive server-validation.log.gz     GZip Archive stress-test-bundles.tar.gz     File test-connection-leaks.sh    
Tags: 3_1_2-review

 Description   

I just made some tests with JDBC connection pool tuning and PostgreSQL.

As PostgreSQL doesn't have a lot of timeout options (at least version 8.x doesn't), I wanted to prevent certain bad things to happen by configuring our JDBC connection pools to not reuse connection for a long time and so I am now testing the "max-connection-usage-count" parameter.

However, enabling this parameter gives me connection leaks. I've already filed a bug for EclipseLink as I think this only happens, when a connection is being destroyed after being used for X times:


But still I get the feeling that there is also some ToDo on the GlassFish side as my tests reveal. For these tests I did the following:

  1. setup clean GlassFish 3.1.2 promoted
  2. modify domain.xml derby pool (add these):
    steady-pool-size="1"
    max-pool-size="10"
    statement-leak-timeout-in-seconds="10"
    statement-leak-reclaim="true"
    idle-timeout-in-seconds="10"
    connection-leak-timeout-in-seconds="15"
    connection-leak-reclaim="true"
    max-connection-usage-count="10"
    fail-all-connections="true"
    
  3. deploy the attached test bundles (copy files into .../autodeploy/bundles/)
  4. start derby
  5. start domain
  6. wait some time and see the server log


Here is a trace of a task that shows up log messages I'm worried about (resourceadapter logging set to FINE):

$ sed -ne '/ThreadID=43;/,/^$/p' domains/domain1/server.log

[#|2011-12-11T23:51:29.481+0100|INFO|glassfish3.1.2|org.ancoron.movie.stresstest.StressTestBean|_ThreadID=43;_ThreadName=Thread-2;|Running task #24|#]

[#|2011-12-11T23:51:29.698+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.enterprise.connectors.ConnectorRegistry;MethodName=getInstance;|returning the connector registry|#]

[#|2011-12-11T23:51:29.702+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.enterprise.connectors.ConnectionManagerImpl;MethodName=allocateConnection;|RAR5036:Resource reference is not defined for JNDI name [jdbc/__default__nontx]|#]

[#|2011-12-11T23:51:29.703+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.enterprise.connectors.ConnectorRegistry;MethodName=getInstance;|returning the connector registry|#]

[#|2011-12-11T23:51:29.703+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.spi|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.gjc.spi.ManagedConnectionFactory;MethodName=logFine;|In equals|#]

[#|2011-12-11T23:51:30.020+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.enterprise.connectors.ConnectorRegistry;MethodName=getDescriptor;|Found/returing Connector descriptor in connector registry.|#]

[#|2011-12-11T23:51:30.020+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.enterprise.connectors.ConnectionManagerImpl;MethodName=logFine;|ConnectionMgr: poolName DerbyPool  txLevel : 1|#]

[#|2011-12-11T23:51:30.020+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource.pool|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.enterprise.resource.pool.PoolManagerImpl;MethodName=logFine;|Returning noTxResourceManager|#]

[#|2011-12-11T23:51:32.391+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource.pool|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.enterprise.resource.pool.ConnectionPool;MethodName=logFine;|Resource Pool: getting on wait queue|#]

[#|2011-12-11T23:51:50.608+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource.pool|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.enterprise.resource.pool.ConnectionPool;MethodName=getResource;|removing wait monitor from queue: java.lang.Object@7bf51a2f|#]

[#|2011-12-11T23:51:53.289+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource.pool|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.enterprise.resource.pool.ConnectionPool;MethodName=getResource;|Resource Pool: elapsed time (ms) to get connection for [ResourceSpec :- 
connectionPoolName : DerbyPool
isXA_ : false
resoureId : jdbc/__default__nontx
resoureIdType : 1
pmResource : false
nonTxResource : true
lazyEnlistable : false
lazyAssociatable : false] : 23268|#]

[#|2011-12-11T23:51:53.290+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.spi|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.gjc.spi.ManagedConnection;MethodName=logFine;|In getConnection|#]

[#|2011-12-11T23:51:53.290+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.spi|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.gjc.spi.ManagedConnection;MethodName=executeInitSql;|Starting Init SQL|#]

[#|2011-12-11T23:51:53.291+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.spi|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.gjc.spi.ManagedConnection;MethodName=executeInitSql;|Finished executing Init SQL|#]

[#|2011-12-11T23:51:53.292+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource.pool|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.enterprise.resource.pool.PoolManagerImpl;MethodName=logFine;|Returning noTxResourceManager|#]

[#|2011-12-11T23:51:53.292+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource.rm|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.enterprise.resource.rm.NoTxResourceManagerImpl;MethodName=logFine;|NoTxResourceManagerImpl :: enlistResource called|#]

[#|2011-12-11T23:51:53.372+0100|FINEST|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.util|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.gjc.util.StatementLeakDetector;MethodName=startStatementLeakTracing;|Scheduled Statement leak tracing timer task|#]

[#|2011-12-11T23:51:53.373+0100|FINEST|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.util|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.gjc.util.StatementLeakDetector;MethodName=stopStatementLeakTracing;|Stopped Statement leak tracing timer task|#]

[#|2011-12-11T23:51:53.374+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource.pool|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.enterprise.resource.pool.PoolManagerImpl;MethodName=logFine;|Returning noTxResourceManager|#]

[#|2011-12-11T23:51:53.374+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource.rm|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.enterprise.resource.rm.NoTxResourceManagerImpl;MethodName=logFine;|NoTxResourceManagerImpl :: delistResource called|#]

[#|2011-12-11T23:51:53.374+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource.pool|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.enterprise.resource.pool.ConnectionPool;MethodName=resourceClosed;|Pool: resourceClosed: 67|#]

[#|2011-12-11T23:51:53.381+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.spi|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.gjc.spi.ManagedConnection;MethodName=logFine;|In cleanup|#]

[#|2011-12-11T23:51:53.549+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.spi|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.gjc.spi.ManagedConnection;MethodName=logFine;|In destroy|#]

[#|2011-12-11T23:51:53.606+0100|FINEST|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource.allocator|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.enterprise.resource.allocator.LocalTxConnectorAllocator;MethodName=destroyResource;|destroyResource for LocalTxConnectorAllocator done|#]

[#|2011-12-11T23:51:53.607+0100|INFO|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource.pool|_ThreadID=43;_ThreadName=Thread-2;|RAR7113: destroying connection since it has reached the maximum usage of : 1|#]

[#|2011-12-11T23:51:53.607+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource.pool|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.enterprise.resource.pool.ConnectionPool;MethodName=notifyWaitingThreads;|Notifying wait monitor : java.lang.Object@3b86a79a|#]

[#|2011-12-11T23:51:53.607+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource.pool|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.enterprise.resource.pool.ConnectionPool;MethodName=resourceClosed;|Pool: resourceFreed: 67|#]

[#|2011-12-11T23:51:53.607+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.enterprise.connectors.ConnectorRegistry;MethodName=getInstance;|returning the connector registry|#]

[#|2011-12-11T23:51:53.608+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.enterprise.connectors.ConnectionManagerImpl;MethodName=allocateConnection;|RAR5036:Resource reference is not defined for JNDI name [jdbc/__default__nontx]|#]

[#|2011-12-11T23:51:53.608+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.enterprise.connectors.ConnectorRegistry;MethodName=getInstance;|returning the connector registry|#]

[#|2011-12-11T23:51:53.608+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.spi|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.gjc.spi.ManagedConnectionFactory;MethodName=logFine;|In equals|#]

[#|2011-12-11T23:51:53.608+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.enterprise.connectors.ConnectorRegistry;MethodName=getDescriptor;|Found/returing Connector descriptor in connector registry.|#]

[#|2011-12-11T23:51:53.608+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.enterprise.connectors.ConnectionManagerImpl;MethodName=logFine;|ConnectionMgr: poolName DerbyPool  txLevel : 1|#]

[#|2011-12-11T23:51:53.609+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource.pool|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.enterprise.resource.pool.PoolManagerImpl;MethodName=logFine;|Returning noTxResourceManager|#]

[#|2011-12-11T23:51:54.410+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.spi|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.gjc.spi.ManagedConnectionFactory;MethodName=logFine;|In createManagedConnection|#]

[#|2011-12-11T23:51:54.413+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.spi|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.gjc.spi.ManagedConnectionFactory;MethodName=logFine;|In equals|#]

[#|2011-12-11T23:51:54.416+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.spi|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.gjc.spi.ManagedConnectionFactory;MethodName=logFine;|In equals|#]

[#|2011-12-11T23:51:54.417+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.spi|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.gjc.spi.ManagedConnectionFactory;MethodName=logFine;|In getResourceAdapter|#]

[#|2011-12-11T23:51:54.418+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource.pool|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.enterprise.resource.pool.ConnectionPool;MethodName=createSingleResource;|Time taken to create a single resource : jdbc/__default__nontx and adding to the pool (ms) : 8|#]

[#|2011-12-11T23:51:54.418+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource.pool|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.enterprise.resource.pool.ConnectionPool;MethodName=addResource;|Pool: resource added|#]

[#|2011-12-11T23:51:54.600+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource.pool|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.enterprise.resource.pool.ConnectionPool;MethodName=addResource;|Pool: resource added|#]

[#|2011-12-11T23:51:54.602+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource.pool|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.enterprise.resource.pool.ConnectionPool;MethodName=getResource;|Resource Pool: elapsed time (ms) to get connection for [ResourceSpec :- 
connectionPoolName : DerbyPool
isXA_ : false
resoureId : jdbc/__default__nontx
resoureIdType : 1
pmResource : false
nonTxResource : true
lazyEnlistable : false
lazyAssociatable : false] : 993|#]

[#|2011-12-11T23:51:54.637+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.spi|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.gjc.spi.ManagedConnection;MethodName=logFine;|In getConnection|#]

[#|2011-12-11T23:51:54.679+0100|WARNING|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors|_ThreadID=43;_ThreadName=Thread-2;|RAR5117 : Failed to obtain/create connection from connection pool [ DerbyPool ]. Reason : com.sun.appserv.connectors.internal.api.PoolingException: This Managed Connection is not valid as the physical connection is not usable|#]

[#|2011-12-11T23:51:54.746+0100|WARNING|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.spi|_ThreadID=43;_ThreadName=Thread-2;|RAR5114 : Error allocating connection : [Error in allocating a connection. Cause: This Managed Connection is not valid as the physical connection is not usable]|#]

[#|2011-12-11T23:51:54.753+0100|INFO|glassfish3.1.2|org.eclipse.persistence.session.file:/tmp/osgiapp8911206436065082297/_MovieUnit|_ThreadID=43;_ThreadName=Thread-2;|Communication failure detected when attempting to perform read query outside of a transaction. Attempting to retry query. Error was: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: This Managed Connection is not valid as the physical connection is not usable
Error Code: 0
Call: SELECT DISTINCT c_type FROM mov_video WHERE (c_id = ?)
        bind => [1 parameter bound]
Query: ReadObjectQuery(name="readObject" referenceClass=VideoEntityImpl sql="SELECT DISTINCT c_type FROM mov_video WHERE (c_id = ?)").|#]

[#|2011-12-11T23:51:54.753+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.enterprise.connectors.ConnectorRegistry;MethodName=getInstance;|returning the connector registry|#]

[#|2011-12-11T23:51:54.754+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.enterprise.connectors.ConnectionManagerImpl;MethodName=allocateConnection;|RAR5036:Resource reference is not defined for JNDI name [jdbc/__default__nontx]|#]

[#|2011-12-11T23:51:54.754+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.enterprise.connectors.ConnectorRegistry;MethodName=getInstance;|returning the connector registry|#]

[#|2011-12-11T23:51:54.755+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.spi|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.gjc.spi.ManagedConnectionFactory;MethodName=logFine;|In equals|#]

[#|2011-12-11T23:51:54.757+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.enterprise.connectors.ConnectorRegistry;MethodName=getDescriptor;|Found/returing Connector descriptor in connector registry.|#]

[#|2011-12-11T23:51:54.758+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.enterprise.connectors.ConnectionManagerImpl;MethodName=logFine;|ConnectionMgr: poolName DerbyPool  txLevel : 1|#]

[#|2011-12-11T23:51:54.759+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource.pool|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.enterprise.resource.pool.PoolManagerImpl;MethodName=logFine;|Returning noTxResourceManager|#]

[#|2011-12-11T23:51:55.434+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource.pool|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.enterprise.resource.pool.ConnectionPool;MethodName=getResource;|Resource Pool: elapsed time (ms) to get connection for [ResourceSpec :- 
connectionPoolName : DerbyPool
isXA_ : false
resoureId : jdbc/__default__nontx
resoureIdType : 1
pmResource : false
nonTxResource : true
lazyEnlistable : false
lazyAssociatable : false] : 673|#]

[#|2011-12-11T23:51:55.434+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.spi|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.gjc.spi.ManagedConnection;MethodName=logFine;|In getConnection|#]

[#|2011-12-11T23:51:55.434+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.spi|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.gjc.spi.ManagedConnection;MethodName=executeInitSql;|Starting Init SQL|#]

[#|2011-12-11T23:51:55.434+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.spi|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.gjc.spi.ManagedConnection;MethodName=executeInitSql;|Finished executing Init SQL|#]

[#|2011-12-11T23:51:55.435+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource.pool|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.enterprise.resource.pool.PoolManagerImpl;MethodName=logFine;|Returning noTxResourceManager|#]

[#|2011-12-11T23:51:55.435+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource.rm|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.enterprise.resource.rm.NoTxResourceManagerImpl;MethodName=logFine;|NoTxResourceManagerImpl :: enlistResource called|#]

[#|2011-12-11T23:51:55.437+0100|FINEST|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.util|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.gjc.util.StatementLeakDetector;MethodName=startStatementLeakTracing;|Scheduled Statement leak tracing timer task|#]

[#|2011-12-11T23:51:55.442+0100|FINEST|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.util|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.gjc.util.StatementLeakDetector;MethodName=stopStatementLeakTracing;|Stopped Statement leak tracing timer task|#]

[#|2011-12-11T23:51:55.443+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource.pool|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.enterprise.resource.pool.PoolManagerImpl;MethodName=logFine;|Returning noTxResourceManager|#]

[#|2011-12-11T23:51:55.443+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource.rm|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.enterprise.resource.rm.NoTxResourceManagerImpl;MethodName=logFine;|NoTxResourceManagerImpl :: delistResource called|#]

[#|2011-12-11T23:51:55.455+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource.pool|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.enterprise.resource.pool.ConnectionPool;MethodName=resourceClosed;|Pool: resourceClosed: 97|#]

[#|2011-12-11T23:51:55.455+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.spi|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.gjc.spi.ManagedConnection;MethodName=logFine;|In cleanup|#]

[#|2011-12-11T23:51:55.539+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.spi|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.gjc.spi.ManagedConnection;MethodName=logFine;|In destroy|#]

[#|2011-12-11T23:51:55.539+0100|FINEST|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource.allocator|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.enterprise.resource.allocator.LocalTxConnectorAllocator;MethodName=destroyResource;|destroyResource for LocalTxConnectorAllocator done|#]

[#|2011-12-11T23:51:55.540+0100|INFO|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource.pool|_ThreadID=43;_ThreadName=Thread-2;|RAR7113: destroying connection since it has reached the maximum usage of : 1|#]

[#|2011-12-11T23:51:55.541+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource.pool|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.enterprise.resource.pool.ConnectionPool;MethodName=notifyWaitingThreads;|Notifying wait monitor : java.lang.Object@1465d8d2|#]

[#|2011-12-11T23:51:55.541+0100|FINE|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource.pool|_ThreadID=43;_ThreadName=Thread-2;ClassName=com.sun.enterprise.resource.pool.ConnectionPool;MethodName=resourceClosed;|Pool: resourceFreed: 97|#]

[#|2011-12-11T23:51:55.541+0100|INFO|glassfish3.1.2|org.ancoron.movie.stresstest.StressTestBean|_ThreadID=43;_ThreadName=Thread-2;|... task #24 was successful|#]


...and more or less exactly 15 seconds later (the connection leak timeout):

[#|2011-12-11T23:52:10.450+0100|WARNING|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource.pool|_ThreadID=1114;_ThreadName=Thread-2;
|A potential connection leak detected for connection pool DerbyPool. The stack trace of the thread is provided below : 
com.sun.enterprise.resource.pool.ConnectionPool.setResourceStateToBusy(ConnectionPool.java:324)
com.sun.enterprise.resource.pool.ConnectionPool.getResourceFromPool(ConnectionPool.java:758)
com.sun.enterprise.resource.pool.ConnectionPool.getUnenlistedResource(ConnectionPool.java:632)
com.sun.enterprise.resource.pool.ConnectionPool.internalGetResource(ConnectionPool.java:526)
com.sun.enterprise.resource.pool.ConnectionPool.getResource(ConnectionPool.java:381)
com.sun.enterprise.resource.pool.PoolManagerImpl.getResourceFromPool(PoolManagerImpl.java:242)
com.sun.enterprise.resource.pool.PoolManagerImpl.getResource(PoolManagerImpl.java:167)
com.sun.enterprise.connectors.ConnectionManagerImpl.getResource(ConnectionManagerImpl.java:338)
com.sun.enterprise.connectors.ConnectionManagerImpl.internalGetConnection(ConnectionManagerImpl.java:301)
com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:190)
com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:165)
com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:160)
com.sun.gjc.spi.base.DataSource.getConnection(DataSource.java:113)
org.eclipse.persistence.sessions.JNDIConnector.connect(JNDIConnector.java:123)
org.eclipse.persistence.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:162)
org.eclipse.persistence.internal.databaseaccess.DatasourceAccessor.connectInternal(DatasourceAccessor.java:330)
org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.connectInternal(DatabaseAccessor.java:293)
org.eclipse.persistence.internal.databaseaccess.DatasourceAccessor.reconnect(DatasourceAccessor.java:565)
org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.reconnect(DatabaseAccessor.java:1508)
org.eclipse.persistence.internal.databaseaccess.DatasourceAccessor.incrementCallCount(DatasourceAccessor.java:305)
org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:579)
org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:535)
org.eclipse.persistence.internal.sessions.AbstractSession.basicExecuteCall(AbstractSession.java:1717)
org.eclipse.persistence.sessions.server.ServerSession.executeCall(ServerSession.java:566)
org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:207)
org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:193)
org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.selectOneRow(DatasourceCallQueryMechanism.java:666)
org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectOneRowFromTable(ExpressionQueryMechanism.java:2656)
org.eclipse.persistence.descriptors.InheritancePolicy.selectOneRowUsingDefaultMultipleTableSubclassRead(InheritancePolicy.java:1462)
org.eclipse.persistence.descriptors.InheritancePolicy.selectOneRowUsingMultipleTableSubclassRead(InheritancePolicy.java:1492)
org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectOneRow(ExpressionQueryMechanism.java:2624)
org.eclipse.persistence.queries.ReadObjectQuery.executeObjectLevelReadQuery(ReadObjectQuery.java:450)
org.eclipse.persistence.queries.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:1081)
org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:844)
org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:1040)
org.eclipse.persistence.queries.ReadObjectQuery.execute(ReadObjectQuery.java:418)
org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:1128)
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2871)
org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1516)
org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1498)
org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1449)
org.eclipse.persistence.internal.jpa.EntityManagerImpl.executeQuery(EntityManagerImpl.java:820)
org.eclipse.persistence.internal.jpa.EntityManagerImpl.findInternal(EntityManagerImpl.java:760)
org.eclipse.persistence.internal.jpa.EntityManagerImpl.find(EntityManagerImpl.java:653)
org.eclipse.persistence.internal.jpa.EntityManagerImpl.find(EntityManagerImpl.java:532)
com.sun.enterprise.container.common.impl.EntityManagerWrapper.find(EntityManagerWrapper.java:320)
org.ancoron.movie.jpa.impl.MovieJPAServiceImpl.get(MovieJPAServiceImpl.java:65)
org.ancoron.movie.jpa.impl.MovieJPAServiceImpl.getVideo(MovieJPAServiceImpl.java:82)
sun.reflect.GeneratedMethodAccessor171.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:616)
org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1052)
org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1124)
com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:5388)
com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:619)
com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:571)
com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doAround(SystemInterceptorProxy.java:162)
com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:144)
sun.reflect.GeneratedMethodAccessor49.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:616)
com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:861)
com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:370)
com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5360)
com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5348)
com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:214)
com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:88)
$Proxy111.getVideo(Unknown Source)
sun.reflect.GeneratedMethodAccessor165.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:616)
org.glassfish.osgicdi.impl.OSGiServiceFactory$DynamicInvocationHandler.invoke(OSGiServiceFactory.java:234)
$Proxy164.getVideo(Unknown Source)
org.ancoron.movie.ejb.MovieEJBImpl.getVideo(MovieEJBImpl.java:70)
sun.reflect.GeneratedMethodAccessor147.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:616)
org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1052)
org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1124)
com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:5388)
com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:619)
com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:571)
org.jboss.weld.ejb.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:49)
sun.reflect.GeneratedMethodAccessor53.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:616)
com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:861)
com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:571)
com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doAround(SystemInterceptorProxy.java:162)
com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:144)
sun.reflect.GeneratedMethodAccessor49.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:616)
com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:861)
com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:370)
com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5360)
com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5348)
com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:214)
com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:88)
$Proxy162.getVideo(Unknown Source)
sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:616)
org.glassfish.osgicdi.impl.OSGiServiceFactory$DynamicInvocationHandler.invoke(OSGiServiceFactory.java:234)
$Proxy157.getVideo(Unknown Source)
org.ancoron.movie.stresstest.StressTestBean$1.run(StressTestBean.java:71)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
java.lang.Thread.run(Thread.java:679)

Monitoring Statistics :

 Monitoring Statistics for 
DerbyPool|#]

[#|2011-12-11T23:52:10.450+0100|INFO|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource.pool|_ThreadID=1114;_ThreadName=Thread-2;|Reclaiming the leaked connection of pool [ DerbyPool ] and destroying it so as to avoid both the application that leaked the connection and any other request that can potentially acquire the same connection from the pool end up using the connection at the same time|#]


Running the tests without the "max-connection-usage-count" is totally fine and not a single connection leak is detected, nor do other problems occur.



 Comments   
Comment by Mitesh Meswani [ 14/Dec/11 ]

Can you please try bumping up connection-leak-timeout-in-seconds and see whether the "leaks" are still detected?

Comment by chaoslayer [ 14/Dec/11 ]

Of course I can and will do.

However, this simple test with very short timeout values has been established because I saw
the same behavior in another application where timeouts are much higher, e.g.:

max-wait-time-in-millis="60000"
init-sql="SET statement_timeout TO 30000"
idle-timeout-in-seconds="300"
connection-leak-reclaim="true"
connection-leak-timeout-in-seconds="3600"
connection-creation-retry-interval-in-seconds="10"
fail-all-connections="true"
statement-leak-reclaim="true"
statement-leak-timeout-in-seconds="60"
statement-cache-size="0"
steady-pool-size="10"
max-pool-size="100"


As the result is the same in terms of warnings and leaks and also the stacktraces look identical
up to the application layer I don't think it will yield different results, but I'll do it anyways.

P.S.: can someone edit the issue description and shorten the line length of the embedded log excerpt?
Seems like I don't have the permission to do so. Thanx

Comment by chaoslayer [ 14/Dec/11 ]

Just made another run with increased connection leak timeout (600 seconds).

Results:

$ egrep 'Running task #[0-9]+' logs/server.log* | wc -l
10000
$ egrep 'task #[0-9]+ was successful' logs/server.log* | wc -l
10000
$ egrep 'task #[0-9]+ failed' logs/server.log* | wc -l
0
$ grep 'A potential connection leak' logs/server.log* | wc -l
3
$ grep 'Communication failure detected' logs/server.log* | wc -l
6
$ grep 'RAR5114' logs/server.log* | wc -l
4
$ grep 'RAR5117' logs/server.log* | wc -l
4
$ grep 'RAR7113' logs/server.log* | wc -l
934
Comment by chaoslayer [ 14/Dec/11 ]

Attached server-increased-timeout.log.gz containing the full run with connection-leak-timeout-in-seconds set to 600 seconds.

Comment by Shalini [ 15/Dec/11 ]

From the logs, the connection leak tracing happens when a particular connection
that is got from the pool is not closed within the specified time (600 seconds). Could you
observe at random points of time, the number of connection made to the database
using netstat or some other mechanism?

There are also some connection failure messages, to track this, the connection
validation could be turned on with table as the validation-method and a valid
connection-validation-table-name could be provided. This will detect the connection
failures and a FINE log would display the stacktrace of this failure.

The configuration fail-all-connections=true works when connection validation is turned on
and if there is a connection validation failure.

From the logs, i understand that your application spawns multiple threads around 10000,
each getting and closing a connection. Does each task do anything else with the
connection got from the pool? It would be great if you could describe more about your application.

I would also like to know if this behavior is seen only when you use eclipselink. A default
installation of glassfish with these same pool settings, goes through fine?

Comment by ancoron [ 16/Dec/11 ]

OK, here we go:

The test "application" being used consists of 3 main parts:

  • a Stateless EJB using CMP (JPA) as a data access layer
  • a Stateless EJB providing business logic and using the data access SLSB
  • a "client" Singleton EJB used as an automatic test starter

The code for the test client Singleton is here:

@Singleton
@Startup
public class StressTestBean {

    private static final Logger log = Logger.getLogger(StressTestBean.class.getName());
    private static final ExecutorService exec = Executors.newCachedThreadPool();
    
    @Inject
    @OSGiService(dynamic=true)
    private MovieService svc;
    
    @Resource
    private TimerService timers;

    @PostConstruct
    protected void init() {
        timers.createSingleActionTimer(3000, new TimerConfig());
    }
    
    @Timeout
    protected void timeout() {
        final int num = 10000;
        log.log(Level.INFO,
                "Starting in-container stress test with {0} tasks...",
                String.valueOf(num));
        
        for(int i=0; i<num; i++) {
            final int tmp = i;
            exec.execute(new Runnable() {

                @Override
                public void run() {
                    log.log(Level.INFO,
                            "Running task #{0}",
                            String.valueOf(tmp));
                    try {
                        svc.getVideo(Long.valueOf(
                                Math.round(Math.random() * Long.MAX_VALUE)
                                ));
                        
                        log.log(Level.INFO,
                                "... task #{0} was successful",
                                String.valueOf(tmp));
                    } catch(MovieServiceException msx) {
                        log.log(Level.INFO,
                                "... task #" + tmp + " failed",
                                msx);
                    }
                }
            });
        }
        
    }
}


For the test itself there are no entries in the tables (or at least it doesn't matter).

I have re-configured the datasource with validation, increased the max-wait-time and enabled
basically anything GlassFish offers for datasource/connection/statement validation/checking/recovery:

<jdbc-connection-pool validation-table-name="mov_video"
                      steady-pool-size="1"
                      statement-timeout-in-seconds="60"
                      connection-leak-reclaim="true"
                      idle-timeout-in-seconds="120"
                      max-wait-time-in-millis="120000"
                      connection-creation-retry-attempts="10"
                      validate-atmost-once-period-in-seconds="30"
                      statement-leak-timeout-in-seconds="90"
                      connection-creation-retry-interval-in-seconds="5"
                      max-pool-size="10"
                      datasource-classname="org.apache.derby.jdbc.ClientDataSource"
                      res-type="javax.sql.DataSource"
                      max-connection-usage-count="10"
                      connection-leak-timeout-in-seconds="600"
                      statement-leak-reclaim="true"
                      name="DerbyPool"
                      init-sql="SELECT COUNT(*) FROM mov_video"
                      transaction-isolation-level="read-committed"
                      ping="true"
                      fail-all-connections="true"
                      >
    <property name="PortNumber" value="1527"></property>
    <property name="Password" value="APP"></property>
    <property name="User" value="APP"></property>
    <property name="serverName" value="localhost"></property>
    <property name="DatabaseName" value="sun-appserv-samples"></property>
    <property name="connectionAttributes" value=";create=true"></property>
    <property name="prefer-validate-over-recreate" value="true"></property>
</jdbc-connection-pool>


All the rest is default and apart from the bundles and logging there is no
modification of the tested GlassFish 3.1.2-b13.

For testing I've written a little script to ease getting results and tracking things.

Note that I used the monitoring for collecting some data.

  • jdbc-connection-pool="HIGH"
  • accessing the REST API using curl

Please note the values for "current-conns" in the following outputs. Those are exactly
what the monitoring via REST API reports (may be another bug - only happens when under
heavy load - when that monitoring data is most needed to be exact).

Here is the output for a test run with logging kept at INFO:

Starting database in the background.
Log redirected to /srv/servers/glassfish/3.1.2-b13/glassfish/databases/derby.log.
Command start-database executed successfully.
Waiting for domain1 to start .....
Successfully started the domain : domain1
domain  Location: /srv/servers/glassfish/3.1.2-b13/glassfish/domains/domain1
Log File: /srv/servers/glassfish/3.1.2-b13/glassfish/domains/domain1/logs/server.log
Admin Port: 4848
Command start-domain executed successfully.
[2011-12-16T01:31:58.610] ...waiting for deployment to finish...
[2011-12-16T01:32:13.829] Deployment successful :)
Command enable-monitoring executed successfully.
Command enable-monitoring executed successfully.
[2011-12-16T01:32:20.191] tasks=81, current-conns=9
[2011-12-16T01:32:22.002] tasks=150, current-conns=6
[2011-12-16T01:32:23.065] tasks=227, current-conns=7
[2011-12-16T01:32:24.150] tasks=292, current-conns=8
[2011-12-16T01:32:25.244] tasks=358, current-conns=7
[2011-12-16T01:32:26.334] tasks=419, current-conns=8
[2011-12-16T01:32:27.435] tasks=519, current-conns=8
[2011-12-16T01:32:28.539] tasks=635, current-conns=8
[2011-12-16T01:32:29.657] tasks=710, current-conns=5
[2011-12-16T01:32:32.344] tasks=779, current-conns=7
[2011-12-16T01:32:33.594] tasks=1051, current-conns=8
[2011-12-16T01:32:34.793] tasks=1534, current-conns=9
[2011-12-16T01:32:35.969] tasks=2024, current-conns=8
[2011-12-16T01:32:37.143] tasks=2569, current-conns=4
[2011-12-16T01:32:38.427] tasks=3290, current-conns=5
[2011-12-16T01:32:39.712] tasks=3958, current-conns=5
[2011-12-16T01:32:41.001] tasks=4600, current-conns=3
[2011-12-16T01:32:42.236] tasks=5364, current-conns=2
[2011-12-16T01:32:43.427] tasks=6330, current-conns=5
[2011-12-16T01:32:44.618] tasks=7330, current-conns=1
[2011-12-16T01:32:45.858] tasks=8467, current-conns=6
[2011-12-16T01:32:47.138] tasks=9736, current-conns=4
[2011-12-16T01:32:48.349] tasks=10000, current-conns=-3
[2011-12-16T01:32:48.361] Waiting for connection leak timeout (600 seconds)...
[2011-12-16T01:42:49.764] Test results: statement-leaks=4, connection-leaks=9
Waiting for the domain to stop .....
Command stop-domain executed successfully.
Fri Dec 16 01:42:58 CET 2011 : Connection obtained for host: 0.0.0.0, port number 1527.
Fri Dec 16 01:42:58 CET 2011 : Apache Derby Network Server - 10.8.1.2 - (1095077) shutdown
Command stop-database executed successfully.


And here is the output for logging set to FINE:

Starting database in the background.
Log redirected to /srv/servers/glassfish/3.1.2-b13/glassfish/databases/derby.log.
Command start-database executed successfully.
Waiting for domain1 to start ...
Successfully started the domain : domain1
domain  Location: /srv/servers/glassfish/3.1.2-b13/glassfish/domains/domain1
Log File: /srv/servers/glassfish/3.1.2-b13/glassfish/domains/domain1/logs/server.log
Admin Port: 4848
Command start-domain executed successfully.
[2011-12-16T02:03:37.115] ...waiting for deployment to finish...
[2011-12-16T02:03:51.353] Deployment successful :)
Command enable-monitoring executed successfully.
Command enable-monitoring executed successfully.
[2011-12-16T02:04:03.034] tasks=0, current-conns=4
[2011-12-16T02:04:04.156] tasks=0, current-conns=4
[2011-12-16T02:04:05.279] tasks=0, current-conns=5
[2011-12-16T02:04:06.409] tasks=0, current-conns=5
[2011-12-16T02:04:07.584] tasks=0, current-conns=5
[2011-12-16T02:04:08.719] tasks=0, current-conns=5
[2011-12-16T02:04:09.866] tasks=0, current-conns=5
[2011-12-16T02:04:11.039] tasks=0, current-conns=5
[2011-12-16T02:04:12.218] tasks=0, current-conns=5
[2011-12-16T02:04:13.367] tasks=0, current-conns=5
[2011-12-16T02:04:14.544] tasks=0, current-conns=5
[2011-12-16T02:04:15.717] tasks=0, current-conns=5
[2011-12-16T02:04:16.874] tasks=0, current-conns=5
[2011-12-16T02:04:18.072] tasks=0, current-conns=5
[2011-12-16T02:04:19.254] tasks=0, current-conns=6
[2011-12-16T02:04:22.071] tasks=0, current-conns=6
[2011-12-16T02:04:23.279] tasks=0, current-conns=6
[2011-12-16T02:04:24.466] tasks=0, current-conns=6
[2011-12-16T02:04:25.657] tasks=0, current-conns=6
[2011-12-16T02:04:26.854] tasks=0, current-conns=7
[2011-12-16T02:04:28.210] tasks=0, current-conns=7
[2011-12-16T02:04:29.373] tasks=0, current-conns=7
[2011-12-16T02:04:30.567] tasks=0, current-conns=7
[2011-12-16T02:04:31.759] tasks=0, current-conns=9
[2011-12-16T02:04:32.978] tasks=0, current-conns=9
[2011-12-16T02:04:34.177] tasks=0, current-conns=9
[2011-12-16T02:04:35.414] tasks=0, current-conns=10
[2011-12-16T02:04:36.634] tasks=0, current-conns=10
[2011-12-16T02:04:37.856] tasks=0, current-conns=10
[2011-12-16T02:04:39.051] tasks=0, current-conns=10
[2011-12-16T02:04:40.280] tasks=0, current-conns=10
[2011-12-16T02:04:41.514] tasks=6, current-conns=10
[2011-12-16T02:04:42.952] tasks=23, current-conns=8
[2011-12-16T02:04:44.209] tasks=30, current-conns=8
[2011-12-16T02:04:45.427] tasks=57, current-conns=6
[2011-12-16T02:04:46.772] tasks=70, current-conns=8
[2011-12-16T02:04:47.986] tasks=88, current-conns=7
[2011-12-16T02:04:49.629] tasks=154, current-conns=6
[2011-12-16T02:04:50.825] tasks=273, current-conns=5
[2011-12-16T02:04:52.074] tasks=383, current-conns=2
[2011-12-16T02:04:53.406] tasks=491, current-conns=0
[2011-12-16T02:04:54.631] tasks=570, current-conns=-3
[2011-12-16T02:04:55.897] tasks=669, current-conns=0
[2011-12-16T02:04:57.166] tasks=775, current-conns=0
[2011-12-16T02:04:58.445] tasks=888, current-conns=-1
[2011-12-16T02:04:59.669] tasks=994, current-conns=1
[2011-12-16T02:05:00.978] tasks=1124, current-conns=-1
[2011-12-16T02:05:02.207] tasks=1234, current-conns=-3
[2011-12-16T02:05:03.482] tasks=1352, current-conns=-5
[2011-12-16T02:05:04.733] tasks=1477, current-conns=-4
[2011-12-16T02:05:05.964] tasks=1585, current-conns=-4
[2011-12-16T02:05:07.231] tasks=1714, current-conns=-8
[2011-12-16T02:05:08.499] tasks=1838, current-conns=-7
[2011-12-16T02:05:09.751] tasks=1962, current-conns=-9
[2011-12-16T02:05:11.042] tasks=2088, current-conns=-10
[2011-12-16T02:05:12.339] tasks=2206, current-conns=-13
[2011-12-16T02:05:13.642] tasks=2325, current-conns=-13
[2011-12-16T02:05:14.975] tasks=2465, current-conns=-14
[2011-12-16T02:05:16.308] tasks=2606, current-conns=-15
[2011-12-16T02:05:17.610] tasks=2750, current-conns=-18
[2011-12-16T02:05:18.893] tasks=2885, current-conns=-16
[2011-12-16T02:05:20.228] tasks=3016, current-conns=-18
[2011-12-16T02:05:21.519] tasks=3149, current-conns=-23
[2011-12-16T02:05:22.993] tasks=3312, current-conns=-21
[2011-12-16T02:05:24.336] tasks=3452, current-conns=-21
[2011-12-16T02:05:25.638] tasks=3579, current-conns=-21
[2011-12-16T02:05:27.028] tasks=3725, current-conns=-23
[2011-12-16T02:05:28.367] tasks=3933, current-conns=-28
[2011-12-16T02:05:29.674] tasks=4127, current-conns=-25
[2011-12-16T02:05:30.984] tasks=4356, current-conns=-28
[2011-12-16T02:05:32.303] tasks=4613, current-conns=-32
[2011-12-16T02:05:33.599] tasks=4742, current-conns=-31
[2011-12-16T02:05:34.930] tasks=4930, current-conns=-31
[2011-12-16T02:05:36.257] tasks=5143, current-conns=-34
[2011-12-16T02:05:37.584] tasks=5372, current-conns=-37
[2011-12-16T02:05:38.907] tasks=5596, current-conns=-39
[2011-12-16T02:05:40.247] tasks=5845, current-conns=-39
[2011-12-16T02:05:41.600] tasks=6088, current-conns=-40
[2011-12-16T02:05:43.001] tasks=6349, current-conns=-42
[2011-12-16T02:05:44.397] tasks=6624, current-conns=-43
[2011-12-16T02:05:46.177] tasks=6719, current-conns=-44
[2011-12-16T02:05:47.562] tasks=6999, current-conns=-48
[2011-12-16T02:05:48.952] tasks=7267, current-conns=-44
[2011-12-16T02:05:50.309] tasks=7542, current-conns=-45
[2011-12-16T02:05:51.738] tasks=7903, current-conns=-49
[2011-12-16T02:05:53.128] tasks=8208, current-conns=-50
[2011-12-16T02:05:54.528] tasks=8514, current-conns=-48
[2011-12-16T02:05:55.944] tasks=8820, current-conns=-49
[2011-12-16T02:05:57.336] tasks=9119, current-conns=-50
[2011-12-16T02:05:58.744] tasks=9454, current-conns=-50
[2011-12-16T02:06:00.180] tasks=9805, current-conns=-54
[2011-12-16T02:06:01.567] tasks=10000, current-conns=-62
[2011-12-16T02:06:01.585] Waiting for connection leak timeout (600 seconds)...
[2011-12-16T02:16:02.992] Test results: statement-leaks=1, connection-leaks=14
Waiting for the domain to stop .....
Command stop-domain executed successfully.
Fri Dec 16 02:16:12 CET 2011 : Connection obtained for host: 0.0.0.0, port number 1527.
Fri Dec 16 02:16:12 CET 2011 : Apache Derby Network Server - 10.8.1.2 - (1095077) shutdown
Command stop-database executed successfully.


For using a different JPA implementation inside GlassFish I don't have much
experience (it has to work with OSGi, too).

Can you recommend some how-to?

Comment by ancoron [ 16/Dec/11 ]

Attached server-validation.log.gz, which is the server.log for the latest test run with logging kept at INFO.

Attached server-validation-fine.log.gz, which is the server.log for the latest test run with logging kept at FINE.

Comment by ancoron [ 16/Dec/11 ]

Attached the test script test-connection-leaks.sh, which should be put directly into .../glassfish/.

This script just starts GlassFish, observes various things during the test run and shuts down everything afterwards. So you still have to provide a configured GlassFish first including the test OSGi bundles.

Comment by Shalini [ 16/Dec/11 ]

You could take a glassfish installation from http://dlc.sun.com.edgesuite.net/glassfish/3.1.2/promoted/ and then deploy this application (war/war file) after starting the domain. I still see that connection validation is not turned on. The "is-connection-validation-required" attribute should be set to true and "connection-validation-method" attribute should be set to "table" along with the validation-table-name attribute.

The log level of resourceadapter could be set to FINE to observe the connection validation failure messages.

Comment by Mitesh Meswani [ 16/Dec/11 ]

Assigning to Shalini as the current discussions on this issue are around jdbc connector functionality.

Comment by ancoron [ 16/Dec/11 ]

I always take the GlassFish binaries from there, anyway...

I've attached a new version of the test script that now also includes the
real number of connections established to derby.

Additionally I've included the database setup into the script prior to
starting GlassFish to avoid the connection failures at first start.

With that I've made a new run:

  1. download 3.1.2 promoted b14
  2. copy bundles into .../autodeploy/bundles/
  3. reconfigure default derby connection pool:
    <jdbc-connection-pool name="DerbyPool"
                          datasource-classname="org.apache.derby.jdbc.ClientDataSource"
                          res-type="javax.sql.DataSource"
                          steady-pool-size="1"
                          max-pool-size="10"
                          ping="true"
                          max-wait-time-in-millis="120000"
                          transaction-isolation-level="read-committed"
                          is-connection-validation-required="true"
                          connection-validation-method="table"
                          validation-table-name="mov_video"
                          validate-atmost-once-period-in-seconds="30"
                          fail-all-connections="true"
                          init-sql="SELECT COUNT(*) FROM mov_video"
                          connection-creation-retry-attempts="10"
                          connection-creation-retry-interval-in-seconds="5"
                          max-connection-usage-count="10"
                          idle-timeout-in-seconds="120"
                          connection-leak-timeout-in-seconds="600"
                          connection-leak-reclaim="true"
                          statement-timeout-in-seconds="60"
                          statement-leak-timeout-in-seconds="90"
                          statement-leak-reclaim="true"
                          >
        <property name="PortNumber" value="1527"></property>
        <property name="Password" value="APP"></property>
        <property name="User" value="APP"></property>
        <property name="serverName" value="localhost"></property>
        <property name="DatabaseName" value="sun-appserv-samples"></property>
        <property name="connectionAttributes" value=";create=true"></property>
        <property name="prefer-validate-over-recreate" value="true"></property>
    </jdbc-connection-pool>
    
  4. reconfigure logging to not rotate and set the following:
    javax.enterprise.resource.resourceadapter.level=FINE
    
  5. run the test script inside .../glassfish/:
    ...
    Successfully started the domain : domain1
    domain  Location: /srv/servers/glassfish/3.1.2-b14/glassfish/domains/domain1
    Log File: /srv/servers/glassfish/3.1.2-b14/glassfish/domains/domain1/logs/server.log
    Admin Port: 4848
    Command start-domain executed successfully.
    [2011-12-16T11:17:27.264] ...waiting for deployment to finish...
    [2011-12-16T11:17:35.354] Deployment successful :)
    Command enable-monitoring executed successfully.
    Command enable-monitoring executed successfully.
    [2011-12-16T11:17:40.256] tasks=0, current-conns=10, active-derby-conns=10
    [2011-12-16T11:17:41.339] tasks=0, current-conns=10, active-derby-conns=10
    [2011-12-16T11:17:42.410] tasks=1, current-conns=10, active-derby-conns=10
    [2011-12-16T11:17:43.496] tasks=1, current-conns=5, active-derby-conns=9
    [2011-12-16T11:17:44.565] tasks=1, current-conns=5, active-derby-conns=9
    [2011-12-16T11:17:45.651] tasks=1, current-conns=9, active-derby-conns=9
    [2011-12-16T11:17:46.760] tasks=1, current-conns=10, active-derby-conns=10
    [2011-12-16T11:17:47.873] tasks=1, current-conns=9, active-derby-conns=11
    [2011-12-16T11:17:49.011] tasks=1, current-conns=10, active-derby-conns=10
    [2011-12-16T11:17:51.654] tasks=1, current-conns=9, active-derby-conns=9
    [2011-12-16T11:17:59.728] tasks=1, current-conns=9, active-derby-conns=9
    [2011-12-16T11:18:00.847] tasks=1, current-conns=9, active-derby-conns=10
    [2011-12-16T11:18:01.975] tasks=1, current-conns=9, active-derby-conns=10
    [2011-12-16T11:18:22.888] tasks=1, current-conns=9, active-derby-conns=10
    [2011-12-16T11:18:32.313] tasks=1, current-conns=9, active-derby-conns=10
    [2011-12-16T11:18:33.465] tasks=1, current-conns=9, active-derby-conns=10
    [2011-12-16T11:18:44.495] tasks=1, current-conns=9, active-derby-conns=10
    [2011-12-16T11:18:47.382] tasks=1, current-conns=10, active-derby-conns=10
    [2011-12-16T11:18:48.555] tasks=2, current-conns=10, active-derby-conns=10
    [2011-12-16T11:18:49.962] tasks=3, current-conns=10, active-derby-conns=10
    [2011-12-16T11:18:51.238] tasks=7, current-conns=10, active-derby-conns=10
    [2011-12-16T11:18:52.384] tasks=32, current-conns=7, active-derby-conns=10
    [2011-12-16T11:18:54.027] tasks=56, current-conns=8, active-derby-conns=10
    [2011-12-16T11:18:55.217] tasks=65, current-conns=7, active-derby-conns=10
    [2011-12-16T11:18:56.392] tasks=96, current-conns=7, active-derby-conns=10
    [2011-12-16T11:18:57.572] tasks=132, current-conns=6, active-derby-conns=10
    [2011-12-16T11:18:58.963] tasks=180, current-conns=0, active-derby-conns=6
    [2011-12-16T11:19:00.211] tasks=316, current-conns=-1, active-derby-conns=10
    [2011-12-16T11:19:01.378] tasks=368, current-conns=2, active-derby-conns=9
    [2011-12-16T11:19:02.532] tasks=368, current-conns=2, active-derby-conns=9
    [2011-12-16T11:19:03.897] tasks=449, current-conns=2, active-derby-conns=10
    [2011-12-16T11:19:05.185] tasks=579, current-conns=0, active-derby-conns=10
    [2011-12-16T11:19:06.357] tasks=733, current-conns=-2, active-derby-conns=10
    [2011-12-16T11:19:07.546] tasks=866, current-conns=-2, active-derby-conns=10
    [2011-12-16T11:19:08.756] tasks=1004, current-conns=-2, active-derby-conns=10
    [2011-12-16T11:19:09.945] tasks=1126, current-conns=-3, active-derby-conns=10
    [2011-12-16T11:19:11.141] tasks=1239, current-conns=-6, active-derby-conns=10
    [2011-12-16T11:19:12.422] tasks=1372, current-conns=-7, active-derby-conns=11
    [2011-12-16T11:19:13.648] tasks=1508, current-conns=-6, active-derby-conns=10
    [2011-12-16T11:19:14.872] tasks=1666, current-conns=-6, active-derby-conns=10
    [2011-12-16T11:19:16.110] tasks=1813, current-conns=-9, active-derby-conns=11
    [2011-12-16T11:19:17.327] tasks=1946, current-conns=-11, active-derby-conns=9
    [2011-12-16T11:19:18.578] tasks=2096, current-conns=-9, active-derby-conns=9
    [2011-12-16T11:19:19.797] tasks=2237, current-conns=-11, active-derby-conns=10
    [2011-12-16T11:19:21.024] tasks=2376, current-conns=-14, active-derby-conns=9
    [2011-12-16T11:19:22.288] tasks=2522, current-conns=-15, active-derby-conns=9
    [2011-12-16T11:19:23.772] tasks=2706, current-conns=-17, active-derby-conns=10
    [2011-12-16T11:19:25.151] tasks=2852, current-conns=-19, active-derby-conns=10
    [2011-12-16T11:19:26.404] tasks=2990, current-conns=-23, active-derby-conns=9
    [2011-12-16T11:19:27.664] tasks=3136, current-conns=-23, active-derby-conns=10
    [2011-12-16T11:19:28.894] tasks=3277, current-conns=-26, active-derby-conns=9
    [2011-12-16T11:19:30.193] tasks=3429, current-conns=-27, active-derby-conns=10
    [2011-12-16T11:19:31.461] tasks=3590, current-conns=-27, active-derby-conns=10
    [2011-12-16T11:19:32.867] tasks=3788, current-conns=-30, active-derby-conns=9
    [2011-12-16T11:19:34.132] tasks=3991, current-conns=-37, active-derby-conns=7
    [2011-12-16T11:19:35.437] tasks=4257, current-conns=-33, active-derby-conns=10
    [2011-12-16T11:19:36.729] tasks=4510, current-conns=-33, active-derby-conns=10
    [2011-12-16T11:19:38.026] tasks=4772, current-conns=-34, active-derby-conns=10
    [2011-12-16T11:19:39.314] tasks=4999, current-conns=-36, active-derby-conns=10
    [2011-12-16T11:19:40.712] tasks=5230, current-conns=-34, active-derby-conns=10
    [2011-12-16T11:19:42.032] tasks=5428, current-conns=-34, active-derby-conns=10
    [2011-12-16T11:19:43.331] tasks=5691, current-conns=-35, active-derby-conns=10
    [2011-12-16T11:19:44.629] tasks=5962, current-conns=-37, active-derby-conns=9
    [2011-12-16T11:19:45.929] tasks=6204, current-conns=-41, active-derby-conns=9
    [2011-12-16T11:19:47.243] tasks=6443, current-conns=-40, active-derby-conns=11
    [2011-12-16T11:19:48.558] tasks=6655, current-conns=-42, active-derby-conns=10
    [2011-12-16T11:19:49.884] tasks=6872, current-conns=-41, active-derby-conns=10
    [2011-12-16T11:19:51.260] tasks=7250, current-conns=-49, active-derby-conns=10
    [2011-12-16T11:19:52.618] tasks=7746, current-conns=-43, active-derby-conns=10
    [2011-12-16T11:19:53.964] tasks=8160, current-conns=-43, active-derby-conns=11
    [2011-12-16T11:19:55.326] tasks=8543, current-conns=-47, active-derby-conns=9
    [2011-12-16T11:19:56.734] tasks=8777, current-conns=-46, active-derby-conns=10
    [2011-12-16T11:19:58.132] tasks=9159, current-conns=-47, active-derby-conns=10
    [2011-12-16T11:19:59.555] tasks=9671, current-conns=-50, active-derby-conns=10
    [2011-12-16T11:20:00.898] tasks=9997, current-conns=-58, active-derby-conns=9
    [2011-12-16T11:20:02.260] tasks=9997, current-conns=-58, active-derby-conns=9
    [2011-12-16T11:20:03.606] tasks=9998, current-conns=-58, active-derby-conns=8
    [2011-12-16T11:20:04.968] tasks=9999, current-conns=-58, active-derby-conns=7
    [2011-12-16T11:20:06.336] tasks=10000, current-conns=-58, active-derby-conns=6
    [2011-12-16T11:20:06.348] Waiting for connection leak timeout (600 seconds)...
    [2011-12-16T11:20:56.362] ...550 seconds left...
    [2011-12-16T11:21:56.383] ...490 seconds left...
    [2011-12-16T11:22:56.404] ...430 seconds left...
    [2011-12-16T11:23:56.425] ...370 seconds left...
    [2011-12-16T11:24:56.446] ...310 seconds left...
    [2011-12-16T11:25:56.467] ...250 seconds left...
    [2011-12-16T11:26:56.488] ...190 seconds left...
    [2011-12-16T11:27:56.509] ...130 seconds left...
    [2011-12-16T11:28:56.528] ...70 seconds left...
    [2011-12-16T11:29:56.549] ...10 seconds left...
    [2011-12-16T11:30:06.608] Test results: statement-leaks=0, connection-leaks=10
    ...
    


I've also attached a new server.log: server-validate-fine-b14.log.gz

I hope I now did everything correctly to get connection validation.

If you want to have a look at the full code of the test bundles, just go here:

Comment by Shalini [ 22/Dec/11 ]

Looks like this is an issue with the max-connection-usage count attribute only. When i executed the test case without leak tracing
off, i could reproduce this issue. Will put in a fix for this issue soon.

Comment by ancoron [ 22/Dec/11 ]

Thank you.

Comment by prasads [ 26/Dec/11 ]

Changing component to JDBC and adding 3_1_2-review tag as per discussion with Shalini

Comment by Shalini [ 09/Jan/12 ]

Fixed in trunk.

The max connection usage operation is modified to remove a resource handle from the pool when its usage count is more than max connection usage count directly.

Sending appserver/connectors/connectors-runtime/src/main/java/com/sun/enterprise/resource/pool/AssocWithThreadResourcePool.java
Sending appserver/connectors/connectors-runtime/src/main/java/com/sun/enterprise/resource/pool/ConnectionPool.java
Sending appserver/connectors/connectors-runtime/src/main/resources/com/sun/logging/enterprise/resource/resourceadapter/LogStrings.properties
Transmitting file data ...
Committed revision 51959.

Comment by Shalini [ 09/Jan/12 ]

Fixed in 3.1.2 branch :

Sending connectors/connectors-runtime/src/main/java/com/sun/enterprise/resource/pool/AssocWithThreadResourcePool.java
Sending connectors/connectors-runtime/src/main/java/com/sun/enterprise/resource/pool/ConnectionPool.java
Sending connectors/connectors-runtime/src/main/resources/com/sun/logging/enterprise/resource/resourceadapter/LogStrings.properties
Transmitting file data ...
Committed revision 51962.

Comment by chaoslayer [ 09/Jan/12 ]

Thank you very much for the fix.

I'm also glad to see this fix landed in the 3.1.2 branch.





[GLASSFISH-17746] Error message is getting displaying twice while creating a JDBC connection pool in GUI with wrong data Created: 16/Nov/11  Updated: 14/Mar/12  Resolved: 27/Dec/11

Status: Resolved
Project: glassfish
Component/s: jdbc
Affects Version/s: None
Fix Version/s: 3.1.2_b16, 4.0_b43

Type: Bug Priority: Major
Reporter: sumasri Assignee: Shalini
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: 3_1_2-approved

 Description   

Reproducible steps:
1) In GUI, Create a JDBC connection pool with wrong credentials and ping should be enabled.
2)After creation of a pool,the error message is getting displayed twice as shown below.

Error Pool successfully created with the following Warning
Ping Connection Pool failed for sadf. Ping failed Exception - Class name is wrong or classpath is not set for : com.ddtek.jdbcx.db2.DB2DataSource. Please check the server.log for more details. Ping failed Exception - Class name is wrong or classpath is not set for : com.ddtek.jdbcx.db2.DB2DataSource. Please check the server.log for more details.



 Comments   
Comment by Shalini [ 01/Dec/11 ]

Assigning issue back to GUI team. The PingConnectionPool.execute method sets the report appropriately when there is an exception. While debugging, the lines 153-156 of PingConnectionPool.java, the report.getMessage() just gives :

"Ping Connection Pool failed for asda. Ping failed Exception - Class name is wrong or classpath is not set for : com.ibm.db2.jdbc.DB2DataSource. Please check the server.log for more details."

The GUI should display the propogated exceptions appropriately.

Comment by Shalini [ 20/Dec/11 ]

The error message is printed twice because of setting the localizedMessage in report. Removing this will solve the issue.

Comment by Shalini [ 20/Dec/11 ]

Fixed in trunk.

Sending appserver/connectors/admin/src/main/java/org/glassfish/connectors/admin/cli/PingConnectionPool.java
Transmitting file data .
Committed revision 51664.

Comment by Shalini [ 26/Dec/11 ]
  • What is the impact on the customer of the bug?

Customers who execute ping-connection-pool command are likely to see this error message displayed twice in the event of a failure.

  • How likely is it that a customer will see the bug and how serious is the bug?

Whenever a ping-connection-pool command fails.

  • Is it a regression? Does it meet other bug fix criteria (security, performance, etc.)?

No, this is not a regression.

  • What is the cost/risk of fixing the bug?

Fix for this issue is only in the PingConnectionPool command.

  • How risky is the fix? How much work is the fix? Is the fix complicated?

Fix is not risky. This issue will not be seen when the error report that is generated from this command is modified and sent back.

  • Is there an impact on documentation or message strings?

No, this does not involve a documentation or message strings change.

  • Which tests should QA (re)run to verify the fix did not destabilize GlassFish?

The fix does not destabilize GlassFish as this is only a modification of error report generated.

  • Which is the targeted build of 3.1.2 for this fix?

b16.

Comment by Shalini [ 26/Dec/11 ]

Reopening this issue for fix in 3.1.2 branch.

Comment by Shalini [ 27/Dec/11 ]

Fixed in 3.1.2 branch.

Sending connectors/admin/src/main/java/org/glassfish/connectors/admin/cli/PingConnectionPool.java
Transmitting file data .
Committed revision 51770.





[GLASSFISH-17573] Pool flush fails Created: 02/Nov/11  Updated: 10/Feb/13

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: 3.1.1
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: rkolar02 Assignee: sfelts
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File flushfail.png     PNG File flushlog.png     PNG File pooltarget.png    

 Description   

another bugrep of flush pool failure, which seems to be pretty popular issue.

This one is probably caused by not enabling pool to be flushed on domain controller.



 Comments   
Comment by Shalini [ 07/Dec/11 ]

I see that the pool Rapidshare is not initialized. This means the pool has not been used by any application till this time. Only after the pool is initialized, the flush connection pool functionality will work.

Is this still an issue?

Comment by ljnelson [ 10/Oct/12 ]

I am not the original reporter but I can reproduce this bug at will on an initialized connection pool.

I am assuming that successfully pinging the pool will initialize it.

If you ping the pool, then try to flush it it fails reliably.





[GLASSFISH-17544] With Introspect enabled for JavaDB-30 , Derby-30 Oracle Datasource Classnames are also displayed. Created: 01/Nov/11  Updated: 25/Jan/12  Resolved: 06/Dec/11

Status: Closed
Project: glassfish
Component/s: jdbc
Affects Version/s: 3.1.2_b01
Fix Version/s: 3.1.2_b13, 4.0

Type: Bug Priority: Major
Reporter: shaline Assignee: Shalini
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OS:Windows 2008 server
GF 3.1.2 b07
Firefox 3.6


Tags: 3_1_2-review, 3_1_2-verified

 Description   

In GF 3.1.2 b07, when we enable "introspect" for a JDBC pool with Database Driver Vendor" name as Derby-30 or JavaDB-30 or Embedded-Derby-30, and any value as "Resource Type", and then select "Next " button. In the next page, the List of Datasource Classnames displayed in the drop-down, has the Classnames for both Oracle and Derby db's. Even for the Driver Classnames , we see the Oracle Drivers listed along with Derby drivers.



 Comments   
Comment by shaline [ 01/Nov/11 ]

To reproduce this issue, place the Oracle ojdbc6.jar under domain1/lib dir and restart domain.
Then create a pool with Java-DB or Derby-DB where in Datasource Classnames for both Derby and Oracle are displayed. For JavaDB or DerbyDB without "-30" option, the Datasource Classnames are displayed correctly.

Comment by sumasri [ 16/Nov/11 ]

I could reproduce the issue.. But, the values are coming from back end.. Hence, Transferring it to Shalini from JDBC team.

Data source class names displaying for the condition dbVendor=JavaDB-30&introspect=true&resType=javax.sql.DataSource are

  • oracle.jdbc.pool.OracleConnectionPoolDataSource
  • oracle.jdbc.pool.OracleDataSource
  • oracle.jdbc.xa.client.OracleXADataSource
  • org.apache.derby.jdbc.ClientConnectionPoolDataSource
  • org.apache.derby.jdbc.ClientDataSource
  • org.apache.derby.jdbc.ClientXADataSource
  • org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource
  • org.apache.derby.jdbc.EmbeddedDataSource
  • org.apache.derby.jdbc.EmbeddedSimpleDataSource
  • org.apache.derby.jdbc.EmbeddedXADataSource
Comment by sumasri [ 21/Nov/11 ]

Assigning it to JDBC team.Hence, modified the component.

Comment by Shalini [ 01/Dec/11 ]

Users who use admin console for introspection are affected by this bug when different versions of derby are used in the database vendor name. Fix is available for this issue. The GUI jdbc connection pool page should be unit tested with different options for database vendor name for verification of this issue.

Comment by Shalini [ 06/Dec/11 ]

Fixed in trunk.

Sending appserver/connectors/connectors-runtime/src/main/java/com/sun/enterprise/connectors/util/DriverLoader.java
Transmitting file data .
Committed revision 51292.

Comment by Shalini [ 06/Dec/11 ]

Fixed in 3.1.2.

Sending connectors/connectors-runtime/src/main/java/com/sun/enterprise/connectors/util/DriverLoader.java
Transmitting file data .
Committed revision 51296.

Comment by shaline [ 25/Jan/12 ]

verified in GF 3.1.2 b18.





[GLASSFISH-17528] JDBC connection leak on JSP runtimeException Created: 29/Oct/11  Updated: 10/Feb/13

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: 3.1.1
Fix Version/s: None

Type: Bug Priority: Major
Reporter: rkolar02 Assignee: sfelts
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows, FreeBSD


Attachments: PNG File conf1.png     PNG File conf2.png     File connleak.war     Text File server.txt    
Tags: 3_1_2-exclude, hang, jdbc, leak

 Description   

If exception is thrown during JSP page processing then opened database connection is not returned back to pool resulting in connection leak, connection is still marked in pool as used.

This bug will make application to hang after number of exceptions thrown will reach configured pool size.

Because JDBC pool flush do not works also (another bug) then you have to restart instance every now and then to avoid server hang caused by leaked jdbc connections.



 Comments   
Comment by Shalini [ 02/Nov/11 ]

Could you attach the jdbc connection pool/resource configuration? A quick workaround is to set the attribute "connection-leak-timeout-in-seconds" to a positive non zero value and "connection-leak-reclaim" to true to reclaim the leaked connections.

Comment by Shalini [ 11/Nov/11 ]

Ideally, the application should close the connections in the finally block after usage. If not, there could be connection leaks. Please set the Leak timeout value to a non-zero number and observe from the server.log that connections are indeed leaked. To reclaim the connections, set Leak reclaim to true.

Please attach your server.log so we can figure out if there is any other issue apart from the connection leaks.

Comment by Shalini [ 11/Nov/11 ]

Reducing the priority as this is not a blocker. There is a way to detect connection leaks and reclaim them. Also, it is the responsibility of the application to close all the connections in finally block.

Comment by Shalini [ 07/Dec/11 ]

Is this still an issue? If not, could we close this one.

Comment by rkolar02 [ 09/Dec/11 ]

with connection leak detection enabled it runs so-so in day to day operation but if fails during stress testing.





[GLASSFISH-17433] Maximum-pool-size is involved in the behavior of unpooled connections Created: 17/Oct/11  Updated: 08/Dec/11

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: 4.0
Fix Version/s: None

Type: Improvement Priority: Major
Reporter: ito_m Assignee: Shalini
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All



 Description   

Maximum-pool-size in pool settings is described on GlassFish Server Administration Console Reference below.

The maximum number of connections in the pool. The default value is 32.

However this functionality always sets an upper limit to the number of connections regardless of the pooling attribute value which is enabled or disabled although almost any other attributes such as initial-and-minimum-pool-size has no effect on unpooled connections.

I think this spec may confuse users and can be a frequent cause of incorrect use. It is because the more likely scenario where unpooled mode will be selected is the case a user would like to use connections pooled by a JDBC driver. In this case, not only a JDBC driver but also an application server redundantly restricts the connection size by default due to the default value of maximum-pool-size(32).

I would like to confirm the reason why maximum-pool-size is effective on even unpooled mode. Besides, I believe we should avoid adopting an option which lets users change maximum-pool-size manually so that they can make sure maximum-pool-size is greater than the upper limit set on the JDBC driver. I think it difficult for users to understand the relationship between maximum-pool-size and unpooled mode.

Therefore I would suggest either one of the following improvements if it is acceptable.
1. Remove the corresponding codes controlling the maximum size of connections when the pooling attribute is specified as disabled.

com.sun.enterprise.resource.pool.UnpooledResource.java
       private synchronized boolean incrementPoolSize(){
        if(poolSize >= maxPoolSize) // These are the condition
            return false;           // for maximum-pool-size.
        poolSize++;
        return true;
    }

2. Prepare a value of maximum-pool-size which allows users to create unlimited connections and switch to this special value automatically when the pooling attribute is specified as disabled. They can also specify another value as maximum-pool-size consciously afterwards if needed.



 Comments   
Comment by Shalini [ 08/Dec/11 ]

Though the names (steady-pool-size/max-pool-size) may sound
inappropriate for the "pooling=false" option, these are used to limit
the concurrent number of connections usage ie., a pool can serve upto
"max-pool-size" number of connections at any point in time. We do not
allow unlimited connections to be acquired as that can potentially bring
down the entire DB/EIS server.

We could come up with a better naming mechanism for steady-pool-size and max-pool-size when connection pooling is turned off.





[GLASSFISH-17265] The task checking idle connections is scheduled using previous idleTimeout value on reconfiguration Created: 01/Sep/11  Updated: 06/Dec/11  Resolved: 06/Dec/11

Status: Resolved
Project: glassfish
Component/s: jdbc
Affects Version/s: 4.0
Fix Version/s: 3.1.2_b13, 4.0

Type: Bug Priority: Major
Reporter: ito_m Assignee: Shalini
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Tags: 3_1_2-review

 Description   

When changing idletimeout after initialization of JDBC connection pool, the reconfiguration of pool is executed.
In this case, I expected the task checking idle connections would adopt the updated idletimeout value.
However it still seems to use the previous idletimeout value after reconfiguration.

[Reproducible steps]

  1. asadmin set resources.jdbc-connection-pool.DerbyPool.pooling=true
    asadmin set resources.jdbc-connection-pool.DerbyPool.steady-pool-size=8
    asadmin set resources.jdbc-connection-pool.DerbyPool.idle-timeout-in-seconds=10
  2. Getting a connection using DerbyPool. (DerbyPool is initialized on first getConnection().)
  3. asadmin set resources.jdbc-connection-pool.DerbyPool.idle-timeout-in-seconds=30
  4. Sleep 20 (sec)
  5. Idle connections are destroyed though idletimeout is 30 (sec).

Note that I couldn't always reproduce this issue by following the above steps. It might depend on the machine spec. So I confirmed the previous idletimeout value was passed Timer for ResizerTask directly on debug.

[Reason]
A variable idletime which is used in scheduleResizerTask() is not updated as follows.

com.sun.enterprise.resource.pool.ConnectionPool.java
public synchronized void reconfigurePool(ConnectorConnectionPool poolResource) throws PoolingException {
    int _idleTime = Integer.parseInt(poolResource.getIdleTimeoutInSeconds())
            * 1000;
    if (poolInitialized) {
        if (_idleTime != idletime && _idleTime != 0) {
            scheduleResizerTask();//idletime was not updated
        }
        if (_idleTime == 0) {
            //resizerTask.cancel();
            cancelResizerTask();
        }
    }
    idletime = _idleTime;//idletime will be updated here
    ...
}

private void scheduleResizerTask() {
    ...
    timer.scheduleAtFixedRate(resizerTask, idletime, idletime);// the previous idletime was passed 
    ...
}

I tested using GFv3.2(r48897).



 Comments   
Comment by Shalini [ 06/Dec/11 ]

Fixed in trunk.

Sending appserver/connectors/connectors-runtime/src/main/java/com/sun/enterprise/resource/pool/ConnectionPool.java
Sending appserver/connectors/connectors-runtime/src/main/java/com/sun/enterprise/resource/pool/UnpooledResource.java
Transmitting file data ..
Committed revision 51293.

Comment by Shalini [ 06/Dec/11 ]

Fixed in 3.1.2

Sending connectors/connectors-runtime/src/main/java/com/sun/enterprise/resource/pool/ConnectionPool.java
Sending connectors/connectors-runtime/src/main/java/com/sun/enterprise/resource/pool/UnpooledResource.java
Transmitting file data ..
Committed revision 51297.





[GLASSFISH-17262] Reconfiguration on unpooling causes NullPointerException Created: 31/Aug/11  Updated: 06/Dec/11  Resolved: 06/Dec/11

Status: Resolved
Project: glassfish
Component/s: jdbc
Affects Version/s: 4.0
Fix Version/s: 3.1.2_b13, 4.0

Type: Bug Priority: Major
Reporter: ito_m Assignee: Shalini
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Attachments: Zip Archive GF17262.zip    
Tags: 3_1_2-review

 Description   

When increasing steady-pool-size dynamically after getting connections from unpooling JDBC connection pool, ConnectorRuntimeException occurred because of NullPointerException on creating a new connection. Unpooling JDBC connection pool should not be affected by steady-pool-size because the container must not have any pooled connections. I think the problem is that UnpooledResource.reconfigurePool() just delegates ConnectionPool.reconfigurePool().

[Reproducible steps]
1. asadmin set resources.jdbc-connection-pool.DerbyPool.pooling=false
2. asadmin set resources.jdbc-connection-pool.DerbyPool.steady-pool-size=8
3. Getting connections using DerbyPool.
4. asadmin set resources.jdbc-connection-pool.DerbyPool.steady-pool-size=9

[server.log]
[#|2011-08-31T15:31:07.060+1000|SEVERE|glassfish3.2|LogStrings.org.glassfish.resources|_ThreadID=43;_ThreadName=Thread-2;|resources.resource-manager.change-event-failed
com.sun.appserv.connectors.internal.api.ConnectorRuntimeException
at com.sun.enterprise.connectors.service.ConnectorConnectionPoolAdminServiceImpl.updateMCFAndPoolAttributes(ConnectorConnectionPoolAdminServiceImpl.java:1275)
at com.sun.enterprise.connectors.service.ConnectorConnectionPoolAdminServiceImpl.reconfigureConnectorConnectionPool(ConnectorConnectionPoolAdminServiceImpl.java:1221)
at com.sun.enterprise.connectors.ConnectorRuntime.reconfigureConnectorConnectionPool(ConnectorRuntime.java:878)
at com.sun.enterprise.resource.deployer.JdbcConnectionPoolDeployer.redeployResource(JdbcConnectionPoolDeployer.java:784)
at org.glassfish.resources.ResourceManager$PropertyChangeHandler.handleChangeEvent(ResourceManager.java:382)
at org.glassfish.resources.ResourceManager$PropertyChangeHandler.changed(ResourceManager.java:332)
at org.jvnet.hk2.config.ConfigSupport.sortAndDispatch(ConfigSupport.java:332)
at org.glassfish.resources.ResourceManager.changed(ResourceManager.java:277)
at org.jvnet.hk2.config.Transactions$ConfigListenerJob.process(Transactions.java:400)
at org.jvnet.hk2.config.Transactions$ConfigListenerJob.process(Transactions.java:390)
at org.jvnet.hk2.config.Transactions$ConfigListenerNotifier$1$1.call(Transactions.java:280)
at org.jvnet.hk2.config.Transactions$ConfigListenerNotifier$1$1.call(Transactions.java:278)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)

#]

[StackTrace when NullPointerException occurs]
UnpooledResource(ConnectionPool).createSingleResource(ResourceAllocator) line: 907
UnpooledResource(ConnectionPool).createResource(ResourceAllocator) line: 1185
RWLockDataStructure.addResource(ResourceAllocator, int) line: 98
UnpooledResource(ConnectionPool).addResource(ResourceAllocator) line: 282
UnpooledResource(ConnectionPool).createResourceAndAddToPool(ResourceAllocator) line: 1501
UnpooledResource(ConnectionPool).increaseSteadyPoolSize(int) line: 1491
UnpooledResource(ConnectionPool).reconfigurePool(ConnectorConnectionPool) line: 1425
PoolManagerImpl.reconfigPoolProperties(ConnectorConnectionPool) line: 674
ConnectorConnectionPoolAdminServiceImpl.updateMCFAndPoolAttributes(ConnectorConnectionPool) line: 1273
ConnectorConnectionPoolAdminServiceImpl.reconfigureConnectorConnectionPool(ConnectorConnectionPool, Set) line: 1221
ConnectorRuntime.reconfigureConnectorConnectionPool(ConnectorConnectionPool, Set) line: 878
JdbcConnectionPoolDeployer.redeployResource(Object) line: 784
ResourceManager$PropertyChangeHandler.handleChangeEvent(T) line: 382
ResourceManager$PropertyChangeHandler.changed(TYPE, Class<T>, T) line: 332

[line:907 of ConnectionPool]
protected ResourceHandle createSingleResource(ResourceAllocator resourceAllocator) throws PoolingException {
...
resourceHandle = resourceAllocator.createResource();//L907: resourceAllocator is null when UnpooledResource.reconfigurePool() is called.
...
}

I tested using GFv3.2(r48897).



 Comments   
Comment by ito_m [ 31/Aug/11 ]

The attached zip file is a reproducible application.

1. unzip the attached zip file to trunk\v2\appserv-tests\devtests directory
2. cd trunk\v2\appserv-tests\devtests\issues\GF17262
3. asadmin start-domain
4. asadmin start-database
5. ant prepare
6. ant run-unpool
7. check server.log of DAS.

Comment by Shalini [ 06/Dec/11 ]

Fixed in trunk.

Sending appserver/connectors/connectors-runtime/src/main/java/com/sun/enterprise/resource/pool/ConnectionPool.java
Sending appserver/connectors/connectors-runtime/src/main/java/com/sun/enterprise/resource/pool/UnpooledResource.java
Transmitting file data ..
Committed revision 51293.

Comment by Shalini [ 06/Dec/11 ]

Fixed in 3.1.2.

Sending connectors/connectors-runtime/src/main/java/com/sun/enterprise/resource/pool/ConnectionPool.java
Sending connectors/connectors-runtime/src/main/java/com/sun/enterprise/resource/pool/UnpooledResource.java
Transmitting file data ..
Committed revision 51297.





[GLASSFISH-17260] There is an exclusive multi-threading problem in create jdbc connection pool Created: 31/Aug/11  Updated: 10/Feb/13

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: v2.1.1
Fix Version/s: None

Type: Bug Priority: Major
Reporter: jifeng Assignee: sfelts
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

windows 32


Tags: 3_1_2-exclude

 Description   

package:appserv-core/src/com/sun/enterprise/resource/PoolManagerImpl.java(#createAndInitPool)

This method is not thread-safe,in multithreading environment ,the pool created by thread 1 will be overwritten by thread 2

Precondition:thread 1 and thread 2 use the same poolName
Steps:

  • thread 1 execute getPool(poolName) ( return null)
  • thread 1 create ResourcePool (execute ResourcePoolFactoryImpl.newInstance method)
  • thread 2 execute getPool(poolName) ( return null,because thread 1 is not execute addPool method)
  • thread 1 execute addPool( pool )( add to poolTable )
  • thread 2 execute addPool( pool ) ( add to poolTalbe and overwrite pool )
private ConcurrentHashMap poolTable;

private ResourcePool createAndInitPool(final String poolName, PoolType pt) 
        throws PoolingException 
    {
        ResourcePool pool = getPool( poolName );
	if ( pool == null ) {
            pool = ResourcePoolFactoryImpl.newInstance( poolName, pt );
	    addPool( pool );
	    try {
	        ConnectorRuntime runtime = ConnectorRuntime.getRuntime();
	        if ( runtime.getEnviron() == ConnectorConstants.SERVER ) {
	    	    if (isJdbcPool( poolName ) ) {
	    	        enableJDBCPoolMonitoring(pool, poolName);
	    	    } else {
	    	        enableConnectorConnectionPoolMonitoring(pool, poolName);
	    	    }
	        }
	    } catch( Exception e) {
	        _logger.log(Level.INFO, "poolmon.cannot_reg");
	        _logger.log(Level.FINE, "Exception while registering " +
	    	    "connection pool", e);
	    }
        if (_logger.isLoggable(Level.FINE)){
            _logger.fine( "Created connection  pool  and added it to PoolManager :" + pool);
        }
    }
	return pool;
    }

if overwrite pool,then in enableJDBCPoolMonitoring(pool, poolName) method, Register monitor MBean there will be problems。






[GLASSFISH-17259] Cannot retrieve monitoring info when the level is LOW Created: 31/Aug/11  Updated: 10/Feb/13

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: 4.0
Fix Version/s: None

Type: Bug Priority: Major
Reporter: ito_m Assignee: sfelts
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Tags: 3_1_2-exclude

 Description   

We can set the monitoring level to HIGH, LOW or OFF. My understanding is that specified values except for OFF make monitoring functionality available. However, I couldn't acquire any monitoring items for DAS on setting jdbc-connection-pool's monitoring level to LOW.

I tried to get monitoring info on LOW level in the following way. All of them resulted in failure. When switching to HIGH level, I could retrieve monitoring info successfully.

1. Admin Console
Click Server > Monitor > resources and select $

{actual_pool_name}
2. asadmin command
asadmin get --monitor server.resources.${actual_pool_name}

.*
3. REST API
HTTP GET request to http://localhost:4848/monitoring/domain/server/resources/$

{actual_pool_name}

Because the fundamental concept of monitoring levels such as LOW and HIGH should take over GFv2.x although the base implementation was replaced into flashlight framework, I'm wondering this result indicates some bugs.

I tested using GFv3.2(48897).



 Comments   
Comment by Shalini [ 14/Nov/11 ]

Need to provide feature parity with v2.x. Excluding in 3.1.2





[GLASSFISH-17254] Some monitoring values on unpooled connections are invalid Created: 30/Aug/11  Updated: 10/Feb/13

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: 4.0
Fix Version/s: None

Type: Bug Priority: Major
Reporter: ito_m Assignee: sfelts
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Attachments: Text File GF17254.patch     Zip Archive jdbcmonitoring.zip    
Tags: 3_1_2-exclude

 Description   

[Monitoring Issues]
I detected some monitoring items indicated invalid values when using unpooled connection (pooling attribute of jdbc connection pool is false). Note that pooled/unpooled connections in the following description mean connections are pooled by the container or not according to the pooling attribute. So not refer to PooledConnection in JDBC spec.

1. numconncreated is not counted.
This item should increase every DataSource.getConnection().

2. numconnfree decreases regardless of getting/closing connection.
This item should always indicate zero because there is no pooled connection.

3. numconnused doesn't decrease when closing connection.
This item should decrease every Connection.close().

4. numconndestroyed is counted double when closing connection marked as invalid using com.sun.appserv.jdbc.DataSource.markConnectionAsBad(Connection).

5. numconnused and numconndestroyed don't decrease when leak connections are detected and the container kills them according to leak reclaim setting.

[Reasons]
The current com.sun.enterprise.resource.pool.UnpooledResource (A subclass of ConnectionPool) seems to have some issues as follows.
1. UnpooledResource.getUnenlistedResource() doesn't increment numconncreated.
numconncreated should be incremented using similar logic to ConnectionPool.createResource().

2. [When DataSource.getConnection() is called]
UnpooledResource.getUnenlistedResource() doesn't increment numconnfree, however ConnectionPool.internalGetResource() which calls the method decrements numconnfree.

[When Connection.close() is called]
As well, UnpooledResource.freeResource() doesn't increment numconnfree, however
ConnectionPool.deleteResource() which is called by the method decrements numconnfree.
numconnfree should be incremented before calling it's decrement to keep the numconnfree value as zero.

3. UnpooledResource.freeResource() doesn't decrement numconnused.
numconnused should be decremented using similar logic to ConnectionPool.freeResource().

4. When closing an invalid connection, PoolManagerImpl.putbackBadResourceToPool() is called.
Because putbackBadResourceToPool() calls UnpooledResource.freeResource() twice as follows,
ConnectionPool.deleteResource() is also called twice. Therefore numconndestroyed is counted double.
We should fix it so that deleteResource() cannot be called twice.

public void putbackBadResourceToPool(ResourceHandle h) {
...
synchronized (pool)

{ pool.resourceClosed(h);//call UnpooledResource.freeResource() in case a connection is not enlisted. h.setConnectionErrorOccurred(); pool.resourceErrorOccurred(h);//call UnpooledResource.freeResource(). }

...
}

5. ConnectionLeakDetector.poetentialConnectionLeakFound() which is in charge of processing leak connections calls ConnectionPool.reclaimConnection(), and ConnectionPool.reclaimConnection() calls DataStructure.removeResource().
Only if DataStructure detects the corresponding pooled connection successfully, numconnused and numconndestroyeddecrement decrement. However in case of UnpooledResource any pooled resources cannot always be found, these monitor values are not calculated.

[Reproducible Applications]
I attach a reproducible test application.

1. unzip the attached zip file to trunk\v2\appserv-tests\devtests directory
2. cd trunk\v2\appserv-tests\devtests\issues\poolingmonitor
3. asadmin start-domain
4. asadmin start-database
5. ant prepare
6. ant run-pool (In case of executing pooled connection tests)
ant run-unpool (In case of executing unpooled connection tests)

I used GFv3.2(r48897).



 Comments   
Comment by ito_m [ 30/Aug/11 ]

I will attach a patch of this issue later.

Comment by ito_m [ 30/Aug/11 ]

The procedure of reproducing application was insufficient.
Before procedure 6, change monitoring-level of jdbc-connection-pool into HIGH.
>asadmin enable-monitoring --modules jdbc-connection-pool=HIGH

Comment by ito_m [ 05/Sep/11 ]

The attached file is a patch for this issue.

Comment by Shalini [ 14/Nov/11 ]

Excluding this issue for 3.1.2 release as this might need lot of testing.





[GLASSFISH-17211] DB2 datasource classname is incorrect Created: 19/Aug/11  Updated: 06/Dec/11  Resolved: 06/Dec/11

Status: Resolved
Project: glassfish
Component/s: jdbc
Affects Version/s: 3.1_b43
Fix Version/s: 3.1.2_b13, 4.0

Type: Bug Priority: Major
Reporter: dspurl Assignee: Shalini
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

windows server 2008 r2


Tags: 3_1_2-review, DB2, connectionpool

 Description   

There is a problem with the datasource classname that is generated after selecting the javax.sql.ConnectionPoolDataSource resource type. The datasource classname that automatically generated by glassfish is com.ibm.db2.jdbc.DB2ConnectionPoolDataSource when it should be COM.ibm.db2.jdbc.DB2ConnectionPoolDataSource. COM should be all caps.



 Comments   
Comment by Jagadish [ 29/Aug/11 ]

transferring to Shalini

Comment by Shalini [ 01/Dec/11 ]

The datasource classname that is generated by the database vendor mapping in glassfish should contain the right classname. Else, any operation pertaining to the jdbc driver might fail. Fix is available for this issue.

Comment by Shalini [ 06/Dec/11 ]

Fixed in trunk.

Sending appserver/jdbc/templates/src/main/resources/glassfish/lib/install/databases/dbvendormapping/cpds.properties
Transmitting file data .
Committed revision 51288.

Comment by Shalini [ 06/Dec/11 ]

Fixed in 3.1.2.

Sending jdbc/templates/src/main/resources/glassfish/lib/install/databases/dbvendormapping/cpds.properties
Transmitting file data .
Committed revision 51294.





[GLASSFISH-17208] If Connection Validation failured, physical connection could be leaked. Created: 19/Aug/11  Updated: 01/Dec/11  Resolved: 01/Dec/11

Status: Closed
Project: glassfish
Component/s: jdbc
Affects Version/s: 3.1.1
Fix Version/s: None

Type: Bug Priority: Major
Reporter: lzg5039 Assignee: Shalini
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

windows32



 Description   

CPManagedConnectionFactory、DMManagedConnectionFactory、DSManagedConnectionFactory、XAManagedConnectionFactory have a method of createManagedConnection . The function of createManagedConnection is to create ManagedConnection and return ManagedConnection. If Connection Validation failured, physical connection could be leaked.( In the gui the location of Connection Validation is Resources->JDBC Connection Pools->DerbyPool->Advanced-> Connection Validation)

Directory: jdbc\jdbc-ra\jdbc-core\src\main\java
Package: com.sun.gjc.spi
Class:DSManagedConnectionFactory
Method: createManagedConnection
Line
132	   gedConnection mc = constructManagedConnection(null, dsConn, pc, this);
133
134        //GJCINT
135        validateAndSetIsolation(mc);
136        return mc;

If the line of 132 or 135 throws resourceException, the physical connection could not be closed. So that the physical connection may be leaked.



 Comments   
Comment by Shalini [ 01/Dec/11 ]

Duplicate of issue 17159.





[GLASSFISH-17201] If Connection Validation failured, physical connection could be leaked. Created: 18/Aug/11  Updated: 11/Nov/11  Resolved: 11/Nov/11

Status: Closed
Project: glassfish
Component/s: jdbc
Affects Version/s: 3.1.1
Fix Version/s: None

Type: Bug Priority: Major
Reporter: lzg5039 Assignee: Shalini
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: 1 day
Time Spent: Not Specified
Original Estimate: 1 day
Environment:

windows32



 Description   

CPManagedConnectionFactory、DMManagedConnectionFactory、DSManagedConnectionFactory、XAManagedConnectionFactory have a method of createManagedConnection . The function of createManagedConnection is to create ManagedConnection and return ManagedConnection. If Connection Validation failured, physical connection could be leaked.( In the gui the location of Connection Validation is Resources->JDBC Connection Pools->DerbyPool->Advanced-> Connection Validation)

 
Directory: jdbc\jdbc-ra\jdbc-core\src\main\java
Package: com.sun.gjc.spi
Class:DSManagedConnectionFactory
Method: createManagedConnection
Line
132	   gedConnection mc = constructManagedConnection(null, dsConn, pc, this);
133
134        //GJCINT
135        validateAndSetIsolation(mc);
136        return mc;

If the line of 132 or 135 throws resourceException, the physical connection could not be closed. So that the physical connection may be leaked.



 Comments   
Comment by Shalini [ 11/Nov/11 ]

Duplicate of Issue 17208.





[GLASSFISH-17159] Validation failure after getting connection from DataSource causes connection leak Created: 08/Aug/11  Updated: 06/Dec/11  Resolved: 06/Dec/11

Status: Resolved
Project: glassfish
Component/s: jdbc
Affects Version/s: 4.0
Fix Version/s: 3.1.2_b13, 4.0

Type: Bug Priority: Major
Reporter: ito_m Assignee: Shalini
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Attachments: Text File avoidleakcon.patch    
Tags: 3_1_2-review

 Description   

The ManagedConnectionFactory#createManagedConnection method of jdbc-ra calls the validateAndSetIsolation method after acquiring connections from DataSource.
The validateAndSetIsolation method is a role of connection validation and initializing transaction isolation level. If any errors occur in the validateAndSetIsolation method, it will be returned to connector runtime without closing the acquired connection. This indicates the possibility of connection leak.

Attached patch is to resolve this leak issue by calling the ManagedConnection#destroy method to close a physical connection. If connection close also fail after applying this patch, the following message will be printed in server.log.

[#|$

{Time}

|WARNING|glassfish3.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.spi|$

{ThreadID}

;$

{ThreadName}

;|RAR5083 : Exception while destroying physical connection
java.sql.SQLException: $

{A message in SQLException}

at com.sun.gjc.spi.ManagedConnection.destroy(ManagedConnection.java:405)
at com.sun.gjc.spi.CPManagedConnectionFactory.createManagedConnection(CPManagedConnectionFactory.java:161)
at com.sun.enterprise.resource.allocator.LocalTxConnectorAllocator.createResource(LocalTxConnectorAllocator.java:87)
...



 Comments   
Comment by Shalini [ 01/Dec/11 ]

There could be a potential connection leak if the creation of new physical connection to the underlying EIS resource manager fails for some reason. This needs to be fixed. Fix is available for this issue.

Comment by Shalini [ 06/Dec/11 ]

Fixed in trunk.

Sending appserver/jdbc/admin/src/main/java/org/glassfish/jdbc/admin/cli/JDBCConnectionPoolManager.java
Sending appserver/jdbc/jdbc-ra/jdbc-core/src/main/java/com/sun/gjc/common/LocalStrings.properties
Sending appserver/jdbc/jdbc-ra/jdbc-core/src/main/java/com/sun/gjc/spi/DMManagedConnectionFactory.java
Sending appserver/jdbc/jdbc-ra/jdbc-core/src/main/java/com/sun/gjc/spi/ManagedConnectionFactory.java
Transmitting file data ....
Committed revision 51289.

Comment by Shalini [ 06/Dec/11 ]

Fixed in 3.1.2.

Sending jdbc/admin/src/main/java/org/glassfish/jdbc/admin/cli/JDBCConnectionPoolManager.java
Sending jdbc/jdbc-ra/jdbc-core/src/main/java/com/sun/gjc/common/LocalStrings.properties
Sending jdbc/jdbc-ra/jdbc-core/src/main/java/com/sun/gjc/spi/DMManagedConnectionFactory.java
Sending jdbc/jdbc-ra/jdbc-core/src/main/java/com/sun/gjc/spi/ManagedConnectionFactory.java
Transmitting file data ....
Committed revision 51295.





[GLASSFISH-17143] Get validation class names fail to return appropriate values in GUI Created: 03/Aug/11  Updated: 02/Dec/11  Resolved: 04/Aug/11

Status: Resolved
Project: glassfish
Component/s: jdbc
Affects Version/s: 4.0
Fix Version/s: 3.1.2_b02, 4.0

Type: Bug Priority: Major
Reporter: Shalini Assignee: Shalini
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

When connection validation method is set to custom-validation, admin console calls the Connector Runtime API getValidationClassNames to get a list of custom validation class names available for the particular database vendor. This API needs to change to take in a datasource classname or a driver classname.

As of now, this does not work because the advanced tab in GUI has settings to turn on the connection validation to one of the types. After a pool is created, when the user navigates to the advanced tab, the value of the database vendor is lost and as a result, the getValidationClassNames API cannot be invoked.

This needs to be fixed for displaying the validation class names in GUI.



 Comments   
Comment by Shalini [ 04/Aug/11 ]

Fixed the issue in trunk. Admin GUI can pass the datasource/driver classname to the getValidationClassNames API to retrieve the list of custom validation class names. A new properties file that maps the database vendor to the custom validation class name is introduced. With the classname passed to the API, the database vendor name is got from the existing mappings between the classname and vendor. Additionally, a JDBC40 connection validation mechanism is returned if the classname passed implements the isWrapperFor method.

Sending appserver/common/amx-core/src/main/java/org/glassfish/admin/amx/base/ConnectorRuntimeAPIProvider.java
Sending appserver/common/amx-ext-impl/src/main/java/org/glassfish/admin/amx/impl/ext/ConnectorRuntimeAPIProviderImpl.java
Sending appserver/connectors/connectors-internal-api/src/main/java/com/sun/appserv/connectors/internal/api/ConnectorRuntime.java
Sending appserver/connectors/connectors-runtime/src/main/java/com/sun/enterprise/connectors/ConnectorRuntime.java
Sending appserver/connectors/connectors-runtime/src/main/java/com/sun/enterprise/connectors/service/JdbcAdminServiceImpl.java
Sending appserver/connectors/connectors-runtime/src/main/java/com/sun/enterprise/connectors/util/DriverLoader.java
Sending appserver/connectors/connectors-runtime/src/main/java/com/sun/enterprise/resource/pool/monitor/ConnectorConnPoolStatsProvider.java
Sending appserver/connectors/connectors-runtime/src/main/resources/com/sun/logging/enterprise/resource/resourceadapter/LogStrings.properties
Sending appserver/jdbc/admin/src/main/java/org/glassfish/jdbc/admin/cli/internal/GetValidationClassNames.java
Adding appserver/jdbc/templates/src/main/resources/glassfish/lib/install/databases/dbvendormapping/validationclassnames.properties
Transmitting file data ..........
Committed revision 48563.

Comment by Shalini [ 08/Aug/11 ]

Fixed this issue in 3.1.2 branch.

Sending common/amx-core/src/main/java/org/glassfish/admin/amx/base/ConnectorRuntimeAPIProvider.java
Sending common/amx-ext-impl/src/main/java/org/glassfish/admin/amx/impl/ext/ConnectorRuntimeAPIProviderImpl.java
Sending connectors/connectors-internal-api/src/main/java/com/sun/appserv/connectors/internal/api/ConnectorRuntime.java
Sending connectors/connectors-runtime/src/main/java/com/sun/enterprise/connectors/ConnectorRuntime.java
Sending connectors/connectors-runtime/src/main/java/com/sun/enterprise/connectors/service/JdbcAdminServiceImpl.java
Sending connectors/connectors-runtime/src/main/java/com/sun/enterprise/connectors/util/DriverLoader.java
Sending connectors/connectors-runtime/src/main/java/com/sun/enterprise/resource/pool/monitor/ConnectorConnPoolStatsProvider.java
Sending connectors/connectors-runtime/src/main/resources/com/sun/logging/enterprise/resource/resourceadapter/LogStrings.properties
Sending jdbc/admin/src/main/java/org/glassfish/jdbc/admin/cli/internal/GetValidationClassNames.java
Adding jdbc/templates/src/main/resources/glassfish/lib/install/databases/dbvendormapping/validationclassnames.properties
Transmitting file data ..........
Committed revision 48635.





[GLASSFISH-17129] DB Connections are pooled on DAS after automatic schema generation Created: 29/Jul/11  Updated: 10/Feb/13

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: 4.0
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: ito_m Assignee: sfelts
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Tags: 3_1_2-exclude

 Description   

When deploying JPA apps with createtables/dropandcreatetables options or with including persistence.xml which specifies the corresponding properties, the automatic schema generation is executed. To achieve this, DAS refers to the data source specified in persistence.xml, gets connections to DB and executes DDL. The issue is that DB connections are pooled on DAS after deployment if resources.jdbc-connection-pool.$

{poolName}

.pooling is true.

This affects the following issue.
1. It wastes DB resources.
Even if user choose a non-DAS server for deployment of his app, steady-pool-size connections will be pooled on DAS. Besides, all of them will be reconnected every idle-timeout-in-seconds because they must be idle in this case. If steady-pool-size is 100, the total 200 connections will be acquired by DAS and a non-DAS server.

2. DML execution on DAS can be failed depending on DB.
Some DB don't allow to reuse connections which executed DDL in order to execute DML. In this case, any DML executions by apps on DAS after deployment will be failed.

Although we have the following workarounds, these are inconvenient for users. So I think it's better to use UnPooled connections in order to execute DDL on deployment regardless of JDBC connection pool definition.

  • False is set on pooling definition when deployment. After that, switch it to true.
  • Restart DAS (Because the pooling starts when requiring DB connection at the beginning.)

Here is stacktrace of GFv3.2(r47843) when the JDBC connection pool was initialized on deployment.

ConnectionPool.initPool(ResourceAllocator) line: 224
ConnectionPool.internalGetResource(ResourceSpec, ResourceAllocator, Transaction) line: 511
ConnectionPool.getResource(ResourceSpec, ResourceAllocator, Transaction) line: 381
PoolManagerImpl.getResourceFromPool(ResourceSpec, ResourceAllocator, ClientSecurityInfo, Transaction) line: 242
PoolManagerImpl.getResource(ResourceSpec, ResourceAllocator, ClientSecurityInfo) line: 167
ConnectionManagerImpl.getResource(int, PoolManager, ManagedConnectionFactory, ResourceSpec, Subject, ConnectionRequestInfo, ClientSecurityInfo, ConnectorDescriptor, boolean) line: 338
ConnectionManagerImpl.internalGetConnection(ManagedConnectionFactory, ResourcePrincipal, ConnectionRequestInfo, boolean, String, Object, boolean) line: 301
ConnectionManagerImpl.allocateConnection(ManagedConnectionFactory, ConnectionRequestInfo, String, Object) line: 190
ConnectionManagerImpl.allocateConnection(ManagedConnectionFactory, ConnectionRequestInfo, String) line: 165
ConnectionManagerImpl.allocateConnection(ManagedConnectionFactory, ConnectionRequestInfo) line: 160
DataSource40(DataSource).getConnection() line: 113
JNDIConnector.connect(Properties) line: 126
JNDIConnector.connect(Properties, Session) line: 94
DatabaseLogin(DatasourceLogin).connectToDatasource(Accessor, Session) line: 162
ServerSession(DatabaseSessionImpl).loginAndDetectDatasource() line: 592
EntityManagerFactoryProvider.login(ServerSession, Map) line: 233
EntityManagerSetupImpl.deploy(ClassLoader, Map) line: 394
EntityManagerFactoryImpl.getServerSession() line: 185
EntityManagerFactoryImpl.createEntityManagerImpl(Map) line: 242
EntityManagerFactoryImpl.createEntityManager() line: 230
PersistenceUnitLoader.doJava2DB() line: 373
JPADeployer$2.visitPUD(PersistenceUnitDescriptor, DeploymentContext) line: 435
JPADeployer$2(JPADeployer$PersistenceUnitDescriptorIterator).iteratePUDs(DeploymentContext) line: 483
JPADeployer.iterateInitializedPUsAtApplicationPrepare(DeploymentContext) line: 465
JPADeployer.event(EventListener$Event) line: 389
EventsImpl.send(EventListener$Event, boolean) line: 128



 Comments   
Comment by Shalini [ 14/Nov/11 ]

While using a non DAS server for application deployment, the resource could be disabled, which will solve the issue.

Flush connection pool could be used after executing DDL statements on connections. Hence the subsequent DML executions will not fail.

reducing the priority as there are workarounds to achieve the setup.





[GLASSFISH-17080] Jndi Deployment Failed Created: 21/Jul/11  Updated: 22/Jul/11  Resolved: 22/Jul/11

Status: Closed
Project: glassfish
Component/s: jdbc
Affects Version/s: 4.0_b08
Fix Version/s: None

Type: Bug Priority: Major
Reporter: caojun_12482 Assignee: Shalini
Resolution: Works as designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

GF V3.2


Attachments: