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

    help with teiid embedded deployVDBzip

    sudeep das Newbie

      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"));

      }