Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-2372

@Model stops working with bean-discovery-mode="annotated"

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • 8.0.0.Beta1
    • CDI / Weld, Web (Undertow)
    • None

      First of all: I'm not sure whether this is a bug of Undertow or a bug of Weld or a limitation of Mojarra 2.1.

      I changed WEB-INF/beans.xml so that the root element looks as follows, i.e. "annotated" instead of "all":

      <beans ... bean-discovery-mode="annotated" ...>
      

      When I access this CDI-enabled bean in a JSF page via EL using #

      {artikelModel.load}, I'm getting the stacktrace below:
      @Model
      public class ArtikelModel implements Serializable {
      

      If I replace @Model with @RequestScoped @Named, then the issue is gone. Also if I go back from "annotated" to "all".

      Stacktrace:
      
      

      11:26:49,340 ERROR [io.undertow.request] (default task-3) Servlet request failed HttpServerExchange{ GET /shop/index.jsf}: javax.servlet.ServletException: /indexDesktop.xhtml @15,79 listener="#{artikelModel.load}

      ": Target Unreachable, identifier 'artikelModel' resolved to null
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:606) [jsf-api-2.1.26.jar:2.1]
      at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:87) [undertow-servlet-1.0.0.Beta19.jar:1.0.0.Beta19]
      at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:93) [undertow-servlet-1.0.0.Beta19.jar:1.0.0.Beta19]
      at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.0.0.Beta19.jar:1.0.0.Beta19]
      at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:81)
      at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.0.Beta19.jar:1.0.0.Beta19]
      at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:113) [undertow-servlet-1.0.0.Beta19.jar:1.0.0.Beta19]
      at io.undertow.security.handlers.AuthenticationCallHandler.handleRequest(AuthenticationCallHandler.java:52) [undertow-core-1.0.0.Beta19.jar:1.0.0.Beta19]
      at io.undertow.security.handlers.AuthenticationConstraintHandler.handleRequest(AuthenticationConstraintHandler.java:51) [undertow-core-1.0.0.Beta19.jar:1.0.0.Beta19]
      at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45) [undertow-core-1.0.0.Beta19.jar:1.0.0.Beta19]
      at io.undertow.servlet.handlers.security.ServletSecurityConstraintHandler.handleRequest(ServletSecurityConstraintHandler.java:55) [undertow-servlet-1.0.0.Beta19.jar:1.0.0.Beta19]
      at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58) [undertow-core-1.0.0.Beta19.jar:1.0.0.Beta19]
      at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:65) [undertow-servlet-1.0.0.Beta19.jar:1.0.0.Beta19]
      at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:70) [undertow-core-1.0.0.Beta19.jar:1.0.0.Beta19]
      at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.0.Beta19.jar:1.0.0.Beta19]
      at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.0.Beta19.jar:1.0.0.Beta19]
      at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:218) [undertow-servlet-1.0.0.Beta19.jar:1.0.0.Beta19]
      at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:205) [undertow-servlet-1.0.0.Beta19.jar:1.0.0.Beta19]
      at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:69) [undertow-servlet-1.0.0.Beta19.jar:1.0.0.Beta19]
      at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:134) [undertow-servlet-1.0.0.Beta19.jar:1.0.0.Beta19]
      at io.undertow.server.Connectors.executeRootHandler(Connectors.java:138) [undertow-core-1.0.0.Beta19.jar:1.0.0.Beta19]
      at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:622) [undertow-core-1.0.0.Beta19.jar:1.0.0.Beta19]
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_45]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_45]
      at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_45]
      Caused by: javax.el.PropertyNotFoundException: /indexDesktop.xhtml @15,79 listener="#

      {artikelModel.load}

      ": Target Unreachable, identifier 'artikelModel' resolved to null
      at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:107) [jsf-impl-2.1.26.jar:2.1.26]
      at com.sun.faces.facelets.tag.jsf.core.DeclarativeSystemEventListener.processEvent(EventHandler.java:128) [jsf-impl-2.1.26.jar:2.1.26]
      at javax.faces.component.UIComponent$ComponentSystemEventListenerAdapter.processEvent(UIComponent.java:2526) [jsf-api-2.1.26.jar:2.1]
      at javax.faces.event.SystemEvent.processListener(SystemEvent.java:106) [jsf-api-2.1.26.jar:2.1]
      at com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:2163) [jsf-impl-2.1.26.jar:2.1.26]
      at com.sun.faces.application.ApplicationImpl.invokeComponentListenersFor(ApplicationImpl.java:2111) [jsf-impl-2.1.26.jar:2.1.26]
      at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:289) [jsf-impl-2.1.26.jar:2.1.26]
      at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:247) [jsf-impl-2.1.26.jar:2.1.26]
      at org.jboss.as.jsf.injection.weld.ForwardingApplication.publishEvent(ForwardingApplication.java:299) [wildfly-jsf-injection-8.0.0.Beta2-SNAPSHOT.jar:8.0.0.Beta2-SNAPSHOT]
      at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:107) [jsf-impl-2.1.26.jar:2.1.26]
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.1.26.jar:2.1.26]
      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) [jsf-impl-2.1.26.jar:2.1.26]
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594) [jsf-api-2.1.26.jar:2.1]
      ... 24 more

      
      

              rhn-engineering-jharting Jozef Hartinger
              juergen.zimmermann Juergen Zimmermann (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: