[jibx-users] org.jibx.runtime.JiBXException: Duplicate element "{http://www.pcats.org/schema/naxml/loyalty/v01}Promotion"(line 1, col 1059)
Could anyone please assist me in resolving the Duplicate element error? Any help would be greatly appreciated... XMLhttp://www.naxml.org/POSBO/Vocabulary/2003-10-16; xmlns:ns4="http://www.pcats.org/schema/core/v01; xmlns:ns3="http://www.pcats.org/schema/naxml/loyalty/v01;> 1 001 HOSTRefID6085997634 HOSTRefID6085997634 0.00 loyaltyOffer 4K 4K 0.00 loyaltyOffer 001 2 cash Other 0.00 Bindinghttp://www.pcats.org/schema/naxml/loyalty/v01; xmlns:ns2="http://www.naxml.org/POSBO/Vocabulary/2003-10-16; xmlns:ns4="http://www.pcats.org/schema/core/v01; trim-whitespace="true"> http://www.pcats.org/schema/naxml/loyalty/v01; default="elements" /> http://www.naxml.org/POSBO/Vocabulary/2003-10-16; /> http://www.pcats.org/schema/core/v01; /> http://www.naxml.org/POSBO/Vocabulary/2003-10-16; /> Exceptionorg.jibx.runtime.JiBXException: Duplicate element "{http://www.pcats.org/schema/naxml/loyalty/v01}Promotion;(line 1, col 1059) at org.jibx.runtime.impl.UnmarshallingContext.throwNameException(UnmarshallingContext.java:249) ~[jibx-run.jar:1.2.5]at org.pcats.schema.naxml.loyalty.v01.JiBX_CancelTransactionRequestMungeAdapter.JiBX_FinalizeRewardsRequest_unmarshal_1_16() ~[app1.jar:na]at org.pcats.schema.naxml.loyalty.v01.JiBX_FinalizeRewardsRequestFuelLine_access.unmarshal() ~[app1.jar:na]at org.pcats.schema.naxml.loyalty.v01.JiBX_CancelTransactionRequestMungeAdapter.JiBX_FinalizeRewardsRequest_unmarshal_1_13() ~[app1.jar:na]at org.pcats.schema.naxml.loyalty.v01.JiBX_FinalizeRewardsRequestTransactionLine_access.unmarshal() ~[app1.jar:na]at org.pcats.schema.naxml.loyalty.v01.JiBX_CancelTransactionRequestMungeAdapter.JiBX_FinalizeRewardsRequest_unmarshal_1_11() ~[app1.jar:na]at org.pcats.schema.naxml.loyalty.v01.JiBX_CancelTransactionRequestMungeAdapter.JiBX_FinalizeRewardsRequest_unmarshal_1_12() ~[app1.jar:na]at org.pcats.schema.naxml.loyalty.v01.JiBX_FinalizeRewardsRequestTransactionDetailGroup_access.unmarshal() ~[app1.jar:na]at org.pcats.schema.naxml.loyalty.v01.JiBX_CancelTransactionRequestMungeAdapter.JiBX_FinalizeRewardsRequest_unmarshal_1_9() ~[app1.jar:na]at org.pcats.schema.naxml.loyalty.v01.JiBX_FinalizeRewardsRequestFinalizeRewardsRequest_access.unmarshal() ~[app1.jar:na]at org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(UnmarshallingContext.java:2757) ~[jibx-run.jar:1.2.5]at org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(UnmarshallingContext.java:2948) ~[jibx-run.jar:1.2.5]org.jibx.runtime.JiBXException: Duplicate element "{http://www.pcats.org/schema/naxml/loyalty/v01}Promotion;(line 1, col 1059) at org.jibx.runtime.impl.UnmarshallingContext.throwNameException(UnmarshallingContext.java:249) at org.pcats.schema.naxml.loyalty.v01.JiBX_CancelTransactionRequestMungeAdapter.JiBX_FinalizeRewardsRequest_unmarshal_1_16() at org.pcats.schema.naxml.loyalty.v01.JiBX_FinalizeRewardsRequestFuelLine_access.unmarshal() at org.pcats.schema.naxml.loyalty.v01.JiBX_CancelTransactionRequestMungeAdapter.JiBX_FinalizeRewardsRequest_unmarshal_1_13() at org.pcats.schema.naxml.loyalty.v01.JiBX_FinalizeRewardsRequestTransactionLine_access.unmarshal() at org.pcats.schema.naxml.loyalty.v01.JiBX_CancelTransactionRequestMungeAdapter.JiBX_FinalizeRewardsRequest_unmarshal_1_11() at org.pcats.schema.naxml.loyalty.v01.JiBX_CancelTransactionRequestMungeAdapter.JiBX_FinalizeRewardsRequest_unmarshal_1_12() at org.pcats.schema.naxml.loyalty.v01.JiBX_FinalizeRewardsRequestTransactionDetailGroup_access.unmarshal() at org.pcats.schema.naxml.loyalty.v01.JiBX_CancelTransactionRequestMungeAdapter.JiBX_FinalizeRewardsRequest_unmarshal_1_9()
[jibx-users] Not to include namespace prefix for few fields
How can I change the binding definition so that it doesn't add name space prefix for a few fields? XML http://www.pcats.org/schema/naxml/loyalty/v01; xmlns:ns2="http://www.naxml.org/POSBO/Vocabulary/2003-10-16; xmlns:ns4="http://www.pcats.org/schema/core/v01; > 1.0 VIPER:Topaz Binding http://www.pcats.org/schema/naxml/loyalty/v01; xmlns:ns2="http://www.naxml.org/POSBO/Vocabulary/2003-10-16; xmlns:ns4="http://www.pcats.org/schema/core/v01;trim-whitespace="true" direction="output">http://www.pcats.org/schema/naxml/loyalty/v01; default="elements" prefix="ns3"/> http://www.naxml.org/POSBO/Vocabulary/2003-10-16; prefix="ns2"/> http://www.pcats.org/schema/core/v01; prefix="ns4"/> http://www.pcats.org/schema/core/v01; get-method="getPOSLoyaltyInterfaceVersion" set-method="setPOSLoyaltyInterfaceVersion"/>http://www.naxml.org/POSBO/Vocabulary/2003-10-16; get-method="getVendorName" set-method="setVendorName"/>http://www.pcats.org/schema/core/v01; > What changes are required to this binding to not include the ns3: prefix from just element? -- ___ jibx-users mailing list jibx-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jibx-users
Re: [jibx-users] org.jibx.runtime.JiBXException: Duplicate element error
The original schema is very complex (include many other schemas) and I only need to process a few elements from it. That is why I tried the structure approach. Why was I getting the Duplicate element error in my original approach? What does the "No way to load prior value - new instance will be created on each unmarshalling; on structure element at" warning mean. It was pointing to the line caused the duplicate element errorWhen I changed the binding like this to use collection, I am getting bind errors[bind] Error: Unknown format {http://www.naxml.org/POSBO/Vocabulary/2003-10-16}:Description; on value element at (line 18, col 105 [bind] Error: All child components must define element names for flexible='true'; on collection element at (line 13, col 137http://www.pcats.org/schema/naxml/loyalty/v01; xmlns:ns3="http://www.naxml.org/POSBO/Vocabulary/2003-10-16; > http://www.pcats.org/schema/naxml/loyalty/v01; prefix="ns2" /> http://www.naxml.org/POSBO/Vocabulary/2003-10-16; prefix="ns3" /> -- Go from Idea to Many App Stores Faster with Intel(R) XDK Give your users amazing mobile app experiences with Intel(R) XDK. Use one codebase in this all-in-one HTML5 development environment. Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs. http://pubads.g.doubleclick.net/gampad/clk?id=254741911=/4140___ jibx-users mailing list jibx-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jibx-users
Re: [jibx-users] How to solve org.jibx.runtime.JiBXException: No unmarshaller for element error
I have changed the binding like this and it is working now... http://www.pcats.org/schema/naxml/loyalty/v01; class="org.pcats.schema.naxml.loyalty.v01.LoyaltyOnlineStatusRequest" flexible="true" ordered="false"> http://www.naxml.org/POSBO/Vocabulary/2003-10-16; prefix="ns2"/> http://www.pcats.org/schema/naxml/loyalty/v01; prefix="ns3"/> http://www.pcats.org/schema/core/v01; prefix="ns4"/> http://www.pcats.org/schema/naxml/loyalty/v01; > http://www.pcats.org/schema/naxml/loyalty/v01; /> http://www.naxml.org/POSBO/Vocabulary/2003-10-16; /> http://www.naxml.org/POSBO/Vocabulary/2003-10-16"/> http://www.pcats.org/schema/naxml/loyalty/v01; /> http://www.pcats.org/schema/naxml/loyalty/v01; usage="optional" > > From: bindulbhow...@gmail.com > Date: Tue, 24 Nov 2015 15:01:27 -0700 > Subject: Re: [jibx-users] How to solve org.jibx.runtime.JiBXException: No > unmarshaller for element error > To: psgov...@hotmail.com > CC: jibx-users@lists.sourceforge.net > > Hello, > > You seem to have only changed it in the mapping element; the same > change needs to happen on all other name fields (structure, value > elements). > > Please go through the documentation if this is not clear. > > Regards, > Bindul > Bindul Bhowmik > > > On Tue, Nov 24, 2015 at 2:08 PM, PS Govind <psgov...@hotmail.com> wrote: > > Appreciate the quick response.. > > I have changed the binding as follows and now the exception is gone. But > > fields are set with null. > > pOSLoyaltyInterfaceVersion=null, vendorName=null, vendorModelVersion=null, > > pOSSequenceID=null > > How can I get the values populated in LoyaltyOnlineStatusRequest fields? > > Again truly appreciate all the help... > > > > > > > ns="http://www.pcats.org/schema/naxml/loyalty/v01; > > class="org.pcats.schema.naxml.loyalty.v01.LoyaltyOnlineStatusRequest" > > flexible="true" ordered="false"> > > > > http://www.naxml.org/POSBO/Vocabulary/2003-10-16; > > prefix="ns2"/> > > http://www.pcats.org/schema/naxml/loyalty/v01; > > prefix="ns3"/> > > http://www.pcats.org/schema/core/v01; prefix="ns4"/> > > > > > usage="optional" > > > > field="pOSLoyaltyInterfaceVersion" usage="optional"/> > > > > > usage="optional" /> > > > > > > > > > > > > > >> From: bindulbhow...@gmail.com > >> Date: Tue, 24 Nov 2015 12:41:23 -0700 > >> Subject: Re: [jibx-users] How to solve org.jibx.runtime.JiBXException: No > >> unmarshaller for element error > >> To: psgov...@hotmail.com; jibx-users@lists.sourceforge.net > > > >> > >> Hello, > >> > >> I do not believe your name mapping is correct. As per JiBX > >> documentation [1]; the /@name attribute should be the local > >> (unqualified) name of the element or attribute. If you need to add a > >> namespace, you need to use the /@ns attribute. You cannot use prefixes > >> in your mapping outside the namespace element. > >> > >> So, instead of: > >> >> class="org.pcats.schema.naxml.loyalty.v01.LoyaltyOnlineStatusRequest" > >> flexible="true" ordered="false"> > >> > >> use: > >> >> ns="http://www.pcats.org/schema/naxml/loyalty/v01; > >> class="org.pcats.schema.naxml.loyalty.v01.LoyaltyOnlineStatusRequest" > >> flexible="true" ordered="false"> > >> > >> > >> From the namespace element documentation [2], the /@prefix attribute > >> is used for marshalling only. > >> > >> > >> Bindul Bhowmik > >> > >> [1] http://jibx.sourceforge.net/binding/binding-attributes.html#name > >> [2] http://jibx.sourceforge.net/binding/namespace-element.html > >> > >> > >> On Tue, Nov 24, 2015 at 12:17 PM, PS Govind <psgov...@hotmail.com> wrote: > >> > Hi, > >> > > >> > I am getting "org.jibx.runtime.JiBX
[jibx-users] org.jibx.runtime.JiBXException: Duplicate element error
I am getting org.jibx.runtime.JiBXException: Duplicate element "{http://www.pcats.org/schema/naxml/loyalty/v01}TransactionLine; when trying to load this xml into java. I see the set-method="addTransactionLine" method being called for the first TransactionLine element. How can I resolve this error? Any help is truly appreciated... http://www.pcats.org/schema/naxml/loyalty/v01; xmlns:ns4="http://www.pcats.org/schema/core/v01; xmlns:ns3="http://www.naxml.org/POSBO/Vocabulary/2003-10-16;> vX.0X:X.00.00 123456 XX 2013-01-31 2013-01-31 19:34:16 1 TESTPRODUCT1 EA 2 TESTPRODUCT2 EA --- http://www.pcats.org/schema/naxml/loyalty/v01; class="com.weis.fuel.verifone.model.RewardTransaction" flexible="true" ordered="false"> http://www.pcats.org/schema/naxml/loyalty/v01; prefix="ns2"/> http://www.naxml.org/POSBO/Vocabulary/2003-10-16; prefix="ns3"/> http://www.pcats.org/schema/core/v01; prefix="ns4"/> http://www.pcats.org/schema/naxml/loyalty/v01; > http://www.naxml.org/POSBO/Vocabulary/2003-10-16; usage="optional" /> http://www.pcats.org/schema/naxml/loyalty/v01; usage="optional" /> http://www.pcats.org/schema/naxml/loyalty/v01; usage="optional" > http://www.pcats.org/schema/naxml/loyalty/v01; > http://www.pcats.org/schema/naxml/loyalty/v01; > http://www.naxml.org/POSBO/Vocabulary/2003-10-16; usage="optional" /> http://www.pcats.org/schema/naxml/loyalty/v01; > http://www.naxml.org/POSBO/Vocabulary/2003-10-16; usage="optional" /> http://www.naxml.org/POSBO/Vocabulary/2003-10-16; usage="optional" /> http://www.naxml.org/POSBO/Vocabulary/2003-10-16; usage="optional" /> http://www.pcats.org/schema/naxml/loyalty/v01; usage="optional" > http://www.pcats.org/schema/naxml/loyalty/v01; usage="optional"> http://www.pcats.org/schema/naxml/loyalty/v01; usage="optional"/> http://www.pcats.org/schema/naxml/loyalty/v01; usage="optional" > http://www.naxml.org/POSBO/Vocabulary/2003-10-16; usage="optional"/> http://www.pcats.org/schema/naxml/loyalty/v01; usage="optional"/> --- -- Go from Idea to Many App Stores Faster with Intel(R) XDK Give your users amazing mobile app experiences with Intel(R) XDK. Use one codebase in this all-in-one HTML5 development environment. Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs. http://pubads.g.doubleclick.net/gampad/clk?id=254741911=/4140___ jibx-users mailing list jibx-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jibx-users
[jibx-users] How to solve org.jibx.runtime.JiBXException: No unmarshaller for element error
Hi, I am getting "org.jibx.runtime.JiBXException: No unmarshaller for element" error when trying unmarshel the xml file given below. The input xml file, binding definition, Java source and unmarshelling code are given below. Any help will be truly appreciated... org.jibx.runtime.JiBXException: No unmarshaller for element "{http://www.pcats.org/schema/naxml/loyalty/v01}GetLoyaltyOnlineStatusRequest; (line 5, col 60)at org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(UnmarshallingContext.java:2754) at org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(UnmarshallingContext.java:2900) at com.weis.fuel.verifone.util.JiBXTest.main(JiBXTest.java:43) XML--http://www.naxml.org/POSBO/Vocabulary/2003-10-16; xmlns:ns4="http://www.pcats.org/schema/core/v01; xmlns:ns3="http://www.pcats.org/schema/naxml/loyalty/v01;> 1.0 VIPER 5.07.00 XXX XXX Binding--http://www.naxml.org/POSBO/Vocabulary/2003-10-16; prefix="ns2"/> http://www.pcats.org/schema/naxml/loyalty/v01; prefix="ns3"/> http://www.pcats.org/schema/core/v01; prefix="ns4"/> Unmarshalling code-- bfact = BindingDirectory.getFactory("LoyaltyStatusRequest", LoyaltyOnlineStatusRequest.class); //bfact = BindingDirectory.getFactory(LoyaltyOnlineStatusRequest.class); uctx = bfact.createUnmarshallingContext(); in = new FileInputStream(inFile); LoyaltyOnlineStatusRequest request = (LoyaltyOnlineStatusRequest)uctx.unmarshalDocument(in, null); package org.pcats.schema.naxml.loyalty.v01;public class GetLoyaltyOnlineStatusRequest implements java.io.Serializable{ private static final long serialVersionUID = 1L;private String pOSLoyaltyInterfaceVersion;private String vendorName;private String vendorModelVersion;private String pOSSequenceID; public GetLoyaltyOnlineStatusRequest(){ super();} public String getPOSLoyaltyInterfaceVersion() { return pOSLoyaltyInterfaceVersion;}public void setPOSLoyaltyInterfaceVersion( String pOSLoyaltyInterfaceVersion) {this.pOSLoyaltyInterfaceVersion = pOSLoyaltyInterfaceVersion;} public String getVendorName() {return vendorName;}public void setVendorName(String vendorName) {this.vendorName = vendorName;}public String getVendorModelVersion() {return vendorModelVersion;}public void setVendorModelVersion(String vendorModelVersion) {this.vendorModelVersion = vendorModelVersion;} public String getPOSSequenceID() {return pOSSequenceID;}public void setPOSSequenceID(String pOSSequenceID) {this.pOSSequenceID = pOSSequenceID;}} -- Go from Idea to Many App Stores Faster with Intel(R) XDK Give your users amazing mobile app experiences with Intel(R) XDK. Use one codebase in this all-in-one HTML5 development environment. Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs. http://pubads.g.doubleclick.net/gampad/clk?id=254741551=/4140___ jibx-users mailing list jibx-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jibx-users