Well, I've been looking at this off and on for the past two months, and I've 
finally been able to pinpoint when it happens, but I still don't understand 
why.  I've verified this behavior with both beta3c & rc0.

This happens when I have a structure I'd like to unmarshall which has a few 
elements I'd like to ignore.  To accomplish this, I add something like:

  <structure name="abc" class="com.my.MyClass">
    <value name="important" field="important" />
    <value name="dontcare" />
  </structure>

If I add a constructor of the form:

  public class MyClass
  {
    private String important;

    public MyClass( String s )
    {
      // Do nothing
    }
    ...
  }

Then everything works as expected (I get the "important" field, but the 
presence of the "dontcare" field doesn't cause the unmarshalling to fail).

You seem to address this in your response from below, Dennis (You should only 
get that message when you are using an object as a simple <value>).  I guess 
that's what I'm doing, but I still don't understand why this is required, or 
why this constructor is required but never called.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dennis Sosnoski
Sent: Friday, March 04, 2005 12:10 PM
To: [email protected]
Subject: Re: [jibx-users] Why does jibx always need a constructor from 
java.lang.String?

This one puzzles me, Joshua. You should only get that message when you 
are using an object as a simple <value>. Unless you specify otherwise 
(using a <format>, or deserializer="xxxxx") JiBX needs the constructor 
from String to create an instance of the object corresponding to the 
text value seen in the input document. Yet you say the constructor is 
not actually being used. Can you give more specifics of your binding and 
data?

  - Dennis

Dennis M. Sosnoski
Enterprise Java, XML, and Web Services
Training and Consulting
http://www.sosnoski.com
Redmond, WA  425.885.7197



Davies, Joshua wrote:

>Whenever I create an input binding (e.g. for unmarshalling), I always
>get the following error message:
>
>org.jibx.runtime.JiBXException: No deserializer for
>com.travelocity.datatype.car.sabre.CarPolicyResponse; define
>deserializer or constructor from java.lang.String
>
>And I create a dummy constructor that takes a string argument, and then
>it works.  In testing (by placing a breakpoint in that constructor), it
>doesn't appear that this constructor is being used... does anybody know
>why this is required?  I'm using beta 3c.
>
>
>-------------------------------------------------------
>SF email is sponsored by - The IT Product Guide
>Read honest & candid reviews on hundreds of IT Products from real users.
>Discover which products truly live up to the hype. Start reading now.
>http://ads.osdn.com/?ad_ide95&alloc_id396&op�k
>_______________________________________________
>jibx-users mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/jibx-users
>
>  
>



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=ick
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_idt12&alloc_id344&op=click
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to