0 Replies Latest reply on Apr 12, 2013 4:01 AM by ken chen

    JBoss eap 6.0.1 with myface 1.1 have java.lang.NoSuchMethodException to Actionlistener

    ken chen Newbie

      Hi all.

       

      I deploy an ear project with an ejb and a war.

       

      I have read almost all myface discusions and article to let it work on JBoss.

       

      I have

       

      <context-param>

            <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>

            <param-value>true</param-value>

      </context-param>

       

      in my web.xml

       

      and

       

      <?xml version="1.0" encoding="UTF-8"?>

      <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">

      <deployment>

      <resources>

      <resource-root path="APP-INF/lib/myfaces-api-1.1.5-you.jar"/>

      <resource-root path="APP-INF/lib/myfaces-impl-1.1.5-you.jar"/>

      </resources>

      <dependencies>

            <module name="com.myface" />

      </dependencies>

      </deployment>

      <sub-deployment name="cht.mytest.war">

      <resources>

      <resource-root path="cht.mytest.war/WEB-INF/lib/myfaces-api-1.1.5-you.jar"/>

      <resource-root path="cht.mytest.war/WEB-INF/lib/myfaces-impl-1.1.5-you.jar"/>

      </resources>

      <dependencies>

            <module name="com.myface" />

      </dependencies>

      </sub-deployment>

      <sub-deployment name="cht.heriyeto.hellobean.jar">

      <resources>

      <resource-root path="APP-INF/lib/myfaces-api-1.1.5-you.jar"/>

      <resource-root path="APP-INF/lib/myfaces-impl-1.1.5-you.jar"/>

      </resources>

      <dependencies>

            <module name="com.myface" />

      </dependencies>

      </sub-deployment>

      </jboss-deployment-structure>

       

      in my jboss-deployment-structure.xml to get the myface work.

       

      Although the index page and action="show" in my index.jsp work well,

       

      the actionListener="#{user.doQuery}" in index.jsp still have error below.

       

      15:26:49,862 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/cht.mytest].[Faces Servlet]] (http-localhost/127.0.0.1:8080-1) Servlet.service() for servlet Faces Servlet threw exception: java.lang.NoSuchMethodException: cht.heriyeto.test.UserBean.doQuery(javax.faces.event.ActionEvent)

                at java.lang.Class.getMethod(Class.java:1605) [rt.jar:1.6.0_22]

                at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:121) [myfaces-impl-1.1.5-you.jar:]

                at javax.faces.component.UICommand.broadcast(UICommand.java:89) [myfaces-api-1.1.5-you.jar:]

                at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:97) [myfaces-api-1.1.5-you.jar:]

                at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:172) [myfaces-api-1.1.5-you.jar:]

                at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:33) [myfaces-impl-1.1.5-you.jar:]

                at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95) [myfaces-impl-1.1.5-you.jar:]

                at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70) [myfaces-impl-1.1.5-you.jar:]

                at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139) [myfaces-api-1.1.5-you.jar:]

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.17.Final-redhat-1.jar:]

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.17.Final-redhat-1.jar:]

                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.17.Final-redhat-1.jar:]

                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:163) [jbossweb-7.0.17.Final-redhat-1.jar:]

                at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:170) [jboss-as-web-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]

                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.17.Final-redhat-1.jar:]

                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.17.Final-redhat-1.jar:]

                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:111) [jbossweb-7.0.17.Final-redhat-1.jar:]

                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:372) [jbossweb-7.0.17.Final-redhat-1.jar:]

                at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.17.Final-redhat-1.jar:]

                at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:679) [jbossweb-7.0.17.Final-redhat-1.jar:]

                at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:931) [jbossweb-7.0.17.Final-redhat-1.jar:]

                at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_22]

       

      In fact, when i load the index page, i get some warning

       

      15:26:43,129 WARN  [org.jboss.modules] (http-localhost/127.0.0.1:8080-1) Failed to define class org.apache.myfaces.portlet.MyFacesGenericPortlet in Module "deployment.test2.ear.cht.heriyeto.hellobean.jar:main" from Service Module Loader: java.lang.LinkageError: Failed to link org/apache/myfaces/portlet/MyFacesGenericPortlet (Module "deployment.test2.ear.cht.heriyeto.hellobean.jar:main" from Service Module Loader)

                at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:396)

                at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243)

                at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73)

                at org.jboss.modules.Module.loadModuleClass(Module.java:527)

                at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182)

                at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

                at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:417)

                at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

                at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

                at org.apache.myfaces.shared_impl.renderkit.html.HtmlRenderer.getActionUrl(HtmlRenderer.java:77) [myfaces-impl-1.1.5-you.jar:]

                at org.apache.myfaces.shared_impl.renderkit.html.HtmlFormRendererBase.getActionUrl(HtmlFormRendererBase.java:127) [myfaces-impl-1.1.5-you.jar:]

                at org.apache.myfaces.shared_impl.renderkit.html.HtmlFormRendererBase.encodeBegin(HtmlFormRendererBase.java:102) [myfaces-impl-1.1.5-you.jar:]

                at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:515) [myfaces-api-1.1.5-you.jar:]

                at javax.faces.webapp.UIComponentTag.encodeBegin(UIComponentTag.java:467) [myfaces-api-1.1.5-you.jar:]

                at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:320) [myfaces-api-1.1.5-you.jar:]

                at org.apache.jsp.index_jsp._jspx_meth_h_005fform_005f0(index_jsp.java:315)

                at org.apache.jsp.index_jsp._jspx_meth_f_005fview_005f0(index_jsp.java:165)

                at org.apache.jsp.index_jsp._jspService(index_jsp.java:96)

                at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) [jbossweb-7.0.17.Final-redhat-1.jar:]

                at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.1.Final-redhat-2.jar:1.0.1.Final-redhat-2]

                at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369) [jbossweb-7.0.17.Final-redhat-1.jar:]

                at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:326) [jbossweb-7.0.17.Final-redhat-1.jar:]

                at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:253) [jbossweb-7.0.17.Final-redhat-1.jar:]

                at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.1.Final-redhat-2.jar:1.0.1.Final-redhat-2]

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.17.Final-redhat-1.jar:]

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.17.Final-redhat-1.jar:]

                at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:840) [jbossweb-7.0.17.Final-redhat-1.jar:]

                at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:622) [jbossweb-7.0.17.Final-redhat-1.jar:]

                at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:560) [jbossweb-7.0.17.Final-redhat-1.jar:]

                at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:488) [jbossweb-7.0.17.Final-redhat-1.jar:]

                at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:419) [myfaces-impl-1.1.5-you.jar:]

                at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:211) [myfaces-impl-1.1.5-you.jar:]

                at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41) [myfaces-impl-1.1.5-you.jar:]

                at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132) [myfaces-impl-1.1.5-you.jar:]

                at javax.faces.webapp.FacesServlet.service(FacesServlet.java:140) [myfaces-api-1.1.5-you.jar:]

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.17.Final-redhat-1.jar:]

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.17.Final-redhat-1.jar:]

                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.17.Final-redhat-1.jar:]

                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.17.Final-redhat-1.jar:]

                at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]

                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.17.Final-redhat-1.jar:]

                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.17.Final-redhat-1.jar:]

                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.17.Final-redhat-1.jar:]

                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:372) [jbossweb-7.0.17.Final-redhat-1.jar:]

                at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.17.Final-redhat-1.jar:]

                at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:679) [jbossweb-7.0.17.Final-redhat-1.jar:]

                at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:931) [jbossweb-7.0.17.Final-redhat-1.jar:]

                at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_22]

      Caused by: java.lang.NoClassDefFoundError: javax/portlet/GenericPortlet

                at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.6.0_22]

                at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632) [rt.jar:1.6.0_22]

                at java.lang.ClassLoader.defineClass(ClassLoader.java:616) [rt.jar:1.6.0_22]

                at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) [rt.jar:1.6.0_22]

                at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327)

                at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391)

                ... 47 more

       

      Can anyone help me?

       

      Here is my ear.