Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-3473

CDI Cache interceptor tests are failing while running in Tomcat container

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Duplicate Issue
    • 6.0.0.Alpha3
    • None
    • CDI

    Description

      There is a problem with Infinispan CDI interceptors under the Tomcat container.

      While running the infinispan/cdi-extension module's tests under the tomcat container, the following 2 related issues appear:

      1) When the beans.xml contains the definition for the interceptors, as given below:

      <beans xmlns="http://java.sun.com/xml/ns/javaee"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
      
         <interceptors>
            <class&gt;org.infinispan.jcache.annotation.CacheResultInterceptor</class&gt;
            <class&gt;org.infinispan.jcache.annotation.CachePutInterceptor</class&gt;
            <class&gt;org.infinispan.jcache.annotation.CacheRemoveEntryInterceptor</class&gt;
            <class&gt;org.infinispan.jcache.annotation.CacheRemoveAllInterceptor</class&gt;
         </interceptors>
      
         <alternatives>
            <class&gt;org.infinispan.cdi.InjectedCacheResolver</class&gt;
         </alternatives>
      
      </beans>
      

      Then while the deployment on the container, the following exception is thrown:

      org.jboss.weld.exceptions.DeploymentException: WELD-001416 Enabled interceptor class [<class&gt;org.infinispan.jcache.annotation.CacheResultInterceptor</class&gt; in jar:file:/home/anna.manukyan/.jenkins/jobs/invm-tomcat/workspace/tomcat-server/jboss-ews-2.0/tomcat7/webapps/test/WEB-INF/lib/infinispan-jcache.jar!/META-INF/beans.xml@7, <class&gt;org.infinispan.jcache.annotation.CachePutInterceptor</class&gt; in jar:file:/home/anna.manukyan/.jenkins/jobs/invm-tomcat/workspace/tomcat-server/jboss-ews-2.0/tomcat7/webapps/test/WEB-INF/lib/infinispan-jcache.jar!/META-INF/beans.xml@8, <class&gt;org.infinispan.jcache.annotation.CacheRemoveEntryInterceptor</class&gt; in jar:file:/home/anna.manukyan/.jenkins/jobs/invm-tomcat/workspace/tomcat-server/jboss-ews-2.0/tomcat7/webapps/test/WEB-INF/lib/infinispan-jcache.jar!/META-INF/beans.xml@9, <class&gt;org.infinispan.jcache.annotation.CacheRemoveAllInterceptor</class&gt; in jar:file:/home/anna.manukyan/.jenkins/jobs/invm-tomcat/workspace/tomcat-server/jboss-ews-2.0/tomcat7/webapps/test/WEB-INF/lib/infinispan-jcache.jar!/META-INF/beans.xml@10, <class&gt;org.infinispan.jcache.annotation.CacheResultInterceptor</class&gt; in jndi:/localhost/test/WEB-INF/beans.xml@29, <class&gt;org.infinispan.jcache.annotation.CachePutInterceptor</class&gt; in jndi:/localhost/test/WEB-INF/beans.xml@30, <class&gt;org.infinispan.jcache.annotation.CacheRemoveEntryInterceptor</class&gt; in jndi:/localhost/test/WEB-INF/beans.xml@31, <class&gt;org.infinispan.jcache.annotation.CacheRemoveAllInterceptor</class&gt; in jndi:/localhost/test/WEB-INF/beans.xml@32] specified twice
      	at org.jboss.weld.manager.Enabled.createMetadataMap(Enabled.java:123)
      	at org.jboss.weld.manager.Enabled.<init>(Enabled.java:96)
      	at org.jboss.weld.manager.Enabled.of(Enabled.java:79)
      	at org.jboss.weld.bootstrap.BeanDeployment.<init>(BeanDeployment.java:114)
      	at org.jboss.weld.bootstrap.WeldBootstrap$DeploymentVisitor.visit(WeldBootstrap.java:183)
      	at org.jboss.weld.bootstrap.WeldBootstrap$DeploymentVisitor.visit(WeldBootstrap.java:152)
      	at org.jboss.weld.bootstrap.WeldBootstrap.startContainer(WeldBootstrap.java:283)
      	at org.jboss.weld.environment.servlet.Listener.contextInitialized(Listener.java:151)
      	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791)
      	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285)
      	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
      	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
      	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618)
      	at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:963)
      	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:537)
      	at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1468)
      	at sun.reflect.GeneratedMethodAccessor27.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:601)
      	at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
      	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
      	at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:791)
      	at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1444)
      	at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:677)
      	at org.apache.catalina.manager.ManagerServlet.doPut(ManagerServlet.java:435)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:644)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      	at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
      	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:581)
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
      	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
      	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
      	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
      	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
      	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      	at java.lang.Thread.run(Thread.java:722)
      

      If there is no need declare the interceptors in the beans.xml (as far as I know it is necessary), then please let me know and ignore this case.

      2) When the interceptors declaration is commented, then the interceptors doesn't work properly. So all tests located under the package org.infinispan.cdi.test.interceptor.* are failing with assertion errors.

      Please note that this behaviour is noticed for infinispan 6.0.0.Alpha3. It is not tried for the earlier versions.

      Attachments

        Issue Links

          Activity

            People

              gzamarre Galder ZamarreƱo
              amanukya@redhat.com Anna Manukyan
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: