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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

Unable to install ThingWorx 9.1. The tomcat is not starting up

ranjank
15-Moonstone

Unable to install ThingWorx 9.1. The tomcat is not starting up

The catalina log has been closed.

 

I have Tomcat 9.0.37 and Java 11.0.9 in my local machine.

 

Also let me know how to set JAVA_OPTS using bat file as I am unable to locate "setenv.bat" file under Tomcat directory.

 

Kindly help.

ACCEPTED SOLUTION

Accepted Solutions

If you don't have -Djava.library.path set then Thingworx normally crashes

 

Also keep in mind that if you have spaces in the path, you should put it into quotes, like

set JAVA_OPTS=-Dserver -Dd64 -XX:+UseG1GC -Dfile.encoding=UTF-8 -Djava.library.path="c:\Program Files (x86)\Apache Foundation\Apache Tomcat\webapps\WEB-INF"

View solution in original post

12 REPLIES 12

You have to create setenv.bat manually in the Tomcat/bin folder and set the env. variables there, e.g.:

------------------------------

set JRE_HOME=c:\PTC\jre18_241
set THINGWORX_PLATFORM_SETTINGS=c:\PTC\Thingworx90_H2
set JAVA_OPTS=-Dserver -Dd64 -XX:+UseG1GC -Dfile.encoding=UTF-8 -Djava.library.path=c:\PTC\Thingworx90_H2\webapps\Thingworx\WEB-INF\extensions
set TITLE=Thingworx90_H2

----------------------------------------------

 

As for the reason why Thingworx doesn't start... Do you have any log files in the ThingworxStorage/logs folder? In particular, ApplicationLog.log file.

ranjank
15-Moonstone
(To:DmitryTsarev)

@DmitryTsarev ,

 

Have referred below link for ThingWorx 9.1 System Requirements:-

 

https://support.ptc.com/help/thingworx/platform/r9/en/index.html#page/ThingWorx%2FHelp%2FSystemRequirements%2F9_1_system_requirements.html%23wwID0EMFHM

 

Below three are mentioned there for Java:-

• OpenJDK - Amazon Coretto 11.0.8
• Oracle Java 11.0.8 and above (eg: 11.0.x)
• Oracle Java 1.8.0_261
That'sy I installed Oracle Java 11.0.9
 
ThingworxStorage folder is empty till now.
 
Please advise.
 
 

So Tomcat crashes upon starting?

 

According to your logs, Thingworx deployment begins as expected and there are no more errors.

19-Dec-2020 22:26:18.940 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\Thingworx.war]
19-Dec-2020 22:26:59.733 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.

***************************************

 

Does something change if you create setenv.bat and set options there?

set JRE_HOME=c:\PTC\jre18_241
set JAVA_OPTS=-Dserver -Dd64 -XX:+UseG1GC -Dfile.encoding=UTF-8 -Djava.library.path=c:\PTC\Thingworx90_H2\webapps\Thingworx\WEB-INF\extensions

 

Can you see the "Thingworx" folder in the "Tomcat\webapps\" folder, next to the Thingworx.war ?

ranjank
15-Moonstone
(To:DmitryTsarev)

Yes tomcat crashes up after starting.

 

Now after including below "setenv.bat" the tomcat crashes immediately. It not even tries to start. Immediately gets closed after double clicked on "startup.bat".

 

Yes, "Thingworx" folder is in the "Tomcat\webapps\" location.

There are a few things to check...

 

First, make sure that if you rename / remove setenv.bat Tomcat starts starting. This would mean that the issue is indeed with the setenv.bat The setenv.bat looks OK, though.

Actually you don't have to set THINGWORX_PLATFORM_SETTINGS there so you can just remove it if you're using the default location.

 

Anyways, I assume, that platform-settings.json is in the c:\ThingworxPlatform folder

The second thig to check is the content of your platform-settings.json.

I actually believe that that's where you're having issues.

Here is a very basic working example, in case you're trying H2 version

 

Spoiler
{
"PlatformSettingsConfig": {
"AdministratorUserSettings": {
"InitialPassword": "SomeSecure123pa$$"
},
"ExtensionPackageImportPolicy": {
"importEnabled": true,
"allowJarResources": true,
"allowJavascriptResources": true,
"allowCSSResources": true,
"allowJSONResources": true,
"allowWebAppResources": true,
"allowEntities": true,
"allowExtensibleEntities": true
}
},
"PersistenceProviderPackageConfigs": {
"H2PersistenceProviderPackage": {
"ConnectionInformation": {
"password": "twadmin",
"username": "twadmin"
}
}
}
}

In case you're going with PostgreSQL or MS SQL, the should be one more section in it, but I'd advise to get comfortable with installing H2 befor going there.

So, make sure you're using the appropriate Thingworx.war, i.e. H2 version.

 

Also, if you really need to make things up and running asap, you can always fire up ThingWorx Foundation Installer. As I see it, PTC starts depricating manual installations. For example, one can't install Navigate on top of manually installed Thingworx Foundation. And Navigate itself is not supposed to be installed manually.

 

The last point...

While according to the according to the catalina.2020-12-19.log java_home seem to be set correctly

 

Spoiler

19-Dec-2020 22:26:17.485 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: C:\Program Files\Java\jdk-11.0.9

 

you also have a bunch of different java-related things in your path - there are things like 

Spoiler
C:\Program Files\Java\jdk-11.0.9\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files\Java\jdk-11.0.9\bin;

So just to be on the safe side, I'd add 

 

Spoiler

set JRE_HOME=C:\Program Files\Java\jdk-11.0.9

set JAVA_HOME=C:\Program Files\Java\jdk-11.0.9

 

to the setenv.bat.

ranjank
15-Moonstone
(To:DmitryTsarev)

Its ThingWorx 9.1 (H2 Instance) which is I am trying to install.

 

PFB all the files currently I am having right now.

 

As I explored, Oracle mentioned separate JRE folder is not required in Java 11 thatswhy it don't turn up in Java directory after installation. 

You are missing a curly bracket at the end of the platform-settings.json 

This will definitely make Thingworx fail to start.

 

Also make sure the admin password complies with the policy (the one in the attached file does)

 

I made a clean copy of tomcat and it starts correctly with your slightly modified platform-settings.json

 

Also attaching setenv just for reference

ranjank
15-Moonstone
(To:DmitryTsarev)

@DmitryTsarev 

Have updated my platform-settings.json with missing '}' bracket at last but still the tomcat closes immediately without trying to start.

 

Unable to set JRE_HOME as I informed earlier Oracle don't provide separate JRE folder in Java 11.

 

I have uploaded the screenshots of my Java folder.

 

You can also try to install my version of Oracle Java 11.0.9 and Tomcat 9.0.37 as suggested in System Requirements of ThingWorx 9.1.

 

Please advise.

So, at the moment Tomcat crashes immediately and no new Tomcat logs appear?

 

Have you checked if removing setenv.bar (which as you say makes yout Tomcat crash immediately after starting) gets you back to where you in the beginning, when Tomcat began starting nd only crashed when Thingworx kicked in?

 

The issue with the missing curly bracket normally results in Thingworx not starting.

 

In any case, revert back and check how things are going now, with the modified platform-settings.json

 

Tomcat should start starting and you have to track the error appearing just before the crash. It doesn't get logged anywhere and you have to have a sharp eye or just record the screen with some video capture software or just your handy.

 

See the attached video for the reference.

ranjank
15-Moonstone
(To:DmitryTsarev)

@DmitryTsarev 

 

After removing custom setenv.bat from tomcat\bin, the ThingWorx got started successfully.

 

So what does it mean? Below mentioned JAVA_OPTS parameters are not important to save anywhere?

 

-Dserver -Dd64
-XX:+UseG1GC
-Dfile.encoding=UTF-8
-Djava.library.path=<path to Tomcat>\webapps\Thingworx\WEB-INF\extensions

 

As I haven't been able to save via any of three methods like Configure Tomcat or setenv.bat or catalina.bat. Every time I edit catalina.bat or manually save setenv.bat , the tomcat crashes immediately.

 

Please explain about JAVA_OPTS, why above parameters are not mandatory ?

 

And also let me know the process to install license for ThingWorx 9.1.

 

If you don't have -Djava.library.path set then Thingworx normally crashes

 

Also keep in mind that if you have spaces in the path, you should put it into quotes, like

set JAVA_OPTS=-Dserver -Dd64 -XX:+UseG1GC -Dfile.encoding=UTF-8 -Djava.library.path="c:\Program Files (x86)\Apache Foundation\Apache Tomcat\webapps\WEB-INF"

ranjank
15-Moonstone
(To:DmitryTsarev)

@DmitryTsarev 

Thank you for your amazing help.

 

Now after putting  -Djava.library.path="c:\Program Files (x86)\Apache Foundation\Apache Tomcat\webapps\WEB-INF\extensions" value in double quotes I am able to place JAVA_OPTS parameters in setenv.bat file and my Thingworx 9.1 is also up.

 

Cheers

Announcements


Top Tags