cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

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

NiKlaus
12-Amethyst

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

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. 

ACCEPTED SOLUTION

Accepted Solutions
NiKlaus
12-Amethyst
(To:Rocko)

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.

View solution in original post

9 REPLIES 9

NiKlaus
12-Amethyst
(To:Rocko)

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.

 

NiKlaus
12-Amethyst
(To:NiKlaus)

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. 
 

 

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?

 

 

NiKlaus
12-Amethyst
(To:Rocko)

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! ***

 

Okay, so the issue is that ThingWorx can't start and is shutting down Tomcat. That means your Tomcat is working fine, but TWX can't find its tables. So you have to check if you provided the correct DB connection info and that you ran the DB Setup script correctly. See https://www.ptc.com/en/support/article/CS258676

and https://support.ptc.com/help/thingworx/platform/r9/en/index.html#page/ThingWorx/Help/Installation/Installation/install_and_configure_postgresql_Ubuntu.html#wwID0EM1LS

 

 

NiKlaus
12-Amethyst
(To:Rocko)

Thanks, I managed to make sure that the postgresql is running an that the tables is set up correctly. 
Now I am in currently faced with the issue that I am not able to access the site. 

My Application logs look clear: 

 

2024-02-21 11:14:17.617+0000 [L: INFO] [O: c.t.s.s.w.WSExecutionProcessingSubsystem] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] Max Queue Size = 100000
2024-02-21 11:14:17.617+0000 [L: INFO] [O: c.t.s.s.w.WSExecutionProcessingSubsystem] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] Max Thread Life = 600000
2024-02-21 11:14:17.617+0000 [L: INFO] [O: c.t.s.s.w.WSExecutionProcessingSubsystem] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] ----------------------------------------
2024-02-21 11:14:17.617+0000 [L: INFO] [O: c.t.s.ThingWorxServer] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] Subsystem SCIMSubsystem is disabled
2024-02-21 11:14:17.617+0000 [L: INFO] [O: c.t.s.ThingWorxServer] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] Subsystem RelationshipSubsystem is starting
2024-02-21 11:14:17.617+0000 [L: INFO] [O: c.t.s.ThingWorxServer] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] Subsystem RelationshipSubsystem is started
2024-02-21 11:14:17.617+0000 [L: INFO] [O: c.t.s.ThingWorxServer] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] Subsystem WorkflowSubsystem is disabled
2024-02-21 11:14:17.617+0000 [L: INFO] [O: c.t.s.ThingWorxServer] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] Subsystem SolutionCentralSubsystem is starting
2024-02-21 11:14:17.617+0000 [L: INFO] [O: c.t.s.ThingWorxServer] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] Subsystem SolutionCentralSubsystem is started
2024-02-21 11:14:17.623+0000 [L: INFO] [O: c.t.s.ThingWorxServer] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] Install extensions from upgrade queue...
2024-02-21 11:14:17.681+0000 [L: INFO] [O: c.t.s.ThingWorxServer] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] Starting All Things...
2024-02-21 11:14:17.713+0000 [L: INFO] [O: c.t.s.ThingWorxServer] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] Activating Property Bindings...
2024-02-21 11:14:17.717+0000 [L: INFO] [O: c.t.s.ThingWorxServer] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] Sending Post Start Notifications...
2024-02-21 11:14:17.723+0000 [L: INFO] [O: c.t.s.s.f.FileTransferSubsystem] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] Resuming 0 transfer jobs loaded from persistence provider
2024-02-21 11:14:17.723+0000 [L: INFO] [O: c.t.s.s.f.FileTransferSubsystem] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] Finished loading transfer jobs from persistence (took 1 ms)
2024-02-21 11:14:17.731+0000 [L: INFO] [O: c.t.s.ThingWorxServer] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] Starting change watcher...
2024-02-21 11:14:17.732+0000 [L: INFO] [O: c.t.s.ThingWorxServer] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] Starting entity state change processor...
2024-02-21 11:14:17.732+0000 [L: INFO] [O: c.t.s.ThingWorxServer] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] Thingworx Server Application...ON
2024-02-21 11:14:17.744+0000 [L: INFO] [O: c.t.s.ThingWorxServer] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] WebApp started ...
2024-02-21 11:14:17.744+0000 [L: INFO] [O: c.t.s.ThingWorxServer] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] >>>>>>>>>> End loading model in:

 

 

My Catalina logs also looks good: 

11:14:00,401 |-INFO in c.q.l.core.rolling.SizeAndTimeBasedRollingPolicy@1199967080 - Will use the pattern /ThingworxStorage/logs/archives/AuthLog.%d{yyyy-MM-dd}.%i.log for the active file
11:14:00,402 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@66ba3660 - The date pattern is 'yyyy-MM-dd' from file name pattern '/ThingworxStorage/logs/archives/AuthLog.%d{yyyy-MM-dd}.%i.log'.
11:14:00,402 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@66ba3660 - Roll-over at midnight.
11:14:00,402 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@66ba3660 - Setting initial period to Wed Feb 21 08:50:37 UTC 2024
11:14:00,402 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[AUTH] - Active log file name: /ThingworxStorage/logs/AuthLog.log
11:14:00,402 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[AUTH] - File property is set to [/ThingworxStorage/logs/AuthLog.log]
21-Feb-2024 11:14:18.063 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/opt/tomcat/webapps/Thingworx.war] has finished in [35,719] ms
21-Feb-2024 11:14:18.070 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [35849] milliseconds

 

So, I am making some progress. 

Looks like tomcat is stable now and looks like thingworx is stable. Hoping I can get some furthe guidance on why I am not able to access the site. 
It is on a remote server. 
The server has had all firewall configs disabled for now so that I can get this working. 

You should see the request to Thingworx in Tomcat access log. If not, the query isn't reaching Tomcat.

If you can see the query, you'd need to check ApplicationLog in Thingworx for error messages (There are other logs for TWX in the same directory you can check but I doubt it will be helpful at this point).

You can try to connect into the server via remote desktop/vnc/xrdp and run a browser there connecting into localhost/Thingworx.

If that works, it's a network problem.

 

(EDIT: If RDP is too complicated, you can try to ssh into the machine and run

curl -v -u "Administrator:yourpasswd" "http://localhost/Thingworx/Composer/" to see what comes back. It should give you a HTTP 200)

NiKlaus
12-Amethyst
(To:Rocko)

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.

Announcements


Top Tags