Weird behavior in app properties screen

Hi,
I found some weird behaviour in the app properties screen in which I change the boolean value for a property and after refreshing it changes back to it’s original value. What could the problem be?
I attach a video evidence,
Thanks beforehand,
T.

Hi,
Maybe you have this property redefined via application.properties, or via environment variable. Such value will take precedence over the value stored in the database.

1 Like

Hi Alexander.
No, the property is solely defined in our config interface.


Could it be the Default value?
Thanks again

Well, is the “true” value saved to the database then, when you change it in the UI?
It’s the sys_config table.

Just checked and yes, the “true” value is saved, but the app still displays “false” (even after restarting the screen).
Really weird.

I would also try to rename getter method: getXxx into isXxx

I tried that and the same keeps happening!

Hello, any news on what the possible problem could be?
I found this similar issue and tried to fix the behavior, but it doesn’t seem to solve the problem.
Thanks again.

Try to debug these methods, if the problem reproduces in local environment:
com.haulmont.cuba.client.sys.config.ConfigPersisterClientImpl#getProperty
com.haulmont.cuba.core.sys.ConfigPersisterImpl#getProperty

Also, open Administration → JMX Console.
Open MBean “app-core.cuba:type=ConfigStorage”.

And invoke methods: java.lang.String getAppProperty() and java.lang.String getDbProperty()
passing property key as an argument.

This could help to diagnose the problem.

So, I do not know if this could be the problem, but when running the getDbProperty() method with the config name I am getting an exception on authentication. I paste it below:

java.lang.RuntimeException: 
Unable to perform system login
java.lang.RuntimeException: Unable to perform system login
	at com.haulmont.cuba.security.app.Authentication.begin(Authentication.java:131)
	at com.haulmont.cuba.security.app.Authentication.begin(Authentication.java:149)
	at com.haulmont.cuba.security.sys.AuthenticationInterceptor.aroundInvoke(AuthenticationInterceptor.java:40)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:644)
	at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633)
	at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88)
	at com.haulmont.cuba.core.sys.MBeanInterceptor.aroundInvoke(MBeanInterceptor.java:39)
	at jdk.internal.reflect.GeneratedMethodAccessor98.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:644)
	at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633)
	at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:95)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
	at com.sun.proxy.$Proxy254.getDbProperty(Unknown Source)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71)
	at jdk.internal.reflect.GeneratedMethodAccessor81.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at java.base/sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:260)
	at java.management/javax.management.modelmbean.RequiredModelMBean$4.run(RequiredModelMBean.java:1173)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.management/javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1167)
	at java.management/javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:1014)
	at org.springframework.jmx.export.SpringModelMBean.invoke(SpringModelMBean.java:90)
	at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:809)
	at java.management/com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
	at com.haulmont.cuba.web.jmx.JmxControlBean.lambda$invokeOperation$7(JmxControlBean.java:384)
	at com.haulmont.cuba.web.jmx.JmxConnectionHelper.withConnection(JmxConnectionHelper.java:105)
	at com.haulmont.cuba.web.jmx.JmxControlBean.invokeOperation(JmxControlBean.java:373)
	at com.haulmont.cuba.web.app.ui.jmxcontrol.inspect.MbeanInspectWindow.runSynchronously(MbeanInspectWindow.java:235)
	at com.haulmont.cuba.web.app.ui.jmxcontrol.inspect.MbeanInspectWindow.invokeOperation(MbeanInspectWindow.java:228)
	at com.haulmont.cuba.web.app.ui.jmxcontrol.inspect.MbeanInspectWindow.lambda$initOperationsLayout$4(MbeanInspectWindow.java:200)
	at com.haulmont.bali.events.EventHub.publish(EventHub.java:170)
	at com.haulmont.cuba.gui.components.actions.BaseAction.actionPerform(BaseAction.java:222)
	at com.haulmont.cuba.web.gui.components.WebButton.buttonClicked(WebButton.java:67)
	at com.haulmont.cuba.web.widgets.CubaButton.fireClick(CubaButton.java:76)
	at com.vaadin.ui.Button$1.click(Button.java:57)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:153)
	at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:115)
	at com.vaadin.server.communication.ServerRpcHandler.handleInvocation(ServerRpcHandler.java:431)
	at com.vaadin.server.communication.ServerRpcHandler.handleInvocations(ServerRpcHandler.java:396)
	at com.vaadin.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:260)
	at com.vaadin.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:82)
	at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:40)
	at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1580)
	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:733)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	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:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:690)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:374)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1590)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: com.haulmont.cuba.security.global.LoginException: Unknown login name or bad password 'admin'
	at com.haulmont.cuba.security.auth.providers.SystemAuthenticationProvider.authenticate(SystemAuthenticationProvider.java:56)
	at com.haulmont.cuba.security.auth.AuthenticationManagerBean.authenticateInternal(AuthenticationManagerBean.java:252)
	at com.haulmont.cuba.security.auth.AuthenticationManagerBean.login(AuthenticationManagerBean.java:117)
	at com.haulmont.cuba.security.app.Authentication.begin(Authentication.java:128)
	... 94 more

However I do not think this is the problem since when changing the configurations the user is already logged…

Hello again @albudarov,
Finally I could run the method correctly, however to show what’s happening I used the printDbProperties() method that prints ALL the DB-stored properties.

As you can see in the image, neon.signMaintenancePlanApprove is set to ‘true’. On use it works as it should. However, on the app properties page the displayed value is ‘false’ and the updateTs is the same in which I set the property to ‘true’.

We tried by debugging the methods you said but the problem persists…
What else could be happening?
Thanks again

What is the result with this method?

Well, the debugging isn’t the way to remove the problem.

It is the way to diagnose - what is going wrong. You should catch the method invocation when the getter method of the configuration is called.

There is not much else I could advise. There should be some simple mistake, like mistyping.

The only thing - you can check, if the problem will reproduce if you re-create the same code in a small freshly created project.

Hello again @albudarov,
I have created a small project only defining a config interface and I cannot reproduce the problem…
The thing is… it is not a problem with the database either because the values are correctly updated, but on the properties screen the properties (both file and db-stored) display their previous values on refresh.
Both JMX console methods are working correctly so there was no error to diagnose, that’s what I meant.

And on the mistyping issue, I double checked the Config Interface format with both the small project and a preexisting project that does not have this problem and I also checked the properties and methods names and they match correctly, so I would not consider it the problem in this case!