Hello friends,
I have a GWT-Application split in 2 eclipse-projects, both being managed by Maven 2.2 and the m2eclipse-Plugin 0.12.
P1: Web-Application-Project (-> .war)
P2: Simple Java Project (->.jar).
P1 references P2 through a Maven-Dependency which all seems to work fine.
So my problem is as follows:
P1 declares a Dispatcher-Servlet "spring-web" in web.xml:
Because of this declaration Spring is going to consume my following configuration-file "spring-web-servlet.xml" which looks as follows:HTML Code:<servlet> <servlet-name>spring-web</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> </servlet>
SpringCommandServiceServlet should create Beans from some @Component-annotated Classes that are placed in P2 (Package "wwi.server.action"). Therefore I want to use the component-scanning Feature in this spring-configuration. Sadly, the Beans are not being created by Spring.HTML Code:<?xml version="1.0" encoding="UTF-8"?> <beans> <context:component-scan base-package="wwi.server.action" /> <bean id="commandService" class="de.wwag.common.ui.gwt.command.server.SpringCommandServiceServlet" /> <!-- no 'id' required, HandlerMapping beans are automatically detected by the DispatcherServlet --> <bean class="de.wwag.common.ui.gwt.command.server.handler.GWTRPCHandlerMapping"> <property name="mappings"> <map> <entry key="/GwtApp/command" value-ref="commandService" /> </map> </property> </bean>
When initalizing the Spring-Context I see the following Log-Statement:
When building the final war-File everything works fine. Only when using the "Run as Webapplication" the component-scan does absolutely nothing2012-02-10 16:54:39,968 DEBUG [btpool0-0] [-721bc142:13567f915a7:-7ffe] support.PathMatchingResourcePatternResolver (PathMatchingResourcePatternResolver.java:353) - Resolved location pattern [classpath*:wwi/server/action/**/*.class] to resources []
I've also looked in the resultating WAR- and JAR-Files which all looked as expected.
What kind of problem could that be? Some kind of classloader problem?
Any experiences or tips solving this strange behaviour?



Reply With Quote
