I tried to upload my application to my Tomcat instance today.
When i uploaded App-core i got this error message:
2017-04-24 15:28:27.507 ERROR [localhost-startStop-1] com.haulmont.cuba.core.sys.AppContextLoader - Error initializing application
java.lang.RuntimeException: java.io.FileNotFoundException: /app_home/app-core/work/orm.xml (Fila eller mappa finnes ikke)
at com.haulmont.cuba.core.sys.persistence.MappingFileCreator.writeDocument(MappingFileCreator.java:213) ~[cuba-core-6.4.2.jar:6.4.2]
at com.haulmont.cuba.core.sys.persistence.MappingFileCreator.create(MappingFileCreator.java:111) ~[cuba-core-6.4.2.jar:6.4.2]
at com.haulmont.cuba.core.sys.persistence.PersistenceConfigProcessor.create(PersistenceConfigProcessor.java:108) ~[cuba-core-6.4.2.jar:6.4.2]
at com.haulmont.cuba.core.sys.AppContextLoader.createPersistenceXml(AppContextLoader.java:70) ~[cuba-core-6.4.2.jar:6.4.2]
at java.util.ArrayList.forEach(ArrayList.java:1249) ~[na:1.8.0_121]
at com.haulmont.cuba.core.sys.AppContextLoader.beforeInitAppContext(AppContextLoader.java:85) ~[cuba-core-6.4.2.jar:6.4.2]
at com.haulmont.cuba.core.sys.AbstractWebAppContextLoader.contextInitialized(AbstractWebAppContextLoader.java:70) ~[cuba-global-6.4.2.jar:6.4.2]
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4745) [catalina.jar:8.5.14]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5207) [catalina.jar:8.5.14]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [catalina.jar:8.5.14]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752) [catalina.jar:8.5.14]
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728) [catalina.jar:8.5.14]
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734) [catalina.jar:8.5.14]
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:952) [catalina.jar:8.5.14]
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1823) [catalina.jar:8.5.14]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_121]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_121]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_121]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_121]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_121]
Caused by: java.io.FileNotFoundException: /app_home/app-core/work/orm.xml (Fila eller mappa finnes ikke)
at java.io.FileOutputStream.open0(Native Method) ~[na:1.8.0_121]
at java.io.FileOutputStream.open(FileOutputStream.java:270) ~[na:1.8.0_121]
at java.io.FileOutputStream.<init>(FileOutputStream.java:213) ~[na:1.8.0_121]
at java.io.FileOutputStream.<init>(FileOutputStream.java:162) ~[na:1.8.0_121]
at com.haulmont.cuba.core.sys.persistence.MappingFileCreator.writeDocument(MappingFileCreator.java:210) ~[cuba-core-6.4.2.jar:6.4.2]
... 19 common frames omitted
24-Apr-2017 15:28:27.510 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file
24-Apr-2017 15:28:27.528 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal Context [/app-core] startup failed due to previous errors
Your appHome needs to point to the folder that the war file is going to be copied to. For example:
appHome = ‘/home/site/wwwroot/webapps’.
You need appHome to point to the webapps folder that the war file is copied to. Please CUBA team, this is a recurring issue and needs to be better documented in the docs and give a better default value then just ‘app_home’.
I think your default of ‘app_home’ when creating war file is misleading and what causes people to not understand. I have spent hours as a newbie trying to figure this out. It’s a no brainer for people that are experienced but for people that are new, we are assuming the default values being provided are valid … and they are not.
People, ‘app_home’ is a placeholder for where you are specifying the war file is being copied to. It can be absolute or relative but it needs to eventually point to the ‘webapps’ folder.
So if I want to deploy to Tomcat I have to create a folder inside webapps with the name app_home?
And the deployment will copy the app.war and app-core.war to app_home?
Good. I hope others also can make use of this topic.
And CUBA-platform team: Please put this information into the documentation.
It will make things easy for other users to.
IanE. To you have any experience with Nginx on Ubuntu and using it to redirect the user to different instances of Tomcat but still come from the same address outside?