Upgrading from 7.1.3 to 7.1.4 generates an Unable to login as anonymous message

When I opened my cuba project today, it said there was a new version available. So I did the update and continued with my work. Running the app locally works fine. It was only when I generated a WAR file and deployed to a seperate tomcat 9 server, that I got this unable to login as anonymous! message.

  1. Both my cuba project and tomcat 9 server are pointing to the same database.
  2. the Anonymous user on this database exists.
  3. In other threads with the same error, I have double checked that the cuba.useLocalServiceInvocation=true and the cuba.connectionUrlList is correct.

As a last ditch effort, I decided to go into the Project properties and roll back to 7.1.3, redeploy the WAR file and try again. This time it works. So apparently, going from 7.1.3 to 7.1.4 has generated a problem.

I’ve attached the app.log file. Near the end of the file is when I rolled back to 7.1.3 and things started with no error.

app.log (31.3 KB)

It is clear from the log file that your cuba.connectionUrlList property in the web module is not synchronized with “cuba.webContextName” value of the core module.

See one line:

2020-02-01 18:57:45.474 INFO  [http-nio-8080-exec-8/app-core/server] com.haulmont.cuba.core.app.ConfigStorage - Loading DB-stored app properties cache
2020-02-01 18:57:46.839 INFO  [http-nio-8080-exec-8/app-core/server] com.haulmont.cuba.core.sys.DefaultPermissionValuesConfig - Initializing default permission values
2020-02-01 18:57:47.029 INFO  [http-nio-8080-exec-8/app-core/server] com.haulmont.cuba.security.auth.AuthenticationManagerBean - Logged in: 3af7938d-5f40-b232-2f01-bf10a6296788 [anonymous]

Core webapp starts thinking that its name is “app-core”.

But web webapp starts thinking that it should connect to “hsi-core”:

Caused by: java.lang.IllegalArgumentException: Service hsi-core/cuba_TrustedClientService is not registered in LocalServiceDirectory

That is why your application fails to start.