I am working with legacy code based on:
- Seam 2.2.1
- JSF 1.2
- Richfaces 3.3.3
The app itself is running fine on a Wildfly 9.0.2, with some dependencies such as JSF 1.2 being used instead of the Wildfly 9.0.2 Defaults. The Arquillian configuration is running on a managed JBoss 7.2
Before moving this app to a newer technology stack, I need to write an extensive test Suite. I would like to use Arquillian for this purpose.
I managed to get some things to work already. However, for some tests I need to create an Identity and have Seam recognize me (the test) as a logged in user. This is where I am stuck.
Whatever I try, I get this exception:
ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/ISMS_Tool]] (http-/0:0:0:0:0:0:0:0:8180-2)
JBWEB000211: Session event listener threw exception:
org.jboss.seam.InstantiationException: Could not instantiate Seam component:
org.jboss.seam.security.ruleBasedPermissionResolver
at org.jboss.seam.Component.newInstance(Component.java:2170)
[jboss-seam-2.2.1.Final.jar:2.2.1.Final]
at org.jboss.seam.contexts.Contexts.startup(Contexts.java:304) [jboss-seam-2.2.1.Final.jar:2.2.1.Final]
Caused by: org.jboss.seam.InstantiationException: Could not instantiate Seam component: securityRules
Caused by: java.lang.NullPointerException
at org.drools.base.evaluators.EvaluatorRegistry.addEvaluatorDefinition(EvaluatorRegistry.java:155) [drools-core-5.6.0.Final.jar:5.6.0.Final]
[I am mostly using code from this repository]https://github.com/omidp/seam/tree/master/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/security
The SecurityTest.java is what I'm trying to get to work here.
The following code will solve the problem above. I hope it may be useful for other developers working with legacy applications.
}