Can't call method in EJB bean
I'm getting crazy over an error I'm currently experiencing.
14:45:08,492 ERROR [BusinessC开发者_开发技巧ontrollerInterceptor] object is not an instance of declaring class [ERRID: 0845] org.springframework.aop.AopInvocationException: AOP configuration seems to be invalid: tried calling method [public abstract at.package.List at.package.Search.search(at.package.Employee)] on target [searchTarget]; nested exception is java.lang.IllegalArgumentException: object is not an instance of declaring class
The searchTarget is an EJB bean and implements the interface with which it is called, so the method exists.
I don't know where else to look for mistakes. Maybe you have some hints.
I've found the problem. In my application context I've written
<property name="target">
<value>searchTarget</value>
</property>
instead of
<property name="targetName">
<value>searchTarget</value>
</property>
Since the property target
is expecting an object, it thought of my target as a string.
精彩评论