10 Replies Latest reply on Jan 1, 2017 4:12 PM by van.halbert

    Teiid with Infinispan as external materialized view

    vijaynm

      I could not find any information on how to configure Infinispan module in Teiid 9.1.1. There are few references around configuring the resource-adapter not the module.

       

      Please provide any references. Thanks

       

      I am getting below error in Teiid 9.1.1, after configuring the resource-adapter using the reference provided @ Infinispan-DSL Data Sources - Teiid 9.0 (draft) - Project Documentation Editor

       

      15:54:07,864 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 60)  MSC000001: Failed to start service jboss.ra.deployer.infinispanRemQS: org.jboss.msc.service.StartException in service jboss.ra.deployer.infinispanRemQS: WFLYJCA0046: Failed to start RA deployment [infinispanRemQS]

        at org.jboss.as.connector.services.resourceadapters.deployment.ResourceAdapterDeploymentService$1.run(ResourceAdapterDeploymentService.java:174)

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

        at java.lang.Thread.run(Thread.java:745)

        at org.jboss.threads.JBossThread.run(JBossThread.java:320)

      Caused by: org.jboss.jca.deployers.common.DeployException: IJ020056: Deployment failed: file:/Users/vijay/Tools/teiid-9.1.1/modules/system/layers/dv/org/jboss/teiid/resource-adapter/infinispan/hotrod/main/

        at org.jboss.jca.deployers.common.AbstractResourceAdapterDeployer.createObjectsAndInjectValue(AbstractResourceAdapterDeployer.java:2029)

        at org.jboss.as.connector.services.resourceadapters.deployment.ResourceAdapterDeploymentService$WildFLyRaDeployer.doDeploy(ResourceAdapterDeploymentService.java:226)

        at org.jboss.as.connector.services.resourceadapters.deployment.ResourceAdapterDeploymentService.start(ResourceAdapterDeploymentService.java:124)

        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)

        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

        at java.lang.Thread.run(Thread.java:745)

      Caused by: org.jboss.jca.validator.ValidatorException: Severity: ERROR

      Section: 6.5.3.2

      Description: A ManagedConnectionFactory must implement a "public int hashCode()" method.

      Code: org.teiid.resource.adapter.infinispan.hotrod.InfinispanManagedConnectionFactory

       

      Severity: ERROR

      Section: 6.5.3.2

      Description: A ManagedConnectionFactory must implement a "public boolean equals(Object)" method.

      Code: org.teiid.resource.adapter.infinispan.hotrod.InfinispanManagedConnectionFactory

       

        ... 8 more

        • 1. Re: Teiid with Infinispan as external materialized view
          van.halbert

          Hi Vijay,

           

          Can you please post the resource-adapter section from your standalone config file?

           

          Also, in the meantime, can you take a look up the current docs [1].

           

           

          [1]  Infinispan HotRod Data Sources · Teiid Documentation

           

          Thanks.

           

          Van

          • 2. Re: Teiid with Infinispan as external materialized view
            vijaynm

            Hi Van,

             

            I have made few changes to the standalone.xml and module.xml, I am getting bellow error now.

             

            14:11:28,435 INFO  [org.jboss.as.ejb3] (MSC service thread 1-8)  WFLYEJB0481: Strict pool slsb-strict-max-pool is using a max instance size of 128 (per class), which is derived from thread worker pool sizing.

            14:11:28,523 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 50)  WFLYCTL0013: Operation ("add") failed - address: ([

                ("subsystem" => "resource-adapters"),

                ("resource-adapter" => "java:/infinispanRemoteHotRod")

            ]) - failure description: "WFLYJCA0073: Failed to load module for RA [org.jboss.teiid.resource-adapter.infinispan.hotrod]"

            14:11:28,534 INFO  [org.jboss.as.connector.deployers.RADeployer] (MSC service thread 1-3)  IJ020001: Required license terms for file:/Users/vijay/Tools/teiid-9.1.1/modules/system/layers/dv/org/jboss/teiid/resource-adapter/salesforce/main/

             

            Please find the resource adapter configuration below, I am using open source infinispan 8.2.5 not JDG. My teiid version is 9.1.1.

             

            The document link you shared says minimum of JDG 6.2 or JDG 6.6, does it mean I cannot use its upstream project Infinispan?

             

            standalone.xml

            <resource-adapter id="java:/infinispanRemoteHotRod">

              <module slot="main" id="org.jboss.teiid.resource-adapter.infinispan.hotrod"/>

              <connection-definitions>

              <connection-definition class-name="org.teiid.resource.adapter.infinispan.hotrod.InfinispanManagedConnectionFactory" jndi-name="java:/infinispanRemote" enabled="true" use-java-context="true" pool-name="infinispanRemote">

              <!-- module name to load the cache classes from -->

              <config-property name="StagingCacheName">

              addressbook_indexed

              </config-property>

              <config-property name="AliasCacheName">

              aliasCache

              </config-property>

              <config-property name="RemoteServerList">

              127.0.0.1:11322

              </config-property>

              </connection-definition>

              </connection-definitions>

            </resource-adapter>

             

            module.xml

            <module xmlns="urn:jboss:module:1.3" name="org.jboss.teiid.resource-adapter.infinispan.hotrod" >

                <properties>

                    <property name="jboss.api" value="private"/>

                </properties>

              

                <resources>

                    <resource-root path="connector-infinispan-hotrod-9.1.1.jar" />

                    <resource-root path="infinispan-commons-8.2.5.Final.jar"/>

                </resources>

             

                <dependencies>

                    <module name="javax.api" />

                    <module name="javax.resource.api" />

                    <module name="org.jboss.teiid.common-core" />

                    <module name="org.jboss.teiid.api" />  

              <module name="org.jboss.teiid.translator.infinispan.hotrod" export="true" />

              </dependencies>

            </module>

            • 3. Re: Teiid with Infinispan as external materialized view
              van.halbert

              JDG was integrated as if it was a 3rd party data source.  And the integration relies on the JDG EAP kits that are provided (e.g., hot rod client) to be configured a certain way.  In this case, modules are configured under a certain slot.   For Teiid 8.12 it expects slot "jdg-6.6" and the current Teiid 9.x, it is expecting slot "jdg-7.0" (and this will soon be updated to be jdg-7.1 to match the JDG 7.x product release.

              • 4. Re: Teiid with Infinispan as external materialized view
                van.halbert

                Vijay,

                 

                Thanks for pointing out a whole in the documentation.  I've logged https://issues.jboss.org/browse/TEIID-4657 to update documentation.

                 

                Van

                • 5. Re: Teiid with Infinispan as external materialized view
                  van.halbert

                  If you are interested in seeing an example, take a look at https://github.com/vhalbert/jdv-jdg-integrations

                   

                  The initial usecase is using JDG for external materialization.   The use case for accessing as a data source is similar, and will be added soon.

                  • 6. Re: Teiid with Infinispan as external materialized view
                    vijaynm

                    Thanks Van for the reply.

                     

                    I tried to follow the instructions from the github link. While executing the create-jdg-resource-adapter.cli I got below error

                     

                    TEIID_BIN$ ./jboss-cli.sh --file=../jdv-jdg-integrations-master/jdv-ext-mat-jdg/cli/create-jdg-resource-adapter.cli

                    {

                        "outcome" => "failed",

                        "failure-description" => {"WFLYCTL0080: Failed services" => {"jboss.ra.deployer.ispnHotrod" => "org.jboss.msc.service.StartException in service jboss.ra.deployer.ispnHotrod: WFLYJCA0046: Failed to start RA deployment [ispnHotrod]

                        Caused by: org.jboss.jca.deployers.common.DeployException: IJ020056: Deployment failed: file:/Users/vijay/Tools/teiid-9.1.1/modules/system/layers/dv/org/jboss/teiid/resource-adapter/infinispan/hotrod/main/

                        Caused by: java.lang.NoClassDefFoundError: org/infinispan/commons/marshall/Marshaller

                        Caused by: java.lang.ClassNotFoundException: org.infinispan.commons.marshall.Marshaller from [Module \"org.jboss.teiid.resource-adapter.infinispan.hotrod:main\" from local module loader @18ef96 (finder: local module finder @6956de9 (roots: /Users/vijay/Tools/teiid-9.1.1/modules,/Users/vijay/Tools/teiid-9.1.1/modules/system/layers/dv,/Users/vijay/Tools/teiid-9.1.1/modules/system/layers/base))]"}},

                        "rolled-back" => true

                    }

                     

                    then I added below module dependencies to org.jboss.teiid.resource-adapter.infinispan.hotrod module

                     

                    <module name="org.infinispan.commons" optional="true" services="import"/>
                    <module name="org.infinispan.client.hotrod" optional="true" services="import"/>
                    <module name="org.infinispan.protostream" optional="true" services="import" />

                       

                    now getting

                     

                    TEIID_BIN$ ./jboss-cli.sh --file=../jdv-jdg-integrations-master/jdv-ext-mat-jdg/cli/create-jdg-resource-adapter.cli

                    {

                        "outcome" => "failed",

                        "failure-description" => {"WFLYCTL0080: Failed services" => {"jboss.ra.deployer.ispnHotrod" => "org.jboss.msc.service.StartException in service jboss.ra.deployer.ispnHotrod: WFLYJCA0046: Failed to start RA deployment [ispnHotrod]

                        Caused by: org.jboss.jca.deployers.common.DeployException: IJ020056: Deployment failed: file:/Users/vijay/Tools/teiid-9.1.1/modules/system/layers/dv/org/jboss/teiid/resource-adapter/infinispan/hotrod/main/

                        Caused by: org.jboss.jca.validator.ValidatorException: Severity: ERROR

                    Section: 6.5.3.2

                    Description: A ManagedConnectionFactory must implement a \"public int hashCode()\" method.

                    Code: org.teiid.resource.adapter.infinispan.hotrod.InfinispanManagedConnectionFactory

                     

                    Severity: ERROR

                    Section: 6.5.3.2

                    Description: A ManagedConnectionFactory must implement a \"public boolean equals(Object)\" method.

                    Code: org.teiid.resource.adapter.infinispan.hotrod.InfinispanManagedConnectionFactory

                    "}},

                        "rolled-back" => true

                    }

                    • 7. Re: Teiid with Infinispan as external materialized view
                      van.halbert

                      Vijay,

                       

                      I'm sorry, I lead you down the wrong trail for Teiid 9 example.  That link was an example for using JDV 6 (Teiid 8.12) and JDG.  And the setup process would be running everything for you, you wouldn't need to run any cli scripts directly.

                       

                      For the quickstarts that align with Teiid 9, take a look at the teiid-quickstarts:  GitHub - teiid/teiid-quickstarts: Quick starts for Teiid    There are 4 jdg examples.

                       

                      Again, I apologize for incorrectly directing you.

                       

                      Van

                      • 8. Re: Teiid with Infinispan as external materialized view
                        vijaynm

                        Thanks Van

                        I moved onto other priority tasks as this was taking lot of time, but yesterday I was able to resolve this.

                         

                        I am not sure why JCA validator is throwing exception, even though the InfinispanManagedConnectionFactory overrides hashCode and equals methods, may be a bug in JBoss implementation, I am not sure.

                         

                        I was able to resolve the issue by turning off the JCA archive validation, which I don't like, but as of now I could not find any other option.

                         

                        <archive-validation enabled="false" fail-on-error="true" fail-on-warn="false"/>

                        • 9. Re: Teiid with Infinispan as external materialized view
                          vijaynm

                          Not related to the above issue, but I found another weird issue

                           

                          17:23:32,096 WARN  [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (Worker1_async-teiid-threads1)  IJ000604: Throwable while attempting to get a new connection: null: java.lang.ClassCastException: org.infinispan.protostream.annotations.ProtoSchemaBuilder cannot be cast to org.infinispan.protostream.annotations.ProtoSchemaBuilder

                            at org.teiid.resource.adapter.infinispan.hotrod.schema.AnnotationSchema.registerSchema(AnnotationSchema.java:64)

                            at org.teiid.resource.adapter.infinispan.hotrod.InfinispanManagedConnectionFactory.registerWithCacheManager(InfinispanManagedConnectionFactory.java:697)

                           

                          and

                           

                          15:20:39,886 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 60)  MSC000001: Failed to start service jboss.ra.deployment."org.jboss.teiid.resource-adapter.infinispan.hotrod:main_infinispanRemMatRA": org.jboss.msc.service.StartException in service jboss.ra.deployment."org.jboss.teiid.resource-adapter.infinispan.hotrod:main_infinispanRemMatRA": WFLYJCA0046: Failed to start RA deployment [infinispanRemMatRA]

                            at org.jboss.as.connector.services.resourceadapters.deployment.AbstractResourceAdapterDeploymentService$2.run(AbstractResourceAdapterDeploymentService.java:318)

                            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

                            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

                            at java.lang.Thread.run(Thread.java:745)

                            at org.jboss.threads.JBossThread.run(JBossThread.java:320)

                          Caused by: org.jboss.jca.deployers.common.DeployException: IJ020060: Unable to inject: org.teiid.resource.adapter.infinispan.hotrod.ExilantInfinispanManagedConnectionFactory property: StagingCacheName value: addressbook_indexed_mat

                            at org.jboss.jca.deployers.common.AbstractResourceAdapterDeployer.createObjectsAndInjectValue(AbstractResourceAdapterDeployer.java:1394)

                            at org.jboss.as.connector.services.resourceadapters.deployment.ResourceAdapterXmlDeploymentService$WildFlyRaXmlDeployer.doDeploy(ResourceAdapterXmlDeploymentService.java:173)

                            at org.jboss.as.connector.services.resourceadapters.deployment.ResourceAdapterXmlDeploymentService.start(ResourceAdapterXmlDeploymentService.java:116)

                            at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)

                            at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)

                            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

                            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

                            at java.lang.Thread.run(Thread.java:745)

                           

                          Some of these errors messages are very misleading, specially the second one, which is the result of not having protostream jar in the class path.

                          • 10. Re: Teiid with Infinispan as external materialized view
                            van.halbert

                            Sorry for your issues.

                             

                            We are in the process of making the changes to support the upcoming JDG 7.1 (from 7.0), which requires changed in Teiid.   You maybe hitting some of those related issues, but the full extent of the changes have not been completely finished at this time.

                             

                            You can follow this jira as to when these changes are completed:  [TEIID-4518] Add support for JDG 7.1 - JBoss Issue Tracker

                             

                            Van