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

wangful commented on TUSCANY-1381:
----------------------------------

I have co the new codes and mvn them to the jar.
This is statment is used to load the config, but I got the following error:
DAS das = 
DAS.FACTORY.createDAS(Thread.currentThread().getContextClassLoader().getResourceAsStream("config.xml"),
 conn);

Exception in thread "main" java.lang.UnsupportedOperationException
        at 
org.apache.tuscany.sdo.impl.DataObjectBase.getStaticType(DataObjectBase.java:363)
        at 
org.apache.tuscany.sdo.impl.DataObjectBase.eStaticClass(DataObjectBase.java:358)
        at 
org.apache.tuscany.sdo.impl.ExtensibleDataObjectImpl.eClass(ExtensibleDataObjectImpl.java:118)
        at 
org.eclipse.emf.ecore.xmi.impl.XMLHandler.processObject(XMLHandler.java:2161)
        at 
org.eclipse.emf.ecore.xmi.impl.SAXXMLHandler.processObject(SAXXMLHandler.java:93)
        at 
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromFeatureType(XMLHandler.java:1926)
        at 
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObject(XMLHandler.java:1791)
        at 
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleFeature(XMLHandler.java:1569)
        at 
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createDocumentRoot(XMLHandler.java:1237)
        at 
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType(XMLHandler.java:1165)
        at 
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XMLHandler.java:1247)
        at 
org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XMLHandler.java:883)
        at 
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:866)
        at 
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:627)
        at 
org.apache.tuscany.sdo.util.resource.SDOXMLResourceImpl$SDOXMLLoadImpl$XmlHandler.startElement(SDOXMLResourceImpl.java:362)
        at 
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown
 Source)
        at 
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
 Source)
        at 
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown
 Source)
        at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
 Source)
        at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
 Source)
        at 
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown 
Source)
        at 
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown 
Source)
        at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown 
Source)
        at 
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown 
Source)
        at javax.xml.parsers.SAXParser.parse(Unknown Source)
        at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:268)
        at 
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:666)
        at 
org.apache.tuscany.sdo.util.resource.SDOXMLResourceImpl.doLoad(SDOXMLResourceImpl.java:538)
        at 
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.load(XMLResourceImpl.java:634)
        at 
org.apache.tuscany.sdo.helper.XMLDocumentImpl.load(XMLDocumentImpl.java:259)
        at 
org.apache.tuscany.sdo.helper.XMLDocumentImpl.load(XMLDocumentImpl.java:232)
        at 
org.apache.tuscany.sdo.helper.XMLHelperImpl.load(XMLHelperImpl.java:85)
        at 
org.apache.tuscany.sdo.helper.XMLHelperImpl.load(XMLHelperImpl.java:79)
        at 
org.apache.tuscany.das.rdb.util.ConfigUtil.loadConfig(ConfigUtil.java:52)
        at org.apache.tuscany.das.rdb.impl.DASImpl.<init>(DASImpl.java:100)
        at 
org.apache.tuscany.das.rdb.impl.DASFactoryImpl.createDAS(DASFactoryImpl.java:39)
        at TestDAS.main(TestDAS.java:55)

> DAS config file with default namespace will not work
> ----------------------------------------------------
>
>                 Key: TUSCANY-1381
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1381
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java DAS RDB
>    Affects Versions: Java-DAS-M2
>            Reporter: wangful
>         Attachments: workingExampleJune26.jar
>
>
> Hi, 
> If I use the following xml file as the DAS config file, there will be errors:
> DAS das = 
> DAS.FACTORY.createDAS(Thread.currentThread().getContextClassLoader().getResourceAsStream("config.xml"),
>  conn);
> <Config xmlns="http:///org.apache.tuscany.das.rdb/config.xsd";>
>       <Command name="AllCustomers" SQL="select * from MYCUSTOMER" 
> kind="Select">
>       <ResultDescriptor columnName="ID" tableName="MYCUSTOMER" 
> columnType="commonj.sdo.Long"/>
>       <ResultDescriptor columnName="Name" tableName="MYCUSTOMER" 
> columnType="commonj.sdo.String"/>
>       </Command>
>       
>       <Table tableName="MYCUSTOMER">
>               <Column columnName="ID" primaryKey="true" />
>               <Column columnName="NAME" />
>       </Table>
>       
> </Config>
> The error is: 
> Exception in thread "main" java.lang.RuntimeException: 
> org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Feature 'Command' 
> not found. (http:///temp.xml, 25, 76)
>       at 
> org.apache.tuscany.das.rdb.util.ConfigUtil.loadConfig(ConfigUtil.java:54)
>       at org.apache.tuscany.das.rdb.impl.DASImpl.<init>(DASImpl.java:100)
>       at 
> org.apache.tuscany.das.rdb.impl.DASFactoryImpl.createDAS(DASFactoryImpl.java:39)
>       at TestDAS.main(TestDAS.java:52)
> It seems the default namespace can't work.  But if I add prefix for the 
> namespace as below, it will work.
> <c:Config xmlns:c="http:///org.apache.tuscany.das.rdb/config.xsd";>
>       <Command name="AllCustomers" SQL="select * from MYCUSTOMER" 
> kind="Select">
>       <ResultDescriptor columnName="ID" tableName="MYCUSTOMER" 
> columnType="commonj.sdo.Long"/>
>       <ResultDescriptor columnName="Name" tableName="MYCUSTOMER" 
> columnType="commonj.sdo.String"/>
>       </Command>
>       
>       <Table tableName="MYCUSTOMER">
>               <Column columnName="ID" primaryKey="true" />
>               <Column columnName="NAME" />
>       </Table>
>       
> </c:Config>
> From the user manual and samples, I think we need not supply the prefix for 
> the namespace. But it can't work in my eclipse. 
> Can someone help to make the default namespace work? 
> Thanks.

-- 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to