Seam Faces
  1. Seam Faces
  2. SEAMFACES-42

IllegalProductException: WELD-000052 Cannot return null from a non-dependent producer method

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved (View Workflow)
    • Priority: Major Major
    • Resolution: Done
    • Affects Version/s: 3.0.0.Alpha3
    • Fix Version/s: 3.0.0.Beta1
    • Component/s: Messages & i18n
    • Labels:
      None
    • Environment:
      Glassfish 3.0.1, Weld 1.0.1-FINAL, Seam3 Faces 1.0-ALPHA3
    • Similar Issues:
      Show 10 results 

      Description

      I created a Custom Exception handler to trap "NonexistentConversationException" exceptions as per Ed Burns howto:
      http://weblogs.java.net/blog/edburns/archive/2009/09/03/dealing-gracefully-viewexpiredexception-jsf2

      The exception handler attempts to redirect the faces navigation:
      nav.handleNavigation(fc, null, "/workrequest/index.xhtml");

      This results in the stack trace:
      org.jboss.weld.exceptions.IllegalProductException: WELD-000052 Cannot return null from a non-dependent producer method: org.jboss.weld.bean.ProducerMethod$1@32ac538c
      at org.jboss.weld.bean.AbstractProducerBean.checkReturnValue(AbstractProducerBean.java:255)
      at org.jboss.weld.bean.AbstractProducerBean.create(AbstractProducerBean.java:361)
      at org.jboss.weld.context.AbstractMapContext.get(AbstractMapContext.java:112)
      at org.jboss.weld.bean.proxy.ClientProxyMethodHandler.getProxiedInstance(ClientProxyMethodHandler.java:143)
      at org.jboss.weld.bean.proxy.ClientProxyMethodHandler.invoke(ClientProxyMethodHandler.java:100)
      at org.jboss.weld.util.CleanableMethodHandler.invoke(CleanableMethodHandler.java:43)
      at org.jboss.seam.faces.context.FlashContext_$$javassist_785.put(FlashContext$$_javassist_785.java)
      at org.jboss.seam.faces.status.MessagesAdapter.flushBeforeNavigate(MessagesAdapter.java:63)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:304)
      at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54)
      at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163)
      at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:298)
      at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:200)
      at org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:59)
      at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:194)
      at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:241)
      at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:216)
      at org.jboss.weld.manager.BeanManagerImpl.notifyObservers(BeanManagerImpl.java:654)
      at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:647)
      at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:641)
      at org.jboss.seam.faces.event.PreNavigateEventProducer.handleNavigation(PreNavigateEventProducer.java:65)
      at ca.triumf.mis.qms.workrequest.jsf.exception.NonexistentConversationExceptionHandler.handle(NonexistentConversationExceptionHandler.java:48)
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:119)
      at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:110)
      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
      at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
      at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
      at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
      at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226)
      at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
      at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
      at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
      at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
      at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
      at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
      at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
      at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
      at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
      at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
      at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
      at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
      at java.lang.Thread.run(Thread.java:619)

      It seems as if the seam faces module is trying to put messages in the flash context, and this is causing a weld exception to be thrown. I hope I'm reading this as a Seam3 Faces error correctly

      Thanks as always,
      Brian

      1. initializeCurrentContextPatch.diff
        2 kB
        Brian Leathem
      2. mavenproject.zip
        34 kB
        Brian Leathem

        Activity

        Hide
        Lincoln Baxter III
        added a comment -

        I would go ahead with @PostConstruct for now. It may be necessary to create a new JSF System Event to properly address this situation.

        PreExecuteLifecycleEvent, which would be triggered before any lifecycle processing begins for the request:

        https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=871

        Show
        Lincoln Baxter III
        added a comment - I would go ahead with @PostConstruct for now. It may be necessary to create a new JSF System Event to properly address this situation. PreExecuteLifecycleEvent, which would be triggered before any lifecycle processing begins for the request: https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=871
        Hide
        Lincoln Baxter III
        added a comment -

        Patch applied (decided to use lazy initialization instead of multiple method entry points.) Please verify

        Show
        Lincoln Baxter III
        added a comment - Patch applied (decided to use lazy initialization instead of multiple method entry points.) Please verify
        Hide
        Anders Åberg
        added a comment -

        I have the same use case and the same error. Are there any builds I can test this with? Is Beta1 released? I found it in Nexus but it's still not marked as released on sfwk.org and in Jira.

        I tried to deploy with the beta1 from Nexus but my application won't start. First problem: NoClassDefFoundError: org/jboss/logging/Logger. If I add jboss-logging 3.0.0.Beta4, I get another exception on startup:

        WELD-001408 Injection point has unsatisfied dependencies. Injection point: field org.jboss.weld.extensions.resourceLoader.ResourceProducer.resourceLoaderManager; Qualifiers: [@javax.enterprise.inject.Default()]

        Show
        Anders Åberg
        added a comment - I have the same use case and the same error. Are there any builds I can test this with? Is Beta1 released? I found it in Nexus but it's still not marked as released on sfwk.org and in Jira. I tried to deploy with the beta1 from Nexus but my application won't start. First problem: NoClassDefFoundError: org/jboss/logging/Logger. If I add jboss-logging 3.0.0.Beta4, I get another exception on startup: WELD-001408 Injection point has unsatisfied dependencies. Injection point: field org.jboss.weld.extensions.resourceLoader.ResourceProducer.resourceLoaderManager; Qualifiers: [@javax.enterprise.inject.Default()]
        Hide
        Lincoln Baxter III
        added a comment -

        You are correct to add JBoss Logging; however, Seam Faces 3.0.0.Beta1 requires the current Weld version 1.1.0.Beta1 (or later.) It also requires a newer version of Weld-Extensions (Seam Solder).

        Show
        Lincoln Baxter III
        added a comment - You are correct to add JBoss Logging; however, Seam Faces 3.0.0.Beta1 requires the current Weld version 1.1.0.Beta1 (or later.) It also requires a newer version of Weld-Extensions (Seam Solder).
        Hide
        Anders Åberg
        added a comment -

        Ah too bad, that means it cannot be used on Glassfish until 3.1 (which is scheduled for December). But I'll try to patch 3.0.0.Alpha3 myself.

        Show
        Anders Åberg
        added a comment - Ah too bad, that means it cannot be used on Glassfish until 3.1 (which is scheduled for December). But I'll try to patch 3.0.0.Alpha3 myself.

          People

          • Assignee:
            Lincoln Baxter III
            Reporter:
            Brian Leathem
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: