Skip to main content
12-Amethyst
February 20, 2024
Solved

Installing Tomcat9.0.86 with thingworx 9.4.4 - Manual Installation - Linux Ubuntu 22.04.3 LTS

  • February 20, 2024
  • 2 replies
  • 2879 views

Hello, I am struggling with a fresh install of thingworx 9.4.4. More so I am struggling to get the tomcat service to start. It is consistently comming up with the error: ubuntu systemd[1]: tomcat9.0.service: Killing process xxxx (n/a) with signal SIGKILL.

I have made sure that the permissions on the PID file location belongs to the tomcat9.0 user. 

 

I have followed the guide: Install Java, Apache Tomcat, and ThingWorx (ptc.com) 
I have installed java -version- openjdk version "11.0.21" 2023-10-17.
I have installed tomcat9.0.86. 
For now, I have just used the self-signed certificate for simplicity and will change over once I have the service working. 


From the guide I made sure to do the following: 
Edit AUTHBIND properties to allow Tomcat to bind to ports below 1024

 

 

sudo apt-get install authbind
# For port 80
sudo touch /etc/authbind/byport/80
sudo chmod 500 /etc/authbind/byport/80
sudo chown tomcat9.0 /etc/authbind/byport/80

# For port 443
sudo touch /etc/authbind/byport/443
sudo chmod 500 /etc/authbind/byport/443
sudo chown tomcat9.0 /etc/authbind/byport/443

echo 'AUTHBIND=yes' | sudo tee /usr/share/tomcat9.0/9.0.86/bin/setenv.sh
sudo chmod +x /usr/share/tomcat9.0/9.0.86/bin/setenv.sh

 

 


Here is my Tomcat9.0.service file: 

 

[Unit]
 Description=Apache Tomcat Web Application Container
 After=network.target

 [Service]
 Type=forking
 PIDFile=/run/tomcat9.0/tomcat.pid
 Environment="JAVA_OPTS=-Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -Dserver -Dd64 -XX:+UseNUMA -Dlog4j2.formatMsgNoLookups=true -XX:+UseG1GC -Dfile.encoding=UTF-8 -Xms256M -Xmx512M -Djava.library.path=${CATALINA_BASE}/webapps/Thingworx/WEB-INF/extensions -DIGNITE_HOME=/usr/share/tomcat9.0/ignite"
 Environment=CATALINA_PID=/run/tomcat9.0/tomcat.pid
 Environment=JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64
 Environment=CATALINA_HOME=/usr/share/tomcat9.0/9.0.86
 Environment=CATALINA_BASE=/usr/share/tomcat9.0/9.0.86
 Environment=CATALINA_OPTS=

 ExecStart=/usr/share/tomcat9.0/9.0.86/bin/jsvc \
 -DIGNITE_HOME=/usr/share/tomcat9.0/ignite \
 -Dcatalina.home=${CATALINA_HOME} \
 -Dcatalina.base=${CATALINA_BASE} \
 -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -Dserver -Dd64 -XX:+UseNUMA -Dlog4j2.formatMsgNoLookups=true \
 -XX:+UseG1GC -Dfile.encoding=UTF-8 \
 -Xms=4g \
 -Xmx=4g \
 -Djava.library.path=${CATALINA_BASE}/webapps/Thingworx/WEB-INF/extensions \
 -Duser.timezone=UTC \
 -cp ${CATALINA_HOME}/bin/commons-daemon.jar:${CATALINA_HOME}/bin/bootstrap.jar:${CATALINA_HOME}/bin/tomcat-juli.jar \
 -user tomcat9.0 \
 -java-home ${JAVA_HOME} \
 -pidfile /run/tomcat9.0/tomcat.pid \
 -errfile ${CATALINA_HOME}/logs/catalina.out \
 -outfile ${CATALINA_HOME}/logs/catalina.out \
 $CATALINA_OPTS \
 org.apache.catalina.startup.Bootstrap

 [Install]
WantedBy=multi-user.target

 


I am not sure where to turn to, and I am looking for some assistance / guidance / suggestions / additional reading material. 
Thanks. 

Best answer by NiKlaus

Thanks, the issue was my certifacte in the end. I had not registered a domain to it and was trying to access. once I replaced my server.xml configs with standard port 8080 configs and no SSL encryption, it worked right away.

2 replies

Rocko
19-Tanzanite
February 20, 2024
NiKlaus12-AmethystAuthor
12-Amethyst
February 20, 2024

Thanks Rocko. I was able to find those trailing spaces and fix that error. Any idea why i am getting this: 

Feb 20 16:13:39 ubuntu systemd[1]: Starting Apache Tomcat Web Application Container...
Feb 20 16:13:39 ubuntu systemd[1]: tomcat9.0.service: Supervising process 24980 which is not our child. We'll most likely not notice when it exits.
Feb 20 16:13:39 ubuntu systemd[1]: Started Apache Tomcat Web Application Container.
Feb 20 16:13:39 ubuntu systemd[1]: tomcat9.0.service: Killing process 24980 (n/a) with signal SIGKILL.
Feb 20 16:13:39 ubuntu systemd[1]: tomcat9.0.service: Killing process 24980 (n/a) with signal SIGKILL.
Feb 20 16:13:39 ubuntu systemd[1]: tomcat9.0.service: Deactivated successfully.

 

NiKlaus12-AmethystAuthor
12-Amethyst
February 20, 2024

Update: 
I have changed my config file to the following: 

 

 

[Unit]
 Description=Apache Tomcat Web Application Container
 After=network.target

 [Service]
 User=tomcat9.0
 Group=tomcat9.0
 Type=forking
 PIDFile=/run/tomcat9.0/tomcat.pid
 Environment="JAVA_OPTS=-Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -Dserver -Dd64 -XX:+UseNUMA -Dlog4j2.formatMsgNoLookups=true -XX:+UseG1GC -Dfile.encoding=UTF-8 -Xms256M -Xmx512M -Djava.library.path=${CATALINA_BASE}/webapps/Thingworx/WEB-INF/extensions -DIGNITE_HOME=/usr/share/tomcat9.0/ignite"
 Environment=CATALINA_PID=/run/tomcat9.0/tomcat.pid
 Environment=JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64
 Environment=CATALINA_HOME=/usr/share/tomcat9.0/9.0.86
 Environment=CATALINA_BASE=/usr/share/tomcat9.0/9.0.86
 Environment=CATALINA_OPTS=

 ExecStart=/usr/share/tomcat9.0/9.0.86/bin/jsvc \
 -DIGNITE_HOME=/usr/share/tomcat9.0/ignite \
 -Dcatalina.home=${CATALINA_HOME} \
 -Dcatalina.base=${CATALINA_BASE} \
 -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -Dserver -Dd64 -XX:+UseNUMA -Dlog4j2.formatMsgNoLookups=true \
 -XX:+UseG1GC -Dfile.encoding=UTF-8 \
 -Xms16g \
 -Xmx20g \
 -Djava.library.path=${CATALINA_BASE}/webapps/Thingworx/WEB-INF/extensions \
 -Duser.timezone=UTC \
 -cp ${CATALINA_HOME}/bin/commons-daemon.jar:${CATALINA_HOME}/bin/bootstrap.jar:${CATALINA_HOME}/bin/tomcat-juli.jar \
 -user tomcat9.0 \
 -java-home ${JAVA_HOME} \
 -pidfile /run/tomcat9.0/tomcat.pid \
 -errfile ${CATALINA_HOME}/logs/catalina.out \
 -outfile ${CATALINA_HOME}/logs/catalina.out \
 $CATALINA_OPTS \
 org.apache.catalina.startup.Bootstrap

 [Install]
WantedBy=multi-user.target

 

 

 

 And now the service ran successfully for a minute. And then I get this error: 

 

 

 tomcat9.0.service - Apache Tomcat Web Application Container
 Loaded: loaded (/etc/systemd/system/tomcat9.0.service; enabled; vendor preset: enabled)
 Active: inactive (dead) since Tue 2024-02-20 16:50:26 UTC; 8min ago
 Process: 26384 ExecStart=/usr/share/tomcat9.0/9.0.86/bin/jsvc -DIGNITE_HOME=/usr/share/tomcat9.0/ignite -Dcatalina.home=${CATALINA_HOME} -Dcatalina.bas>
 Main PID: 26388

Feb 20 16:50:25 ubuntu jsvc[26388]: 16:50:25,796 |-INFO in ch.qos.logback.classic.AsyncAppender[ASYNC_APPENDER_SECURITY] - Worker thread will flush remaini>
Feb 20 16:50:25 ubuntu jsvc[26388]: 16:50:25,796 |-INFO in ch.qos.logback.classic.AsyncAppender[ASYNC_APPENDER_SECURITY] - Queue flush finished successfull>
Feb 20 16:50:25 ubuntu jsvc[26388]: 16:50:25,797 |-INFO in ch.qos.logback.classic.AsyncAppender[ASYNC_APPENDER_ERROR] - Worker thread will flush remaining >
Feb 20 16:50:25 ubuntu jsvc[26388]: 16:50:25,797 |-INFO in ch.qos.logback.classic.AsyncAppender[ASYNC_APPENDER_ERROR] - Queue flush finished successfully w>
Feb 20 16:50:25 ubuntu jsvc[26388]: >>>>>>>> TERMINATING JVM <<<<<<<<<<
Feb 20 16:50:25 ubuntu jsvc[26388]: >>>>>>>> CALLING SYSTEM EXIT <<<<<<<<<<
Feb 20 16:50:26 ubuntu jsvc[26387]: Service exit with a return value of 1
Feb 20 16:50:26 ubuntu systemd[1]: tomcat9.0.service: Killing process 26388 (n/a) with signal SIGKILL.
Feb 20 16:50:26 ubuntu systemd[1]: tomcat9.0.service: Killing process 26388 (n/a) with signal SIGKILL.
Feb 20 16:50:26 ubuntu systemd[1]: tomcat9.0.service: Deactivated successfully.

 

 

Any suggestions or comments? 

Edit: 
It the service seems to run in a somewhat stable state until I load the page and then it fails. Specifically when I load the Public IP of the server with out any further info on the link. 

 

So when i try to navigate on my browser to https://xxx.xxx.xxx.xxx/Thingworx nothing happens but when i try to go to https://xx.xx.xx.xx the service stops running. 
 

 

Rocko
19-Tanzanite
February 21, 2024

If /Thingworx isn't replying then the app wasn't deployed, so it's probably not a TWX problem (unless you can find TWX logs in the ThingworxStorage folder). Could be many things, so you can try to find other log files with more details and search Ubuntu and tomcat forums.

 

Also you added the User and Group setting to jsvc, so now you are running with a different user. Could it be that from your previous tries there are files, eg. pid files written and owned by a different user so tomcat9.0 user can't overwrite them?

 

 

NiKlaus12-AmethystAuthor
12-Amethyst
February 21, 2024

Hi Rocko, thanks. yes I have changed the user name. 

 

I am looking into the thingworx error logs and I can see the following: 

2024-02-21 08:50:40.857+0000 [L: ERROR] [O: E.c.q.l.c.Logger] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] ERROR: relation "system_version" does not exist_ Position: 128
2024-02-21 08:50:40.861+0000 [L: ERROR] [O: E.c.q.l.c.Logger] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] Problems migrating database
2024-02-21 08:50:40.864+0000 [L: ERROR] [O: E.c.q.l.c.Logger] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] ERROR: current transaction is aborted, commands ignored until end of transaction block
2024-02-21 08:50:40.864+0000 [L: ERROR] [O: E.c.q.l.c.Logger] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] ERROR: current transaction is aborted, commands ignored until end of transaction block
2024-02-21 08:50:40.875+0000 [L: ERROR] [O: E.c.q.l.c.Logger] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] *** CRITICAL ERROR ON STARTUP: Unable to initialize and start system: ERROR: current transaction is aborted, commands ignored until end of transaction block
2024-02-21 08:50:40.876+0000 [L: ERROR] [O: E.c.q.l.c.Logger] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] *** Web Application STATE is being set to ERROR! ***