Hello list,

I have a strange problem, and I'm not if this is a bug or my mistake. If
it is my mistake, please help me to find out what I am doing wrong.

As one of my types, I am extending gml:AbstractGMLType. Lets call it
"BuildingType". The created schema is checked and valid.

This is the problematic part:

<xs:element name="BuildingElement" type="myNS:ExampelType" />

<xs:complexType name="BuildingType">
   <xs:complexContent>
       <xs:extension base="gml:AbstractFeatureType">
           <xs:sequence>
               <xs:element name="someElement" type="xs:string" />
           </xs:sequence>
       </xs:extension>
   </xs:complexContent>
</xs:complexType>


If I look closer into the classes generated by xmlBeans, I can see that
my generated class (BuildingTypeImpl) extends AbstractGMLTypeImpl, which
extends XmlComplexContentImpl, and it is OK.

But, on calling Factory.getInstance() method, the
java.lang.reflect.InvocationTargetException is thrown. The reason is
that it tries to call the constructor declared as
BuildingTypeImpl.<init>(org.apache.xmlbeans.SchemaType, boolean), which
does not exist in this class or in generated superclasses.
There is only a constructor with single argument, of type
org.apache.xmlbeans.SchemaType.

Here is the stack trace:

Exception trying to instantiate impl class.
java.lang.reflect.InvocationTargetException
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
   at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
   at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
   at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
   at
org.apache.xmlbeans.impl.schema.SchemaTypeImpl.createUnattachedNode(SchemaTypeImpl.java:1859)
   at
org.apache.xmlbeans.impl.schema.SchemaTypeImpl.createTypeStoreUser(SchemaTypeImpl.java:1805)
   at org.apache.xmlbeans.impl.store.Xobj.setStableType(Xobj.java:1390)
   at org.apache.xmlbeans.impl.store.Cur.setType(Cur.java:2497)
   at org.apache.xmlbeans.impl.store.Cur.setType(Cur.java:2482)
   at org.apache.xmlbeans.impl.store.Locale.newInstance(Locale.java:630)
   at org.apache.xmlbeans.impl.store.Locale.newInstance(Locale.java:606)
   at
org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.newInstance(SchemaTypeLoaderBase.java:198)
   at de.tuHarburg.wb.kalypso.risk.schemata.floretoDataset.BuildingType
$Factory.newInstance(BuildingType.java:109)
   at de.tuHarburg.wb.floreto.test.TestFeature.main(TestFeature.java:18)
Caused by: java.lang.NoSuchMethodError:
net.opengis.gml.impl.AbstractGMLTypeImpl.<init>(Lorg/apache/xmlbeans/SchemaType;)V
   at
net.opengis.gml.impl.AbstractFeatureTypeImpl.<init>(AbstractFeatureTypeImpl.java:19)
   at
de.tuHarburg.wb.kalypso.risk.schemata.floretoDataset.impl.BuildingTypeImpl.<init>(BuildingTypeImpl.java:19)
   ... 14 more
java.lang.NoSuchMethodException:
de.tuHarburg.wb.kalypso.risk.schemata.floretoDataset.impl.BuildingTypeImpl.<init>(org.apache.xmlbeans.SchemaType, boolean)
   at java.lang.Class.getConstructor0(Class.java:2723)
   at java.lang.Class.getDeclaredConstructor(Class.java:2002)
   at
org.apache.xmlbeans.impl.schema.SchemaTypeImpl.getJavaImplConstructor2(SchemaTypeImpl.java:1749)
   at
org.apache.xmlbeans.impl.schema.SchemaTypeImpl.createUnattachedSubclass(SchemaTypeImpl.java:1886)
   at
org.apache.xmlbeans.impl.schema.SchemaTypeImpl.createUnattachedNode(SchemaTypeImpl.java:1875)
   at
org.apache.xmlbeans.impl.schema.SchemaTypeImpl.createTypeStoreUser(SchemaTypeImpl.java:1805)
   at org.apache.xmlbeans.impl.store.Xobj.setStableType(Xobj.java:1390)
   at org.apache.xmlbeans.impl.store.Cur.setType(Cur.java:2497)
   at org.apache.xmlbeans.impl.store.Cur.setType(Cur.java:2482)
   at org.apache.xmlbeans.impl.store.Locale.newInstance(Locale.java:630)
   at org.apache.xmlbeans.impl.store.Locale.newInstance(Locale.java:606)
   at
org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.newInstance(SchemaTypeLoaderBase.java:198)
   at de.tuHarburg.wb.kalypso.risk.schemata.floretoDataset.BuildingType
$Factory.newInstance(BuildingType.java:109)
   at de.tuHarburg.wb.floreto.test.TestFeature.main(TestFeature.java:18)
java.lang.NoSuchMethodException:
net.opengis.gml.impl.AbstractFeatureTypeImpl.<init>(org.apache.xmlbeans.SchemaType, boolean)
   at java.lang.Class.getConstructor0(Class.java:2723)
   at java.lang.Class.getDeclaredConstructor(Class.java:2002)
   at
org.apache.xmlbeans.impl.schema.SchemaTypeImpl.getJavaImplConstructor2(SchemaTypeImpl.java:1749)
   at
org.apache.xmlbeans.impl.schema.SchemaTypeImpl.createUnattachedSubclass(SchemaTypeImpl.java:1886)
   at
org.apache.xmlbeans.impl.schema.SchemaTypeImpl.createUnattachedNode(SchemaTypeImpl.java:1875)
   at
org.apache.xmlbeans.impl.schema.SchemaTypeImpl.createTypeStoreUser(SchemaTypeImpl.java:1805)
   at org.apache.xmlbeans.impl.store.Xobj.setStableType(Xobj.java:1390)
   at org.apache.xmlbeans.impl.store.Cur.setType(Cur.java:2497)
   at org.apache.xmlbeans.impl.store.Cur.setType(Cur.java:2482)
   at org.apache.xmlbeans.impl.store.Locale.newInstance(Locale.java:630)
   at org.apache.xmlbeans.impl.store.Locale.newInstance(Locale.java:606)
   at
org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.newInstance(SchemaTypeLoaderBase.java:198)
   at de.tuHarburg.wb.kalypso.risk.schemata.floretoDataset.BuildingType
$Factory.newInstance(BuildingType.java:109)
   at de.tuHarburg.wb.floreto.test.TestFeature.main(TestFeature.java:18)
java.lang.NoSuchMethodException:
net.opengis.gml.impl.AbstractGMLTypeImpl.<init>(org.apache.xmlbeans.SchemaType, boolean)
   at java.lang.Class.getConstructor0(Class.java:2723)
   at java.lang.Class.getDeclaredConstructor(Class.java:2002)
   at
org.apache.xmlbeans.impl.schema.SchemaTypeImpl.getJavaImplConstructor2(SchemaTypeImpl.java:1749)
   at
org.apache.xmlbeans.impl.schema.SchemaTypeImpl.createUnattachedSubclass(SchemaTypeImpl.java:1886)
   at
org.apache.xmlbeans.impl.schema.SchemaTypeImpl.createUnattachedNode(SchemaTypeImpl.java:1875)
   at
org.apache.xmlbeans.impl.schema.SchemaTypeImpl.createTypeStoreUser(SchemaTypeImpl.java:1805)
   at org.apache.xmlbeans.impl.store.Xobj.setStableType(Xobj.java:1390)
   at org.apache.xmlbeans.impl.store.Cur.setType(Cur.java:2497)
   at org.apache.xmlbeans.impl.store.Cur.setType(Cur.java:2482)
   at org.apache.xmlbeans.impl.store.Locale.newInstance(Locale.java:630)
   at org.apache.xmlbeans.impl.store.Locale.newInstance(Locale.java:606)
   at
org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.newInstance(SchemaTypeLoaderBase.java:198)
   at de.tuHarburg.wb.kalypso.risk.schemata.floretoDataset.BuildingType
$Factory.newInstance(BuildingType.java:109)
   at de.tuHarburg.wb.floreto.test.TestFeature.main(TestFeature.java:18)




This happens regardless if I use scomp or Ant build, if I generate GML
types first and than my types or if I compile all together. I tried with
XmlBeans 2.3 and 2.4. Version 2.5 fails to compile because of
"generatedSetterHelperImpl()" problem.


Best regards,
Dejan


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: user-h...@xmlbeans.apache.org

Reply via email to