steinarb / jersey-demo

This is a karaf application that demonstrates using Jersey to provide a REST API in karaf, and demonstrates how OSGi services can be injected into Jersey resources created by the Jersey framework.
https://steinar.bang.priv.no/2018/08/03/use-jersey-to-provide-rest-apis-from-karaf-applications/
Apache License 2.0
4 stars 4 forks source link

Getting 404 in /counter api #4

Open akrain opened 3 years ago

akrain commented 3 years ago

Followed all the steps mentioned in the Readme with karaf 4.2.11. The feature got installed and Web UI comes up after that. Clicking on the increment button doesn't do anything. In the browser network console, I can see HTTP 404 for the /counter (GET as well as POST) API calls. Here is a sample response for the same:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 404 Not Found</title>
</head>
<body><h2>HTTP ERROR 404 Not Found</h2>
<table>
<tr><th>URI:</th><td>/jerseyinkaraf/api/counter</td></tr>
<tr><th>STATUS:</th><td>404</td></tr>
<tr><th>MESSAGE:</th><td>Not Found</td></tr>
<tr><th>SERVLET:</th><td>-</td></tr>
</table>
<hr><a href="https://eclipse.org/jetty">Powered by Jetty:// 9.4.38.v20210224</a><hr/>

</body>
</html>

Upon further inspection, found thiserror in karaf logs:

10:08:24.746 ERROR [paxweb-config-1-thread-1] Bundle no.priv.bang.demos.jerseyinkaraf.jerseyinkaraf.webapi [69] EventDispatcher: Error during dispatch. (java.lang.NoClassDefFoundError: com/sun/xml/bind/v2/model/annotation/AnnotationReader)
java.lang.NoClassDefFoundError: com/sun/xml/bind/v2/model/annotation/AnnotationReader
    at java.lang.ClassLoader.defineClass1(Native Method) ~[?:1.8.0_282]
    at java.lang.ClassLoader.defineClass(ClassLoader.java:757) ~[?:1.8.0_282]
    at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.defineClass(BundleWiringImpl.java:2410) ~[?:?]
    at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2194) ~[?:?]
    at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1607) ~[?:?]
    at org.apache.felix.framework.BundleWiringImpl.access$200(BundleWiringImpl.java:80) ~[?:?]
    at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2053) ~[?:?]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:352) ~[?:1.8.0_282]
    at java.lang.Class.getDeclaredMethods0(Native Method) ~[?:1.8.0_282]
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) ~[?:1.8.0_282]
    at java.lang.Class.privateGetMethodRecursive(Class.java:3048) ~[?:1.8.0_282]
    at java.lang.Class.getMethod0(Class.java:3018) ~[?:1.8.0_282]
    at java.lang.Class.getMethod(Class.java:1784) ~[?:1.8.0_282]
    at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:137) ~[?:1.8.0_282]
    at javax.xml.bind.ContextFinder.find(ContextFinder.java:310) ~[?:1.8.0_282]
    at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:431) ~[?:1.8.0_282]
    at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:394) ~[?:1.8.0_282]
    at org.glassfish.jersey.server.wadl.internal.WadlApplicationContextImpl.getJAXBContextFromWadlGenerator(WadlApplicationContextImpl.java:121) ~[?:?]
    at org.glassfish.jersey.server.wadl.internal.WadlApplicationContextImpl.isJaxbImplAvailable(WadlApplicationContextImpl.java:270) ~[?:?]
    at org.glassfish.jersey.server.wadl.WadlFeature.configure(WadlFeature.java:65) ~[?:?]
    at org.glassfish.jersey.model.internal.CommonConfig.configureFeatures(CommonConfig.java:728) ~[?:?]
    at org.glassfish.jersey.model.internal.CommonConfig.configureMetaProviders(CommonConfig.java:647) ~[?:?]
    at org.glassfish.jersey.server.ResourceConfig.configureMetaProviders(ResourceConfig.java:823) ~[?:?]
    at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:328) ~[?:?]
    at org.glassfish.jersey.server.ApplicationHandler.lambda$initialize$1(ApplicationHandler.java:293) ~[?:?]
    at org.glassfish.jersey.internal.Errors.process(Errors.java:292) ~[?:?]
    at org.glassfish.jersey.internal.Errors.process(Errors.java:274) ~[?:?]
    at org.glassfish.jersey.internal.Errors.processWithException(Errors.java:232) ~[?:?]
    at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:292) ~[?:?]
    at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:259) ~[?:?]
    at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:311) ~[?:?]
    at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:154) ~[?:?]
    at no.priv.bang.servlet.jersey.JerseyServlet.init(JerseyServlet.java:87) ~[?:?]
    at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:347) ~[?:?]
    at javax.servlet.GenericServlet.init(GenericServlet.java:244) ~[?:?]
    at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:624) ~[?:?]
    at org.eclipse.jetty.servlet.ServletHolder.initialize(ServletHolder.java:407) ~[?:?]
    at org.eclipse.jetty.servlet.ServletHandler.lambda$initialize$0(ServletHandler.java:731) ~[?:?]
    at java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:357) ~[?:1.8.0_282]
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:483) ~[?:1.8.0_282]
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) ~[?:1.8.0_282]
    at java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:313) ~[?:1.8.0_282]
    at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:743) ~[?:1.8.0_282]
    at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:647) ~[?:1.8.0_282]
    at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:755) ~[?:?]
    at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:379) ~[?:?]
    at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.startContext(HttpServiceContext.java:396) ~[?:?]
    at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:911) ~[?:?]
    at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:288) ~[?:?]
    at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doStart(HttpServiceContext.java:272) ~[?:?]
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73) ~[?:?]
    at org.ops4j.pax.web.service.jetty.internal.JettyServerImpl$1.start(JettyServerImpl.java:329) ~[?:?]
    at org.ops4j.pax.web.service.internal.HttpServiceStarted.registerServlet(HttpServiceStarted.java:255) ~[?:?]
    at org.ops4j.pax.web.service.internal.HttpServiceStarted.registerServlet(HttpServiceStarted.java:226) ~[?:?]
    at org.ops4j.pax.web.service.internal.HttpServiceStarted.registerServlet(HttpServiceStarted.java:210) ~[?:?]
    at org.ops4j.pax.web.service.internal.HttpServiceProxy.registerServlet(HttpServiceProxy.java:69) ~[?:?]
    at org.ops4j.pax.web.extender.whiteboard.internal.element.ServletWebElement.register(ServletWebElement.java:97) ~[?:?]
    at org.ops4j.pax.web.extender.whiteboard.internal.WebApplication.registerWebElement(WebApplication.java:392) ~[?:?]
    at org.ops4j.pax.web.extender.whiteboard.internal.WebApplication.registerWebElements(WebApplication.java:371) ~[?:?]
    at org.ops4j.pax.web.extender.whiteboard.internal.WebApplication.registerHttpContext(WebApplication.java:283) ~[?:?]
    at org.ops4j.pax.web.extender.whiteboard.internal.WebApplication.serviceChanged(WebApplication.java:232) ~[?:?]
    at org.ops4j.pax.web.extender.whiteboard.internal.WebApplication.serviceChanged(WebApplication.java:68) ~[?:?]
    at org.ops4j.pax.web.extender.whiteboard.internal.util.tracker.ReplaceableService.bind(ReplaceableService.java:86) ~[?:?]
    at org.ops4j.pax.web.extender.whiteboard.internal.util.tracker.ReplaceableService$Customizer.addingService(ReplaceableService.java:105) ~[?:?]
    at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941) ~[osgi.core-6.0.0.jar:?]
    at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:870) ~[osgi.core-6.0.0.jar:?]
    at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256) ~[osgi.core-6.0.0.jar:?]
    at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229) ~[osgi.core-6.0.0.jar:?]
    at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:901) ~[osgi.core-6.0.0.jar:?]
    at org.apache.felix.framework.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:990) ~[?:?]
    at org.apache.felix.framework.EventDispatcher.fireEventImmediately(EventDispatcher.java:838) ~[?:?]
    at org.apache.felix.framework.EventDispatcher.fireServiceEvent(EventDispatcher.java:545) ~[?:?]
    at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4595) ~[?:?]
    at org.apache.felix.framework.Felix.registerService(Felix.java:3587) ~[?:?]
    at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:348) ~[?:?]
    at org.ops4j.pax.web.service.internal.Activator.updateController(Activator.java:381) ~[?:?]
    at org.ops4j.pax.web.service.internal.Activator.lambda$scheduleUpdateFactory$1(Activator.java:299) ~[?:?]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_282]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_282]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_282]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_282]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_282]
Caused by: java.lang.ClassNotFoundException: com.sun.xml.bind.v2.model.annotation.AnnotationReader
    at java.net.URLClassLoader.findClass(URLClassLoader.java:382) ~[?:1.8.0_282]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:419) ~[?:1.8.0_282]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:352) ~[?:1.8.0_282]
    at org.apache.felix.framework.BundleWiringImpl.doImplicitBootDelegation(BundleWiringImpl.java:1859) ~[?:?]
    at org.apache.felix.framework.BundleWiringImpl.tryImplicitBootDelegation(BundleWiringImpl.java:1788) ~[?:?]
    at org.apache.felix.framework.BundleWiringImpl.searchDynamicImports(BundleWiringImpl.java:1741) ~[?:?]
    at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1617) ~[?:?]
    at org.apache.felix.framework.BundleWiringImpl.access$200(BundleWiringImpl.java:80) ~[?:?]
    at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2053) ~[?:?]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:352) ~[?:1.8.0_282]
    ... 82 more
10:08:24.753 ERROR [FelixDispatchQueue] FrameworkEvent ERROR
java.lang.NoClassDefFoundError: com/sun/xml/bind/v2/model/annotation/AnnotationReader
    at java.lang.ClassLoader.defineClass1(Native Method) ~[?:1.8.0_282]
    at java.lang.ClassLoader.defineClass(ClassLoader.java:757) ~[?:1.8.0_282]
    at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.defineClass(BundleWiringImpl.java:2410) ~[?:?]
    at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2194) ~[?:?]
    at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1607) ~[?:?]
    at org.apache.felix.framework.BundleWiringImpl.access$200(BundleWiringImpl.java:80) ~[?:?]
    at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2053) ~[?:?]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:352) ~[?:1.8.0_282]
    at java.lang.Class.getDeclaredMethods0(Native Method) ~[?:1.8.0_282]
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) ~[?:1.8.0_282]
    at java.lang.Class.privateGetMethodRecursive(Class.java:3048) ~[?:1.8.0_282]
    at java.lang.Class.getMethod0(Class.java:3018) ~[?:1.8.0_282]
    at java.lang.Class.getMethod(Class.java:1784) ~[?:1.8.0_282]
    at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:137) ~[?:1.8.0_282]
    at javax.xml.bind.ContextFinder.find(ContextFinder.java:310) ~[?:1.8.0_282]
    at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:431) ~[?:1.8.0_282]
    at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:394) ~[?:1.8.0_282]
    at org.glassfish.jersey.server.wadl.internal.WadlApplicationContextImpl.getJAXBContextFromWadlGenerator(WadlApplicationContextImpl.java:121) ~[?:?]
    at org.glassfish.jersey.server.wadl.internal.WadlApplicationContextImpl.isJaxbImplAvailable(WadlApplicationContextImpl.java:270) ~[?:?]
    at org.glassfish.jersey.server.wadl.WadlFeature.configure(WadlFeature.java:65) ~[?:?]
    at org.glassfish.jersey.model.internal.CommonConfig.configureFeatures(CommonConfig.java:728) ~[?:?]
    at org.glassfish.jersey.model.internal.CommonConfig.configureMetaProviders(CommonConfig.java:647) ~[?:?]
    at org.glassfish.jersey.server.ResourceConfig.configureMetaProviders(ResourceConfig.java:823) ~[?:?]
    at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:328) ~[?:?]
    at org.glassfish.jersey.server.ApplicationHandler.lambda$initialize$1(ApplicationHandler.java:293) ~[?:?]
    at org.glassfish.jersey.internal.Errors.process(Errors.java:292) ~[?:?]
    at org.glassfish.jersey.internal.Errors.process(Errors.java:274) ~[?:?]
    at org.glassfish.jersey.internal.Errors.processWithException(Errors.java:232) ~[?:?]
    at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:292) ~[?:?]
    at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:259) ~[?:?]
    at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:311) ~[?:?]
    at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:154) ~[?:?]
    at no.priv.bang.servlet.jersey.JerseyServlet.init(JerseyServlet.java:87) ~[?:?]
    at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:347) ~[?:?]
    at javax.servlet.GenericServlet.init(GenericServlet.java:244) ~[?:?]
    at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:624) ~[?:?]
    at org.eclipse.jetty.servlet.ServletHolder.initialize(ServletHolder.java:407) ~[?:?]
    at org.eclipse.jetty.servlet.ServletHandler.lambda$initialize$0(ServletHandler.java:731) ~[?:?]
    at java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:357) ~[?:1.8.0_282]
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:483) ~[?:1.8.0_282]
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) ~[?:1.8.0_282]
    at java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:313) ~[?:1.8.0_282]
    at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:743) ~[?:1.8.0_282]
    at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:647) ~[?:1.8.0_282]
    at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:755) ~[?:?]
    at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:379) ~[?:?]
    at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.startContext(HttpServiceContext.java:396) ~[?:?]
    at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:911) ~[?:?]
    at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:288) ~[?:?]
    at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doStart(HttpServiceContext.java:272) ~[?:?]
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73) ~[?:?]
    at org.ops4j.pax.web.service.jetty.internal.JettyServerImpl$1.start(JettyServerImpl.java:329) ~[?:?]
    at org.ops4j.pax.web.service.internal.HttpServiceStarted.registerServlet(HttpServiceStarted.java:255) ~[?:?]
    at org.ops4j.pax.web.service.internal.HttpServiceStarted.registerServlet(HttpServiceStarted.java:226) ~[?:?]
    at org.ops4j.pax.web.service.internal.HttpServiceStarted.registerServlet(HttpServiceStarted.java:210) ~[?:?]
    at org.ops4j.pax.web.service.internal.HttpServiceProxy.registerServlet(HttpServiceProxy.java:69) ~[?:?]
    at org.ops4j.pax.web.extender.whiteboard.internal.element.ServletWebElement.register(ServletWebElement.java:97) ~[?:?]
    at org.ops4j.pax.web.extender.whiteboard.internal.WebApplication.registerWebElement(WebApplication.java:392) ~[?:?]
    at org.ops4j.pax.web.extender.whiteboard.internal.WebApplication.registerWebElements(WebApplication.java:371) ~[?:?]
    at org.ops4j.pax.web.extender.whiteboard.internal.WebApplication.registerHttpContext(WebApplication.java:283) ~[?:?]
    at org.ops4j.pax.web.extender.whiteboard.internal.WebApplication.serviceChanged(WebApplication.java:232) ~[?:?]
    at org.ops4j.pax.web.extender.whiteboard.internal.WebApplication.serviceChanged(WebApplication.java:68) ~[?:?]
    at org.ops4j.pax.web.extender.whiteboard.internal.util.tracker.ReplaceableService.bind(ReplaceableService.java:86) ~[?:?]
    at org.ops4j.pax.web.extender.whiteboard.internal.util.tracker.ReplaceableService$Customizer.addingService(ReplaceableService.java:105) ~[?:?]
    at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941) ~[osgi.core-6.0.0.jar:?]
    at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:870) ~[osgi.core-6.0.0.jar:?]
    at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256) ~[osgi.core-6.0.0.jar:?]
    at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229) ~[osgi.core-6.0.0.jar:?]
    at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:901) ~[osgi.core-6.0.0.jar:?]
    at org.apache.felix.framework.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:990) ~[?:?]
    at org.apache.felix.framework.EventDispatcher.fireEventImmediately(EventDispatcher.java:838) ~[?:?]
    at org.apache.felix.framework.EventDispatcher.fireServiceEvent(EventDispatcher.java:545) ~[?:?]
    at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4595) ~[?:?]
    at org.apache.felix.framework.Felix.registerService(Felix.java:3587) ~[?:?]
    at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:348) ~[?:?]
    at org.ops4j.pax.web.service.internal.Activator.updateController(Activator.java:381) ~[?:?]
    at org.ops4j.pax.web.service.internal.Activator.lambda$scheduleUpdateFactory$1(Activator.java:299) ~[?:?]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_282]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_282]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_282]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_282]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_282]
Caused by: java.lang.ClassNotFoundException: com.sun.xml.bind.v2.model.annotation.AnnotationReader
    at java.net.URLClassLoader.findClass(URLClassLoader.java:382) ~[?:1.8.0_282]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:419) ~[?:1.8.0_282]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:352) ~[?:1.8.0_282]
    at org.apache.felix.framework.BundleWiringImpl.doImplicitBootDelegation(BundleWiringImpl.java:1859) ~[?:?]
    at org.apache.felix.framework.BundleWiringImpl.tryImplicitBootDelegation(BundleWiringImpl.java:1788) ~[?:?]
    at org.apache.felix.framework.BundleWiringImpl.searchDynamicImports(BundleWiringImpl.java:1741) ~[?:?]
    at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1617) ~[?:?]
    at org.apache.felix.framework.BundleWiringImpl.access$200(BundleWiringImpl.java:80) ~[?:?]
    at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2053) ~[?:?]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:352) ~[?:1.8.0_282]
    ... 82 more
akrain commented 3 years ago

To add more context, I am using Azul JDK 8

akrain commented 3 years ago

I was able to fix the issue by replacing the following dependencies

        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-core</artifactId>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-impl</artifactId>
        </dependency>

with

        <dependency>
            <groupId>org.glassfish.jaxb</groupId>
            <artifactId>jaxb-runtime</artifactId>
            <version>2.2.11</version>
        </dependency>
steinarb commented 3 years ago

Hi,

I have no idea what Azul JDK 8 is, :-)

But FWIW I haven't tried running on anything older than JDK 11 for a long time now.

The com.sun.xml.bind dependencies is stuff that used to be part of the runtime up and including Java 8, and had to be included extra when moving to Java 11. No idea why adding that give a classNotFound...? I can't remember that from when I still was using java 8 on some computers.

I've also no idea why you needed to add jaxb-runtime. And I'm also curious why that version did work...?

Jersey, and all of its dependencies, are pulled in by this karaf feature: https://github.com/steinarb/jersey-karaf-feature and that feature currently pulls in jersey 2.33.