You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Frank Budinsky (JIRA)" <tu...@ws.apache.org> on 2007/03/30 20:21:27 UTC

[jira] Commented: (TUSCANY-1196) java.lang.ClassCastException org.eclipse.emf.ecore.impl.DynamicEObjectImpl incompatible with commonj.sdo.DataObject

    [ https://issues.apache.org/jira/browse/TUSCANY-1196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12485596 ] 

Frank Budinsky commented on TUSCANY-1196:
-----------------------------------------

I looked at it a little and noticed that the problem is that when an XSD type is unresolved XSDEcoreBuilder.getEffectiveTypeDefinition() will return null, but we haven't guarded against null everywhere we should in our subclass (SDOXSDEcoreBuilder).

If you put a breakpoint on line 1328 of BaseSDOXSDEcoreBuilder:

  protected EStructuralFeature createFeature
   (EClass eClass, XSDElementDeclaration xsdElementDeclaration, String name, XSDComponent xsdComponent, int minOccurs, int maxOccurs)
  {
    XSDTypeDefinition elementTypeDefinition = getEffectiveTypeDefinition(xsdComponent, xsdElementDeclaration);
    EClassifier eClassifier = getEClassifier(elementTypeDefinition); <--- breakpoint on this line
    ...

You'll see that sometimes getEffectiveTypeDefinition() returns null, and that our override of getEClassifier() in SDOXSDEcoreBuilder will then have a NullPointerException.

I'm too busy with other things right now to finish this, so it would be much appreciated if you could try to fix up the places with this problem and see if you can get the test case working.

Thanks,
Frank.

> java.lang.ClassCastException org.eclipse.emf.ecore.impl.DynamicEObjectImpl incompatible with commonj.sdo.DataObject
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: TUSCANY-1196
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1196
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-SDO-M3
>         Environment: M3 release candidate 1. Modified version as described by Frank Budinsky: http://www.mail-archive.com/tuscany-user%40ws.apache.org/msg00754.html
>            Reporter: Christian Landbo Frederiksen
>         Attachments: TestSDOErronousSchemaReferences.java
>
>
> First reported here: http://www.mail-archive.com/tuscany-user%40ws.apache.org/msg00758.html
> When a schema with an invalid reference to another schema is defined it causes an IllegalArgumentException. If the same helperContext is later used to define another schema and then attempting to create using DataFactory causes a ClassCastException - though nothing is wrong with the second schema (passes define - create fails).
> The attached JUnit testcase illustrates the problem

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org