4 Replies Latest reply on Oct 15, 2015 3:28 AM by parrotola

    How to deploy a VDB created with Teiid Designer as Teiid Embedded?

    parrotola Novice

      Hi, I created a Vdb withTeiid Designer but I'm not able to deploy it as Teiid Embedded. I followed this link

      Dynamic VDBs - Teiid 8.12 (draft) - Project Documentation Editor

      but it doesn't work. 

      This is my code:

       

      EmbeddedServer es=new EmbeddedServer();

      URL vdburl=new File("vdbinsurance.vdb").toURI().toURL();

      es.deployVDBZip(vdburl);

       

      This is my stack error:

       

      Exception in thread "main" java.lang.IllegalStateException

        at org.teiid.runtime.EmbeddedServer.checkStarted(EmbeddedServer.java:832)

        at org.teiid.runtime.EmbeddedServer.deployVDB(EmbeddedServer.java:696)

        at org.teiid.runtime.EmbeddedServer.deployVDBZip(EmbeddedServer.java:691)

        at com.teiid.embed.Vdb_Example.main(Vdb_Example.java:54)


      Any suggestions?

      Thanks a lot.

        • 1. Re: How to deploy a VDB created with Teiid Designer as Teiid Embedded?
          Ramesh Reddy Master

          As error is indicating, the Embeeded engine is not started. You need to do

           

          es.start(config);

           

          before call the deploy method.

          1 of 1 people found this helpful
          • 2. Re: How to deploy a VDB created with Teiid Designer as Teiid Embedded?
            parrotola Novice

            Thanks for your fast reply.

            I have improved my application but I have still an error:

            This is my code:

             

            EmbeddedServer es=new EmbeddedServer();

            EmbeddedConfiguration ec=new EmbeddedConfiguration();

            MySQL5ExecutionFactory mysql=new MySQL5ExecutionFactory();

            mysql.setSupportsDirectQueryProcedure(true);

            mysql.start();

            es.addTranslator("mysql5",mysql);

            es.start(ec);

            URL vdburl=new File("vdbinsurance.vdb").toURI().toURL();

            es.deployVDBZip(vdburl);

            Connection c=es.getDriver().connect("jdbc:teiid:vdbinsurance", null);

            execute(c, "select * from ANAG_CLIENTI limit 10", false);


            The stack trace is :

             

            AVVERTENZA: TEIID30020 Processing exception for request ccVC+adb3UD7.0 'TEIID30498 Capabilities for mysqlins were not available.  The command could not be planned properly.'. Originally QueryPlannerException 'Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial' NamingManager.java:662. Enable more detailed logging to see the entire stacktrace.

            org.teiid.jdbc.TeiidSQLException: TEIID30498 Capabilities for mysqlins were not available.  The command could not be planned properly.

              at org.teiid.jdbc.TeiidSQLException.create(TeiidSQLException.java:135)

              at org.teiid.jdbc.TeiidSQLException.create(TeiidSQLException.java:71)

              at org.teiid.jdbc.StatementImpl.postReceiveResults(StatementImpl.java:700)

              at org.teiid.jdbc.StatementImpl.access$100(StatementImpl.java:64)

              at org.teiid.jdbc.StatementImpl$2.onCompletion(StatementImpl.java:539)

              at org.teiid.client.util.ResultsFuture.addCompletionListener(ResultsFuture.java:148)

              at org.teiid.jdbc.StatementImpl.executeSql(StatementImpl.java:535)

              at org.teiid.jdbc.StatementImpl.execute(StatementImpl.java:1068)

              at org.teiid.jdbc.StatementImpl.execute(StatementImpl.java:320)

              at com.teiid.embed.Vdb_Example.execute(Vdb_Example.java:29)

              at com.teiid.embed.Vdb_Example.main(Vdb_Example.java:89)


            Do you think  I'm missing some Class or instruction?

            For excel example, I've found this extra instruction:


            FileManagedConnectionFactory managedconnectionFactory = new FileManagedConnectionFactory();

            managedconnectionFactory.setParentDirectory("data");

            server.addConnectionFactory("java:/excel-file", managedconnectionFactory.createConnectionFactory());


            Is there a similar instruction for DBMS?



            Using  VDB with multiple datasource, how can I work?



            Thanks a lot. Best regards.

            Francesco Paparella




            • 4. Re: How to deploy a VDB created with Teiid Designer as Teiid Embedded?
              parrotola Novice

              Thank you very  much.

              I have risolved my problem successfully.

              Bye