【发布时间】:2016-08-21 17:26:08
【问题描述】:
你好,我下载了tomcat 8.5.4,我用球衣做了一些简单的休息应用程序。当我在 Windows 上的 tomcat 上部署战争时,它工作正常。当我将整个目录复制到 linux 服务器(下载的版本是多平台的)并部署应用程序时,Linux 看不到我的 Rest Controller。 相同的服务器文件,相同的war和windows工作,linux不...
从窗口输出:
21-Aug-2016 19:12:52.370 INFO [localhost-startStop-2] com.sun.jersey.api.core.PackagesResourceConfig.init Scanning for root resource and provider classes in the packages:
com.test.rest
21-Aug-2016 19:12:52.414 INFO [localhost-startStop-2] com.sun.jersey.api.core.ScanningResourceConfig.logClasses Root resource classes found:
class com.test.rest.RestController
21-Aug-2016 19:12:52.414 INFO [localhost-startStop-2] com.sun.jersey.api.core.ScanningResourceConfig.init No provider classes found.
21-Aug-2016 19:12:52.568 INFO [localhost-startStop-2] com.sun.jersey.server.impl.application.WebApplicationImpl._initiate Initiating Jersey application, version 'Jersey: 1.18 11/22/2013 03:05 AM'
21-Aug-2016 19:12:53.773 INFO [localhost-startStop-2] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive D:\tomcat-8.5.4\webapps\RestServices.war has finished in 2,654 ms
linux 输出
21-Aug-2016 19:17:01.343 INFO [localhost-startStop-1] com.sun.jersey.api.core.PackagesResourceConfig.init Scanning for root resource and provider classes in the packages:
com.test.rest
21-Aug-2016 19:17:01.398 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive /home/tomcat-8.5.4/webapps/RestServices.war has fished in 3,342 ms
当我打电话休息时:
Servlet.init() for servlet jersey-serlvet threw exception
...
java.lang.IllegalAccessError: tried to access method com.sun.jersey.core.reflection.ReflectionHelper.getContextClassLoader()Ljava/lang/ClassLoader; from class com.sun.jersey.spi.scanning.AnnotationScannerListener
有什么想法吗?
【问题讨论】:
-
您是否也在 Windows 机器上进行了测试?我的意思是,达到 REST 端点?
-
是的,它工作正常。我什至拿了我的本地 ip(192...) 并尝试了它。因为我本地有windows,linux是远程服务器。我相信这是编码或类似的问题;/