Cannot load SchemaTypeSystem

View: New views
3 Messages — Rating Filter:   Alert me  

Cannot load SchemaTypeSystem

by Wynand Vermeulen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,
 
I'm trying to get XMLBeans 2.4.0 to work in a standard Netbeans project. I have a built.xml file in my project directory, which contains ANT script to build the XMLBeans source. I get no errors while performing the build, but do get a runtime exeception "java.lang.RuntimeException: Cannot load SchemaTypeSystem. Unable to load class with name schemaorg_apache_xmlbeans.system.sBA558E54E426CCFF39A8E684578DC966.TypeSystemHolder. Make sure the generated binary files are on the classpath.".
 
I have been finecombing the documentation, and searching the web (and this list's archives) for days now and have found several of these types of messages reported, and usually the advice is to make sure the TypeSystemHolder.class is on the classpath. My ANT script stores the generated files in the project's build\classes folder, and directly after the build I can see that the class file and xsd files have been generated in the proper location, however for some strange reason once I run the application the TypeSystemHolder.class file disappears and the exception occurs!
 
I assume that everything in the build\classes folder is part of the classpath. If not, how do I add the schemaorg_apache_xmlbeans.system.sBA558E54E426CCFF39A8E684578DC966.TypeSystemHolder to the classpath in Netbeans? I've tried right clicking on the project, and adding the folder to the compile and runtime classpaths, and I've tried adding it to the classpath in the ANT script together with xbean.jar, but as then the compiler complains that the directory does not exist (since it has not yet been built).
 
 
     <taskdef name="xmlbean"
        classname="org.apache.xmlbeans.impl.tool.XMLBean"
        classpath="../3rd Party/xmlbeans-2.4.0/lib/jsr173.jar: ../3rd Party/xmlbeans-2.4.0/lib/xbean.jar" />
    <target name="-pre-compile">
        <antcall target="gen-schema2"/>
    </target>
    <target name="gen-schema">
        <xmlbean srconly="true"
            verbose="true"
            srcgendir="src"
            classgendir="build/classes"
            download="true"
            destfile="DeviceListXmlTypes.jar"
            schema="./src/CardWizard/resources/config/DeviceList.xsd"/>
    </target>
 
Please help, I really need to get XMLBeans working asap.
 
Kind Regards
Wynand

Re: Cannot load SchemaTypeSystem

by Jacob Danner-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If the file is present as a result of the ant build, I'd say the issue lay somewhere in your netbeans configuration.
Is there a reason you need the xmlbeans sources?
From your ant task it looks like you want the task to generate source (srcOnly) and a jar (destFile). I've only used the task with one or the other options specified.
There are several options for scomp output, but I think srconly overrides destfile.
-jacobd

On Sun, Sep 13, 2009 at 6:58 AM, Wynand Vermeulen <groendrakie@...> wrote:
Hello,
 
I'm trying to get XMLBeans 2.4.0 to work in a standard Netbeans project. I have a built.xml file in my project directory, which contains ANT script to build the XMLBeans source. I get no errors while performing the build, but do get a runtime exeception "java.lang.RuntimeException: Cannot load SchemaTypeSystem. Unable to load class with name schemaorg_apache_xmlbeans.system.sBA558E54E426CCFF39A8E684578DC966.TypeSystemHolder. Make sure the generated binary files are on the classpath.".
 
I have been finecombing the documentation, and searching the web (and this list's archives) for days now and have found several of these types of messages reported, and usually the advice is to make sure the TypeSystemHolder.class is on the classpath. My ANT script stores the generated files in the project's build\classes folder, and directly after the build I can see that the class file and xsd files have been generated in the proper location, however for some strange reason once I run the application the TypeSystemHolder.class file disappears and the exception occurs!
 
I assume that everything in the build\classes folder is part of the classpath. If not, how do I add the schemaorg_apache_xmlbeans.system.sBA558E54E426CCFF39A8E684578DC966.TypeSystemHolder to the classpath in Netbeans? I've tried right clicking on the project, and adding the folder to the compile and runtime classpaths, and I've tried adding it to the classpath in the ANT script together with xbean.jar, but as then the compiler complains that the directory does not exist (since it has not yet been built).
 
 
     <taskdef name="xmlbean"
        classname="org.apache.xmlbeans.impl.tool.XMLBean"
        classpath="../3rd Party/xmlbeans-2.4.0/lib/jsr173.jar: ../3rd Party/xmlbeans-2.4.0/lib/xbean.jar" />
    <target name="-pre-compile">
        <antcall target="gen-schema2"/>
    </target>
    <target name="gen-schema">
        <xmlbean srconly="true"
            verbose="true"
            srcgendir="src"
            classgendir="build/classes"
            download="true"
            destfile="DeviceListXmlTypes.jar"
            schema="./src/CardWizard/resources/config/DeviceList.xsd"/>
    </target>
 
Please help, I really need to get XMLBeans working asap.
 
Kind Regards
Wynand


Re: Cannot load SchemaTypeSystem

by tray2100 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hey I was just wondering if you ever resolved this problem .... I have the same issue. The one thing i've noticed though is that it has something to do with NetBeans and not ant. I modified the build file initially not specifying a namespace but later edited the file and added specified a namespace. when I build the project, the build/classes directory looks fine. If i run the app from the command line, everything works fine. If I use the run feature in netbeans, the TypeTypeSystemHolder file disappears from the schemaorg_apache_xmlbeans folder and a folder called noNamespace is generated (which was correct when I initially didn't specify a namespace).

Any ideas on how to resolve this problem?

Wynand Vermeulen wrote:
Hello,

I'm trying to get XMLBeans 2.4.0 to work in a standard Netbeans project. I
have a built.xml file in my project directory, which contains ANT script to
build the XMLBeans source. I get no errors while performing the build,
but do get a runtime exeception "java.lang.RuntimeException: Cannot load
SchemaTypeSystem. Unable to load class with name
schemaorg_apache_xmlbeans.system.sBA558E54E426CCFF39A8E684578DC966.TypeSystemHolder.
Make sure the generated binary files are on the classpath.".

I have been finecombing the documentation, and searching the web (and this
list's archives) for days now and have found several of these types of
messages reported, and usually the advice is to make sure the
TypeSystemHolder.class is on the classpath. My ANT script stores the
generated files in the project's build\classes folder, and directly after
the build I can see that the class file and xsd files have been generated in
the proper location, however for some strange reason once I run the
application the TypeSystemHolder.class file disappears and the exception
occurs!

I assume that everything in the build\classes folder is part of the
classpath. If not, how do I add the
schemaorg_apache_xmlbeans.system.sBA558E54E426CCFF39A8E684578DC966.TypeSystemHolder
to the classpath in Netbeans? I've tried right clicking on the project, and
adding the folder to the compile and runtime classpaths, and I've tried
adding it to the classpath in the ANT script together with xbean.jar, but as
then the compiler complains that the directory does not exist (since it has
not yet been built).

The ANT Script I use (based on tutorial at
http://lajavaloca.wordpress.com/2008/05/26/xmlbeans-with-netbeans-thats-a-lot-of-beans/
):

     <taskdef name="xmlbean"
        classname="org.apache.xmlbeans.impl.tool.XMLBean"
        classpath="../3rd Party/xmlbeans-2.4.0/lib/jsr173.jar: ../3rd
Party/xmlbeans-2.4.0/lib/xbean.jar" />
    <target name="-pre-compile">
        <antcall target="gen-schema2"/>
    </target>
    <target name="gen-schema">
        <xmlbean srconly="true"
            verbose="true"
            srcgendir="src"
            classgendir="build/classes"
            download="true"
            destfile="DeviceListXmlTypes.jar"
            schema="./src/CardWizard/resources/config/DeviceList.xsd"/>
    </target>

Please help, I really need to get XMLBeans working asap.

Kind Regards
Wynand