|
| How can I use a Java INTERFACE argument for Remote Client<--> |
 |
Mon, 13 Aug 2007 10:24:20 EDT |
Dear IBM Websphere Forum,
perhaps you can help me with my problem.
I use Websphere 6.1 and the related Application Client.
I use JRE-1.5
Communication between J2EE-Client side and J2EE-Server side seems to work.
I seem have to have a problem with serialization of an argument,
wich is a plain interface.
What has to be done different?
Yours,
Frank
I use this Interface to communicate between Client and Server.
The Client creates an instance iof this interface ....
-----------------------------------------------------------------------
public interface ChatRoomListener extends Serializable {
public void downloadMessage(String user, String message);
}
Inside the Client environment, I use these calls----------------
//chatIncomingMessages is a JTextArea instance to show the downloaded Messages
-----------------------
ChatRoom chatRoom= createChatRoom();
ChatRoomListener listener=new ChatRoomListener(){
private static final long serialVersionUID = -7779005097061534360L;
public void downloadMessage(String user, String message){
chatIncomingMessages.append(""+user+": "+
message+"\n\r");
}
};
if(chatRoom==null){
System.err.println("Error: createChatRoom: returned
'null'");
}else{
try{
chatRoom.addChatRoomListener(this.nickname, listener);
}catch(RemoteException re){
// TODO Auto-generated catch block
re.printStackTrace();
}
}
-------------
At the J2EE-Server Side, the code looks like this
attention: nicknamesListeners and chatterListeners
are Linked Lists of String/ChatRoomListeners
-------------
public void addChatRoomListener(String nickname, ChatRoomListener listener){
System.err.print("addChatRoomListener:");
System.err.flush();
for(int idx=0; idx < getInstance().nicknamesListeners.size();idx++){
if(getInstance().nicknamesListeners.get(idx).equals(nickname)){
// This nickanme already is logged in to this chatroom
return;
}
}
System.err.println(nickname);
System.err.flush();
getInstance().chatterListeners.add(listener);
getInstance().nicknamesListeners.add(nickname);
return;
}
=========================================
I receive this error context.
=========================================
java.rmi.MarshalException: CORBA MARSHAL 0x4942f89a No; nested exception is:
org.omg.CORBA.MARSHAL:
>> SERVER (id=4773e3aa, host=depoiw0wk11it39.als.avnet.eu) TRACE START:
>> org.omg.CORBA.MARSHAL: Unable to read value from underlying bridge :
null vmcid: IBM minor code: 89A completed: No
>> at
com.ibm.rmi.iiop.CDRInputStream.read_value(CDRInputStream.java:2105)
>> at
ejbs._EJSRemoteStatefulChatRoom_916715b1_Tie.addChatRoomListener(_EJSRemoteState
fulChatRoom_916715b1_Tie.java:181)
>> at
ejbs._EJSRemoteStatefulChatRoom_916715b1_Tie._invoke(_EJSRemoteStatefulChatRoom_
916715b1_Tie.java:105)
>> at
com.ibm.CORBA.iiop.ServerDelegate.dispatchInvokeHandler(ServerDelegate.java:613)
P.S.: if I use a class instead of an interface,
the AddChatRoomListener Caall works without any problem!
-------------------------------------
Public class ChatRoomListener implements Serializable{??;}
-------------------------------------
|
| Post Reply
|
|
|
|
|
|
|
|
|
|