0 Replies Latest reply on Feb 1, 2016 9:06 AM by Nishant Agrawal

    Remote Flat File Data Source

    Nishant Agrawal Novice

      Hi,

      I am trying to create datasource for a remote flat file.I am using below steps:

       

      statnalone-teiid.xml:

       

      <resource-adapter id="file">

                          <module slot="main" id="org.jboss.teiid.resource-adapter.file"/>

                          <transaction-support>NoTransaction</transaction-support>

                          <connection-definitions>

                              <connection-definition class-name="org.teiid.resource.adapter.file.FileManagedConnectionFactory" jndi-name="java:/TextfileDS" enabled="true" use-java-context="true" pool-name="teiid-file-ds">

                                  <config-property name="AllowParentPaths">

                                      true

                                  </config-property>

                                  <config-property name="ParentDirectory">

                                     http://download.jboss.org/teiid/designer/data/employees/file/EMPLOYEEDATA.txt

                                  </config-property>

                              </connection-definition>

                          </connection-definitions>

                      </resource-adapter>

       

       

      vdb file:

      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>

      <vdb name="TextFileVDB" version="1">

          <description>A Dynamic VDB</description>

          <property name="UseConnectorMetadata" value="false"/>

       

        <model name="MarketData" >

              <!--

                  Each source represents a translator and data source. There are

                  pre-defined translators, or you can create one. ConnectionFactories

                  or DataSources in JBoss AS they are typically defined using "xxx-ds.xml" files.

              -->

              <source name="textDataSource" translator-name="file" connection-jndi-name="java:/TextfileDS"/>

          </model>

         </vdb>   

       

      I am using below query to access the data from the flat file:

       

      SELECT A.LastName, A.FirstName, A.MiddleName, A.EmpId, A.Department,A.AnnualSalary, A.Title, A.HomePhone, A.Manager, A.Street, A.City, A.State, A.Zip FROM ( EXEC MarketData.invokeHttp ( 'GET', null,'http://download.jboss.org/teiid/designer/data/employees/file/EMPLOYEEDATA.txt', 'TRUE')) AS f, TEXTTABLE(TO_CHARS(f.result, 'UTF-8') COLUMNS LastName string, FirstName string,MiddleName string, EmpId string, Department string, AnnualSalary string, Title string, HomePhone string, Manager string, Street string, City string, State string, Zip string HEADER 2) AS A

       

       

      But i am getting the below error:

       

      Caused by: [TeiidComponentException] TEIID30357: Error Code:TEIID30357 Message:Remote org.teiid.api.exception.query.QueryMetadataException: TEIID30357 MarketData.invokeHttp does not exist. at org.teiid.query.metadata.TransformationMetadata.getStoredProcedureInfoForProcedure(TransformationMetadata.java:321) at org.teiid.query.metadata.BasicQueryMetadataWrapper.getStoredProcedureInfoForProcedure(BasicQueryMetadataWrapper.java:250)at org.teiid.query.metadata.BasicQueryMetadataWrapper.getStoredProcedureInfoForProcedure(BasicQueryMetadataWrapper.java:250)at org.teiid.query.resolver.command.ExecResolver.findCommandMetadata(ExecResolver.java:76)

              at org.teiid.query.resolver.command.ExecResolver.resolveProceduralCommand(ExecResolver.java:303)

              at org.teiid.query.resolver.ProcedureContainerResolver.resolveCommand(ProcedureContainerResolver.java:143)

              at org.teiid.query.resolver.QueryResolver.resolveCommand(QueryResolver.java:273)

              ... 26 more

       

       

      Can anyone suggest me what i am missing or is there any other way to create datasource of remote flat file and  access to data from it ?