Could not access HTTP invoker remote service with 2 WAR files

Hi,

When I start the application from CUBA, everything is fine. However, if I generate a war with gradle task and I deploy it in a tomcat, when starting the tomcat this error occurs:

2018-12-05 16:25:10.067 INFO  [cuba_web_scheduler-2] com.haulmont.cuba.core.sys.remoting.ClusteredHttpInvokerRequestExecutor - Invocation of http://localhost:8080/app-core/remoting/cuba_TrustedClientService failed: java.io.IOException: Did not receive successful HTTP response: status code = 401, status message = [Unauthorized]
2018-12-05 16:25:10.067 INFO  [cuba_web_scheduler-2] com.haulmont.cuba.core.sys.remoting.ClusteredHttpInvokerRequestExecutor - No more URL available
2018-12-05 16:25:10.071 ERROR [cuba_web_scheduler-2] org.springframework.scheduling.support.TaskUtils$LoggingErrorHandler - Unexpected error occurred in scheduled task.
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 = 401, status message = [Unauthorized]
	at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.convertHttpInvokerAccessException(HttpInvokerClientInterceptor.java:226) ~[spring-web-4.3.18.RELEASE.jar:4.3.18.RELEASE]

What could be the cause?

Thanks

I have nothing configured with that service or with that port.
On port 8080 I have an Oracle. The application runs on port 9080. I do not know why an url is created on port 8080

As I see the problem is not related with TrustedClientService. It seems that you are trying to deploy 2 WAR files, in this case you will need to configure cuba.connectionUrlList application property for web WAR.

Have you deployed separate WAR files or a single WAR with middleware and web client?

Separate war. I have 3 wars (app, app-core, front)

In this case you cannot use local service invocations and middleware calls will go through network connection. The middleware URL is configured using cuba.connectionUrlList application property.

Ok, thank you very much

I am having this same problem.
Ivan, what did you do to solve this problem ?

I am also facing the same problem. my cuba.connectionUrlList is correct - http://localhost:8080/app-core & app-core.jar also deployed without errors. Still getting a similar error

06:53:17.953 WARN  o.s.web.servlet.PageNotFound            - No mapping for POST /app-core/remoting/cuba_AuthenticationService
06:53:17.972 INFO  c.h.c.c.s.r.ClusteredHttpInvokerRequestExecutor- Invocation of http://localhost:8080/app-core/remoting/cuba_AuthenticationService failed: java.io.IOException: Did not receive successful HTTP response: status code = 404, status message = [null]
06:53:17.975 INFO  c.h.c.c.s.r.ClusteredHttpInvokerRequestExecutor- No more URL available
06:53:17.977 WARN  o.s.s.o.p.endpoint.TokenEndpoint        - Handling error: RemoteAccessException, Could not access HTTP invoker remote service at [cuba_AuthenticationService]; nested exception is java.io.IOException: Did not receive successful HTTP response: status code = 404, status message = [null]

Hi,

  1. Either the http port in your Tomcat isn’t “8080”, or the application name isn’t “app-core”.
    You can post here full log file, there are some debug details written on startup.

  2. For most cases you don’t need to build and deploy separate WAR files if you use just core and web modules in your project. Using single WAR file is recommended, it’s easier to configure and deploy.

Thanks. it’s working now partially. The issue was that ‘app-core.war’ had a deployment error. Now both web applications are running. I confirmed with health check urls. But the strange issue right now is that I am not able to get a Oauth token for any users except "Administrator’ with the latest Rest Api plugin

{{host}}/app/rest/v2/oauth/token

Getting the following error

- Handling error: RemoteAccessException, Could not access HTTP invoker remote service at [cuba_AuthenticationService]; nested exception is com.haulmont.cuba.core.sys.serialization.SerializationException: Failed to deserialize object type

The core exception is StreamCorruptedException: Inconsistent vector internals

On debugging, I found It’s unable to deserialize the com.haulmont.cuba.security.global.UserSession object after it’s created in core module .

Any idea why this is happening ? I am using CUBA 7.2.12

Cheers, Ram