When you run WSDL2Java with xmlbeans, there will indeed be a
TypeSystemHolder class generated and you have to somehow get that
class into you classpath. From the codegen guide:

http://ws.apache.org/axis2/tools/1_0/CodegenToolReference.html

"An important detail is that an XMLBean class file is also generated
by WSDL2Java, TypeSystemHolder.class. That file is placed into
build/classes by the above ant task and will be needed to compile the
generated sources. A frequent problem is users get an error such as:

ClassNotFoundException : Cannot load SchemaTypeSystem. Unable to load
class with name
schemaorg_apache_xmlbeans.system.s68C41DB812F52C975439BA10FE4FEE54.TypeSystemHolder.
Make sure the generated binary files are on the classpath.

The TypeSystemHolder.class generated by WSDL2Java must be placed in
your classpath in order to avoid this error."

For example, when I run WSDL2Java, I do it thru an ant task:

<target name="wsdl2java" depends="clean,prepare">
     <delete dir="output" />
     <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
         <classpath refid="axis.classpath"/>
         <arg value="-d"/>
         <!-- none ??? -->
         <arg value="xmlbeans"/>
         <arg value="-uri"/>
         <arg file="wsdl/Maragato.wsdl"/>
         <arg value="-ss"/>
         <arg value="-ssi"/>
         <arg value="-g"/>
         <arg value="-sd"/>
         <arg value="-o"/>
         <arg file="output"/>
         <arg value="-p"/>
         <arg value="br.com.atlantico.maragato.webservices.endpoint"/>
     </java>

     <!-- Move the schema folder to classpath-->
     <move todir="${build.classes}">
         <fileset dir="output/resources">
             <include name="*schema*/**/*.class"/>
             <include name="*schema*/**/*.xsb"/>
         </fileset>
     </move>

 </target>

In this case, I get:

build/classes/schemaorg_apache_xmlbeans/system/sC4DADC577FF83F46C2C248EE4254F70D/TypeSystemHolder.class

I just confirmed that still works with todays svn.

HTH,
Robert
http://www.braziloutsource.com/

On 7/19/06, Derek <[EMAIL PROTECTED]> wrote:

Hi, folks.

I just ran WSDL2Java (from yesterday's nightly build), and generated a bunch
of output files. Now, I am trying to test a client which is written with
those output files. Whenever I try, however, I get the following exception:

Exception in thread "main" java.lang.ExceptionInInitializerError
        at
crc.ieee1512import.xmlbeans.im.IMWrapper$Factory.newInstance(IMWrapper.java:
79)
        at
crc.importtestclient.IEEE1512Client.createIMWrapper(IEEE1512Client.java:67)
        at
crc.importtestclient.IEEE1512Client.runTest(IEEE1512Client.java:50)
        at crc.importtestclient.ClientMain.main(ClientMain.java:39)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at
com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
Caused by: java.lang.RuntimeException: Cannot load SchemaTypeSystem. Unable
to load class with name
schemaorg_apache_xmlbeans.system.s3F178E0A50CC587BC745803A994CE78D.TypeSyste
mHolder. Make sure the generated binary files are on the classpath.
        at
org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(XmlBeans.java:781)
        at
crc.ieee1512import.xmlbeans.im.IMWrapper.<clinit>(IMWrapper.java:18)
        ... 9 more
Caused by: java.lang.ClassNotFoundException:
schemaorg_apache_xmlbeans.system.s3F178E0A50CC587BC745803A994CE78D.TypeSyste
mHolder
        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)
        ... 10 more

I have verified that the generated 'resources' directory is in my classpath.
I have also verified that there exists a subdirectory of it named
schemaorg_apache_xmlbeans/system/s3F178E0A50CC587BC745803A994CE78D. However,
there is no TypeSystemHolder class in that directory (although there are a
bunch of .xsb files in it).

I am rather flummoxed as to what to do. Has anybody seen this before?

Derek



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to