WAR deploy fails to start

Setting up a new server and got a new error I’ve never seen before. It keeps the WAR from starting.
CentOS 7 (running in Docker)
Java 1.8.0_101

Jan 23, 2017 2:58:03 AM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter com.servoy.j2db.server.ngclient.NGClientEntryFilter
java.lang.NullPointerException
at com.servoy.j2db.server.ngclient.NGClientEntryFilter.init(NGClientEntryFilter.java:109)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:105)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4908)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5602)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1312)
at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:690)
at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:216)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:136)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:614)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)

Hi Scott

Cant answer the specific question but had similar issues with the war starting, managed to fix it with this …

#TestFile
FROM tomcat:8.0
MAINTAINER Gordon McLean Gordon@Clickdigital.com
COPY war /usr/local/tomcat/webapps
CMD [“catalina.sh”, “run”]
VOLUME /velocity
EXPOSE 8080

It appeared that you have to specifically start catalina with CMD [“catalina.sh”, “run”]

I have deployed this to Amazon AWS via Docker Cloud I will share what I did on GitHub shortly

Best
Gordon

which servoy version is this?

Version 8.0.3

I have done several other Docker deployment too, but just problems with this one.

ah then the line number makes sense (there are quite some changes in that area already to 812rc)

but it is on a weird line, don’t you have any exceptions in front of that? Because something is not started (our internal application server instance) that should already be up and running by then for a long time
I guess multiply things don’t work? like the admin pages?

Yes, nothing works. the war unzips, but nothing seems to be listening. Directory /usr/share/tomcat/.servoy is also empty. Doesn’t seem like it gets very far.

also nothing in the tomcat logs? Because it seems to me that the WarClientServletContextListener that is or should be hit the first is not working correctly

So…I’m back trying to get this working on this same server again. This time I’ve updated to 8.1.2 .

So I have:
Servoy: 8.1.2 - build 3031
Java: 1.8.0_101-b13
OS: CentOS Linux release 7.3.1611 (Core)
Docker: 1.12.6

I get this error after uploading the war. It unzips, but fails to start.

Mar 04, 2017 4:48:54 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Mar 04, 2017 4:48:54 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Mar 04, 2017 4:48:54 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeAdded(‘org.apache.jasper.compiler.TldLocationsCache’, ‘org.apache.jasper.compiler.TldLocationsCache@7a5d7797’)
Mar 04, 2017 4:55:16 PM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter com.servoy.j2db.server.ngclient.NGClientEntryFilter
java.lang.NullPointerException
at com.servoy.j2db.server.ngclient.NGClientEntryFilter.init(NGClientEntryFilter.java:122)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:105)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4908)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5602)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1092)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:560)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1779)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(Unknown Source)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(Unknown Source)
at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1506)
at org.apache.catalina.manager.HTMLManagerServlet.upload(HTMLManagerServlet.java:285)
at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:205)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:136)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:614)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)

Mar 04, 2017 4:55:18 PM org.apache.catalina.core.StandardContext listenerStop
SEVERE: Exception sending context destroyed event to listener instance of class com.servoy.j2db.server.servlets.WarClientServletContextListener
java.lang.NullPointerException
at com.servoy.j2db.persistence.ContentSpec.clear(ContentSpec.java:389)
at com.servoy.j2db.server.servlets.WarClientServletContextListener.contextDestroyed(WarClientServletContextListener.java:170)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:5115)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5779)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:224)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:159)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1092)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:560)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1779)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(Unknown Source)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(Unknown Source)
at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1506)
at org.apache.catalina.manager.HTMLManagerServlet.upload(HTMLManagerServlet.java:285)
at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:205)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:136)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:614)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)

So, I’m guessing the problem is somewhere in here:

Mar 04, 2017 4:55:18 PM org.apache.catalina.core.StandardContext listenerStop
SEVERE: Exception sending context destroyed event to listener instance of class com.servoy.j2db.server.servlets.WarClientServletContextListener
java.lang.NullPointerException
at com.servoy.j2db.persistence.ContentSpec.clear(ContentSpec.java:389)
at com.servoy.j2db.server.servlets.WarClientServletContextListener.contextDestroyed(WarClientServletContextListener.java:170)

no that is in the destroy again (because it can’t init)
so that is just a result of the failure not the failure it self

problem is in

java.lang.NullPointerException
at com.servoy.j2db.server.ngclient.NGClientEntryFilter.init(NGClientEntryFilter.java:122)

that is this line in servoy:

ApplicationServerRegistry.getServiceRegistry().registerService(IMessagesRecorder.class, new MessageRecorder());

The problem is then that that is again also a result of something that goes wrong before that…
because getServiceRegistry() returns null here. That shouldn’t happen

Before that Filter.init() is called the WarClientServletContextListener should be executed first that should bring up the whole application server…

So i really don’t understand why the ContextListener is not executed or that you don’t see a exception coming from that
See the web.xml in the WEB-INF dir of the war that you have:

com.servoy.j2db.server.servlets.WarClientServletContextListener

that listener should be executed before anything… Thats how we start servoy app server.

Edit:
now i see that it is called or touched (because in the on destroy we do see that specific class)
But are you really not seeing any error where you see this in the stacktrace:

com.servoy.j2db.server.servlets.WarClientServletContextListener.contextInitialized(xxxx)

I pasted in the whole log. Is there anything else I can do to get you more info?

of every log file that you could find? So all tomcat logging but also the servoy log file? (i guess thats not really created yet)

i can’t do anything with this. because it seems that something fails or really isn’t configured correctly like SERVOY_HOME ?

Hi

I have the same problem. I’m just trying to set up WAR-Deployment with ANT/Jenkis for fun. So there’s no hurry.

On a remote VM I get also this

java.lang.NullPointerException
at com.servoy.j2db.server.ngclient.NGClientEntryFilter.init(NGClientEntryFilter.java:122)

I tried it on a local tomcat (not the application-server of the developer, it a separate installation running on localhost:8888) and the WAR-file is running correctly.

Looks like there could be a configuration issue on the remote VM. What did you mean with SERVOY_HOME? The only configuration I did on the tomcat server was to set an admin-role and to liften up the max-upload-size. Is there anything more to do? E.g. read or writing rights for servoy?

Thanks a lot

Gregory

that the same thing, there has to be exceptions before that, if you get an exception there on NGClientEntryFilter then it is because the application server of servoy itself didn’t start up fully

Hi Johann

:oops: !!! I made a post how I solved it in my case. Who is interested, please check PAGE 2!!! on the bottom of this forum. Unbelievable. America first, Gregory second! :oops:

You where right!
I didn’t found an exception in the log. But after a while I checked catalina.out file. There it was!

‘Coudn’t create server properties file in user home: usr/share/tomcat7 directory. Please set SERVOY_USER_HOME variable …’

Thanks a lot

I will do that next week. It’s enough for today.

Greetings Gregory

yes thats the biggest problem, i have also a feeling that Scott has a simular thing.

Maybe we need to fail a bit harder then (so the whole context doesn’t come up). Problem is that we can’t log like we normally do because almost nothing is initialized correctly.

Finally that thing works :lol:

I would like to show how I solved it in my case and hope that it helps someone. Unfortunately every installation is different and has a different directory structure. So keep trying and never give up even on a windows.

My tomcat7 is running on a ubunutu server 16.04.2 LTS and was installed over apt-get install. The WAR is build by a Servoy 8.1.2.

While deploying the WAR-file I had the following Error in my log:

Mär 30, 2017 6:24:48 PM org.apache.catalina.core.StandardContext filterStart
SCHWERWIEGEND: Exception starting filter com.servoy.j2db.server.ngclient.NGClientEntryFilter
java.lang.NullPointerException
	at com.servoy.j2db.server.ngclient.NGClientEntryFilter.init(NGClientEntryFilter.java:122)
	at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)....

and

Mär 30, 2017 6:24:51 PM org.apache.catalina.core.StandardContext listenerStop
SCHWERWIEGEND: Exception sending context destroyed event to listener instance of class com.servoy.j2db.server.servlets.WarClientServletContextListener
java.lang.NullPointerException
	at com.servoy.j2db.persistence.ContentSpec.clear(ContentSpec.java:389)
	at com.servoy.j2db.server.servlets.WarClientServletContextListener.contextDestroyed(WarClientServletContextListener.java:170)
	at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:5115)

If you have similar errors, please search and check a file called ‘catalina.out’. It is somewhere in a log folder around your tomcat installation or in my case in /var/log/tomcat. I guess catalina.out is what tomcat tells you when you start it over a console. A lot of java stuff, what tomcat is doing while startup. It can be quiet big. If it’s the right file you can delete it and it starts to log new. But be careful with deleting files when you not sure!!!

So look for an error like this in the catalina.out file (‘…’ means left out lines):

Mär 30, 2017 6:24:40 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNUNG: Problem with directory [/usr/share/tomcat7/common/classes], exists: [false], isDirectory: [false], canRead: [false]
Mär 30, 2017 6:24:40 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNUNG: Problem with directory [/usr/share/tomcat7/common], exists: [false], isDirectory: [false], canRead: [false]
Mär 30, 2017 6:24:40 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNUNG: Problem with directory [/usr/share/tomcat7/server/classes], exists: [false], isDirectory: [false], canRead: [false]
Mär 30, 2017 6:24:40 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNUNG: Problem with directory [/usr/share/tomcat7/server], exists: [false], isDirectory: [false], canRead: [false]
Mär 30, 2017 6:24:40 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNUNG: Problem with directory [/usr/share/tomcat7/shared/classes], exists: [false], isDirectory: [false], canRead: [false]
Mär 30, 2017 6:24:40 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNUNG: Problem with directory [/usr/share/tomcat7/shared], exists: [false], isDirectory: [false], canRead: [false]
...
...
NFORMATION: 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.
java.io.IOException: Datei oder Verzeichnis nicht gefunden
	at java.io.UnixFileSystem.createFileExclusively(Native Method)
	at java.io.File.createNewFile(File.java:1012)
...
...
Couldn't create server properties file in user.home: /usr/share/tomcat7 directory. Please set a SERVOY_USER_HOME variable (env. variable or java -D... arg) which points to a writable directory.
Mär 30, 2017 6:24:48 PM org.apache.catalina.core.StandardContext startInternal
SCHWERWIEGEND: One or more Filters failed to start. Full details will be found in the appropriate container log file
Mär 30, 2017 6:24:48 PM org.apache.catalina.core.StandardContext startInternal
SCHWERWIEGEND: Context [/Menuplanner] startup failed due to previous errors
...
...

On the bottom you see the line ‘Couldn’t create server properties file in user.home: /usr/share/tomcat7 directory. Please set a SERVOY_USER_HOME variable…’. That’s the actual problem. Tomcat can’t write in the /usr/share/tomcat7 directory. A naive way would be to give tomcat access to that folder. I guess it’s o.k. in a non-production environment to see if that is the only problem, but it’s a security hole. So don’t do that. Do as suggested and set the SERVOY_USER_HOME variable!

But that was the task where I bit my teeth out. It took me hours! I hope you are faster.

I tried to set it directly with ‘export SERVOY_USER_HOME=/var/lib/tomcat/user_home’ and changed many files around tomcat. Nothing worked. You can google a bit for 'set tomcat environment variable. Maybe you find a good solution for you.
A way could be to set an setenv script described here: https://tomcat.apache.org/tomcat-7.0-doc/RUNNING.txt (did’t work for me)

The only thing that worked for me, was to set a java -D argument. After hours I found a file in /etc/default called tomcat7. I changed:

JAVA_OPTS="-Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC"

to

JAVA_OPTS="-Djava.awt.headless=true -DSERVOY_USER_HOME=/var/lib/tomcat7/user_home -Xmx128m -XX:+UseConcMarkSweepGC"

and created a directory user_home there and gave tomcat read and write access. Be careful when changing such file and make a backup before you do it. In a stand-alone installation the file /etc/default/tomcat7 could be catalina.sh or catalina.bat located in the bin directory. Check out that for JAVA_OPTS.

After a restart everything was o.k. and I could finally deploy my WAR-file.

Thanks to Johan again to bring me on the right way!

Greetings Gregory

This thread was a great help, as we had with Tomcat 9 the same problem and could solve it. Thanks!