NPE in org.jboss.weld.environment.servlet.Listener
ejb3workshop Sep 4, 2013 4:00 AMWhen deploying my weld application on tomcat in any other than the default context I am no longer able to log in to my application. I would like to deploy the application into the root "/" context.
When I copy my web application's war file to tomcat/webapps/ROOT.war everything is working as expected. However as soon as I try to add resources I need to specify a context
Working configuration as long as the application WAR is called ROOT.war
<Host appBase="webapps/weld" name="weld.j2anywhere.com" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"> </Host>
However as soon as I introduce a context so that I can add resources for my application I get the exception below:
<Host appBase="webapps/weld" name="weld.j2anywhere.com" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"> <Context path="" docBase="ROOT"> <Resources... <Resources... </Context> </Host>
A similar problem occurs when trying to deploy the application under it's proper name insteat of ROOT.war and using the following configuration:
<Host appBase="webapps/development" name="www.fancywebsite.com" unpackWARs="false" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"> <Context path="" docBase="FancyWeb.war" debug="0" priviledged="true"> <Resource... </Context> </Host>
SEVERE: Exception sending request initialized lifecycle event to listener instance of class org.jboss.weld.environment.servlet.Listener
java.lang.NullPointerException
at org.jboss.weld.context.AbstractBoundContext.deactivate(AbstractBoundContext.java:71)
at org.jboss.weld.context.http.HttpRequestContextImpl.deactivate(HttpRequestContextImpl.java:70)
at org.jboss.weld.servlet.HttpContextLifecycle.requestDestroyed(HttpContextLifecycle.java:179)
at org.jboss.weld.servlet.WeldInitialListener.requestDestroyed(WeldInitialListener.java:92)
at org.jboss.weld.servlet.api.helpers.ForwardingServletListener.requestDestroyed(ForwardingServletListener.java:38)
at org.apache.catalina.core.StandardContext.fireRequestDestroyEvent(Unknown Source)
at org.apache.catalina.core.StandardHostValve.invoke(Unknown Source)
at org.apache.catalina.valves.ErrorReportValve.invoke(Unknown Source)
at org.apache.catalina.valves.AccessLogValve.invoke(Unknown Source)
at org.apache.catalina.core.StandardEngineValve.invoke(Unknown Source)
at org.apache.catalina.connector.CoyoteAdapter.service(Unknown Source)
at org.apache.coyote.ajp.AjpAprProcessor.process(Unknown Source)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(Unknown Source)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)