You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Raymond Feng (JIRA)" <tu...@ws.apache.org> on 2006/03/10 18:43:38 UTC

[jira] Created: (TUSCANY-112) Generated SDO2 DataObject class throws ClassCastException when DataObject.getType() is called

Generated SDO2 DataObject class throws ClassCastException when DataObject.getType() is called
---------------------------------------------------------------------------------------------

         Key: TUSCANY-112
         URL: http://issues.apache.org/jira/browse/TUSCANY-112
     Project: Tuscany
        Type: Bug
  Components: Java SDO Implementation  
    Reporter: Raymond Feng
    Priority: Critical


These 4 lines of code will fail:

import org.apache.tuscany.model.scdl.Module;
import org.apache.tuscany.model.scdl.ScdlFactory;

Module module = ScdlFactory.INSTANCE.createModule();
Type type = ((DataObject) module).getType();

Exception in thread "main" java.lang.ClassCastException: org.eclipse.emf.ecore.impl.EClassImpl incompatible with commonj.sdo.Type
	at org.apache.tuscany.sdo.impl.DataObjectImpl.getType(DataObjectImpl.java:319)
	at org.apache.tuscany.axis2.stax.AxiomHelper.main(AxiomHelper.java:135)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (TUSCANY-112) Generated SDO2 DataObject class throws ClassCastException when DataObject.getType() is called

Posted by "Frank Budinsky (JIRA)" <tu...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/TUSCANY-112?page=comments#action_12369921 ] 

Frank Budinsky commented on TUSCANY-112:
----------------------------------------

Raymond, 

It is called in TypeHelper.INSTANCE or if you touch any SDO  Helper, but the problem is that you're example isn't touching any SDO code. It's just  using a generated class. Usually a client of generated classes registers the generated metadata first ... by calling SDOUtil.registerStaticTypes() ... and that also causes the SDO runtime initialization to happen as well. Maybe that's the "proper" way for you to do it.. Don't you need to register the metadata anyway?

Frank.


> Generated SDO2 DataObject class throws ClassCastException when DataObject.getType() is called
> ---------------------------------------------------------------------------------------------
>
>          Key: TUSCANY-112
>          URL: http://issues.apache.org/jira/browse/TUSCANY-112
>      Project: Tuscany
>         Type: Bug
>   Components: Java SDO Implementation
>     Reporter: Raymond Feng
>     Priority: Critical

>
> These 4 lines of code will fail:
> import org.apache.tuscany.model.scdl.Module;
> import org.apache.tuscany.model.scdl.ScdlFactory;
> Module module = ScdlFactory.INSTANCE.createModule();
> Type type = ((DataObject) module).getType();
> Exception in thread "main" java.lang.ClassCastException: org.eclipse.emf.ecore.impl.EClassImpl incompatible with commonj.sdo.Type
> 	at org.apache.tuscany.sdo.impl.DataObjectImpl.getType(DataObjectImpl.java:319)
> 	at org.apache.tuscany.axis2.stax.AxiomHelper.main(AxiomHelper.java:135)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (TUSCANY-112) Generated SDO2 DataObject class throws ClassCastException when DataObject.getType() is called

Posted by "Raymond Feng (JIRA)" <tu...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/TUSCANY-112?page=comments#action_12369903 ] 

Raymond Feng commented on TUSCANY-112:
--------------------------------------

Your code helps. Thanks.

Instead of asking users to call this initiailization , should it be called somethere in the bootstrap, for example, TypeHelper.INSTANCE?

> Generated SDO2 DataObject class throws ClassCastException when DataObject.getType() is called
> ---------------------------------------------------------------------------------------------
>
>          Key: TUSCANY-112
>          URL: http://issues.apache.org/jira/browse/TUSCANY-112
>      Project: Tuscany
>         Type: Bug
>   Components: Java SDO Implementation
>     Reporter: Raymond Feng
>     Priority: Critical

>
> These 4 lines of code will fail:
> import org.apache.tuscany.model.scdl.Module;
> import org.apache.tuscany.model.scdl.ScdlFactory;
> Module module = ScdlFactory.INSTANCE.createModule();
> Type type = ((DataObject) module).getType();
> Exception in thread "main" java.lang.ClassCastException: org.eclipse.emf.ecore.impl.EClassImpl incompatible with commonj.sdo.Type
> 	at org.apache.tuscany.sdo.impl.DataObjectImpl.getType(DataObjectImpl.java:319)
> 	at org.apache.tuscany.axis2.stax.AxiomHelper.main(AxiomHelper.java:135)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (TUSCANY-112) Generated SDO2 DataObject class throws ClassCastException when DataObject.getType() is called

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

Raymond Feng closed TUSCANY-112.
--------------------------------


> Generated SDO2 DataObject class throws ClassCastException when DataObject.getType() is called
> ---------------------------------------------------------------------------------------------
>
>                 Key: TUSCANY-112
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-112
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>            Reporter: Raymond Feng
>            Priority: Critical
>
> These 4 lines of code will fail:
> import org.apache.tuscany.model.scdl.Module;
> import org.apache.tuscany.model.scdl.ScdlFactory;
> Module module = ScdlFactory.INSTANCE.createModule();
> Type type = ((DataObject) module).getType();
> Exception in thread "main" java.lang.ClassCastException: org.eclipse.emf.ecore.impl.EClassImpl incompatible with commonj.sdo.Type
> 	at org.apache.tuscany.sdo.impl.DataObjectImpl.getType(DataObjectImpl.java:319)
> 	at org.apache.tuscany.axis2.stax.AxiomHelper.main(AxiomHelper.java:135)

-- 
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-112) Generated SDO2 DataObject class throws ClassCastException when DataObject.getType() is called

Posted by "Frank Budinsky (JIRA)" <tu...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/TUSCANY-112?page=all ]
     
Frank Budinsky resolved TUSCANY-112:
------------------------------------

    Resolution: Invalid

model registration is being addressed in TUSCANY-195.

> Generated SDO2 DataObject class throws ClassCastException when DataObject.getType() is called
> ---------------------------------------------------------------------------------------------
>
>          Key: TUSCANY-112
>          URL: http://issues.apache.org/jira/browse/TUSCANY-112
>      Project: Tuscany
>         Type: Bug

>   Components: Java SDO Implementation
>     Reporter: Raymond Feng
>     Priority: Critical

>
> These 4 lines of code will fail:
> import org.apache.tuscany.model.scdl.Module;
> import org.apache.tuscany.model.scdl.ScdlFactory;
> Module module = ScdlFactory.INSTANCE.createModule();
> Type type = ((DataObject) module).getType();
> Exception in thread "main" java.lang.ClassCastException: org.eclipse.emf.ecore.impl.EClassImpl incompatible with commonj.sdo.Type
> 	at org.apache.tuscany.sdo.impl.DataObjectImpl.getType(DataObjectImpl.java:319)
> 	at org.apache.tuscany.axis2.stax.AxiomHelper.main(AxiomHelper.java:135)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (TUSCANY-112) Generated SDO2 DataObject class throws ClassCastException when DataObject.getType() is called

Posted by "Raymond Feng (JIRA)" <tu...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/TUSCANY-112?page=comments#action_12370213 ] 

Raymond Feng commented on TUSCANY-112:
--------------------------------------

Should the SDO classes generated from Tuscany tools have the code to initialize it? I assume we should have the code generated in such a way.

Raymond

> Generated SDO2 DataObject class throws ClassCastException when DataObject.getType() is called
> ---------------------------------------------------------------------------------------------
>
>          Key: TUSCANY-112
>          URL: http://issues.apache.org/jira/browse/TUSCANY-112
>      Project: Tuscany
>         Type: Bug
>   Components: Java SDO Implementation
>     Reporter: Raymond Feng
>     Priority: Critical

>
> These 4 lines of code will fail:
> import org.apache.tuscany.model.scdl.Module;
> import org.apache.tuscany.model.scdl.ScdlFactory;
> Module module = ScdlFactory.INSTANCE.createModule();
> Type type = ((DataObject) module).getType();
> Exception in thread "main" java.lang.ClassCastException: org.eclipse.emf.ecore.impl.EClassImpl incompatible with commonj.sdo.Type
> 	at org.apache.tuscany.sdo.impl.DataObjectImpl.getType(DataObjectImpl.java:319)
> 	at org.apache.tuscany.axis2.stax.AxiomHelper.main(AxiomHelper.java:135)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Jira emails

Posted by Jim Marino <jm...@myroma.net>.
Does anyone know if we can get Jira to generate emails with the sub- 
project or even "component part of the subproject" embedded in the  
subiject so we can filter issues?

Jim



[jira] Commented: (TUSCANY-112) Generated SDO2 DataObject class throws ClassCastException when DataObject.getType() is called

Posted by "Frank Budinsky (JIRA)" <tu...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/TUSCANY-112?page=comments#action_12369898 ] 

Frank Budinsky commented on TUSCANY-112:
----------------------------------------

It sounds like this static initialization in class DataObjectUitl hasn't run in your environment:

  /**
   * Configure EMF to support the SDO runtime by registering a specialized Ecore factory, SDOEcoreFactory.
   *  This static initializion must run before any SDO metadata is created or loaded.
   *  As long as SDO helper classes (e.g., TypeHelper, XMLHelper, etc.) are accessed though their
   *  corresponding INSTANCE fields (e.g., TypeHelper.INSTANCE), or using the SDOUtil methods (e.g.,
   *  SDOUtil.createTypeHelper(), this will always be the case.
   */
  static
  {
    EPackage.Registry.INSTANCE.put(EcorePackage.eNS_URI, new EPackage.Descriptor()
      {
        public EPackage getEPackage()
        {
          return EcorePackage.eINSTANCE;
        }

        public EFactory getEFactory()
        {
          return new SDOFactoryImpl.SDOEcoreFactory();
        }
      });
  }

You can force it by calling DataObjectUtil.initRuntime() in your startup code.

Frank.


> Generated SDO2 DataObject class throws ClassCastException when DataObject.getType() is called
> ---------------------------------------------------------------------------------------------
>
>          Key: TUSCANY-112
>          URL: http://issues.apache.org/jira/browse/TUSCANY-112
>      Project: Tuscany
>         Type: Bug
>   Components: Java SDO Implementation
>     Reporter: Raymond Feng
>     Priority: Critical

>
> These 4 lines of code will fail:
> import org.apache.tuscany.model.scdl.Module;
> import org.apache.tuscany.model.scdl.ScdlFactory;
> Module module = ScdlFactory.INSTANCE.createModule();
> Type type = ((DataObject) module).getType();
> Exception in thread "main" java.lang.ClassCastException: org.eclipse.emf.ecore.impl.EClassImpl incompatible with commonj.sdo.Type
> 	at org.apache.tuscany.sdo.impl.DataObjectImpl.getType(DataObjectImpl.java:319)
> 	at org.apache.tuscany.axis2.stax.AxiomHelper.main(AxiomHelper.java:135)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira