0

I'm trying to deploy a JEE8 application to a local GlassFish server. The application consists of two modules: one for EJB and one for JSF. I'm using IntelliJ and followed instructions for creating an EAR file, which includes an ejb.jar and jsf.war file.

The deployment is failing and looking at the output is seems to be a NullPointerException. Done plenty of Googling, but no further forward. I've attached the GlassFish output, the application.xml and server log output.

Can someone help please?

The GlassFish console output below

[2020-05-25 02:02:38,665] Artifact JEEv3:ear: Artifact is being deployed, please wait...
[2020-05-25 02:02:55,453] Artifact JEEv3:ear: Error during artifact deployment. See server log for details.
[2020-05-25 02:02:55,453] Artifact JEEv3:ear: java.io.IOException: com.sun.enterprise.admin.remote.RemoteFailureException: Error occurred during deployment: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.RuntimeException: java.lang.NullPointerException. Please see server.log for more details.

The application.xml file

<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://xmlns.jcp.org/xml/ns/javaee"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/application_8.xsd"
             version="8">
    <module id="ejb-EJB">
        <ejb>ejb.jar</ejb>
    </module>
    <module id="jsf-Web">
        <web>
            <web-uri>jsf.war</web-uri>
            <context-root>jsfWeb</context-root>
        </web>
    </module>
</application>

The server log details below. I've added the full log, which appears to be mainly warnings, and highlighted the nullpointer exception

[2020-05-25T14:02:47.811+0100] [glassfish 5.1] [WARN] [] [org.jboss.weld.Bootstrap] [tid: _ThreadID=49 _ThreadName=admin-listener(4)] [timeMillis: 1590411767811] [levelValue: 900] [[
  WELD-000146: BeforeBeanDiscovery.addAnnotatedType(AnnotatedType<?>) used for class org.glassfish.cdi.transaction.TransactionalInterceptorMandatory is deprecated from CDI 1.1!]]

[2020-05-25T14:02:47.841+0100] [glassfish 5.1] [WARN] [] [org.jboss.weld.Bootstrap] [tid: _ThreadID=49 _ThreadName=admin-listener(4)] [timeMillis: 1590411767841] [levelValue: 900] [[
  WELD-000146: BeforeBeanDiscovery.addAnnotatedType(AnnotatedType<?>) used for class org.glassfish.cdi.transaction.TransactionalInterceptorNever is deprecated from CDI 1.1!]]

[2020-05-25T14:02:47.846+0100] [glassfish 5.1] [WARN] [] [org.jboss.weld.Bootstrap] [tid: _ThreadID=49 _ThreadName=admin-listener(4)] [timeMillis: 1590411767846] [levelValue: 900] [[
  WELD-000146: BeforeBeanDiscovery.addAnnotatedType(AnnotatedType<?>) used for class org.glassfish.cdi.transaction.TransactionalInterceptorNotSupported is deprecated from CDI 1.1!]]

[2020-05-25T14:02:47.850+0100] [glassfish 5.1] [WARN] [] [org.jboss.weld.Bootstrap] [tid: _ThreadID=49 _ThreadName=admin-listener(4)] [timeMillis: 1590411767850] [levelValue: 900] [[
  WELD-000146: BeforeBeanDiscovery.addAnnotatedType(AnnotatedType<?>) used for class org.glassfish.cdi.transaction.TransactionalInterceptorRequired is deprecated from CDI 1.1!]]

[2020-05-25T14:02:47.857+0100] [glassfish 5.1] [WARN] [] [org.jboss.weld.Bootstrap] [tid: _ThreadID=49 _ThreadName=admin-listener(4)] [timeMillis: 1590411767857] [levelValue: 900] [[
  WELD-000146: BeforeBeanDiscovery.addAnnotatedType(AnnotatedType<?>) used for class org.glassfish.cdi.transaction.TransactionalInterceptorRequiresNew is deprecated from CDI 1.1!]]

[2020-05-25T14:02:47.861+0100] [glassfish 5.1] [WARN] [] [org.jboss.weld.Bootstrap] [tid: _ThreadID=49 _ThreadName=admin-listener(4)] [timeMillis: 1590411767861] [levelValue: 900] [[
  WELD-000146: BeforeBeanDiscovery.addAnnotatedType(AnnotatedType<?>) used for class org.glassfish.cdi.transaction.TransactionalInterceptorSupports is deprecated from CDI 1.1!]]

[2020-05-25T14:02:47.888+0100] [glassfish 5.1] [WARN] [] [org.jboss.weld.Bootstrap] [tid: _ThreadID=49 _ThreadName=admin-listener(4)] [timeMillis: 1590411767888] [levelValue: 900] [[
  WELD-000146: BeforeBeanDiscovery.addAnnotatedType(AnnotatedType<?>) used for class org.glassfish.jersey.ext.cdi1x.internal.CdiComponentProvider$JaxRsParamProducer is deprecated from CDI 1.1!]]

[2020-05-25T14:02:47.917+0100] [glassfish 5.1] [WARN] [] [org.jboss.weld.Bootstrap] [tid: _ThreadID=49 _ThreadName=admin-listener(4)] [timeMillis: 1590411767917] [levelValue: 900] [[
  WELD-000146: BeforeBeanDiscovery.addAnnotatedType(AnnotatedType<?>) used for class com.ibm.jbatch.container.cdi.BatchProducerBean is deprecated from CDI 1.1!]]

[2020-05-25T14:02:47.929+0100] [glassfish 5.1] [WARN] [] [org.jboss.weld.Bootstrap] [tid: _ThreadID=49 _ThreadName=admin-listener(4)] [timeMillis: 1590411767929] [levelValue: 900] [[
  WELD-000146: BeforeBeanDiscovery.addAnnotatedType(AnnotatedType<?>) used for class com.sun.faces.flow.FlowDiscoveryCDIHelper is deprecated from CDI 1.1!]]

[2020-05-25T14:02:48.056+0100] [glassfish 5.1] [WARN] [] [org.jboss.weld.Bootstrap] [tid: _ThreadID=49 _ThreadName=admin-listener(4)] [timeMillis: 1590411768056] [levelValue: 900] [[
  WELD-000146: BeforeBeanDiscovery.addAnnotatedType(AnnotatedType<?>) used for class org.glassfish.jersey.ext.cdi1x.servlet.internal.CdiExternalRequestScope is deprecated from CDI 1.1!]]

[2020-05-25T14:02:49.069+0100] [glassfish 5.1] [WARN] [] [org.jboss.weld.Bootstrap] [tid: _ThreadID=49 _ThreadName=admin-listener(4)] [timeMillis: 1590411769069] [levelValue: 900] [[
  WELD-000146: BeforeBeanDiscovery.addAnnotatedType(AnnotatedType<?>) used for class org.jboss.weld.environment.se.beans.ParametersFactory is deprecated from CDI 1.1!]]

[2020-05-25T14:02:49.156+0100] [glassfish 5.1] [WARN] [] [org.jboss.weld.Bootstrap] [tid: _ThreadID=49 _ThreadName=admin-listener(4)] [timeMillis: 1590411769156] [levelValue: 900] [[
  WELD-000146: BeforeBeanDiscovery.addAnnotatedType(AnnotatedType<?>) used for class org.jboss.weld.environment.se.beans.InstanceManager is deprecated from CDI 1.1!]]

[2020-05-25T14:02:49.164+0100] [glassfish 5.1] [WARN] [] [org.jboss.weld.Bootstrap] [tid: _ThreadID=49 _ThreadName=admin-listener(4)] [timeMillis: 1590411769164] [levelValue: 900] [[
  WELD-000146: BeforeBeanDiscovery.addAnnotatedType(AnnotatedType<?>) used for class org.jboss.weld.environment.se.threading.RunnableDecorator is deprecated from CDI 1.1!]]

[2020-05-25T14:02:49.202+0100] [glassfish 5.1] [WARN] [] [org.jboss.weld.Bootstrap] [tid: _ThreadID=49 _ThreadName=admin-listener(4)] [timeMillis: 1590411769202] [levelValue: 900] [[
  WELD-000146: BeforeBeanDiscovery.addAnnotatedType(AnnotatedType<?>) used for class org.jboss.weld.environment.se.WeldContainer is deprecated from CDI 1.1!]]

[2020-05-25T14:02:49.208+0100] [glassfish 5.1] [WARN] [] [org.jboss.weld.Bootstrap] [tid: _ThreadID=49 _ThreadName=admin-listener(4)] [timeMillis: 1590411769208] [levelValue: 900] [[
  WELD-000146: BeforeBeanDiscovery.addAnnotatedType(AnnotatedType<?>) used for class org.glassfish.jersey.ext.cdi1x.transaction.internal.WebAppExceptionHolder is deprecated from CDI 1.1!]]

[2020-05-25T14:02:49.217+0100] [glassfish 5.1] [WARN] [] [org.jboss.weld.Bootstrap] [tid: _ThreadID=49 _ThreadName=admin-listener(4)] [timeMillis: 1590411769217] [levelValue: 900] [[
  WELD-000146: BeforeBeanDiscovery.addAnnotatedType(AnnotatedType<?>) used for class org.glassfish.jersey.ext.cdi1x.transaction.internal.WebAppExceptionInterceptor is deprecated from CDI 1.1!]]

[2020-05-25T14:02:49.223+0100] [glassfish 5.1] [WARN] [] [org.jboss.weld.Bootstrap] [tid: _ThreadID=49 _ThreadName=admin-listener(4)] [timeMillis: 1590411769223] [levelValue: 900] [[
  WELD-000146: BeforeBeanDiscovery.addAnnotatedType(AnnotatedType<?>) used for class org.glassfish.jersey.ext.cdi1x.transaction.internal.TransactionalExceptionMapper is deprecated from CDI 1.1!]]

[2020-05-25T14:02:50.912+0100] [glassfish 5.1] [SEVERE] [] [] [tid: _ThreadID=49 _ThreadName=Thread-9] [timeMillis: 1590411770912] [levelValue: 1000] [[
  SLF4J: Class path contains multiple SLF4J bindings.]]

[2020-05-25T14:02:50.912+0100] [glassfish 5.1] [SEVERE] [] [] [tid: _ThreadID=49 _ThreadName=Thread-9] [timeMillis: 1590411770912] [levelValue: 1000] [[
  SLF4J: Found binding in [jar:file:/Users/marccooling/IdeaProjects/appservers/glassfish5/glassfish/domains/domain1/applications/JEEv3_ear/jsf_war_war/WEB-INF/lib/weld-se.jar!/org/slf4j/impl/StaticLoggerBinder.class]]]

[2020-05-25T14:02:50.912+0100] [glassfish 5.1] [SEVERE] [] [] [tid: _ThreadID=49 _ThreadName=Thread-9] [timeMillis: 1590411770912] [levelValue: 1000] [[
  SLF4J: Found binding in [jar:file:/Users/marccooling/IdeaProjects/appservers/glassfish5/glassfish/domains/domain1/applications/JEEv3_ear/jsf_war_war/WEB-INF/lib/weld-servlet.jar!/org/slf4j/impl/StaticLoggerBinder.class]]]

[2020-05-25T14:02:50.912+0100] [glassfish 5.1] [SEVERE] [] [] [tid: _ThreadID=49 _ThreadName=Thread-9] [timeMillis: 1590411770912] [levelValue: 1000] [[
  SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.]]

[2020-05-25T14:02:50.923+0100] [glassfish 5.1] [SEVERE] [] [] [tid: _ThreadID=49 _ThreadName=Thread-9] [timeMillis: 1590411770923] [levelValue: 1000] [[
  SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]]]

[2020-05-25T14:02:55.267+0100] [glassfish 5.1] [WARNING] [] [javax.enterprise.web] [tid: _ThreadID=49 _ThreadName=admin-listener(4)] [timeMillis: 1590411775267] [levelValue: 900] [[
  java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.RuntimeException: java.lang.NullPointerException
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.RuntimeException: java.lang.NullPointerException
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:881)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:860)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:644)
    at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2020)
    at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1666)
    at com.sun.enterprise.web.WebApplication.start(WebApplication.java:83)
    at org.glassfish.internal.data.EngineRef.start(EngineRef.java:98)
  **Critical error during deployment: 
java.lang.NullPointerException
    at** com.sun.faces.application.ApplicationAssociate$PostConstructApplicationListener.processEvent(ApplicationAssociate.java:324)
    at javax.faces.event.SystemEvent.processListener(SystemEvent.java:123)
    at com.sun.faces.application.applicationimpl.Events.processListeners(Events.java:253)
    at com.sun.faces.application.applicationimpl.Events.invokeListenersFor(Events.java:231)
    at com.sun.faces.application.applicationimpl.Events.publishEvent(Events.java:112)
    at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:127)
    at org.jboss.weld.environment.servlet.jsf.ForwardingApplication.publishEvent(ForwardingApplication.java:282)
    at org.jboss.weld.environment.servlet.jsf.ForwardingApplication.publishEvent(ForwardingApplication.java:282)
    at javax.faces.application.ApplicationWrapper.publishEvent(ApplicationWrapper.java:788)
    at com.sun.faces.config.ConfigManager.publishPostConfigEvent(ConfigManager.java:553)
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:264)
    at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:5005)
    at com.sun.enterprise.web.WebModule.contextListenerStart(WebModule.java:568)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:5574)
    at com.sun.enterprise.web.WebModule.start(WebModule.java:516)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:877)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:860)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:644)
    at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2020)
    at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1666)
    at com.sun.enterprise.web.WebApplication.start(WebApplication.java:83)
    at org.glassfish.internal.data.EngineRef.start(EngineRef.java:98)
  Startup of context /jsf_war failed due to previous errors]]

[2020-05-25T14:02:55.262+0100] [glassfish 5.1] [SEVERE] [AS-WEB-CORE-00175] [javax.enterprise.web.core] [tid: _ThreadID=49 _ThreadName=admin-listener(4)] [timeMillis: 1590411775262] [levelValue: 1000] [[
  **Exception during cleanup after start failed**
org.apache.catalina.LifecycleException: Manager has not yet been started
    at org.apache.catalina.session.StandardManager.stop(StandardManager.java:838)
    at org.apache.catalina.core.StandardContext.stop(StandardContext.java:5779)
    at com.sun.enterprise.web.WebModule.stop(WebModule.java:545)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:5592)
    at com.sun.enterprise.web.WebModule.start(WebModule.java:516)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:877)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:860)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:644)
    at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2020)
    at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1666)
    at com.sun.enterprise.web.WebApplication.start(WebApplication.java:83)
    at org.glassfish.internal.data.EngineRef.start(EngineRef.java:98)
mcooling
  • 107
  • 2
  • 14
  • So the first thing you did was run your application in debug mode, set a breakpoint and checked what was null? – Kukeltje May 25 '20 at 17:53
  • Yes @Kukeltje it was. I set breakpoints in each Java class, but it didn't enter debug mode. Even with breakpoints set in each class, it just attempts to deploy the ear and I end up with the same error. – mcooling May 25 '20 at 20:10
  • You can add a breakpoint also for a specific exception, at last with Eclipse. In your case, the error seems this `SLF4J: Class path contains multiple SLF4J bindings`, the NPE is an effect – WoAiNii May 25 '20 at 20:35
  • Does this answer your question? [SLF4J: Class path contains multiple SLF4J bindings](https://stackoverflow.com/questions/14024756/slf4j-class-path-contains-multiple-slf4j-bindings) – WoAiNii May 25 '20 at 20:38

0 Answers0