java.lang.NullPointerException

Java.net JIRA | jifeng | 4 years ago
  1. 0

    In glassfish Server 3.1 Application Development Guide,the description of "allow-non-component-callers" are as follows: {noformat} 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. "★" {noformat} 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* {code:xml} con1 = datasource.getConnection;// enlisted into the transaction ut.begin(); con2 = datasource.getConnection;// enlisted into the transaction ...... ut.commit(); {code} 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* {code:xml} con1 = datasource.getConnection;// will not be enlisted into the transaction ut.begin(); con2 = datasource.getConnection;// enlisted into the transaction ...... ut.commit(); {code} in *part2*,if execute con1.close before ut.commit() method. For example: {code:xml} con1 = datasource.getConnection() ut.begin(); con1.close();"★" ut.commit(); {code} When execute con1.close() method ,the program is throwing exception : {code:xml} [#|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) {code}

    Java.net JIRA | 4 years ago | jifeng
    java.lang.NullPointerException
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

  3. 0

    Android: Saving Map State in Google map

    Stack Overflow | 11 months ago | Junie Negentien
    java.lang.RuntimeException: Unable to resume activity {com.ourThesis.junieNegentien2015/com.ourThesis.junieNegentien2015.MainActivity}: java.lang.NullPointerException

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at com.sun.enterprise.resource.ConnectorXAResource.getResourceHandle()
    2. Connectors Runtime
      ConnectorXAResource.end
      1. com.sun.enterprise.resource.ConnectorXAResource.getResourceHandle(ConnectorXAResource.java:246)
      2. com.sun.enterprise.resource.ConnectorXAResource.end(ConnectorXAResource.java:159)
      2 frames
    3. Embedded GlassFish Web
      JavaEETransactionManagerSimplified.delistResource
      1. com.sun.enterprise.transaction.JavaEETransactionManagerSimplified.delistResource(JavaEETransactionManagerSimplified.java:528)
      1 frame
    4. Connectors Runtime
      LocalTxConnectionEventListener.connectionClosed
      1. com.sun.enterprise.resource.rm.SystemResourceManagerImpl.delistResource(SystemResourceManagerImpl.java:145)
      2. com.sun.enterprise.resource.pool.PoolManagerImpl.resourceClosed(PoolManagerImpl.java:381)
      3. com.sun.enterprise.resource.listener.LocalTxConnectionEventListener.connectionClosed(LocalTxConnectionEventListener.java:77)
      3 frames
    5. Embedded GlassFish Web
      ConnectionHolder40.close
      1. com.sun.gjc.spi.ManagedConnection.connectionClosed(ManagedConnection.java:784)
      2. com.sun.gjc.spi.base.ConnectionHolder.close(ConnectionHolder.java:217)
      3. com.sun.gjc.spi.jdbc40.ConnectionHolder40.close(ConnectionHolder40.java:587)
      3 frames