1

I've been stuck on this for a good bit now and can't find the solution anywhere. I'm writing a java rest service using jersey framework, maven as a package manager hosted on a apache tomcat.

The project works perfectly fine locally. I want to dockerize the application and really struggling. I have the tomcat container up and running and when I go to the root of my application I can see the simple hello text I have. So when I go to http://xxx:8888/npmanager/ at this point I'm seeing what I expect.

Now when I try to hit any of my endpoints i.e https://xxx:8888/npmanager/api/XXX I get a 500 error:

warnings have been detected with resource and/or provider classes: SEVERE: Missing dependency for field: private org.glassfish.jersey.server.wadl.WadlApplicationContext org.glassfish.jersey.server.wadl.internal.WadlResource.wadlContext

Dockefile:

FROM tomcat:8.5.38
ADD ./target/npmanager.war /usr/local/tomcat/webapps/
CMD chmod +x /usr/local/tomcat/bin/catalina.sh
CMD ["catalina.sh", "run"]

docker-compose.yml

version: '3'

services:

tomcat-dev:
  build: .
  environment:
    TOMCAT_USERNAME: root
    TOMCAT_PASSWORD: root
  ports:
    - "8888:8080"

mysql-dev:
  image: mysql:8.0.2
  environment:
    MYSQL_ROOT_PASSWORD: root
    MYSQL_DATABASE: npmanager
  volumes:
    - /mysql-data:/var/lib/mysql
  ports:
    - "3308:3306"
bos570
  • 1,505
  • 2
  • 23
  • 45
  • Is there any other logs from tomcat service can be added to the question ? – Mostafa Hussein Mar 17 '19 at 19:44
  • 1
    @MostafaHussein sure. You can find the details log here: https://justpaste.it/4e07q – bos570 Mar 17 '19 at 19:49
  • you have this error: SEVERE: Missing dependency for field: private org.glassfish.jersey.server.wadl.WadlApplicationContext org.glassfish.jersey.server.wadl.internal.WadlResource.wadlContext – Mostafa Hussein Mar 17 '19 at 20:03
  • Possible duplicate of [SEVERE: Missing dependency for field : private org.glassfish.jersey.server.wadl.WadlApplicationContext](https://stackoverflow.com/questions/18409088/severe-missing-dependency-for-field-private-org-glassfish-jersey-server-wadl) – Mostafa Hussein Mar 17 '19 at 20:05
  • @MostafaHussein I saw that but I don't see that on my local build. Why is it only showing up on my docker container? – bos570 Mar 17 '19 at 20:15
  • maybe different versions either java or tomcat or any other dependency ? – Mostafa Hussein Mar 17 '19 at 20:16
  • Fair, point. I didn't think of that. Let me check that and see if it's the case. – bos570 Mar 17 '19 at 20:17

0 Answers0