How/where a truly global jar can be added in WildFly 8.x?
atijms Mar 27, 2015 4:56 PMThe JACC specification defines that a JACC provider can be integrated with a server by means of the following JVM parameters:
-Djavax.security.jacc.policy.provider=test.TestPolicy -Djavax.security.jacc.PolicyConfigurationFactory.provider=test.TestPolicyConfigurationFactory
In that case a jar containing these two classes should be put on the server's classpath. Unfortunately it's not entirely clear how to put something on that classpath in WildFly 8.x.
I tried the -cp option but this didn't work. Then I tried creating a global module, by putting a module.xml file in module/system/layers/base/test/main with the following content:
<module xmlns="urn:jboss:module:1.3" name="test"> <resources> <resource-root path="jacctest-0.0.1-SNAPSHOT.jar"/> </resources> <dependencies> </dependencies> </module>
And then defining a global module in standalone.xml:
<subsystem xmlns="urn:jboss:domain:ee:2.0"> <global-modules> <module name="test" slot="main" /> </global-modules>
But this too did not work. I additionally added the "test" dependency to picketbox's module.xml, but even this did not work.
Every time the result is that the classes are not available on the classpath resulting in the following exception:
java.lang.ClassNotFoundException: test.TestPolicy at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:423) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:356) at org.jboss.as.security.service.SecurityActions.loadClass(SecurityActions.java:95) at org.jboss.as.security.service.SecurityBootstrapService.start(SecurityBootstrapService.java:87)
Now I may get it to work by injecting the classes from the JACC provider in the picketbox jar, but it's a little extreme perhaps.
Is there any more straightforward place where a system wide jar can be put? All existing documentations only ever talks about making jars available to application deployments.