users@jaxb.java.net

Only run under debug mode ? Help!!

From: Yi Wasser <yi_wasser_at_FREENET.DE>
Date: Fri, 30 May 2003 12:31:50 -0600

Hello All,

A part of my schema look like this:

...
<!-- complexType definition for "datanetType"-->
<xsd:complexType name="datanetEntries">
 <xsd:sequence>
  <xsd:element name="SRC" type="SRCType"/>
  <xsd:element name="DES" type="DESType"/>
 </xsd:sequence>
</xsd:complexType>


<!-- complexType definition for "DESType"-->
<xsd:complexType name="DESType">
 <xsd:simpleContent>
  <xsd:extension base="xsd:unsignedShort">
   <xsd:attributeGroup ref="entryAttries"/>
  </xsd:extension>
 </xsd:simpleContent>
</xsd:complexType>

<!-- complexType definition for "SRCType"-->
<xsd:complexType name="SRCType">
 <xsd:simpleContent>
  <xsd:extension base="xsd:unsignedShort">
   <xsd:attributeGroup ref="entryAttries"/>
  </xsd:extension>
 </xsd:simpleContent>
</xsd:complexType>

<xsd:attributeGroup name="entryAttries">
 <xsd:attribute name="offset" type="xsd:unsignedShort" use="required"/>
 <xsd:attribute name="dataType" type="xsd:string" use="required"/>
 <xsd:attribute name="length" type="xsd:byte" use="required"/>
</xsd:attributeGroup>
...

JAXB can generate java interfaces from the schema and compile them successfully. But the program crashed and generated "segmentation fault" when it tried to create a JAXBContext instance with the call

JAXBContext jc = JAXBContext.newInstance( "t2" );

where "t2" is my temp directory for the JAXB generated interfaces. I tried to use the jdb debugger to see what happened, however, the problem then disappeared, the program run through and exit in normal mode.

And if I removed the complexType "datanetEntries" from the schema, then it will also run without debugger. In fact, I am in such a situation now --- as long as I add a bit more types in my schema, it will crash before the JAXBContext new instance created. But if I run with debugger, then it works. It actually also runs under Oracle's java IDE "JBUILDER"--with same version jdk interpreter and same environment. The only difference is runtime environment library. But after some tests, I am quite sure it is not the reason. But somehow, if I execute the program under the jdb debugger or under "JBUILDER" IDE, I got more information than I execute the program directly from the shell. e.g. I also encountered the case that under JBUILDER the program caught an unmarshal error but under shell, it only generated the annoying "segmentaion fault".

I really have no idea what is really going on. Can anybody help?


By the way, the current project I am working on is under Linux, and I am using jdk1.3.1_04. Is it the reason ?

Thanks in advance!
Yi Wasser