I know when this problem comes :
- If I have in my XML only one element from the group it works fine !
- If I have two element coming from the group then I have the stack
overflow

Let me explain what I do :

1. I generate classes from the schema :
      java -cp castor.jar;xerces.jar
org.exolab.castor.builder.SourceGenerator -i testgroup.xsd -types j2
-package com.pictet.apps.intranet.tests.castor
      castor.jar is the build made from the latest CVs version

2. I run the following code

      FileReader reader = new FileReader("D:\\castor\\testgroup.xml");
      // Marshal the person object
      TestGroupUser document
= (TestGroupUser)Unmarshaller.unmarshal(TestGroupUser.class, reader);
      System.out.println("id : "+document.getTestgroup().getCustomerid());
      System.out.println("ref : "+document.getTestgroup().getCustomerref
());

  using the file containing for the stack overflow BOTH customerid ans
customerref

      <?xml version="1.0" encoding="UTF-8"?>
      <TestGroupUser xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:noNamespaceSchemaLocation="D:\Castor\testgroup.xsd">
            <customerid>his id</customerid>
            <customerref>his ref</customerref>
            <teststring>sample string</teststring>
      </TestGroupUser>

Regards

Christopher

PS: Sorry to have sent the small xml not causing the exception




Hi Christophe,

I tried your schema and the following sample document with the current
CVS and it's working, so the problem appears fixed.

<?xml version="1.0"?>
<TestGroupUser>
   <customerid>customer1000</customerid>
   <teststring>foo bar</teststring>
</TestGroupUser>

So, unless I'm missing something it's been fixed.

Try using the CVS version.

--Keith




----------------------------------------------------------------
This document should only be read by those persons to whom it is
addressed  and  is  not intended to be relied upon by any person
without  subsequent written confirmation of its contents. If you
have  received  this  e-mail message in error, please destroy it
and delete it from your computer.
Any  form of  reproduction, dissemination, copying,  disclosure,
modification,  distribution  and/or  publication  of this E-mail
message is strictly prohibited.
----------------------------------------------------------------
Pictet & Cie, Banquiers                  Tel. +41 (0)58 323 2323
29, boulevard Georges-Favon              Fax  +41 (0)58 323 2324
CH-1204 GENEVE                            http://www.pictet.com/
----------------------------------------------------------------
*               NEW PHONE NUMBERS AS OF 1/1/2002!              *
*               NOUVEAUX NUMEROS DES LE 1/1/2002!              *
----------------------------------------------------------------

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to