GlassFish sometimes doesn't load my web apps

1k views Asked by At

Sometimes when GlassFishis started one out of the 3 web apps will not load (a blank page gets served).

Any ideas?

I get the following stacktrace:

WebDirContext.java:358)-06-09t21:43:56.410-0400] [glassfish 4.1] [severe]       [as-web-core-00037] [javax.enterprise.web.core] [tid: _threadid=67 _threadname=https-listener-1(15)] [timemillis: 1433900636410] [levelvalue: 1000] [[
  an exception or error occurred in the container during the request processing
java.lang.runtimeexception: java.lang.nullpointerexception
        at com.sun.enterprise.security.jmac.authmessagepolicy.getdefaultcallbackhandler(authmessagepolicy.java:377)
        at com.sun.enterprise.security.jmac.config.confighelper.getcallbackhandler(confighelper.java:254)
        at com.sun.enterprise.security.jmac.config.confighelper.init(confighelper.java:100)
        at com.sun.enterprise.security.jmac.config.httpservlethelper.<init>(httpservlethelper.java:81)
        at com.sun.web.security.realmadapter.getconfighelper(realmadapter.java:1604)
        at com.sun.web.security.realmadapter.initconfighelper(realmadapter.java:1992)
        at com.sun.web.security.realmadapter.issecurityextensionenabled(realmadapter.java:1588)
        at com.sun.enterprise.web.webpipeline.invoke(webpipeline.java:95)
        at org.apache.catalina.core.standardhostvalve.invoke(standardhostvalve.java:174)
        at org.apache.catalina.connector.coyoteadapter.doservice(coyoteadapter.java:415)
        at org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:282)
        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:201)
        at org.glassfish.grizzly.http.server.httphandler.dohandle(httphandler.java:175)
        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:284)
        at org.glassfish.grizzly.filterchain.defaultfilterchain.executechainpart(defaultfilterchain.java:201)
        at org.glassfish.grizzly.filterchain.defaultfilterchain.execute(defaultfilterchain.java:133)
        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:561)
        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:565)
        at org.glassfish.grizzly.threadpool.abstractthreadpool$worker.run(abstractthreadpool.java:545)
        at java.lang.thread.run(thread.java:744)
Caused by: java.lang.NullPointerException
    at org.apache.naming.resources.WebDirContext.lookupFromJars(WebDirContext.java:325)
    at org.apache.naming.resources.WebDirContext.getAttributes(WebDirContext.java:298)
    at org.apache.naming.resources.BaseDirContext.getAttributes(BaseDirContext.java:787)
    at org.apache.naming.resources.ProxyDirContext.cacheLoad(ProxyDirContext.java:1533)
    at org.apache.naming.resources.ProxyDirContext.cacheLookup(ProxyDirContext.java:1456)
    at org.apache.naming.resources.ProxyDirContext.lookup(ProxyDirContext.java:274)
    at org.glassfish.web.loader.WebappClassLoader.findResourceInternalFromRepositories(WebappClassLoader.java:2892)
    at org.glassfish.web.loader.WebappClassLoader.findResourceInternal(WebappClassLoader.java:2842)
    at org.glassfish.web.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2736)
    at org.glassfish.web.loader.WebappClassLoader.findClass(WebappClassLoader.java:1194)
    at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1750)
    at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1633)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:270)
    at com.sun.enterprise.security.jmac.AuthMessagePolicy$7.run(AuthMessagePolicy.java:370)
    at com.sun.enterprise.security.common.AppservAccessController.doPrivileged(AppservAccessController.java:72)
    at com.sun.enterprise.security.jmac.AuthMessagePolicy.getDefaultCallbackHandler(AuthMessagePolicy.java:359)
    ... 29 more

]]

Also note that it seems to randomly affect one of the 4 webapps running. 3 of the 4 webapps will load correctly. I restart the domain and it will randomly cause a different app to serve a blank page...

1

There are 1 answers

0
kingoleg On

Looks like it was never fixed in GL 4.1.2, but was fixed in Payara 4.1.1.163. (see https://github.com/payara/Payara/issues/693) and in GL5 (see https://github.com/eclipse-ee4j/glassfish/issues/21522)