component-scan OSGi environment
Hi,
I have 2 WAB (Web Application Bundles), then I need WAB-1 to scan the controllers of the WAB-2. Then when I deploy WAB-1 and go to the browser and I type "http://localhost:8080/wab-1/index" it shows me the Index page (because WAB-1 has a controller to show the index page (jsp)). When I deploy both (WAB-1 and WAB-2) the WAB-1 should scan to the controllers of the WAB-2 and be able to show his JSPs(pages). But when I type this url "http://localhost:8080/wab-1/SOME-PAGE-OF-WAB-2" in browser it return 404 error with this message:
HTTP Status 404 - /wab-1/WEB-INF/jsp/SOME-PAGE-OF-WAB-2.jsp
type Status report
message /wab-1/WEB-INF/jsp/SOME-PAGE-OF-WAB-2.jsp
description The requested resource (/wab-1/WEB-INF/jsp/SOME-PAGE-OF-WAB-2.jsp) is not available.
I'm using Virgo with Spring DM 3.0.5. in OSGi Environment.
This is the code of WAB-1.
Manifest
Code:
Manifest-Version: 1.0
Created-By: user
Bundle-ManifestVersion: 2
Bundle-Name: WAB-1
Bundle-SymbolicName: WAB-1
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Web-ContextPath: wab-1
Webapp-Context: wab-1
Bundle-ClassPath: .,WEB-INF/classes,WEB-INF/lib/jstl-impl-1.2.jar
Import-Package: org.eclipse.virgo.web.dm,org.apache.taglibs.standard.tag.rt.core,com.wab2.controller
Import-Library: org.springframework.spring;version="[3.0.5.RELEASE,3.0.5.RELEASE]"
wab1-servlet.xml
Code:
<context:component-scan annotation-config="true" base-package="com.wab1.controller"></context:component-scan>
<context:component-scan annotation-config="true" base-package="com.wab2.controller"></context:component-scan>
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/jsp/"/>
<property name="suffix" value=".jsp"/>
</bean>
<mvc:annotation-driven/>
<mvc:resources mapping="/resources/**" location="/resources/"/>
This is the code of WAB-2.
Manifest
Code:
Manifest-Version: 1.0
Created-By: user
Bundle-ManifestVersion: 2
Bundle-Name: WAB-2
Bundle-SymbolicName: WAB-2
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Web-ContextPath: wab-2
Webapp-Context: wab-2
Bundle-ClassPath: .,WEB-INF/classes,WEB-INF/lib/jstl-impl-1.2.jar
Import-Package: org.eclipse.virgo.web.dm,org.apache.taglibs.standard.tag.rt.core
Import-Library: org.springframework.spring;version="[3.0.5.RELEASE,3.0.5.RELEASE]"
Export-Package: com.wab2.controller
Both have controller classes with and
Code:
@RequestMapping(value = "SOME-PAGE", method = RequestMethod.GET)