Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-1908

Weld CDI does not work with jetty-maven-plugin:run goal

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 2.2.10.Final
    • None

      The app's web.xml contains the following listeners:

      org.jboss.weld.environment.servlet.BeanManagerResourceBindingListener
      com.sun.faces.config.ConfigureListener

      The first listener registers BeanManager with JNDI. The second listener initializes JSF and looks up for BeanManager in the JNDI.

      This setup works perfectly ok when jetty maven plugin runs with "jetty:run-war" goal or when the application is running as standalone with embedded jetty.

      However when running it with "jetty:run" goal the BeanManager registered in the first listener is not visible in the JSF resulting in NPE's on session invalidation/destruction of the ViewScoped beans.

      NPE stack trace:
      Caused by: java.lang.NullPointerException at com.sun.faces.application.view.ViewScopeContextManager.destroyBeans(ViewScopeContextManager.java:171) at com.sun.faces.application.view.ViewScopeContextManager.sessionDestroyed(ViewScopeContextManager.java:339) at com.sun.faces.application.view.ViewScopeManager.sessionDestroyed(ViewScopeManager.java:369) at com.sun.faces.application.WebappLifecycleListener.sessionDestroyed(WebappLifecycleListener.java:181) at com.sun.faces.config.ConfigureListener.sessionDestroyed(ConfigureListener.java:399) at org.eclipse.jetty.server.session.AbstractSessionManager.removeSession(AbstractSessionManager.java:772) at org.eclipse.jetty.server.session.AbstractSession.invalidate(AbstractSession.java:326) at com.sun.faces.context.ExternalContextImpl.invalidateSession(ExternalContextImpl.java:783)

              Unassigned Unassigned
              dmitry.pankratov Dmitry Pankratov (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: