6 Replies Latest reply on Jul 24, 2012 8:12 AM by manoj.m.agarwal

    Issue while deploying custom translator with Teiid 8.0

    manoj.m.agarwal

      Hi,

       

      I am useing JBoss 7.1.1 along with Teiid 8.0  to deploy a custom translator. The implementing class of my executionFactory extands BaseDelegatingExecutionFactory.

       

      I am following the module approch for deploying this translator, so i have created a module for my translator jar and configured it in standalone-teiid.xml as below....

       

      <subsystem xmlns="urn:jboss:domain:teiid:1.0">

      ...............

      <translator name="xyz-translator-safetyHarness" module="com.abc.xyz.teiid.safety"/>

      ...............

      ...............

      </subsystem>

       

      In my translator jar META-INF/services/org.teiid.translator.BaseDelegatingExecutionFactory  contins "com.abc.xyz.teiid.safety.SafetyHarnessExecutionFactory#xyz-translator-safetyHarness"

       

       

      When i start Jboss, i get this Error....

       

      17:04:58,956 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 47) Operation ("add") failed - address: ([

          ("subsystem" => "teiid"),

          ("translator" => "xyz-translator-safetyHarness")

      ]) - failure description: "TEIID50009 Translator \"xyz-translator-safetyHarness\" not found in the module \"com.abc.xyz.teiid.safety\" "

       

       

      Thanks !

      Manoj

        • 1. Re: Issue while deploying custom translator with Teiid 8.0
          rareddy

          Manoj,

           

          The "ExecutionFactory" class needs to be a top level class and adhere to Java Service semantics. I see you defined as inner class.

           

          Also the file needs to be META-INF/services/org.teiid.translator.ExecutionFactory should contain the implementaion class name, not the BaseExecutionFactory.

           

          Ramesh..

          • 2. Re: Issue while deploying custom translator with Teiid 8.0
            manoj.m.agarwal

            Hi Ramesh,

             

            What makes you think that my ExecutionFactory is inner class ? (because its not inner class actulyy...just want to know if i configured it in wrong way and and you said i see it as inner class)

             

            I have copied my ExecutionFactory class below, please let me know if i need to rename the file under META-INF/services and its content.

             

            package com.abc.xyz.teiid.safety;

             

            import java.util.List;

             

            import org.apache.log4j.Logger;

            import org.teiid.language.Command;

            import org.teiid.metadata.MetadataFactory;

            import org.teiid.metadata.RuntimeMetadata;

            import org.teiid.translator.BaseDelegatingExecutionFactory;

            import org.teiid.translator.Execution;

            import org.teiid.translator.ExecutionContext;

            import org.teiid.translator.ExecutionFactory;

            import org.teiid.translator.Translator;

            import org.teiid.translator.TranslatorException;

             

             

            @Translator(name = "xyz-translator-safetyHarness")

            public class SafetyHarnessExecutionFactory

                extends BaseDelegatingExecutionFactory<Object, Object>

            {

                private static final Logger              logger               = Logger.getLogger(SafetyHarnessExecutionFactory.class.getName());

             

                private boolean                          hasConnectionErr     = false;

             

                private ExecutionFactory<Object, Object> delegate             = null;

             

             

                @Override

                public void getMetadata(MetadataFactory metadataFactory, Object conn) throws TranslatorException

                {

                    try

                    {

                        if (!this.hasConnectionErr)

                        {

                            super.getMetadata(metadataFactory, conn);

                        }

                    } catch (Exception e)

                    {

                        logger.warn("Error on getMetaData call", e);

                    }

             

                }

             

                @Override

                public void setDelegate(ExecutionFactory<Object, Object> delegate)

                {

                    this.delegate = delegate;

             

                    super.setDelegate(delegate);

             

                    super.setSupportsFullOuterJoins(delegate.supportsFullOuterJoins());

                    super.setSupportsOrderBy(delegate.supportsOrderBy());

                    super.setSupportsOuterJoins(delegate.supportsOuterJoins());

                    super.setSupportsSelectDistinct(delegate.supportsSelectDistinct());

                    super.setSupportsInnerJoins(delegate.supportsInnerJoins());

                    super.setMaxInCriteriaSize(delegate.getMaxInCriteriaSize());

                    super.setMaxDependentInPredicates(delegate.getMaxDependentInPredicates());

                }

             

            }

            • 3. Re: Issue while deploying custom translator with Teiid 8.0
              rareddy

              Because I saw ClassName#another may be that was a comment, which I misread.

               

              See

              https://docs.jboss.org/author/display/TEIID/Packaging

              https://docs.jboss.org/author/display/TEIID/Deployment

               

              Ramesh..

              • 4. Re: Issue while deploying custom translator with Teiid 8.0
                manoj.m.agarwal

                Hi Ramesh,

                 

                That is kind of comment where i put the translator name. Its not a inner class. I have checked these links already and configured the custom translator according but still i get the error as mentioned before. Can plese you suggest me something  ?

                 

                Thanks !

                Manoj

                • 5. Re: Issue while deploying custom translator with Teiid 8.0
                  rareddy

                  Pls attach your jar file, may be there is more than what you posted here.

                  • 6. Re: Issue while deploying custom translator with Teiid 8.0
                    manoj.m.agarwal

                    Hi Ramesh,

                     

                    After updating service definition to META-INF/services/org.teiid.translator.ExecutionFactory, i pass thru this issue.

                     

                     

                    Thanks !

                    Manoj