3 Replies Latest reply on Jun 6, 2009 11:44 PM by pmuir

    JSF2 + Tomcat + WebBeans Preview 1

    diegocoronel

      Hi,


      Im with some problems trying to use webbeans, im getting nullPointer in CurrentManager.rootManager(),


      log using webBeans libs inside WEB-INF/lib




      04/06/2009 20:35:26 org.apache.tomcat.util.digester.SetPropertiesRule begin
      WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:HelloWebBeans' did not find a matching property.
      04/06/2009 20:35:26 org.apache.catalina.core.AprLifecycleListener init
      INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre6\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre6/bin/client;C:/Program Files/Java/jre6/bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\Java\jdk1.6.0_10\bin;C:\Program Files\Common Files\Teleca Shared
      04/06/2009 20:35:27 org.apache.coyote.http11.Http11Protocol init
      INFO: Initializing Coyote HTTP/1.1 on http-8080
      04/06/2009 20:35:27 org.apache.catalina.startup.Catalina load
      INFO: Initialization processed in 518 ms
      04/06/2009 20:35:27 org.apache.catalina.core.StandardService start
      INFO: Starting service Catalina
      04/06/2009 20:35:27 org.apache.catalina.core.StandardEngine start
      INFO: Starting Servlet Engine: Apache Tomcat/6.0.20
      04/06/2009 20:35:27 com.sun.faces.config.ConfigureListener contextInitialized
      INFO: Initializing Mojarra 2.0.0 (Beta1 b13) for context '/HelloWebBeans'
      04/06/2009 20:35:28 org.apache.coyote.http11.Http11Protocol start
      INFO: Starting Coyote HTTP/1.1 on http-8080
      04/06/2009 20:35:28 org.apache.jk.common.ChannelSocket init
      INFO: JK: ajp13 listening on /0.0.0.0:8009
      04/06/2009 20:35:28 org.apache.jk.server.JkMain start
      INFO: Jk running ID=0 time=0/55  config=null
      04/06/2009 20:35:28 org.apache.catalina.startup.Catalina start
      INFO: Server startup in 1683 ms
      04/06/2009 20:35:37 org.apache.catalina.core.StandardWrapperValve invoke
      SEVERE: Servlet.service() for servlet Faces Servlet threw exception
      java.lang.NullPointerException
           at org.jboss.webbeans.jsf.WebBeansPhaseListener.afterRestoreView(WebBeansPhaseListener.java:119)
           at org.jboss.webbeans.jsf.WebBeansPhaseListener.afterPhase(WebBeansPhaseListener.java:90)
           at com.sun.faces.lifecycle.Phase.handleAfterPhase(Phase.java:181)
           at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:108)
           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:310)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
           at java.lang.Thread.run(Unknown Source)
      04/06/2009 20:35:39 org.apache.catalina.core.StandardWrapperValve invoke
      SEVERE: Servlet.service() for servlet Faces Servlet threw exception



      anyone know what i did wrong ?

        • 1. Re: JSF2 + Tomcat + WebBeans Preview 1
          diegocoronel

          hi again, the problem was i forgot to add to web.xml





              <listener>
                <listener-class>org.jboss.webbeans.environment.servlet.Listener</listener-class>
             </listener>
          
             <resource-env-ref>
               <description>
                 Object factory for the JCDI Manager
               </description>
               <resource-env-ref-name>
                 app/Manager
               </resource-env-ref-name>
               <resource-env-ref-type>
                 javax.inject.manager.Manager
               </resource-env-ref-type>
             </resource-env-ref>





          but now im getting this error..




          04/06/2009 20:49:04 org.apache.tomcat.util.digester.SetPropertiesRule begin
          WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:HelloWebBeans' did not find a matching property.
          04/06/2009 20:49:04 org.apache.catalina.core.AprLifecycleListener init
          INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre6\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre6/bin/client;C:/Program Files/Java/jre6/bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\Java\jdk1.6.0_10\bin;C:\Program Files\Common Files\Teleca Shared
          04/06/2009 20:49:04 org.apache.coyote.http11.Http11Protocol init
          INFO: Initializing Coyote HTTP/1.1 on http-8080
          04/06/2009 20:49:04 org.apache.catalina.startup.Catalina load
          INFO: Initialization processed in 522 ms
          04/06/2009 20:49:04 org.apache.catalina.core.StandardService start
          INFO: Starting service Catalina
          04/06/2009 20:49:04 org.apache.catalina.core.StandardEngine start
          INFO: Starting Servlet Engine: Apache Tomcat/6.0.20
          04/06/2009 20:49:05 org.jboss.webbeans.bootstrap.WebBeansBootstrap <clinit>
          INFO: Web Beans 1.0.0.PREVIEW1
          04/06/2009 20:49:05 org.jboss.webbeans.bootstrap.WebBeansBootstrap initialize
          INFO: Transactional services not available.  Transactional observers will be invoked synchronously.
          04/06/2009 20:49:05 org.jboss.webbeans.bootstrap.WebBeansBootstrap initialize
          INFO: EJB services not available. Session beans will be simple beans, injection into non-contextual EJBs, injection of @EJB in simple beans, injection of Java EE resources and JMS resources will not be available.
          04/06/2009 20:49:05 org.jboss.webbeans.bootstrap.WebBeansBootstrap initialize
          INFO: JPA services not available. Injection of @PersistenceContext will not occur. Entity beans will be discovered as simple beans.
          04/06/2009 20:49:22 com.sun.faces.config.ConfigureListener contextInitialized
          INFO: Initializing Mojarra 2.0.0 (Beta1 b13) for context '/HelloWebBeans'
          04/06/2009 20:49:23 org.apache.coyote.http11.Http11Protocol start
          INFO: Starting Coyote HTTP/1.1 on http-8080
          04/06/2009 20:49:23 org.apache.jk.common.ChannelSocket init
          INFO: JK: ajp13 listening on /0.0.0.0:8009
          04/06/2009 20:49:23 org.apache.jk.server.JkMain start
          INFO: Jk running ID=0 time=0/70  config=null
          04/06/2009 20:49:23 org.apache.catalina.startup.Catalina start
          INFO: Server startup in 18694 ms
          04/06/2009 20:49:30 org.apache.catalina.core.StandardWrapperValve invoke
          SEVERE: Servlet.service() for servlet Faces Servlet threw exception
          java.lang.ClassNotFoundException: javax.servlet.jsp.jstl.core.Config
               at java.net.URLClassLoader$1.run(Unknown Source)
               at java.security.AccessController.doPrivileged(Native Method)
               at java.net.URLClassLoader.findClass(Unknown Source)
               at java.lang.ClassLoader.loadClass(Unknown Source)
               at java.lang.ClassLoader.loadClass(Unknown Source)
               at java.lang.ClassLoader.loadClassInternal(Unknown Source)
               at com.sun.faces.application.view.JspViewHandlingStrategy.executePageToBuildView(JspViewHandlingStrategy.java:314)
               at com.sun.faces.application.view.JspViewHandlingStrategy.buildView(JspViewHandlingStrategy.java:129)
               at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
               at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:103)
               at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
               at javax.faces.webapp.FacesServlet.service(FacesServlet.java:311)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
               at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
               at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
               at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
               at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
               at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
               at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
               at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
               at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
               at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
               at java.lang.Thread.run(Unknown Source)
          




          anyone ?

          • 2. Re: JSF2 + Tomcat + WebBeans Preview 1
            diegocoronel

            ok, im fast :) or not :(


            My application is working fine, i downloaded jstl jar to tomcat, now that i resolved all erros i think its really easy to configure js2 and webBeans.


            i just dont know i this download was necessary.

            • 3. Re: JSF2 + Tomcat + WebBeans Preview 1
              pmuir

              You could write a wiki page or blog detailing the steps you took :-)