Cannot invoke method message, but method is invoked #331

Closed
blackdrag opened this Issue Jan 17, 2017 · 4 comments

Projects

None yet

3 participants

@blackdrag

das ist auch so ein Fall von nahezu unbrauchbarer Fehlermeldung

[2017-01-17 12:56:17.788] boot - 4418 ERROR [http-nio-8080-exec-6] --- DolphinContext: Unexpected exception while invoking action load on controller 987935bb-dc2d-4acb-b16a-09d1581481ec
com.canoo.dolphin.server.controller.InvokeActionException: java.lang.IllegalStateException: Cannot invoke method: public void Foo.load(long)
at com.canoo.dolphin.server.controller.ControllerHandler.invokeAction(ControllerHandler.java:168)
at com.canoo.dolphin.server.context.DolphinContext.onCallControllerAction(DolphinContext.java:281)
at com.canoo.dolphin.server.context.DolphinContext.access$600(DolphinContext.java:69)
at com.canoo.dolphin.server.context.DolphinContext$3$5.handleCommand(DolphinContext.java:202)
at org.opendolphin.core.server.ServerConnector.receive(ServerConnector.java:61)
at com.canoo.dolphin.server.context.DolphinContext.handle(DolphinContext.java:316)
at com.canoo.dolphin.server.context.DolphinContextCommunicationHandler.handle(DolphinContextCommunicationHandler.java:78)
at com.canoo.dolphin.server.servlet.DolphinPlatformServlet.doPost(DolphinPlatformServlet.java:39)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
[...]
Caused by: java.lang.IllegalStateException: Cannot invoke method: public void Foo.load(long)
at com.canoo.dolphin.impl.ReflectionHelper$3.run(ReflectionHelper.java:96)
at com.canoo.dolphin.impl.ReflectionHelper$3.run(ReflectionHelper.java:87)
at java.security.AccessController.doPrivileged(Native Method)
at com.canoo.dolphin.impl.ReflectionHelper.invokePrivileged(ReflectionHelper.java:87)
at com.canoo.dolphin.server.controller.ControllerHandler.invokeAction(ControllerHandler.java:166)
... 85 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.canoo.dolphin.impl.ReflectionHelper$3.run(ReflectionHelper.java:93)
... 89 more
Caused by: com.canoo.dolphin.mapping.MappingException: Error in property change handling!
at com.canoo.dolphin.impl.PropertyImpl$1.propertyChange(PropertyImpl.java:57)
at java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:335)
at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:328)
at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:263)
at org.opendolphin.core.AbstractObservable.firePropertyChange(AbstractObservable.java:63)
at org.opendolphin.core.server.ServerAttribute.access$001(ServerAttribute.java:24)
at org.opendolphin.core.server.ServerAttribute$1.run(ServerAttribute.java:117)
at org.opendolphin.core.server.ServerAttribute.verbosely(ServerAttribute.java:101)
at org.opendolphin.core.server.ServerAttribute.firePropertyChange(ServerAttribute.java:114)
at org.opendolphin.core.BaseAttribute.setValue(BaseAttribute.java:75)
at org.opendolphin.core.server.ServerAttribute.setValue(ServerAttribute.java:47)
at com.canoo.dolphin.impl.PropertyImpl.set(PropertyImpl.java:66)
at Foo.setCaseInfo(Foo.java:102)
at Foo.fillCaseDetails(Foo.java:1017)
at Foo.load(Foo.java:310)
... 94 more
Caused by: com.canoo.dolphin.converter.ValueConverterException: Can not convert to dolphin bean
at com.canoo.dolphin.impl.converters.DolphinBeanConverterFactory$DolphinBeanConverter.convertFromDolphin(DolphinBeanConverterFactory.java:63)
at com.canoo.dolphin.impl.converters.DolphinBeanConverterFactory$DolphinBeanConverter.convertFromDolphin(DolphinBeanConverterFactory.java:50)
at com.canoo.dolphin.internal.info.PropertyInfo.convertFromDolphin(PropertyInfo.java:40)
at com.canoo.dolphin.impl.PropertyImpl$1.propertyChange(PropertyImpl.java:53)
... 108 more
Caused by: java.lang.IllegalArgumentException: No bean instance found with id d1fab1cc-d144-423c-a688-9d286ddba12b
at com.canoo.dolphin.impl.BeanRepositoryImpl.getBean(BeanRepositoryImpl.java:155)
at com.canoo.dolphin.impl.converters.DolphinBeanConverterFactory$DolphinBeanConverter.convertFromDolphin(DolphinBeanConverterFactory.java:61)
... 111 more

the important information is that the bean instance d1fab1cc could not be found. AS the trace shows the load method was actually executed. That can also be seen at by the InvocationTargetException, which is thrown if during execution of the method an exception is thrown and not catched in the method. This exception itself is there of no interest, since the wrapped exception is the one we want to have

@hendrikebbers hendrikebbers added this to the 0.8.11 milestone Jan 17, 2017
@hendrikebbers
Member

I think the following exceptions need more information (in the exception message):

Caused by: com.canoo.dolphin.mapping.MappingException: Error in property change handling!
at com.canoo.dolphin.impl.PropertyImpl$1.propertyChange(PropertyImpl.java:57)
at java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:335)
at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:328)
at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:263)
at org.opendolphin.core.AbstractObservable.firePropertyChange(AbstractObservable.java:63)
at org.opendolphin.core.server.ServerAttribute.access$001(ServerAttribute.java:24)
at org.opendolphin.core.server.ServerAttribute$1.run(ServerAttribute.java:117)
at org.opendolphin.core.server.ServerAttribute.verbosely(ServerAttribute.java:101)
at org.opendolphin.core.server.ServerAttribute.firePropertyChange(ServerAttribute.java:114)
at org.opendolphin.core.BaseAttribute.setValue(BaseAttribute.java:75)
at org.opendolphin.core.server.ServerAttribute.setValue(ServerAttribute.java:47)
at com.canoo.dolphin.impl.PropertyImpl.set(PropertyImpl.java:66)
at Foo.setCaseInfo(Foo.java:102)
at Foo.fillCaseDetails(Foo.java:1017)
at Foo.load(Foo.java:310)
... 94 more
Caused by: com.canoo.dolphin.converter.ValueConverterException: Can not convert to dolphin bean
at com.canoo.dolphin.impl.converters.DolphinBeanConverterFactory$DolphinBeanConverter.convertFromDolphin(DolphinBeanConverterFactory.java:63)
at com.canoo.dolphin.impl.converters.DolphinBeanConverterFactory$DolphinBeanConverter.convertFromDolphin(DolphinBeanConverterFactory.java:50)
at com.canoo.dolphin.internal.info.PropertyInfo.convertFromDolphin(PropertyInfo.java:40)
at com.canoo.dolphin.impl.PropertyImpl$1.propertyChange(PropertyImpl.java:53)
... 108 more

As you can see in the stackTrace of the original message the final cause is

Caused by: java.lang.IllegalArgumentException: No bean instance found with id d1fab1cc-d144-423c-a688-9d286ddba12b

But in DP this ends in
ValueConverterException: Can not convert to dolphin bean
and
MappingException: Error in property change handling!

Both of them should contain more information (what property? what bean?...)

@hendrikebbers
Member

@blackdrag right?

@blackdrag

yes

@hendrikebbers
Member

See #336

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment