-
1. Re: Seam 1.2.1, AS 4.2.1, @Restricted method gives NoClassDe
smokingapipe Jul 30, 2007 1:32 AM (in response to smokingapipe)I looked some more and the missing class is defined in el-ri.jar . But I thought that that jar should no longer be used in JBoss 4.2.1. This means that some Seam class is compiled to look for the com.sun.el.ExpressionFactoryImpl class. Is there a work-around for this?
Everything else is working. On my UI elements, I can put security restrictions on them. It's only throwing this when I invoke a method which is @Restricted.
Thanks -
2. Re: Seam 1.2.1, AS 4.2.1, @Restricted method gives NoClassDe
smokingapipe Jul 30, 2007 2:02 AM (in response to smokingapipe)And it looks like the problem is in org.jboss.seam.util.EL:
import com.sun.el.ExpressionFactoryImpl; import com.sun.el.lang.VariableMapperImpl;
which means that Seam is still dependent on the Sun EL RI, while JBoss AS has switched, and packaging the Sun RI in the EAR causes problems apparently.
Any ideas would be welcome. -
3. Re: Seam 1.2.1, AS 4.2.1, @Restricted method gives NoClassDe
smokingapipe Jul 30, 2007 2:05 AM (in response to smokingapipe)Further checking, the Sun RI is used in only two files in Seam:
./main/org/jboss/seam/util/EL.java:import com.sun.el.ExpressionFactoryImpl; ./main/org/jboss/seam/util/EL.java:import com.sun.el.lang.VariableMapperImpl; ./main/org/jboss/seam/jsf/SeamELFunctionMapper.java:import com.sun.el.lang.FunctionMapperImpl;
I think I'm at an impasse here, and will simply remove the @Restricted declarations at this point, and rely on the UI elements to prevent unauthorized use until this can be fixed. This is for an internal use thing with a very small user group at this point, for testing, not real deployment, so that's a reasonable decision for Right Now. -
4. Re: Seam 1.2.1, AS 4.2.1, @Restricted method gives NoClassDe
norman.richards Jul 30, 2007 10:48 AM (in response to smokingapipe)I think you may need to have that JAR around.
FWIW, this all works fine in the upcoming Seam 1.3. -
5. Re: Seam 1.2.1, AS 4.2.1, @Restricted method gives NoClassDe
smokingapipe Jul 30, 2007 12:50 PM (in response to smokingapipe)"norman.richards@jboss.com" wrote:
I think you may need to have that JAR around.
It seems like that jar would mess up other things. Reading Michael Yuan's blog:
http://www.michaelyuan.com/blog/2007/05/29/seam-book-examples-updated-to-jboss-as-420-ga/
There is now a JIRA open on it:
http://jira.jboss.org/jira/browse/JBSEAM-1740"norman.richards@jboss.com" wrote:
FWIW, this all works fine in the upcoming Seam 1.3.
Wait, isn't Seam 1.3 gone, replaced by Seam 2.0? I'm sort of tempted to switch to 2.0 right now but this is for something that needs to be in production use fairly soon and I'm not thrilled to deploy on beta software versions. -
6. Re: Seam 1.2.1, AS 4.2.1, @Restricted method gives NoClassDe
norman.richards Jul 30, 2007 1:15 PM (in response to smokingapipe)Yes - Seam 2.0. I got confused. :)
-
7. Re: Seam 1.2.1, AS 4.2.1, @Restricted method gives NoClassDe
smokingapipe Jul 30, 2007 2:36 PM (in response to smokingapipe)By the way this shows why classes which are not public should not be labeled public. My guess is that com.sun.el.*Impl should have default permissions so external projects couldn't specify them directly.
-
8. Re: Seam 1.2.1, AS 4.2.1, @Restricted method gives NoClassDe
michael.yuan Jul 30, 2007 2:40 PM (in response to smokingapipe)
It seems like that jar would mess up other things. Reading Michael Yuan's blog:
Let me clarify: the el-*.jar entires in application.xml mess up things. It does not hurt to leave the JARs in the EAR/WAR classpath -- at least this is what I think ...
cheers
Michael -
9. Re: Seam 1.2.1, AS 4.2.1, @Restricted method gives NoClassDe
smokingapipe Jul 30, 2007 3:18 PM (in response to smokingapipe)When I put the jars in the war/WEB-INF/lib, I get:
SEVERE: Error Rendering View[/index.xhtml] com.sun.facelets.FaceletException: Could not instantiate feature[compiler.ExpressionFactory]: org.jboss.seam.ui.facelet.SeamExpressionFactory at com.sun.facelets.compiler.Compiler.featureInstance(Compiler.java:154) at com.sun.facelets.compiler.Compiler.createExpressionFactory(Compiler.java:128) at com.sun.facelets.impl.DefaultFaceletFactory.createFacelet(DefaultFaceletFactory.java:198)
It totally breaks it. -
10. Re: Seam 1.2.1, AS 4.2.1, @Restricted method gives NoClassDe
michael.yuan Jul 30, 2007 3:29 PM (in response to smokingapipe)Can you try to put just the implementation classes not the interfaces in the lib dir? Thanks.
-
11. Re: Seam 1.2.1, AS 4.2.1, @Restricted method gives NoClassDe
smokingapipe Jul 30, 2007 4:05 PM (in response to smokingapipe)I put el-ri.jar in the WEB-INF/lib, and got the same "java.lang.NoClassDefFoundError: com/sun/el/ExpressionFactoryImpl".
I then put the el-ri.jar directly in the ear, and added it as a module in application.xml, and... it works! I tested it and it lets me run the restricted factory method. I then changed it from @Restrict("#{s:hasRole('admin')}") to @Restrict("#{s:hasRole('thisRoleDoesNotExist')}") , logged in as admin, and tried to access that factory, and got:Authorization check failed for expression [#{s:hasRole('thisRoleDoesNotExst')}]
as I expected. So this fix seems to work, so far, and lets me keep working on this.
I'll be keeping my eyes open for Seam 1.2.2 or whatever, where hopefully this dependency will be gone. -
12. Re: Seam 1.2.1, AS 4.2.1, @Restricted method gives NoClassDe
michael.yuan Jul 30, 2007 4:12 PM (in response to smokingapipe)SmokingAPipe,
Is this AS 4.2.1 GA?
Thanks
cheers
Michael -
13. Re: Seam 1.2.1, AS 4.2.1, @Restricted method gives NoClassDe
smokingapipe Jul 30, 2007 4:22 PM (in response to smokingapipe)Yes, it's AS 4.2.1 GA.
Release ID: JBoss [Trinity] 4.2.1.GA (build: SVNTag=JBoss_4_2_1_GA date=200707131605)
-
14. Re: Seam 1.2.1, AS 4.2.1, @Restricted method gives NoClassDe
smokingapipe Jul 30, 2007 4:23 PM (in response to smokingapipe)Built on Friday the 13th, note!