problem with WSDL2Java generated code
I have generatedcode using wsdl2java. Then I wrote a Client.java to call web service, while excuting the client I get ClassNotFoundException in LoginDocument.java class which is generated by wsdl2java "schemaorg_apache_xmlbeans.system.s28FB12A440F78A928205C7E789D0196A.TypeSystemHolder" C:\work\os-ag-onbank1\codejava -cp build\classes;C:\software\axis2\lib\axis2-kernel-SNAPSHOT.jar;C:\software\axis2\lib\xbean-2.2.0.jar;.;C:\software\axis2\lib\axiom-api-1.1.1.jar;C:\software\axis2\lib\stax-api-1.0.1.jar;C:\software\axis2\lib\wsdl4j-1.6.1.jar;C:\software\axis2\lib\XmlSchema-SNAPSHOT.jar;C:\software\axis2\lib\commons-logging-1.1.jar;C:\software\axis2\lib\neethi-SNAPSHOT.jar;C:\software\axis2\lib\stax-1.2.0.jar;C:\software\axis2\lib\axiom-impl-1.1.1.jar;C:\software\axis2\lib\xbean-2.2.0.jar;ClientException in thread "main" java.lang.ExceptionInInitializerError at com.example.www.onlinebanking.xsd.LoginDocument$Factory.newInstance(LoginDocument.java:112) at Client.login(Client.java:40) at Client.main(Client.java:17)Caused by: java.lang.RuntimeException: Cannot load SchemaTypeSystem. Unable to load class with name schemaorg_apache_xmlbeans.system.s28FB12A440F78A928205C7E789D0196A.TypeSystemHolder. Make sure the generated binary files are on the classpath. at org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(XmlBeans.java:783) at com.example.www.onlinebanking.xsd.LoginDocument.clinit(LoginDocument.java:19) ... 3 moreCaused by: java.lang.ClassNotFoundException: schemaorg_apache_xmlbeans.system.s28FB12A440F78A928205C7E789D0196A.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:769) ... 4 more any help will be appreciated. thanx -yogen NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.
RE: problem with WSDL2Java generated code
I am getting the same errorrunning client for Axis2SampleDocLitService WSDL as well. The client code looks like this: import org.apache.axis2.userguide.xsd.*;import org.apache.axis2.userguide.xsd.impl.*;import com.sample.*; import java.util.*; public class Client{ public static void main(java.lang.String args[]){ Axis2SampleDocLitServiceStub stub = null; try{ stub = new Axis2SampleDocLitServiceStub(null, "http://localhost:8080/axis2/services/Axis2SampleDocLitService"); echoString(stub); } catch(Exception e){ e.printStackTrace(); } } public static String echoString(Axis2SampleDocLitServiceStub stub){ try{ EchoStringParamDocument reqDoc00 = EchoStringParamDocument.Factory.newInstance(); reqDoc00.setEchoStringParam("echo"); EchoStringReturnDocument resDoc00 = stub.echoString(reqDoc00); return resDoc00.getEchoStringReturn(); } catch(Exception e){ e.printStackTrace(); } return null; } } The runtime exception is: C:\work\Axis2Samplejava -cp build\classes;C:\software\axis2\lib\axis2-kernel-SNAPSHOT.jar;C:\software\axis2\lib\xbean-2.2.0.jar;.;C:\software\axis2\lib\axiom-api-1.1.1.jar;C:\software\axis2\lib\stax-api-1.0.1.jar;C:\software\axis2\lib\wsdl4j-1.6.1.jar;C:\software\axis2\lib\XmlSchema-SNAPSHOT.jar;C:\software\axis2\lib\commons-logging-1.1.jar;C:\software\axis2\lib\neethi-SNAPSHOT.jar;C:\software\axis2\lib\stax-1.2.0.jar;C:\software\axis2\lib\axiom-impl-1.1.1.jar;C:\software\axis2\lib\xbean-2.2.0.jar;ClientException in thread "main" java.lang.ExceptionInInitializerError at org.apache.axis2.userguide.xsd.EchoStringParamDocument$Factory.newInstance(EchoStringParamDocument.java:50) at Client.echoString(Client.java:23) at Client.main(Client.java:15)Caused by: java.lang.RuntimeException: Cannot load SchemaTypeSystem. Unable to load class with name schemaorg_apache_xmlbeans.system.s0C55B8F5926240E3576E190A4CD282A2.TypeSystemHolder. Make sure the generated binary files are on the classpath. at org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(XmlBeans.java:783) at org.apache.axis2.userguide.xsd.EchoStringParamDocument.clinit(EchoStringParamDocument.java:19) ... 3 moreCaused by: java.lang.ClassNotFoundException: schemaorg_apache_xmlbeans.system.s0C55B8F5926240E3576E190A4CD282A2.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:769) ... 4 more What am I doing wrong ? From: Yadav, Yogendra (IT) Sent: Wednesday, October 04, 2006 1:13 PMTo: axis-user@ws.apache.orgSubject: problem with WSDL2Java generated code I have generatedcode using wsdl2java. Then I wrote a Client.java to call web service, while excuting the client I get ClassNotFoundException in LoginDocument.java class which is generated by wsdl2java "schemaorg_apache_xmlbeans.system.s28FB12A440F78A928205C7E789D0196A.TypeSystemHolder" C:\work\os-ag-onbank1\codejava -cp build\classes;C:\software\axis2\lib\axis2-kernel-SNAPSHOT.jar;C:\software\axis2\lib\xbean-2.2.0.jar;.;C:\software\axis2\lib\axiom-api-1.1.1.jar;C:\software\axis2\lib\stax-api-1.0.1.jar;C:\software\axis2\lib\wsdl4j-1.6.1.jar;C:\software\axis2\lib\XmlSchema-SNAPSHOT.jar;C:\software\axis2\lib\commons-logging-1.1.jar;C:\software\axis2\lib\neethi-SNAPSHOT.jar;C:\software\axis2\lib\stax-1.2.0.jar;C:\software\axis2\lib\axiom-impl-1.1.1.jar;C:\software\axis2\lib\xbean-2.2.0.jar;ClientException in thread "main" java.lang.ExceptionInInitializerError at com.example.www.onlinebanking.xsd.LoginDocument$Factory.newInstance(LoginDocument.java:112) at Client.login(Client.java:40) at Client.main(Client.java:17)Caused by: java.lang.RuntimeException: Cannot load SchemaTypeSystem. Unable to load class with name schemaorg_apache_xmlbeans.system.s28FB12A440F78A928205C7E789D0196A.TypeSystemHolder. Make sure the generated binary files are on the classpath. at org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(XmlBeans.java:783) at com.example.www.onlinebanking.xsd.LoginDocument.clinit(LoginDocument.java:19) ... 3 moreCaused by: java.lang.ClassNotFoundException: schemaorg_apache_xmlbeans.system.s28FB12A440F78A928205C7E789D0196A.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.typeSystemForCl
RE: problem with WSDL2Java generated code
never mind resolved: included resource directory generated by wsdl2java in the classpath From: Yadav, Yogendra (IT) Sent: Wednesday, October 04, 2006 3:40 PMTo: axis-user@ws.apache.orgSubject: RE: problem with WSDL2Java generated code I am getting the same errorrunning client for Axis2SampleDocLitService WSDL as well. The client code looks like this: import org.apache.axis2.userguide.xsd.*;import org.apache.axis2.userguide.xsd.impl.*;import com.sample.*; import java.util.*; public class Client{ public static void main(java.lang.String args[]){ Axis2SampleDocLitServiceStub stub = null; try{ stub = new Axis2SampleDocLitServiceStub(null, "http://localhost:8080/axis2/services/Axis2SampleDocLitService"); echoString(stub); } catch(Exception e){ e.printStackTrace(); } } public static String echoString(Axis2SampleDocLitServiceStub stub){ try{ EchoStringParamDocument reqDoc00 = EchoStringParamDocument.Factory.newInstance(); reqDoc00.setEchoStringParam("echo"); EchoStringReturnDocument resDoc00 = stub.echoString(reqDoc00); return resDoc00.getEchoStringReturn(); } catch(Exception e){ e.printStackTrace(); } return null; } } The runtime exception is: C:\work\Axis2Samplejava -cp build\classes;C:\software\axis2\lib\axis2-kernel-SNAPSHOT.jar;C:\software\axis2\lib\xbean-2.2.0.jar;.;C:\software\axis2\lib\axiom-api-1.1.1.jar;C:\software\axis2\lib\stax-api-1.0.1.jar;C:\software\axis2\lib\wsdl4j-1.6.1.jar;C:\software\axis2\lib\XmlSchema-SNAPSHOT.jar;C:\software\axis2\lib\commons-logging-1.1.jar;C:\software\axis2\lib\neethi-SNAPSHOT.jar;C:\software\axis2\lib\stax-1.2.0.jar;C:\software\axis2\lib\axiom-impl-1.1.1.jar;C:\software\axis2\lib\xbean-2.2.0.jar;ClientException in thread "main" java.lang.ExceptionInInitializerError at org.apache.axis2.userguide.xsd.EchoStringParamDocument$Factory.newInstance(EchoStringParamDocument.java:50) at Client.echoString(Client.java:23) at Client.main(Client.java:15)Caused by: java.lang.RuntimeException: Cannot load SchemaTypeSystem. Unable to load class with name schemaorg_apache_xmlbeans.system.s0C55B8F5926240E3576E190A4CD282A2.TypeSystemHolder. Make sure the generated binary files are on the classpath. at org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(XmlBeans.java:783) at org.apache.axis2.userguide.xsd.EchoStringParamDocument.clinit(EchoStringParamDocument.java:19) ... 3 moreCaused by: java.lang.ClassNotFoundException: schemaorg_apache_xmlbeans.system.s0C55B8F5926240E3576E190A4CD282A2.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:769) ... 4 more What am I doing wrong ? From: Yadav, Yogendra (IT) Sent: Wednesday, October 04, 2006 1:13 PMTo: axis-user@ws.apache.orgSubject: problem with WSDL2Java generated code I have generatedcode using wsdl2java. Then I wrote a Client.java to call web service, while excuting the client I get ClassNotFoundException in LoginDocument.java class which is generated by wsdl2java "schemaorg_apache_xmlbeans.system.s28FB12A440F78A928205C7E789D0196A.TypeSystemHolder" C:\work\os-ag-onbank1\codejava -cp build\classes;C:\software\axis2\lib\axis2-kernel-SNAPSHOT.jar;C:\software\axis2\lib\xbean-2.2.0.jar;.;C:\software\axis2\lib\axiom-api-1.1.1.jar;C:\software\axis2\lib\stax-api-1.0.1.jar;C:\software\axis2\lib\wsdl4j-1.6.1.jar;C:\software\axis2\lib\XmlSchema-SNAPSHOT.jar;C:\software\axis2\lib\commons-logging-1.1.jar;C:\software\axis2\lib\neethi-SNAPSHOT.jar;C:\software\axis2\lib\stax-1.2.0.jar;C:\software\axis2\lib\axiom-impl-1.1.1.jar;C:\software\axis2\lib\xbean-2.2.0.jar;ClientException in thread "main" java.lang.ExceptionInInitializerError at com.example.www.onlinebanking.xsd.LoginDocument$Factory.newInstance(LoginDocument.java:112) at Client.login(Client.java:40) at Client.main(Client.java:17)Caused by: java.lang.RuntimeException: Cannot load SchemaTypeSystem. Unable to load class with name schemaorg_apache_xmlbeans.system.s28FB12A440F78A928205C7E789D0196A.TypeSystemHolder. Make sure the generated binary files are on the classpath. at org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(XmlBeans.java:783) at com.example.www.onlinebanking.xsd.LoginDocument.clinit(LoginDocument.java:19) ... 3 moreCaused by: java.lang.ClassNotFoundException: schemaorg_apache_xmlbeans.system.s28FB12A440F78A928205C7E789D0196A.TypeSystemHolder at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoa
Re: Problem with WSDL2Java Generated Code using JiBX bindings
Hi John, I'd suspect the problem here is in the use of a fault - this is something I hadn't tried out, and it looks like it's confusing things because of the special way Axis2 code generation handles the exception. I'm not even sure what's actually appropriate in this case - should your StandardError class actually be an exception, or should there be a generated exception class that has a StandardError field? In any case, you should enter this in Jira and attach the files. I'm hoping to get the code in place for unwrapping message elements using JiBX binding over the next week or so, and will try to get this fixed at the same time. Incidentally, you no longer need to supply default constructors in your data classes, you can instead use the add-constructors='true' attribute on your binding element (added as part of the JiBX 1.1 changes). Thanks for including JiBX in the subject line of your email. I don't try to follow all the Axis(1) messages on these lists, so unless the subject line mentions Axis2 or JiBX I'm probably not going to read it. - Dennis Dennis M. Sosnoski SOA, Web Services, and XML Training and Consulting http://www.sosnoski.com - http://www.sosnoski.co.nz Seattle, WA +1-425-296-6194 - Wellington, NZ +64-4-298-6117 John Grantham wrote: I wonder if anybody has encountered this issue, and might know if i am doing something wrong, or if this is a bug? I am using WSDL2Java, which works ok with regular ADB bindings. I want to use my own java value objects, however, and have been trying out JiBX. My jibx bindings test out ok, and the WSDL2Java code generation using jibx works somewhat, but it generates a MessageReceiverInOut class that has a compilation problem where it catches my custom exception and calls toOm(...). also, none of the /resources files are getting generated, including services.xml. intel mac Eclipse 3.2.0 java 1.5.0-06 jibx 1.1 Here are my schemas: ?xml version=1.0 encoding=UTF-8 ? xsd:schema xmlns:xsd=http://www.w3.org/2001/XMLSchema; targetNamespace=http://nextgen.ubc/schema/Dictionary; xmlns:dict=http://nextgen.ubc/schema/Dictionary; xsd:simpleType name=StudentNumber xsd:restriction base=xsd:string xsd:length value=8/ /xsd:restriction /xsd:simpleType xsd:simpleType name=LastName xsd:restriction base=xsd:string xsd:maxLength value=20/ /xsd:restriction /xsd:simpleType xsd:simpleType name=GivenName xsd:restriction base=xsd:string xsd:maxLength value=20/ /xsd:restriction /xsd:simpleType xsd:simpleType name=Program xsd:restriction base=xsd:string xsd:minLength value=2/ xsd:maxLength value=4/ /xsd:restriction /xsd:simpleType xsd:simpleType name=Campus xsd:restriction base=xsd:string xsd:enumeration value=VAN/ xsd:enumeration value=OKAN/ /xsd:restriction /xsd:simpleType xsd:simpleType name=Street xsd:restriction base=xsd:string xsd:maxLength value=30/ /xsd:restriction /xsd:simpleType xsd:simpleType name=City xsd:restriction base=xsd:string xsd:maxLength value=30/ /xsd:restriction /xsd:simpleType xsd:simpleType name=Province xsd:restriction base=xsd:string xsd:enumeration value=BC/ xsd:enumeration value=AB/ xsd:enumeration value=SK/ xsd:enumeration value=MB/ xsd:enumeration value=ON/ xsd:enumeration value=PQ/ xsd:enumeration value=NB/ xsd:enumeration value=NS/ xsd:enumeration value=PE/ xsd:enumeration value=NF/ xsd:enumeration value=YT/ xsd:enumeration value=NT/ /xsd:restriction /xsd:simpleType xsd:simpleType name=PostalCode xsd:restriction base=xsd:string xsd:pattern value=([A-Z]\d[A-Z]\d[A-Z]\d)/ /xsd:restriction /xsd:simpleType xsd:simpleType name=ErrorMessage xsd:restriction base=xsd:string xsd:maxLength value=30/ /xsd:restriction /xsd:simpleType xsd:simpleType name=ErrorCode xsd:restriction base=xsd:string xsd:length value=4/ /xsd:restriction /xsd:simpleType /xsd:schema ?xml version=1.0 encoding=UTF-8 ? xsd:schema xmlns:xsd=http://www.w3.org/2001/XMLSchema; targetNamespace=http://nextgen.ubc/schema/StudentKey; xmlns:key=http://nextgen.ubc/schema/StudentKey; xmlns:dict=http://nextgen.ubc/schema/Dictionary; xsd:import namespace=http://nextgen.ubc/schema/Dictionary; schemaLocation=Dictionary.xsd/ xsd:element name=StudentNumber type=dict:StudentNumber/ xsd:element name=StudentKey xsd:complexType xsd:sequence xsd:element ref=key:StudentNumber minOccurs=1 maxOccurs=1/ /xsd:sequence /xsd:complexType /xsd:element /xsd:schema ?xml version=1.0 encoding=UTF-8 ? xsd:schema xmlns:xsd=http://www.w3.org/2001/XMLSchema; targetNamespace=http://nextgen.ubc/schema/Address; xmlns:addr=http://nextgen.ubc/schema/Address;