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.

There's something I'm not getting with respect to the binding file:
what is the purpose of the binding.xml when marshalling /
unmarshalling pre-existing objects like hibernate? I mean to say, my
binding.xml has those entities, so how do I tie that into
IBindingFactory? For example, when executing:

        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"

When I try:

IBindingFactory ibf = BindingDirectory.getFactory(this.bindingFilePath, clazz);

Its doesn't accept an InputStream argument and looking at the
BindingDirectory code, things like bname don't appear to be actually
loading the file. Anyways, I want to load my binding.xml off the
classpath and simply passing "binding.xml" isn't working.

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

Reply via email to