RMI -> Serializable

Frankster

Mitglied
Verbindung zum RMI Server steht.

WIR SIND IM CLIENT
Die Daten werden eingegeben und dann an die Methode weitergegeben
Der Client enthält eine Klasse Pruefung die mir das Objekt anlegt.
In der Klasse VerwaltungClient wo auch main() enthalten ist, macht diesen aufruf;

Code:
class Pruefung implements Serializable
{
//Instanzvariablen
String schluessel;
String name;
String beginn;
String ende;
String ort;
String pruefer;

//Konstruktor
Pruefung(String schluessel, String name, String beginn, String ende, String ort, String pruefer)
{
this.schluessel = schluessel;
this.name = name;
this.beginn = beginn;
this.ende = ende;
this.ort = ort;
this.pruefer = pruefer;
}
}

public class VerwaltungClient implements Serializable 
{
public static void main(String[] args) throws IOException
{
.........................................
.........................................
obj.pruefungAnlegen (new Pruefung(schluessel,namePruefung, beginnPruefung, endePruefung, ortPruefung, prueferPruefung));
..........................................
........................................
}
}

WIR SIND IM SERVER

Der server sollte das Objekt erhalten
Code:
public class VerwaltungServer extends UnicastRemoteObject implements PruefungsVerwaltung, Serializable 
{
public void pruefungAnlegen (Pruefung pruefung)
{
System.out.println("Pruefung anlegen ausgeben");
}
}
------------------------------------------------------------------------------------------------

Es kommt aber immer:

HelloApplication exception: RemoteException occurred in server thread; nested ex
ception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
tion is:
java.io.InvalidClassException: Pruefung; class invalid for deserializati
on
java.rmi.ServerException: RemoteException occurred in server thread; nested exce
ption is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
tion is:
java.io.InvalidClassException: Pruefung; class invalid for deserializati
on
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:292)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
60)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
.java:701)
at java.lang.Thread.run(Thread.java:536)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknow
n Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at VerwaltungServer_Stub.pruefungAnlegen(Unknown Source)
at VerwaltungClient.main(VerwaltungClient.java:116)
Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested ex
ception is:
java.io.InvalidClassException: Pruefung; class invalid for deserializati
on
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:249)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
60)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
.java:701)
at java.lang.Thread.run(Thread.java:536)
Caused by: java.io.InvalidClassException: Pruefung; class invalid for deserializ
ation
at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:483)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:152
1)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
626)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:297)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:246)
... 6 more


Wo gehört überall Serializable eingebunden ?

HILFE :-(

Mfg
Frankster
 
Zurück