[jboss-user] [Security & JAAS/JBoss] - Class Loading Problem of LoginModule from MBean/SAR File

tine2k do-not-reply at jboss.com
Thu Apr 17 04:43:49 EDT 2008


Hi guys,

I have a problem that has kept frustrating me over some time now. I have the following situation:
I deploy a .sar file to my JBoss AS (4.0.5GA) containing an MBean that makes use of JBoss JAAS Security by calling

  | LoginContext lc = new LoginContext("myJaas");
  | lc.login();
  | 
The JAAS application policy is configured in my conf/login-config.xml like this:

  | 	<application-policy name="myJaas">
  | 		<authentication>
  | 			<login-module code="mypackage.MyLoginModule" flag="required" />
  | 		</authentication>
  | 	</application-policy>
  | 
Other than that, I have nothing changed in the default configuration of my JBoss. I am using the 'default' instance. 

When the MBean calls the snippet above I receive the following error:

  | javax.security.auth.login.LoginException: unable to find LoginModule class: myPackage.MyLoginModule
  |      at javax.security.auth.login.LoginContext.invoke(LoginContext.java:808)
  |      at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
  |      at javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)
  |      at java.security.AccessController.doPrivileged(Native Method)
  |      at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
  |      at javax.security.auth.login.LoginContext.login(LoginContext.java:579)
  | 

I am pretty sure it is a class loading problem because I CAN load the class fine the when I put the jar containing myPackage.MyLoginModule an the classpath using JBOSS_CLASSPATH system variable.
Every other attempt to put this jar in the lib-dir of JBoss or the default instance has failed. Likewise, the same error occurs when I package the jar along with my sar-File.

What am I missing? Is it even possible to use the JBoss JAAS config from an MBean? Do you have any other ideas how I can use JAAS from an MBean? 

Thank you
Martin

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4144761#4144761

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4144761



More information about the jboss-user mailing list