Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Problems loading ApplicatioContext file in a WAB
Problems loading ApplicatioContext file in a WAB [message #867281] Tue, 01 May 2012 08:02 Go to next message
taher mosbah is currently offline taher mosbahFriend
Messages: 17
Registered: April 2012
Junior Member
Greetings,
Im having a hard time getting a Spring project to run on Virgo 3.0.2, and more precisely reading the applicationContext file, here is my StackTrace:

[2012-05-01 09:44:37.681] DEBUG Thread-130                   o.e.gemini.web.tomcat.internal.loading.BundleWebappClassLoader      Searching the application's bundle 
[2012-05-01 09:44:37.681] TRACE Thread-130                   org.springframework.osgi.util.DebugUtils                          Could not find class [org.springframework.web.context.ContextLoaderListener] required by [null(BizTouch.Web)] scanning available bundles 
[2012-05-01 09:44:37.682] DEBUG Thread-130                   o.e.gemini.web.tomcat.internal.loading.BundleWebappClassLoader    loadClass(org.eclipse.gemini.web.tomcat.internal.loading.BundleWebappClassLoader, false) 
[2012-05-01 09:44:37.682] DEBUG Thread-130                   o.e.gemini.web.tomcat.internal.loading.BundleWebappClassLoader      Searching the application's bundle 
[2012-05-01 09:44:37.683] TRACE Thread-130                   org.springframework.osgi.util.DebugUtils                          Could not find class [org.eclipse.gemini.web.tomcat.internal.loading.BundleWebappClassLoader] required by [null(BizTouch.Web)] scanning available bundles 
[2012-05-01 09:44:37.683] ERROR Thread-130                   o.a.c.core.ContainerBase.[Catalina].[localhost].[/BizTouch.Web]   Error configuring application listener of class org.springframework.web.context.ContextLoaderListener java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
	at org.eclipse.gemini.web.tomcat.internal.loading.BundleWebappClassLoader.loadClass(BundleWebappClassLoader.java:306)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
	at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:415)
	at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:397)
	at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4660)
	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5226)
	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5221)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
	at java.lang.Thread.run(Thread.java:619)



my Manifest file:
Manifest-Version: 2.0
Tool: Bnd-0.0.386
Meta-Persistence: META-INF/persistence.xml
Bundle-Name: com.apptivit.biztouch.web
DynamicImport-Package: *
Bundle-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: com.apptivit.biztouch.web
Import-Library: org.springframework.spring;version="[3.0.5.RELEASE,3.0.5.RELEASE]"
Import-Bundle: com.springsource.com.mysql.jdbc;version="[5.1.6,5.1.6]"
Import-Package: com.apptivit.biztouch.business.timeline;com.apptivit.biztouch.dao;javax.el;javax.servlet;javax.servlet.http;javax.servlet.jsp;javax.servlet.jsp.el;javax.servlet.jsp.tagext;com.apptivit.biztouch.models;org.eclipse.virgo.web.dm
Bundle-Vendor: Apptiv-IT
Web-ContextPath: BizTouch.Web
Spring-Context: WEB-INF/spring/appServlet/appServlet-context.xml


my web.xml file :
<?xml version="1.0" encoding="UTF-8"?>
	<!-- The definition of the Root Spring Container shared by all Servlets 
		and Filters -->
	<context-param>
		<param-name>contextConfigLocation</param-name>
		<param-value>/WEB-INF/spring/root-context.xml</param-value>
	</context-param>

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

	<!-- Creates the Spring Container shared by all Servlets and Filters -->
	<listener>
		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
	</listener>

	<!-- Processes application requests -->
	<servlet>
		<servlet-name>appServlet</servlet-name>
		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
		<init-param>
			<param-name>contextConfigLocation</param-name>
			<param-value>/WEB-INF/spring/appServlet/appServlet-context.xml</param-value>
		</init-param>
		<init-param>
			<param-name>contextClass</param-name>
			<param-value>org.springframework.osgi.web.context.support.OsgiBundleXmlWebApplicationContext</param-value>
		</init-param>
		<load-on-startup>1</load-on-startup>
	</servlet>

	<servlet-mapping>
		<servlet-name>appServlet</servlet-name>
		<url-pattern>/</url-pattern>
	</servlet-mapping>

</web-app>


I'm ready to provide the complete project if needed, I experimented with various
configurations and always get the same problem.
Many thanks.
Re: Problems loading ApplicatioContext file in a WAB [message #867349 is a reply to message #867281] Tue, 01 May 2012 08:44 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
Looks like you're missing an import. Remember that Spring web is not part of the core Spring framework and so is not covered by Import-Library: org.springframework.spring;...
Re: Problems loading ApplicatioContext file in a WAB [message #867397 is a reply to message #867349] Tue, 01 May 2012 09:18 Go to previous messageGo to next message
taher mosbah is currently offline taher mosbahFriend
Messages: 17
Registered: April 2012
Junior Member
Thank you for your quick reply,
This link at spring source repository states that spring web is part of spring library : springsource.com/repository/app/library/version/detail?name=org.springframework.spring&version=3.0.5.RELEASE
sorry for the formatting because I can't post links
anyway, I tried to add the import explicitly but I always get the same error...
I'm really out of ideas.

[Updated on: Tue, 01 May 2012 09:18]

Report message to a moderator

Re: Problems loading ApplicatioContext file in a WAB [message #867433 is a reply to message #867397] Tue, 01 May 2012 09:41 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
My mistake about the spring library. The usual advice is either to start with a known good WAB and add in your changes incrementally to narrow down the problem or to start with the failing WAB and gradually strip it down until you find a single change that removes the problem. Often this turns up an error in the application, but if not, you'll have a minimal testcase that can be the basis for a bug.
Re: Problems loading ApplicatioContext file in a WAB [message #867462 is a reply to message #867433] Tue, 01 May 2012 09:59 Go to previous messageGo to next message
taher mosbah is currently offline taher mosbahFriend
Messages: 17
Registered: April 2012
Junior Member
Thanks for the advice, I tried that approach earlier, just a new dynamic web application with web bundle nature, but I got exactly the same problem,
I tried changing spring library to 3.1.1, changing Virgo to 3.0.3 with no chance.
The weird thing is that "org.springframework.web-3.0.5.RELEASE.jar" exists in my
VIRGO_HOME/repository/ext and contains the said missing class .
Re: Problems loading ApplicatioContext file in a WAB [message #867486 is a reply to message #867462] Tue, 01 May 2012 10:18 Go to previous messageGo to next message
taher mosbah is currently offline taher mosbahFriend
Messages: 17
Registered: April 2012
Junior Member
Actually with a fresh web application bundle with just spring config files and on controller, I'm getting this:
[2012-05-01 12:14:12.154] TRACE  TCP Connection(2)-127.0.0.1 o.e.v.kernel.deployer.core.internal.PipelinedApplicationDeployer  < private void org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.uninstallArtifact(org.eclipse.virgo.kernel.install.artifact.InstallArtifact) 
[2012-05-01 12:14:12.157] DEBUG  TCP Connection(2)-127.0.0.1 o.e.v.kernel.deployer.core.internal.PipelinedApplicationDeployer  < public org.eclipse.virgo.kernel.deployer.core.DeploymentIdentity org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.deploy(java.net.URI, org.eclipse.virgo.kernel.deployer.core.DeploymentOptions) org.eclipse.virgo.kernel.deployer.core.DeploymentException: IOException parsing XML document from OSGi resource[/applicationContext.xml|bnd.id=137|bnd.sym=BizTouch.webTest]; nested exception is java.io.FileNotFoundException: OSGi resource[/applicationContext.xml|bnd.id=137|bnd.sym=BizTouch.webTest] cannot be resolved to URL because it does not exist
	at org.eclipse.virgo.kernel.deployer.core.internal.BlockingSignal.awaitCompletion(BlockingSignal.java:87)
	at org.eclipse.virgo.kernel.deployer.core.internal.BlockingAbortableSignal.awaitCompletion(BlockingAbortableSignal.java:63)
	at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.start(PipelinedApplicationDeployer.java:303)
	at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.deploy(PipelinedApplicationDeployer.java:208)
	at org.eclipse.virgo.kernel.deployer.management.StandardDeployer.deploy(StandardDeployer.java:52)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenReturn(ConvertingMethod.java:167)
	at com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIntrospector.java:96)
	at com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIntrospector.java:33)
	at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:208)
	at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:120)
	at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:262)
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
	at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
	at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1424)
	at javax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:72)
	at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1262)
	at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1357)
	at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:786)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
	at sun.rmi.transport.Transport$1.run(Transport.java:159)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
	at java.lang.Thread.run(Thread.java:619)
Caused by: java.io.FileNotFoundException: OSGi resource[/applicationContext.xml|bnd.id=137|bnd.sym=BizTouch.webTest] cannot be resolved to URL because it does not exist


you can find the test project as attachment:

[Updated on: Tue, 01 May 2012 10:21]

Report message to a moderator

Re: Problems loading ApplicatioContext file in a WAB [message #869449 is a reply to message #867486] Thu, 03 May 2012 12:20 Go to previous messageGo to next message
taher mosbah is currently offline taher mosbahFriend
Messages: 17
Registered: April 2012
Junior Member
Hi, I'm starting over with just a web bundle and adding spring project nature without maven integration, my spring servlet configuration file is recognized successfully, but I'm getting the following exception :
Exception sending context destroyed event to listener instance of class org.springframework.web.context.ContextLoaderListener java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
	at org.springframework.web.context.ContextCleanupListener.<clinit>(ContextCleanupListener.java:43)
	at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:144)
	at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4819)
	at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5466)
	at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
	at org.eclipse.gemini.web.tomcat.internal.TomcatServletContainer.startWebApplication(TomcatServletContainer.java:124)
	at org.eclipse.gemini.web.internal.StandardWebApplication.start(StandardWebApplication.java:95)
	at org.eclipse.virgo.web.core.internal.WebBundleLifecycleListener.onStarted(WebBundleLifecycleListener.java:122)
	at org.eclipse.virgo.kernel.install.artifact.internal.StandardArtifactStateMonitor.onStarted(StandardArtifactStateMonitor.java:271)
	at org.eclipse.virgo.kernel.install.artifact.internal.AbstractInstallArtifact.asyncStartSucceeded(AbstractInstallArtifact.java:319)
	at org.eclipse.virgo.kernel.install.artifact.internal.AbstractInstallArtifact.access$0(AbstractInstallArtifact.java:316)
	at org.eclipse.virgo.kernel.install.artifact.internal.AbstractInstallArtifact$StateMonitorSignal.signalSuccessfulCompletion(AbstractInstallArtifact.java:252)
	at org.eclipse.virgo.kernel.core.internal.BundleStartTracker$1.run(BundleStartTracker.java:140)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:680)
Caused by: org.eclipse.virgo.kernel.osgi.framework.ExtendedClassNotFoundException: org.apache.commons.logging.LogFactory in KernelBundleClassLoader: [bundle=TestWebBundle_1.0.0]
	at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.loadClass(KernelBundleClassLoader.java:138)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
	... 20 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
	at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.loadClass(KernelBundleClassLoader.java:134)
	... 21 common frames omitted


I'm already have commons-logging in my dependencies.
Sincerly.
Re: Problems loading ApplicatioContext file in a WAB [message #869600 is a reply to message #869449] Thu, 03 May 2012 17:09 Go to previous messageGo to next message
taher mosbah is currently offline taher mosbahFriend
Messages: 17
Registered: April 2012
Junior Member
I actually identified the problem, wich is the listner in web.xml, here is my web.xml :
<?xml version="1.0" encoding="UTF-8"?>
	<display-name>TestWebBundle</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>dispatcher</servlet-name>
		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
		<load-on-startup>1</load-on-startup>
	</servlet>
	<servlet-mapping>
		<servlet-name>dispatcher</servlet-name>
		<url-pattern>/</url-pattern>
	</servlet-mapping>
</web-app>


The bundle deployes successfully but I got this exception on runtime :
org.springframework.beans.FatalBeanException: Class [org.springframework.context.config.ContextNamespaceHandler] for namespace [springframework.org/schema/context] does not implement the [org.springframework.beans.factory.xml.NamespaceHandler] interface
	org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver.resolve(DefaultNamespaceHandlerResolver.java:126)
	org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1330)
	org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1325)
	org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135)
	org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:93)
	org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)
	org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
	org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
	org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
	org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
	org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
	org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
	org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
	org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:93)
	org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
	org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)
	org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397)
	org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:442)
	org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:458)
	org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:339)
	org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306)
	org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
	javax.servlet.GenericServlet.init(GenericServlet.java:244)
	org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
	org.eclipse.virgo.web.tomcat.support.ApplicationNameTrackingValve.invoke(ApplicationNameTrackingValve.java:33)
	org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
	org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
	org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
	org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
	java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	java.lang.Thread.run(Thread.java:680)


if I uncomment the listner on web.xml, my bundle fails to start giving the following :
[2012-05-03 18:02:35.519] ERROR start-signalling-4           o.a.c.core.ContainerBase.[Catalina].[localhost].[/TestWebBundle]  Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener java.lang.NoClassDefFoundError: org.eclipse.virgo.web.dm.ServerOsgiBundleXmlWebApplicationContext not found from bundle [TestWebBundle_1.0.0 [133]]
	at org.eclipse.gemini.web.tomcat.internal.loading.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:107)
	at org.eclipse.gemini.web.tomcat.internal.loading.BundleDelegatingClassLoader.loadClass(BundleDelegatingClassLoader.java:139)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
	at org.eclipse.gemini.web.tomcat.internal.loading.ChainedClassLoader.doLoadClass(ChainedClassLoader.java:173)
	at org.eclipse.gemini.web.tomcat.internal.loading.ChainedClassLoader.loadClass(ChainedClassLoader.java:163)
	at org.eclipse.gemini.web.tomcat.internal.loading.BundleWebappClassLoader.loadClass(BundleWebappClassLoader.java:293)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
	at org.springframework.util.ClassUtils.forName(ClassUtils.java:257)
	at org.springframework.web.context.ContextLoader.determineContextClass(ContextLoader.java:292)
	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:245)
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4779)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
	at org.eclipse.gemini.web.tomcat.internal.TomcatServletContainer.startWebApplication(TomcatServletContainer.java:124)
	at org.eclipse.gemini.web.internal.StandardWebApplication.start(StandardWebApplication.java:95)
	at org.eclipse.virgo.web.core.internal.WebBundleLifecycleListener.onStarted(WebBundleLifecycleListener.java:122)
	at org.eclipse.virgo.kernel.install.artifact.internal.StandardArtifactStateMonitor.onStarted(StandardArtifactStateMonitor.java:271)
	at org.eclipse.virgo.kernel.install.artifact.internal.AbstractInstallArtifact.asyncStartSucceeded(AbstractInstallArtifact.java:319)
	at org.eclipse.virgo.kernel.install.artifact.internal.AbstractInstallArtifact.access$0(AbstractInstallArtifact.java:316)
	at org.eclipse.virgo.kernel.install.artifact.internal.AbstractInstallArtifact$StateMonitorSignal.signalSuccessfulCompletion(AbstractInstallArtifact.java:252)
	at org.eclipse.virgo.kernel.core.internal.BundleStartTracker$1.run(BundleStartTracker.java:140)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:680)
Caused by: org.eclipse.virgo.kernel.osgi.framework.ExtendedNoClassDefFoundError: org/eclipse/gemini/blueprint/context/support/OsgiBundleXmlApplicationContext in KernelBundleClassLoader: [bundle=TestWebBundle_1.0.0] in KernelBundleClassLoader: [bundle=TestWebBundle_1.0.0]
	at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.loadClass(KernelBundleClassLoader.java:140)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
	at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
	at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207)
	at org.eclipse.gemini.web.tomcat.internal.loading.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:91)
	... 28 common frames omitted
Caused by: org.eclipse.virgo.kernel.osgi.framework.ExtendedNoClassDefFoundError: org/eclipse/gemini/blueprint/context/support/OsgiBundleXmlApplicationContext in KernelBundleClassLoader: [bundle=TestWebBundle_1.0.0]
	at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.defineClass(KernelBundleClassLoader.java:242)
	at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.java:601)
	at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathManager.java:567)
	at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.java:490)
	at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass_LockClassLoader(ClasspathManager.java:478)
	at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:458)
	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
	at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:476)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
	at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.loadClass(KernelBundleClassLoader.java:134)
	... 33 common frames omitted
Caused by: java.lang.NoClassDefFoundError: org/eclipse/gemini/blueprint/context/support/OsgiBundleXmlApplicationContext
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.java:188)
	at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.defineClass(KernelBundleClassLoader.java:238)
	... 45 common frames omitted
Caused by: org.eclipse.virgo.kernel.osgi.framework.ExtendedClassNotFoundException: org.eclipse.gemini.blueprint.context.support.OsgiBundleXmlApplicationContext in KernelBundleClassLoader: [bundle=TestWebBundle_1.0.0]
	at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.loadClass(KernelBundleClassLoader.java:138)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
	... 50 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.eclipse.gemini.blueprint.context.support.OsgiBundleXmlApplicationContext
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
	at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.loadClass(KernelBundleClassLoader.java:134)
	... 51 common frames omitted



As an attachement you can find my test project,(sorry file size is too big)
Sincerly.

[Updated on: Thu, 03 May 2012 17:15]

Report message to a moderator

Re: Problems loading ApplicatioContext file in a WAB [message #870389 is a reply to message #869600] Mon, 07 May 2012 22:06 Go to previous messageGo to next message
taher mosbah is currently offline taher mosbahFriend
Messages: 17
Registered: April 2012
Junior Member
The last problem turned to be caused by a conflict in spring jars, I solved it by referening the jars shiped with Virgo in my classpath. Thank you.

[Updated on: Mon, 07 May 2012 22:07]

Report message to a moderator

Re: Problems loading ApplicatioContext file in a WAB [message #870672 is a reply to message #870389] Wed, 09 May 2012 10:04 Go to previous messageGo to next message
teresa tang is currently offline teresa tangFriend
Messages: 2
Registered: May 2012
Junior Member
May I know how do you fix it ? I met the same problem too.
Re: Problems loading ApplicatioContext file in a WAB [message #870677 is a reply to message #870672] Wed, 09 May 2012 10:19 Go to previous messageGo to next message
taher mosbah is currently offline taher mosbahFriend
Messages: 17
Registered: April 2012
Junior Member
@Teresa tang, I just started a new dynamic web project, added web application nature (have to install osgi bundle facet from : download.eclipse.org/virgo/milestone/tooling) and that's all, for the configuration just follow the greenpages samples (this is the most up to date verion : github.com/dsklyut/virgo-samples-greenpages) , if you have any other problems it will be a pleasure to help.
Re: Problems loading ApplicatioContext file in a WAB [message #870857 is a reply to message #870677] Thu, 10 May 2012 01:50 Go to previous message
teresa tang is currently offline teresa tangFriend
Messages: 2
Registered: May 2012
Junior Member
Thanks for your reply and help.
I resolved the problem, the war can not build by the ant directly

[Updated on: Thu, 10 May 2012 07:48]

Report message to a moderator

Previous Topic:Snaps Parent Application Context Not Loading
Next Topic:How to change the value of LimitRequestFieldSize in virgo tomcat server
Goto Forum:
  


Current Time: Thu Dec 18 13:42:17 GMT 2014

Powered by FUDForum. Page generated in 0.02993 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software