2016-07-23 38 views
0

嗨,我是JibX的新手,刚开始使用样例。在命令提示符下运行绑定编译器时,它会抛出以下错误,它会抛出以下错误:C:\ Users \ Uvais \ JavaProject \ src \ com \ jibX> java -jar C:\ Drive \ jibx_1_2_6 \ jibx \ lib \ jibx- bind.jar binding.xml 错误:无法加载类com.jibX.Person;在结构元素(升 啉3,列50,在binding.xml)上 错误运行结合编译 org.jibx.runtime.JiBXException:装订binding.xml是不可用,因为有效 通货膨胀错误 在org.jibx的。 binding.Utility.loadBinding(Utility.java:358) at org.jibx.binding.Utility.loadFileBinding(Utility.java:420) at org.jibx.binding.Compile.compile(Compile.java:217) at org.jibx.binding.Compile.main(Compile.java:384)无法在jibX绑定编译上加载类

下面

是我binding.xml

<binding> 
<mapping name="customer" class="Customer" ordered="false"> 
    <structure name="person" field="person" > 
     <value name="cust-num" field="customerNumber" usage="optional"/> 
    </structure> 
    <value name="street" field="street" /> 
</mapping> 

但是我不能在eclipse和命令提示符下编译相同的内容,如果我在binding.xml中注释结构标记。请帮助相同。这将是veryuseful,如果任何一个可以共享JIBX一个很好的教程,适合初学者,

回答

0

穆罕默德,

它看起来像你可能有你的包名的情况下的问题。记住Windows文件系统不区分大小写,但Java是。

com.jibX.Person类可能应该是com.jibx.Person。

为什么不从一个简单的基于Maven的示例开始。您会在这里找到他们:

http://jibx.sourceforge.net/maven-jibx-plugin/index.html

也有在github上回购了一些很好的例子。这是一个非常简单的:

https://github.com/jibx/maven-plugin/tree/master/test-suite/base-binding-test

祝您好运!

Don

+0

即使将jibX更改为jibx也有同样的问题。 –

+0

http://stackoverflow.com/questions/10467779/binding-in-jibx –