Unable to deploy on local tomcat

Hi,

I am trying to deploy a small app for testing purposes in my local tomcat, as a previous step before attempting on a remote server.

Have successfully produced app.war and app-core.war and uploaded them in the tomcat server via manager/html.

But when attempting to login the page doesn’t load, arguing the ApplicationContext is missing.

org.springframework.remoting.RemoteAccessException: Could not access HTTP invoker remote service at [cuba_TrustedClientService]; nested exception is java.io.IOException: Did not receive successful HTTP response: status code = 500, status message = [Internal Server Error]
at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.convertHttpInvokerAccessException(HttpInvokerClientInterceptor.java:231)
at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.invoke(HttpInvokerClientInterceptor.java:157)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
at com.sun.proxy.$Proxy290.healthCheck(Unknown Source)
at com.haulmont.cuba.web.AppUI.init(AppUI.java:330)
at com.vaadin.ui.UI.doInit(UI.java:738)
at com.vaadin.server.communication.UIInitHandler.getBrowserDetailsUI(UIInitHandler.java:209)
at com.vaadin.server.communication.UIInitHandler.synchronizedHandleRequest(UIInitHandler.java:67)
at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:40)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1578)
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:425)
at com.haulmont.cuba.web.sys.CubaApplicationServlet.serviceAppRequest(CubaApplicationServlet.java:329)
at com.haulmont.cuba.web.sys.CubaApplicationServlet.service(CubaApplicationServlet.java:215)
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.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.springframework.web.filter.CompositeFilter$VirtualFilterChain.doFilter(CompositeFilter.java:108)
at org.springframework.web.filter.CompositeFilter.doFilter(CompositeFilter.java:74)
at com.haulmont.cuba.web.sys.CubaHttpFilter.doFilter(CubaHttpFilter.java:93)
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:219)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506)
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:962)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1115)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: Did not receive successful HTTP response: status code = 500, status message = [Internal Server Error]
at org.springframework.remoting.httpinvoker.SimpleHttpInvokerRequestExecutor.validateResponse(SimpleHttpInvokerRequestExecutor.java:187)
at com.haulmont.cuba.core.sys.remoting.ClusteredHttpInvokerRequestExecutor.doExecuteRequest(ClusteredHttpInvokerRequestExecutor.java:79)
at org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor.executeRequest(AbstractHttpInvokerRequestExecutor.java:140)
at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.executeRequest(HttpInvokerClientInterceptor.java:206)
at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.executeRequest(HttpInvokerClientInterceptor.java:188)
at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.invoke(HttpInvokerClientInterceptor.java:154)
… 38 more

any guidance on how to resolve this issue is greatly appreciated.

Regards,

Carlos.

Hi,

There are two options:

  1. You have set “cuba.connectionUrlList” property incorrectly, so web block connects to some wrong place, not to the core block. Default value works for tomcat port 8080 and core webContextName “app-core”.

  2. core block has failed to start, or has some other problems.

In both cases you should analyze log files: CUBA log app.log and Tomcat logs (catalina.out, catalina.log, localhost.log) for possible startup errors.

Also, have you tried to restart the Tomcat server? Maybe you’ve copied WARs in wrong order (app-core.war should start first).

Are you absolutely sure you need separate WARs? For most users single WAR is more preferable because it is easier to configure.

Hi Alex,

I don’t have any preference between 1 or 2 war file deployments. Honestly the one that is easier to maintain. I know deploying a single file involved doing further steps, so wanted to try first a straight deployment.

Here my catalina.out and catalinax.out logs.

It is apparently a jdbc issue not being able to find CubaDS. It surely is a configuration issue, then the deployment machine for the time being is the same as the development machine.

Since I am newbie with CUBA I would appreciate some guidance please.

Many thanks in advance.

Regards,
Carlos.catalina logs.zip (93.4 KB)

Hi,
We have detailed deployment instructions in the manual:
https://doc.cuba-platform.com/manual-7.2/tomcat_war_deployment.html

https://doc.cuba-platform.com/manual-7.2/tomcat_war_deployment_linux.html

Your error means that you have not configured a database connection for your application.
It’s this step from “tomcat deployment on Windows”:

If you want to provide production database connection properties with a local file on the server, you can create a file in the conf\Catalina\localhost subfolder of the Tomcat server. The name of the file depends on the WAR file name, e.g. app.xml for single WAR and app-core.xml if separate WAR files are deployed. Copy contents of the context.xml to this file.

Cool Alex. That did the trick!

Sorry for not being able to interpret correctly the manual. I gave for granted that CubaStudio and its deployment utilities would manage that part.

Thanks for the effective guidance.

Regards,

Carlos Conti.