0

Just upgraded software on my Digital Ocean Ubuntu 14.04 droplet with sudo apt-get update and sudo apt-get upgrade. Unfortunately I didn't read the question properly - something about tomcat7 and java. Since this tomcat7 isn't responding on port 8080 - eventually timing out.

ps -ef|grep tomcat:

tomcat7   1711     1  2 15:16 ?        00:00:53 /usr/lib/jvm/default-java/bin/java -Djava.util.logging.config.file=/var/lib/tomcat7/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.awt.headless=true -Xmx256m -Xms48m -XX:SoftRefLRUPolicyMSPerMB=36000 -XX:MaxPermSize=128m -XX:+UseConcMarkSweepGC -Djava.endorsed.dirs=/usr/share/tomcat7/endorsed -classpath /usr/share/tomcat7/bin/bootstrap.jar:/usr/share/tomcat7/bin/tomcat-juli.jar -Dcatalina.base=/var/lib/tomcat7 -Dcatalina.home=/usr/share/tomcat7 -Djava.io.tmpdir=/tmp/tomcat7-tomcat7-tmp org.apache.catalina.startup.Bootstrap start
tree-ma+  2056  1596  0 15:53 pts/1    00:00:00 grep --color=auto tomcat

catalina.out output:

Apr 25, 2017 3:16:19 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/common/classes], exists: [false], isDirectory: [false], canRead: [false]
Apr 25, 2017 3:16:19 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/common], exists: [false], isDirectory: [false], canRead: [false]
Apr 25, 2017 3:16:19 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/server/classes], exists: [false], isDirectory: [false], canRead: [false]
Apr 25, 2017 3:16:19 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/server], exists: [false], isDirectory: [false], canRead: [false]
Apr 25, 2017 3:16:19 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/shared/classes], exists: [false], isDirectory: [false], canRead: [false]
Apr 25, 2017 3:16:19 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/shared], exists: [false], isDirectory: [false], canRead: [false]
Apr 25, 2017 3:16:19 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Apr 25, 2017 3:16:19 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 657 ms
Apr 25, 2017 3:16:19 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Apr 25, 2017 3:16:19 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.52 (Ubuntu)
Apr 25, 2017 3:16:19 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /var/lib/tomcat7/webapps/geoserver.war
log4j:WARN File option not set for appender [geoserverlogfile].
log4j:WARN Are you using FileAppender instead of ConsoleAppender?
Apr 25, 2017 3:16:36 PM org.geoserver.platform.GeoServerExtensions checkContext
WARNING: Extension lookup occured, but ApplicationContext is unset.

catalina.2017-04-25.log:

Apr 25, 2017 3:16:19 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/common/classes], exists: [false], isDirectory: [false], canRead: [false]
Apr 25, 2017 3:16:19 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/common], exists: [false], isDirectory: [false], canRead: [false]
Apr 25, 2017 3:16:19 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/server/classes], exists: [false], isDirectory: [false], canRead: [false]
Apr 25, 2017 3:16:19 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/server], exists: [false], isDirectory: [false], canRead: [false]
Apr 25, 2017 3:16:19 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/shared/classes], exists: [false], isDirectory: [false], canRead: [false]
Apr 25, 2017 3:16:19 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/shared], exists: [false], isDirectory: [false], canRead: [false]
Apr 25, 2017 3:16:19 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Apr 25, 2017 3:16:19 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 657 ms
Apr 25, 2017 3:16:19 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Apr 25, 2017 3:16:19 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.52 (Ubuntu)
Apr 25, 2017 3:16:19 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /var/lib/tomcat7/webapps/geoserver.war
Apr 25, 2017 3:16:36 PM org.geoserver.platform.GeoServerExtensions checkContext
WARNING: Extension lookup occured, but ApplicationContext is unset.

netstat -na | grep -e 8080 gives:

tcp6       0      0 :::8080                 :::*                    LISTEN     
tcp6     510      0 95.85.22.89:8080        176.71.34.121:49840     CLOSE_WAIT 
tcp6     510      0 95.85.22.89:8080        176.71.34.121:49837     CLOSE_WAIT 
tcp6     380      0 95.85.22.89:8080        83.248.187.2:46220      CLOSE_WAIT 
tcp6     510      0 95.85.22.89:8080        176.71.34.121:49841     CLOSE_WAIT 
tcp6     510      0 95.85.22.89:8080        176.71.34.121:49836     CLOSE_WAIT 
tcp6     379      0 95.85.22.89:8080        83.248.187.2:46355      ESTABLISHED
tcp6     510      0 95.85.22.89:8080        176.71.34.121:49839     CLOSE_WAIT 
tcp6     510      0 95.85.22.89:8080        176.71.34.121:49838     CLOSE_WAIT

83.248.187.2 is my home.

nmap 95.85.22.89 from my pc shows:

Starting Nmap 6.40 ( http://nmap.org ) at 2017-04-25 16:46 CEST
Nmap scan report for 95.85.22.89
Host is up (0.067s latency).
Not shown: 991 closed ports
PORT     STATE    SERVICE
25/tcp   filtered smtp
80/tcp   open     http
135/tcp  filtered msrpc
139/tcp  filtered netbios-ssn
443/tcp  open     https
445/tcp  filtered microsoft-ds
1025/tcp filtered NFS-or-IIS
6129/tcp filtered unknown
8080/tcp open     http-proxy

so 8080 is open. I have one webapp - geoserver (v2.5.5.8 I think, but can't get to it just now!) Any ideas?

minisaurus
  • 1,099
  • 4
  • 17
  • 30

1 Answers1

0

I thought I'd "sorted" the issue thus:

sudo service tomcat7 stop
cp -R /var/lib/tomcat7/webapps/geoserver/data ./safe_storage_location
sudo apt-get purge tomcat7 libtomcat7-java
sudo apt-get autoremove
sudo apt-get update
sudo apt-get install tomcat7

Then, download geoserver war zipfile: I went for 2.8.3 (http://geoserver.org/release/2.8.3/)

unzip geoserver.war.zip
mv geoserver.war /var/lib/tomcat7/webapps

Wait a bit, while tomcat unpacks the war, etc....

Go to hostname:8080/geoserver - to verify you have a geoserver.

sudo service tomcat7 stop
cp -R ./safe_storage_location /var/lib/tomcat7/webapps/geoserver/data
sudo service tomcat7 start

Wait,

And wait,

And eventually, the old geoserver is there - 10-15 minutes wait in my case.

In my case, the purge also removed Oracle's Java 7 JRE plus some geoserver specific java config I'd done, so then I edited /etc/default/tomcat7, and replaced

JAVA_OPTS="-Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC"

with

JAVA_OPTS="-Djava.awt.headless=true -Xmx256m -Xms48m -XX:SoftRefLRUPolicyMSPerMSPerMB=36000 -XX:MaxPermSize=128m -XX:+UseConcMarkSweepGC"

Then I edited /var/lib/tomcat7/webapps/geoserver/WEB-INF/web.xml, and added:

<context-param>
  <param-name>GEOWEBCACHE_CACHE_DIR</param-name>
  <param-value>/var/tmp</param-value>
</context-param>

so it would use my GeoWebCache.

BUT - see here which is an issue I have ... a circa 30 minute start-up time for tomcat. My server is Digital Ocean, I don't know if this is significant.

Once up, tomcat7/geoserver work well.

Community
  • 1
  • 1
minisaurus
  • 1,099
  • 4
  • 17
  • 30