views:

273

answers:

1
java org.apache.axis2.wsdl.WSDL2Java -s -p studs.exchange -uri https://api.betfair.com/exchange/v5/BFExchangeService.wsdl


Retrieving document at 'https://api.betfair.com/exchange/v5/BFExchangeService.wsdl'.
log4j:WARN No appenders could be found for logger (org.apache.axis2.description.WSDL11ToAllAxisServicesBuilder).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
 at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:271)
 at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
 at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
 at org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage(SimpleDBExtension.java:53)
 at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:224)
 ... 2 more
Caused by: java.lang.reflect.InvocationTargetException
 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:597)
 at org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage(SimpleDBExtension.java:50)
 ... 3 more
Caused by: java.lang.NoSuchMethodError: org.apache.ws.commons.schema.XmlSchema.getTypeByName(Ljava/lang/String;)Lorg/apache/ws/commons/schema/XmlSchemaType;
 at org.apache.axis2.schema.SchemaCompiler.isComponetExists(SchemaCompiler.java:2728)
 at org.apache.axis2.schema.SchemaCompiler.getParentSchemaFromIncludes(SchemaCompiler.java:2670)
 at org.apache.axis2.schema.SchemaCompiler.getParentSchemaFromIncludes(SchemaCompiler.java:2704)
 at org.apache.axis2.schema.SchemaCompiler.getParentSchema(SchemaCompiler.java:2644)
 at org.apache.axis2.schema.SchemaCompiler.processElement(SchemaCompiler.java:758)
 at org.apache.axis2.schema.SchemaCompiler.processElement(SchemaCompiler.java:552)
 at org.apache.axis2.schema.SchemaCompiler.process(SchemaCompiler.java:1991)
 at org.apache.axis2.schema.SchemaCompiler.processParticle(SchemaCompiler.java:1874)
 at org.apache.axis2.schema.SchemaCompiler.processComplexType(SchemaCompiler.java:1081)
 at org.apache.axis2.schema.SchemaCompiler.processAnonymousComplexSchemaType(SchemaCompiler.java:980)
 at org.apache.axis2.schema.SchemaCompiler.processSchema(SchemaCompiler.java:934)
 at org.apache.axis2.schema.SchemaCompiler.processElement(SchemaCompiler.java:592)
 at org.apache.axis2.schema.SchemaCompiler.processElement(SchemaCompiler.java:563)
 at org.apache.axis2.schema.SchemaCompiler.compile(SchemaCompiler.java:370)
 at org.apache.axis2.schema.SchemaCompiler.compile(SchemaCompiler.java:280)
 at org.apache.axis2.schema.ExtensionUtility.invoke(ExtensionUtility.java:103)
 ... 8 more

whats is happening here? what about log4j

A: 

Don't worry about the Log4j stuff for the moment. That's simply telling you that the Log4j framework can't find its configuration. It'll run ok without it.

The important line is

Caused by: java.lang.NoSuchMethodError: org.apache.ws.commons.schema.XmlSchema.getTypeByName(Ljava/lang/String;)Lorg/apache/ws/commons/schema/XmlSchemaType;

which says to me that you have some library mismatch. You have some library in your classpath that doesn't match Axis' requirements (most probably an old version of the library). Check Axis' dependencies versus what you're running with (your JVM version and the libraries on your classpath).

Brian Agnew
ye, fixed it with a reinstall of libraries :D what about log4j? how can i fix that warning?
Daniel
You need to provide a log4j properties file or XML file with a config. I would check the Log4j doc.
Brian Agnew