You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Kelvin Goodson (JIRA)" <tu...@ws.apache.org> on 2008/03/04 15:51:43 UTC

[jira] Commented: (TUSCANY-2031) Error encountered when trying to use dynamic Data APIs and SDO code-generated APIs at the same time

    [ https://issues.apache.org/jira/browse/TUSCANY-2031?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12575008#action_12575008 ] 

Kelvin Goodson commented on TUSCANY-2031:
-----------------------------------------

Hello Joseph.  I'm sorry that I didn't spot this one before.  I need to see a bit more of your code.   I don't have the beta1 source to hand at the moment to check in detail,  but the first thing that seems clear is that any occurrence of AnyTypeImpl indicates that the Type system for the document that is being read is not registered.  You'll need to have registered your type system in some way.  It's not clear whether you want to use the dynamic API on instances of DataObject,  or to use the dynamic API on instances of your generated classes.  Either is possible.  In the first case you will need to use the schema that you used for generating the static classes, and provide it as an InputStream to helperContext.getTypeHelper().define(...) and in the second case you would need to do something like MyGenFactory.INSTANCE.register(helperContext). This makes the Types available so that when you do helperContext.getXMLHelper().load(...) the load operation can look up the Types referenced in the XML document's elements,  and create instances of the appropriate classes.  I suspect this is user error.  So I am going to close this JIRA as such.  If you are still having troubles please mail the tuscany-user mailing list where we'll be able to help you out.

> Error encountered when trying to use dynamic Data APIs and SDO code-generated APIs at the same time
> ---------------------------------------------------------------------------------------------------
>
>                 Key: TUSCANY-2031
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2031
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-SDO-beta1
>         Environment: Windows XP, JDK 1.6
>            Reporter: Joseph Nguyen
>             Fix For: Java-SDO-Next
>
>   Original Estimate: 96h
>  Remaining Estimate: 96h
>
> Can use generated codes from SDO generator to create DataObject(s) and XML data.  Once the data has been created, error encountered when trying to use dynamic Data APIs to read in to create DataObject(s).  Below shows the details of error.
> Exception in thread "main" java.lang.ClassCastException: org.eclipse.emf.ecore.xml.type.impl.AnyTypeImpl
>         at org.apache.tuscany.sdo.helper.XMLDocumentImpl.getRootObject(XMLDocumentImpl.java:320)
>         at tbd.TBD.getRootObjectFromXMLDoc(TBD.java:73)
>         at tbd.TBD.main(TBD.java:497)

-- 
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