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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Cannot deploy Thingworx WAR on Ubuntu as non-root

mikei
1-Newbie

Cannot deploy Thingworx WAR on Ubuntu as non-root

<p>When attempting to start Tomcat 7, the following error is returned with the stacktrace:<div><div>INFO: Deploying web application archive /usr/share/tomcat7/webapps/Thingworx.war</div><div>java.lang.NullPointerException</div><div>        at com.thingworx.entities.EntityReference.&lt;init&gt;(EntityReference.java:33)</div><div>        at com.thingworx.system.ThingWorxServer.checkDefaultPermissions(ThingWorxServer.java:263)</div><div>        at com.thingworx.system.ThingWorxServer.Initialize(ThingWorxServer.java:74)</div><div>        at com.thingworx.system.ThingWorxBootstrapper.contextInitialized(ThingWorxBootstrapper.java:115)</div><div>        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4973)</div><div>        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5467)</div><div>        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)</div><div>        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)</div><div>        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)</div><div>        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)</div><div>        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1083)</div><div>        at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1880)</div><div>        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)</div><div>        at java.util.concurrent.FutureTask.run(FutureTask.java:262)</div><div>        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)</div><div>        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)</div><div>        at java.lang.Thread.run(Thread.java:745)</div></div><div><br></div><div>This does not happen when I attempt to start Tomcat as root.  The /ThingworxStorage and /ThingworxBackupStorage directories both exist and have open permissions.  In fact, after starting Tomcat as the non-root user, the /ThingworxStorage folder successfully is populated with all of its files and folders.</div><div><br></div><div>I am attempting to start Tomcat as the user "tomcat" in the user group "tomcat".  Here is some additional info:</div>h3. <span style="font-weight: normal;">== /etc/lsb-release ==<br></span><span style="font-weight: normal;">DISTRIB_ID=Ubuntu<br></span><span style="font-weight: normal;">DISTRIB_RELEASE=14.04<br></span><span style="font-weight: normal;">DISTRIB_CODENAME=trusty<br></span><span style="font-weight: normal;">DISTRIB_DESCRIPTION="Ubuntu 14.04 LTS"<br></span><span style="font-weight: normal;"><o:p> <br></o:p></span><span style="font-weight: normal;">== /ThingworxStorage ==<br></span><span style="font-weight: normal;">total 24<br></span><span style="font-weight: normal;">drwxrwxrwx 8 root   root  

4096 Jul 17 15:29 <span style="background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;">.<br><o:p></o:p></span></span><span style="font-weight: normal;">drwxr-xr-x 4 root   root  

4096 Jul 17 02:45 ..<br></span><span style="font-weight: normal;">drwxr-xr-x 2 tomcat tomcat 4096 Jul 17 15:29 certificates<br></span><span style="font-weight: normal;">drwxr-xr-x 3 tomcat tomcat 4096 Jul 17 15:29 database<br></span><span style="font-weight: normal;">drwxr-xr-x 2 tomcat tomcat 4096 Jul 17 15:29 exports<br></span><span style="font-weight: normal;">drwxr-xr-x 2 tomcat tomcat 4096 Jul 17 15:29 extensions<br></span><span style="font-weight: normal;">drwxr-xr-x 2 tomcat tomcat 4096 Jul 17 15:29 logs<br></span><span style="font-weight: normal;">drwxr-xr-x 2 tomcat tomcat 4096 Jul 17 15:29 repository<br></span><span style="font-weight: normal;"><o:p> <br></o:p></span><span style="font-weight: normal;">== /ThingworxBackupStorage ==<br></span><span style="font-weight: normal;">drwxrwxrwx 3 root   root  

4096 Jul 17 15:29 <span style="background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;">.<br><o:p></o:p></span></span><span style="font-weight: normal;">drwxr-xr-x 4 root   root  

4096 Jul 17 02:45 ..<br></span><span style="font-weight: normal;">drwxr-xr-x 2 tomcat tomcat 4096 Jul 17 15:29 backups<br></span><span style="font-weight: normal;"><o:p> </o:p></span>

<div><span style="font-weight: normal;"><o:p>Please let me know if you need any additional information.  Thanks for your help!</o:p></span></div><div><span style="font-weight: normal;"><o:p><br></o:p></span></div><div><span style="font-weight: normal;"><o:p>Regards,</o:p></span></div><div><span style="font-weight: normal;"><o:p>Mike Intravaia</o:p></span></div><div><p class="MsoNormal"><o:p></o:p></p>

 

<p class="MsoNormal"><o:p></o:p></p>

 

<p class="MsoNormal"><o:p></o:p></p>

 

<p class="MsoNormal"><o:p></o:p></p>

 

<p class="MsoNormal"><o:p></o:p></p>

 

 

 

<p class="MsoNormal"><o:p></o:p></p>

 

<p class="MsoNormal"><o:p></o:p></p>

 

 

 

<p class="MsoNormal"><o:p></o:p></p>

 

<p class="MsoNormal"><o:p></o:p></p>

 

<p class="MsoNormal"><o:p></o:p></p>

 

<p class="MsoNormal"><o:p></o:p></p>

 

<p class="MsoNormal"><o:p></o:p></p>

 

<p class="MsoNormal"><o:p></o:p></p>

 

<p class="MsoNormal"><o:p></o:p></p>

 

 

 

<p class="MsoNormal"><o:p></o:p></p>

 

 

 

 

 

</div></p>

2 REPLIES 2
mikei
1-Newbie
(To:mikei)

I have figured it out.  I had started Tomcat as the "tomcat" user, but not using a new login shell as the "tomcat" user.  Starting it with a new login shell fixed it (i.e.: "su - tomcat ..../startup.sh").

smanley
13-Aquamarine
(To:mikei)

Hi Mike,

What are the permissions for the Catalina script in the bin directory of your tomcat install.


Thanks,

Saeed



Top Tags