You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Susan Liu <xi...@auto-trol.com> on 2005/01/17 17:02:26 UTC

[betwixt] Write XML Schema of a Cyclic Bean

I am trying to write xml schema for a cyclic Bean(A include B, B include A).

The Bean definition used LoopBean.java in the example:

public class LoopBean
{
   private static int count = 0;   
   private static final int max_count = 100;

   private LoopBean friend;
 
   private String name;
  .........................

}


The code to generate the XML Schema for this Bean: (from the example)

     SchemaTranscriber transcriber = new SchemaTranscriber();
 
transcriber.getXMLIntrospector().getConfiguration().setElementNameMapper(new
HyphenatedNameMapper());
 
transcriber.getXMLIntrospector().getConfiguration().setAttributeNameMapper(n
ew HyphenatedNameMapper());
 
transcriber.getXMLIntrospector().getConfiguration().setAttributesForPrimitiv
es(false);
 
transcriber.getXMLIntrospector().getConfiguration().setWrapCollectionsInElem
ent(false);
      //transcriber.getXMLIntrospector().setMapIDs(true);
      
      System.out.println("before generate schema:");
      Schema schema = transcriber.generate(LoopBean.class);

   .........................


A StackOverflowException was caught when executing the:
transcriber.generate(LoopBean.class).

Please help.

Susan 


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [betwixt] Write XML Schema of a Cyclic Bean

Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
hi susan

this sounds like a bug to me (the schema generation stuff is still  
experimental, i'm afraid).

if you'd be willing to create a unit test demonstrating this bug and  
contribute it to apache by attaching to a bugzilla report, it would  
greatly increase the chances of this being fixed promptly.

TIA

- robert

On 17 Jan 2005, at 16:02, Susan Liu wrote:

> I am trying to write xml schema for a cyclic Bean(A include B, B  
> include A).
>
> The Bean definition used LoopBean.java in the example:
>
> public class LoopBean
> {
>    private static int count = 0;
>    private static final int max_count = 100;
>
>    private LoopBean friend;
>
>    private String name;
>   .........................
>
> }
>
>
> The code to generate the XML Schema for this Bean: (from the example)
>
>      SchemaTranscriber transcriber = new SchemaTranscriber();
>
> transcriber.getXMLIntrospector().getConfiguration().setElementNameMappe 
> r(new
> HyphenatedNameMapper());
>
> transcriber.getXMLIntrospector().getConfiguration().setAttributeNameMap 
> per(n
> ew HyphenatedNameMapper());
>
> transcriber.getXMLIntrospector().getConfiguration().setAttributesForPri 
> mitiv
> es(false);
>
> transcriber.getXMLIntrospector().getConfiguration().setWrapCollectionsI 
> nElem
> ent(false);
>       //transcriber.getXMLIntrospector().setMapIDs(true);
>
>       System.out.println("before generate schema:");
>       Schema schema = transcriber.generate(LoopBean.class);
>
>    .........................
>
>
> A StackOverflowException was caught when executing the:
> transcriber.generate(LoopBean.class).
>
> Please help.
>
> Susan
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org