Reputation:
I have Ubuntu server on my computer and i have the tomcat9 there.
Last night everything was going well, put .war into webapp folder and it would run like it should on localhost:8080/app
Then i went to sleep and was prepared to continue from where i left off, but behold, yet again there is a problem with tomcat!
i restarted the server, went to /opt/tomcat9/bin and ran startup.sh
Using CATALINA_BASE: /opt/tomcat9
Using CATALINA_HOME: /opt/tomcat9
Using CATALINA_TMPDIR: /opt/tomcat9/temp
Using JRE_HOME: /usr/lib/jvm/java-8-oracle/jre
Using CLASSPATH: /opt/tomcat9/bin/bootstrap.jar:/opt/tomcat9/bin/tomcat-juli.jar
Tomcat started.
but at localhost:8080 is now unable to connect, as is the /app folder too.
In logs there is nothing.... It seems it dosent even write into logs anymore, last log post is from last night, despite running the server 5min ago.
Catalinalog (timestamp from last night)
07-Mar-2017 04:20:49.775 WARNING [http-nio-8080-exec-9] org.springframework.web.servlet.PageNotFound.noHandlerFound No mapping found for HTTP request with URI [/spring3-mvc-maven-xml-hello-world/hello2] in DispatcherServlet with name 'spring-web'
Catalina.out (also from last night)
07-Mar-2017 04:20:49.775 WARNING [http-nio-8080-exec-9] org.springframework.web.servlet.PageNotFound.noHandlerFound No mapping found for HTTP request with URI [/spring3-mvc-maven-xml-hello-world/hello2] in DispatcherServlet with name 'spring-web'
./catalina.sh: 1: eval: /usr/lib/jvm/java-8-oracle/jre/bin/java: not found
./catalina.sh: 1: eval: /usr/lib/jvm/java-8-oracle/jre/bin/java: not found
./catalina.sh: 1: eval: /usr/lib/jvm/java-8-oracle/jre/bin/java: not found
./catalina.sh: 1: eval: /usr/lib/jvm/java-8-oracle/jre/bin/java: not found
./catalina.sh: 1: eval: /usr/lib/jvm/java-8-oracle/jre/bin/java: not found
Am i really just bad with the service or what, it feels like majority, somewhere around 70% of my time is wasted on debuggin Tomcat alone, I would totally love to actually work on my project instead of tomcat...
Upvotes: 1
Views: 2418
Reputation: 29150
you can default set by using the following command.
sudo update-alternatives --config java
For more, you can go through this link: https://stackoverflow.com/a/37479837/2293534
Java Full Installation in Linux: https://www.digitalocean.com/community/tutorials/how-to-install-java-on-ubuntu-with-apt-get
you can follow this link: https://confluence.atlassian.com/doc/setting-the-java_home-variable-in-windows-8895.html
Run the following command
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 export PATH=$JAVA_HOME/bin:$PATH export JRE_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre
This is a suggestion. You can reinstall java8 and tomcat9 after removing current installation.
Full installation procedure is given here: https://tecadmin.net/install-tomcat-9-on-ubuntu/
Another installation procedure is also given here: http://www.linuxtechi.com/install-apache-tomcat9-centos7-rhel7-ubuntu16-04/
Upvotes: 1
Reputation: 3083
That end of the catalina.out is rather revealing: it cannot seem to find the java executable!
Try in a terminal to write
/usr/lib/jvm/java-8-oracle/jre/bin/java -version
Unless you get something along these lines...
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
...then it is not your Tomcat that is broken but your Java Runtime Environment.
Upvotes: 2