I'm running Eclipse with the run-jetty-run plugin to launch my J2EE web apps. My project uses Spring, and the spring configuration uses things like HttpInvokerProxy and properties placeholder.
- When the spring jars are on the classpath (I mean configured in the "classpath" tab of the "run configuration") and external (not in WEB-INF/lib), everything works fine.
- But when I place spring.jar (or all spring jars) in the WEB-INF/lib/ directory (+referenced in the classpath), the trouble starts. I tried with both values of Jetty's parentLoaderPriority:
- when parentLoaderPriority is
true
, I get a complaint of Xerces saying it can't validate the spring.xml's XSD (so I guess Jetty's embedded different version of xerces conflicting with mine) - when parentLoaderPriority is
false
, the property placeholder doesn't work anymore and (I tried replacing with the direct values) Spring also fails to convert the HttpInvokerProxy into the correct interface, like some classes are missing
- when parentLoaderPriority is
- Finally, when I leave all my jars in WEB-INF/lib and remove the matching classpath entries, it can't find the classes: I get a ClassDefNotFoundException com/google/common/collect/Lists although google-collections.jar is in WEB-INF/lib and contains the class file... This with both values of parentLoaderPriority.
Method #3 works fine in Tomcat, though. So I guess this jetty launcher has some classloading configuration I'm doing wrong ?