unmarshalling

Intermittent ClassCastException from ElementNSImpl to own type during unmarshalling

We are experiencing an exceedingly hard to track down issue where we are seeing ClassCastExceptions sometimes when trying to iterate over a list of unmarshalled objects. The important bit is sometimes, after a reboot the particular code works fine. This seems to point in the direction of concurrency/timing/race condition. I can confirm t...

How can I handle Castor unmarshaling of SOAP messages when the namespace is defined inside the operation tag?

I am developing a contract-first web service based on Spring-WS. I'm relying on Castor marshaling, and I have run into the following issue. Requests are being accepted when the "xmlns" namespace is defined in the Envelope tag, such as: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns="h...

Unmarshalling exception in wsdl2ruby SOAP::FaultError detail attribute

I've used wsdl2ruby to generate a client for a web service. When a service method raises one of the exceptions defined in the WSDL I'd like to access the exception object's attributes. From what I can tell the exception object has been marshalled into a SOAP::Mapping::Object that's referenced by the detail attribute of the SOAP::FaultErr...

Grails Date unmarshalling

If I get the following json from a RESTful client, how do I elegantly unmarshal the java.util.Date? (Is it possible without providing (aka. hard-coding) the format, that's what I mean by elegantly...) { "class": "url", "link": "http://www.empa.ch", "rating": 5, "lastcrawl" : "2009-06-04 16:53:26.706 CEST", "checksum" : "837261...

How can I have JAXB call a method after it has completed unmarshalling an XML file into an object?

I am using JAXB to unmarshall an XML file into a Java object -- standard stuff. Once JAXB has completed this, I'd like a method to be called on the newly created object. Is there a mechanism to do this? I'd prefer the object, not an external entity, do this to keep construction in one place. Thanks. ...

Unmarshalling collections in JaxB

Hi, suppose I have this class: public class A { private HashMap<String, B> map; @XmlElement private void setB(ArrayList<B> col) { ... } private ArrayList<B> getB() { ... } } When trying to unmarshall an xml document to this class using JaxB I notice that instead of calling the setB() method...

Unmarshalling XML using JAXB in restlet's acceptRepresentation method.

I've created an XML schema by annotating an existing Java domain model class, now when I try to use JAXB to unmarshall the representation received within my restlet webservice I'm getting a host of errors no matter what I seem to try. I'm new to both restlets and JAXB so pointing me in the direction of a decent example of using both woul...

JAXB: unmarshaling data on a per-instance basis

I am using JAXB to unmarshal an XML file into a Java object model. Works great, except for one thing. I've been using parseMethod and printMethod to convert simple strings to a type of my choice, e.g.: <someElement tag='Bismarck' name='Dagwood' /> <someElement tag='Pierre' name='Herb' /> where the "tag" attribute, instead of being unm...

weblogic context lookup error : java.rmi.UnmarshalException: error unmarshalling arguments

Hi, We are facing an issue in our production env. We have searched the net high and low and we were not able to come up with any answers. This error(stacktrace below) occurs when an ejb lookup is made from managed server 1 to manager server 2. Virtual ip is used for the lookup. It occurs intermittently and at random intervals. We are no...

Suitable XML Marshaller and Unmarshaller

Hi. We have an XML that needs to be converted to an object and vice versa. Something like Xstream does. Until now we were using Xstream to marshall and unmarshall the object/xml. However the problem is that an object that corresponds to XML in xstream, needs to have all the tags as attributes; else if XML contains any extra tags which ...

JAXB to unmarshall <string>foobar</string>

Greetings! I have a server returning XML content to my client that looks like this: <string xmlns="...">foobar</string> I'm new to JAXB and have gotten a lot of stuff working, except this. I thought it would be pretty easy to marshal and unmarshal this to and from a String. It took a while, but I finally figured out how to marshal thi...

Java RMI (Server: TCP Connection Idle/Client: Unmarshalexception (EOFException))

I'm trying to implement Sun Tutorials RMI application that calculates Pi. I'm having some serious problems and I cant find the solution eventhough I've been searching the entire web and several javaskilled people. I'm hoping you can put an end to my frustrations. The crazy thing is that I can run the application from the cmd on my deskt...

java.rmi.UnmarshalException: unable to pull client classes by server

Hi, I have an RMI client/server set-up on two machines that works fine in a simple situation when the server doesn't require a client-side defned class. However, when I need to use a class defined on the client side I am unable to have the server unmarshall those classes. I suspect this is an issue with my java.rmi.server.codebase prop...

Getting java.rmi.UnmarshalException: unrecognized method hash: method not supported by remote object

Hi Friends, I am new to RMI technology. When I am running the rmi client program, I am getting the exception : java.rmi.UnmarshalException: unrecognized method hash: method not supported by remote object. I am using jdk1.5 The argument of the remote method is the Serialized object. These are the server code... This is the Remote Inte...

simple marshalling unmarshalling objects

Hello Folks, json support is one of the new features of delphi 2009 and delphi 2010. I want to know if it's there any simple function to marshalling/unmarshalling directly between string and object like in superobject library. Example: MyKnownObject := FromJSON('{name:"francis", surname:"lee"}'); ...

In-memory unmarshalling, from an XML string and its schema stored in a string too, possible ?

Hello, Let's suppose I store an XML string into a variable String resp = new String("<?xml version=\"1.0\" encodin..."); and the schema definition related to this XML in another one: String xsd = new String("<xs:schema xmlns="http://schema-..."); do you think there is a way to validate and unmarshall 'resp' into objects (using JAXB...

JiBX unmarshalling - is it possible to tell JiBX to ignore the order of elements??

Is there a way to get by this? For example, my XML: <group> <idExt>new group idext</idExt> <user-id>1</user-id> <parent-id>2</parent-id> </group> when unmarshalling, goes without errors, but when I change order: <group> <user-id>1</user-id> <parent-id>2</parent-id> <idExt>new group idext</idExt> </gro...

How to use JAXB to marshall/unmarshall a collection of MyBean

I have a MyBean annotated @XmlRootElement public class MyBean ... Marshalling/Unmarshalling MyBean w/o problems, e.g. JAXBContext jaxbCtx = JAXBContext.newInstance(MyBean.class); Marshaller m = jaxbCtx.createMarshaller(); m.marshal(myBean, writer); How can I use JAXB to marshall/unmarshall a Collection or List? My attempt results ...

Spring with Castor - Null Pointer Exception when initialising Application Context

Hi, I'm trying to register my castor mapping files with spring and I appear to be getting a null pointer exception. In my application context I have: <bean id="xmlContext" class="org.castor.spring.xml.XMLContextFactoryBean"> <property name="mappingLocations"> <list> <value>DistributionSamplerMappings.xml</value>...

JAXB Unmarshall Created an Empty Object

I am using JAXB to unmarshal an XML file into an object tree. The root object is non-null, but all of it's members are null even though there is data in the XML file. My object classes were generated with Axis2 from wsdls. I have the ObjectFactory class, the jaxb.index class, the package.info annotation, etc. My problem is the same a...