0

Sometimes I have exceptions below in glassfish log when deploying web project

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)

It turned out to be the known bug of glassfish https://java.net/jira/browse/GLASSFISH-21522

In my case I noticed that this exception occurs only when JMS queue is not empty. When deploying war, MDB starts consuming messages and crashes by java.lang.NoClassDefFoundError exception, this NoClassDefFoundError occurs because above exception in lookupFromJars of glassfish occured.

But, when there is no messages in JMS queue, application successfully deploying. After deploy, MDB consumes messages without any exceptions.

Here is my question, how can I set delay to MDB consumer. For example, to start MDB after minute after application deploy.

Or is there way to enable MDB manually?

I am using glassfish 4.1.1 and OpenMQ of glassfish.

Bagdat
  • 308
  • 4
  • 15
  • 1
    Not an answer to the question, but a possible solution to the problem - this is fixed in Payara Server which is a drop-in replacement for GlassFish. The latest version has the fix included: http://www.payara.fish/downloads – Mike May 04 '17 at 19:33
  • thanks @Mike i'am already started trying Payara. If there won't be any problems with it, I'll switch to Payara – Bagdat May 11 '17 at 12:38

0 Answers0