将服务端部署到阿里云服务器,使用DHC访问API报错
来源:15-3 项目完善与展望-2
passerbyYSQ
2020-02-24
HTTP Status 500 – Internal Server Error
Type 异常报告
消息 Servlet.init() for servlet [ITalkerApiServlet] threw exception
描述 服务器遇到一个意外的情况,阻止它完成请求。
Exception
javax.servlet.ServletException: Servlet.init() for servlet [ITalkerApiServlet] threw exception
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:688)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:367)
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
org.apache.coyote.AbstractProtocolConnectionHandler.process(AbstractProtocol.java:868)org.apache.tomcat.util.net.NioEndpointConnectionHandler.process(AbstractProtocol.java:868)
org.apache.tomcat.util.net.NioEndpointConnectionHandler.process(AbstractProtocol.java:868)org.apache.tomcat.util.net.NioEndpointSocketProcessor.doRun(NioEndpoint.java:1639)
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutorWorker.run(ThreadPoolExecutor.java:624)org.apache.tomcat.util.threads.TaskThreadWorker.run(ThreadPoolExecutor.java:624)
org.apache.tomcat.util.threads.TaskThreadWorker.run(ThreadPoolExecutor.java:624)org.apache.tomcat.util.threads.TaskThreadWrappingRunnable.run(TaskThread.java:61)
java.lang.Thread.run(Thread.java:748)
Root Cause
A MultiException has 1 exceptions. They are:
-
org.glassfish.jersey.server.internal.scanning.ResourceFinderException: The URI scheme war of the URI war:file:/opt/tomcat/apache-tomcat-9.0.31/webapps-italker/ROOT.war*/WEB-INF/classes/net/qiujuer/web/italker/push/service/ is not supported. Package scanning deployment is not supported for such URIs.
Try using a different deployment mechanism such as explicitly declaring root resource and provider classes using an extension of javax.ws.rs.core.Applicationorg.jvnet.hk2.internal.Utilities.justCreate(Utilities.java:1085)
org.jvnet.hk2.internal.ServiceLocatorImpl.create(ServiceLocatorImpl.java:978)
org.jvnet.hk2.internal.ServiceLocatorImpl.createAndInitialize(ServiceLocatorImpl.java:1082)
org.jvnet.hk2.internal.ServiceLocatorImpl.createAndInitialize(ServiceLocatorImpl.java:1074)
org.glassfish.jersey.hk2.HK2InjectionManager.createAndInitialize(HK2InjectionManager.java:201)
org.glassfish.jersey.server.ApplicationHandler.createApplication(ApplicationHandler.java:354)
org.glassfish.jersey.server.ApplicationHandler.(ApplicationHandler.java:316)
org.glassfish.jersey.servlet.WebComponent.(WebComponent.java:337)
org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:178)
org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:370)
javax.servlet.GenericServlet.init(GenericServlet.java:158)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:688)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:367)
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
org.apache.coyote.AbstractProtocolConnectionHandler.process(AbstractProtocol.java:868)org.apache.tomcat.util.net.NioEndpointConnectionHandler.process(AbstractProtocol.java:868) org.apache.tomcat.util.net.NioEndpointConnectionHandler.process(AbstractProtocol.java:868)org.apache.tomcat.util.net.NioEndpointSocketProcessor.doRun(NioEndpoint.java:1639)
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutorWorker.run(ThreadPoolExecutor.java:624)org.apache.tomcat.util.threads.TaskThreadWorker.run(ThreadPoolExecutor.java:624) org.apache.tomcat.util.threads.TaskThreadWorker.run(ThreadPoolExecutor.java:624)org.apache.tomcat.util.threads.TaskThreadWrappingRunnable.run(TaskThread.java:61)
java.lang.Thread.run(Thread.java:748)
Root Cause
org.glassfish.jersey.server.internal.scanning.ResourceFinderException: The URI scheme war of the URI war:file:/opt/tomcat/apache-tomcat-9.0.31/webapps-italker/ROOT.war*/WEB-INF/classes/net/qiujuer/web/italker/push/service/ is not supported. Package scanning deployment is not supported for such URIs.
Try using a different deployment mechanism such as explicitly declaring root resource and provider classes using an extension of javax.ws.rs.core.Application
org.glassfish.jersey.server.internal.scanning.PackageNamesScanner.addResourceFinder(PackageNamesScanner.java:284)
org.glassfish.jersey.server.internal.scanning.PackageNamesScanner.init(PackageNamesScanner.java:198)
org.glassfish.jersey.server.internal.scanning.PackageNamesScanner.(PackageNamesScanner.java:154)
org.glassfish.jersey.server.internal.scanning.PackageNamesScanner.(PackageNamesScanner.java:110)
org.glassfish.jersey.server.ResourceConfig.packages(ResourceConfig.java:674)
org.glassfish.jersey.server.ResourceConfig.packages(ResourceConfig.java:654)
net.qiujuer.web.italker.push.Application.(Application.java:20)
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
java.lang.reflect.Constructor.newInstance(Constructor.java:423)
org.glassfish.hk2.utilities.reflection.ReflectionHelper.makeMe(ReflectionHelper.java:1375)
org.jvnet.hk2.internal.Utilities.justCreate(Utilities.java:1083)
org.jvnet.hk2.internal.ServiceLocatorImpl.create(ServiceLocatorImpl.java:978)
org.jvnet.hk2.internal.ServiceLocatorImpl.createAndInitialize(ServiceLocatorImpl.java:1082)
org.jvnet.hk2.internal.ServiceLocatorImpl.createAndInitialize(ServiceLocatorImpl.java:1074)
org.glassfish.jersey.hk2.HK2InjectionManager.createAndInitialize(HK2InjectionManager.java:201)
org.glassfish.jersey.server.ApplicationHandler.createApplication(ApplicationHandler.java:354)
org.glassfish.jersey.server.ApplicationHandler.(ApplicationHandler.java:316)
org.glassfish.jersey.servlet.WebComponent.(WebComponent.java:337)
org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:178)
org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:370)
javax.servlet.GenericServlet.init(GenericServlet.java:158)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:688)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:367)
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
org.apache.coyote.AbstractProtocolConnectionHandler.process(AbstractProtocol.java:868)org.apache.tomcat.util.net.NioEndpointConnectionHandler.process(AbstractProtocol.java:868)
org.apache.tomcat.util.net.NioEndpointConnectionHandler.process(AbstractProtocol.java:868)org.apache.tomcat.util.net.NioEndpointSocketProcessor.doRun(NioEndpoint.java:1639)
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutorWorker.run(ThreadPoolExecutor.java:624)org.apache.tomcat.util.threads.TaskThreadWorker.run(ThreadPoolExecutor.java:624)
org.apache.tomcat.util.threads.TaskThreadWorker.run(ThreadPoolExecutor.java:624)org.apache.tomcat.util.threads.TaskThreadWrappingRunnable.run(TaskThread.java:61)
java.lang.Thread.run(Thread.java:748)
):注意 主要问题的全部 stack 信息可以在 server logs 里查看
Apache Tomcat/9.0.31
想试一下注册的API,报如上错误
4回答
-
你将PUSH到服务器的war放到目录后,手动解压一下,然后重启服务器看看。
052020-02-25 -
passerbyYSQ
提问者
2020-02-25
出现了另外的异常,空指针异常,【在本地测试正常,没问题】
服务器上的hibernate配置文件
022020-02-26 -
passerbyYSQ
提问者
2020-02-25
----------------------
@Qiujuer
072020-03-02 -
passerbyYSQ
提问者
2020-02-24
本地测试正常
00
相似问题