deploymentwicketosgi-bundlewicket-1.5apache-servicemix

Wicket feature unable to find its classes during deployment of wicket application in ServiceMix


After I install Apache Wicket feature in my servicemix(instalation goes without any problems) during deployment of my application I get the following error:

Caused by: java.lang.ClassNotFoundException: org.apache.wicket.request.Request not found by org.apache.wicket.core [180] at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)[org.apache.felix.framework-4.2.1.jar:] at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)[org.apache.felix.framework-4.2.1.jar:] at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955) at java.lang.ClassLoader.loadClass(ClassLoader.java:357)[:1.8.0_101]

When I include the same wicket jars that I use while installing them to SMX in my WAR during deployment and add them to classpath in my applications' manifest there is no issue.

Here's definition of my wicket feature in features.xml

<feature name="wicket-spring" version="1.5.16" description="Wicket spring" resolver="(obr)">
    <feature version="1.5.16">wicket-ioc</feature>
    <bundle start-level="30">mvn:org.apache.wicket/wicket-spring/1.5.16</bundle>
</feature>   
<feature name="wicket-ioc" version="1.5.16" description="Wicket ioc" resolver="(obr)">
    <feature version="1.5.16">wicket-core</feature>
    <bundle start-level="30">mvn:org.apache.wicket/wicket-ioc/1.5.16</bundle>
</feature>   
<feature name="wicket-core" version="1.5.16" description="Wicket core" resolver="(obr)">
    <feature version="1.5.16">wicket-request</feature>
    <bundle start-level="30">mvn:org.apache.wicket/wicket-core/1.5.16</bundle>
</feature> 

<feature name="wicket-request" version="1.5.16" description="Wicket request" resolver="(obr)">
<feature version="1.5.16">wicket-util</feature>
    <bundle start-level="30">mvn:org.apache.wicket/wicket-request/1.5.16</bundle>
</feature> 
<feature name="wicket-util" version="1.5.16" description="Wicket util" resolver="(obr)">
    <bundle start-level="30">mvn:org.apache.wicket/wicket-util/1.5.16</bundle>
</feature>  

Including wicket jars in my WAR is not a desirable approach, how can I fix it?

By the way, wicket-core.jar doesn't import org.apache.wicket.request in its manifest file, but I don't think that editing those manifests is the way to go

Full stacktrace:

java.lang.NoClassDefFoundError: org/apache/wicket/request/Request
at java.lang.Class.getDeclaredConstructors0(Native Method)[:1.8.0_101]
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)[:1.8.0_101]
at java.lang.Class.getConstructor0(Class.java:3075)[:1.8.0_101]
at java.lang.Class.newInstance(Class.java:412)[:1.8.0_101]
at org.eclipse.jetty.servlet.ServletContextHandler$Context.createFilter(ServletContextHandler.java:1051)[50:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:104)[50:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)[50:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:768)[50:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)[50:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717)[50:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doStart(HttpServiceContext.java:222)[59:org.ops4j.pax.web.pax-web-jetty:3.2.6]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)[50:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.ops4j.pax.web.service.jetty.internal.JettyServerImpl$1.start(JettyServerImpl.java:204)[59:org.ops4j.pax.web.pax-web-jetty:3.2.6]
at org.ops4j.pax.web.service.internal.HttpServiceStarted.end(HttpServiceStarted.java:1032)[58:org.ops4j.pax.web.pax-web-runtime:3.2.6]
at org.ops4j.pax.web.service.internal.HttpServiceProxy.end(HttpServiceProxy.java:422)[58:org.ops4j.pax.web.pax-web-runtime:3.2.6]
at org.ops4j.pax.web.extender.war.internal.RegisterWebAppVisitorWC.end(RegisterWebAppVisitorWC.java:341)[64:org.ops4j.pax.web.pax-web-extender-war:3.2.6]
at org.ops4j.pax.web.extender.war.internal.model.WebApp.accept(WebApp.java:678)[64:org.ops4j.pax.web.pax-web-extender-war:3.2.6]
at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.register(WebAppPublisher.java:237)[64:org.ops4j.pax.web.pax-web-extender-war:3.2.6]
at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.addingService(WebAppPublisher.java:182)[64:org.ops4j.pax.web.pax-web-extender-war:3.2.6]
at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.addingService(WebAppPublisher.java:135)[64:org.ops4j.pax.web.pax-web-extender-war:3.2.6]
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:932)[karaf-org.osgi.core.jar:]
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:864)[karaf-org.osgi.core.jar:]
at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)[karaf-org.osgi.core.jar:]
at org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:183)[karaf-org.osgi.core.jar:]
at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:317)[karaf-org.osgi.core.jar:]
at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:261)[karaf-org.osgi.core.jar:]
at org.ops4j.pax.web.extender.war.internal.WebAppPublisher.publish(WebAppPublisher.java:101)[64:org.ops4j.pax.web.pax-web-extender-war:3.2.6]
at org.ops4j.pax.web.extender.war.internal.WebObserver.deploy(WebObserver.java:213)[64:org.ops4j.pax.web.pax-web-extender-war:3.2.6]
at org.ops4j.pax.web.extender.war.internal.WebObserver$1.doStart(WebObserver.java:175)[64:org.ops4j.pax.web.pax-web-extender-war:3.2.6]
at org.ops4j.pax.web.extender.war.internal.extender.SimpleExtension.start(SimpleExtension.java:58)[64:org.ops4j.pax.web.pax-web-extender-war:3.2.6]
at org.ops4j.pax.web.extender.war.internal.extender.AbstractExtender$1.run(AbstractExtender.java:266)[64:org.ops4j.pax.web.pax-web-extender-war:3.2.6]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_101]
at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_101]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)[:1.8.0_101]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[:1.8.0_101]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_101]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_101]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_101]
Caused by: java.lang.ClassNotFoundException: org.apache.wicket.request.Request not found by org.apache.wicket.core [180]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)[org.apache.felix.framework-4.2.1.jar:]
at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)[org.apache.felix.framework-4.2.1.jar:]
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)[:1.8.0_101]
... 38 more
2016-10-06 15:20:27,532 | WARN  | pool-4-thread-1  | AbstractLifeCycle                | 50 - org.eclipse.jetty.aggregate.jetty-all-server - 8.1.17.v20150415 | FAILED HttpServiceContext{httpContext=WebAppHttpContext{hub-web - 184}}:       
java.lang.NoClassDefFoundError: org/apache/wicket/request/Request
java.lang.NoClassDefFoundError: org/apache/wicket/request/Request
at java.lang.Class.getDeclaredConstructors0(Native Method)[:1.8.0_101]
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)[:1.8.0_101]
at java.lang.Class.getConstructor0(Class.java:3075)[:1.8.0_101]
at java.lang.Class.newInstance(Class.java:412)[:1.8.0_101]
at org.eclipse.jetty.servlet.ServletContextHandler$Context.createFilter(ServletContextHandler.java:1051)
at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:104)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)[50:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:768)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717)
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doStart(HttpServiceContext.java:222)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)[50:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.ops4j.pax.web.service.jetty.internal.JettyServerImpl$1.start(JettyServerImpl.java:204)[59:org.ops4j.pax.web.pax-web-jetty:3.2.6]
at org.ops4j.pax.web.service.internal.HttpServiceStarted.end(HttpServiceStarted.java:1032)[58:org.ops4j.pax.web.pax-web-runtime:3.2.6]
at org.ops4j.pax.web.service.internal.HttpServiceProxy.end(HttpServiceProxy.java:422)[58:org.ops4j.pax.web.pax-web-runtime:3.2.6]
at org.ops4j.pax.web.extender.war.internal.RegisterWebAppVisitorWC.end(RegisterWebAppVisitorWC.java:341)[64:org.ops4j.pax.web.pax-web-extender-war:3.2.6]
at org.ops4j.pax.web.extender.war.internal.model.WebApp.accept(WebApp.java:678)[64:org.ops4j.pax.web.pax-web-extender-war:3.2.6]
at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.register(WebAppPublisher.java:237)[64:org.ops4j.pax.web.pax-web-extender-war:3.2.6]
at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.addingService(WebAppPublisher.java:182)[64:org.ops4j.pax.web.pax-web-extender-war:3.2.6]
at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.addingService(WebAppPublisher.java:135)[64:org.ops4j.pax.web.pax-web-extender-war:3.2.6]
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:932)[karaf-org.osgi.core.jar:]
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:864)[karaf-org.osgi.core.jar:]
at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)[karaf-org.osgi.core.jar:]
at org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:183)[karaf-org.osgi.core.jar:]
at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:317)[karaf-org.osgi.core.jar:]
at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:261)[karaf-org.osgi.core.jar:]
at org.ops4j.pax.web.extender.war.internal.WebAppPublisher.publish(WebAppPublisher.java:101)[64:org.ops4j.pax.web.pax-web-extender-war:3.2.6]
at org.ops4j.pax.web.extender.war.internal.WebObserver.deploy(WebObserver.java:213)[64:org.ops4j.pax.web.pax-web-extender-war:3.2.6]
at org.ops4j.pax.web.extender.war.internal.WebObserver$1.doStart(WebObserver.java:175)[64:org.ops4j.pax.web.pax-web-extender-war:3.2.6]
at org.ops4j.pax.web.extender.war.internal.extender.SimpleExtension.start(SimpleExtension.java:58)[64:org.ops4j.pax.web.pax-web-extender-war:3.2.6]
at org.ops4j.pax.web.extender.war.internal.extender.AbstractExtender$1.run(AbstractExtender.java:266)[64:org.ops4j.pax.web.pax-web-extender-war:3.2.6]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_101]
at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_101]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)[:1.8.0_101]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[:1.8.0_101]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_101]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_101]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_101]
Caused by: java.lang.ClassNotFoundException: org.apache.wicket.request.Request not found by org.apache.wicket.core [180]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)[org.apache.felix.framework-4.2.1.jar:]
at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)[org.apache.felix.framework-4.2.1.jar:]
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)[:1.8.0_101]
... 38 more

Solution

  • Solution mentioned in Starting Wicket web application with OSGi HTTP Service worked, but I had to upgrade wicket to 6.24.0. However new problem appeared - Spring ReloadableResourceBundleMessageSource bean unable to find external properties