可选的导入包不在karaf包解析程序内连接jersey media multipart出现问题

xyhw6mcr  于 2021-07-12  发布在  Java
关注(0)|答案(0)|浏览(280)

我对泽西媒体有意见-multipart:2.30.1 dependency. 我正在尝试在jersey服务器中注册multipartfeature.class。在我注册功能后,我的karaf包抛出激活错误。jersey media multipart bundle内部找不到org.glassfish.jersey.server.spi.internal.valueparamprovider类。您可以在下面查看问题日志。

Component Description: com.ericsson.bss.cus.core.application.rest.registrator.ResourceRegistratorService
========================================================================================================
Class:         com.ericsson.bss.cus.core.application.rest.registrator.ResourceRegistratorService
Bundle:        291 (com.ericsson.bss.cus.core.application.rest.registrator:0.6.0.SNAPSHOT)
Enabled:       true
Immediate:     true
Services:      [com.ericsson.bss.cus.core.application.rest.registrator.ResourceRegistratorService]
Scope:         singleton
Config PID(s): [com.ericsson.bss.cus.core.application.rest.registrator.ResourceRegistratorService], Policy: optional
Base Props:    (0 entries)

Component Configuration Id: 68
------------------------------
State:        FAILED ACTIVATION
Service:      347 [com.ericsson.bss.cus.core.application.rest.registrator.ResourceRegistratorService]
Config Props: (2 entries)
  component.id<Long> = 68
  component.name<String> = com.ericsson.bss.cus.core.application.rest.registrator.ResourceRegistratorService
References:   (total 1)
  - HttpService: org.osgi.service.http.HttpService SATISFIED 1..1 static
    target=(*) scope=bundle (1 binding):
    * Bound to [250] from bundle 87 (org.ops4j.pax.web.pax-web-runtime:7.2.11)
Failure:      java.lang.NoClassDefFoundError: org/glassfish/jersey/server/spi/internal/ValueParamProvider
        at org.glassfish.jersey.media.multipart.internal.FormDataParamInjectionFeature.configure(FormDataParamInjectionFeature.java:44)
        at org.glassfish.jersey.model.internal.CommonConfig.configureFeatures(CommonConfig.java:713)
        at org.glassfish.jersey.model.internal.CommonConfig.configureFeatures(CommonConfig.java:721)
        at org.glassfish.jersey.model.internal.CommonConfig.configureMetaProviders(CommonConfig.java:632)
        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 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:656)
        at org.eclipse.jetty.servlet.ServletHolder.initialize(ServletHolder.java:421)
        at org.eclipse.jetty.servlet.ServletHandler.lambda$initialize$0(ServletHandler.java:746)
        at java.base/java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:357)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
        at java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:312)
        at java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:735)
        at java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:734)
        at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)
        at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:739)
        at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:361)
        at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.startContext(HttpServiceContext.java:391)
        at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:821)
        at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:276)
        at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doStart(HttpServiceContext.java:267)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
        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:252)
        at org.ops4j.pax.web.service.internal.HttpServiceStarted.registerServlet(HttpServiceStarted.java:223)
        at org.ops4j.pax.web.service.internal.HttpServiceStarted.registerServlet(HttpServiceStarted.java:207)
        at org.ops4j.pax.web.service.internal.HttpServiceProxy.registerServlet(HttpServiceProxy.java:69)
        at com.ericsson.bss.cus.core.application.rest.registrator.ResourceRegistratorService.initApp(ResourceRegistratorService.java:101)
        at com.ericsson.bss.cus.core.application.rest.registrator.ResourceRegistratorService.activate(ResourceRegistratorService.java:61)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.apache.felix.scr.impl.inject.methods.BaseMethod.invokeMethod(BaseMethod.java:228)
        at org.apache.felix.scr.impl.inject.methods.BaseMethod.access$500(BaseMethod.java:41)
        at org.apache.felix.scr.impl.inject.methods.BaseMethod$Resolved.invoke(BaseMethod.java:664)
        at org.apache.felix.scr.impl.inject.methods.BaseMethod.invoke(BaseMethod.java:510)
        at org.apache.felix.scr.impl.inject.methods.ActivateMethod.invoke(ActivateMethod.java:317)
        at org.apache.felix.scr.impl.inject.methods.ActivateMethod.invoke(ActivateMethod.java:307)
        at org.apache.felix.scr.impl.manager.SingleComponentManager.createImplementationObject(SingleComponentManager.java:340)
        at org.apache.felix.scr.impl.manager.SingleComponentManager.createComponent(SingleComponentManager.java:114)
        at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:982)
        at org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal(SingleComponentManager.java:955)
        at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:756)
        at org.apache.felix.scr.impl.manager.AbstractComponentManager.enableInternal(AbstractComponentManager.java:666)
        at org.apache.felix.scr.impl.manager.AbstractComponentManager.enable(AbstractComponentManager.java:432)
        at org.apache.felix.scr.impl.manager.ConfigurableComponentHolder.enableComponents(ConfigurableComponentHolder.java:665)
        at org.apache.felix.scr.impl.BundleComponentActivator.initialEnable(BundleComponentActivator.java:338)
        at org.apache.felix.scr.impl.Activator.loadComponents(Activator.java:382)
        at org.apache.felix.scr.impl.Activator.access$200(Activator.java:49)
        at org.apache.felix.scr.impl.Activator$ScrExtension.start(Activator.java:264)
        at org.apache.felix.scr.impl.AbstractExtender.createExtension(AbstractExtender.java:196)
        at org.apache.felix.scr.impl.AbstractExtender.modifiedBundle(AbstractExtender.java:169)
        at org.apache.felix.scr.impl.AbstractExtender.modifiedBundle(AbstractExtender.java:49)
        at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:482)
        at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:415)
        at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:232)
        at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:444)
        at org.apache.felix.framework.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:915)
        at org.apache.felix.framework.EventDispatcher.fireEventImmediately(EventDispatcher.java:834)
        at org.apache.felix.framework.EventDispatcher.fireBundleEvent(EventDispatcher.java:516)
        at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4579)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:2174)
        at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998)
        at org.apache.karaf.bundle.command.Start.executeOnBundle(Start.java:38)
        at org.apache.karaf.bundle.command.BundlesCommand.doExecute(BundlesCommand.java:65)
        at org.apache.karaf.bundle.command.BundlesCommand.execute(BundlesCommand.java:55)
        at org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:84)
        at org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:68)
        at org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:86)
        at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:599)
        at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:526)
        at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:415)
        at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:416)
        at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229)
        at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.ClassNotFoundException: org.glassfish.jersey.server.spi.internal.ValueParamProvider not found by org.glassfish.jersey.media.jersey-media-multipart [211]
        at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1639)
        at org.apache.felix.framework.BundleWiringImpl.access$200(BundleWiringImpl.java:80)
        at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2053)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
        ... 91 more

过了一段时间,我可以在jersey media multipart pom.xml中发现jersey server是可选的。内部清单头也可以作为可选导入org.glassfish.jersey.server.spi.internal包。



我在jersey media multipart中手动编辑了manifest文件,karaf包激活时没有出错。在karaf内部,它可以从jersey服务器找到类。这是卡拉夫的问题还是泽西岛的问题?
我尝试了一些解决方案,但没有奏效。
试图使用,wrap:mvn:org.glassfish.jersey.media/jersey media multipart/2.30.1/$bundle symbolicname=jersey media multipart&import package=org.glassfish.jersey.server.spi.internal,!*但是没有导入包选项来 Package 包。
在karafmaven插件中尝试了includetransitivedependency选项,但它是不同的。
javax servelet、jersey服务器和ect服务器依赖项。。尝试切换提供的范围和其他选项,但不起作用。
你们能帮我找到这个吗?。。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题