7 Replies Latest reply on Oct 27, 2014 8:00 PM by rareddy

    Problem Using a Custom Connector from TEIID Designer

    lautar.molinero

      I've created a custom connector for an eis.

       

      created and deployed the translator and the resource adapter.

       

      I was able to create a dynamic VDB that uses the translator and its working OK. even returns data.

       

      but i can't create a data model from Teiid Designer.

       

      When I try to create a new data source from the designer I can see my resource adapter but the "class-name" property is empty and I cant edit the property.

       

      So I tried to skip that issue by defining the property on de ra.xml file ( wich I think is wrong) and then the data source creation throws an exception.

       

      java.lang.IllegalArgumentException: properties

        at org.teiid.core.util.ArgCheck.isNotEmpty(ArgCheck.java:406)

        at org.teiid84.runtime.ExecutionAdmin.getOrCreateDataSource(ExecutionAdmin.java:279)

        at org.teiid.designer.runtime.TeiidServer.getOrCreateDataSource(TeiidServer.java:592)

        at org.teiid.designer.runtime.importer.ImportManager.getOrCreateDataSource(ImportManager.java:453)

        at org.teiid.designer.teiidimporter.ui.wizard.TeiidImportManager.getOrCreateDataSource(TeiidImportManager.java:640)

        at org.teiid.designer.teiidimporter.ui.panels.DataSourceManager$1.run(DataSourceManager.java:62)

        at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)

       

       

      the bottom line is that I'm unable to use my connector from the Designer. is there any documentation or tutorial on how to do that? am I doing something obviously wrong?

       

      Thanks

        • 1. Re: Problem Using a Custom Connector from TEIID Designer
          rareddy

          If you use "jboss-cli.sh" program and issue a command like

           

          /subsystem=teiid:read-rar-description(rar-name=file)

           

          do see a property like

           

                  {"managedconnectionfactory-class" => {

                      "type" => STRING,

                      "display" => "managedconnectionfactory-class",

                      "read-only" => "true",

                      "advanced" => "true",

                      "default" => "org.teiid.resource.adapter.file.FileManagedConnectionFactory"

                  }},

           

          If yes, then the issue is in the Designer side. Designer tooling supposed to be written such that it can take the value of this property and supply in the "class-name" property. Often times we find Designer may have hard-coded values, which can be problematic in situations as you are seeing. Once you verify, you can log an issue here Teiid Designer - JBoss Issue Tracker

           

          Ramesh..

          • 2. Re: Problem Using a Custom Connector from TEIID Designer
            lautar.molinero

            Thank you for the answer.

             

            here is the command output.

             

            [standalone@localhost:9999 /] /subsystem=teiid:read-rar-description(rar-name=MarketoAdapter-0.0.1-SNAPSHOT.rar)

            {

                "outcome" => "success",

                "result" => [

                    {"resourceadapter-class" => {

                        "type" => STRING,

                        "display" => "resourceadapter-class",

                        "read-only" => "true",

                        "advanced" => "true",

                        "default" => "com.citrix.cdm.connector.adapter.marketo.MarketoResourceAdapter"

                    }},

                    {"managedconnectionfactory-class" => {

                        "type" => STRING,

                        "display" => "managedconnectionfactory-class",

                        "read-only" => "true",

                        "advanced" => "true",

                        "default" => "com.citrix.cdm.connector.adapter.marketo.MarketoManagedConnectionFactory"

                    }},

                    {"username" => {

                        "type" => STRING,

                        "required" => false,

                        "description" => "this is the username",

                        "display" => "usernameRA",

                        "read-only" => false,

                        "advanced" => false,

                        "masked" => false

                    }},

                    {"class-type" => {

                        "type" => STRING,

                        "required" => false,

                        "description" => "this is the class type",

                        "display" => "class-name",

                        "read-only" => false,

                        "advanced" => false,

                        "masked" => false

                    }}

                ]

            }

             

            the class-name parameter in BOLD is me trying to fool the designer. ( I was trying to "override" the property)

             

            actually the managed connection factory class is looking OK in the designer.

            • 3. Re: Problem Using a Custom Connector from TEIID Designer
              rareddy

              You provided the "class-type" not "class-name". display is just that, only for UI, underlying property name will be class-type. Also, did you define this property in ra.xml? All the ra.xml properties are showed here.

               

              BTW, I not sure if overriding the "class-name" property in ra.xml works with Designer, you certainly give it a try.

               

              Ramesh..

              • 4. Re: Problem Using a Custom Connector from TEIID Designer
                lautar.molinero

                Hi Ramesh, again thanks for the help.

                 

                Overriding de class-name property didn't work unfortunatelly.

                 

                I'll go a step backwards.

                 

                this is what I'm seeing, but im not sure if i'm using the designer in the right way.

                 

                ConnectorProblem.jpg

                 

                by the way, is there anywhere I can get the designer code to check if this is an issue. or if a I need to define something in my connector to make it work?

                 

                Thanks

                • 5. Re: Problem Using a Custom Connector from TEIID Designer
                  rareddy

                  Teiid Designer source code is at Teiid-Designer/teiid-designer · GitHub they have WIKI pages how to setup the environment etc.

                   

                  Also what version of the Designer you are working with? Is to possible to share your resource-adapter for me to test?

                   

                  Ramesh..

                  • 6. Re: Problem Using a Custom Connector from TEIID Designer
                    lautar.molinero

                    I'm sorry I cannot give you my resource adapter. If I have some time I might be able to create a dummy one that has the same issue for you.

                     

                    Looking at the designer code i found this:

                     

                    String rarConnFactoryValue = null;

                            if(isRarDriver(driverName,teiidVersion)) {

                                rarConnFactoryValue = getManagedConnectionFactoryClassDefault(propDefns);

                            }

                     

                     

                     

                        private boolean isRarDriver(String driverName, ITeiidServerVersion teiidVersion) {

                        boolean isRarDriver = false;

                        if(!CoreStringUtil.isEmpty(driverName)) {

                        // Teiid 8.3 and before

                        if(!TranslatorHelper.isTeiid84OrHigher(teiidVersion)) {

                        if (driverName.endsWith(DOT_RAR)) {

                        isRarDriver = true;

                        }

                        // Teiid 8.4 and later

                          } else  {

                        if(   driverName.equals(TranslatorHelper.TEIID_FILE_DRIVER_84UP) || driverName.equals(TranslatorHelper.TEIID_GOOGLE_DRIVER_84UP)

                          || driverName.equals(TranslatorHelper.TEIID_INFINISPAN_DRIVER_84UP) || driverName.equals(TranslatorHelper.TEIID_LDAP_DRIVER_84UP)

                          || driverName.equals(TranslatorHelper.TEIID_SALESORCE_DRIVER_84UP) || driverName.equals(TranslatorHelper.TEIID_WEBSERVICE_DRIVER_84UP)

                          || driverName.equals(TranslatorHelper.TEIID_MONGODB_DRIVER_84UP)) {

                        isRarDriver = true;

                        }

                        }

                        }

                      

                        return isRarDriver;

                        }

                     

                    I'm using TEIID 8.4.1-redhat-7

                     

                    so I think thats the issue. in versions equals or higher than 8.4 the class-name property will be set to null.

                     

                    I think maybe I wrote the connector using 8.3 standards and that doesn't work on 8.4 teiid.

                     

                    Am I right?

                    • 7. Re: Problem Using a Custom Connector from TEIID Designer
                      rareddy

                      There is no 8.3 standards Vs 8.4. This is JEE specification, for implementing a resource adapter, happen to use some base classes we wrote to make ease of development by folks like you.  Now the error is in Designer, so you can upgrade the Designer version and see if that fixes your issue.