-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Exposing objects over RMI and then persisting them
PostPosted: Fri Sep 07, 2007 8:19 pm 
Newbie

Joined: Fri Sep 07, 2007 8:11 pm
Posts: 1
Hiya,

I am trying to expose all the objects via rmi to provide an application layer and am running into a problem. When passing an object back to session to save, the object is the stub instead of the implemented class.

In more detail,

I have effectively the following class remotely available over RMI

public class HBUtilImpl implements HBUtil {

public void persist (ObjectA obj);

// ...
}

ObjectA is also remoted

public class ObjectAImpl implements ObjectA {

public void method 1() throws RemoveException;

// ...

}

ObjectA is created from ObjectAFactory

public class ObjectAFactoryImpl implements ObjectAFactory {

public ObjectA newObject() {
return new ObjectAImpl();

}

// ...
}
On the client, I can pick up the ObjectAFactory and create a new object.

ObjectAFactory factory = getRemoteInterface("ObjectAFactory");
ObjectA obj = factory.newObject();

The above works fine. However, the following fails

HBUtil hb = getRemoteInterface("HBUtil");
hb.persist(obj);

since for hb, obj is ObjectAImpl_Stub and not ObjectAImpl.

Am I approaching this completely wrongly or is there some way to resolve this.

Any help in resolving this greatly appreciated.

Best Wishes

O


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.