I was running into a different WSDL2Java CodeGenerationException while
working with nested binding files and a WSDL that uses nested schemas. 

Our WSDL is pretty simple and imports an external schema, but that schema is
fairly complex and includes of other schemas.  Also, our binding files are
pretty much tied to their respective schemas, so they are nested as well. 

To illustrate a simpler example of what we are trying to do, I modified
Dennis Sosnoski's "jibx-library" example
(http://www.sosnoski.com/jibx-wiki/space/axis2-jibx/example), eliminating
most functionality, adding a Subject object as an attribute to the Book
object, and added nested schema & binding files for BookInformation &
SubjectInformation.  I successfully tested the binding files by generating a
binding jar with org.jibx.binding.ant.CompileTask and using it to
unmarshalling XML into a Book object (which contains a Subject object) &
remartialling it back into XML ("ant build" & "ant run" with code in
simpleLibrary-bindingOnly.zip).  However, when I run ant in the example
("ant" with code in simpleLibrary.zip), WSDL2Java fails during the
generate-client target with the following exception (tested with both JiBX
1.1.3 & 1.1.5): 

generate-client: 
     [echo] Running WSDL2Java task 
     [mkdir] Created dir:
C:\development\examples\jibx-simpleLibrary\client\gen 
     [java] Retrieving schema at 'book.xsd', relative to
'file:/C:/development/examples/jibx-library/./'. 
     [java] Retrieving schema at 'subject.xsd', relative to
'file:/C:/development/examples/jibx-library/book.xsd'. 
     [java] Exception in thread "main"
org.apache.axis2.wsdl.codegen.CodeGenerationException:
java.lang.NullPointerException 
     [java]     at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:224)
 
     [java]     at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32) 
     [java]     at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21) 
     [java] Caused by: java.lang.NullPointerException 
     [java]     at
org.apache.axis2.jibx.CodeGenerationUtility.collectTopLevelComponents(CodeGenerationUtility.java:957)
 
     [java]     at
org.apache.axis2.jibx.CodeGenerationUtility.collectTopLevelComponents(CodeGenerationUtility.java:966)
 
     [java]     at
org.apache.axis2.jibx.CodeGenerationUtility.engage(CodeGenerationUtility.java:301)
 
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method) 
     [java]     at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
     [java]     at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 
     [java]     at java.lang.reflect.Method.invoke(Method.java:585) 
     [java]     at
org.apache.axis2.wsdl.codegen.extension.JiBXExtension.engage(JiBXExtension.java:74)
 
     [java]     at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:177)
 
     [java]     ... 2 more 

The binding files, schemas, wsdl, and updated source are attached.  Please
let me know if you see anything that may be causing the WSDL2Java exception.
http://www.nabble.com/file/p11199623/simpleLibrary.ZIP simpleLibrary.ZIP 
http://www.nabble.com/file/p11199623/simpleLibrary-bindingOnly.ZIP
simpleLibrary-bindingOnly.ZIP 

-- 
View this message in context: 
http://www.nabble.com/WSDL2Java-Exception-with-nested-binding---schema-files-tf3947855.html#a11199623
Sent from the Axis - User mailing list archive at Nabble.com.


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

Reply via email to