eurostat / searoute

Compute shortest maritime routes between ports

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Webservice /seaws 404

goaround opened this issue · comments

Hi,

first of all, thank you for the great work. I use Searoute to map the routing of a cruise, e.g. here https://travel-dealz.eu/deal/msc-sinfonia-europe-africa/

I try to deploy my own webservice. I followed the instructions here: https://travel-dealz.eu/deal/msc-sinfonia-europe-africa/ but if I move the servlet to Tomcat /webapps I can access /searoute and I see the API docs but the subdir e.g. /searoute/seaws just returns a 404.

Do I miss something? I come from the PHP/Javascript/Nginx world and I use Tomcat for the first time. Sorry if I'm on the wrong track

I now get a 500 HTTP Status Error instantiating servlet class [eu.europa.ec.eurostat.searoute.SeaRouteWS]

jakarta.servlet.ServletException: Error instantiating servlet class [eu.europa.ec.eurostat.searoute.SeaRouteWS]
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:690)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:356)
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399)
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:867)
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1716)
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.base/java.lang.Thread.run(Thread.java:833)

Any ideal @jgaffuri?

I found the issue: https://stackoverflow.com/questions/38993182/how-to-tag-an-image-in-a-dockerfile

It does not work with Tomcat 10, downgraded to Tomcat 9, and it works finally :)

Hi @goaround,
I'm researching a project where I would like to run SeaRoute as a webservice in docker instance. Based on your last comment it looks like you have done just that?

Is this the case? Would you like to share your Dockerfile?

Hi @douweh,

exactly. The Dockerfile is pretty simple:

FROM tomcat:9.0
RUN rm -rf /usr/local/tomcat/webapps/*
COPY searoute.war /usr/local/tomcat/webapps/ROOT.war

EXPOSE 8080
CMD ["catalina.sh", "run"]

with the searoute.war in the same folder.

@goaround thanks for your reaction! I see you don't make the build in the Dockerfile, but just copy the
.war.

It is my plan to setup a Dockerfile which also
Does the actual build
Of the source. But i have to understand the java/maven ecosystem first. (Not my background)

So did you first set up an instance with java and maven etc, to make the build (.war) file? Cause (correct me
If i'm wrong) the .war is not included in this repo is
It?

@douweh yes, I build the .war locally, but you can also download the .war right here: https://jarcasting.de/artifacts/eu.europa.ec.eurostat/searoute-war/

commented

Late to the party, but we wrote a small Dockerfile as well, see https://github.com/dbl-works/searoutes/, that we publish to Dockerhub.

Relevant change/addition: we added a health check endpoint to the server that runs in the container so you can use it in e.g. a cluster with auto-redeploy when a service becomes unhealthy.

We just copy a locally built war file into the repo. Feel free to update the Dockerfile to build it during Docker-Build, happy to review contributions :)