2 Replies Latest reply on Aug 23, 2011 5:49 AM by bitec_alisovenko

    Problems running JSF2.0 web app on SMX 4.3.1-fuse

    bitec_alisovenko

      Hi.

      I created the simple web application with simple faces configuration. Having several libraries in WEB-INF/lib folder including jsf-api-2.1.0.jar and jsf-impl-2.1.0.jar and also primefaces-2.2.1.jar. The web app is installed correctly but throw the exception:

       

      09:45:05,505 | WARN  | use-00-00/deploy | /drfusion-web                    | 104 - org.ops4j.pax.web.pax-web-jetty - 0.7.4 | unavailable

      java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.context.FacesContextFactory

      *     at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:815)*267:drfusion-web:1.0.0.SNAPSHOT

           at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:317)[267:drfusion-web:1.0.0.SNAPSHOT]

           at javax.faces.webapp.FacesServlet.init(FacesServlet.java:253)[267:drfusion-web:1.0.0.SNAPSHOT]

           at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:440)[100:org.apache.servicemix.bundles.jetty:6.1.26.1-fuse]

           at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:263)[100:org.apache.servicemix.bundles.jetty:6.1.26.1-fuse]

           at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)[100:org.apache.servicemix.bundles.jetty:6.1.26.1-fuse]

           at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:736)[100:org.apache.servicemix.bundles.jetty:6.1.26.1-fuse]

           at org.mortbay.jetty.servlet.ServletHandler.updateMappings(ServletHandler.java:1104)[100:org.apache.servicemix.bundles.jetty:6.1.26.1-fuse]

           at org.mortbay.jetty.servlet.ServletHandler.setServletMappings(ServletHandler.java:1163)[100:org.apache.servicemix.bundles.jetty:6.1.26.1-fuse]

           at org.mortbay.jetty.servlet.ServletHandler.addServletMapping(ServletHandler.java:860)[100:org.apache.servicemix.bundles.jetty:6.1.26.1-fuse]

           at org.ops4j.pax.web.service.jetty.internal.JettyServerImpl$1.call(JettyServerImpl.java:149)[104:org.ops4j.pax.web.pax-web-jetty:0.7.4]

           at org.ops4j.pax.web.service.jetty.internal.JettyServerImpl$1.call(JettyServerImpl.java:144)[104:org.ops4j.pax.web.pax-web-jetty:0.7.4]

           at org.ops4j.pax.swissbox.core.ContextClassLoaderUtils.doWithClassLoader(ContextClassLoaderUtils.java:60)[104:org.ops4j.pax.web.pax-web-jetty:0.7.4]

           at org.ops4j.pax.web.service.jetty.internal.JettyServerImpl.addServlet(JettyServerImpl.java:143)[104:org.ops4j.pax.web.pax-web-jetty:0.7.4]

           at org.ops4j.pax.web.service.jetty.internal.ServerControllerImpl$Started.addServlet(ServerControllerImpl.java:252)[104:org.ops4j.pax.web.pax-web-jetty:0.7.4]

           at org.ops4j.pax.web.service.jetty.internal.ServerControllerImpl.addServlet(ServerControllerImpl.java:103)[104:org.ops4j.pax.web.pax-web-jetty:0.7.4]

           at org.ops4j.pax.web.service.internal.HttpServiceStarted.registerServlet(HttpServiceStarted.java:291)[103:org.ops4j.pax.web.pax-web-runtime:0.7.4]

           at org.ops4j.pax.web.service.internal.HttpServiceStarted.registerServlet(HttpServiceStarted.java:251)[103:org.ops4j.pax.web.pax-web-runtime:0.7.4]

           at org.ops4j.pax.web.service.internal.HttpServiceProxy.registerServlet(HttpServiceProxy.java:98)[103:org.ops4j.pax.web.pax-web-runtime:0.7.4]

           at org.ops4j.pax.web.extender.war.internal.RegisterWebAppVisitorWC.visit(RegisterWebAppVisitorWC.java:192)[106:org.ops4j.pax.web.pax-web-extender-war:0.7.4]

           at org.ops4j.pax.web.extender.war.internal.model.WebApp.accept(WebApp.java:495)[106:org.ops4j.pax.web.pax-web-extender-war:0.7.4]

       

      I also tried to install jsf 2.0 as the separate bundle (used the one from springsource.com), but failed to launch it.

       

      Can anyone advise how can I use the web application together with JSF libraries inside SMX?

       

      Thanks, Anton

        • 1. Re: Problems running JSF2.0 web app on SMX 4.3.1-fuse
          bitec_alisovenko

          Tried Myfaces. No exception, but the context is not initialized correctly either:

           

          10:26:45,863 | INFO  | Refresh Packages | FacesConfigurator                |  -  -  | MyFaces-package : trinidad-api not found.

          10:26:45,863 | INFO  | Refresh Packages | FacesConfigurator                |  -  -  | MyFaces-package : trinidad-impl not found.

          10:26:45,863 | INFO  | Refresh Packages | FacesConfigurator                |  -  -  | MyFaces-package : tobago not found.

          10:26:45,863 | INFO  | Refresh Packages | FacesConfigurator                |  -  -  | MyFaces-package : commons-el not found.

          10:26:45,863 | INFO  | Refresh Packages | FacesConfigurator                |  -  -  | MyFaces-package : jsp-api not found.

          10:26:45,879 | INFO  | Refresh Packages | ExternalSpecifications           |  -  -  | MyFaces Bean Validation support disabled

          10:26:46,020 | INFO  | Refresh Packages | FacesConfigurator                |  -  -  | Serialization provider : class org.apache.myfaces.shared_impl.util.serial.DefaultSerialFactory

          10:26:46,035 | INFO  | Refresh Packages | DefaultLifecycleProviderFactory  |  -  -  | Using LifecycleProvider java.lang.String

          10:26:46,051 | INFO  | Refresh Packages | AbstractFacesInitializer         |  -  -  | ServletContext 'null' initialized.

           

          Everything works ok in Tomcat.

           

          Very pity that enabling JSF in Karaf is so difficult

          • 2. Re: Problems running JSF2.0 web app on SMX 4.3.1-fuse
            bitec_alisovenko

            Tried the latest SMX (apache-servicemix-4.4.0-fuse-00-43).

             

            I'm trying the sample web application, attached here http://karaf.922171.n3.nabble.com/Apache-Karaf-amp-WAR-JSF-td2465980.html. Also, I managed to install bundles for myfaces-impl and myfaces-api version 1.2.9. But after I install the sample application there, I get the following stack:

             

             

            13:35:28,318 | INFO  | qtp8441961-62    | WebXmlObserver                   | 161 - org.ops4j.pax.web.pax-web-extender-war - 1.0.3 | Using as web application context name

            13:35:28,318 | INFO  | qtp8441961-62    | WebXmlObserver                   | 161 - org.ops4j.pax.web.pax-web-extender-war - 1.0.3 | Using [] as web application root path

            13:35:28,318 | INFO  | qtp8441961-62    | HttpServiceFactoryImpl           | 157 - org.ops4j.pax.web.pax-web-runtime - 1.0.3 | Binding bundle: [myfaces-test-helloworld-osgi-pax-web ] to http service

            13:35:28,318 | INFO  | qtp8441961-62    | log                              | 114 - org.eclipse.jetty.util - 7.4.1.v20110513 | started HttpServiceContext{httpContext=org.ops4j.pax.web.extender.war.internal.WebAppWebContainerContext@bd8e3b}

            13:35:28,334 | INFO  | qtp8441961-62    | StartupServletContextListener    | 223 - org.apache.myfaces.core.impl - 1.2.9 | Checking for plugins:org.apache.myfaces.FACES_INIT_PLUGINS

            13:35:28,334 | INFO  | qtp8441961-62    | MyfacesConfig                    | 223 - org.apache.myfaces.core.impl - 1.2.9 | No context init parameter 'org.apache.myfaces.RENDER_CLEAR_JAVASCRIPT_FOR_BUTTON' found, using default value false

            13:35:28,334 | INFO  | qtp8441961-62    | MyfacesConfig                    | 223 - org.apache.myfaces.core.impl - 1.2.9 | No context init parameter 'org.apache.myfaces.RENDER_HIDDEN_FIELDS_FOR_LINK_PARAMS' found, using default value false

            13:35:28,334 | INFO  | qtp8441961-62    | MyfacesConfig                    | 223 - org.apache.myfaces.core.impl - 1.2.9 | No context init parameter 'org.apache.myfaces.SAVE_FORM_SUBMIT_LINK_IE' found, using default value false

            13:35:28,334 | INFO  | qtp8441961-62    | MyfacesConfig                    | 223 - org.apache.myfaces.core.impl - 1.2.9 | No context init parameter 'org.apache.myfaces.RENDER_VIEWSTATE_ID' found, using default value true

            13:35:28,334 | INFO  | qtp8441961-62    | MyfacesConfig                    | 223 - org.apache.myfaces.core.impl - 1.2.9 | No context init parameter 'org.apache.myfaces.STRICT_XHTML_LINKS' found, using default value true

            13:35:28,334 | INFO  | qtp8441961-62    | MyfacesConfig                    | 223 - org.apache.myfaces.core.impl - 1.2.9 | No context init parameter 'org.apache.myfaces.CONFIG_REFRESH_PERIOD' found, using default value 2

            13:35:28,334 | INFO  | qtp8441961-62    | MyfacesConfig                    | 223 - org.apache.myfaces.core.impl - 1.2.9 | No context init parameter 'org.apache.myfaces.VIEWSTATE_JAVASCRIPT' found, using default value false

            13:35:28,334 | INFO  | qtp8441961-62    | MyfacesConfig                    | 223 - org.apache.myfaces.core.impl - 1.2.9 | Tomahawk jar not available. Autoscrolling, DetectJavascript, AddResourceClass and CheckExtensionsFilter are disabled now.

            13:35:28,334 | INFO  | qtp8441961-62    | MyfacesConfig                    | 223 - org.apache.myfaces.core.impl - 1.2.9 | Starting up Tomahawk on the MyFaces-JSF-Implementation

            13:35:28,334 | INFO  | qtp8441961-62    | FacesConfigurator                | 223 - org.apache.myfaces.core.impl - 1.2.9 | Reading standard config META-INF/standard-faces-config.xml

            13:35:28,381 | INFO  | qtp8441961-62    | FacesConfigurator                | 223 - org.apache.myfaces.core.impl - 1.2.9 | Reading config /WEB-INF/faces-config.xml

            13:35:28,381 | INFO  | qtp8441961-62    | FacesConfigurator                | 223 - org.apache.myfaces.core.impl - 1.2.9 | MyFaces-package : myfaces-api not found.

            13:35:28,381 | INFO  | qtp8441961-62    | FacesConfigurator                | 223 - org.apache.myfaces.core.impl - 1.2.9 | MyFaces-package : myfaces-impl not found.

            13:35:28,381 | INFO  | qtp8441961-62    | FacesConfigurator                | 223 - org.apache.myfaces.core.impl - 1.2.9 | MyFaces-package : tomahawk not found.

            13:35:28,381 | INFO  | qtp8441961-62    | FacesConfigurator                | 223 - org.apache.myfaces.core.impl - 1.2.9 | MyFaces-package : tomahawk12 not found.

            13:35:28,381 | INFO  | qtp8441961-62    | FacesConfigurator                | 223 - org.apache.myfaces.core.impl - 1.2.9 | MyFaces-package : tomahawk-sandbox not found.

            13:35:28,381 | INFO  | qtp8441961-62    | FacesConfigurator                | 223 - org.apache.myfaces.core.impl - 1.2.9 | MyFaces-package : tomahawk-sandbox12 not found.

            13:35:28,381 | INFO  | qtp8441961-62    | FacesConfigurator                | 223 - org.apache.myfaces.core.impl - 1.2.9 | MyFaces-package : tomahawk-sandbox15 not found.

            13:35:28,381 | INFO  | qtp8441961-62    | FacesConfigurator                | 223 - org.apache.myfaces.core.impl - 1.2.9 | MyFaces-package : myfaces-orchestra-core not found.

            13:35:28,381 | INFO  | qtp8441961-62    | FacesConfigurator                | 223 - org.apache.myfaces.core.impl - 1.2.9 | MyFaces-package : myfaces-orchestra-core12 not found.

            13:35:28,381 | INFO  | qtp8441961-62    | FacesConfigurator                | 223 - org.apache.myfaces.core.impl - 1.2.9 | MyFaces-package : trinidad-api not found.

            13:35:28,381 | INFO  | qtp8441961-62    | FacesConfigurator                | 223 - org.apache.myfaces.core.impl - 1.2.9 | MyFaces-package : trinidad-impl not found.

            13:35:28,381 | INFO  | qtp8441961-62    | FacesConfigurator                | 223 - org.apache.myfaces.core.impl - 1.2.9 | MyFaces-package : tobago not found.

            13:35:28,381 | INFO  | qtp8441961-62    | FacesConfigurator                | 223 - org.apache.myfaces.core.impl - 1.2.9 | MyFaces-package : commons-el not found.

            13:35:28,381 | INFO  | qtp8441961-62    | FacesConfigurator                | 223 - org.apache.myfaces.core.impl - 1.2.9 | MyFaces-package : jsp-api not found.

            13:35:28,381 | WARN  | qtp8441961-62    | LocaleUtils                      | 223 - org.apache.myfaces.core.impl - 1.2.9 | Locale name in faces-config.xml null or empty, setting locale to default locale : en_US

            13:35:28,396 | INFO  | qtp8441961-62    | FacesConfigurator                | 223 - org.apache.myfaces.core.impl - 1.2.9 | Serialization provider : class org.apache.myfaces.shared_impl.util.serial.DefaultSerialFactory

            13:35:28,396 | WARN  | qtp8441961-62    | AbstractFacesInitializer         | 223 - org.apache.myfaces.core.impl - 1.2.9 | File for navigation 'from id' does not exist null/helloWorld.jsp

            13:35:28,396 | WARN  | qtp8441961-62    | AbstractFacesInitializer         | 223 - org.apache.myfaces.core.impl - 1.2.9 | File for navigation 'to id' does not exist null/page2.jsp

            13:35:28,396 | WARN  | qtp8441961-62    | AbstractFacesInitializer         | 223 - org.apache.myfaces.core.impl - 1.2.9 | File for navigation 'from id' does not exist null/page2.jsp

            13:35:28,396 | WARN  | qtp8441961-62    | AbstractFacesInitializer         | 223 - org.apache.myfaces.core.impl - 1.2.9 | File for navigation 'to id' does not exist null/helloWorld.jsp

            13:35:28,396 | INFO  | qtp8441961-62    | AbstractFacesInitializer         | 223 - org.apache.myfaces.core.impl - 1.2.9 | ServletContext 'null' initialized.

            13:35:28,396 | INFO  | qtp8441961-62    | StartupServletContextListener    | 223 - org.apache.myfaces.core.impl - 1.2.9 | Checking for plugins:org.apache.myfaces.FACES_INIT_PLUGINS

             

            For some reasons the context is empty. I tried the following command :

            install war:file:///d:/temp/sample.war?Webapp-Context=sample

             

            but the context is empty anyway

             

            Can anyone advise why the context name is empty?

             

            Edited by: bitec on Aug 23, 2011 9:48 AM