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 error running 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\Axis2Sample>java -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.(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 generated code 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\code>java -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.LoginDocu
RE: problem with WSDL2Java generated code
I am getting the same error running 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\Axis2Sample>java -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.(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 generated code 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\code>java -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.(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
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 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: http://www.w3.org/2001/XMLSchema"; targetNamespace="http://nextgen.ubc/schema/Dictionary"; xmlns:dict="http://nextgen.ubc/schema/Dictionary";> 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";> http://nextgen.ubc/schema/Dictionary"; schemaLocation="Dictionary.xsd"/> http://www.w3.org/2001/XMLSchema"; targetNamespace="http://nextgen.ubc/schema/Address"; xmlns:addr="http://nextgen.ubc/schema/Address"; xmlns:dict="http://nextgen.ubc/schema/Dictionary";> http://nextgen.ubc/schema/Dictionary"; schemaLocation="Dictionary.xsd"/> maxOccurs="1"/> http://www.w3.org/2001/XMLSchema"; targetNamespace="http://nextgen.ubc/schema/StandardError"; xmlns:err="http://nextgen.ubc/schema/StandardError"; xmlns:dict="http://nextgen.ubc/schema/Dictionary";> http://nextgen.ubc/schema/Dictionary"; schemaLocation="Dictionary.xsd"/> -- This is my wsdl file: xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding"; xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; xmlns:key="http://nextgen.ubc/schema/StudentKey"; xmlns:addr="http://nextgen.ubc/schema/Address"; xmlns:err="http://nextgen.ubc/schema/StandardError"; xmlns:service="http://nextgen.ubc/wsdl/AddressRetrieval"; targetNamespace="http://nextgen.ubc/wsdl/AddressRetrieval";> http://nextgen.ubc/schema/StudentKey"; schemaLocation="../schemas/StudentKey.xsd"/> http://nextgen.ubc/schema/Address"; schemaLocation="../schemas/Address.xsd"/> http://nextgen.ubc/schema/StandardError"; schemaLocation="../schemas/StandardError.xsd"/> type="service:AddressRetrieval"> transport="http://schemas.xmlsoap.org/soap/http"; /> soapAction="http://nextgen.ubc/wsdl/operation/getAddress"; /> name="AddressRetrieval"> location="http://www4.students.ubc.ca:9180/axis2/services/AddressRetrievalService"; /> - These are my dto classes: package ubc.nextgen.dto; public class StudentKey { private String studentNumber = null; private StudentKey() {} // required by jibx compiler public StudentKey(Str