I have migrated my project to the new version 7.2 and studio 13. The new log-in screen appeared on login that looks very nice.
I understand there are some changes made in the security subsystems. After migration to the new version I see the migration process has automatically added the following lines of code as mentioned in the user guide:
23:42:14.892 ERROR c.h.cuba.web.app.login.LoginScreen - Internal error during login
com.haulmont.cuba.security.global.InternalAuthenticationException: java.lang.NoSuchMethodError: com.haulmont.cuba.security.global.UserSession.addPermission(Lcom/haulmont/cuba/security/entity/PermissionType;Ljava/lang/String;Ljava/lang/String;I)V
at com.haulmont.cuba.security.auth.AuthenticationServiceBean.wrapInLoginException(AuthenticationServiceBean.java:169) ~[na:na]
at com.haulmont.cuba.security.auth.AuthenticationServiceBean.login(AuthenticationServiceBean.java:110) ~[na:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_151]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_151]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_151]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_151]
at com.haulmont.cuba.core.sys.remoting.LocalServiceInvokerImpl.invoke(LocalServiceInvokerImpl.java:94) ~[na:na]
at com.haulmont.cuba.web.sys.remoting.LocalServiceProxy$LocalServiceInvocationHandler.invoke(LocalServiceProxy.java:155) ~[cuba-web-7.2.0.jar:7.2.0]
at com.sun.proxy.$Proxy374.login(Unknown Source) ~[na:na]
at com.haulmont.cuba.web.security.providers.LoginPasswordLoginProvider.loginMiddleware(LoginPasswordLoginProvider.java:69) ~[cuba-web-7.2.0.jar:7.2.0]
at com.haulmont.cuba.web.security.providers.LoginPasswordLoginProvider.login(LoginPasswordLoginProvider.java:64) ~[cuba-web-7.2.0.jar:7.2.0]
at com.haulmont.cuba.web.security.ConnectionImpl.loginInternal(ConnectionImpl.java:192) ~[cuba-web-7.2.0.jar:7.2.0]
at com.haulmont.cuba.web.security.ConnectionImpl.login(ConnectionImpl.java:91) ~[cuba-web-7.2.0.jar:7.2.0]
at com.haulmont.cuba.web.security.LoginScreenAuthDelegate.doLogin(LoginScreenAuthDelegate.java:148) ~[cuba-web-7.2.0.jar:7.2.0]
at com.haulmont.cuba.web.app.login.LoginScreen.doLogin(LoginScreen.java:275) [cuba-web-7.2.0.jar:7.2.0]
at com.haulmont.cuba.web.app.login.LoginScreen.doLogin(LoginScreen.java:243) [cuba-web-7.2.0.jar:7.2.0]
at com.haulmont.cuba.web.app.login.LoginScreen.login(LoginScreen.java:213) [cuba-web-7.2.0.jar:7.2.0]
at com.company.web.gen.AppLoginScreen.onSubmit(AppLoginScreen.java:36) [inteaccERPProd-web-2020.02-SNAPSHOT.jar:na]
As suggested, I have granted “allow” to the different menu but I can’t log-in using any users except Admin (super) user. Any help on what I should check would be appreciated.
NoSuchMethodError usually indicates that there is something wrong with the set of JARs deployed to the server. Make sure that there are no old versions of CUBA JARs in WEB-INF/lib directories of the deployed webapps.
Hi Konstantin
Tried to figure it out but seems like most of them are from the latest versions like as follows except some are 7.2.0 where others are 7.2.1, is that the reason?
It seems now that this issue is triggered from the security handler of multitenancy add-on:
13:48:42.489 [http-nio-8080-exec-12] ERROR com.haulmont.cuba.security.auth.AuthenticationServiceBean - Login error
java.lang.NoSuchMethodError: com.haulmont.cuba.security.global.UserSession.addPermission(Lcom/haulmont/cuba/security/entity/PermissionType;Ljava/lang/String;Ljava/lang/String;I)V
at com.haulmont.addon.sdbmt.core.sys.MultiTenancySecurityHandler.createEntityOpProhibitPermission(MultiTenancySecurityHandler.java:227)
at com.haulmont.addon.sdbmt.core.sys.MultiTenancySecurityHandler.addProhibitEntityCreatePermission(MultiTenancySecurityHandler.java:219)
at com.haulmont.addon.sdbmt.core.sys.MultiTenancySecurityHandler.createEntityWritePermissions(MultiTenancySecurityHandler.java:183)
at com.haulmont.addon.sdbmt.core.sys.MultiTenancySecurityHandler.compileTenantPermissions(MultiTenancySecurityHandler.java:119)
at com.haulmont.addon.sdbmt.core.sys.MultiTenancySecurityHandler.compilePermissions(MultiTenancySecurityHandler.java:95)
at com.haulmont.addon.sdbmt.core.LoginEventListener.onApplicationEvent(LoginEventListener.java:38)
at com.haulmont.addon.sdbmt.core.LoginEventListener.onApplicationEvent(LoginEventListener.java:27)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:403)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:360)
at com.haulmont.cuba.core.sys.EventsImpl.publish(EventsImpl.java:33)
at com.haulmont.cuba.security.auth.AuthenticationManagerBean.publishUserLoggedInEvent(AuthenticationManagerBean.java:319)
The multitenancy addon i have in my project is older version. However, when I upgrade it to the latest BETA version, my application doesn’t run and throws the following exception.
com.haulmont.cuba.web.sys.remoting.LocalServiceAccessException: Unable to connect to middleware. Service inteaccERPProd-core/cuba_TrustedClientService is not registered in LocalServiceDirectory
Due to this error, 'web' block cannot connect to the co-located 'core' block.
Most probably the 'core' block didn't start properly, so check the server log for exceptions.
If there are no prior exceptions in the log, check that 'cuba.connectionUrlList' property value ends with the web context name of the 'core' block, e.g. 'cuba.connectionUrlList = http://localhost:8080/app-core'
You can turn off this information using 'cuba.web.productionMode' application property.