Hi,
I’m trying to deploy the sample application into Tomcat which is hosted in the Cloud. I managed to get the Cuba login screen but when I entered the user ID and password it remains on the Login screen.
I notice there is an error in the log saying “HTTP Upgrade is not supported by this protocol”. Can someone help me identify the problem? Attached is the snapshot of the log file. Thanks.
2016-10-20 14:53:20.731 DEBUG [ajp-nio-33187-exec-1] com.haulmont.cuba.web.AppUI - Initializing AppUI
2016-10-20 14:53:20.731 DEBUG [ajp-nio-33187-exec-1] com.haulmont.cuba.web.App - Initializing application
20-Oct-2016 14:53:24.269 SEVERE [ajp-nio-33187-exec-1] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [app_servlet] in context with path [/life] threw exception
java.lang.UnsupportedOperationException: HTTP upgrade is not supported by this protocol
at org.apache.coyote.AbstractProcessor.doHttpUpgrade(AbstractProcessor.java:681)
at org.apache.coyote.AbstractProcessor.action(AbstractProcessor.java:474)
at org.apache.coyote.Request.action(Request.java:392)
at org.apache.catalina.connector.Request.upgrade(Request.java:1960)
at org.apache.catalina.connector.RequestFacade.upgrade(RequestFacade.java:1115)
at org.apache.tomcat.websocket.server.UpgradeUtil.doUpgrade(UpgradeUtil.java:234)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:77)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at com.haulmont.cuba.web.sys.CubaHttpFilter.handleNotFiltered(CubaHttpFilter.java:108)
at com.haulmont.cuba.web.sys.CubaHttpFilter.doFilter(CubaHttpFilter.java:95)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:108)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
at org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:476)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:802)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1410)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
I’m using Tomcat Hosting by JavaPipe. I was told by them that there is a unique Port number assigned to my Tomcat container for example 33nnn. So, they suggest to access the web app that I deployed using that port number like this: http://www.xxx.com:33nnn/app. By using this way, I managed to get around the previous issue of “HTTP upgrade is not supported”.
However, I get another error that suggest to me that the application is still trying to access the default HTTP port 8080. Then, I tried to change the HTTP port setting from within the Cuba Studio to 33nnn, rebuild the WAR and re-deploy the WAR to my Tomcat. However, I still get the same error where the app is still trying to access port 8080.
Hope this additional info can give you a clearer picture of where the issue might be. Thanks.
This is the error log that I get
2016-10-21 09:48:46.297 DEBUG [http-nio-33186-exec-9] com.haulmont.cuba.web.AppUI - Initializing AppUI
2016-10-21 09:49:51.419 INFO [http-nio-33186-exec-7] com.haulmont.cuba.core.sys.remoting.ClusteredHttpInvokerRequestExecutor - Invocation of http://localhost:8080/life-core/remoting/cuba_LoginService failed: java.net.ConnectException: Connection refused
2016-10-21 09:49:51.420 INFO [http-nio-33186-exec-7] com.haulmont.cuba.core.sys.remoting.ClusteredHttpInvokerRequestExecutor - No more URL available
2016-10-21 09:49:51.420 DEBUG [http-nio-33186-exec-7] com.haulmont.cuba.web.log.AppLog - WARNING: SocketException in CommunicationManager. Most likely client (browser) closed socket.
I think, You ned setup correctly the web tier (app) and middleware tier (app-core) connection.
You can find the help in the documentation about scalling.
You probably need to configure the web client’s cuba.connectionUrlList variable correctly and probably set cuba.useLocalServiceInvocation to false, otherways the web client allways tries to connect to the middleware over 127.0.0.1:8080.
Then Sandor is right, you should set up the cuba.connectionUrlList property on the web tier. You can provide it to the buildWar task in the appProperties map.
After I add in the cuba.connectionUrlList property in the buildWar, the previous problem is solved but then I get a different “HTTP 404” error.
Btw, I just noticed there was an error when app-core.WAR is deployed to Tomcat. The error comes from AppContextLoader - Error initializing application. Could it be the original problem?
Attached is the log starting from when the WAR(s) are deployed up to pressing Submit button at the Login screen. I hope you guys can help me find the problem from the log file. Thanks.