6 Replies Latest reply on May 29, 2013 4:20 PM by rareddy

    Odata: Not Found Exception

    pinkstondevin

      Hello all,

       

      I have a VDB with multiple sources, but for example a flat file such as the one below.  When i try to access via Odata: http://localhost:8080/odata/Portfolio.1/refinedSalaries.  I have tried with http://localhost:8080/odata/Portfolio.1/refinedSalariesModel as well to see if i can generate a different error to no avail.  Am i missing an import property in my VDB? I continue to receive this error:

       

      Odata Error:

      <error><code>NotFoundException</code><message lang="en-US">EdmEntitySet refinedSalaries is not found</message></error>    

       

       

       

      Flat File data source in my VDB:

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

      <model visible ="true" type = "VIRTUAL" name = "refinedSalariesModel">

          <metadata type = "DDL"><![CDATA[

              CREATE VIEW refinedSalaries(

              salaryyear integer,

              teamid string(128),

              leagueid string (128),

              playerid string(128),

              playersalary integer

              ) OPTIONS (UPDATABLE TRUE) AS

              select refinedSalaries.* from (call csvSourceModels.getTextFiles('refinedSalaries.csv')) f, TEXTTABLE(f.file COLUMNS salaryyear integer, teamid string, leagueid string, playerid string, playersalary integer HEADER) refinedSalaries;

              ]]>

          </metadata>

      </model>

       

      Thank you for all your help!

        • 1. Re: Odata: Not Found Exception
          rareddy

          try http://localhost:8080/odata/Portfolio.1/refinedSalariesModel/refinedSalaries

           

          let me know if that works? I believe that is how I implemented the full path. I will update the docs to reflect this.

           

          Thanks

           

          Ramesh..

          1 of 1 people found this helpful
          • 2. Re: Odata: Not Found Exception
            pinkstondevin

            Ramesh,

             

            That definitely is helping, I am still receiving an error.  Perhaps related to the web.xml file in modules?

             

            <error><code/><message lang="en-US">Could not find resource for relative : /refinedSalariesModel/refinedSalaries of full path: http://localhost:8080/odata/Portfolio.1/refinedSalariesModel/refinedSalaries</message></error>

             

            Thank you Ramesh.

            • 3. Re: Odata: Not Found Exception
              rareddy

              Devin,

               

              I had to refresh my memory by going back to the OData spec. The URL needs to be "http://<host>:<port>/odata/<vdbname>.<vdb-version>/<model-name>.<table-name>

               

              However I see a bug which is making the case sensitive match for URL with Table name, which is wrong. You can log a JIRA on it. As per workaround right now, the below should work

               

              http://localhost:8080/odata/Portfolio.1/refinedSalariesModel.refinedSalaries

               

               

              Ramesh..

              • 4. Re: Odata: Not Found Exception
                pinkstondevin

                Ramesh,

                 

                Sorry for the gap in communication, I still am not able to retreive data from Teiid through Odata.  If i submit the second URL which only has the VDB name, i receive a different set of information which i included.  Am i doing something wrong on my end?  I have tried to use all of our sources and I cannot return results.

                 

                http://localhost:8080/odata/Portfolio.1/refinedSalariesModel.refinedSalaries

                <error><code>NotFoundException</code><message lang="en-US">EdmEntitySet refinedSalariesModel.refinedSalaries is not found</message></error>

                 

                http://localhost:8080/odata/Portfolio.1/

                <service xml:base="http://localhost:8080/odata/Portfolio.1/"><workspace><atom:title>Default</atom:title><collection href="Columns"><atom:title>Columns</atom:title></collection><collection href="DataTypes"><atom:title>DataTypes</atom:title></collection><collection href="KeyColumns"><atom:title>KeyColumns</atom:title></collection><collection href="Keys"><atom:title>Keys</atom:title></collection><collection href="ProcedureParams"><atom:title>ProcedureParams</atom:title></collection><collection href="Procedures"><atom:title>Procedures</atom:title></collection><collection href="Properties"><atom:title>Properties</atom:title></collection><collection href="Schemas"><atom:title>Schemas</atom:title></collection><collection href="Tables"><atom:title>Tables</atom:title></collection><collection href="VirtualDatabases"><atom:title>VirtualDatabases</atom:title></collection><collection href="MatViews"><atom:title>MatViews</atom:title></collection><collection href="VDBResources"><atom:title>VDBResources</atom:title></collection><collection href="matpg_datatype"><atom:title>matpg_datatype</atom:title></collection><collection href="matpg_relatt"><atom:title>matpg_relatt</atom:title></collection><collection href="pg_attribute"><atom:title>pg_attribute</atom:title></collection><collection href="pg_class"><atom:title>pg_class</atom:title></collection><collection href="pg_index"><atom:title>pg_index</atom:title></collection><collection href="pg_proc"><atom:title>pg_proc</atom:title></collection></workspace></service>

                 

                Thank you!

                • 5. Re: Odata: Not Found Exception
                  pinkstondevin

                  I have been playing around wth the URL and Odata, I can see the metadata of my VDB by issuing:

                   

                  http://localhost:8080/odata/Portfolio.1/$metadata

                   

                  <edmx:Edmx Version="1.0"><edmx:DataServices m:DataServiceVersion="2.0"><Schema Namespace="csvSourceModels"><ComplexType Name="getFiles_RSParam"><Property Name="file" Type="Edm.Binary" Nullable="true"/><Property Name="filePath" Type="Edm.String" Nullable="true" MaxLength="4000" FixedLength="false" Unicode="true"/></ComplexType><ComplexType Name="getTextFiles_RSParam"><Property Name="file" Type="Edm.Binary" Nullable="true"/><Property Name="filePath" Type="Edm.String" Nullable="true" MaxLength="4000" FixedLength="false" Unicode="true"/></ComplexType><EntityContainer Name="csvSourceModels" m:IsDefaultEntityContainer="false"><FunctionImport Name="getFiles" ReturnType="Collection(csvSourceModels.getFiles_RSParam)" m:HttpMethod="GET"><Parameter Name="pathAndPattern" Type="Edm.String" Mode="In" Nullable="true"/></FunctionImport><FunctionImport Name="getTextFiles" ReturnType="Collection(csvSourceModels.getTextFiles_RSParam)" m:HttpMethod="GET"><Parameter Name="pathAndPattern" Type="Edm.String" Mode="In" Nullable="true"/></FunctionImport><FunctionImport Name="saveFile" m:HttpMethod="POST"><Parameter Name="filePath" Type="Edm.String" Mode="In" Nullable="true"/><Parameter Name="file" Type="Edm.Binary" Mode="In" Nullable="true"/></FunctionImport></EntityContainer></Schema><Schema Namespace="refinedSalariesModel"><EntityContainer Name="refinedSalariesModel" m:IsDefaultEntityContainer="false"/></Schema><Schema Namespace="fieldingPostgres"><EntityContainer Name="fieldingPostgres" m:IsDefaultEntityContainer="false"/></Schema><Schema Namespace="oracleBaseball"><EntityContainer Name="oracleBaseball" m:IsDefaultEntityContainer="false"/></Schema><Schema Namespace="salariesHadoop"><EntityContainer Name="salariesHadoop" m:IsDefaultEntityContainer="false"/></Schema>

                  I can see all of my data sources, however i still cannot return data from my tables/sources through Odata. 

                   

                  Currently I am just trying to issue a "select * from datasource" but I am returning EdmEntitySet not found.

                   

                  Thank you for your time.

                  • 6. Re: Odata: Not Found Exception
                    rareddy

                    From your copy of $metadata I do not see any tables in your VDB at all. If you login into same VDB using the SquirreL do you see the tables you are calling?