Jakub Drulis created TUSCANY-4078: ------------------------------------- Summary: Inheritance problem when subtypes are in different namespaces Key: TUSCANY-4078 URL: https://issues.apache.org/jira/browse/TUSCANY-4078 Project: Tuscany Issue Type: Bug Components: Java SDO Tools Affects Versions: Java-SDO-1.1 Environment: Java 6, eclipse indigo, RHEL 6.3 Reporter: Jakub Drulis
NullPointerException is thrown during generating SDO Java classes from XSD when there is a specific situation in a XSD model that is there is more than one inheritance level for instance type TC extends TB and TB extends TA and additionally each of the classes (complexTypees) is in different package (namespace), for instance pa.TA, pb.TB, pc.TC (p is for package, T is for Type, and V is for ...) This might be a EMF bug (version 2.2.3). stderr: org.eclipse.emf.common.util.WrappedException: org.eclipse.emf.codegen.jet.JETException: InvocationTargetException at org.eclipse.emf.codegen.ecore.generator.AbstractGeneratorAdapter.generateJava(AbstractGeneratorAdapter.java:1046) at org.eclipse.emf.codegen.ecore.genmodel.generator.GenClassGeneratorAdapter.generateClass(GenClassGeneratorAdapter.java:147) at org.eclipse.emf.codegen.ecore.genmodel.generator.GenClassGeneratorAdapter.generateModel(GenClassGeneratorAdapter.java:107) at org.eclipse.emf.codegen.ecore.genmodel.generator.GenBaseGeneratorAdapter.doGenerate(GenBaseGeneratorAdapter.java:214) at org.eclipse.emf.codegen.ecore.generator.AbstractGeneratorAdapter.generate(AbstractGeneratorAdapter.java:275) at org.eclipse.emf.codegen.ecore.generator.Generator.generate(Generator.java:600) at org.eclipse.emf.codegen.ecore.generator.Generator.generate(Generator.java:512) at org.apache.tuscany.sdo.generate.JavaGenerator.generateFromGenModel(JavaGenerator.java:531) at org.apache.tuscany.sdo.generate.JavaGenerator.generatePackages(JavaGenerator.java:413) at org.apache.tuscany.sdo.generate.XSD2JavaGenerator.generateFromXMLSchema(XSD2JavaGenerator.java:212) at org.apache.tuscany.sdo.generate.XSD2JavaGenerator.run(XSD2JavaGenerator.java:148) at org.apache.tuscany.sdo.generate.XSD2JavaGenerator.main(XSD2JavaGenerator.java:97) at pl.raiffeisen.esb.catalog.tools.XSD2SDO.main(XSD2SDO.java:53) Caused by: org.eclipse.emf.codegen.jet.JETException: InvocationTargetException at org.eclipse.emf.codegen.jet.JETEmitter.generate(JETEmitter.java:396) at org.eclipse.emf.codegen.ecore.generator.AbstractGeneratorAdapter.generateJava(AbstractGeneratorAdapter.java:937) ... 12 more Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.eclipse.emf.codegen.jet.JETEmitter.generate(JETEmitter.java:388) ... 13 more Caused by: java.lang.NullPointerException at org.eclipse.emf.codegen.ecore.genmodel.impl.GenBaseImpl.collectGenFeatures(GenBaseImpl.java:1353) at org.eclipse.emf.codegen.ecore.genmodel.impl.GenClassImpl.getAllGenFeatures(GenClassImpl.java:657) at org.eclipse.emf.codegen.ecore.genmodel.impl.GenClassImpl.getFeatureCount(GenClassImpl.java:826) at org.apache.tuscany.sdo.generate.templates.model.SDOClass.generate(SDOClass.java:1585) ... 18 more stdout: Generating SDO 1.1 from XSD file: /home/arekf/workspaces/catalog_bug/REB-Catalog-SDO-Java/../REB-Catalog-XSD//xsd/pl.company.xsd Args: [-targetDirectory, /home/arekf/workspaces/catalog_bug/REB-Catalog-SDO-Java/../REB-Catalog-SDO-Java//src-autogen, /home/arekf/workspaces/catalog_bug/REB-Catalog-SDO-Java/../REB-Catalog-XSD//xsd/pl.company.xsd] >> Generating code >> Generating packages >> Generating package CompanyPackageImpl >> Generating Java interface pl.company.CompanyFactory >> Generating /TargetProject/pl/company/CompanyFactory.java >> Generating Java class pl.company.impl.CompanyFactoryImpl >> Generating /TargetProject/pl/company/impl/CompanyFactoryImpl.java >> Generating Parent >> Generating Java interface pl.company.Parent >> Generating /TargetProject/pl/company/Parent.java >> Generating Java class pl.company.impl.ParentImpl >> Generating /TargetProject/pl/company/impl/ParentImpl.java Generating SDO 1.1 from XSD file: /home/arekf/workspaces/catalog_bug/REB-Catalog-SDO-Java/../REB-Catalog-XSD//xsd/operations.xsd Args: [-targetDirectory, /home/arekf/workspaces/catalog_bug/REB-Catalog-SDO-Java/../REB-Catalog-SDO-Java//src-autogen, /home/arekf/workspaces/catalog_bug/REB-Catalog-SDO-Java/../REB-Catalog-XSD//xsd/operations.xsd] >> Generating code >> Generating packages >> Generating package PlPackageImpl >> Generating Java interface pl.PlFactory >> Generating /TargetProject/pl/PlFactory.java >> Generating Java class pl.impl.PlFactoryImpl >> Generating /TargetProject/pl/impl/PlFactoryImpl.java >> Generating Grandparent >> Generating Java interface pl.Grandparent >> Generating /TargetProject/pl/Grandparent.java >> Generating Java class pl.impl.GrandparentImpl >> Generating /TargetProject/pl/impl/GrandparentImpl.java Generating SDO 1.1 from XSD file: /home/arekf/workspaces/catalog_bug/REB-Catalog-SDO-Java/../REB-Catalog-XSD//xsd/pl.xsd Args: [-targetDirectory, /home/arekf/workspaces/catalog_bug/REB-Catalog-SDO-Java/../REB-Catalog-SDO-Java//src-autogen, /home/arekf/workspaces/catalog_bug/REB-Catalog-SDO-Java/../REB-Catalog-XSD//xsd/pl.xsd] >> Generating code >> Generating packages >> Generating package PlPackageImpl >> Generating Java interface pl.PlFactory >> Generating /TargetProject/pl/PlFactory.java >> Examining old /TargetProject/pl/PlFactory.java >> Generating Java class pl.impl.PlFactoryImpl >> Generating /TargetProject/pl/impl/PlFactoryImpl.java >> Examining old /TargetProject/pl/impl/PlFactoryImpl.java >> Generating Grandparent >> Generating Java interface pl.Grandparent >> Generating /TargetProject/pl/Grandparent.java >> Examining old /TargetProject/pl/Grandparent.java >> Generating Java class pl.impl.GrandparentImpl >> Generating /TargetProject/pl/impl/GrandparentImpl.java >> Examining old /TargetProject/pl/impl/GrandparentImpl.java Generating SDO 1.1 from XSD file: /home/arekf/workspaces/catalog_bug/REB-Catalog-SDO-Java/../REB-Catalog-XSD//xsd/pl.company.esb.xsd Args: [-targetDirectory, /home/arekf/workspaces/catalog_bug/REB-Catalog-SDO-Java/../REB-Catalog-SDO-Java//src-autogen, /home/arekf/workspaces/catalog_bug/REB-Catalog-SDO-Java/../REB-Catalog-XSD//xsd/pl.company.esb.xsd] >> Generating code >> Generating packages >> Generating package EsbPackageImpl >> Generating Java interface pl.company.esb.EsbFactory >> Generating /TargetProject/pl/company/esb/EsbFactory.java >> Generating Java class pl.company.esb.impl.EsbFactoryImpl >> Generating /TargetProject/pl/company/esb/impl/EsbFactoryImpl.java >> Generating Child >> Generating Java interface pl.company.esb.Child >> Generating /TargetProject/pl/company/esb/Child.java >> Generating Java class pl.company.esb.impl.ChildImpl >> Generating /TargetProject/pl/company/esb/impl/ChildImpl.java -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira