On Nov 14, 2007 6:19 AM, robert lazarski <[EMAIL PROTECTED]> wrote: > Hi all, > > I've successfuly been following Dennis' though provoking article 'code > first' and jibx2wsdl, adapting it to hibernate and axis2. All is > working fine at the proof of concept level. Now I'm trying to marshal > hibernate entities to an xml file / unmarshal xml files to hibernate > entities - outside of an axis2 services. > <snip> > > IBindingFactory ibf = BindingDirectory.getFactory(clazz); > IMarshallingContext mctx = ibf.createMarshallingContext(); > ByteArrayOutputStream output = new ByteArrayOutputStream(); > try { > XMLOutputFactory ofact = XMLOutputFactory.newInstance(); > XMLStreamWriter wrtr = ofact.createXMLStreamWriter(output, > "UTF-8"); > mctx.setXmlWriter(new StAXWriter(ibf.getNamespaces(), wrtr)); > mctx.marshalDocument(bo); > } catch (XMLStreamException e) { > throw new JiBXException("Error creating writer", e); > } > > I get: > > "Supplied root object of class > com.wazollc.alphatheory.hibernate.bo.ExchangePermissionBO cannot be > marshalled without top-level mapping" >
Replying to myself as I'm a jibx newbie. Looking at the source, the object I'm trying marshall needs to be an instance of IMarshallable. Yet, I'm trying to use pre-existing hibernate objects. Furthermore, I noticed that the jibx binding creates some of its own classes, JiBX_bindingExchangePermissionBO_access.class and JiBX_bindingFactory.class in my case. Its not clear to me though what to do in my case. Please help, Robert ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ jibx-users mailing list jibx-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jibx-users