Hi,

In my last message, I meant to say to check the thread: Using Ids in which I posted a question similar to yours (with no answer).

I have simplified my mapping and xml file to a minimum.  Here they are:

BINDING:
========
<binding>
<mapping name="ItineraryRendition" class="com.agencebraque.jetsgo.itineraryserver.entities.ItineraryRendition">
<collection name="ItineraryList" add-method="addItinerary" iter-method="getItineraryIterator"/>
<collection name="PassengerInfoList" add-method="addPassengerInfo" iter-method="getPassengerInfoIterator"/>
</mapping>
<mapping name="Itinerary" class="com.agencebraque.jetsgo.itineraryserver.entities.Itinerary">
<structure name="pnr" get-method="getPnr" set-method="setPnr" type="com.agencebraque.jetsgo.itineraryserver.PNR.entities.ItineraryPNR">
<collection name="passengers" add-method="addPassengers" iter-method="getPassengersIterator">
<structure name="PassengerInfo" >
<value style="attribute" name="refid" type="com.agencebraque.jetsgo.itineraryserver.PNR.passenger.entities.PassengerInfo" ident="ref"/>
</structure>
</collection>
</structure>
</mapping>
<mapping name="PassengerInfo" class="com.agencebraque.jetsgo.itineraryserver.PNR.passenger.entities.PassengerInfo">
<value style="attribute" name="id" get-method="getId" set-method="setId" ident="def"/>
</mapping>
</binding>


XML FILE:
========
<?xml version="1.0" encoding="UTF-8"?>
<ItineraryRendition>
   <ItineraryList>
       <Itinerary>
           <pnr>
               <passengers>
                   <PassengerInfo refid="N10093"/>
               </passengers>
           </pnr>
       </Itinerary>
   </ItineraryList>
   <PassengerInfoList>
       <PassengerInfo id="N10093">
       </PassengerInfo>
   </PassengerInfoList>
</ItineraryRendition>

When compiling my binding, I get the following exception.

EXCEPTION:
==========
java.lang.NullPointerException
at org.jibx.binding.def.PropertyDefinition.getName(PropertyDefinition.java:307)
at org.jibx.binding.def.ValueChild.createBackfillClass(ValueChild.java:185)
at org.jibx.binding.def.ValueChild.genParseIdRef(ValueChild.java:283)
at org.jibx.binding.def.ValueChild.genUnmarshal(ValueChild.java:401)
at org.jibx.binding.def.ValueChild.genAttributeUnmarshal(ValueChild.java:553)
at org.jibx.binding.def.NestedStructure.genAttributeUnmarshal(NestedStructure.java:118)
at org.jibx.binding.def.ElementWrapper.genContentUnmarshal(ElementWrapper.java:248)


If anybody has any clue, please let me know.

Thank you,

Fran�ois

Fran�ois Eric wrote:

Hi Linus and Jibx users/developers,

I sent a similar message last week (see title: Problem with jibx ref and def) but did not get an answer. I also saw that a bug was in JIRA: [jira] Created: (JIBX-19) NullPointerException in ident="ref" within collection.

It says that it is due to forward references but even after eliminating those references (my XML is not static and I can therefore modify it) I still get the same exception.

If anybody has got this to work please help us out, I'm running out of ideas.

Thanks a lot,

Francois

Linus Kamb wrote:

I have the following mapping:


<collection name="InstalledItems" add-method="addHardwareInstallation" iter-method="getInstalledHardwareIterator" > <value name="Installation" type="edu.iris.dmc.isis.HardwareInstallation" ident="ref" /> </collection>

And I get a NPE when I try to compile the binding.

(from runtime binding:)
[java] Exception in thread "main" java.lang.NullPointerException
[java] at org.jibx.binding.def.PropertyDefinition.getName(PropertyDefinition.java:307)


[java] at org.jibx.binding.def.ValueChild.createBackfillClass(ValueChild.java:185)
[java] at org.jibx.binding.def.ValueChild.genParseIdRef(ValueChild.java:283)
[java] at org.jibx.binding.def.ValueChild.genUnmarshal(ValueChild.java:401)
[java] at org.jibx.binding.def.ValueChild.genContentUnmarshal(ValueChild.java:587)
[java] at org.jibx.binding.def.NestedCollection.genContentUnmarshal(NestedCollection.java:132)


[java] at org.jibx.binding.def.ElementWrapper.genContentUnmarshal(ElementWrapper.java:272)

[java] at org.jibx.binding.def.NestedStructure.genContentUnmarshal(NestedStructure.java:153)

[java] at org.jibx.binding.def.ObjectBinding.genUnmarshalContentCall(ObjectBinding.java:611)

[java] at org.jibx.binding.def.ObjectBinding.genContentUnmarshal(ObjectBinding.java:723)

[java] at org.jibx.binding.def.ElementWrapper.genContentUnmarshal(ElementWrapper.java:272)

[java] at org.jibx.binding.def.MappingDefinition.generateCode(MappingDefinition.java:499)

[java] at org.jibx.binding.def.DefinitionContext.generateCode(DefinitionContext.java:593)

[java] at org.jibx.binding.def.BindingDefinition.generateCode(BindingDefinition.java:562)

[java] at org.jibx.binding.Loader.processBindings(Loader.java:292)
[java] at org.jibx.binding.Run.main(Run.java:190)
[java] Java Result: 1


If I change the getName() method in PropertyDefinition to spit out toString() at that point, I get:

[java] noSet for: property from collection (edu.iris.dmc.isis.HardwareInstallation)

HardwareInstallation has a defined value for ident="def" .

Trying to figure out what I'm doing wrong...





-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
jibx-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jibx-users







------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ jibx-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to