Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Can't start greenpages.web-solution:2.4.0 in virgo-tomcat.3.0.2
Can't start greenpages.web-solution:2.4.0 in virgo-tomcat.3.0.2 [message #771887] Wed, 28 December 2011 08:11 Go to next message
Mariano Eloy Fernández Osca is currently offline Mariano Eloy Fernández Osca
Messages: 16
Registered: July 2009
Junior Member
Hi everybody,

I downloaded greenpages-2.4.0 to take it for a sping in Eclipse Indigo + Virgo 3.0.2.
I imported the "solution" directory as a Maven project and then added it to the Virgo thanks to its server adapter.
index.php/fa/6587/0/

No luck. The error log file says this:
[2011-12-28 13:44:37.973] ERROR Thread-88                    o.a.c.c.C.[Catalina].[localhost].[/greenpages.web-solution]       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:248)
	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:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:619)


I know this issue with the <listener> element calling Spring's ContextLoaderListener has been widely discussed in this forum. I tried some solutions like changing WABHeaders to "defaulted", but it didn't work.

I'm a bit dissapointed since Greenpages is the official starting point to dive into Virgo and OSGi. I expected it to just work "as is".

Since this classloading issue is such a hot topic, I guess we're all needing some specific FAQ entry about this.

Thanks.

[Updated on: Wed, 28 December 2011 08:16]

Report message to a moderator

Re: Can't start greenpages.web-solution:2.4.0 in virgo-tomcat.3.0.2 [message #771918 is a reply to message #771887] Wed, 28 December 2011 09:25 Go to previous messageGo to next message
Mariano Eloy Fernández Osca is currently offline Mariano Eloy Fernández Osca
Messages: 16
Registered: July 2009
Junior Member
I keep trying to make Greenpages work in my Virgo 3.0.2 runtime.
This time I issued a mvn package at top level project.
It generated the file greenpages-solution-2.4.0.RELEASE.par which I placed in the "pickup" directory.

I hoped for it to work, but this is what is logged.
Caused by: org.eclipse.virgo.kernel.osgi.framework.UnableToSatisfyBundleDependenciesException: Unable to satisfy dependencies of bundle 'greenpages-2.4.0.RELEASE-greenpages.jpa' at version '2.4.0': Import-Bundle with symbolic name 'com.springsource.org.eclipse.persistence' in version range '[1.0.0, 1.0.0]' could not be satisfied
	at org.eclipse.virgo.kernel.userregion.internal.importexpansion.ImportExpansionHandler.getBundlePackageImports(ImportExpansionHandler.java:271)
	at org.eclipse.virgo.kernel.userregion.internal.importexpansion.ImportExpansionHandler.getAdditionalPackageImports(ImportExpansionHandler.java:235)
	at org.eclipse.virgo.kernel.userregion.internal.importexpansion.ImportExpansionHandler.expandImports(ImportExpansionHandler.java:206)
	at org.eclipse.virgo.kernel.userregion.internal.importexpansion.ImportExpansionHandler.expandImportsIfNecessary(ImportExpansionHandler.java:174)
	at org.eclipse.virgo.kernel.userregion.internal.importexpansion.ImportExpansionHandler.expandImports(ImportExpansionHandler.java:112)
	at sun.reflect.GeneratedMethodAccessor56.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
	at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:58)
	at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:62)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
	at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:56)
	at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:39)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
	at org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
	at $Proxy67.expandImports(Unknown Source)
	at org.eclipse.virgo.kernel.deployer.core.internal.ImportExpandingTransformer.expandImports(ImportExpandingTransformer.java:107)
	... 22 common frames omitted


I unpacked a fresh Virgo 3.0.2 runtime just in case there was some garbage causing these problems, but it still doesn't work.
Re: Can't start greenpages.web-solution:2.4.0 in virgo-tomcat.3.0.2 [message #771969 is a reply to message #771918] Wed, 28 December 2011 12:10 Go to previous messageGo to next message
Mariano Eloy Fernández Osca is currently offline Mariano Eloy Fernández Osca
Messages: 16
Registered: July 2009
Junior Member
FINALLY!

I had to dive deeper in order to understand what the problem was. I think this could be due to a bug in m2e-wtp integration plugin, since all projects in the workspace have Maven Nature and Dynamic Web Module Facet enabled.

m2e-wtp plugin was generating an almost empty MANIFEST.MF in /target/m2e-wtp/web-resources/META-INF folder, no matter
where I placed the real MANIFEST.MF (I tried src/main/webapp/META-INF and /src/main/resources/META-INF). So Virgo was
not importing any package at all, including that missing ContextLoaderListener class.

I found a clue to this by having a look at Virgo's admin console. Just browse the "bundles" category the bundle. You'll
see what packages are being imported and exported FOR REAL.

So what I did is to copy the MANIFEST.MF to the /$VIRGO_BASE/stage/$BUNDLE_WEBAPP/META-INF directory and hit "redeploy" in
Eclipse's Server View. Quite cumbersome.

I created an issue to see if this is indeed an m2e-wtp bug.
https://issues.sonatype.org/browse/MECLIPSEWTP-208


[Updated on: Wed, 28 December 2011 12:12]

Report message to a moderator

Re: Can't start greenpages.web-solution:2.4.0 in virgo-tomcat.3.0.2 [message #772190 is a reply to message #771969] Thu, 29 December 2011 02:56 Go to previous message
Mariano Eloy Fernández Osca is currently offline Mariano Eloy Fernández Osca
Messages: 16
Registered: July 2009
Junior Member
To avoid conflicts with Maven, WTP, and m2e-wtp, I needed to add the following snippet to the pom.xml
...
  <build>
    <finalName>simplewebapp</finalName>
    <plugins>
    	<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.1-beta-1</version>
        <configuration>
          <archive>
          	 <manifestFile>src/main/webapp/META-INF/MANIFEST.MF</manifestFile>
          </archive>
        </configuration>
      </plugin>
    </plugins>
  </build>
...


This tells m2e-wtp to pick the MANIFEST.MF from that specific path. Otherwise it will generate an almost empty MANIFEST.MF, thus breaking the application at deploy time.
Previous Topic:Deploying webapp with Spring WebFlow
Next Topic:Virgo 3.5.0.M01 released
Goto Forum:
  


Current Time: Tue Sep 02 15:15:22 EDT 2014

Powered by FUDForum. Page generated in 0.18714 seconds