Why does a remote EJB Call throw a org.jboss.remoting.serialization.ClassLoaderUtility Exception?

£可爱£侵袭症+ 提交于 2019-12-25 06:48:15

问题


I have a login module which calls a remote EJB (JBOSS 5.1) to get a javax.security.auth.Subject:

public Subject getSubject (String a, String b) throws FailedLoginException 

On the remote side the subject is filled as follows:

MyOwnPrincipalInterface principal = (MyOwnPrincipalInterface)new MyOwnPrincipalImpl("name");
subject.getPrincipals().add(principal);

The client always throws a Exception:

        ...
    Caused by: java.lang.ClassNotFoundException: my.packages.MyOwnPrincipalImpl
org.jboss.remoting.serialization.ClassLoaderUtility.loadClass(ClassLoaderUtility.java:103)
        ...

The client has access to the Interfaces, but not the implementations. It seems that the client needs the implementations to unmarshall the objects. Why is this so? Can it been turned off? I would rather not have the implementations in the client, because it makes changes so much harder.

In http://docs.jboss.org/jbossremoting/docs/guide/2.2/html/ch07.html it only says, that classes are needed for unmashalling. I see no reason, why the Interfaces are not sufficent for this.


回答1:


Seems some issue with classloading. I found this post of the forum. The issue being faced is similar. See if this helps you.



来源:https://stackoverflow.com/questions/8035574/why-does-a-remote-ejb-call-throw-a-org-jboss-remoting-serialization-classloaderu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!