背景
在做项目时,用户自行做tomcat升级tomcat8.5.*->tomcat9.0.*,操作:删除之前的tomcat,重新导入9.0版本tomcat,将Thingworx.war包放入webappa目录后启动,发现启动失败,报错:
Failed to load FlxCore library. Ensure it's in PATH (Windows) or LD_LIBRARY_PATH(other platforms) or set with the VM arg, -Djava.library.path. Error message : com.flexnet.licensing.DllEntryPoint.entry([B)I
解决方案
1、在PTC官网查看解决方法,地址CS259533 - 尝试启动 ThingWorx Platform 时出现“无法加载 FlxCore 库”错误https://www.ptc.com/en/support/article/CS259533?art_lang=zh-cn
2、根据原因一条一条分析排除后,发现只剩下这条
- -Djava.library.path=<Tomcat>\webapps\Thingworx\WEB-INF\extensions参数从 Tomcat Java 设置中丢失
3、看到第二步我们大概就清楚了,缺失指定路径,tomcat8.*此路劲指定方法:
在tomcat /bin文件中创建一个名为setenv.sh的新文件
CATALINA_OPTS="$CATALINA_OPTS -Djava.library.path=/usr/share/tomcat8.5/8.5.xx/webapps/Thingworx/WEB-INF/extensions"
参考官网安装步骤
4、文件创建好后记得授予权限,然后再次启动又遇到了一个新的错误
The installation grace period is over. You must install license manually by placing the license_capability_response.bin file in thingworx platform dir
根据意思提示是授权文件问题,我们需要找到设备ID生请授权,设备ID在ThingworxPlatform下licenseRequestFile.txt文件中。
5、完成以上步骤后重新启动tomcat即可启动成功!