分享

关于spark监护的rest api访问报错问题

dlh 发表于 2016-6-26 10:34:13 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 2 13210
官方网站上提供的方法是
http://192.168.1.91:4040/api/v1/applications


但是报错

HTTP ERROR 503
Problem accessing /api/v1/applications. Reason:
    Service Unavailable
Caused by:org.spark-project.jetty.servlet.ServletHolder$1: java.lang.reflect.InvocationTargetException        at org.spark-project.jetty.servlet.ServletHolder.makeUnavailable(ServletHolder.java:496)        at org.spark-project.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:543)        at org.spark-project.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:415)        at org.spark-project.jetty.servlet.ServletHolder.handle(ServletHolder.java:657)        at org.spark-project.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501)        at org.spark-project.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)        at org.spark-project.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)        at org.spark-project.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)        at org.spark-project.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)        at org.spark-project.jetty.server.handler.GzipHandler.handle(GzipHandler.java:264)        at org.spark-project.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)        at org.spark-project.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)        at org.spark-project.jetty.server.Server.handle(Server.java:370)        at org.spark-project.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)        at org.spark-project.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:971)        at org.spark-project.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1033)        at org.spark-project.jetty.http.HttpParser.parseNext(HttpParser.java:644)        at org.spark-project.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)        at org.spark-project.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)        at org.spark-project.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667)        at org.spark-project.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)        at org.spark-project.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)        at org.spark-project.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)        at java.lang.Thread.run(Thread.java:745)Caused by: java.lang.reflect.InvocationTargetException        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 com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:728)        at com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:678)        at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:203)        at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:373)        at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:556)        at javax.servlet.GenericServlet.init(GenericServlet.java:244)        at org.spark-project.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:532)        ... 22 moreCaused by: java.lang.NoSuchMethodError: com.sun.jersey.core.reflection.ReflectionHelper.getOsgiRegistryInstance()Lcom/sun/jersey/core/osgi/OsgiRegistry;        at com.sun.jersey.spi.scanning.AnnotationScannerListener$AnnotatedClassVisitor.getClassForName(AnnotationScannerListener.java:217)        at com.sun.jersey.spi.scanning.AnnotationScannerListener$AnnotatedClassVisitor.visitEnd(AnnotationScannerListener.java:186)        at org.objectweb.asm.ClassReader.accept(Unknown Source)        at org.objectweb.asm.ClassReader.accept(Unknown Source)        at com.sun.jersey.spi.scanning.AnnotationScannerListener.onProcess(AnnotationScannerListener.java:136)        at com.sun.jersey.core.spi.scanning.JarFileScanner.scan(JarFileScanner.java:97)        at com.sun.jersey.core.spi.scanning.uri.JarZipSchemeScanner$1.f(JarZipSchemeScanner.java:78)        at com.sun.jersey.core.util.Closing.f(Closing.java:71)        at com.sun.jersey.core.spi.scanning.uri.JarZipSchemeScanner.scan(JarZipSchemeScanner.java:75)        at com.sun.jersey.core.spi.scanning.PackageNamesScanner.scan(PackageNamesScanner.java:223)        at com.sun.jersey.core.spi.scanning.PackageNamesScanner.scan(PackageNamesScanner.java:139)        at com.sun.jersey.api.core.ScanningResourceConfig.init(ScanningResourceConfig.java:80)        at com.sun.jersey.api.core.PackagesResourceConfig.init(PackagesResourceConfig.java:104)        at com.sun.jersey.api.core.PackagesResourceConfig.<init>(PackagesResourceConfig.java:78)        at com.sun.jersey.api.core.PackagesResourceConfig.<init>(PackagesResourceConfig.java:89)        ... 33 moreCaused by:java.lang.reflect.InvocationTargetException        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 com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:728)        at com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:678)        at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:203)        at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:373)        at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:556)        at javax.servlet.GenericServlet.init(GenericServlet.java:244)        at org.spark-project.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:532)        at org.spark-project.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:415)        at org.spark-project.jetty.servlet.ServletHolder.handle(ServletHolder.java:657)        at org.spark-project.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501)        at org.spark-project.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)        at org.spark-project.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)        at org.spark-project.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)        at org.spark-project.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)        at org.spark-project.jetty.server.handler.GzipHandler.handle(GzipHandler.java:264)        at org.spark-project.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)        at org.spark-project.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)        at org.spark-project.jetty.server.Server.handle(Server.java:370)        at org.spark-project.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)        at org.spark-project.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:971)        at org.spark-project.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1033)        at org.spark-project.jetty.http.HttpParser.parseNext(HttpParser.java:644)        at org.spark-project.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)        at org.spark-project.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)        at org.spark-project.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667)        at org.spark-project.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)        at org.spark-project.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)        at org.spark-project.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)        at java.lang.Thread.run(Thread.java:745)Caused by: java.lang.NoSuchMethodError: com.sun.jersey.core.reflection.ReflectionHelper.getOsgiRegistryInstance()Lcom/sun/jersey/core/osgi/OsgiRegistry;        at com.sun.jersey.spi.scanning.AnnotationScannerListener$AnnotatedClassVisitor.getClassForName(AnnotationScannerListener.java:217)        at com.sun.jersey.spi.scanning.AnnotationScannerListener$AnnotatedClassVisitor.visitEnd(AnnotationScannerListener.java:186)        at org.objectweb.asm.ClassReader.accept(Unknown Source)        at org.objectweb.asm.ClassReader.accept(Unknown Source)        at com.sun.jersey.spi.scanning.AnnotationScannerListener.onProcess(AnnotationScannerListener.java:136)        at com.sun.jersey.core.spi.scanning.JarFileScanner.scan(JarFileScanner.java:97)        at com.sun.jersey.core.spi.scanning.uri.JarZipSchemeScanner$1.f(JarZipSchemeScanner.java:78)        at com.sun.jersey.core.util.Closing.f(Closing.java:71)        at com.sun.jersey.core.spi.scanning.uri.JarZipSchemeScanner.scan(JarZipSchemeScanner.java:75)        at com.sun.jersey.core.spi.scanning.PackageNamesScanner.scan(PackageNamesScanner.java:223)        at com.sun.jersey.core.spi.scanning.PackageNamesScanner.scan(PackageNamesScanner.java:139)        at com.sun.jersey.api.core.ScanningResourceConfig.init(ScanningResourceConfig.java:80)        at com.sun.jersey.api.core.PackagesResourceConfig.init(PackagesResourceConfig.java:104)        at com.sun.jersey.api.core.PackagesResourceConfig.<init>(PackagesResourceConfig.java:78)        at com.sun.jersey.api.core.PackagesResourceConfig.<init>(PackagesResourceConfig.java:89)        ... 33 moreCaused by:java.lang.NoSuchMethodError: com.sun.jersey.core.reflection.ReflectionHelper.getOsgiRegistryInstance()Lcom/sun/jersey/core/osgi/OsgiRegistry;        at com.sun.jersey.spi.scanning.AnnotationScannerListener$AnnotatedClassVisitor.getClassForName(AnnotationScannerListener.java:217)        at com.sun.jersey.spi.scanning.AnnotationScannerListener$AnnotatedClassVisitor.visitEnd(AnnotationScannerListener.java:186)        at org.objectweb.asm.ClassReader.accept(Unknown Source)        at org.objectweb.asm.ClassReader.accept(Unknown Source)        at com.sun.jersey.spi.scanning.AnnotationScannerListener.onProcess(AnnotationScannerListener.java:136)        at com.sun.jersey.core.spi.scanning.JarFileScanner.scan(JarFileScanner.java:97)        at com.sun.jersey.core.spi.scanning.uri.JarZipSchemeScanner$1.f(JarZipSchemeScanner.java:78)        at com.sun.jersey.core.util.Closing.f(Closing.java:71)        at com.sun.jersey.core.spi.scanning.uri.JarZipSchemeScanner.scan(JarZipSchemeScanner.java:75)        at com.sun.jersey.core.spi.scanning.PackageNamesScanner.scan(PackageNamesScanner.java:223)        at com.sun.jersey.core.spi.scanning.PackageNamesScanner.scan(PackageNamesScanner.java:139)        at com.sun.jersey.api.core.ScanningResourceConfig.init(ScanningResourceConfig.java:80)        at com.sun.jersey.api.core.PackagesResourceConfig.init(PackagesResourceConfig.java:104)        at com.sun.jersey.api.core.PackagesResourceConfig.<init>(PackagesResourceConfig.java:78)        at com.sun.jersey.api.core.PackagesResourceConfig.<init>(PackagesResourceConfig.java:89)        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 com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:728)        at com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:678)        at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:203)        at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:373)        at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:556)        at javax.servlet.GenericServlet.init(GenericServlet.java:244)        at org.spark-project.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:532)        at org.spark-project.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:415)        at org.spark-project.jetty.servlet.ServletHolder.handle(ServletHolder.java:657)        at org.spark-project.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501)        at org.spark-project.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)        at org.spark-project.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)        at org.spark-project.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)        at org.spark-project.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)        at org.spark-project.jetty.server.handler.GzipHandler.handle(GzipHandler.java:264)        at org.spark-project.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)        at org.spark-project.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)        at org.spark-project.jetty.server.Server.handle(Server.java:370)        at org.spark-project.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)        at org.spark-project.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:971)        at org.spark-project.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1033)        at org.spark-project.jetty.http.HttpParser.parseNext(HttpParser.java:644)        at org.spark-project.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)        at org.spark-project.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)        at org.spark-project.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667)        at org.spark-project.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)        at org.spark-project.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)        at org.spark-project.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)        at java.lang.Thread.run(Thread.java:745)
Powered by Jetty://

已有(2)人评论

跳转到指定楼层
qcbb001 发表于 2016-6-26 11:58:18
其它端口是否可以,比如7080.
楼主很有可能是缺包或则包未引用到,配置等问题造成的
回复

使用道具 举报

dlh 发表于 2016-6-27 16:28:22
问题找到了,是因为 spark的一个配置文件classpath.txt中这两行造成的
/opt/cloudera/parcels/CDH-5.5.1-1.cdh5.5.1.p0.11/jars/jersey-server-1.14.jar
/opt/cloudera/parcels/CDH-5.5.1-1.cdh5.5.1.p0.11/jars/jersey-server-1.9.jar
,使用14版本就会有问题,然后我把这两个换一下位置就可以了。
但是新问题又来了,cdh会重新下发这个配置文件,而且下发的还挺频繁的。cdh下发的原文件在哪?我想修改下发的原始文件
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条