[JBoss Seam] - Problem w/ 1.1.6 example Security Rules
by JohnEChesher
I had a working Seam 1.1.6 application to which I added the jars and configuration to implement Seam Security, per the 1.1.6 reference doc. Just to see if everything was configured properly, before I configured any application specific rules, I used the security.drl file from the example in the ref doc:
package MyApplicationPermissions;
import org.jboss.seam.security.PermissionCheck;
import org.jboss.seam.security.Role;
rule CanUserDeleteCustomers
when
c: PermissionCheck(name == "customer", action == "delete")
Role(name == "admin")
then
c.grant()
end;
JBoss AS startup looks fine, but when my browser tries to load the first page of the app, I get the following error below about "c.grant() not a type". FYI, I have no permission checks in the page my browser is loading. (and in fact, it finally loads OK) Can anyone provide insight into the error below and, even better, provide some example Seam-Drools code that is doing permission checks, so that maybe I have something better to work with. I am new to drools/JBoss Rules and, other than the Seam Ref Doc, I cannot find any references to Seam Security Drools code doing PermissionChecks...
Thanks!
Here's the error:
08:21:05,500 INFO [Lifecycle] starting up: org.jboss.seam.security.identity
08:21:07,625 ERROR [STDERR] Warning: An error occurred compiling a semantic invoker. Errors should have been reported elsewhere.
08:21:07,687 ERROR [[/]] Session event listener threw exception
org.drools.rule.InvalidRulePackage: Rule Compilation error File MyApplicationPermissions/Rule_CanUserDeleteCustomers_0.java, Line 9, 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(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:102)
at org.jboss.seam.Component.callComponentMethod(Component.java:1835)
at org.jboss.seam.Component.callCreateMethod(Component.java:1783)
at org.jboss.seam.Component.newInstance(Component.java:1772)
at org.jboss.seam.Component.getInstance(Component.java:1669)
at org.jboss.seam.Component.getInstance(Component.java:1636)
at org.jboss.seam.security.Identity.initSecurityContext(Identity.java:109)
at org.jboss.seam.security.Identity.create(Identity.java:84)
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:585)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:102)
at org.jboss.seam.Component.callComponentMethod(Component.java:1835)
at org.jboss.seam.Component.callCreateMethod(Component.java:1783)
at org.jboss.seam.Component.newInstance(Component.java:1772)
at org.jboss.seam.contexts.Lifecycle.startup(Lifecycle.java:163)
at org.jboss.seam.contexts.Lifecycle.beginSession(Lifecycle.java:223)
at org.jboss.seam.servlet.SeamListener.sessionCreated(SeamListener.java:41)
at org.apache.catalina.session.StandardSession.tellNew(StandardSession.java:384)
at org.apache.catalina.session.StandardSession.setId(StandardSession.java:356)
at org.apache.catalina.session.ManagerBase.createSession(ManagerBase.java:824)
at org.apache.catalina.session.StandardManager.createSession(StandardManager.java:290)
at org.apache.catalina.connector.Request.doGetSession(Request.java:2223)
at org.apache.catalina.connector.Request.getSession(Request.java:2024)
at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:831)
at org.apache.myfaces.context.servlet.ServletExternalContextImpl.getSession(ServletExternalContextImpl.java:197)
at org.jboss.seam.contexts.ContextAdaptor.getSession(ContextAdaptor.java:42)
at org.jboss.seam.contexts.Lifecycle.beginRequest(Lifecycle.java:42)
at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:53)
at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersBefore(PhaseListenerManager.java:70)
at org.apache.myfaces.lifecycle.LifecycleImpl.restoreView(LifecycleImpl.java:103)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:66)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4021093#4021093
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4021093
19Â years, 2Â months
[Clustering/JBoss] - Re: Pooling in Buddy Replication
by manik.surtaniï¼ jboss.com
anonymous wrote :
| It seems here that application has data backed up on node3 and node4 (which are from pool2)
|
What makes you think this is the case? A good way to tell is to use the JMX console on each node and dump cache contents to see where the data is and where the backups are.
In your scenario, you have:
Pool1: node1, node2
Pool2: node3, node4
When you use the app (assume you start on node2 as your example suggests) your state is backed up on node1 since it is in the same pool.
When you kill node2, your app continues to work since the state is available on node1.
Now node1 NEEDS a new backup node. Since there are no other nodes in pool1, it is forced to pick a node from elsewhere (such as in pool2).
Basically, these pools are only _hints_ on how to select a backup node. The algorithm is:
1) Try and select buddy from same pool, on different host.
2) Else, try and select buddy from same pool, on same host.
3) Else, try and select buddy from different pool, on different host.
4) Else, try and select buddy from different pool, on same host.
5) Finally fall back to no buddy.
See NextMemberBuddyLocator.locateBuddies() for details of how this is implemented.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4021080#4021080
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4021080
19Â years, 2Â months
[JBoss Seam] - Re: Seam & Maven2
by fip
Thanks for your reply, fers, I deleted the jboss artifacts from my repository an created a new project using your archetype. Now I get a bit further but run into another exception, is there anything else that might not be up-to-date and should be deleted from the local repository?
org.apache.maven.lifecycle.LifecycleExecutionException: Failure
| at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:559)
| at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:488)
| at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:458)
| at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:306)
| at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273)
| at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:140)
| at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:393)
| at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:182)
| at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:747)
| at org.apache.maven.cli.MavenCli.main(MavenCli.java:380)
| 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:585)
| at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
| at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
| at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
| at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
| Caused by: org.apache.maven.plugin.MojoExecutionException: Failure
| at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:340)
| at org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:272)
| at org.mortbay.jetty.plugin.AbstractJettyRunMojo.execute(AbstractJettyRunMojo.java:177)
| at org.mortbay.jetty.plugin.Jetty6RunMojo.execute(Jetty6RunMojo.java:183)
| at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:417)
| at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:534)
| ... 17 more
| Caused by: java.lang.IllegalStateException: Failed to create schema loader: org.apache.xerces.dom.DOMXSImplementationSourceImpl
| at org.jboss.xb.binding.Util.getXSImplementation(Util.java:420)
| at org.jboss.xb.binding.Util.loadSchema(Util.java:269)
| at org.jboss.xb.binding.sunday.unmarshalling.XsdBinder.bind(XsdBinder.java:103)
| at org.jboss.xb.binding.sunday.unmarshalling.XsdBinder.bind(XsdBinder.java:90)
| at org.jboss.kernel.plugins.deployment.xml.BeanSchemaBinding.readXsd(BeanSchemaBinding.java:997)
| at org.jboss.kernel.plugins.deployment.xml.BeanSchemaBinding.getSchemaBinding(BeanSchemaBinding.java:211)
| at org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer.<init>(BeanXMLDeployer.java:34)
| at org.jboss.kernel.plugins.bootstrap.standalone.StandaloneBootstrap.bootstrap(StandaloneBootstrap.java:65)
| at org.jboss.kernel.plugins.bootstrap.AbstractBootstrap.run(AbstractBootstrap.java:87)
| at org.jboss.kernel.plugins.bootstrap.standalone.StandaloneBootstrap.main(StandaloneBootstrap.java:46)
| at org.jboss.seam.core.Microcontainer.startup(Microcontainer.java:31)
| 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:585)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
| at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:102)
| at org.jboss.seam.Component.callComponentMethod(Component.java:1835)
| at org.jboss.seam.Component.callCreateMethod(Component.java:1783)
| at org.jboss.seam.Component.newInstance(Component.java:1772)
| at org.jboss.seam.contexts.Lifecycle.startup(Lifecycle.java:163)
| at org.jboss.seam.contexts.Lifecycle.startup(Lifecycle.java:156)
| at org.jboss.seam.contexts.Lifecycle.endInitialization(Lifecycle.java:135)
| at org.jboss.seam.init.Initialization.init(Initialization.java:452)
| at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:33)
| at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:450)
| at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1129)
| at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:420)
| at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:457)
| at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:38)
| at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:156)
| at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:120)
| at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:38)
| at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:156)
| at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:38)
| at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:119)
| at org.mortbay.jetty.Server.doStart(Server.java:210)
| at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:38)
| at org.mortbay.jetty.plugin.Jetty6PluginServer.start(Jetty6PluginServer.java:134)
| at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:327)
| ... 22 more
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4021077#4021077
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4021077
19Â years, 2Â months