dev@glassfish.java.net

web container and JTA

From: Jerome Dochez <Jerome.Dochez_at_Sun.COM>
Date: Mon, 24 Aug 2009 16:17:58 -0700

Jan, Marina

when debugging web container in embedded mode, I ran into the
following issue :

SEVERE: Cannot stop module web
java.lang.NullPointerException
        at
com
.sun
.web
.server
.J2EEInstanceListener.handleAfterEvent(J2EEInstanceListener.java:373)
        at
com
.sun
.web
.server.J2EEInstanceListener.instanceEvent(J2EEInstanceListener.java:
117)
        at
org
.apache
.catalina.util.InstanceSupport.fireInstanceEvent(InstanceSupport.java:
384)
        at
org.apache.catalina.core.StandardWrapper.unload(StandardWrapper.java:
1703)
        at org.apache.catalina.core.StandardWrapper.stop(StandardWrapper.java:
2048)
        at org.apache.catalina.core.StandardContext.stop(StandardContext.java:
5447)


this happened because J2EEInstanceListener relies on

         private JavaEETransactionManager tm;

to be initialized correctly.

However, webtier-all does not list

         <dependency>
                 <groupId>org.glassfish.transaction</groupId>
                 <artifactId>jta</artifactId>
         </dependency>

as a dependency so I got the NPE.

It seems to be me that either :
        1. J2EEInstanceListener should protect itself against tm being null.
        2. add jta to webtier-all.

jerome