jdbc / rmi and xml / rmi

0 views
Skip to first unread message

bankim pandya

unread,
Apr 2, 2010, 12:17:33 AM4/2/10
to open-traini...@googlegroups.com
hi i am developing an rmi application i.e reading data from database using rmi approach and jdbc
client and server code is attached in this mail:
when i am running client i am getting this exception:
Can any one help
and also i need help for reading xml file using rmi approach






java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
        java.io.WriteAbortedException: writing aborted; java.io.NotSerializableE
xception: sun.jdbc.odbc.JdbcOdbcResultSet
        at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:173)
        at DataBaseServerImpl_Stub.readJdbcData(Unknown Source)
        at JdbcClient.main(JdbcClient.java:16)
Caused by: java.io.WriteAbortedException: writing aborted; java.io.NotSerializab
leException: sun.jdbc.odbc.JdbcOdbcResultSet
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1333)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
        at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:306)
        at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:155)
        ... 2 more
Caused by: java.io.NotSerializableException: sun.jdbc.odbc.JdbcOdbcResultSet
        at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)

        at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
        at sun.rmi.server.UnicastRef.marshalValue(UnicastRef.java:274)
        at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:315)
        at sun.rmi.transport.Transport$1.run(Transport.java:159)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
        at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:5
35)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTranspor
t.java:790)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
.java:649)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:885)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:907)
        at java.lang.Thread.run(Thread.java:619)

DataBaseServerImpl.java
DataBaseServer.java
JdbcClient.java

Shardul Bhatt

unread,
Apr 2, 2010, 8:31:07 AM4/2/10
to open-traini...@googlegroups.com
Bankim,

Looking at the exception....

1. The program is trying to marshal and object which is not serialized
2. Is JdbcOdbcResultSet serializable.
3. Try using the RowSet implementation of ResultSet, it is serializable.

Google a bit.

Regards,
Shardul. 

--
You received this message because you are subscribed to the Google
Groups "open-training-community" group.
To post to this group, send email to
open-traini...@googlegroups.com
To unsubscribe from this group, send email to
open-training-com...@googlegroups.com
For more options, visit this group at
http://groups.google.co.in/group/open-training-community?hl=en-GB

Reply all
Reply to author
Forward
0 new messages