This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes SOA and ESB and the fly likes tuscany SDO beginner Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » SOA and ESB
Bookmark "tuscany SDO beginner" Watch "tuscany SDO beginner" New topic
Author

tuscany SDO beginner

zb cong
Ranch Hand

Joined: Jan 14, 2002
Posts: 416
hello,

my first tuscany sdo program:



i import all jar under lib dir of tuscany_sdo1.1 package, when i run it, the following exception thrown at "root.getString("person/name")":

Exception in thread "main" java.lang.ClassCastException: org.eclipse.emf.ecore.util.FeatureMapUtil$FeatureEList incompatible with org.eclipse.emf.ecore.EObject
at org.apache.tuscany.sdo.util.DataObjectUtil$Accessor.process(DataObjectUtil.java:2237)
at org.apache.tuscany.sdo.util.DataObjectUtil$Accessor.init(DataObjectUtil.java:2017)
at org.apache.tuscany.sdo.util.DataObjectUtil$Accessor.create(DataObjectUtil.java:1932)
at org.apache.tuscany.sdo.util.DataObjectUtil$Accessor.create(DataObjectUtil.java:1926)
at org.apache.tuscany.sdo.util.DataObjectUtil.get(DataObjectUtil.java:776)
at org.apache.tuscany.sdo.impl.DataObjectImpl.get(DataObjectImpl.java:221)
at org.apache.tuscany.sdo.impl.DataObjectImpl.getString(DataObjectImpl.java:426)
at Test.main(Test.java:19)


why is it? who can help, appreciated first.
Roger Sterling
Ranch Hand

Joined: Apr 06, 2012
Posts: 426

The result coming back from your DataObject call is an EReference which is not castable to a Java String type, and why the getString call fails. There is a bug on this behavior with the Tuscany team and since no development has taken place on the main code stream for over a year, I wouldn't hold your breath waiting for a fix. You might have better success with http://xml.apache.org/xalan-j/xpath_apis.html or http://jaxen.codehaus.org/ .
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: tuscany SDO beginner
 
It's not a secret anymore!