我有一个由3层组成的应用程序: DB ,后端包含EJB(在Wildfly EJB容器上单独运行)和前端 EJB客户端(在Tomcat上单独运行)。前端和后端之间的通信由DTO(数据传输对象)完成。一切都工作正常,直到我在其中一个DTO中添加了一个新的地图字段:
public class xxxDTO implements Serializable {
private static final long serialVersionUID = 5811694947383586010L;
// simple fields like String, Integer, etc. go here
private Map<Language, yyyNameDTO> NameDetailsMap;
.....
}
只要我添加了map字段,来自客户端的xxxDTO
上的EJB方法调用就会产生以下异常:
java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling [appName:app, moduleName:app-ejb, distinctName:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@2d3f6ba3
at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:749) ~[jboss-ejb-client-2.0.1.Final.jar:2.0.1.Final]
at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:116) ~[jboss-ejb-client-2.0.1.Final.jar:2.0.1.Final]
at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:186) ~[jboss-ejb-client-2.0.1.Final.jar:2.0.1.Final]
at org.jboss.ejb.client.EJBClientInvocationContext.retryRequest(EJBClientInvocationContext.java:211) ~[jboss-ejb-client-2.0.1.Final.jar:2.0.1.Final]
at org.jboss.ejb.client.EJBInvocationHandler.sendRequestWithPossibleRetries(EJBInvocationHandler.java:256) ~[jboss-ejb-client-2.0.1.Final.jar:2.0.1.Final]
at org.jboss.ejb.client.EJBInvocationHandler.sendRequestWithPossibleRetries(EJBInvocationHandler.java:265) ~[jboss-ejb-client-2.0.1.Final.jar:2.0.1.Final]
at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:198) ~[jboss-ejb-client-2.0.1.Final.jar:2.0.1.Final]
at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:181) ~[jboss-ejb-client-2.0.1.Final.jar:2.0.1.Final]
at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:144) ~[jboss-ejb-client-2.0.1.Final.jar:2.0.1.Final]
at com.sun.proxy.$Proxy65.registerTaxpayer(Unknown Source) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_66]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_66]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_66]
at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_66]
at org.springframework.remoting.rmi.RmiClientInterceptorUtils.invokeRemoteMethod(RmiClientInterceptorUtils.java:71) ~[spring-context-4.1.5.RELEASE.jar:4.1.5.RELEASE]
at org.springframework.ejb.access.SimpleRemoteSlsbInvokerInterceptor.doInvoke(SimpleRemoteSlsbInvokerInterceptor.java:98) ~[spring-context-4.1.5.RELEASE.jar:4.1.5.RELEASE]
at org.springframework.ejb.access.AbstractRemoteSlsbInvokerInterceptor.invokeInContext(AbstractRemoteSlsbInvokerInterceptor.java:140) ~[spring-context-4.1.5.RELEASE.jar:4.1.5.RELEASE]
at org.springframework.ejb.access.AbstractSlsbInvokerInterceptor.invoke(AbstractSlsbInvokerInterceptor.java:189) ~[spring-context-4.1.5.RELEASE.jar:4.1.5.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.1.5.RELEASE.jar:4.1.5.RELEASE]
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207) ~[spring-aop-4.1.5.RELEASE.jar:4.1.5.RELEASE]
at com.sun.proxy.$Proxy22.registerTaxpayer(Unknown Source) ~[?:?]
当我删除map字段,或者将该字段设置为null
时,EJB接收器变得可用并且一切正常,但如果map字段的值不是null
,则EJB接收器变为不可用。
我尝试通过更改SerialVersionUID
(认为它可能是序列化和版本控制问题)来解决它,但没有结果。
问题是:
答案 0 :(得分:0)
我刚刚解决了这个问题。
愚蠢的错误:我忘了实施Serializable
界面并为我serialVersionUID
新添加的DTO课程添加yyyNameDTO
。