2 Replies Latest reply on Jul 13, 2009 11:27 AM by jbalunas

    jsf2.0 cdk schema parsing and build dependencies

      Hi,

      I checked out jsf2.0 branch and ran a build to a "Failed to parse" on C:\JBoss\richfaces2\jsf2.0\cdk\generator\src\main\xsd\cdk.xsd.

      parsing a schema...
      [ERROR]null[54,50]
      org.xml.sax.SAXParseException: src-ct.2.1: Complex Type Definition Representation Error for type 'classnameType'. When <simpleContent> is used, the base type must be a complexType whose content type is simple, or, only if restriction is specified, a complex type with mixed content and emptiable particle, or, only if extension is specified, a simple type. 'javaType' satisfies none of these conditions.
       at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
       at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
       at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
       at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaErr(XSDHandler.java:2537)
       at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaError(XSDHandler.java:2528)
       at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDAbstractTraverser.reportSchemaError(XSDAbstractTraverser.java:706)
       at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDComplexTypeTraverser.handleComplexTypeError(XSDComplexTypeTraverser.java:1119)
       at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDComplexTypeTraverser.traverseComplexTypeDecl(XSDComplexTypeTraverser.java:285)
       at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDComplexTypeTraverser.traverseGlobal(XSDComplexTypeTraverser.java:160)
       at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.traverseSchemas(XSDHandler.java:1255)
       at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parseSchema(XSDHandler.java:579)
       at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:552)
       at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadGrammar(XMLSchemaLoader.java:519)
       at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadGrammar(XMLSchemaLoader.java:485)
       at com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory.newSchema(XMLSchemaFactory.java:210)
       at com.sun.tools.xjc.reader.xmlschema.parser.SchemaConstraintChecker.check(SchemaConstraintChecker.java:85)
       at com.sun.tools.xjc.ModelLoader.loadXMLSchema(ModelLoader.java:329)
       at com.sun.tools.xjc.ModelLoader.load(ModelLoader.java:145)
       at com.sun.tools.xjc.ModelLoader.load(ModelLoader.java:91)
       at com.sun.tools.xjc.Driver.run(Driver.java:287)
       at org.codehaus.mojo.jaxb2.XjcMojo.execute(XjcMojo.java:301)
       at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
       at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
       at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
       at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
       at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
       at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
       at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
      Failed to parse a schema.
      ------------------------------------------------------------------------
      


      I believe the "classnameType" needs to extend the simpleType javaType which holds the restriction rather than be a restriction itself extending a simpleType.
      A potential change that allows it to generate is in this patch:
      # This patch file was generated by NetBeans IDE
      # Following Index: paths are relative to: C:\JBoss\richfaces2\jsf2.0\cdk\generator\src\main\xsd
      # This patch can be applied using context Tools: Patch action on respective folder.
      # It uses platform neutral UTF-8 encoding and \n newlines.
      # Above lines and this line are ignored by the patching process.
      Index: cdk.xsd
      --- cdk.xsd Base (BASE)
      +++ cdk.xsd Locally Modified (Based On LOCAL)
      @@ -51,7 +51,7 @@
      
       <xsd:complexType name="classnameType">
       <xsd:simpleContent>
      - <xsd:restriction base="cdk:javaType"></xsd:restriction>
      \ No newline at end of file
      + <xsd:extension base="cdk:javaType"></xsd:extension>
      \ No newline at end of file
       </xsd:simpleContent>
       </xsd:complexType>
       </xsd:schema>
      
      if it accomplishes what is intended especially if the xsd:token base is what is needed.

      Build went further but ran into missing apache packages such as velocity package.

      If it is useful, ran a "mvn dependency:tree > rimcdk.dep" and put it up on sendspace at http://www.sendspace.com/file/q4z1t6

      however I get a different log error while building without the tree dependency turned on:
      
      org/richfaces/builder/generator/RendererCompilationContext.java:[24,26] package org.apache.velocity does not exist
      
      org/richfaces/templatecompiler/builder/AbstractCompilationContext.java:[36,35] package org.apache.commons.beanutils does not exist
      
      org/richfaces/templatecompiler/builder/AbstractCompilationContext.java:[37,35] package org.apache.commons.beanutils does not exist
      
      org/richfaces/templatecompiler/builder/AbstractCompilationContext.java:[38,33] package org.apache.commons.logging does not exist
      
      org/richfaces/templatecompiler/builder/AbstractCompilationContext.java:[39,33] package org.apache.commons.logging does not exist
      
      and more.