1 2 Previous Next 24 Replies Latest reply on Aug 4, 2007 3:55 PM by supernovasoftware.com Go to original post
      • 15. Re: Seam 1.2.1, AS 4.2.1, @Restricted method gives NoClassDe
        smokingapipe

        I was too quick when I said it works. It works most of the time, but not all the time. I get errors like:

        javax.faces.FacesException: javax.el.ELException: /layout/menu.xhtml @12,51 rendered="#{s:hasRole('admin')}": Function 's:hasRole' not found
         at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:373)
         at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:993)
         at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1001)
        


        But not always. I don't get it. Is that related to this problem with the EL RI, or am I doing something else wrong?


        • 16. Re: Seam 1.2.1, AS 4.2.1, @Restricted method gives NoClassDe
          smokingapipe

          It seems to be happening when I invoke an action from that page by clicking a button, which hits some action in my FooHome extends EntityHome object. I can research this some more if it would help.

          • 17. Re: Seam 1.2.1, AS 4.2.1, @Restricted method gives NoClassDe
            tynor

            I am seeing exactly the same bizzare behavior. My app works fine (s:hasRole() apparently working since my menu.xhtml is evaluating ok), until I click on a Save button (though oddly, I can click Delete on the same form without any trouble). Exception at the bottom of this post.

            I have a Seam 1.2.1GA based app (originally created via seamgen) that I'm trying to run on AS 4.2.1 and have made the following changes thus far:

            Added files:

            lib/jsf-impl.jar
            lib/jsf-api.jar
            

            Removed files:
            lib/el-api.jar
            lib/myfaces-impl-1.1.4.jar
            lib/myfaces-api-1.1.4.jar
            


            and various edits:

            Index: build.properties
            ===================================================================
            --- build.properties (revision 186)
            +++ build.properties (working copy)
            @@ -1 +1,2 @@
            -jboss.home = C:/Program Files/jboss-4.0.5.GA
            +jboss.home = C:/Program Files/jboss-4.2.1.GA
            Index: build.xml
            ===================================================================
            --- build.xml (revision 203)
            +++ build.xml (working copy)
            @@ -211,7 +212,11 @@
             <include name="drools-*.jar"/>
             <include name="janino-*.jar"/>
             <include name="antlr-*.jar"/>
            + <include name="commons-beanutils-*.jar"/>
            + <include name="commons-collections-*.jar"/>
            + <include name="commons-digester-*.jar"/>
             <include name="commons-jci-*.jar"/>
            + <include name="commons-lang-*.jar"/>
             <include name="stringtemplate-*.jar"/>
             </fileset>
             </copy>
            Index: resources/WEB-INF/faces-config.xml
            ===================================================================
            --- resources/WEB-INF/faces-config.xml (revision 186)
            +++ resources/WEB-INF/faces-config.xml (working copy)
            @@ -1,9 +1,8 @@
             <?xml version='1.0' encoding='UTF-8'?>
            -<!DOCTYPE faces-config PUBLIC
            - "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
            - "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
            -
            -<faces-config>
            +<faces-config version="1.2"
            + xmlns="http://java.sun.com/xml/ns/javaee"
            + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
            
             <application>
             <message-bundle>messages</message-bundle>
            @@ -11,6 +10,7 @@
             <!--
             <view-handler>org.jboss.seam.ui.facelet.SeamFaceletViewHandler</view-handler>
             -->
            + <el-resolver>org.jboss.seam.jsf.SeamELResolver</el-resolver>
             </application>
            
             <!-- Seam transaction management -->
            Index: resources/WEB-INF/web.xml
            ===================================================================
            --- resources/WEB-INF/web.xml (revision 186)
            +++ resources/WEB-INF/web.xml (working copy)
            @@ -63,11 +63,11 @@
             <url-pattern>/seam/resource/*</url-pattern>
             </servlet-mapping>
            
            - <!-- MyFaces -->
            -
            +<!-- required for jboss prior to 4.2.x
             <listener>
             <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
             </listener>
            +-->
            
             <!-- Facelets development mode (disable in production) -->
            
            Index: resources/META-INF/application.xml
            ===================================================================
            --- resources/META-INF/application.xml (revision 186)
            +++ resources/META-INF/application.xml (working copy)
            @@ -21,9 +21,11 @@
             <module>
             <java>jboss-seam.jar</java>
             </module>
            +<!-- disable for Sun RI / JBoss 4.2.x
             <module>
             <java>el-api.jar</java>
             </module>
            +-->
             <module>
             <java>el-ri.jar</java>
             </module>
            @@ -56,6 +58,18 @@
             <java>commons-jci-janino-2.4.3.jar</java>
             </module>
             <module>
            + <java>commons-digester-1.6.jar</java>
            + </module>
            + <module>
            + <java>commons-collections-3.1.jar</java>
            + </module>
            + <module>
            + <java>commons-beanutils-1.7.0.jar</java>
            + </module>
            + <module>
            + <java>commons-lang-2.1.jar</java>
            + </module>
            + <module>
             <java>stringtemplate-2.3b6.jar</java>
             </module>



            Here's the exception:
            javax.faces.FacesException: javax.el.ELException: /WEB-INF/facelets/templates/mainmenu.xhtml @17,87 rendered="#{s:hasRole('ROLE_INVESTMENTS')}": Function 's:hasRole' not found
             at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:373)
             at org.ajax4jsf.framework.renderer.RendererBase.renderChild(RendererBase.java:276)
             at org.richfaces.renderkit.html.ToolBarGroupRenderer.encodeChildren(ToolBarGroupRenderer.java:68)
             at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
             at org.ajax4jsf.framework.renderer.RendererBase.renderChild(RendererBase.java:282)
             at org.richfaces.renderkit.html.ToolBarRendererBase.encodeChildren(ToolBarRendererBase.java:81)
             at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
             at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
             at javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
             at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
             at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
             at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
             at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:571)
             at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
             at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:233)
             at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
             at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
             at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
             at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
             at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
             at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:60)
             at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
             at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
             at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
             at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
             at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
             at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
             at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
             at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
             at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
             at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
             at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
             at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
             at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
             at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
             at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
             at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
             at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
             at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
             at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
             at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
             at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
             at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
             at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
             at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
             at java.lang.Thread.run(Thread.java:595)
            Caused by: javax.el.ELException: /WEB-INF/facelets/templates/mainmenu.xhtml @17,87 rendered="#{s:hasRole('ROLE_INVESTMENTS')}": Function 's:hasRole' not found
             at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:76)
             at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:370)
             ... 53 more
            
            


            • 18. Re: Seam 1.2.1, AS 4.2.1, @Restricted method gives NoClassDe
              tynor

              In hopes that this is a clue to one of the Seam developers (specifically Michael Yuan who seems to have done quite a bit of porting to various new environments and may recognize the symptoms):

              I notice that with the above configuration, everything works as expected until I try to submit a form with validation problems -- so perhaps this is some bizzare interaction with Hibernate Validators?

              Help!

              • 19. Re: Seam 1.2.1, AS 4.2.1, @Restricted method gives NoClassDe
                tynor

                I dont know how i missed this the first time, but in fact, there was also a Facelets exception complaining about class loading.

                2007-08-01 17:24:11,602 ERROR [STDERR] java.lang.ClassNotFoundException: No ClassLoaders found for: org.jboss.seam.security.SecurityFunctions
                2007-08-01 17:24:11,602 ERROR [STDERR] at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:212)
                2007-08-01 17:24:11,602 ERROR [STDERR] at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:514)
                2007-08-01 17:24:11,602 ERROR [STDERR] at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:408)
                2007-08-01 17:24:11,602 ERROR [STDERR] at
                ...

                This is in fact almost identical symptoms to those described (and as far as I can tell never solved) at: http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4056730 (i.e., the security functions work some times, and fail after a submit - in my case, continue to work after some submits, but seem to fail when a Validator fails)

                • 20. Re: Seam 1.2.1, AS 4.2.1, @Restricted method gives NoClassDe
                  shane.bryzak

                  Can you try with the latest CVS version of Seam? I believe we made some changes after 1.2.1 to fix this.

                  • 21. Re: Seam 1.2.1, AS 4.2.1, @Restricted method gives NoClassDe
                    tynor

                    Thanks Shane,

                    I don't doubt that this is fixed in 2.0 or CVS latest, but I can't easily migrate my app to the new Seam config. I'd hoped to be able to do a partial migration of a still Seam 1.2.1-based app, but running with JSF 1.2 (we've had some problems that appear fixed by the newer JSF) - we'll eventually port the rest of the app to Seam 2.0, but we'll probaby have to wait for an official GA release.

                    Comments on Michael Yuan's blog and his success at porting his book's Seam 1.2.1 apps to Jboss 4.2 (http://www.michaelyuan.com/blog/2007/05/29/seam-book-examples-updated-to-jboss-as-420-ga) made me think this was possible. I'm no longer so sure -- too many others have reported this same classloader problem and I've seen no analysis / workarounds.

                    • 22. Re: Seam 1.2.1, AS 4.2.1, @Restricted method gives NoClassDe

                      Yeah, the problem with the examples for the book is that "security" is the last chapter to be added to the book just before it goes off to the printers. So, I did not have a runnable example application in the source code bundle to test out the security annotations. My apologies to my readers!

                      • 23. Re: Seam 1.2.1, AS 4.2.1, @Restricted method gives NoClassDe
                        tynor

                        All,

                        Good news: I just noticed that Chiral posted a followup to my post on Michael's blog explaining the bug and proposing a workaround:

                        http://www.michaelyuan.com/blog/2007/05/29/seam-book-examples-updated-to-jboss-as-420-ga

                        • 24. Re: Seam 1.2.1, AS 4.2.1, @Restricted method gives NoClassDe

                          I have seen this exception, but in my case is was always due to an error on my part and disappeared after I fixed it.

                          I am currently using Seam 1.2.1 on JBAS 4.2.1 in production.

                          I will switch to Seam 2.0 as soon as it comes out though.

                          1 2 Previous Next