Bugs item #3323853, was opened at 2011-06-21 13:24
Message generated for change (Settings changed) made by ppiuser
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=116035&aid=3323853&group_id=16035

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: dom4j 1.6.x
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: ppiuser (ppiuser)
>Assigned to: James Strachan (jstrachan)
Summary: Serialization exception due to QName 

Initial Comment:
Hello,

the class QName is not compliant to the java serialization spec which causes a 
MarshalException when passing an org.dom4j.Document as parameter in an 
EJB-Interface implementation. Adjusting the methods readObject(..) and 
writeObject(..) as shown below solves the problem:

    private void writeObject(ObjectOutputStream out) throws IOException {
        out.defaultWriteObject();
        out.writeObject(namespace.getPrefix());
        out.writeObject(namespace.getURI());
    }

    private void readObject(ObjectInputStream in) throws IOException,
            ClassNotFoundException {
        in.defaultReadObject();
        String prefix = (String) in.readObject();
        String uri = (String) in.readObject();
        namespace = Namespace.get(prefix, uri);
    }

As mentioned in the serialization spec the methods must call 
defaultReadObject() or defaultWriteObject() once before reading or writing from 
the stream. 


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=116035&aid=3323853&group_id=16035

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
dom4j-dev mailing list
dom4j-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dom4j-dev

Reply via email to