5 Replies Latest reply on May 18, 2011 1:22 AM by Thomas Blattner

    Problem with JSF2, Tomcat6, Weld 1.1.0 ConversationAwareViewHandler

    Thomas Blattner Newbie

      Hello,


      I'm having some problems to run Weld 1.1.0 properly in a web application for Tomcat 6 with JSF 2.1.0.


      When following all the steps mentioned in the documentation I get an error message during startup of my web application:


      The error message is


      Cause: Unable to create a new instance of 'org.jboss.weld.jsf.ConversationAwareViewHandler'


      Does anyone know what I'm doing wrong? I have put weld-servlet.jar in WEB-INF/lib. I have configured the servlet listener in web.xml. I have put the context.xml the <resource-env-ref>.


      But I keep getting the error message above.


      Any ideas?


      Thanks.


      Best regards
      Thomas

        • 1. Re: Problem with JSF2, Tomcat6, Weld 1.1.0 ConversationAwareViewHandler
          Ales Justin Master

          You'll need to dig deeper and give more info.


          As atm we can only guess what goes wrong. ;-)

          • 2. Re: Problem with JSF2, Tomcat6, Weld 1.1.0 ConversationAwareViewHandler
            Thomas Blattner Newbie

            Thanks for your reply.


            Steps to reproduce:



            1. Using Apache Tomcat 6.0.18

            2. Create a minimum JSF 2.1 Web Application project

            3. Add weld-servlet.jar to WEB-INF/lib folder

            4. Start the application



            I get this error message during tomcat startup:

            com.sun.faces.config.ConfigurationException:
              Source Document: jar:file:/D:/workspaces/workspace-wtp/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/WeldTest/WEB-INF/lib/weld-servlet.jar!/META-INF/faces-config.xml
              Cause: Unable to create a new instance of 'org.jboss.weld.jsf.ConversationAwareViewHandler': java.lang.reflect.InvocationTargetException
                 at com.sun.faces.config.processor.AbstractConfigProcessor.createInstance(AbstractConfigProcessor.java:293)
                 at com.sun.faces.config.processor.ApplicationConfigProcessor.setViewHandler(ApplicationConfigProcessor.java:527)
                 at com.sun.faces.config.processor.ApplicationConfigProcessor.processViewHandlers(ApplicationConfigProcessor.java:847)
                 at com.sun.faces.config.processor.ApplicationConfigProcessor.process(ApplicationConfigProcessor.java:331)
                 at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:114)
                 at com.sun.faces.config.processor.LifecycleConfigProcessor.process(LifecycleConfigProcessor.java:116)
                 at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:114)
                 at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:222)
                 at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:360)
                 at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:225)
                 at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
                 at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
                 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
                 at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
                 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
                 at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
                 at org.apache.catalina.core.StandardService.start(StandardService.java:516)
                 at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
                 at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
                 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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
                 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
            Caused by: java.lang.reflect.InvocationTargetException
                 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                 at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
                 at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
                 at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
                 at com.sun.faces.config.processor.AbstractConfigProcessor.createInstance(AbstractConfigProcessor.java:263)
                 ... 24 more
            Caused by: java.lang.IllegalStateException: Singleton is not set
                 at org.jboss.weld.bootstrap.api.helpers.IsolatedStaticSingletonProvider$IsolatedStaticSingleton.get(IsolatedStaticSingletonProvider.java:52)
                 at org.jboss.weld.Container.instance(Container.java:58)
                 at org.jboss.weld.jsf.ConversationAwareViewHandler.<init>(ConversationAwareViewHandler.java:71)
                 ... 29 more


            • 3. Re: Problem with JSF2, Tomcat6, Weld 1.1.0 ConversationAwareViewHandler
              Joel Hudon Newbie

              Version 1.1.1.Final of the weld-servlet resolve the issue.

              • 4. Re: Problem with JSF2, Tomcat6, Weld 1.1.0 ConversationAwareViewHandler
                Thomas Blattner Newbie

                I'll test it tomorrow. Thanks for your reply.


                Best regards
                Thomas