You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Christian Landbo Frederiksen (JIRA)" <tu...@ws.apache.org> on 2007/03/28 18:51:25 UTC

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

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


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


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

Posted by "Christian Landbo Frederiksen (JIRA)" <tu...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-1196?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christian Landbo Frederiksen updated TUSCANY-1196:
--------------------------------------------------

    Attachment: TestSDOErronousSchemaReferences.java

> 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


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

Posted by "Frank Budinsky (JIRA)" <tu...@ws.apache.org>.
    [ 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


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

Posted by "Frank Budinsky (JIRA)" <tu...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-1196?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Frank Budinsky resolved TUSCANY-1196.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: Java-SDO-M3

Fixed in revision 524792.

> 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
>             Fix For: Java-SDO-M3
>
>         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


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

Posted by "Christian Landbo Frederiksen (JIRA)" <tu...@ws.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-1196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12485723 ] 

Christian Landbo Frederiksen commented on TUSCANY-1196:
-------------------------------------------------------

I am still puzzled as to why this causes the ClassCast if the context is used again after the nullpointer. My solution for now is to create a new HelperContext - not being sure what the implication of this is when multiple defines may have occured in the now invalid helpercontext.

I'm also quite busy - as my deadline comes nearer and nearer. But if a timeslot should come up I'll try to debug this further. It is risky using a release candidate, but I like the fact that the helpercontext can be changed in case of error. 

And since I have no idea how to handle that fact that my schemas have remote references (still looking for some sort of caching functionality or someway to access them locally, though referenced remotely), I can't really use the M2 release.



> 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