1

Hello I downloaded tomcat 8.5.4 when and I ve made some simple rest aplication with jersey. When I deploy war on tomcat on windows it works fine. When i copied whole directory to linux server(downloaded version is multiplatform) and I deploy application, Linux dont see my Rest Controller. Same files of server, same war and windows working, linux not...

output from 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

output from 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

and when I call rests:

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

Any ideas?

user2771738
  • 913
  • 11
  • 31
  • Did you test on the Windows box also? I mean, hitting a REST end-point? – x80486 Aug 21 '16 at 17:29
  • Yep it works fine. I even took my local ip(192...) and tried with that. Because I locally have windows, linux is remote server. I belive that is some problem with encoding or smth like that ;/ – user2771738 Aug 21 '16 at 17:38

1 Answers1

0

Did you look here if any of the answers might cover your problem?

java.lang.IllegalAccessError while trying to test a jersey REST webservice deployed on TomEE

Community
  • 1
  • 1
Guenther
  • 2,035
  • 2
  • 15
  • 20