users@glassfish.java.net

Server Auth Module (SAM) and osgi bundles

From: <forums_at_java.net>
Date: Tue, 5 Apr 2011 16:31:30 -0500 (CDT)

I have a simple war deployed as a bundle (wab) and I want to configure SAM
for it.
So I followed the instructions here [1] , wrote a custom SAM, defined it in
my domain.xml and configured sun-web.xml in my war. I packaged my sam in a
jar and put under domain/domain1/lib.
This works fine in simple war (i.e - all requests go through my sam).
This *doesn't* work for a bundle. I can see this warning in the log
"jmac.provider_unable_to_load_authmodule", with no detailed exception. I
googled it and it is thrown upon failure to instantiate the auth module using
class.forName.
The solution that worked for me was to add my custom sam to the bundle's
WEB-INF/lib (and add the corresponding entry in the manifest's classpath
entry). The problem is that it's not ideal because it means that I need to
copy my sam (and all its depenencies...) to each of the wars I want to use it
in. Idealy, it should be located in some main lib which is accessible by all
bundles.
My question is what are the alternatives and what is the recommended way do
it when using bundles?
Thanks
 


[1] http://download.oracle.com/docs/cd/E19798-01/821-1752/gizel/index.html

--
[Message sent by forum member 'Karo']
View Post: http://forums.java.net/node/789008