4 Replies Latest reply on Oct 13, 2015 6:16 AM by jietao

    create REST War

    jietao

      I used Teiid designer to create a source model for MySQL, then a relational view model, then a procedure (REST enabled) within the view, then a VDB with source model and view model, finally created WAR. But: as I tested the web service I got the error:

       

      SEVERE [org.teiid.rest] (http-/127.0.0.1:8080-3)  Exception in execute: {0}: java.lang.Throwable: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: PROCEDURE SQLModel.JieRest does not exist

          at org.teiid.rest.services.TeiidRSProviderPost.execute(TeiidRSProviderPost.java:116) [classes:] .....

       

      where SQLModel is the name of the relational view and JieRest is the name of the procedure. Are there additional steps to add the procedure? I used "preview data" menu to test the procedure and I got the result: the expected XML string..

        • 1. Re: create REST War
          tejones

          Hi Jie,

           

          You used the MySQL JNDI when generating the WAR. You need to create a datasource for the VDB and use that JNDI for the generated WAR.

           

          Thanks,

          Ted

          • 2. Re: create REST War
            jietao

            I did it. I have the datasource in standalone-teiid.xml and started the server with this file. My VDB also includes the source model for MySQL database and the view model with a procedure defined. Actually I can create a procedure directly from the source model (in this way I do not need a virtual model), but as I created REST WAR from the VDB, I got an error from the webservice plugin (runtime.ui) that says syntax error with ";". Hence, I went around in another way.

            • 3. Re: create REST War
              rareddy

              See an example here as to what needs to be done to create REST based service in Teiid Generating Web Services for View Models in JBoss Data Virtualization 6.1 – Everything JBoss

              • 4. Re: create REST War
                jietao

                Hi Ramesh,

                 

                thanks a lot. I followed the link and made it now. The problem was: I added the data source entry manually in standalone-teiid.xml and gave a connection to MySQL. This is wrong. Now I automatically added this from Teiid designer and found that it shall be a connection to Teiid server.