GitHub user Ethanlm opened a pull request:
https://github.com/apache/storm/pull/2449
[STORM-2846] Add extra classpath for nimbus and supervisor separately
https://issues.apache.org/jira/browse/STORM-2846
Currently we have STORM_EXT_CLASSPATH_DAEMON and STORM_EXT_CLASSPATH for
extra classpath. We might want to have extra classpath for nimbus and
supervisor specifically. One of the issue I am facing with is about setting up
HdfsBlobstore. I point STORM_EXT_CLASSPATH_DAEMON to the classpath of existing
hadoop cluster. But because the hadoop classpath includes jersey-core-1.9,
storm logviewer and drpc server failed to run (since storm uses jersey-2.x).
```
java.lang.Error: java.lang.NoSuchMethodError:
javax.ws.rs.core.Application.getProperties()Ljava/util/Map;
at
org.apache.storm.utils.Utils.handleUncaughtException(Utils.java:568)
~[storm-client-2.0.0.y.jar:2.0.0.y]
at
org.apache.storm.utils.Utils.handleUncaughtException(Utils.java:547)
~[storm-client-2.0.0.y.jar:2.0.0.y]
at org.apache.storm.utils.Utils$5.uncaughtException(Utils.java:877)
~[storm-client-2.0.0.y.jar:2.0.0.y]
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1057)
~[?:1.8.0_131]
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1052)
~[?:1.8.0_131]
at java.lang.Thread.dispatchUncaughtException(Thread.java:1959)
[?:1.8.0_131]
Caused by: java.lang.NoSuchMethodError:
javax.ws.rs.core.Application.getProperties()Ljava/util/Map;
at
org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:331)
~[jersey-server-2.24.1.jar:?]
at
org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:392)
~[jersey-container-servlet-core-2.24.1.jar:?]
at
org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:177)
~[jersey-container-servlet-core-2.24.1.jar:?]
at
org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:369)
~[jersey-container-servlet-core-2.24.1.jar:?]
at javax.servlet.GenericServlet.init(GenericServlet.java:244)
~[javax.servlet-api-3.1.0.jar:3.1.0]
at
org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:637)
~[jetty-servlet-9.4.7.v20170914.jar:9.4.7.v20170914]
at
org.eclipse.jetty.servlet.ServletHolder.initialize(ServletHolder.java:421)
~[jetty-servlet-9.4.7.v20170914.jar:9.4.7.v20170914]
at
org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:760)
~[jetty-servlet-9.4.7.v20170914.jar:9.4.7.v20170914]
at
org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:348)
~[jetty-servlet-9.4.7.v20170914.jar:9.4.7.v20170914]
at
org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:785)
~[jetty-server-9.4.7.v20170914.jar:9.4.7.v20170914]
at
org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:261)
~[jetty-servlet-9.4.7.v20170914.jar:9.4.7.v20170914]
at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
~[jetty-util-9.4.7.v20170914.jar:9.4.7.v20170914]
at
org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
~[jetty-util-9.4.7.v20170914.jar:9.4.7.v20170914]
at org.eclipse.jetty.server.Server.start(Server.java:449)
~[jetty-server-9.4.7.v20170914.jar:9.4.7.v20170914]
at
org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:105)
~[jetty-util-9.4.7.v20170914.jar:9.4.7.v20170914]
at
org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
~[jetty-server-9.4.7.v20170914.jar:9.4.7.v20170914]
at org.eclipse.jetty.server.Server.doStart(Server.java:416)
~[jetty-server-9.4.7.v20170914.jar:9.4.7.v20170914]
at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
~[jetty-util-9.4.7.v20170914.jar:9.4.7.v20170914]
at
org.apache.storm.daemon.logviewer.LogviewerServer.start(LogviewerServer.java:129)
~[storm-webapp-2.0.0.y.jar:2.0.0.y]
at
org.apache.storm.daemon.logviewer.LogviewerServer.main(LogviewerServer.java:170)
~[storm-webapp-2.0.0.y.jar:2.0.0.y]
```
Adding the jvm option -verbose:class, we have the following message:
```
[Loaded javax.ws.rs.core.Application from
file:/home/gs/gridre/yroot.openqe74blue/share/hadoop-2.8.1.7.1709112043/share/hadoop/common/lib/jersey-core-1.9.jar]
```
It means that the javax.ws.rs.core.Application is loaded from
jersey-core-1.9.
So adding separate classpath for nimbus/supervisor can solve this problem.
This might seem like not a clean solution. But I think it makes sense to
have separate extra classpath for nimbus or supervisor since other daemons
shouldn't have to care about extra classpaths nimbus/supervisor requires.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/Ethanlm/storm STORM-2846
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/storm/pull/2449.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #2449
----
----
---