• Mike Miller

    Mike Miller - 2009-06-19


    Just starting to use RESTEasy and this is as close as I've found for a forum.  I took the SimpleExample and tried to duplicate it in Eclipse with a DynamicWebProject.   When I tried to do the post to create a new object, I get the following: java.lang.ClassCastException: cannot be cast to org.w3c.dom.Element
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

    From the sample code - the exception happens here:

    --- inside readCustomer
    NodeList nodes = root.getChildNodes();
    for (int i = 0; i < nodes.getLength(); i++) {
       Element element = (Element) nodes.item(i);

    nodes.item(i) returns a DeferredTextImpl which can't be casted to an Element.

    Any idea what I am doing wrong?

    • Mike Miller

      Mike Miller - 2009-06-22

      Never mind - the problem was whitespace in the xml document - so the Node I was getting back was not an Element but a Text element.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks