-
Notifications
You must be signed in to change notification settings - Fork 306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NPE in ConnectorXAResource.getResourceHandle causes connection pool problems #3025
Comments
I tested changing the code to:
I replaced the /glassfish/modules/connectors-runtime.jar and my remote bean calls keep working / I cannot reproduce the problem anymore. This might not be the correct fix, but it avoids the NullPointerException and remote bean calls keep working. |
I will try to create a test case to reproduce this. I cannot provide the current code. This could take a while. |
@escay I was the poster of #2310. I actually have seen this issue go away since using more default connection pool settings, as what was recommended in my ticket. I'm not sure if it will help you, but I just wanted to add a data point. Here is my current connection pool setting (for Oracle): <jdbc-connection-pool validation-table-name="TABLEVALIDATION"
connection-validation-method="custom-validation"
allow-non-component-callers="true"
statement-cache-size="200"
associate-with-thread="false"
statement-timeout-in-seconds="-1"
idle-timeout-in-seconds="0"
lazy-connection-association="false"
max-wait-time-in-millis="0"
connection-creation-retry-attempts="5"
validate-atmost-once-period-in-seconds="30"
lazy-connection-enlistment="false"
max-pool-size="96"
res-type="javax.sql.DataSource"
name="MyPool"
is-connection-validation-required="true"
validation-classname="org.glassfish.api.jdbc.validation.OracleConnectionValidation"
datasource-classname="oracle.jdbc.xa.client.OracleXADataSource">
<property name="DataSourceName" value="OracleDataSource"/>
<property name="ImplicitCachingEnabled" value="false"/>
<property name="NetworkProtocol" value="tcp"/>
<property name="DatabaseName" value="transitem"/>
<property name="LoginTimeout" value="0"/>
<property name="User" value="myuser"/>
<property name="Password" value="mypass"/>
<property name="URL" value="jdbc:oracle:thin:@localhost:1521:ORCL"/>
<property name="PortNumber" value="1521"/>
<property name="ExplicitCachingEnabled" value="false"/>
<property name="dynamic-reconfiguration-wait-timeout-in-seconds" value="960"/>
<property name="MaxStatements" value="0"/>
</jdbc-connection-pool> |
@marcreichman Thank you for the information. In the meantime I have created a reproduction scenario and created a support ticket at Payara directly using a support contract. They are able to reproduce the problem. I hope the cause of the problem can be found. |
I believe this is fixed in 5.184 |
See #3344 for the commits |
Description
I run very often into similar issues as described in #769, especially the situation described in issue #2310 seems to be the same as the one in my server.log file:
Reproduction is very difficult but I can reproduce it often when:
Expected Outcome
No NPEs.
Remote bean calls that keep working.
Current Outcome
NPEs and the exception:
Steps to reproduce (Only for bug reports)
I debugged Payara and added a breakpoint on NPE.
This eventually shows a NPE occurs in com.sun.enterprise.resource.ConnectorXAResource on line 255
Payara/appserver/connectors/connectors-runtime/src/main/java/com/sun/enterprise/resource/ConnectorXAResource.java
Line 255 in 189529b
In my case the values are:
The handling of the 'h == null' situation is missing:
As far as I can see this line of code was introduced in the fix for #769
https://github.com/payara/Payara/blame/189529b7fb3b00f282ab7c3315ce53f96a6f93a7/appserver/connectors/connectors-runtime/src/main/java/com/sun/enterprise/resource/ConnectorXAResource.java#L255
Perhaps the code should be:
To make it null pointer safe? But I do not have enough knowledge to understand why there would not be a j2eetran.getNonXAResource() is some cases. EJB Pool or database pool limit reached in an earlier stage?
The stacktrace at the moment the NPE occurs is:
Eventually this NPE is handled in handleResourceException and the server.log shows the PoolingException: java.lang.NullPointerException:
Environment
The text was updated successfully, but these errors were encountered: