Hello all,
Here is my business/technical need. I need to be able to take advantage of JBoss SSO and clustering. I would also like to take advantage of Acegi. As far as I know, the only way to do both is to use the JBoss Acegi adapter. I am using that, and my simple example works.
My Problem:
The simple example has Acegi, Acegi-jboss and Spring in the jboss/mysetup/lib dir (nothing in WEB-INF/lib). This works fine and all is well.
However in real life, I also use Spring in my business layer. This layer introduces a zillion other IOC dependencies, and I'd like these guys versioned with my application and not shared across everyone in jboss/mysetup/lib.
If I keep everything out of jboss/mysetup/lib and instead keep everything in WEB-INF/lib it works...for the first application. The application that contains the login form has no trouble authenticating. However the other applications that are benefitting from JBoss SSO now have trouble because the JbossIntegrationFilter in App2 is no longer works. I assume this is because of classloader issues and the App2 JbossIntegrationFilter not being able to understand objects generated by App1 (the main login app).
This puts me in kind of a bind. Either forget about versioning my business layer libs (which I don't like). Or not use JBoss SSO (which I can't do).
I tried to meet in the middle. Only put the acegi* stuff in jboss/mysetup/lib. However they reference a Spring event class, and that pulls in the whole thing. I tried having Spring in both jboss/mysetup/lib and WEB-INF/lib. This causes a problem with Spring's ApplicationContext.
My guess here is that Spring tries to share its context, or have a single common context and manage sharing internally. This doesn't seem to work well if your context already exists but isn't of an object your classloader understands.Code:11:47:08,565 ERROR [[/main]] Exception sending context initialized event to listener instance of class net.sf.acegisecurity.ui.session.HttpSessionEventPublisher java.lang.IllegalStateException: Root context attribute is not of type WebApplicationContext: org.springframework.web.context.support.XmlWebApplicationContext: display name [Root WebApplicationContext]; startup date [Wed Aug 31 11:47:07 PDT 2005]; root of context hierarchy; config locations [/WEB-INF/applicationContext-acegi-security.xml] at org.springframework.web.context.support.WebApplicationContextUtils.getWebApplicationContext(WebApplicationContextUtils.java:64) at org.springframework.web.context.support.WebApplicationContextUtils.getRequiredWebApplicationContext(WebApplicationContextUtils.java:81) at net.sf.acegisecurity.ui.session.HttpSessionEventPublisher.contextInitialized(HttpSessionEventPublisher.java:73)
Could someone with greater Acegi + Spring experience help me out?
Thanks,
Jim


