Getting an IllegalArgumentException on LookupField : pointing to WebLookupField

Have been using the LookupField but suddenly the error below is popping up after a Git pull on some changes. Going back to a previous index does not work

IllegalArgumentException: Can not set com.haulmont.cuba.gui.components.LookupPickerField field com.sageart.agencybanking.web.screens.agent.AgentEdit.userField to com.haulmont.cuba.web.gui.components.WebLookupField

Full line error is below:

22:33:15.947 ERROR com.haulmont.cuba.web.log.AppLog - Exception in com.haulmont.cuba.web.widgets.CubaButton:
com.vaadin.server.ServerRpcManager$RpcInvocationException: Unable to invoke method click in com.vaadin.shared.ui.button.ButtonServerRpc
at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:157) ~[vaadin-server-8.6.4-24-cuba.jar:8.6.4-24-cuba]
at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:115) ~[vaadin-server-8.6.4-24-cuba.jar:8.6.4-24-cuba]
at com.vaadin.server.communication.ServerRpcHandler.handleInvocation(ServerRpcHandler.java:431) [vaadin-server-8.6.4-24-cuba.jar:8.6.4-24-cuba]
at com.vaadin.server.communication.ServerRpcHandler.handleInvocations(ServerRpcHandler.java:396) [vaadin-server-8.6.4-24-cuba.jar:8.6.4-24-cuba]
at com.vaadin.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:260) [vaadin-server-8.6.4-24-cuba.jar:8.6.4-24-cuba]
at com.vaadin.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:82) [vaadin-server-8.6.4-24-cuba.jar:8.6.4-24-cuba]
at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:40) [vaadin-server-8.6.4-24-cuba.jar:8.6.4-24-cuba]
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1577) [vaadin-server-8.6.4-24-cuba.jar:8.6.4-24-cuba]
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:425) [vaadin-server-8.6.4-24-cuba.jar:8.6.4-24-cuba]
at com.haulmont.cuba.web.sys.CubaApplicationServlet.serviceAppRequest(CubaApplicationServlet.java:329) [cuba-web-7.1.4.jar:7.1.4]
at com.haulmont.cuba.web.sys.CubaApplicationServlet.service(CubaApplicationServlet.java:215) [cuba-web-7.1.4.jar:7.1.4]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) [servlet-api.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [catalina.jar:9.0.19]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.19]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) [tomcat-websocket.jar:9.0.19]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:9.0.19]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.19]
at org.springframework.web.filter.CompositeFilter$VirtualFilterChain.doFilter(CompositeFilter.java:108) [spring-web-5.1.13.RELEASE.jar:5.1.13.RELEASE]
at org.springframework.web.filter.CompositeFilter.doFilter(CompositeFilter.java:74) [spring-web-5.1.13.RELEASE.jar:5.1.13.RELEASE]
at com.haulmont.cuba.web.sys.CubaHttpFilter.doFilter(CubaHttpFilter.java:93) [cuba-web-7.1.4.jar:7.1.4]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:9.0.19]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.19]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:200) [catalina.jar:9.0.19]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [catalina.jar:9.0.19]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) [catalina.jar:9.0.19]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) [catalina.jar:9.0.19]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [catalina.jar:9.0.19]
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678) [catalina.jar:9.0.19]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [catalina.jar:9.0.19]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [catalina.jar:9.0.19]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) [tomcat-coyote.jar:9.0.19]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-coyote.jar:9.0.19]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:836) [tomcat-coyote.jar:9.0.19]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1747) [tomcat-coyote.jar:9.0.19]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-coyote.jar:9.0.19]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_152]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_152]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-util.jar:9.0.19]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_152]
Caused by: java.lang.reflect.InvocationTargetException: null
at sun.reflect.GeneratedMethodAccessor204.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_152]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_152]
at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:153) ~[vaadin-server-8.6.4-24-cuba.jar:8.6.4-24-cuba]
… 38 common frames omitted
Caused by: java.lang.IllegalArgumentException: Can not set com.haulmont.cuba.gui.components.LookupPickerField field com.sageart.agencybanking.web.screens.agent.AgentEdit.userField to com.haulmont.cuba.web.gui.components.WebLookupField
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167) ~[na:1.8.0_152]
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171) ~[na:1.8.0_152]
at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:81) ~[na:1.8.0_152]
at java.lang.reflect.Field.set(Field.java:764) ~[na:1.8.0_152]
at com.haulmont.cuba.gui.sys.UiControllerDependencyInjector.assignValue(UiControllerDependencyInjector.java:748) ~[cuba-gui-7.1.4.jar:7.1.4]
at com.haulmont.cuba.gui.sys.UiControllerDependencyInjector.doInjection(UiControllerDependencyInjector.java:500) ~[cuba-gui-7.1.4.jar:7.1.4]
at com.haulmont.cuba.gui.sys.UiControllerDependencyInjector.injectValues(UiControllerDependencyInjector.java:274) ~[cuba-gui-7.1.4.jar:7.1.4]
at com.haulmont.cuba.gui.sys.UiControllerDependencyInjector.inject(UiControllerDependencyInjector.java:112) ~[cuba-gui-7.1.4.jar:7.1.4]
at com.haulmont.cuba.web.sys.WebScreens.createScreen(WebScreens.java:241) ~[cuba-web-7.1.4.jar:7.1.4]
at com.haulmont.cuba.web.sys.WebScreens.create(WebScreens.java:175) ~[cuba-web-7.1.4.jar:7.1.4]
at com.haulmont.cuba.gui.builders.EditorBuilderProcessor.createScreen(EditorBuilderProcessor.java:287) ~[cuba-gui-7.1.4.jar:7.1.4]
at com.haulmont.cuba.gui.builders.EditorBuilderProcessor.buildEditor(EditorBuilderProcessor.java:89) ~[cuba-gui-7.1.4.jar:7.1.4]
at com.haulmont.cuba.gui.builders.EditorBuilder.build(EditorBuilder.java:359) ~[cuba-gui-7.1.4.jar:7.1.4]
at com.haulmont.cuba.gui.actions.list.CreateAction.actionPerform(CreateAction.java:110) ~[cuba-gui-7.1.4.jar:7.1.4]
at com.haulmont.cuba.web.gui.components.WebButton.buttonClicked(WebButton.java:64) ~[cuba-web-7.1.4.jar:7.1.4]
at com.haulmont.cuba.web.widgets.CubaButton.fireClick(CubaButton.java:76) ~[cuba-web-widgets-7.1.4.jar:na]
at com.vaadin.ui.Button$1.click(Button.java:57) ~[vaadin-server-8.6.4-24-cuba.jar:8.6.4-24-cuba]
… 42 common frames omitted

Hi @emowcee,

You use this Lookup Field in the controller, right? Could you please share the way you inject it? Following your log it looks like something happens while injection, some time mismatch happens.

Regards,
Aleksey

Injected like so:

@Inject
private LookupField userField;

Rolling back Git to see what may have changed between my code and the teams. Shall update.

Huh… found the issue.

Weird, the Graphic designer changes were reflicting on the injection but not altering the getter/setters. Changing their return types to LookupField manually made the problem disappear.

Thanks for the attention though.

1 Like