java ClassNotFoundException:在嵌入了 cxf 依赖项的 OSGi 包中找不到 org.glassfish.jersey.internal.RuntimeDelegateImpl
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/30316829/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
ClassNotFoundException: org.glassfish.jersey.internal.RuntimeDelegateImpl cannot be found in OSGi bundle which has embedded cxf dependencies
提问by Thusitha Thilina Dayaratne
This is relate to the jax-rs-2-0-change-default-implementationI'm having an OSGi bundle which consist of cxf 2.7.8 as well as openejb. cxf dependencies are added as embedded dependencies.
这与jax-rs-2-0-change-default-implementation 有关,我有一个由 cxf 2.7.8 和 openejb 组成的 OSGi 包。cxf 依赖项被添加为嵌入式依赖项。
When I try to deploy a webapp I'm getting the below exception.
When I set the system property when starting the server as -Djavax.ws.rs.ext.RuntimeDelegate=org.apache.cxf.jaxrs.impl.RuntimeDelegateImpl
this can be solved.
当我尝试部署 Web 应用程序时,出现以下异常。当我在启动服务器时设置系统属性时,-Djavax.ws.rs.ext.RuntimeDelegate=org.apache.cxf.jaxrs.impl.RuntimeDelegateImpl
可以解决这个问题。
But in the above link it says that when I have the META-INF/services/javax.ws.rs.ext.RuntimeDelegate
file with the content as org.apache.cxf.jaxrs.impl.RuntimeDelegateImpl
this can be solved.
但是在上面的链接中,它说当我拥有META-INF/services/javax.ws.rs.ext.RuntimeDelegate
包含内容的文件时,org.apache.cxf.jaxrs.impl.RuntimeDelegateImpl
可以解决这个问题。
In my OSGi bundle that file exist in the cxf-rt-frontend-jaxrs-2.7.8.jar
But this jar is embedded in the OSGi bundle seems that is not getting pick correctly. I tried to add the same file to the OSGi bundle META-INF/services
but it didn't work either.
在我的 OSGi 包中,该文件存在于cxf-rt-frontend-jaxrs-2.7.8.jar
但是这个 jar 嵌入在 OSGi 包中似乎没有正确选择。我试图将相同的文件添加到 OSGi 包中,META-INF/services
但它也不起作用。
Can someone tell me is there a way to get rid of this without manually setting the system property?
有人可以告诉我有没有办法在不手动设置系统属性的情况下摆脱这种情况?
java.lang.ExceptionInInitializerError at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:191) at com.sun.proxy.$Proxy89.(Unknown Source) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at java.lang.reflect.Proxy.newInstance(Proxy.java:764) at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:755) at org.apache.openejb.server.cxf.rs.CxfRSService$ContextBean.(CxfRSService.java:192) at org.apache.openejb.server.cxf.rs.CxfRSService.contextCDIIntegration(CxfRSService.java:111) at org.apache.openejb.server.cxf.rs.CxfRSService.integrateCDIAndJaxRsInjections(CxfRSService.java:100) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.openejb.observer.ObserverManager$MethodInvocation.invoke(ObserverManager.java:400) at org.apache.openejb.observer.ObserverManager.doFire(ObserverManager.java:111) at org.apache.openejb.observer.ObserverManager.fireEvent(ObserverManager.java:100) at org.apache.openejb.loader.SystemInstance.fireEvent(SystemInstance.java:134) at org.apache.openejb.cdi.ThreadSingletonServiceImpl.initialize(ThreadSingletonServiceImpl.java:150) at org.apache.openejb.cdi.CdiBuilder.build(CdiBuilder.java:41) at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:838) at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:644) at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1250) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.wso2.carbon.javaee.tomee.ASTomcatWebAppBuilder.configureStart(ASTomcatWebAppBuilder.java:127) at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:130) at org.wso2.carbon.javaee.tomee.ASGlobalListenerSupport.lifecycleEvent(ASGlobalListenerSupport.java:74) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5412) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649) at org.wso2.carbon.tomcat.internal.CarbonTomcat.addWebApp(CarbonTomcat.java:345) at org.wso2.carbon.tomcat.internal.CarbonTomcat.addWebApp(CarbonTomcat.java:190) at org.wso2.carbon.webapp.mgt.TomcatGenericWebappsDeployer.handleWebappDeployment(TomcatGenericWebappsDeployer.java:257) at org.wso2.carbon.webapp.mgt.TomcatGenericWebappsDeployer.handleWarWebappDeployment(TomcatGenericWebappsDeployer.java:207) at org.wso2.carbon.webapp.mgt.TomcatGenericWebappsDeployer.handleHotDeployment(TomcatGenericWebappsDeployer.java:174) at org.wso2.carbon.webapp.mgt.TomcatGenericWebappsDeployer.deploy(TomcatGenericWebappsDeployer.java:139) at org.wso2.carbon.webapp.mgt.AbstractWebappDeployer.deployThisWebApp(AbstractWebappDeployer.java:204) at org.wso2.carbon.webapp.mgt.AbstractWebappDeployer.deploy(AbstractWebappDeployer.java:111) at org.wso2.carbon.webapp.deployer.WebappDeployer.deploy(WebappDeployer.java:42) at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:136) at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:807) at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:144) at org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:377) at org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:254) at org.apache.axis2.deployment.DeploymentEngine.loadServices(DeploymentEngine.java:135) at org.wso2.carbon.core.CarbonAxisConfigurator.deployServices(CarbonAxisConfigurator.java:567) at org.wso2.carbon.core.internal.DeploymentServerStartupObserver.completingServerStartup(DeploymentServerStartupObserver.java:51) at org.wso2.carbon.core.internal.CarbonCoreServiceComponent.notifyBefore(CarbonCoreServiceComponent.java:235) at org.wso2.carbon.core.internal.StartupFinalizerServiceComponent.completeInitialization(StartupFinalizerServiceComponent.java:185) at org.wso2.carbon.core.internal.StartupFinalizerServiceComponent.serviceChanged(StartupFinalizerServiceComponent.java:288) at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:107) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:861) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:819) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:771) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:214) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:433) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:451) at org.wso2.carbon.throttling.agent.internal.ThrottlingAgentServiceComponent.registerThrottlingAgent(ThrottlingAgentServiceComponent.java:123) at org.wso2.carbon.throttling.agent.internal.ThrottlingAgentServiceComponent.activate(ThrottlingAgentServiceComponent.java:100) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.eclipse.equinox.internal.ds.model.ServiceComponent.activate(ServiceComponent.java:260) at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.activate(ServiceComponentProp.java:146) at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:345) at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:620) at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:197) at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:343) at org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java:222) at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:107) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:861) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:819) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:771) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:214) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:433) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:451) at org.wso2.carbon.core.init.CarbonServerManager.initializeCarbon(CarbonServerManager.java:517) at org.wso2.carbon.core.init.CarbonServerManager.start(CarbonServerManager.java:219) at org.wso2.carbon.core.internal.CarbonCoreServiceComponent.activate(CarbonCoreServiceComponent.java:91) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.eclipse.equinox.internal.ds.model.ServiceComponent.activate(ServiceComponent.java:260) at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.activate(ServiceComponentProp.java:146) at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:345) at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:620) at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:197) at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:343) at org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java:222) at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:107) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:861) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:819) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:771) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:214) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:433) at org.eclipse.equinox.http.servlet.internal.Activator.registerHttpService(Activator.java:81) at org.eclipse.equinox.http.servlet.internal.Activator.addProxyServlet(Activator.java:60) at org.eclipse.equinox.http.servlet.internal.ProxyServlet.init(ProxyServlet.java:40) at org.wso2.carbon.tomcat.ext.servlet.DelegationServlet.init(DelegationServlet.java:38) at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1284) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1197) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1087) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5262) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5550) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: org.glassfish.jersey.internal.RuntimeDelegateImpl cannot be found by tomee_1.7.2.SNAPSHOT_wso2v1 at javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:151) at javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:119) at javax.ws.rs.core.EntityTag.(EntityTag.java:56) ... 131 more Caused by: java.lang.ClassNotFoundException: org.glassfish.jersey.internal.RuntimeDelegateImpl cannot be found by tomee_1.7.2.SNAPSHOT_wso2v1 at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:191) at javax.ws.rs.ext.FactoryFinder.newInstance(FactoryFinder.java:114) at javax.ws.rs.ext.FactoryFinder.find(FactoryFinder.java:207) at javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:134) ... 133 more
java.lang.ExceptionInInitializerError at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:191) at com.sun.proxy.$Proxy89.(Unknown Source) at sun.reflect .NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.structor.reflect.newInstance(DelegatingConstructorAccessorImpl.java:45) .java:526) 在 java.lang.reflect.Proxy.newInstance(Proxy.java:764) 在 java.lang.reflect.Proxy.newProxyInstance(Proxy.java:755) 在 org.apache.openejb.server.cxf。 rs.CxfRSService$ContextBean.(CxfRSService.java:192) 在 org.apache.openejb.server.cxf.rs.CxfRSService.contextCDIIntegration(CxfRSService.java:111) at org.apache.openejb.server.cxf.rs.CxfRSService.integrateCDIAndJaxRsInjections(CxfRSService.java:100) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImplative.Invoke(java) 57) 在 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 在 java.lang.reflect.Method.invoke(Method.java:606) 在 org.apache.openejb.observer.ObserverManager$MethodInvocation.invoke(ObserverManager) .java:400) 在 org.apache.openejb.observer.ObserverManager.doFire(ObserverManager.java:111) 在 org.apache.openejb.observer.ObserverManager.fireEvent(ObserverManager.java:100) 在 org.apache.openejb。 loader.SystemInstance.fireEvent(SystemInstance.java:134) 在 org.apache.openejb.cdi.ThreadSingletonServiceImpl。在 org.apache.openejb.cdi.CdiBuilder.build(CdiBuilder.java:41) 在 org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:838) 在 org. .apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:644) at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1250) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)在 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org. wso2.carbon.javaee.tomee.ASTomcatWebAppBuilder.configureStart(ASTomcatWebAppBuilder.java:127) 在 org.apache.tomee.catalina。GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:130) at org.wso2.carbon.javaee.tomee.ASGlobalListenerSupport.lifecycleEvent(ASGlobalListenerSupport.java:74) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)在 org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) 在 org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5412) 在 org.apache.catalina.util.LifecycleBase.start (LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache。 catalina.core.StandardHost.addChild(StandardHost.java:649) 在 org.wso2.carbon.tomcat.internal.CarbonTomcat。addWebApp(CarbonTomcat.java:345) at org.wso2.carbon.tomcat.internal.CarbonTomcat.addWebApp(CarbonTomcat.java:190) at org.wso2.carbon.webapp.mgt.TomcatGenericWebappsDeployer.handleWebappDeployment(TomcatGenericWebappsDeployer.java:257)在 org.wso2.carbon.webapp.mgt.TomcatGenericWebappsDeployer.handleWarWebappDeployment(TomcatGenericWebappsDeployer.java:207) 在 org.wso2.carbon.webapp.mgt.TomcatGenericWebappsDeployer.handleHotDeployment(TomcatGenericWebappsDeployer.javaorg:17wwebapp2.carbon.carbon .mgt.TomcatGenericWebappsDeployer.deploy(TomcatGenericWebappsDeployer.java:139) at org.wso2.carbon.webapp.mgt.AbstractWebappDeployer.deployThisWebApp(AbstractWebappDeployer.java:204) at org.wso2.carbon.webapp.mgt.AbstractWebapp.mgt.AbstractWebapps .java:111) 在 org.wso2.carbon.webapp。deployer.WebappDeployer.deploy(WebappDeployer.java:42) at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:136) at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine. java:807) 在 org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:144) 在 org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:377) 在 org.apache .axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:254) at org.apache.axis2.deployment.DeploymentEngine.loadServices(DeploymentEngine.java:135) at org.wso2.carbon.core.CarbonAxisConfigurator.deployServices(CarbonAxisConfigurator.java) :567) 在 org.wso2.carbon.core.internal.DeploymentServerStartupObserver.completingServerStartup(DeploymentServerStartupObserver.java:51) 在 org.wso2.carbon.core.internal.CarbonCoreServiceComponent.notifyBefore(CarbonCoreServiceComponent.java:235) 在 org.wso2.carbon.core.internal.StartupFinalizerServiceComponent.completeInitialization(StartupFinalizerServiceComponent.java:185) 在 org.wso2 .carbon.core.internal.StartupFinalizerServiceComponent.serviceChanged(StartupFinalizerServiceComponent.java:288) at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:107) at org.eclipse.osgi.framework.internal.core .BundleContextImpl.dispatchEvent(BundleContextImpl.java:861) 在 org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) 在 org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java) :148) 在 org.eclipse.osgi。internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:819) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:771) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register( ServiceRegistrationImpl.java:130) 在 org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:214) 在 org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:433)在 org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:451) 在 org.wso2.carbon.throttling.agent.internal.ThrottlingAgentServiceComponent.registerThrottlingAgent(ThrottlingAgentServiceComponent.java:123) 在 org.wso2 .碳.节流剂。internal.ThrottlingAgentServiceComponent.activate(ThrottlingAgentServiceComponent.java:100) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImplatingorImplatingorAccessorImplatingorImplatingorAccessor java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.eclipse.equinox.internal.ds.model.ServiceComponent.activate(ServiceComponent.java:260) at org.eclipse.equinox .internal.ds.model.ServiceComponentProp.activate(ServiceComponentProp.java:146) at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:345) at org.eclipse.equinox.internal.ds .InstanceProcess.buildComponent(InstanceProcess.java:620) 在 org.eclipse.equinox.internal.ds。InstanceProcess.buildComponents(InstanceProcess.java:197) at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:343) at org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java: 222) 在 org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:107) 在 org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:861) 在 org.eclipse .osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) 在 org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) 在 org.eclipse.osgi.internal.serviceregistry.ServiceRegistry .publishServiceEventPrivileged(ServiceRegistry.java:819) 在 org.eclipse.osgi.internal.serviceregistry.ServiceRegistry。在 org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130) 在 org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:214) 上发布ServiceEvent(ServiceRegistry.java:771)在 org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:433) 在 org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:451) 在 org.wso2 .carbon.core.init.CarbonServerManager.initializeCarbon(CarbonServerManager.java:517) 在 org.wso2.carbon.core.init.CarbonServerManager.start(CarbonServerManager.java:219) 在 org.wso2.carbon.core.internal.CarbonCoreServiceComponent .activate(CarbonCoreServiceComponent.java:91) 在 sun.reflect.NativeMethodAccessorImpl。invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java: 606) 在 org.eclipse.equinox.internal.ds.model.ServiceComponent.activate(ServiceComponent.java:260) 在 org.eclipse.equinox.internal.ds.model.ServiceComponentProp.activate(ServiceComponentProp.java:146) 在 org .eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:345) at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:620) at org.eclipse.equinox.internal .ds.InstanceProcess.buildComponents(InstanceProcess.java:197) 在 org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:343) 在 org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java:222) 在 org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:107) 在 org.eclipse.osgi .framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:861) 在 org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) 在 org.eclipse.osgi.framework.eventmgr.ListenerQueue .dispatchEventSynchronous(ListenerQueue.java:148) 在 org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:819) 在 org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:771) ) 在 org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl。register(ServiceRegistrationImpl.java:130) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:214) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java: 433) 在 org.eclipse.equinox.http.servlet.internal.Activator.registerHttpService(Activator.java:81) 在 org.eclipse.equinox.http.servlet.internal.Activator.addProxyServlet(Activator.java:60) 在 org .eclipse.equinox.http.servlet.internal.ProxyServlet.init(ProxyServlet.java:40) at org.wso2.carbon.tomcat.ext.servlet.DelegationServlet.init(DelegationServlet.java:38) at org.apache.catalina .core.StandardWrapper.initServlet(StandardWrapper.java:1284) 在 org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1197) 在 org.apache.catalina.core。StandardWrapper.load(StandardWrapper.java:1087) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5262) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5550) at org .apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) 在 org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575) 在 org.apache.catalina.core.ContainerBase$StartChild .call(ContainerBase.java:1565) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent。 ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 在 java.lang.Thread.run(Thread.java:745) 引起:java.lang.RuntimeException:java.lang.ClassNotFoundException:org.在 javax.ws.rs.ext.RuntimeDelegate.getgateInstance(RuntimeDelegate.getgateInstance. java:119) at javax.ws.rs.core.EntityTag.(EntityTag.java:56) ... 131 导致:java.lang.ClassNotFoundException:tomee_1 无法找到 org.glassfish.jersey.internal.RuntimeDelegateImpl .7.2.SNAPSHOT_wso2v1 在 org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501) 在 org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421) 在 org.eclipse .osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412) 在 org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107) 在 java。lang.ClassLoader.loadClass(ClassLoader.java:358) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:191) at javax.ws.rs.ext.FactoryFinder。 newInstance(FactoryFinder.java:114) at javax.ws.rs.ext.FactoryFinder.find(FactoryFinder.java:207) at javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:134) ... 133更多的
回答by mkwyche
Was able to find the answer here: https://wso2.org/jira/browse/WSAS-1870
能够在这里找到答案:https: //wso2.org/jira/browse/WSAS-1870
Basically you need to add a system property for setting the default delegate:
基本上你需要添加一个系统属性来设置默认委托:
javax.ws.rs.ext.RuntimeDelegate=org.apache.cxf.jaxrs.impl.RuntimeDelegateImpl
javax.ws.rs.ext.RuntimeDelegate=org.apache.cxf.jaxrs.impl.RuntimeDelegateImpl
回答by Me_developer
If you are using
如果您正在使用
import javax.ws.rs.core.Response;
导入 javax.ws.rs.core.Response;
then add the following dependency in your 'pom.xml' file. It worked for me..
然后在“pom.xml”文件中添加以下依赖项。它对我有用..
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jersey</artifactId>
<version>1.2.0.RELEASE</version>
</dependency>
回答by Mike
Had a similar issue with Spring Boot 2, Jersey and Eureka. I was able to work around by adding a variation of mkwyche's answer:
Spring Boot 2、Jersey 和 Eureka 也有类似的问题。我能够通过添加 mkwyche 答案的变体来解决:
-Djavax.ws.rs.ext.RuntimeDelegate=com.sun.ws.rs.ext.RuntimeDelegateImpl
回答by Marouan
Had a similar issue with Jax-RS. To fix the problem add this dependency in your pom.xml:
Jax-RS 也有类似的问题。要解决此问题,请在 pom.xml 中添加此依赖项:
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-server</artifactId>
<version>1.8</version>
</dependency>