8 Replies Latest reply on May 4, 2010 7:46 PM by Akhbar Falafel

    Is possoble to modify JBoss Rule security.drl file without full redeploy?

    gdfgd eqwe Novice

      Is possible to modify JBoss Rule security.drl file without full redeploy?


      thx.

        • 1. Re: Is possoble to modify JBoss Rule security.drl file without full redeploy?
          Stuart Douglas Master

          Have you tried using a rule agent:


              <drools:rule-agent name="securityRules" configuration-file="/META-INF/securityrules.properties" />
          
              <drools:managed-working-memory name="securityRulesWorkingMemory" auto-create="true" rule-base="#{securityRules}" />
          
          


          securityrules.properties


          newInstance=true
          dir=/rules/rule/directory
          name=SecurityRulesAgent
          poll=5
          
          


          • 2. Re: Is possoble to modify JBoss Rule security.drl file without full redeploy?
            gdfgd eqwe Novice

            Hy!
            thx.
            If I use rule agent, where do i place the security.drl file?

            • 3. Re: Is possoble to modify JBoss Rule security.drl file without full redeploy?
              Miloslav Vlach Novice

              Hello,


              I'm facing the seam problem. Only way to use reloadable security rules is the BRMS deployed in JBoss. But I will use the static file instead.


              Can you help me ?


              Thanks Mila

              • 4. Re: Is possoble to modify JBoss Rule security.drl file without full redeploy?
                gdfgd eqwe Novice

                HY! I solved this issue programatically.


                I remove rules with programatically:
                               Contexts.getSessionContext().remove(org.jboss.seam.security.ruleBasedPermissionResolver);
                Contexts.getSessionContext().remove(org.jboss.seam.security.defaultResolverChain);
                Contexts.getApplicationContext().remove(securityRules);

                • 5. Re: Is possoble to modify JBoss Rule security.drl file without full redeploy?
                  Akhbar Falafel Newbie

                  I tried implementing this, but it does not seem as though the security rules are being re-read once a change has been made.  I performed a permission check and passed, then made a change the rule that should cause it to fail, but it still passes.  Any idea what the problem is?

                  • 8. Re: Is possoble to modify JBoss Rule security.drl file without full redeploy?
                    Akhbar Falafel Newbie

                    I just tried the rules agent method.  I started my app, and performed an action that would trigger one of the rules.  Then, I made a small change to the rules file and performed the same action again.  I saw the rules agent being reloaded, but this time received the following exception when I tried to perform the action.  Any thoughts on what's going on?  I tried this on Seam 2.2...




                    Exception during request processing:
                    Caused by javax.el.ELException with message: java.lang.ClassCastException: org.drools.reteoo.RuleTerminalNode$TerminalNodeMemory cannot be cast to org.drools.reteoo.BetaMemory


                    org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:339)
                    org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:280)
                    org.jboss.el.parser.AstMethodSuffix.getValue(AstMethodSuffix.java:59)
                    org.jboss.el.parser.AstMethodSuffix.invoke(AstMethodSuffix.java:65)
                    org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
                    org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
                    org.jboss.seam.core.Expressions$2.invoke(Expressions.java:175)
                    org.jboss.seam.navigation.Pages.callAction(Pages.java:692)
                    org.jboss.seam.navigation.Pages.preRender(Pages.java:330)
                    org.jboss.seam.jsf.SeamPhaseListener.preRenderPage(SeamPhaseListener.java:561)
                    org.jboss.seam.jsf.SeamPhaseListener.beforeRenderResponse(SeamPhaseListener.java:472)
                    org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:148)
                    org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:118)
                    com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:214)
                    com.sun.faces.lifecycle.Phase.doPhase(Phase.java:96)
                    com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
                    javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
                    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                    org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                    org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
                    org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                    org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
                    org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                    org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                    org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                    org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                    org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                    org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
                    org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)
                    org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
                    org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
                    org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
                    org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
                    org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                    org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
                    org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                    org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
                    org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                    org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
                    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
                    org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
                    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
                    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
                    org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
                    org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
                    org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
                    java.lang.Thread.run(Thread.java:637)


                    Caused by java.lang.ClassCastException with message: org.drools.reteoo.RuleTerminalNode$TerminalNodeMemory cannot be cast to org.drools.reteoo.BetaMemory


                    org.drools.reteoo.JoinNode.assertObject(JoinNode.java:148)
                    org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:360)
                    org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:344)
                    org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:185)
                    org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:146)
                    org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1046)
                    org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1001)
                    org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:788)
                    org.jboss.seam.security.permission.RuleBasedPermissionResolver.hasPermission(RuleBasedPermissionResolver.java:105)
                    org.jboss.seam.security.permission.PermissionMapper.resolvePermission(PermissionMapper.java:80)
                    org.jboss.seam.security.Identity.hasPermission(Identity.java:612)
                    net.odyssi.corvus.services.impl.FriendRequestLocatorImpl.getByUniqueID(FriendRequestLocatorImpl.java:309)
                    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                    java.lang.reflect.Method.invoke(Method.java:597)
                    org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
                    org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)
                    org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
                    org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
                    org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                    org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
                    org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                    org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
                    org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                    org.jboss.seam.security.SecurityInterceptor.aroundInvoke(SecurityInterceptor.java:163)
                    org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                    org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
                    org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
                    org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
                    net.odyssi.corvus.services.impl.FriendRequestLocatorImpl$$javassistseam12.getByUniqueID(FriendRequestLocatorImpl$$javassistseam12.java)
                    net.odyssi.corvus.web.actions.FriendRequestProcessorAction.locateFriendRequest(FriendRequestProcessorAction.java:126)
                    net.odyssi.corvus.web.actions.FriendRequestProcessorAction.approveRequest(FriendRequestProcessorAction.java:69)
                    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                    java.lang.reflect.Method.invoke(Method.java:597)
                    org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
                    org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)
                    org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
                    org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
                    org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                    org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
                    org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                    org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
                    org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                    org.jboss.seam.security.SecurityInterceptor.aroundInvoke(SecurityInterceptor.java:163)
                    org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                    org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
                    org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
                    org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
                    net.odyssi.corvus.web.actions.FriendRequestProcessorAction$$javassistseam19.approveRequest(FriendRequestProcessorAction$$javassistseam19.java)
                    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                    java.lang.reflect.Method.invoke(Method.java:597)
                    org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:335)
                    org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:280)
                    org.jboss.el.parser.AstMethodSuffix.getValue(AstMethodSuffix.java:59)
                    org.jboss.el.parser.AstMethodSuffix.invoke(AstMethodSuffix.java:65)
                    org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
                    org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
                    org.jboss.seam.core.Expressions$2.invoke(Expressions.java:175)
                    org.jboss.seam.navigation.Pages.callAction(Pages.java:692)
                    org.jboss.seam.navigation.Pages.preRender(Pages.java:330)
                    org.jboss.seam.jsf.SeamPhaseListener.preRenderPage(SeamPhaseListener.java:561)
                    org.jboss.seam.jsf.SeamPhaseListener.beforeRenderResponse(SeamPhaseListener.java:472)
                    org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:148)
                    org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:118)
                    com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:214)
                    com.sun.faces.lifecycle.Phase.doPhase(Phase.java:96)
                    com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
                    javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
                    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                    org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                    org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
                    org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                    org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
                    org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                    org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                    org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                    org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                    org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                    org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
                    org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)
                    org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
                    org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
                    org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
                    org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
                    org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                    org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
                    org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                    org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
                    org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                    org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
                    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
                    org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
                    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
                    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
                    org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
                    org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
                    org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
                    java.lang.Thread.run(Thread.java:637)