-
1. Re: Security.drl not read
lvdberg Sep 20, 2010 12:09 PM (in response to kmranganathan)Hi,
Check the relative path of the file and see if the DRL is inside a sub directory and change the components.xml definition if needed. The other thing is that it depends of the location of the file, if you have a WAR-deployment, I've found that the application cannot find resources in the classes dir of WEB-INF. I'am using EAR deployment, so I have solved by placing the file in another location, but for WAR there must be another solution.
Maybe somebody on this forum can help on the classpath problem with WAR (and for the comparable problem with jBPM for that matter)
Leo
-
2. Re: Security.drl not read
mdesignz Sep 20, 2010 3:32 PM (in response to kmranganathan)Not sure if you have a WAR or EAR deployment, but for an EAR deployment the following works for me:
<drools:rule-base name="securityRules"> <drools:rule-files> <value>/META-INF/security.drl</value> </drools:rule-files> </drools:rule-base> <security:rule-based-permission-resolver security-rules="#{securityRules}" />
and I have the security.drl file located in the META-INF directory of my EJB (same place as persistence.xml).
-
3. Re: Security.drl not read
kmranganathan Sep 21, 2010 9:25 AM (in response to kmranganathan)Hi,
I am having an ear deployment.
I tried having the drl both inside META-INF and also outside - both do not work...Also I tried having:
<security:rule-base name="securityRules" rule-files="/META-INF/security.drl"/>
instead of <drools:rule-base> tag - that also doesn't work...
What I can't understand is - there is absolutely nothing in the log that says the rules file was read - even if I type junk in the file it is ignored...
I am wondering if I am missing something... -
4. Re: Security.drl not read
mdesignz Sep 21, 2010 11:19 AM (in response to kmranganathan)Using the configuration I provided earlier, and JBoss 5.1.0.GA, I see the following in the logs when I start up:
18:37:44,174 INFO [STDOUT] 18:37:44,174 DEBUG [org.jboss.seam.contexts.Lifecycle] Session started 18:37:44,320 INFO [STDOUT] 18:37:44,320 DEBUG [org.jboss.seam.drools.RuleBase] parsing rules: /META-INF/security.drl 18:37:44,321 INFO [STDOUT] 18:37:44,321 DEBUG [org.jboss.seam.util.Resources] Loaded resource from context classloader: META-INF/security.drl
I would compare your configuration.xml file to that described in the Seam Reference PDF (section 15.6.9.2 in my copy).
Can't think of any reason why it shouldn't work if you're following this example.