For input like this:

  ...
  <xsd:complexType name="complexType-complex-rest.">
    <xsd:complexContent>
      <xsd:extension base="xsd:anyType">
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  ...

JaxMeXS crashes with an internal IllegalStateException, saying:

  ... The builtin type {http://www.w3.org/2001/XMLSchema}anyType does
  not have an inner instance of XsComplexContentType.


Attached in a test program the demonstrates the problem.

This applies to JaxMeXS in JaxMe 0.3.1, 0.4 beta, and the current
CVS version (as of 2005-05-16).


Daniel

package test;

import org.apache.ws.jaxme.xs.*;
import org.apache.ws.jaxme.xs.parser.*;
import org.apache.ws.jaxme.xs.xml.*;
import org.xml.sax.*;
import javax.xml.parsers.ParserConfigurationException;


import java.io.*;

public class CheckBug_CrashComplexContentAnyType
{


    public static void main( String[] args )
        throws Exception
    {
        System.err.println( "Checking bug: ..." );
        String schemaContent =
            ""
            + "<?xml version=\"1.0\" encoding=\"UTF-8\"?> "
            + "<xsd:schema "
            + "  xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"; "
            + "  xmlns:xsdi=\"http://www.w3.org/2001/XMLSchema-instance\"; "
            + "  xsdi:schemaLocation=\"http://www.w3.org/2001/XMLSchema "
            + "  http://www.w3.org/2001/XMLSchema.xsd\"; "
            + "  > "
            + "  <xsd:complexType name=\"complexType-complex-rest.\"> "
            + "    <xsd:complexContent> "
            + "      <xsd:extension base=\"xsd:anyType\"> "
            + "      </xsd:extension> "
            + "    </xsd:complexContent> "
            + "  </xsd:complexType> "
            + " "
            + "</xsd:schema> "
            ;

            InputSource source = 
                new InputSource( new ByteArrayInputStream( 
                                     schemaContent.getBytes( "ASCII" ) ) );
            source.setSystemId( "someScheme://x/whatever");

            /**
               Symptom:  ???

             */
            XSParser parser = new XSParser();
            try {
                XSSchema schema = parser.parse( source );
                System.err.println( 
                    "bug seems to be fixed (doesn't crash with exception)" );
                
            }   
            catch ( Exception e ) {
                System.err.println( "e = " + e );
                System.err.println( "e.getClass() = " + e.getClass() );
                System.err.println( "e.toString() = " + e.toString() );
                System.err.println( "e.getMessage() = " + e.getMessage() );

                // Exception in thread "main" java.lang.IllegalStateException: 
The builtin type {http://www.w3.org/2001/XMLSchema}anyType does not have an 
inner instance of XsComplexContentType.
                if ( e.toString().equals( 
                         "java.lang.IllegalStateException: The builtin type 
{http://www.w3.org/2001/XMLSchema}anyType does not have an inner instance of 
XsComplexContentType."
                         ) ) {
                    System.err.println( "bug still exists" );
                }
                else {
                    System.err.println( 
                        "behavior has changed (but still getting exception)" );
                }
            }

                
    } // main(...)


} // class CheckBug_CrashComplexContentAnyType

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

Reply via email to