users@glassfish.java.net

Spring component-scan problems in glassfish 3.0.1

From: <glassfish_at_javadesktop.org>
Date: Wed, 15 Sep 2010 19:36:54 PDT

I have an EAR project structured as such:

EAR/
       lib/ <-- contains all shared services between web apps
       web-module1.war/
                                WEB-INF/
                                              web.xml
                                              classes/

In web.xml I specify the spring context param to be "parentContextKey" and supply the "ear.context" as the name of the parent context bean.

In the EAR/lib folder I have a jar called "my-spring-config.jar" in which rests the "beanRefContext.xml". I've got Spring configured to component-scan from the base package of "com.mycomany.myteam.service", thus instructing Spring to scan all classes of that sub package for annotation based beans and make them available in the application context. This is to that I can share common services between different web modules.

When I deploy my EAR I get an IOException at com.sun.enterprise.loader.ASURLClassLoader$InternalURLStreamHandler.openConnection(ASURLClassLoader.java:1281), basically saying that the this.url which is "com/mycompany/myteam/service" doesn't match the foreign URL it found in a lower level in the same package. I can post a full stack trace if necessary.

The issue looks very similar to http://markmail.org/message/xnqlotqyxxf5u6ib
[Message sent by forum member 'catburgers']

http://forums.java.net/jive/thread.jspa?messageID=482899