Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help me please, RMI with JDBC

2 views
Skip to first unread message

Stanley

unread,
Nov 20, 2002, 1:48:12 AM11/20/02
to
For that it leaves me the following error message

java.rmi.UnmarshalException: error unmarshalling return; nested
exception is:
java.io.WriteAbortedException: Writing aborted by exception;
java.io.NotSerializableException: org.gjt.mm.mysql.jdbc2.Connection
java.io.WriteAbortedException: Writing aborted by exception;
java.io.NotSerializableException: org.gjt.mm.mysql.jdbc2.Connection
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:445)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:300)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:134)
at rmijdbc.ServidorRemoto_Stub.getConnection(ServidorRemoto_Stub.java:53)
at rmijdbc.SerializationImpl.getConexion(FramePrincipal.java:1124)
at rmijdbc.FramePrincipal.realizarConsulta(FramePrincipal.java:510)
at rmijdbc.FramePrincipal.jbInit(FramePrincipal.java:411)
at rmijdbc.FramePrincipal.<init>(FramePrincipal.java:114)
at rmijdbc.Principal.<init>(Principal.java:48)
at rmijdbc.Principal.main(Principal.java:79)

if my interfaz has 3 methods, openaConection () that believes a
connection with a database in mySql, closeConectio () that closes the
connection, and getConnectio () that it returns Tipo Connection
Object, so that the Client can work with this object.

Michael Borgwardt

unread,
Nov 20, 2002, 4:34:01 AM11/20/02
to

Objects that are returned by an RMI call must be either serializable or
implement java.rmi.Remote themselves. JDBC connections are neither.

It simply makes no sense to use RMI this way. Simply have the client
open the connection on its own, or have the server do all the work
and return only the results to the client.

Hongyu Sun

unread,
Nov 20, 2002, 9:23:54 AM11/20/02
to
stanleyni...@hotmail.com (Stanley) wrote in message news:<c399aa6d.02111...@posting.google.com>...

Could you post your code if convenient ?

0 new messages