[jboss-user] [JBoss Seam] - no such setter method: org.jboss.seam.security.Identity.secu

jbeaken do-not-reply at jboss.com
Thu Aug 16 07:36:25 EDT 2007


Hello,

I hope someone can help me on this issue. I am using JBoss AS 4.2.1, Seam 1.2.1GA. I wish to use jboss rules security as defined in components.xml: 

   <drools:rule-base name="securityRules">
       <drools:rule-files> 
           /security.drl
       </drools:rule-files>
   </drools:rule-base>

   <security:identity authenticate-method="#{authenticator.authenticate}"
                           security-rules="#{securityRules}"/>

If I package the security jars 

drools-compiler-3.0.5.jar
drools-core-3.0.5.jar
commons-jci-core-1.0-406301.jar
commons-jci-janino-2.4.3.jar
commons-lang-2.1.jar
janino-2.4.3.jar
stringtemplate-2.3b6.jar
antlr-2.7.6.jar
antlr-3.0ea8.jar

in the ear application I get the following exception on startup:


java.lang.RuntimeException: Could not create Component: org.jboss.seam.security.identity
        at org.jboss.seam.init.Initialization.addComponent(Initialization.java:865)
        at org.jboss.seam.init.Initialization.installComponents(Initialization.java:796)
        at org.jboss.seam.init.Initialization.init(Initialization.java:503)
        at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:33)
        at org.apache.catalina.core.StandardContext.listenerStart
..
..

Caused by: java.lang.IllegalArgumentException: no such setter method: org.jboss.seam.security.Identity.securityRules
        at org.jboss.seam.util.Reflections.getSetterMethod(Reflections.java:219)
        at org.jboss.seam.Component.initInitializers(Component.java:401)
        at org.jboss.seam.Component.(Component.java:263)
        at org.jboss.seam.Component.(Component.java:203)
        at org.jboss.seam.init.Initialization.addComponent(Initialization.java:851)

If I move the jar files into Jboss4.2.1/server/default/lib, the application startups with no problems. But then throws the following runtime exception :

org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.security.identity
        at org.jboss.seam.Component.newInstance(Component.java:1740)
        at org.jboss.seam.contexts.Lifecycle.startup(Lifecycle.java:175)
        at org.jboss.seam.contexts.Lifecycle.beginSession(Lifecycle.java:235)
        at org.jboss.seam.servlet.SeamListener.sessionCreated(SeamListener.java:41)
        at org.apache.catalina.session.StandardSession.tellNew(StandardSession.java:397)
..
..
Caused by: org.drools.rule.InvalidRulePackage: Unable to create Field Extractor for 'name'
Unable to create Field Extractor for 'action'
Unable to create Field Extractor for 'name'
Rule Compilation error File Permissions/Rule_CanUserViewAllUsers_0.java, Line 10, Column 16: Expression "c.grant()" is not a type

        at org.drools.rule.Package.checkValidity(Unknown Source)
        at org.drools.common.AbstractRuleBase.addPackage(Unknown Source)
        at org.jboss.seam.drools.RuleBase.compileRuleBase(RuleBase.java:70)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(
        ... 52 more
..
..


In regards of the second exception, here is my security.drl

package Permissions;

import java.security.Principal;

import org.jboss.seam.security.PermissionCheck;
import org.jboss.seam.security.Role;

rule CanUserViewAllUsers
when
  c: PermissionCheck(name == "userManager", action == "getAllUsers")
  Role(name == "admin")
then
	c.grant()
end;
Any help would be much apprecitated!



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4074805#4074805

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4074805



More information about the jboss-user mailing list