Provider org.apache.tomcat.websocket.server.DefaultServerEndpointConfigurator not found [message #1778326] |
Wed, 13 December 2017 02:50  |
Eclipse User |
|
|
|
Hi,
I hope this is the right place to ask this.
Using: virgo-tomcat-server-3.7.1.RELEASE
In my OSGi-bundle-project I am using
javax.websocket.server.ServerEndpointConfig$Configurator
for creating websocket-endpoints.
When starting the bundle via its Activator, I am calling
javax.websocket.server.ServerContainer#addEndpoint
which at runtime is processed by the object/method
org.apache.tomcat.websocket.server.WsServerContainer#addEndpoint
This results in the following stacktrace:
[2017-12-13 08:33:59.189] TCP Connection(16)-127.0.0.1 <DE0006E> Start failed for bundle 'my.bundle' version '1.1.2'. org.eclipse.virgo.nano.deployer.api.core.DeploymentException: BundleException
at org.eclipse.virgo.kernel.install.artifact.internal.bundle.StandardBundleDriver.startBundle(StandardBundleDriver.java:199)
at org.eclipse.virgo.kernel.install.artifact.internal.bundle.StandardBundleDriver.start(StandardBundleDriver.java:178)
at org.eclipse.virgo.kernel.install.artifact.internal.bundle.StandardBundleInstallArtifact.doStart(StandardBundleInstallArtifact.java:310)
at org.eclipse.virgo.kernel.install.artifact.internal.AbstractInstallArtifact.driveDoStart(AbstractInstallArtifact.java:231)
at org.eclipse.virgo.kernel.install.artifact.internal.bundle.StandardBundleInstallArtifact.start(StandardBundleInstallArtifact.java:299)
at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.start(PipelinedApplicationDeployer.java:375)
at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.deploy(PipelinedApplicationDeployer.java:258)
at org.eclipse.virgo.kernel.deployer.management.StandardDeployer.deploy(StandardDeployer.java:52)
at sun.reflect.GeneratedMethodAccessor78.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71)
at sun.reflect.GeneratedMethodAccessor72.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275)
at com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenReturn(ConvertingMethod.java:193)
at com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenReturn(ConvertingMethod.java:175)
at com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIntrospector.java:117)
at com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIntrospector.java:54)
at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:237)
at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:138)
at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:252)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1471)
at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76)
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1312)
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1404)
at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:832)
at sun.reflect.GeneratedMethodAccessor77.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:323)
at sun.rmi.transport.Transport$1.run(Transport.java:200)
at sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$256(TCPTransport.java:683)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.osgi.framework.BundleException: Exception in my.bundle.Activator.start() of bundle my.bundle.
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:300)
at org.eclipse.virgo.nano.core.internal.StandardBundleStarter.start(StandardBundleStarter.java:57)
at org.eclipse.virgo.nano.core.internal.StandardBundleStarter.start(StandardBundleStarter.java:45)
at sun.reflect.GeneratedMethodAccessor66.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56)
at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
at com.sun.proxy.$Proxy45.start(Unknown Source)
at org.eclipse.virgo.kernel.install.artifact.internal.bundle.StandardBundleDriver.startBundle(StandardBundleDriver.java:197)
... 45 common frames omitted
Caused by: java.util.ServiceConfigurationError: javax.websocket.server.ServerEndpointConfig$Configurator: Provider org.apache.tomcat.websocket.server.DefaultServerEndpointConfigurator not found
at java.util.ServiceLoader.fail(ServiceLoader.java:239)
at java.util.ServiceLoader.access$300(ServiceLoader.java:185)
at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:372)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
at javax.websocket.server.ServerEndpointConfig$Configurator.loadDefault(ServerEndpointConfig.java:168)
at javax.websocket.server.ServerEndpointConfig$Configurator.fetchContainerDefaultConfigurator(ServerEndpointConfig.java:152)
at javax.websocket.server.ServerEndpointConfig$Builder.<init>(ServerEndpointConfig.java:69)
at javax.websocket.server.ServerEndpointConfig$Builder.create(ServerEndpointConfig.java:57)
at org.apache.tomcat.websocket.server.WsServerContainer.addEndpoint(WsServerContainer.java:227)
at my.bundle.WebSocketServlet.publishEndpoint(WebSocketServlet.java:294)
at my.bundle.Activator$EndpointPublisherServiceTrackerCustomizer.addingService(Activator.java:26)
at my.bundle.Activator$EndpointPublisherServiceTrackerCustomizer.addingService(Activator.java:21)
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:932)
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:1)
at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
at org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:183)
at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:317)
at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:261)
at my.bundle.Activator.start(Activator.java:54)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
... 68 common frames omitted
When looking at the StackTrace, I found out that the Provider for the ServiceLoader is located in the .jar file
org.apache.tomcat.websocket_8.5.11.jar
in the path
Looking at the .jar itself its setup looks alright: META-INF/services has the required SLI file and the class itself exists aswell.
And maybe the worst of all: Everything works fine when trying to publish the exact same bundle to a "virgo-tocmat-server-3.7.0.RELEASE" on another PC.
I don't know, maybe some configuration for my local 3.7.1 Installation needs to be fixed.
Can you help me to figure out how to resolve this error?
Thanks and Greetings,
Lukas Höllein
|
|
|
|
|
|
|
|
Re: Provider org.apache.tomcat.websocket.server.DefaultServerEndpointConfigurator not found [message #1778756 is a reply to message #1778508] |
Wed, 20 December 2017 18:12   |
Eclipse User |
|
|
|
Lukas Höllein wrote on Fri, 15 December 2017 12:26Hi Dani,
ok I attached some files.
I hope this helps you to better unterstand my problem.
I have two bundles:
1. Server - requires websocket. Consists of "server-pom.xml", "server-Activator.java"
2. websocket. Consists of "websocket-pom.xml", "EndpointPublisher.java", "WebSocketServlet.java"
The error occurs, when trying to start the "Server" bundle via its activator.
In its activator, the "websocket" bundle is referenced.
In "WebSocketServlet" I created a comment starting with "$ERROR_HERE$".
Thats the line of code where the last code of me gets executed before the "Provider not found" error.
Thanks for your help,
Lukas
Why do you try to provide your own server? Is there any requirement about that?
Virgo Server for Apache Tomcat supports websockets.
Regards,
Violeta
|
|
|
Re: Provider org.apache.tomcat.websocket.server.DefaultServerEndpointConfigurator not found [message #1778757 is a reply to message #1778756] |
Wed, 20 December 2017 18:52  |
Eclipse User |
|
|
|
Just tested this very simple example (attached) and I am able to see
[2017-12-21 01:43:13.313] INFO iLogServiceListener@2f7f143d org.osgi.service.log.LogService Bundle websocket_0.0.0, Service 254, ServiceEvent REGISTERED
[2017-12-21 01:43:13.313] INFO start-signalling-3 org.eclipse.virgo.medic.eventlog.default WE0001I Started web bundle 'websocket' version '0.0.0' with context path '/websocket'.
[2017-12-21 01:43:13.314] INFO start-signalling-3 org.eclipse.virgo.medic.eventlog.default DE0005I Started bundle 'websocket' version '0.0.0'.
[2017-12-21 01:43:13.314] INFO start-signalling-3 o.e.v.k.i.artifact.internal.bundle.BundleThreadContextManager Thread context class loader 'KernelBundleClassLoader: [bundle=websocket_0.0.0]' popped and set to 'KernelBundleClassLoader: [bundle=websocket_0.0.0]'
[2017-12-21 01:47:38.612] INFO tp-nio-127.0.0.1-8080-exec-3 System.out test.endpoint.Endpoint.onOpen
[2017-12-21 01:47:38.616] INFO tp-nio-127.0.0.1-8080-exec-3 System.out test.endpoint.Endpoint.onMessage
[2017-12-21 01:47:38.618] INFO tp-nio-127.0.0.1-8080-exec-8 System.out test.endpoint.Endpoint.onClose
[2017-12-21 01:47:39.957] INFO tp-nio-127.0.0.1-8080-exec-2 System.out test.endpoint.Endpoint.onOpen
[2017-12-21 01:47:39.958] INFO tp-nio-127.0.0.1-8080-exec-5 System.out test.endpoint.Endpoint.onMessage
[2017-12-21 01:47:39.964] INFO tp-nio-127.0.0.1-8080-exec-7 System.out test.endpoint.Endpoint.onClose
just put the war archive in the pickup folder and that's it
|
|
|
Powered by
FUDForum. Page generated in 0.05066 seconds