Problems with WAR deployment

Questions and Answers on installation, deployment, management, locking, tranasactions of Servoy Application Server

Problems with WAR deployment

Postby mwiedemann » Tue Nov 20, 2018 1:43 am

Hello everyone,

:x

I've been using Servoy for years, but am new to WAR and NG deployment. My server is running on a Windows 2016 Server, Tomcat 8.5, Postgres 10.5 Repository and Servoy 8.3.2.

I followed the instructions exactly from the Servoy video: Servoy tech webinar series 12: The art of WAR deployment

I've created a local Postgres repository database.

When using the Tomcat Web Application Manager, I pick my WAR file and hit deploy and it resets the browser. I have tried manual installation of the WAR file as well and that fails too.

My Tomcat Java user variables have been set up to create the "Servoy" folder in this location: c:\Program Files\Apache Software Foundation\Tomcat 8.5\Servoy

Here's my "Java Options" variable just as described in the instruction video:
-DSERVOY_USER_HOME=\\10.35.1.82\c$\Program Files\Apache Software Foundation\Tomcat 8.5\Servoy

When importing the WAR file, the directory never gets created, so I have no "servoy logs"

I'm about to put my fist through my screen at this point. The process of WAR deplayment is so poorly documented, I wish there were clearer instructions.

Here's a copy of the entries from the Tomcat log:

19-Nov-2018 14:25:29.395 INFO [localhost-startStop-2] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [C:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps\PD.war]
19-Nov-2018 14:25:47.364 SEVERE [localhost-startStop-2] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/PD]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:754)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:985)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [[email protected]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4907)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5042)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 10 more
Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [[email protected]]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:112)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:724)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 13 more
Caused by: java.lang.IllegalArgumentException: java.util.zip.ZipException: zip file is empty
at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:142)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)
... 16 more
Caused by: java.util.zip.ZipException: zip file is empty
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at org.apache.tomcat.util.compat.JreCompat.jarFileNewInstance(JreCompat.java:196)
at org.apache.tomcat.util.compat.JreCompat.jarFileNewInstance(JreCompat.java:181)
at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:139)
... 17 more

19-Nov-2018 14:25:47.364 SEVERE [localhost-startStop-2] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive [C:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps\PD.war]
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/PD]]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:758)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:985)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

19-Nov-2018 14:25:47.364 INFO [localhost-startStop-2] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [C:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps\PD.war] has finished in [17,969] ms
19-Nov-2018 14:26:10.860 INFO [http-nio-8085-exec-4] org.apache.catalina.startup.HostConfig.undeploy Undeploying context [/PD]
19-Nov-2018 14:27:27.449 INFO [localhost-startStop-3] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [C:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps\PD.war]
19-Nov-2018 14:27:41.277 SEVERE [localhost-startStop-3] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/PD]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:754)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:985)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [[email protected]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4907)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5042)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 10 more
Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [[email protected]]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:112)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:724)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 13 more
Caused by: java.lang.IllegalArgumentException: java.util.zip.ZipException: zip file is empty
at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:142)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)
... 16 more
Caused by: java.util.zip.ZipException: zip file is empty
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at org.apache.tomcat.util.compat.JreCompat.jarFileNewInstance(JreCompat.java:196)
at org.apache.tomcat.util.compat.JreCompat.jarFileNewInstance(JreCompat.java:181)
at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:139)
... 17 more

19-Nov-2018 14:27:41.277 SEVERE [localhost-startStop-3] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive [C:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps\PD.war]
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/PD]]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:758)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:985)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

19-Nov-2018 14:27:41.277 INFO [localhost-startStop-3] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [C:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps\PD.war] has finished in [13,828] ms
19-Nov-2018 14:28:50.440 INFO [http-nio-8085-exec-15] org.apache.catalina.startup.HostConfig.undeploy Undeploying context [/PD]
mwiedemann
 
Posts: 12
Joined: Wed Aug 05, 2015 7:05 pm

Re: Problems with WAR deployment

Postby sean » Tue Nov 20, 2018 4:20 pm

Hi

Tomcat complains that the zip file is empty. Assuming that your war file is not empty, here could be some other causes

The file is transferred over a slow connection, this can trip up tomcat when auto deploy is set to true. I see you tried to deploy manually - did you copy the file directly into the webapps dir from a remote location ?

if so, try to transfer it to a local folder first and then do a local copy into the webapps dir
Another option is to disable auto-deploy setting for tomcat

Another cause could be that the JRE doesn't have enough permissions on the war file

Another cause could be that there is not enough disk space to unpack the war (it is really just a big zip file)

More on this tomcat error here:

Hope this keeps you from punching your monitor
Software Engineer
Servoy USA
sean
 
Posts: 128
Joined: Mon May 21, 2007 6:26 pm
Location: USA

Re: Problems with WAR deployment

Postby omar » Tue Nov 20, 2018 4:50 pm

Hi, first try to create a simple hello world app without any plugins, beans or database connections other than the required repository database. Does this work? Did you run out of memory, is it a big app? You can check your Java memory configuration settings by running C:\Program Files\Apache Software Foundation\Tomcat 9.5\bin\tomcat9w.exe (or something like that corresponding to your version) and going to the Java tab and raising the values for the initial and maximum memory pool. Did you add the servers ip-address to the PostrgreSQL pg_hba.conf. I experienced trouble loading the jasperPluginRMI so avoid that for starters as well. I documented all my WAR file proceedings and got it to work so it is definitely doable.
Intrasoft, Founder
Omar van Galen
[email protected]
+31-(0)6-21234586
Servoy Developer
omar
 
Posts: 329
Joined: Sat Feb 12, 2011 4:51 pm
Location: Intrasoft, The Netherlands

Re: Problems with WAR deployment

Postby mwiedemann » Tue Nov 20, 2018 5:34 pm

Thanks for the responses guys.

The solution I'm uploading is pretty simple. Just a few forms and a little code. I'm also using a freshly created local windows server, so I shouldn't have any connection speed, disk space or memory issues.

I'll create a very simple one page solution and try uploading that. I'll post the results,

Thanks again,
Marty
mwiedemann
 
Posts: 12
Joined: Wed Aug 05, 2015 7:05 pm

Re: Problems with WAR deployment

Postby mwiedemann » Tue Nov 20, 2018 7:31 pm

I created a simple one form solution with one database connection, uploaded the WAR and it worked.

Now I need to figure out why the WAR file for my intended solution isn't working. There isn't much difference in the two solutions other than the real one has some web grids. Everything else is pretty much the same.

I'm also now unable to access the solution using a deep link. My URL is as follows: http://localhost:8085/solutions/hello/index.html

This returns a 404 as does the solution browsing URL at: http://localhost:8085/servoy-ngclient

I now have both log files (catalina and the servoy log) and they're both clean and not showing errors after the "hello world" solution upload.

What am I doing wrong with my deeplinks?

Thanks!
mwiedemann
 
Posts: 12
Joined: Wed Aug 05, 2015 7:05 pm

Re: Problems with WAR deployment

Postby sean » Tue Nov 20, 2018 7:41 pm

Perhaps you are missing the "context"
You can read more about it in the deployment documentation

A tomcat server can host multiple webapps, so unless you have deployed it as the ROOT application it will have context.
Hint: The context is the same name as the war file, so that name does matter. Also, a war file may contain zero, one or multiple solutions

i.e.
war file = hello.war then
http://localhost:8085/hello/solutions/hello/index/html
Software Engineer
Servoy USA
sean
 
Posts: 128
Joined: Mon May 21, 2007 6:26 pm
Location: USA

Re: Problems with WAR deployment

Postby mwiedemann » Tue Nov 20, 2018 8:03 pm

Thanks, the context makes sense and I've tried the updated URL.

Now I'm getting "Page cannot be displayed" The requested solution cannot be found. Looks like I'm getting closer.
mwiedemann
 
Posts: 12
Joined: Wed Aug 05, 2015 7:05 pm

Re: Problems with WAR deployment

Postby sean » Tue Nov 20, 2018 10:21 pm

You should at least be able to access servoy admin page ?
Is there anything at: http://localhost:8085/hello/servoy-admin/log ?
Software Engineer
Servoy USA
sean
 
Posts: 128
Joined: Mon May 21, 2007 6:26 pm
Location: USA

Re: Problems with WAR deployment

Postby swingman » Wed Nov 21, 2018 11:08 am

Hi, not sure if this will help... but...

Did you adjust the Tomcat setting for maximum upload size?

see

https://tecadmin.net/increase-tomcat-up ... ize-limit/

If you are uploading the WAR file, you need to tweak Tomcat first. It has a limit for the maximum upload allowed. Since the Servoy war file contains the whole Servoy server it is huge -- mine is 750MB -- way over the default upload limit of 50MB.
Christian Batchelor
Certified Servoy Developer
Batchelor Associates Ltd, London, UK
http://www.batchelorassociates.co.uk

http://www.postgresql.org - The world's most advanced open source database.
User avatar
swingman
 
Posts: 1238
Joined: Wed Oct 01, 2003 10:20 am
Location: London

Re: Problems with WAR deployment

Postby sean » Wed Nov 21, 2018 3:45 pm

Marty, that's a good tip from Christian.
However, this only affects the manager application, and you say that you already transferred the war manually and had the same problem, so don't know if that will help the original problem.
Software Engineer
Servoy USA
sean
 
Posts: 128
Joined: Mon May 21, 2007 6:26 pm
Location: USA

Re: Problems with WAR deployment

Postby mwiedemann » Wed Nov 21, 2018 7:17 pm

Thanks much everyone for responding to my issue.

I think I've got it sorted out now. I think my original problem of the WAR import failing came down to permission issues. The last part of the problem (URL almost working) came down to a difference in the text case of the solution name vs the name of the WAR file. One had a leading cap and the other didn't.

Thanks again for the help!
mwiedemann
 
Posts: 12
Joined: Wed Aug 05, 2015 7:05 pm


Return to Servoy Server

Who is online

Users browsing this forum: No registered users and 1 guest