Hi Robin,

I did fix several issues with the schema generation in the process of 
getting this to work for the CodeGen customizations (since I wanted a 
schema for those, and ran into the issues when I tried generating one). 
I don't know if this includes your particular issue, though.

I've uploaded the very latest 1.2.2 code to 
http://jibx.sourceforge.net/jibx_1_2_2-SNAPSHOT.zip Could you give that 
a try to see if it works for your binding? And if not, create a Jira 
with an attached project to demonstrate the problem? That would be the 
easiest way to make sure it gets fixed.

Thanks,

  - Dennis

Dennis M. Sosnoski
XML and Web Services in Java
Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117



Robin M. Roos wrote:
> Hi Dennis
>
> I thought I'd try to get JiBX to generate a .XSD file from my 
> binding.   I understand SchemaGen can sometimes accomplish this, 
> but is not supported for all user-defined bindings.  I the 
> NullPointerException below in case it is easily resolved.
>
> I have two instances in my binding where a <collection> contains a 
> <structure>.  In each of these cases I get an NPE at at 
> org.jibx.schema.generator.SchemaGen.setDocumentation(SchemaGen.java:234). 
>  It occurs because the domain class to which the <structure> is 
> mapped does not appear in the Map m_classmap within class 
> PackageCustom.  So pack.get(classname) returns null, and 
> subsequently null.isUseJavaDocs() throws the NPE.
>
> Further details will be made available if required.
>
> Many thanks, Robin.
>
>
> My binding constructs are (these are just extracts):
>
> <mapping name="pointer" 
> class="net.uk.roos.configurator.server.domain.Pointer">
>         <value name="name" field="name"/>
>             <collection field="revIdAttributionList">
>                 <structure name="revId" 
> type="net.uk.roos.configurator.server.domain.RevIdAttribution">
>                     <value name="workstream" field="workstream" 
> style="attribute"/>
>                          <value field="revisionIdString" 
> style="text"/>
>                 </structure>
>             </collection>
>     </mapping>
>
> <mapping name="configurator" 
> class="net.uk.roos.configurator.server.domain.Configurator">
>         <collection field="environments" name="environments"/>
>         <collection field="workstreams" name="workstreams"/>
>         <collection field="pointers" name="pointers"/>
>         <collection field="issues" name="issues"/>
>         <collection field="workstreamConfig">
>             <structure name="revisions"  
> type="net.uk.roos.configurator.server.domain.WorkstreamSpecificConfiguration">
>                 <value name="workstream" field="workstreamName" 
> style="attribute"/>
>                 <collection field="revisions"/>
>             </structure>
>         </collection>
>     </mapping>
>
> And the NPEs are thrown during processing of the RevIdAttribution 
> and WorkstreamspecificConfiguration classes.
>
> My command-line arguments to SchemaGen are:
>
> -n uri=http://net.uk.roos.configurator.schema.1.0 -s 
> C:\projects\configurator\configurator\configurator-server\src\main\java 
> -v 
> C:\projects\configurator\configurator\configurator-server\src\main\config\binding.xml
>
> The console output and exception is as follows:
>
> Using class loading paths:
>  <snip>
> Using source loading paths:
>  C:\projects\configurator\configurator\configurator-server\src\main\java
> Starting from classes:
>  
> C:\projects\configurator\configurator\configurator-server\src\main\config\binding.xml
> Output to directory .
> Exception in thread "main" java.lang.NullPointerException
>       at 
> org.jibx.schema.generator.SchemaGen.setDocumentation(SchemaGen.java:234)
>       at 
> org.jibx.schema.generator.SchemaGen.addItemDocumentation(SchemaGen.java:283)
>       at 
> org.jibx.schema.generator.SchemaGen.fillAttributes(SchemaGen.java:804)
>       at 
> org.jibx.schema.generator.SchemaGen.buildElement(SchemaGen.java:508)
>       at 
> org.jibx.schema.generator.SchemaGen.buildCompositor(SchemaGen.java:609)
>       at 
> org.jibx.schema.generator.SchemaGen.buildCompositor(SchemaGen.java:621)
>       at 
> org.jibx.schema.generator.SchemaGen.buildComplexType(SchemaGen.java:896)
>       at 
> org.jibx.schema.generator.SchemaGen.addMapping(SchemaGen.java:1024)
>       at 
> org.jibx.schema.generator.SchemaGen.generate(SchemaGen.java:1061)
>       at org.jibx.schema.generator.SchemaGen.main(SchemaGen.java:1193)
> Disconnected from the target VM, address: '127.0.0.1:3774', 
> transport: 'socket'
>
> Process finished with exit code 1
>   
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
> trial. Simplify your report design, integration and deployment - and focus on 
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> ------------------------------------------------------------------------
>
> _______________________________________________
> jibx-users mailing list
> jibx-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jibx-users
>   

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to