Why does a remote EJB Call throw a org.jboss.remot

2019-08-23 14:16发布

问题:

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.