6 Replies Latest reply on Sep 22, 2014 12:59 PM by sudeepd

    help with teiid embedded deployVDBzip

    sudeepd

      I am getting started with teiid. I used teiid designer to create a vdb, and it works fine with jboss. I now want to use that vdb in teiid embedded, but I get exception on deployVDBZip


      Exception in thread "main" org.teiid.deployers.VirtualDatabaseException: TEIID40095 TEIID31070 Empty model;There are no tables, procedures or functions defined in this model mysql


      Here is my code...what am I missing ?


          public static void main(String[] args) throws Exception {

              final MysqlDataSource sql = new MysqlDataSource();

              sql.setURL("jdbc:mysql://localhost");

              sql.setUser("xxxx");

              sql.setPassword("xxxx");

             

              EmbeddedServer.ConnectionFactoryProvider<DataSource> jdbcProvider = new EmbeddedServer.ConnectionFactoryProvider<DataSource>() {

                  @Override  

                  public DataSource getConnectionFactory() throws TranslatorException {

                      return sql;    

                  }          

              };     

              Connection conn = jdbcProvider.getConnectionFactory().getConnection();

                    

              // now start Teiid in embedded mode

              EmbeddedConfiguration ec = new EmbeddedConfiguration();

              ec.setUseDisk(true);

                                     

              EmbeddedServer teiidServer = new EmbeddedServer();

              teiidServer.start(ec);

                     

              // configure the connection provider and translator for jdbc based source

              teiidServer.addConnectionFactoryProvider("mysql", jdbcProvider);

              teiidServer.addTranslator("mysql",new MySQLExecutionFactory());

                     

              teiidServer.deployVDBZip(new URL("file:///tmp/empvdb.vdb"));

      }

        • 1. Re: help with teiid embedded deployVDBzip
          rareddy

          The error seem to indicate you have no models in your VDB. Can you attach your VDB?

          • 2. Re: help with teiid embedded deployVDBzip
            sudeepd

            My vdb xml looks like this

             

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

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

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

                <property value="Fri Sep 19 11:53:10 PDT 2014" name="validationDateTime"/>

                <property value="8.6.0" name="validationVersion"/>

                <model visible="true" type="PHYSICAL" name="mysql" path="/empdb/sources/mysql.xmi">

                    <property value="1623599321" name="checksum"/>

                    <property value="1054097021.INDEX" name="indexName"/>

                    <property value="mmuuid:41979468-fc1e-46a2-95b6-dceb0759dea9" name="modelUuid"/>

                    <property value="Relational" name="modelClass"/>

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

                    <source translator-name="mysql" connection-jndi-name="mysql" name="mysql"/>

                </model>

            </vdb>

             

            Will also upload the vdb zip if that will help

            • 3. Re: help with teiid embedded deployVDBzip
              rareddy

              try "deployVDB" method

              • 4. Re: help with teiid embedded deployVDBzip
                sudeepd

                Same error. Just in case it helps, I am using Teiid 8.6

                • 5. Re: help with teiid embedded deployVDBzip
                  rareddy

                  try

                   

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

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

                      <model visible="true" type="PHYSICAL" name="mysql">

                          <source translator-name="mysql" connection-jndi-name="mysql" name="mysql"/>

                      </model>

                  </vdb>

                   

                  And make sure you have translator and data source added before by the name "mysql"


                  Ramesh..

                  • 6. Re: help with teiid embedded deployVDBzip
                    sudeepd

                    Thanks Ramesh for the response.

                    I have the translator and data source defined and added (See code snippet in the first post), and I edited my vdb.xml to be what you suggested.

                    I still get the same error about empty model, I guess there is something amiss with how I am setting up my datasource.

                    Requesting assistance on another thread Teiid Embedded, TIMESTAMPDIFF with MYSQL DataBase for a working mysql datasource.