Hello,
I'm not sure if this is another variant of JIBX-263, or a completely
separate problem??? However, when I run CodeGen on Intuit's QuickBooks
schemas, I get the following stack trace and the operation fails.
[java] Exception in thread "main" java.lang.IllegalArgumentException
[java] at
org.eclipse.jdt.core.dom.SimpleName.setIdentifier(SimpleName.java:196)
[java] at org.eclipse.jdt.core.dom.AST.newSimpleName(AST.java:1251)
[java] at
org.jibx.schema.codegen.ClassBuilder.addEnumConstant(ClassBuilder.java:351)
[java] at
org.jibx.schema.codegen.EnumerationClassHolder.buildJava5Enumeration(Enumera
tionClassHolder.java:353)
[java] at
org.jibx.schema.codegen.EnumerationClassHolder.generate(EnumerationClassHold
er.java:162)
[java] at
org.jibx.schema.codegen.ClassHolder.generateInner(ClassHolder.java:702)
[java] at
org.jibx.schema.codegen.StructureClassHolder.generate(StructureClassHolder.j
ava:2026)
[java] at
org.jibx.schema.codegen.PackageHolder.generate(PackageHolder.java:203)
[java] at
org.jibx.schema.codegen.PackageHolder.generate(PackageHolder.java:218)
[java] at
org.jibx.schema.codegen.CodeGen.generate(CodeGen.java:1402)
[java] at org.jibx.schema.codegen.CodeGen.main(CodeGen.java:1652)
Here is the ant invocation I am using....
<target name="qbXML" depends="prepare" description="Generates Code for
qbXML requests">
<path id="codegen_classpath">
<fileset dir="${JIBX_HOME}/lib" includes="*.jar" />
<pathelement location="bin" />
</path>
<java classname="org.jibx.schema.codegen.CodeGen" fork="yes"
classpathref="codegen_classpath" failonerror="true">
<arg value="-n"/>
<arg value="com.foo.bar"/>
<arg value="-s"/>
<arg value="${srcDir}/xsd"/>
<arg value="-t"/>
<arg value="${srcDir}/generated/${srcDir}"/>
<arg value="-v"/>
<arg value="qbxmlops70.xsd"/>
</java>
</target>
I am using JiBX 1_2_1.
line 18 of the qbxmlops70.xsd includes the qbxml70.xsd file.
<xsd:include schemaLocation="qbxml70.xsd"/>
The stack trace seems to stem from around line 1446 of the included
qbxml70.xsd file which defines the GeneralSummaryReportType as a restricted
SimpleType made of an enumeration.
<xsd:element name="GeneralSummaryReportType">
<xsd:simpleType>
<xsd:restriction base="ENUMTYPE">
<xsd:enumeration
value="BalanceSheetPrevYearComp"/>
<xsd:enumeration
value="BalanceSheetStandard"/>
<xsd:enumeration
value="BalanceSheetSummary"/>
<xsd:enumeration
value="CustomerBalanceSummary"/>
<xsd:enumeration
value="ExpenseByVendorSummary"/>
<xsd:enumeration
value="IncomeByCustomerSummary"/>
<xsd:enumeration
value="InventoryStockStatusByItem"/>
<xsd:enumeration
value="InventoryStockStatusByVendor"/>
<xsd:enumeration
value="IncomeTaxSummary"/>
<xsd:enumeration
value="InventoryValuationSummary"/>
<xsd:enumeration
value="PhysicalInventoryWorksheet"/>
<xsd:enumeration
value="ProfitAndLossByClass"/>
<xsd:enumeration
value="ProfitAndLossByJob"/>
<xsd:enumeration
value="ProfitAndLossPrevYearComp"/>
<xsd:enumeration
value="ProfitAndLossStandard"/>
<xsd:enumeration
value="ProfitAndLossYTDComp"/>
<xsd:enumeration
value="PurchaseByItemSummary"/>
<xsd:enumeration
value="PurchaseByVendorSummary"/>
<xsd:enumeration
value="SalesByCustomerSummary"/>
<xsd:enumeration
value="SalesByItemSummary"/>
<xsd:enumeration
value="SalesByRepSummary"/>
<xsd:enumeration
value="SalesTaxLiability"/>
<xsd:enumeration
value="SalesTaxRevenueSummary"/>
<xsd:enumeration value="TrialBalance"/>
<xsd:enumeration
value="VendorBalanceSummary"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
Note that ENUMTYPE restriction is defined in the qbxmltypes70.xsd included
by qbxml70.xsd on line 17. qbxmltypes70.xsd defines ENUMTYPE as
<xsd:simpleType name="ENUMTYPE">
<xsd:restriction base="xsd:string">
</xsd:restriction>
</xsd:simpleType>
I will happily forward the entire XSDs if needed, but they are a bit large.
Unfortunately, as these XSDs are defined by Intuit, I cannot change them.
I have had significant previous positive experience with JiBX, so this comes
somewhat as a surprise to me. Therefore, only as a data point to rule out
structural problems with the QuickBooks schemas; I offer that the same xsds
complete without errors when using XML-BEANS. I would, of course, prefer to
stick with JIBX if this can be resolved or worked around, however, this is
presently a show stopper for us.
Any and all help will be greatly appreciated!
Thanks in advance for your help!
Todd
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users