Thanks for the reply Günther Wieser,
These additional binding classes, when you say runtime, do I need
these in the classloader when marshalling? Or are they just for the
code gen stage of jibx?
What's strange to me is that in my jibx based axis2 code it handles my
objects just fine. In my working axis2 code, the code gen casts to
IMarshallable. What I may need to do is this:
IBindingFactory ibf =
org.jibx.runtime.BindingDirectory.getFactory("binding",
"com.wazollc.alphatheory.hibernate.bo",
EntityMarshaller.class.getClassLoader());
org.jibx.runtime.IMarshallable mctx = (org.jibx.runtime.IMarshallable)bo;
But my hibernate objects would then be tied to jibx. Is that what I
have to do? Here's my simple mapping - AFAICT I'm doing things as you
say I need to - do you see something wrong? Thanks for the help!!!
<binding xmlns:tns="http://wazollc.com/alphatheory/hibernate/bo"
name="binding" package="com.wazollc.alphatheory.hibernate.bo"
force-classes="true">
<namespace uri="http://wazollc.com/alphatheory/hibernate/bo"
default="elements" prefix="ns1"/>
<namespace
uri="http://wazollc.com/alphatheory/webservices/ATWSServer/ATWSServer"
prefix="ns2"/>
<mapping abstract="true" type-name="tns:exchangePermissionBO"
class="com.wazollc.alphatheory.hibernate.bo.ExchangePermissionBO">
<value style="attribute" name="id" get-method="getId"
set-method="setId" usage="optional"/>
<value style="attribute" name="version" get-method="getVersion"
set-method="setVersion" usage="optional"/> <value style="element"
name="name" get-method="getName" set-method="setName"
usage="optional"/>
<value style="element" name="code" get-method="getCode"
set-method="setCode" usage="optional"/>
</mapping>
</binding>
On Nov 14, 2007 10:58 AM, Günther Wieser <[EMAIL PROTECTED]> wrote:
> hi robert,
>
> the additional classes that you mentioned are used by jibx for runtime
> use (it holds more or less the binding information transfomed into
> byte code, so the binding.xml itself is not needed during runtime).
>
> please read my previous post to your thread, this might solve the
> other question that you have (IMarshallable).
>
> br,
> günther
>
> Am 14.11.2007 um 16:20 schrieb robert lazarski:
>
>
> > 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
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/jibx-users
> >
>
>
>
> --
> Günther Wieser
> creative-it
> Guglgasse 6/1/11/1
> A-1110 Wien
> [EMAIL PROTECTED]
> http://www.creative-it.com
>
>
>
>
> -------------------------------------------------------------------------
> 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
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jibx-users
>
-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users