Ok so, I'm trying to create a browser that connects to a server and when the user enters in a url the browser sends that url to the server. The server then opens the url in a JEditorPane then uses the getDocument() method attempts to send that document through a ObjectOutputStream back to the client. Unfortunately I haven't been able to figure this one out, is it not possible to send a Document through an objectoutputstream or what am I doing wrong?
Here's the code that I'm using:
Method that sets page and gets the Document:
url = (String) input.readObject();
window.setPage(url);
doc = window.getDocument();
sendDoc(doc);
Method that sends the Document through objectoutputstream:
try {
output.writeObject(doc); // no compiling errors...
output.flush();
} catch (Exception e) { }
Error that I get:
java.io.WriteAbortedException: writing aborted;
java.io.NotSerializableException:
javax.swing.text.html.CSS$Value is not serializable as a value in an AttributeSet
...
at DawgsCodeBrowser.whileConnected(DawgsCodeBrowser.java:101)
at DawgsCodeBrowser.Run(DawgsCodeBrowser.java:71)
at StartBrowser.main(StartBrowser.java:8)
Caused by: java.io.NotSerializableException:
javax.swing.text.html.CSS$Value is not serializable as a value in an AttributeSet
...
at DawgsCodeServer.sendDoc(DawgsCodeServer.java:154)
at DawgsCodeServer.whileConnected(DawgsCodeServer.java:100)
at DawgsCodeServer.Run(DawgsCodeServer.java:59)
at StartServer.main(StartServer.java:11)
sorry for long error message, I took out some of it so it wouldnt be as long...