Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Spring Security
Spring Security [message #647053] Tue, 04 January 2011 11:53 Go to next message
Eva Troels is currently offline Eva TroelsFriend
Messages: 17
Registered: December 2010
Junior Member
Hi!
I have successfully deployed a web app on Virgo 2.1.0.
All my bundles are installed and started successfully and in my log I see the url mappings to my controller classes.
I have configured Spring Security 3.0.2.
When I access my application in my browser, I expect to be forwarded to the login page.
But I get a:

[2011-01-04 12:49:02.171] http-8080-1                  System.err                                                        04-01-2011 12:49:02 org.apache.catalina.core.StandardWrapperValve invoke 
[2011-01-04 12:49:02.187] http-8080-1                  System.err                                                        SEVERE: Servlet.service() for servlet default threw exception 
[2011-01-04 12:49:02.187] http-8080-1                  System.err                                                        java.lang.LinkageError: loader constraint violation: when resolving field "logger" the class loader (instance of org/eclipse/virgo/kernel/userregion/internal/equinox/KernelBundleClassLoader) of the referring class, org/springframework/web/filter/GenericFilterBean, and the class loader (instance of org/eclipse/virgo/kernel/userregion/internal/equinox/KernelBundleClassLoader) for the field's resolved type, org/apache/commons/logging/Log, have different Class objects for that type 
[2011-01-04 12:49:02.187] http-8080-1                  System.err                                                        	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:61) 
[2011-01-04 12:49:02.187] http-8080-1                  System.err                                                        	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355) 
[2011-01-04 12:49:02.187] http-8080-1                  System.err                                                        	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:149) 
[2011-01-04 12:49:02.187] http-8080-1                  System.err                                                        	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237) 
[2011-01-04 12:49:02.187] http-8080-1                  System.err                                                        	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167) 
[2011-01-04 12:49:02.187] http-8080-1                  System.err                                                        	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 
[2011-01-04 12:49:02.296] http-8080-1                  System.err                                                        	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
[2011-01-04 12:49:02.296] http-8080-1                  System.err                                                        	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) 
[2011-01-04 12:49:02.296] http-8080-1                  System.err                                                        	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) 
[2011-01-04 12:49:02.296] http-8080-1                  System.err                                                        	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) 
[2011-01-04 12:49:02.296] http-8080-1                  System.err                                                        	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) 
[2011-01-04 12:49:02.296] http-8080-1                  System.err                                                        	at org.eclipse.virgo.web.tomcat.ApplicationNameTrackingValve.invoke(ApplicationNameTrackingValve.java:29) 
[2011-01-04 12:49:02.296] http-8080-1                  System.err                                                        	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:555) 
[2011-01-04 12:49:02.296] http-8080-1                  System.err                                                        	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 
[2011-01-04 12:49:02.296] http-8080-1                  System.err                                                        	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) 
[2011-01-04 12:49:02.296] http-8080-1                  System.err                                                        	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857) 
[2011-01-04 12:49:02.296] http-8080-1                  System.err                                                        	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) 
[2011-01-04 12:49:02.296] http-8080-1                  System.err                                                        	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) 
[2011-01-04 12:49:02.296] http-8080-1                  System.err                                                        	at java.lang.Thread.run(Thread.java:619) 


What is going on here?
Re: Spring Security [message #647060 is a reply to message #647053] Tue, 04 January 2011 12:31 Go to previous messageGo to next message
Hristo Iliev is currently offline Hristo IlievFriend
Messages: 156
Registered: May 2010
Location: Sofia, Bulgaria
Senior Member

According to the JavaDoc: "LinkageError indicate that a class has some dependency on another class; however, the latter class has incompatibly changed after the compilation of the former class."

Do you have Spring binaries bundled in your web application? It seems so from the stacktrace (Spring security?).
Re: Spring Security [message #647061 is a reply to message #647060] Tue, 04 January 2011 12:42 Go to previous messageGo to next message
Eva Troels is currently offline Eva TroelsFriend
Messages: 17
Registered: December 2010
Junior Member
I put the spring security binaries in the 'usr' folder.
Do you (or anyone??) have an example of spring security on virgo?
Re: Spring Security [message #647063 is a reply to message #647060] Tue, 04 January 2011 12:53 Go to previous messageGo to next message
Eva Troels is currently offline Eva TroelsFriend
Messages: 17
Registered: December 2010
Junior Member
Now it works!
I added org.springframework.security.web;version="[3.0.1, 3.1)",
org.springframework.security.core;version="[3.0.1, 3.1)"
to the Import-Bundle list and dropped a couple of extra jars into the 'usr' folder (com.springsource.org.apache.log4j-1.2.15.jar and com.springsource.slf4j.log4j-1.5.10.jar).

Not quite sure what did the trick.
But I am not going to mess around with it to find out Razz
Re: Spring Security [message #647067 is a reply to message #647053] Tue, 04 January 2011 13:07 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
I'm glad the problem is solved. If you want to get to the bottom of the problem, read on.

The loader constraint violation shows that two bundles are picking up different versions of the class org.apache.commons.logging.Log. I haven't seen that issue before in Virgo. The crux of this issue is which class loaders are being used to load the different versions of the class. If you want to investigate with a debugger, try to find the defining class loaders for the two class instances, although you'll need a good understanding of class loading to make progress.

Alternatively, if you can package up a (simple) test that reproduces the problem, please raise a bug for us to look into.

[Updated on: Tue, 04 January 2011 13:11]

Report message to a moderator

Re: Spring Security [message #647149 is a reply to message #647067] Tue, 04 January 2011 18:28 Go to previous messageGo to next message
Hristo Iliev is currently offline Hristo IlievFriend
Messages: 156
Registered: May 2010
Location: Sofia, Bulgaria
Senior Member

Can this be caused by having different version of com.springsource.slf4j.org.apache.commons.logging in usr?
Re: Spring Security [message #647226 is a reply to message #647149] Wed, 05 January 2011 08:41 Go to previous message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
Perhaps, but I think this would need to be combined with something like a missing uses constraint as well.
Previous Topic:Eclipse Virgo vs. Apache Karaf
Next Topic:Is it possible to use two different versions from single DM bundle?
Goto Forum:
  


Current Time: Sun Dec 08 09:32:53 GMT 2024

Powered by FUDForum. Page generated in 0.04356 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top