SingleWar Application HTTP 404 on Tomcat 8

Hi all,
after adding some sample stuffs to sample-sales application i tried to deploy into a production-server to improve my use of platform

I used an existing Tomcat server creating a singlewar package

Application successfully deployed and started on server (windows 7 professional 64bit) but when i try to use them simply accessing to

[url=]http://localhost:8080/app/[/url]

i recieve HTTP Status 404 for /app/

type Status report
message /app/
description The requested resource is not available.
Apache Tomcat/8.0.36

any ideas?
Saro

Hi,
Have you increased the “Maximum memory pool” value for your Tomcat server?
As described here [url=https://doc.cuba-platform.com/manual-6.2/tomcat_war_deployment.html?_ga=1.141922353.2030361064.1466500126]https://doc.cuba-platform.com/manual-6.2/tomcat_war_deployment.html[/url]?
One of the possible reason is that the Tomcat lacks of memory. But in this case the tomcat manager should show running = false state of the application.

It is very hard to guess what may be wrong. Try to find some errors in logs (the tomcat/logs directory).

Hi,
what would be an optimal value for “Maximum memory pool” value for your Tomcat server? (sample-sales application scenario )
anyway no error has reported into tomcat logs

regards
Saro

Hi
It is still hard to say what may be wrong without viewing any logs.
I have tried to deploy “Sales” sample project to Tomcat on my Windows system and discovered a few possible reasons of why the application fails to start:

At first, the “buildWar” task could be configured improperly:
If the includeJdbcDriver and includeContextXml options are not set to true, the corresponding files should be manually put on server.
If we use HSQLDB in our project, it is better to enable that options. Also set the hsqlInProcess = true.
The following buildWar task should pass in most cases:


task buildWar(type: CubaWarBuilding) {
    appHome = '..'
    webXmlPath = 'modules/web/web/WEB-INF/single-war-web.xml'
    appProperties = ['cuba.automaticDatabaseUpdate':'true']
    includeJdbcDriver = true
    includeContextXml = true
    hsqlInProcess = true
}

The second is, that the single-war-web.xml could contain mistakes.
Let me share a method of how that file could be easily generated without copying code from documentation:

  1. open the PROJECT PROPERTIES tab of navigation panel
  2. press the “Cloud deployment settings” page
  3. find the “Custom web.xml path” property and press the Generate button near it
    As a result modules/web/web/WEB-INF/single-war-web.xml will appear in your project. It is suitable for singleWar deployment.

Also, the Tomcat could incorrectly deploy the WAR. To prevent mistakes:

  1. stop the service
  2. erase the app folder (if your project has the ‘app’-prefix) from the tomcat/webapps directory.
  3. make sure you have no undeployed WARs in /webapps
  4. put the generated WAR to /webapps
  5. start the service
    When the Tomcat server starts, it should deploy the WAR and erase it after successful deployment.

If still unsuccessful, try to find some exceptions in the catalina.log.

Hi Rostislav ,
first of all thank for the response :wink:

database used for sample-sales application is SQL Server 2008 R2 on Windows Server 2012

Previously i have added this gradle task to build.gradle project file

task buildWar(type: CubaWarBuilding) {
appHome = ‘…’
webXmlPath = ‘modules/web/web/WEB-INF/single-war-web.xml’
appProperties = [‘cuba.automaticDatabaseUpdate’:‘true’]
includeJdbcDriver = true
includeContextXml = true
}
(so no hsqlInProcess proprieties used because i have SQL Server as DBMS )

single-war-web.xml used is attached on this message (take from the documentation) … vaadin production is TRUE

the only differences is

a. the method used for the creation of war file , I’ve used Eclipse Jee Neon a instead of Cubo Studio features
b. increase Maximum memory pool to 6144MB

with this new scenario after accessing to the startup page i recieve the error messagge attached
(seams something related to Vaadin modules )

regards
Saro

single-war-web.xml (2.8K)

error.txt (4.6K)

Hi
It seems, that Web Client Application class is incorrectly set in your single-war-web.xml


<context-param>
        <description>Web Client Application class</description>
        <param-name>application</param-name>
        <param-value><b>com.sample.library.web.App</b></param-value>
  </context-param>
1 Like

hi,
the error was what you had described :slight_smile:

Thanlks a lot
Saro