2 Replies Latest reply on Mar 12, 2012 3:14 AM by hua shao

    Richfaces 4 do not work with Geronimo V3

    Georg Nozicka Newbie

      Hello,

       

      I have the following problem and for the moment I have no idea what can be wrong.

       

      Environment:

      • Linux 64Bit 11.04
      • Geronimo Server V3
      • IDE Eclipse Helios
      • Richfaces 4 (does not work with any V4 version)

       

      I created a simple WebApp with a corresponding EAR. Then a simple xhtml file using JSF 2 and Richfaces 4. Opening the WebPage shows just the JSF output but no Richfaces output. I've put the Richfaces libraries in the WEB-INF/lib directory, also specified to export the Richfaces libraries.

       

      The xhtml looks like this:

       

      <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"

              xmlns:ui="http://java.sun.com/jsf/facelets"

              xmlns:h="http://java.sun.com/jsf/html"

              xmlns:f="http://java.sun.com/jsf/core"

              xmlns:rich="http://richfaces.org/rich"

              xmlns:a4j="http://richfaces.org/a4j"

              xmlns:c="http://java.sun.com/jstl/core"

              xmlns="http://www.w3.org/1999/xhtml" version="2.0">

       

              <f:view>

                      <h:form>

                              <h:outputText value="Test1!" />               

                      </h:form>                               

       

                      <rich:panel id="mainPanel">

                              <f:facet name="header">

                                      <h:outputText value="Panel" />

                              </f:facet>

                      </rich:panel>

              </f:view>

      </jsp:root>

       

      The web.xml looks like this:

       

      <display-name>WebJsfWeb</display-name>

        <servlet>

          <servlet-name>Faces Servlet</servlet-name>

          <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>

          <load-on-startup>1</load-on-startup>

        </servlet>

        <servlet-mapping>

          <servlet-name>Faces Servlet</servlet-name>

          <url-pattern>/faces/*</url-pattern>

        </servlet-mapping>

       

       

      Looking at the source of the rendered web page it looks like this:

       

      <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j" xmlns:c="http://java.sun.com/jstl/core" xmlns="http://www.w3.org/1999/xhtml" version="2.0"><form id="j_id186993322_b254a8f" name="j_id186993322_b254a8f" method="post" action="/WebJsfWeb/faces/Test.xhtml" enctype="application/x-www-form-urlencoded">Test1!<input type="hidden" name="j_id186993322_b254a8f_SUBMIT" value="1" /><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="9CBdLg1ga30JvIJ2WnhRPHEWETeTsZsJYdKCa2mf3LRAyIsvlCGGPgH5k2mrxrVgGOTgsEwxJFwaHj4G5T+wFQ==" /></form> 

                             

                      <rich:panel id="mainPanel"> 

                      </rich:panel> 

       

      </jsp:root>

       

       

      Obviously the richfaces tags are returned in plain text, they are not converted to HTML resp. JavaScript.

       

      When I deploy, I actually get the following exception:

       

      2011-07-09 09:38:34,708 ERROR [Application] Error reading META-INF/MANIFEST.MF file: FakeURLStreamHandler can not be used!

      java.io.IOException: FakeURLStreamHandler can not be used!

              at org.apache.felix.framework.FakeURLStreamHandler.openConnection(FakeURLStreamHandler.java:39)

              at java.net.URL.openConnection(URL.java:945)

              at org.richfaces.VersionBean$Version.readManifest(VersionBean.java:154)

              at org.richfaces.VersionBean$Version.initialize(VersionBean.java:95)

              at org.richfaces.VersionBean$Version.<init>(VersionBean.java:80)

              at org.richfaces.VersionBean.<clinit>(VersionBean.java:50)

              at org.richfaces.application.InitializationListener.onStart(InitializationListener.java:113)

              at org.richfaces.application.InitializationListener.processEvent(InitializationListener.java:152)

              at javax.faces.event.SystemEvent.processListener(SystemEvent.java:43)

              at org.apache.myfaces.application.ApplicationImpl._traverseListenerList(ApplicationImpl.java:1942)

              at org.apache.myfaces.application.ApplicationImpl.access$000(ApplicationImpl.java:113)

              at org.apache.myfaces.application.ApplicationImpl$SystemListenerEntry.publish(ApplicationImpl.java:2035)

              at org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:512)

              at org.apache.myfaces.webapp.AbstractFacesInitializer.dispatchInitDestroyEvent(AbstractFacesInitializer.java:197)

              at org.apache.myfaces.webapp.AbstractFacesInitializer.initFaces(AbstractFacesInitializer.java:124)

              at org.apache.myfaces.webapp.StartupServletContextListener.initFaces(StartupServletContextListener.java:186)

              at org.apache.myfaces.webapp.StartupServletContextListener.contextInitialized(StartupServletContextListener.java:159)

              at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:676)

              at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:370)

              at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:667)

              at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:253)

              at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:978)

              at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:608)

              at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:155)

              at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:349)

              at org.apache.geronimo.jetty8.handler.GeronimoWebAppContext.doStart(GeronimoWebAppContext.java:89)

              at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)

              at org.apache.geronimo.jetty8.WebAppContextWrapper.doStart(WebAppContextWrapper.java:314)

              at org.apache.geronimo.gbean.runtime.GBeanInstance.createInstance(GBeanInstance.java:959)

              at org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart(GBeanInstanceState.java:269)

              at org.apache.geronimo.gbean.runtime.GBeanInstanceState.start(GBeanInstanceState.java:103)

              at org.apache.geronimo.gbean.runtime.GBeanInstance.start(GBeanInstance.java:530)

              at org.apache.geronimo.gbean.runtime.GBeanDependency.attemptFullStart(GBeanDependency.java:110)

              at org.apache.geronimo.gbean.runtime.GBeanDependency.addTarget(GBeanDependency.java:145)

              at org.apache.geronimo.gbean.runtime.GBeanDependency$1.running(GBeanDependency.java:119)

              at org.apache.geronimo.kernel.basic.BasicLifecycleMonitor.fireRunningEvent(BasicLifecycleMonitor.java:175)

              at org.apache.geronimo.kernel.basic.BasicLifecycleMonitor.access$300(BasicLifecycleMonitor.java:44)

              at org.apache.geronimo.kernel.basic.BasicLifecycleMonitor$RawLifecycleBroadcaster.fireRunningEvent(BasicLifecycleMonitor.java:253)

              at org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart(GBeanInstanceState.java:295)

              at org.apache.geronimo.gbean.runtime.GBeanInstanceState.start(GBeanInstanceState.java:103)

              at org.apache.geronimo.gbean.runtime.GBeanInstance.start(GBeanInstance.java:530)

              at org.apache.geronimo.gbean.runtime.GBeanDependency.attemptFullStart(GBeanDependency.java:110)

              at org.apache.geronimo.gbean.runtime.GBeanDependency.addTarget(GBeanDependency.java:145)

              at org.apache.geronimo.gbean.runtime.GBeanDependency$1.running(GBeanDependency.java:119)

              at org.apache.geronimo.kernel.basic.BasicLifecycleMonitor.fireRunningEvent(BasicLifecycleMonitor.java:175)

              at org.apache.geronimo.kernel.basic.BasicLifecycleMonitor.access$300(BasicLifecycleMonitor.java:44)

              at org.apache.geronimo.kernel.basic.BasicLifecycleMonitor$RawLifecycleBroadcaster.fireRunningEvent(BasicLifecycleMonitor.java:253)

              at org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart(GBeanInstanceState.java:295)

              at org.apache.geronimo.gbean.runtime.GBeanInstanceState.start(GBeanInstanceState.java:103)

              at org.apache.geronimo.gbean.runtime.GBeanInstance.start(GBeanInstance.java:530)

              at org.apache.geronimo.gbean.runtime.GBeanDependency.attemptFullStart(GBeanDependency.java:110)

              at org.apache.geronimo.gbean.runtime.GBeanDependency.addTarget(GBeanDependency.java:145)

              at org.apache.geronimo.gbean.runtime.GBeanDependency$1.running(GBeanDependency.java:119)

              at org.apache.geronimo.kernel.basic.BasicLifecycleMonitor.fireRunningEvent(BasicLifecycleMonitor.java:175)

              at org.apache.geronimo.kernel.basic.BasicLifecycleMonitor.access$300(BasicLifecycleMonitor.java:44)

              at org.apache.geronimo.kernel.basic.BasicLifecycleMonitor$RawLifecycleBroadcaster.fireRunningEvent(BasicLifecycleMonitor.java:253)

              at org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart(GBeanInstanceState.java:295)

              at org.apache.geronimo.gbean.runtime.GBeanInstanceState.start(GBeanInstanceState.java:103)

              at org.apache.geronimo.gbean.runtime.GBeanInstanceState.startRecursive(GBeanInstanceState.java:125)

              at org.apache.geronimo.gbean.runtime.GBeanInstance.startRecursive(GBeanInstance.java:544)

              at org.apache.geronimo.kernel.basic.BasicKernel.startRecursiveGBean(BasicKernel.java:386)

              at org.apache.geronimo.kernel.config.ConfigurationUtil.startConfigurationGBeans(ConfigurationUtil.java:461)

              at org.apache.geronimo.kernel.config.KernelConfigurationManager.start(KernelConfigurationManager.java:224)

              at org.apache.geronimo.kernel.config.SimpleConfigurationManager.startConfiguration(SimpleConfigurationManager.java:698)

              at org.apache.geronimo.kernel.config.SimpleConfigurationManager.startConfiguration(SimpleConfigurationManager.java:677)

              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.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)

              at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:131)

              at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:856)

              at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:245)

              at org.apache.geronimo.kernel.KernelGBean.invoke(KernelGBean.java:344)

              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.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)

              at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:131)

              at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:856)

              at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:245)

              at org.apache.geronimo.system.jmx.MBeanGBeanBridge.invoke(MBeanGBeanBridge.java:172)

              at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)

              at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)

              at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1427)

              at javax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:72)

              at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1265)

              at java.security.AccessController.doPrivileged(Native Method)

              at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1367)

              at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:788)

              at sun.reflect.GeneratedMethodAccessor57.invoke(Unknown Source)

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

              at java.lang.reflect.Method.invoke(Method.java:597)

              at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)

              at sun.rmi.transport.Transport$1.run(Transport.java:159)

              at java.security.AccessController.doPrivileged(Native Method)

              at sun.rmi.transport.Transport.serviceCall(Transport.java:155)

              at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)

              at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)

              at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)

              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

              at java.lang.Thread.run(Thread.java:662)

       

       

      To make it clear, the application principally works, at the output the text “Test1” is shown, i.e. JSF works, but not Richfaces.

       

      Does anyone have an idea?

       

      Best regards,

      Georg

        • 1. Re: Richfaces 4 do not work with Geronimo V3
          Georg Nozicka Newbie

          Hello,

           

          just want to tell that I did a lot of further investigations. I tried my simple sample with Tomcat which worked. I also tried it with Glassfish which also worked. With Geronimo I changed the OSGi runtime from felix to equinox which changed the situation in that way, that the java.io.IOException: FakeURLStreamHandler is not thrown any more (which made me hope that it will work now). So now there are no deployment errors, no warnings, everything seems to be okay, except that I still have the situation, that no richfaces tags are rendered, just the JSF tags.

           

          So my principal question is if everyone knows if Richfaces do work with Geronimo V3 server or if they definitely don’t work. If someone knows that it works, is it possible to give a hint on any additional configurations which are needed to be done? Or are there any additional information I can give you (turn on some tracing or whatever) to track the problem down?

           

          Thank you for any help,

          Georg

          • 2. Re: Richfaces 4 do not work with Geronimo V3
            hua shao Newbie

            I have a similar problem like yours.I create simple richfaces project with mini configuration.

             

            ├─src

            └─WebContent

                ├─META-INF

                │      MANIFEST.MF

                │

                └─WEB-INF

                    │  beans.xml

                    │  faces-config.xml

                    │  geronimo-web.xml

                    │  web.xml

                    │

                    └─lib

                            cssparser-0.9.6.jar

                            guava-11.0.1.jar

                            richfaces-components-api-4.2.0.Final-sources.jar

                            richfaces-components-api-4.2.0.Final.jar

                            richfaces-core-api-4.2.0.Final.jar

                            richfaces-core-impl-4.2.0.Final.jar

                            sac.jar

             

            When deploy in geronimo3,then :

             

            Caused by: java.lang.RuntimeException: javax.enterprise.inject.UnsatisfiedResolutionException: Api type [javax.enterprise.inject.spi.BeanManager] is not found with the qualifiers

            Qualifiers: [@javax.enterprise.inject.Default()]

            for injection into Method Injection Point, method name :  beforeBeanDiscovery, Bean Owner : [PushCDIDependencyRegistrationExtension, Name:null, WebBeans Type:EXTENSION, API Types:[javax.enterprise.inject.spi.Extension,org.richfaces.cdi.push.PushCDIDependencyRegistrationExtension,java.lang.Object], Qualifiers:[javax.enterprise.inject.Default]]

                at org.apache.openejb.cdi.OpenEJBLifecycle.startApplication(OpenEJBLifecycle.java:322)

                at org.apache.geronimo.openejb.cdi.OpenWebBeansWebInitializer.newWebBeansContext(OpenWebBeansWebInitializer.java:111)

                at org.apache.geronimo.openejb.cdi.ThreadSingletonServiceAdapter.initialize(ThreadSingletonServiceAdapter.java:48)

                at org.apache.openejb.cdi.CdiBuilder.build(CdiBuilder.java:50)

                at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:706)

                ... 58 more

            Caused by: javax.enterprise.inject.UnsatisfiedResolutionException: Api type [javax.enterprise.inject.spi.BeanManager] is not found with the qualifiers

            Qualifiers: [@javax.enterprise.inject.Default()]

            for injection into Method Injection Point, method name :  beforeBeanDiscovery, Bean Owner : [PushCDIDependencyRegistrationExtension, Name:null, WebBeans Type:EXTENSION, API Types:[javax.enterprise.inject.spi.Extension,org.richfaces.cdi.push.PushCDIDependencyRegistrationExtension,java.lang.Object], Qualifiers:[javax.enterprise.inject.Default]]

                at org.apache.webbeans.util.InjectionExceptionUtils.throwUnsatisfiedResolutionException(InjectionExceptionUtils.java:92)

                at org.apache.webbeans.container.ResolutionUtil.checkResolvedBeans(ResolutionUtil.java:98)

                at org.apache.webbeans.container.InjectionResolver.getInjectionPointBean(InjectionResolver.java:265)

                at org.apache.webbeans.event.ObserverMethodImpl.getMethodArguments(ObserverMethodImpl.java:387)

                at org.apache.webbeans.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:203)

                at org.apache.webbeans.event.NotificationManager.fireEvent(NotificationManager.java:461)

                at org.apache.webbeans.container.BeanManagerImpl.fireEvent(BeanManagerImpl.java:473)

                at org.apache.openejb.cdi.BeansDeployer.fireBeforeBeanDiscoveryEvent(BeansDeployer.java:146)

                at org.apache.openejb.cdi.OpenEJBLifecycle.startApplication(OpenEJBLifecycle.java:197)

                ... 62 more

             

            I think, it maybe have some mistake in CDI. so, I try to upgrade geronimo3' openwebbeans-1.1.1 to openwebbeans-1.1.3,but it still happen.

            FYI:

            [OWB-622] - beanmanager injection in afterBeanDiscovery method parameter

            Fixed lifecycle issue in CDI BeforeBeanDiscovery