Re: [jibx-users] java.lang.IllegalStateException: Error loading class java.lang.CharSequence

2016-06-07 Thread Bhowmik, Bindul
Varun,

Short answer BECL 5.x is not compatible with Java 1.8 class file
structure. See the BCEL website or the Apache Commons development
mailing list archives for more details.

Bindul

On Tue, Jun 7, 2016 at 9:36 PM, Varun Bhat  wrote:
> Hello,
>
> I am migrating my application previously built on jdk1.6 to jdk1.8 with
> jibx1.2.6 and am seeing the below error upon using BCEL5.1/BCEL5.2 jar.
>
> from the jibx forum i got to know this issue is resolved with
> BCEL-6.0SNAPSHOT.jar. Upon trying that i was able to build my application
> successfully.
>
> I was curious to know why this error is coming on migrating to jdk1.8. Can
> somebody throw light on this. Any or every input would be of great help.
>
> jibx-bind:
>
>  [echo] Binding classes with binding file
> C:\CSG_v1.0.18\corundum\siom-1-03\siom/src/main/java/c
>
> om/ge/medit/siom/mapping/binding.xml
>
>  [bind] Error running binding compiler
>
>  [bind] java.lang.IllegalStateException: Error loading class
> java.lang.CharSequence: Error readi
>
> ng path java/lang/CharSequence.class for class java.lang.CharSequence
>
>  [bind] at
> org.jibx.binding.classes.ClassCache$ClassCacheLocator.getClassInfo(ClassCache.jav
>
> a:291)
>
>  [bind] at
> org.jibx.binding.model.ClassHierarchyContext.accumulateInterfaces(ClassHierarchyC
>
> ontext.java:95)
>
>  [bind] at
> org.jibx.binding.model.ClassHierarchyContext.addTypedComponent(ClassHierarchyCont
>
> ext.java:121)
>
>  [bind] at
> org.jibx.binding.model.DefinitionContext.addFormat(DefinitionContext.java:527)
>
>  [bind] at
> org.jibx.binding.model.BindingElement.defineBaseFormat(BindingElement.java:843)
>
>  [bind] at
> org.jibx.binding.model.BindingElement.runValidation(BindingElement.java:865)
>
>  [bind] at
> org.jibx.binding.model.BindingElement.runValidation(BindingElement.java:899)
>
>  [bind] at
> org.jibx.binding.model.BindingElement.validateBinding(BindingElement.java:969)
>
>  [bind] at
> org.jibx.binding.Utility.validateBinding(Utility.java:226)
>
>  [bind] at org.jibx.binding.Utility.loadBinding(Utility.java:269)
>
>  [bind] at
> org.jibx.binding.Utility.loadFileBinding(Utility.java:420)
>
>  [bind] at org.jibx.binding.Compile.compile(Compile.java:217)
>
>  [bind] at
> org.jibx.binding.ant.CompileTask.execute(CompileTask.java:248)
>
>  [bind] at
> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
>
>  [bind] at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown
> Source)
>
>  [bind] at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java
>
> :43)
>
>  [bind] at java.lang.reflect.Method.invoke(Method.java:498)
>
>  [bind] at
> org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
>
>  [bind] at org.apache.tools.ant.Task.perform(Task.java:348)
>
>  [bind] at org.apache.tools.ant.Target.execute(Target.java:435)
>
>  [bind] at org.apache.tools.ant.Target.performTasks(Target.java:456)
>
>  [bind] at
> org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
>
>  [bind] at
> org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecuto
>
> r.java:38)
>
>  [bind] at
> org.apache.tools.ant.Project.executeTargets(Project.java:1248)
>
>  [bind] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:440)
>
>  [bind] at
> org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
>
>  [bind] at
> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
>
>  [bind] at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown
> Source)
>
>  [bind] at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java
>
> :43)
>
>  [bind] at java.lang.reflect.Method.invoke(Method.java:498)
>
>  [bind] at
> org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
>
>  [bind] at org.apache.tools.ant.Task.perform(Task.java:348)
>
>  [bind] at org.apache.tools.ant.Target.execute(Target.java:435)
>
>  [bind] at org.apache.tools.ant.Target.performTasks(Target.java:456)
>
>  [bind] at
> org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
>
>  [bind] at
> org.apache.tools.ant.Project.executeTarget(Project.java:1364)
>
>  [bind] at
> org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:4
>
> 1)
>
>  [bind] at
> org.apache.tools.ant.Project.executeTargets(Project.java:1248)
>
>  [bind] at org.apache.tools.ant.Main.runBuild(Main.java:851)
>
>  [bind] at org.apache.tools.ant.Main.startAnt(Main.java:235)
>
>  [bind] at
> org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
>
>  [bind] at
> org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
>
>   

Re: [jibx-users] org.jibx.runtime.JiBXException: Duplicate element error

2015-12-03 Thread Bhowmik, Bindul
Govind,

In the mapping you have pasted, I don't see a ns3:Description format
element defined, so where are you referring it from. Also, I am not
sure you can use ':' in the format label (have never used it myself).

Regards,
Bindul

On Thu, Dec 3, 2015 at 6:56 AM, PS Govind  wrote:
> 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 error
>
> When 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 137
>
> 
>
>  xmlns:ns2="http://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" />
>
> 
>
>  usage="optional">
>  set-method="setTranItemList" create-type="java.util.ArrayList">
>
> 
>  style="attribute" />
> 
>  format="ns3:Description" />
> 
>  style="attribute" />
>   
>  
>   
>  
>  
>
> 
> 

--
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] org.jibx.runtime.JiBXException: Duplicate element error

2015-12-02 Thread Bhowmik, Bindul
Govind,

Have you looked at using the  mapping element (see [1] and
[2]), rather than relying on  alone?

Regards,
Bindul

[1] http://jibx.sourceforge.net/binding/tutorial/binding-collects.html
[2] http://jibx.sourceforge.net/binding/collection-element.html
Bindul Bhowmik


On Tue, Dec 1, 2015 at 4:38 PM, PS Govind  wrote:
> 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...
>
>
>  xmlns:ns2="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
> 
> 
> 
> 
> 
> ---
>
> 
>ns="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"/>
>ns="http://www.pcats.org/schema/naxml/loyalty/v01; >
>ns="http://www.naxml.org/POSBO/Vocabulary/2003-10-16;  usage="optional" />
>ns="http://www.pcats.org/schema/naxml/loyalty/v01;   usage="optional" />
>ns="http://www.pcats.org/schema/naxml/loyalty/v01;   usage="optional" >
> usage="optional" style="attribute" />
>
>
>ns="http://www.pcats.org/schema/naxml/loyalty/v01; >
>ns="http://www.pcats.org/schema/naxml/loyalty/v01; >
> ns="http://www.naxml.org/POSBO/Vocabulary/2003-10-16; usage="optional" />
> ns="http://www.pcats.org/schema/naxml/loyalty/v01; >
>  ns="http://www.naxml.org/POSBO/Vocabulary/2003-10-16;  usage="optional" />
>  
> ns="http://www.naxml.org/POSBO/Vocabulary/2003-10-16; usage="optional" />
> ns="http://www.naxml.org/POSBO/Vocabulary/2003-10-16; usage="optional" />
>
>
>ns="http://www.pcats.org/schema/naxml/loyalty/v01; usage="optional" >
> allow-repeats="true" type="com.weis.fuel.verifone.model.TransactionLine"
> set-method="addTransactionLine"
> ns="http://www.pcats.org/schema/naxml/loyalty/v01; usage="optional">
>  ns="http://www.pcats.org/schema/naxml/loyalty/v01; usage="optional"/>
>  usage="optional" style="attribute" />
>  ns="http://www.pcats.org/schema/naxml/loyalty/v01;  usage="optional" >
>   ns="http://www.naxml.org/POSBO/Vocabulary/2003-10-16; usage="optional"/>
>   ns="http://www.pcats.org/schema/naxml/loyalty/v01; usage="optional"/>
>   usage="optional" style="attribute" />
>   
> 
>
>
>   
>
>  
> 
> ---
>
>
>
>
> --
> 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
>

--
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

2015-11-24 Thread Bhowmik, Bindul
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:


use:
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  wrote:
> 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
> --
> 
>xmlns:ns2="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
> --
> 
>  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"/>
>
>
>  field="pOSLoyaltyInterfaceVersion" usage="optional"/>
> 
>  usage="optional" />
> 
> 
> 
> 
>
> --
> -- 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
>

--
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] Unmarshalling attributes of child element to a collection

2014-08-29 Thread Bhowmik, Bindul
​Hello,

​
​I am trying to use JiBX to parse a larger XML, which includes a structure
similar to the ones noted below:

Schema:
xs:complexType name=Parent
xs:sequence
xs:element name=ChildElem maxOccurs=unbounded
xs:complexType
xs:attribute name=ChildElemValue type=xs:string
use=required/
/xs:complexType
/xs:element
/xs:sequence
xs:attribute name=Child1 type=xs:string/
xs:attribute name=Child2 type=xs:int/
/xs:complexType

Sample Value:
Parent Child1=AttrVal Child2=999
ChildElem ChildElemValue=SomeVal/
ChildElem ChildElemValue=SomeVal2/
/Parent​


The equivalent class I am trying to map this to is:
public class Parent {
private String child1;
private int Child2;
private ListString childElems;
}

I am trying to write a mapping for marshalling and unmarshalling, without
requiring a class to represent the ChildElem, because all it will ever have
is a string in the ChildElemValue attribute.

I am open to (but not experienced with) custom Marshaller / Unmarshaller,
and if so, I would like to reuse them as much as possible, as there are
similar structures as above (with different element / attribute names) all
over the project.

Any help or direction in accomplishing this would be greatly appreciated.

Regards,
Bindul​
--
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users