1 2 Previous Next 18 Replies Latest reply on Apr 7, 2017 2:36 AM by danielbarbarian

    "XMLStreamException: IOException: Stream closed" after upgrading Infinispan from 8.2.6 to 9.0.0

    danielbarbarian

      I have recently completed an implementation using Infinispan. It is a spring boot application, using JCache JSR-107 with Infinispan 8.2.6 as a provider. It is a maven project so the infinispan dependency configuration were this:

       

      <dependency>
        <groupId>org.infinispan</groupId>
        <artifactId>infinispan-jcache</artifactId>
        <version>8.2.6.Final</version>
      </dependency>

       

      Now I decided to go for version 9.0.0 of Infinispan and hoped all I had to do was to set the version to 9.0.0.Final.

      New dependencies are set to:

       

      <dependency>
        <groupId>org.infinispan</groupId>
        <artifactId>infinispan-jcache</artifactId>
        <version>9.0.0.Final</version>
      </dependency>

      <dependency>
        <groupId>org.infinispan</groupId>
        <artifactId>infinispan-core</artifactId>
        <version>9.0.0.Final</version>
      </dependency>

       

       

      Dependencies resolve fine but as soon as I start to run my unit tests again they all fail. The root cause exception is this:

       

      Caused by: org.infinispan.commons.CacheConfigurationException: javax.xml.stream.XMLStreamException: java.io.IOException: Stream closed

          at org.infinispan.configuration.parsing.ParserRegistry.parse(ParserRegistry.java:120)

          at org.infinispan.jcache.embedded.JCacheManager.getConfigurationBuilderHolder(JCacheManager.java:100)

          at org.infinispan.jcache.embedded.JCacheManager.<init>(JCacheManager.java:56)

          at org.infinispan.jcache.embedded.JCachingProvider.createCacheManager(JCachingProvider.java:46)

          at org.infinispan.jcache.AbstractJCachingProvider.getCacheManager(AbstractJCachingProvider.java:67)

          at org.springframework.boot.autoconfigure.cache.JCacheCacheConfiguration.createCacheManager(JCacheCacheConfiguration.java:108)

          at org.springframework.boot.autoconfigure.cache.JCacheCacheConfiguration.jCacheCacheManager(JCacheCacheConfiguration.java:91)

          at org.springframework.boot.autoconfigure.cache.JCacheCacheConfiguration$$EnhancerBySpringCGLIB$$4400f35a.CGLIB$jCacheCacheManager$1(<generated>)

          at org.springframework.boot.autoconfigure.cache.JCacheCacheConfiguration$$EnhancerBySpringCGLIB$$4400f35a$$FastClassBySpringCGLIB$$387f82ce.invoke(<generated>)

          at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)

          at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:356)

       

       

      In my application.properties I am pointing to an Infinispan xml configuration file (infinispan.xml). The xml has been updated so that is pointing to version 9.0 rather than 8.2 version. I have read the release notes, specifically the Upgrading Guide and although there were items about the xml configuration, I could not see anything that would cause these issues. I also saw a note  (not Infinispan related) that this sometimes this error could occur if validation of the xml fails. But from what I can see the xml is fine. Just in case I have also tried:

      1. Removing everything but the infinispan tags from the xml
      2. Removing the definition tags from the infinispan tag.

       

      I use the following header in the infinispan.xml:

       

      <infinispan
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="urn:infinispan:config:9.0 http://www.infinispan.org/schemas/infinispan-config-9.0.xsd"
         xmlns="urn:infinispan:config:9.0"
      >

       

      What am I doing wrong?

        • 1. Re: "XMLStreamException: IOException: Stream closed" after upgrading Infinispan from 8.2.6 to 9.0.0
          jholusa

          Hi Daniel,

           

          could you please post the whole infinispan.xml configuration file? I would be happy to look into that

           

          Cheers,

          Jiri

          • 2. Re: "XMLStreamException: IOException: Stream closed" after upgrading Infinispan from 8.2.6 to 9.0.0
            danielbarbarian

            That would be great, but part of the issue is that I get the same no matter what I use as a configuration file, valid or not valid, I still get the same exception. This is the most basic valid xml I have used (which produces the exception).:

             

            <infinispan
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="urn:infinispan:config:9.0 http://www.infinispan.org/schemas/infinispan-config-9.0.xsd"
              xmlns="urn:infinispan:config:9.0">

              <cache-container>

              <local-cache name="dummyCache">
              </local-cache>

              </cache-container>

            </infinispan>

            • 3. Re: "XMLStreamException: IOException: Stream closed" after upgrading Infinispan from 8.2.6 to 9.0.0
              jholusa

              Hi Daniel,

               

              I wasn't able to reproduce your exact stacktrace, but let's try something first. A recommended way of adding an Infinispan dependency is to use uberjar, hence replace your existing Infinispan dependencies with:

               

              <dependency>

                <groupId>org.infinispan</groupId>

                <artifactId>infinispan-embedded</artifactId>

                <version>9.0.0.Final</version>

              </dependency>

               

              Does that help? If not, could you please post the whole stacktrace?

               

              Thanks,

              Jiri

              • 4. Re: "XMLStreamException: IOException: Stream closed" after upgrading Infinispan from 8.2.6 to 9.0.0
                danielbarbarian

                I didn't use embedded as it gives me a slf4j log clash. I get that back, but I also get the same exception for some tests. This is the full stacktrace:

                 

                 

                java.lang.IllegalStateException: Failed to load ApplicationContext

                 

                    at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124)

                    at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:83)

                    at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:189)

                    at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:131)

                    at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:230)

                    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:228)

                    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:287)

                    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)

                    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:289)

                    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:247)

                    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94)

                    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)

                    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)

                    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)

                    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)

                    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)

                    at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)

                    at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)

                    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)

                    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)

                    at org.junit.runners.Suite.runChild(Suite.java:128)

                    at org.junit.runners.Suite.runChild(Suite.java:27)

                    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)

                    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)

                    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)

                    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)

                    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)

                    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)

                    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)

                    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)

                    at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:51)

                    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:237)

                    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

                Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'embeddedServletContainerCustomizerBeanPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cache.config.internalCacheAdvisor' defined in class path resource [org/springframework/cache/annotation/ProxyCachingConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cache.interceptor.BeanFactoryCacheOperationSourceAdvisor]: Factory method 'cacheAdvisor' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'cacheAutoConfigurationValidator': Unsatisfied dependency expressed through field 'cacheManager'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'cacheManager' defined in class path resource [org/springframework/boot/autoconfigure/cache/JCacheCacheConfiguration.class]: Unsatisfied dependency expressed through method 'cacheManager' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jCacheCacheManager' defined in class path resource [org/springframework/boot/autoconfigure/cache/JCacheCacheConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.cache.CacheManager]: Factory method 'jCacheCacheManager' threw exception; nested exception is org.infinispan.commons.CacheConfigurationException: javax.xml.stream.XMLStreamException: java.io.IOException: Stream closed

                    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:564)

                    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)

                    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)

                    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)

                    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)

                    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)

                    at org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:235)

                    at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:702)

                    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:527)

                    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:737)

                    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:370)

                    at org.springframework.boot.SpringApplication.run(SpringApplication.java:314)

                    at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:120)

                    at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:98)

                    at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:116)

                    ... 32 more

                Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cache.config.internalCacheAdvisor' defined in class path resource [org/springframework/cache/annotation/ProxyCachingConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cache.interceptor.BeanFactoryCacheOperationSourceAdvisor]: Factory method 'cacheAdvisor' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'cacheAutoConfigurationValidator': Unsatisfied dependency expressed through field 'cacheManager'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'cacheManager' defined in class path resource [org/springframework/boot/autoconfigure/cache/JCacheCacheConfiguration.class]: Unsatisfied dependency expressed through method 'cacheManager' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jCacheCacheManager' defined in class path resource [org/springframework/boot/autoconfigure/cache/JCacheCacheConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.cache.CacheManager]: Factory method 'jCacheCacheManager' threw exception; nested exception is org.infinispan.commons.CacheConfigurationException: javax.xml.stream.XMLStreamException: java.io.IOException: Stream closed

                    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599)

                    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1173)

                    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1067)

                    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)

                    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)

                    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)

                    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)

                    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)

                    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)

                    at org.springframework.aop.framework.autoproxy.BeanFactoryAdvisorRetrievalHelper.findAdvisorBeans(BeanFactoryAdvisorRetrievalHelper.java:92)

                    at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findCandidateAdvisors(AbstractAdvisorAutoProxyCreator.java:101)

                    at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findEligibleAdvisors(AbstractAdvisorAutoProxyCreator.java:87)

                    at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.getAdvicesAndAdvisorsForBean(AbstractAdvisorAutoProxyCreator.java:69)

                    at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:346)

                    at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:298)

                    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:423)

                    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1633)

                    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)

                    ... 46 more

                Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cache.interceptor.BeanFactoryCacheOperationSourceAdvisor]: Factory method 'cacheAdvisor' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'cacheAutoConfigurationValidator': Unsatisfied dependency expressed through field 'cacheManager'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'cacheManager' defined in class path resource [org/springframework/boot/autoconfigure/cache/JCacheCacheConfiguration.class]: Unsatisfied dependency expressed through method 'cacheManager' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jCacheCacheManager' defined in class path resource [org/springframework/boot/autoconfigure/cache/JCacheCacheConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.cache.CacheManager]: Factory method 'jCacheCacheManager' threw exception; nested exception is org.infinispan.commons.CacheConfigurationException: javax.xml.stream.XMLStreamException: java.io.IOException: Stream closed

                    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)

                    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)

                    ... 63 more

                Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'cacheAutoConfigurationValidator': Unsatisfied dependency expressed through field 'cacheManager'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'cacheManager' defined in class path resource [org/springframework/boot/autoconfigure/cache/JCacheCacheConfiguration.class]: Unsatisfied dependency expressed through method 'cacheManager' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jCacheCacheManager' defined in class path resource [org/springframework/boot/autoconfigure/cache/JCacheCacheConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.cache.CacheManager]: Factory method 'jCacheCacheManager' threw exception; nested exception is org.infinispan.commons.CacheConfigurationException: javax.xml.stream.XMLStreamException: java.io.IOException: Stream closed

                    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:588)

                    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)

                    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366)

                    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264)

                    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)

                    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)

                    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)

                    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)

                    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)

                    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)

                    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:296)

                    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)

                    at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:381)

                    at org.springframework.cache.annotation.ProxyCachingConfiguration$$EnhancerBySpringCGLIB$$24e172af.cacheInterceptor(<generated>)

                    at org.springframework.cache.annotation.ProxyCachingConfiguration.cacheAdvisor(ProxyCachingConfiguration.java:46)

                    at org.springframework.cache.annotation.ProxyCachingConfiguration$$EnhancerBySpringCGLIB$$24e172af.CGLIB$cacheAdvisor$1(<generated>)

                    at org.springframework.cache.annotation.ProxyCachingConfiguration$$EnhancerBySpringCGLIB$$24e172af$$FastClassBySpringCGLIB$$e50aa2e.invoke(<generated>)

                    at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)

                    at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:356)

                    at org.springframework.cache.annotation.ProxyCachingConfiguration$$EnhancerBySpringCGLIB$$24e172af.cacheAdvisor(<generated>)

                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                    at java.lang.reflect.Method.invoke(Method.java:498)

                    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)

                    ... 64 more

                Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'cacheManager' defined in class path resource [org/springframework/boot/autoconfigure/cache/JCacheCacheConfiguration.class]: Unsatisfied dependency expressed through method 'cacheManager' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jCacheCacheManager' defined in class path resource [org/springframework/boot/autoconfigure/cache/JCacheCacheConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.cache.CacheManager]: Factory method 'jCacheCacheManager' threw exception; nested exception is org.infinispan.commons.CacheConfigurationException: javax.xml.stream.XMLStreamException: java.io.IOException: Stream closed

                    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)

                    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:467)

                    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1173)

                    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1067)

                    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)

                    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)

                    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)

                    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)

                    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)

                    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)

                    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208)

                    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138)

                    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066)

                    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:585)

                    ... 88 more

                Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jCacheCacheManager' defined in class path resource [org/springframework/boot/autoconfigure/cache/JCacheCacheConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.cache.CacheManager]: Factory method 'jCacheCacheManager' threw exception; nested exception is org.infinispan.commons.CacheConfigurationException: javax.xml.stream.XMLStreamException: java.io.IOException: Stream closed

                    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599)

                    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1173)

                    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1067)

                    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)

                    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)

                    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)

                    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)

                    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)

                    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)

                    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208)

                    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138)

                    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066)

                    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:835)

                    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)

                    ... 101 more

                Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.cache.CacheManager]: Factory method 'jCacheCacheManager' threw exception; nested exception is org.infinispan.commons.CacheConfigurationException: javax.xml.stream.XMLStreamException: java.io.IOException: Stream closed

                    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)

                    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)

                    ... 114 more

                Caused by: org.infinispan.commons.CacheConfigurationException: javax.xml.stream.XMLStreamException: java.io.IOException: Stream closed

                    at org.infinispan.configuration.parsing.ParserRegistry.parse(ParserRegistry.java:120)

                    at org.infinispan.jcache.embedded.JCacheManager.getConfigurationBuilderHolder(JCacheManager.java:100)

                    at org.infinispan.jcache.embedded.JCacheManager.<init>(JCacheManager.java:56)

                    at org.infinispan.jcache.embedded.JCachingProvider.createCacheManager(JCachingProvider.java:46)

                    at org.infinispan.jcache.AbstractJCachingProvider.getCacheManager(AbstractJCachingProvider.java:67)

                    at org.springframework.boot.autoconfigure.cache.JCacheCacheConfiguration.createCacheManager(JCacheCacheConfiguration.java:108)

                    at org.springframework.boot.autoconfigure.cache.JCacheCacheConfiguration.jCacheCacheManager(JCacheCacheConfiguration.java:91)

                    at org.springframework.boot.autoconfigure.cache.JCacheCacheConfiguration$$EnhancerBySpringCGLIB$$aa1866fa.CGLIB$jCacheCacheManager$1(<generated>)

                    at org.springframework.boot.autoconfigure.cache.JCacheCacheConfiguration$$EnhancerBySpringCGLIB$$aa1866fa$$FastClassBySpringCGLIB$$c99ca477.invoke(<generated>)

                    at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)

                    at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:356)

                    at org.springframework.boot.autoconfigure.cache.JCacheCacheConfiguration$$EnhancerBySpringCGLIB$$aa1866fa.jCacheCacheManager(<generated>)

                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                    at java.lang.reflect.Method.invoke(Method.java:498)

                    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)

                    ... 115 more

                Caused by: javax.xml.stream.XMLStreamException: java.io.IOException: Stream closed

                    at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.setInputSource(XMLStreamReaderImpl.java:212)

                    at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.<init>(XMLStreamReaderImpl.java:184)

                    at com.sun.xml.internal.stream.XMLInputFactoryImpl.getXMLStreamReaderImpl(XMLInputFactoryImpl.java:262)

                    at com.sun.xml.internal.stream.XMLInputFactoryImpl.createXMLStreamReader(XMLInputFactoryImpl.java:129)

                    at org.infinispan.configuration.parsing.ParserRegistry.parse(ParserRegistry.java:126)

                    at org.infinispan.configuration.parsing.ParserRegistry.parse(ParserRegistry.java:114)

                    ... 131 more

                Caused by: java.io.IOException: Stream closed

                    at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:159)

                    at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)

                    at java.io.BufferedInputStream.read(BufferedInputStream.java:265)

                    at com.sun.org.apache.xerces.internal.impl.XMLEntityManager$RewindableInputStream.read(XMLEntityManager.java:2890)

                    at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:674)

                    at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.java:1304)

                    at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDocumentEntity(XMLEntityManager.java:1255)

                    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.setInputSource(XMLDocumentScannerImpl.java:253)

                    at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.setInputSource(XMLStreamReaderImpl.java:199)

                    ... 136 more

                • 5. Re: "XMLStreamException: IOException: Stream closed" after upgrading Infinispan from 8.2.6 to 9.0.0
                  jholusa

                  Hmm. I'm no expert on Spring Boot, unfortunately.

                   

                  We can rule out any XML configuration issue, your XML is valid and is fully functional, I tested it manually. Did you really just bumped the version of Infinispan? Are you sure that the Infinispan XML file is provided on the classpath and that the code can find it? I know these are basic questions, but let's be sure

                   

                  Jiri

                  • 6. Re: "XMLStreamException: IOException: Stream closed" after upgrading Infinispan from 8.2.6 to 9.0.0
                    jholusa

                    Just out of curiosity, why did you add the infinispan-core dependency for 9.0.0.Final?

                    • 7. Re: "XMLStreamException: IOException: Stream closed" after upgrading Infinispan from 8.2.6 to 9.0.0
                      danielbarbarian

                      Classpath:
                      Actually at this point I am not sure of anything, but I changed the configuration of the application to point to infinispan2.xml (while the file really is called infinispan.xml) and then I get

                      Caused by: java.lang.IllegalArgumentException: Cache configuration does not exist 'class path resource [infinispan2.xml]'

                       

                      so yes, I would say it is safe to assume that my xml is available and the application is picking it up.

                       

                      In regards to versions. Yes all I did from a working setup to a non-working setup was to bump the version from 8.2.6-Final to 9.0.0-Final (and change the corresponding xml configuration with 9.0 version as shown in my example).

                       

                      Why I was using infinispan-core? Fairly long story, all explained here: ClassNotFoundException after upgrading Infinispan from 8.2.6 to 9.0.0

                      • 8. Re: "XMLStreamException: IOException: Stream closed" after upgrading Infinispan from 8.2.6 to 9.0.0
                        jholusa

                        Could you upload the code somewhere? We could look at it and fix it ourselves, otherwise it's just playing ping pong

                        1 of 1 people found this helpful
                        • 9. Re: "XMLStreamException: IOException: Stream closed" after upgrading Infinispan from 8.2.6 to 9.0.0
                          danielbarbarian

                          I thought of the same thing. I am working on a minimum test case that contains no code directly related to our application. Will get back once that is done.

                          • 10. Re: "XMLStreamException: IOException: Stream closed" after upgrading Infinispan from 8.2.6 to 9.0.0
                            nadirx

                            Daniel, the first stack trace you posted seems partial. Is that all you have ?

                             

                            Tristan

                            • 11. Re: "XMLStreamException: IOException: Stream closed" after upgrading Infinispan from 8.2.6 to 9.0.0
                              danielbarbarian

                              From the very first stacktrace I have more, but the second is about all I have. It seems like the stacktraces produced become very long and they get cut off.

                              • 12. Re: "XMLStreamException: IOException: Stream closed" after upgrading Infinispan from 8.2.6 to 9.0.0
                                nadirx

                                The CacheConfigurationException thrown at

                                org.infinispan.configuration.parsing.ParserRegistry.parse(ParserRegistry.java:120)

                                wraps the actual IOException, but the stack trace doesn't show where it originated. If you could put the full stack trace in pastebin or a gist, that would be great.

                                • 13. Re: "XMLStreamException: IOException: Stream closed" after upgrading Infinispan from 8.2.6 to 9.0.0
                                  danielbarbarian

                                  This is what I got, but I would suspect it is pretty much the same as the long one I already pasted here: Infinispan stack trace - Pastebin.com

                                  • 14. Re: "XMLStreamException: IOException: Stream closed" after upgrading Infinispan from 8.2.6 to 9.0.0
                                    danielbarbarian

                                    So I got a "working" test case now. GitHub - DBarbarian/CacheTest: Test cases of cache implementations

                                     

                                    I have narrowed down the test to the very basics, so there is not even any cache class implementation there, because it wasn't necessary to reproduce the issue. It surfaces during initialization. In the master branch I have the test case for version 9.0.0, after building you can reproduce the error by running "mvn spring-boot:run". I have also created a branch called version-8.2.6 for comparison where I am using version 8.2.6 of inifinispan instead starting up beautifully.

                                    1 2 Previous Next