Thanks for the reply Lawrence.  What's odd is that I got this after upgrading to the latest 2.1.0 release.  2.0.x isn't on my classpath anymore at all.  I got this problem you described months ago, found relevant threads on it and recompiled XmlBeans from a post 220181 version to fix it.    It reappeared from my perspective right after the 2.1.0 release.  I've gone over my build script quite a few times to see if it's something I'm doing - like referencing an older version of the xmlbeans jars for instance, but I can't find it.

Here's my build script:

    <path id="xml-beans.classpath">
        <fileset dir="${xml-beans.lib.dir}">
            <include name="*.jar" />
        </fileset>
    </path>

    <target name="gen-xmlbeans"
        description="Generate xml-beans from xsd">
        <echo>
            About to generate xml-beans for xsd files to ${target.xml-beans }
        </echo>
        <echo>Sourcedir is ${src.xsd}</echo>
        <echo>Basedir is ${basedir}</echo>
        <echo>xml-beans.lib.dir is ${xml-beans.lib.dir}</echo>

        <taskdef name="xmlbeans"
            classname="org.apache.xmlbeans.impl.tool.XMLBean">
            <classpath>
                <path refid="xml-beans.classpath " />
            </classpath>
        </taskdef>

        <xmlbeans schema="${src.xsd}"
                  srcgendir="${target.xml-beans}"
                  destfile="../lib/member- magna-xmlbeans.jar"
                  debug="true">
            <classpath>
                <path refid="xml-beans.classpath" />
            </classpath>
        </xmlbeans>

    </target>

There is only one classpath defined in the script.

Running it shows the dir containing the xmlbeans jars to be:

     [echo] xml-beans.lib.dir is C:\RAD_workspaces\workspace2\Eivr_Tools\third_p
arty/xmlbeans-2.1.0/lib

And just-to-be-sure, I replaced the full contents of the 2.1.0 XmlBeans jars, freshly expanded from the download.

Any ideas?  For now I'll use the workaround you suggest, but it'd also be nice to figure this out.

Stu

On 11/19/05, Lawrence Jones <[EMAIL PROTECTED]> wrote:

Hi Stuart

 

The problem is that (prior to checkin 220181) a TypeSystemHolder class was directly referenced in every generated class. This TypeSystemHolder class is the link between the .class (generated Java code) world and the .xsb (binary files equivalent to schema entries) world and it's generated in the _binary_ directory (i.e. the argument to the –d flag if you're using scomp or the classgendir arg to the xmlbean ant task).

 

When it comes time to compile the generated .java files this will only work if you include the classgendir in the classpath. If you don't specify the classgendir then a temp dir is created and used for this purpose but unfortunately this is unlikely to be on your classpath.

 

After checkin 220181 we changed the direct reference to be a reference by reflection to avoid this problem (and other similar problems – see e.g. http://issues.apache.org/jira/browse/XMLBEANS-120).

 

So choices are:

 

  1. specify classgendir explicitly and include it in your classpath
  2. upgrade to a version of XmlBeans after revision 220181 (e.g. the new 2.1.0 version that's just been released)

 

Cheers,

 

Lawrence

 


From: Stuart Robertson [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 18, 2005 3:17 PM
To: [email protected]
Subject: TypeSystemHolder does not exist errors

 

I am having the same problem as the user in thread http://www.mail-archive.com/[email protected]/msg07530.html

I added the latest Xerces jars to my 1.4.2_09 jre/lib/endorsed dir (had to make it first) and I still have the same symptoms.  Basically lots of compiler errors like the following when I use the ant task to generate and compile the bindings:

 [xmlbeans] C:\RAD_workspaces\workspace2\app_project\src\generated\xmlb
eans\com\foo\xmlSchemas\eai\blueValidateGrpAndPcpReq\BlueValidateGrpA
ndPcpParmsDocument.java:19: package schemaorg_apache_xmlbeans.system.sD17B886B7C
6CB4F491C29457F4383A81.TypeSystemHolder does not exist
 [xmlbeans]     public static final org.apache.xmlbeans.SchemaType type = (org.a
pache.xmlbeans.SchemaType)schemaorg_apache_xmlbeans.system.sD17B886B7C6CB4F491C2
9457F4383A81.TypeSystemHolder.typeSystem.resolveHandle("bluevalidategrpandpc
pparms8c1adoctype");
 [xmlbeans]

                             ^


The ant task I'm using to build this looks like this:

        <taskdef name="xmlbeans"
            classname="org.apache.xmlbeans.impl.tool.XMLBean ">
            <classpath>
                <path refid="xml-beans.classpath" />
            </classpath>
        </taskdef>

        <xmlbeans schema="${ src.xsd}"
                  srcgendir="${target.xml-beans}"
                  destfile="../lib/member-magna-xmlbeans.jar"
                  debug="true">
            <classpath>
                <path refid="xml-beans.classpath" />
            </classpath>
        </xmlbeans>

with classpath of

    <path id="xml-beans.classpath">
        <fileset dir="${xml-beans.lib.dir}">
            <include name="*.jar" />
        </fileset>
    </path>

Any ideas?


Reply via email to