您好我下载了tomcat 8.5.4,并且我用泽西做了一些简单的休息。当我在Windows上的tomcat上部署战争时它工作正常。当我将整个目录复制到linux服务器(下载版本是多平台)并部署应用程序时,Linux不会看到我的Rest Controller。 相同的服务器文件,相同的战争和Windows工作,Linux不...
从windows输出:
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
有什么想法吗?
答案 0 :(得分:0)
如果有任何答案可能涵盖您的问题,您是否看过这里?
java.lang.IllegalAccessError while trying to test a jersey REST webservice deployed on TomEE