Deployment error

Hi,
I would be very grateful if someone could help me with this error during the application deployment to Tomcat:

21-Jan-2021 17:59:46.123 SEVERE [Catalina-utility-2] org.apache.catalina.core.StandardContext.listenerStart Excepción al enviar evento inicializado de contexto a instancia de escuchador de clase [com.haulmont.cuba.core.sys.singleapp.SingleAppCoreServletListener]
	java.lang.RuntimeException: An error occurred while starting single WAR application
		at com.haulmont.cuba.core.sys.singleapp.SingleAppCoreServletListener.contextInitialized(SingleAppCoreServletListener.java:85)
		at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4716)
		at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5177)
		at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
		at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:717)
		at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:690)
		at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:706)
		at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:978)
		at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1848)
		at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
		at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
		at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
		at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:118)
		at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:773)
		at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:427)
		at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1620)
		at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:305)
		at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
		at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1151)
		at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1353)
		at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1357)
		at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1335)
		at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
		at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
		at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
		at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
		at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
		at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
		at java.base/java.lang.Thread.run(Thread.java:834)
	Caused by: java.lang.reflect.InvocationTargetException
		at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
		at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
		at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
		at java.base/java.lang.reflect.Method.invoke(Method.java:566)
		at com.haulmont.cuba.core.sys.singleapp.SingleAppCoreServletListener.contextInitialized(SingleAppCoreServletListener.java:78)
		... 28 more
	Caused by: java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
		at org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:168)
		at org.springframework.context.support.AbstractApplicationContext.getAutowireCapableBeanFactory(AbstractApplicationContext.java:340)
		at com.haulmont.cuba.core.sys.CubaXmlWebApplicationContext.createBeanFactory(CubaXmlWebApplicationContext.java:29)
		at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:127)
		at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:638)
		at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:523)
		at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:702)
		at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:668)
		at com.haulmont.cuba.core.sys.remoting.RemotingServlet.initWebApplicationContext(RemotingServlet.java:99)
		at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:530)
		at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:170)
		at javax.servlet.GenericServlet.init(GenericServlet.java:158)
		at com.haulmont.cuba.core.sys.remoting.RemotingServlet.init(RemotingServlet.java:181)
		at com.haulmont.cuba.core.sys.singleapp.SingleAppCoreContextLoader.contextInitialized(SingleAppCoreContextLoader.java:52)
		... 33 more

An older version of same application developed with Cuba-Platform v 7.2.8 was deployed to Tomcat Server 9 without problem. But, now, all software in the server has been reinstalled due to a Ransomware virus.

Here you are the details of the platform and log files:

Development platform :
CUBA Platform version: 7.2.11
CUBA Studio plugin version: 15.1-202
IntelliJ version: CUBA Studio 2020.2
O.S.: Linux (Ubuntu 20.0.4)

Server platform:
Application server: Apache Tomcat/9.0.41
OS: Windows 7 Version: 6.1
JDK : IMPLEMENTOR=“Oracle Corporation” VERSION=“18.9” JAVA_VERSION=“11” JAVA_VERSION_DATE=“2018-09-25”

Thanks in advancecatalina.2021-01-21.log (16.0 KB) localhost.2021-01-21.log (10.8 KB)

Please verify that htis is the first exception in the log, this kind of error is typically preceded by another problem.

for good measure, if you attach a log, attach the full log, not just a part.

1 Like

Hi,
There is not enough information in these log files (written by Tomcat itself).
The cause of the problem will most likely appear in the app.log file written by logback the the CUBA log directory.
You need to setup app.home directory, make sure it is writeable by the Tomcat process and look for logback log files in the ${app.home}/logs folder.

1 Like

Thanks, Alex.

Yesterday I looked for app.log file into application directory but it didn’t exist.

As you commented in your answer, the ‘app.home’ Java system property hadn’t any value and the app.log file was in \app_home\logs from apache tomcat root directory.

Once I’ve just readen the app.log file, I’ve just discovered the problem that’s related with a database update error.

Regards

Thanks, Tom

You’are right!. I’ve just answered Alex that the app.log file wasn’t where I supposed.

Regards,