You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Jay Dickon Glanville <di...@gmail.com> on 2006/03/09 19:00:29 UTC

do I have to use the scomp to generate classes?

Hello all.

I have a situation here that I'd a little confused about.

Do I have to use the schema compiler from XmlBeans to compile the java
files into classes or can I use any compiler?

The reason I ask this is because I'm using the scomp ant task to
generate just the java files, and then using my IDE's compiler to
compile them within my project.  So, my ant task looks something like
this:

        <xmlbean
            schema="schema_file.xsd"
            srconly="true"
            srcgendir="src"
            javasource="1.5"
            />

It produces java files no problem.  My IDE then compiles them without
complaint.  The problem is that when I try and run my application that
uses this code, I get ClassNotFoundException (the full stack trace is
included at the end of the email).

Now, when I use scomp to generate the full set (java, class and jar),
I have no problems at all.

Is this because the compiler in scomp is including things in my
classes that a regular compiler wouldn't?  Why does compiling
internally create a different result then compiling externally?

Thanks

JDG

Stack Trace:

Exception in thread "main" java.lang.ExceptionInInitializerError
	at org.xmlsoap.schemas.soap.envelope.EnvelopeDocument$Factory.parse(EnvelopeDocument.java:59)
	at com.nci.cv_02_08.ReadResponseTest.main(ReadResponseTest.java:11)
Caused by: java.lang.RuntimeException: Cannot load SchemaTypeSystem.
Unable to load class with name
schemaorg_apache_xmlbeans.system.s88F62AE3CA8827E50A463322427D3BC8.TypeSystemHolder.
Make sure the generated binary files are on the classpath.
	at org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(XmlBeans.java:781)
	at org.xmlsoap.schemas.soap.envelope.EnvelopeDocument.<clinit>(EnvelopeDocument.java:20)
	... 2 more
Caused by: java.lang.ClassNotFoundException:
schemaorg_apache_xmlbeans.system.s88F62AE3CA8827E50A463322427D3BC8.TypeSystemHolder
	at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
	at org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(XmlBeans.java:767)
	... 3 more

--
Jay Dickon Glanville

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org