PDA

View Full Version : web extender - ClassNotFoundException: org.apache.catalina.Loader


boianvojda
Jun 7th, 2008, 09:46 PM
Hi, I want to deploy a WAR file on OSGI.
To do that I have tried to run Spring DM on equinox using web-extender.
I have thsese plugins running :

0 ACTIVE org.eclipse.osgi_3.3.2.R33x_v20080105
1 ACTIVE org.springframework.bundle.osgi.core_1.1.0.m2
2 ACTIVE org.springframework.bundle.spring.core_2.5.4
3 ACTIVE org.apache.commons.logging_1.0.4.v200706111724
4 ACTIVE org.springframework.osgi.aopalliance.osgi_1.0.0.SN APSHOT
5 ACTIVE org.springframework.bundle.spring.aop_2.5.4
7 ACTIVE org.springframework.bundle.spring.beans_2.5.4
8 ACTIVE org.springframework.bundle.spring.context_2.5.4
9 ACTIVE org.springframework.bundle.osgi.io_1.1.0.m2
10 ACTIVE org.springframework.bundle.osgi.web_1.1.0.m2
12 ACTIVE org.springframework.osgi.servlet-api.osgi_2.5.0.SNAPSHOT
13 RESOLVED org.springframework.bundle.osgi.web.extender_1.1.0 .m2
14 ACTIVE org.springframework.bundle.osgi.extender_1.1.0.m2
17 ACTIVE org.springframework.osgi.catalina.osgi_5.5.23.SNAP SHOT

When I try to start spring-osgi-web-extender-1.1.0-m2.jar I got the following error :

2008-6-8 4:37:44 org.springframework.scheduling.timer.TimerTaskExec utor afterPropertiesSet
INFO: Initializing Timer
2008-6-8 4:37:44 org.springframework.osgi.web.extender.internal.act ivator.WarLoaderListener start
INFO: Starting [org.springframework.bundle.osgi.web.extender] bundle v.[1.1.0.m2]
2008-6-8 4:37:44 org.springframework.osgi.web.extender.internal.act ivator.WarListenerConfiguration <init>
INFO: No custom configuration detected; using defaults
org.osgi.framework.BundleException: Exception in org.springframework.osgi.web.extender.internal.act ivator.WarLoaderListener.start() of bundle org.springframework.bundle.os
.extender.
at org.eclipse.osgi.framework.internal.core.BundleCon textImpl.startActivator(BundleContextImpl.java:101 8)
at org.eclipse.osgi.framework.internal.core.BundleCon textImpl.start(BundleContextImpl.java:974)
at org.eclipse.osgi.framework.internal.core.BundleHos t.startWorker(BundleHost.java:346)
at org.eclipse.osgi.framework.internal.core.AbstractB undle.start(AbstractBundle.java:260)
at org.eclipse.osgi.framework.internal.core.AbstractB undle.start(AbstractBundle.java:252)
at org.eclipse.osgi.framework.internal.core.Framework CommandProvider._start(FrameworkCommandProvider.ja va:260)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknow n Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.osgi.framework.internal.core.Framework CommandInterpreter.execute(FrameworkCommandInterpr eter.java:150)
at org.eclipse.osgi.framework.internal.core.Framework Console.docommand(FrameworkConsole.java:300)
at org.eclipse.osgi.framework.internal.core.Framework Console.console(FrameworkConsole.java:285)
at org.eclipse.osgi.framework.internal.core.Framework Console.run(FrameworkConsole.java:221)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: org/apache/catalina/Loader
at org.springframework.osgi.web.extender.internal.act ivator.WarListenerConfiguration.createDefaultWarDe ployer(WarListenerConfiguration.java:149)
at org.springframework.osgi.web.extender.internal.act ivator.WarListenerConfiguration.<init>(WarListenerConfiguration.java:84)
at org.springframework.osgi.web.extender.internal.act ivator.WarLoaderListener.start(WarLoaderListener.j ava:243)
at org.eclipse.osgi.framework.internal.core.BundleCon textImpl$2.run(BundleContextImpl.java:999)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.framework.internal.core.BundleCon textImpl.startActivator(BundleContextImpl.java:993 )
... 13 more
Caused by: java.lang.ClassNotFoundException: org.apache.catalina.Loader
at org.eclipse.osgi.framework.internal.core.BundleLoa der.findClassInternal(BundleLoader.java:434)
at org.eclipse.osgi.framework.internal.core.BundleLoa der.findClass(BundleLoader.java:369)
at org.eclipse.osgi.framework.internal.core.BundleLoa der.findClass(BundleLoader.java:357)
at org.eclipse.osgi.internal.baseadaptor.DefaultClass Loader.loadClass(DefaultClassLoader.java:83)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 19 more
Nested Exception:
java.lang.NoClassDefFoundError: org/apache/catalina/Loader
at org.springframework.osgi.web.extender.internal.act ivator.WarListenerConfiguration.createDefaultWarDe ployer(WarListenerConfiguration.java:149)
at org.springframework.osgi.web.extender.internal.act ivator.WarListenerConfiguration.<init>(WarListenerConfiguration.java:84)
at org.springframework.osgi.web.extender.internal.act ivator.WarLoaderListener.start(WarLoaderListener.j ava:243)
at org.eclipse.osgi.framework.internal.core.BundleCon textImpl$2.run(BundleContextImpl.java:999)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.framework.internal.core.BundleCon textImpl.startActivator(BundleContextImpl.java:993 )
at org.eclipse.osgi.framework.internal.core.BundleCon textImpl.start(BundleContextImpl.java:974)
at org.eclipse.osgi.framework.internal.core.BundleHos t.startWorker(BundleHost.java:346)
at org.eclipse.osgi.framework.internal.core.AbstractB undle.start(AbstractBundle.java:260)
at org.eclipse.osgi.framework.internal.core.AbstractB undle.start(AbstractBundle.java:252)
at org.eclipse.osgi.framework.internal.core.Framework CommandProvider._start(FrameworkCommandProvider.ja va:260)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknow n Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.osgi.framework.internal.core.Framework CommandInterpreter.execute(FrameworkCommandInterpr eter.java:150)
at org.eclipse.osgi.framework.internal.core.Framework Console.docommand(FrameworkConsole.java:300)
at org.eclipse.osgi.framework.internal.core.Framework Console.console(FrameworkConsole.java:285)
at org.eclipse.osgi.framework.internal.core.Framework Console.run(FrameworkConsole.java:221)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.apache.catalina.Loader
at org.eclipse.osgi.framework.internal.core.BundleLoa der.findClassInternal(BundleLoader.java:434)
at org.eclipse.osgi.framework.internal.core.BundleLoa der.findClass(BundleLoader.java:369)
at org.eclipse.osgi.framework.internal.core.BundleLoa der.findClass(BundleLoader.java:357)
at org.eclipse.osgi.internal.baseadaptor.DefaultClass Loader.loadClass(DefaultClassLoader.java:83)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 19 more
Nested Exception:
java.lang.ClassNotFoundException: org.apache.catalina.Loader
at org.eclipse.osgi.framework.internal.core.BundleLoa der.findClassInternal(BundleLoader.java:434)
at org.eclipse.osgi.framework.internal.core.BundleLoa der.findClass(BundleLoader.java:369)
at org.eclipse.osgi.framework.internal.core.BundleLoa der.findClass(BundleLoader.java:357)
at org.eclipse.osgi.internal.baseadaptor.DefaultClass Loader.loadClass(DefaultClassLoader.java:83)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at org.springframework.osgi.web.extender.internal.act ivator.WarListenerConfiguration.createDefaultWarDe ployer(WarListenerConfiguration.java:149)
at org.springframework.osgi.web.extender.internal.act ivator.WarListenerConfiguration.<init>(WarListenerConfiguration.java:84)
at org.springframework.osgi.web.extender.internal.act ivator.WarLoaderListener.start(WarLoaderListener.j ava:243)
at org.eclipse.osgi.framework.internal.core.BundleCon textImpl$2.run(BundleContextImpl.java:999)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.framework.internal.core.BundleCon textImpl.startActivator(BundleContextImpl.java:993 )
at org.eclipse.osgi.framework.internal.core.BundleCon textImpl.start(BundleContextImpl.java:974)
at org.eclipse.osgi.framework.internal.core.BundleHos t.startWorker(BundleHost.java:346)
at org.eclipse.osgi.framework.internal.core.AbstractB undle.start(AbstractBundle.java:260)
at org.eclipse.osgi.framework.internal.core.AbstractB undle.start(AbstractBundle.java:252)
at org.eclipse.osgi.framework.internal.core.Framework CommandProvider._start(FrameworkCommandProvider.ja va:260)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknow n Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.osgi.framework.internal.core.Framework CommandInterpreter.execute(FrameworkCommandInterpr eter.java:150)
at org.eclipse.osgi.framework.internal.core.Framework Console.docommand(FrameworkConsole.java:300)
at org.eclipse.osgi.framework.internal.core.Framework Console.console(FrameworkConsole.java:285)
at org.eclipse.osgi.framework.internal.core.Framework Console.run(FrameworkConsole.java:221)
at java.lang.Thread.run(Unknown Source)
Nested Exception:
java.lang.NoClassDefFoundError: org/apache/catalina/Loader

.......

sarbx
Jun 8th, 2008, 05:14 PM
I think the web extender looks for version 5.5 of the catalina.osgi. If you had installed version 6 of the catalina.osgi you might run into this issue.

Costin Leau
Jun 9th, 2008, 01:54 AM
Do you have any fragments attached to the war configuration by any chance? The exception is a surprise since we test every night the build against Catalina.

Costin Leau
Jun 9th, 2008, 01:55 AM
I think the web extender looks for version 5.5 of the catalina.osgi. If you had installed version 6 of the catalina.osgi you might run into this issue.

The extender is compatible with both Tomcat 5.5 and Tomcat 6 - moreover, in the configuration Tomcat 5.5 is used.

sarbx
Jun 9th, 2008, 04:23 AM
The extender is compatible with both Tomcat 5.5 and Tomcat 6 - moreover, in the configuration Tomcat 5.5 is used.

I got the same exception in Knopflerfish 2.0.5, and looking at the MANIFEST for "spring-osgi-web" it imports
org.apache.catalina;resolution:=optional;version="5.5.23"

and when I moved back to Tomcat 5.5, it started working fine. Thats when I assumed it required Tomcat 5.5.

I'm using version 1.1.0-m2 spring-osgi-web.

Costin Leau
Jun 12th, 2008, 06:33 AM
spring-osgi-web provides a deployer for both Tomcat and Jetty but as the import mentions, these are optional - they are not critical or required for spring-osgi-web.
However, the spring-osgi web extender deploys to web container (by default Tomcat) so it expects its presence that's why, when the web extender is deployed as well, you end with an exception if you don't have Tomcat installed.
Basically don't install the web extender if you don't plan to deploy a war.

Gaston
Jul 14th, 2008, 03:46 PM
Hi,

today I had the same problem and probably solved it.
I had the org.eclipse.osgi_3.3.x.jar changed to org.eclipse.osgi_3.2.2.jar and everything worked perfect. I am self a newbie to Spring but perhaps helps this hint you spring professional to understand what this error is.

Greetings

Gaston

Costin Leau
Jul 15th, 2008, 03:48 PM
Gaston, I advice you to try 1.1.0 final and see if that makes a difference. While we test against Equinox 3.2.2, things should be working again 3.3.x as well.
Can you please turn on debugging in Equinox and see what's the problem (see the equinox config.ini page for more info)?
Additionally you could try running on Knopflerfish and see whether you encounter any issues.