0 Replies Latest reply on Sep 25, 2012 6:30 AM by Shuting Guan

    RegisterWebAppVisitorWC NoClassDefFoundError

    Shuting Guan Newbie

      I got a NoClassDefFoundError for RegisterWebAppVisitorWC when I installed and ran a war file. The class it is complaining about is inside org.restlet.ext.servlet-2.0.0.jar, which is included in WEB-INF/lib of the war.

      My understanding of the error is that the org.ops4j.pax.web.pax-web-extender-war already contains this class and result in a conflict. However, removing org.restlet.ext.servlet-2.0.0.jar in the war won't solve the problem.

      Is my understanding of the error correct? How should I handle the situation when more than one bundle include the same class?

       

      Thanks in advance!

       

      Error log:

      13:16:23,999 | ERROR | l Console Thread | RegisterWebAppVisitorWC          | 122 - org.ops4j.pax.web.pax-web-extender-war - 1.0.7 | Registration exception. Skipping.

      java.lang.NoClassDefFoundError: org/restlet/ext/servlet/ServerServlet

           at java.lang.ClassLoader.defineClass1(Native Method)[:1.6.0_18]

           at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)[:1.6.0_18]

           at java.lang.ClassLoader.defineClass(ClassLoader.java:616)[:1.6.0_18]

           at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.findClass(ModuleImpl.java:1907)

           at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:727)

           at org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:71)

           at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1768)

           at java.lang.ClassLoader.loadClass(ClassLoader.java:248)[:1.6.0_18]

           at org.apache.felix.framework.ModuleImpl.getClassByDelegation(ModuleImpl.java:645)

           at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1619)[org.apache.felix.framework-3.0.9.jar:]

           at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:900)[org.apache.felix.framework-3.0.9.jar:]

           at org.ops4j.pax.swissbox.core.BundleClassLoader.findClass(BundleClassLoader.java:176)

           at org.ops4j.pax.swissbox.core.BundleClassLoader.loadClass(BundleClassLoader.java:194)

           at java.lang.ClassLoader.loadClass(ClassLoader.java:248)[:1.6.0_18]

           at org.ops4j.pax.web.extender.war.internal.RegisterWebAppVisitorHS.newInstance(RegisterWebAppVisitorHS.java:221)[122:org.ops4j.pax.web.pax-web-extender-war:1.0.7]

           at org.ops4j.pax.web.extender.war.internal.RegisterWebAppVisitorWC.visit(RegisterWebAppVisitorWC.java:200)[122:org.ops4j.pax.web.pax-web-extender-war:1.0.7]

           at org.ops4j.pax.web.extender.war.internal.model.WebApp.accept(WebApp.java:583)[122:org.ops4j.pax.web.pax-web-extender-war:1.0.7]

           at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$HttpServiceListener.register(WebAppPublisher.java:170)[122:org.ops4j.pax.web.pax-web-extender-war:1.0.7]

           at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$HttpServiceListener.serviceChanged(WebAppPublisher.java:155)[122:org.ops4j.pax.web.pax-web-extender-war:1.0.7]

           at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$HttpServiceListener.serviceChanged(WebAppPublisher.java:119)[122:org.ops4j.pax.web.pax-web-extender-war:1.0.7]

           at org.ops4j.pax.swissbox.tracker.ReplaceableService.setService(ReplaceableService.java:114)[122:org.ops4j.pax.web.pax-web-extender-war:1.0.7]

           at org.ops4j.pax.swissbox.tracker.ReplaceableService.access$100(ReplaceableService.java:28)[122:org.ops4j.pax.web.pax-web-extender-war:1.0.7]

           at org.ops4j.pax.swissbox.tracker.ReplaceableService$CollectionListener.serviceAdded(ReplaceableService.java:183)[122:org.ops4j.pax.web.pax-web-extender-war:1.0.7]

           at org.ops4j.pax.swissbox.tracker.ServiceCollection$Tracker.addingService(ServiceCollection.java:181)[122:org.ops4j.pax.web.pax-web-extender-war:1.0.7]

           at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:896)[karaf.jar:2.2.4]

           at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:261)[karaf.jar:2.2.4]

           at org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:184)[karaf.jar:2.2.4]

           at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:339)[karaf.jar:2.2.4]

           at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:273)[karaf.jar:2.2.4]

           at org.ops4j.pax.swissbox.tracker.ServiceCollection.onStart(ServiceCollection.java:139)[122:org.ops4j.pax.web.pax-web-extender-war:1.0.7]

           at org.ops4j.pax.swissbox.lifecycle.AbstractLifecycle$Stopped.start(AbstractLifecycle.java:121)[122:org.ops4j.pax.web.pax-web-extender-war:1.0.7]

           at org.ops4j.pax.swissbox.lifecycle.AbstractLifecycle.start(AbstractLifecycle.java:49)[122:org.ops4j.pax.web.pax-web-extender-war:1.0.7]

           at org.ops4j.pax.swissbox.tracker.ReplaceableService.onStart(ReplaceableService.java:146)[122:org.ops4j.pax.web.pax-web-extender-war:1.0.7]

           at org.ops4j.pax.swissbox.lifecycle.AbstractLifecycle$Stopped.start(AbstractLifecycle.java:121)[122:org.ops4j.pax.web.pax-web-extender-war:1.0.7]

           at org.ops4j.pax.swissbox.lifecycle.AbstractLifecycle.start(AbstractLifecycle.java:49)[122:org.ops4j.pax.web.pax-web-extender-war:1.0.7]

           at org.ops4j.pax.web.extender.war.internal.WebAppPublisher.publish(WebAppPublisher.java:81)[122:org.ops4j.pax.web.pax-web-extender-war:1.0.7]

           at org.ops4j.pax.web.extender.war.internal.WebXmlObserver.doPublish(WebXmlObserver.java:304)[122:org.ops4j.pax.web.pax-web-extender-war:1.0.7]

           at org.ops4j.pax.web.extender.war.internal.WebXmlObserver.addingEntries(WebXmlObserver.java:153)[122:org.ops4j.pax.web.pax-web-extender-war:1.0.7]

           at org.ops4j.pax.swissbox.extender.BundleWatcher.register(BundleWatcher.java:186)[122:org.ops4j.pax.web.pax-web-extender-war:1.0.7]

           at org.ops4j.pax.swissbox.extender.BundleWatcher.access$000(BundleWatcher.java:45)[122:org.ops4j.pax.web.pax-web-extender-war:1.0.7]

           at org.ops4j.pax.swissbox.extender.BundleWatcher$1.bundleChanged(BundleWatcher.java:127)[122:org.ops4j.pax.web.pax-web-extender-war:1.0.7]

           at org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:807)[org.apache.felix.framework-3.0.9.jar:]

           at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:729)[org.apache.felix.framework-3.0.9.jar:]

           at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:610)[org.apache.felix.framework-3.0.9.jar:]

           at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:3761)[org.apache.felix.framework-3.0.9.jar:]

           at org.apache.felix.framework.Felix.startBundle(Felix.java:1787)[org.apache.felix.framework-3.0.9.jar:]

           at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:918)[org.apache.felix.framework-3.0.9.jar:]

           at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:905)[org.apache.felix.framework-3.0.9.jar:]

           at org.apache.karaf.shell.osgi.InstallBundle.doExecute(InstallBundle.java:55)[19:org.apache.karaf.shell.osgi:2.2.4]

           at org.apache.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:38)[25:org.apache.karaf.shell.console:2.2.4]

           at org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:35)[25:org.apache.karaf.shell.console:2.2.4]

           at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[25:org.apache.karaf.shell.console:2.2.4]

           at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:474)[25:org.apache.karaf.shell.console:2.2.4]

           at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:400)[25:org.apache.karaf.shell.console:2.2.4]

           at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[25:org.apache.karaf.shell.console:2.2.4]

           at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[25:org.apache.karaf.shell.console:2.2.4]

           at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[25:org.apache.karaf.shell.console:2.2.4]

           at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)[25:org.apache.karaf.shell.console:2.2.4]

           at org.apache.karaf.shell.console.jline.Console.run(Console.java:218)[25:org.apache.karaf.shell.console:2.2.4]

           at java.lang.Thread.run(Thread.java:619)[:1.6.0_18]