« Return to Thread: Interaction of red5-0.7/jetty, Spring and classloader

Interaction of red5-0.7/jetty, Spring and classloader

by Jack Punt :: Rate this Message:

Reply to Author | View in Thread

Help! I need some expert guidance and explanation.

My app has two components, a red5 flash service and a normal web application.
Both are installed in the red5/webapps directory, and everything works.
But: they both share a common library for data access and login security.
And that library is compiled with Spring-2.5.4 and Spring-security-2.0.4 and Hibernate.

The webapp part has no problems, it deploys with all its jar files and life is good.
The red5app gets confused, presumably because
Red5WebPropertiesConfiguration uses _context.setParentLoaderPriority(false);
[per servlet spec: prefer red5/lib/*.jar before webapps/WEB-INF/lib/*jar]

So, even if the correct jars are in the .war, the classloader prefers the older versions in red5/lib.
[and the other problems if a class is found by different paths in both classloaders...]
[JettyApplicationLoader uses context.setParentLoaderPriority(true); that saves the webapp?]

No problem: replace the spring-*2.0.8.jars with spring-2.5.4.jar and its friends.
But then red.sh dies immediately in Standalone.java(153): NoClassDefFoundError:  org/springframework/context/access/ContextSingletonBeanFactoryLocator.
[which is, of course, in lib/spring-2.5.4.jar; and this on linux, so is not a problem with wrapper.conf]

Strangely, if I: ln -s spring-2.5.4.jar spring-context-2.0.8.jar, then it starts. [and fails for other reasons]
How/why is red5 looking for this particular jar file by that particular name??
One normally expects Java to search all the .jars, no?

 « Return to Thread: Interaction of red5-0.7/jetty, Spring and classloader