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.