Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Problem deploying Spring web bundle - ContextLoaderListener not found (Trying to get my first web bundle working on Virgo)
Problem deploying Spring web bundle - ContextLoaderListener not found [message #723494] Thu, 08 September 2011 12:50 Go to previous message
Simon Watson is currently offline Simon Watson
Messages: 30
Registered: September 2011
Member
Hi all,

I'm new to Virgo and trying to get my first web bundle working with Virgo 3, Spring 3.0.5, and Eclipse 3.7.

I've created a simple web project bundle but Virgo fails to deploy it, throwing an exception: java.lang.ClassNotFoundException: ?org.springframework.web.context.ContextLoaderListener

To try and ensure I'm not missing any dependencies, I've now added the Spring library to my manifest but I still get the same problem. In my Eclipse project's bundle dependencies, I can see all the Spring JARs, including .../virgo-tomcat-server-3.0.0.RELEASE/repository/ext/org.springframework.web-3.0.5.RELEASE.jar. In Virgo's admin tool I can also see that this bundle has been loaded.

If I remove the following lines from web.xml, the bundle deploys and I can access static pages e.g. index.html.
<listener>
	<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>


Given I'm new to this, I'm sure I'm missing something obvious but would be very grateful for any pointers.

Thanks,

Simon.


web.xml

	
	<display-name>Test Spring Web App</display-name>

	<context-param>
		<param-name>contextClass</param-name>
		<param-value>org.eclipse.virgo.web.dm.ServerOsgiBundleXmlWebApplicationContext</param-value>
	</context-param>

	<listener>
		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
	</listener>

	<servlet>
		<servlet-name>springmvc</servlet-name>
		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
		<init-param>
            <param-name>contextClass</param-name>
            <param-value>org.eclipse.virgo.web.dm.ServerOsgiBundleXmlWebApplicationContext</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
		
	</servlet>
	<servlet-mapping>
		<servlet-name>springmvc</servlet-name>
		<url-pattern>/app/*</url-pattern>
	</servlet-mapping>

	<welcome-file-list>
		<welcome-file>index.html</welcome-file>
	</welcome-file-list>
	
</web-app>


MANIFEST.MF
Manifest-Version: 1.0
Class-Path: 
Bundle-Version: 1.0.0
Bundle-Name: Test Spring Web App Bundle
Bundle-ManifestVersion: 2
Web-ContextPath: /test
Bundle-SymbolicName: com.my.test
Import-Package: org.eclipse.virgo.web.dm
Import-Library: org.springframework.spring;version="[3.0.5.RELEASE,3.0.5.RELEASE]"


Exception from log:
Sep 8, 2011 5:24:53 PM org.apache.catalina.core.StandardContext listenerStart 
[2011-09-08 17:24:53.496] ERROR Thread-101                   System.err                                                        SEVERE: Error configuring application listener of class ?org.springframework.web.context.ContextLoaderListener 
[2011-09-08 17:24:53.496] ERROR Thread-101                   System.err                                                        java.lang.ClassNotFoundException: ?org.springframework.web.context.ContextLoaderListener 
[2011-09-08 17:24:53.496] ERROR Thread-101                   System.err                                                        	at org.eclipse.gemini.web.tomcat.internal.loading.BundleWebappClassLoader.loadClass(BundleWebappClassLoader.java:306) 
[2011-09-08 17:24:53.496] ERROR Thread-101                   System.err                                                        	at java.lang.ClassLoader.loadClass(ClassLoader.java:247) 
[2011-09-08 17:24:53.496] ERROR Thread-101                   System.err                                                        	at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:415) 
[2011-09-08 17:24:53.496] ERROR Thread-101                   System.err                                                        	at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:397) 
[2011-09-08 17:24:53.496] ERROR Thread-101                   System.err                                                        	at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118) 
[2011-09-08 17:24:53.497] ERROR Thread-101                   System.err                                                        	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4638) 
[2011-09-08 17:24:53.497] ERROR Thread-101                   System.err                                                        	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5204) 
[2011-09-08 17:24:53.497] ERROR Thread-101                   System.err                                                        	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5199) 
[2011-09-08 17:24:53.497] ERROR Thread-101                   System.err                                                        	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) 
[2011-09-08 17:24:53.497] ERROR Thread-101                   System.err                                                        	at java.util.concurrent.FutureTask.run(FutureTask.java:138) 
[2011-09-08 17:24:53.497] ERROR Thread-101                   System.err                                                        	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) 
[2011-09-08 17:24:53.497] ERROR Thread-101                   System.err                                                        	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) 
[2011-09-08 17:24:53.497] ERROR Thread-101                   System.err                                                        	at java.lang.Thread.run(Thread.java:680) 
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic:Virgo w/Spring 3.1.0.M2
Next Topic:Virgo 3.0.1 Released
Goto Forum:
  


Current Time: Sun May 19 13:30:52 EDT 2013

Powered by FUDForum. Page generated in 0.01712 seconds