4 Replies Latest reply on May 24, 2017 7:26 AM by Galder Zamarreño

    9.0.0.final with Spring Boot

    Adrian Smith Newbie

      Upgrading to 9.0.0.Final causes be lots of issues due to the inclusion of org.jboss.slf4j.JbossLoggerFactory in the infinispan-embedded jar which clashes with other logging.

       

      I wonder if this is good idea to include these classes directly?

       

      Thanks.

        • 1. Re: 9.0.0.final with Spring Boot
          Sebastian Łaskawiec Apprentice

          Uber Jars (such as infinispan-embedded) aim for simple deployment scenarios. Your app seems to be a bit more complicated and therefore you'd probably need to use inifinispan-spring-boot-starter + infinispan-core + infinispan-spring4-embedded or just inifinispan-spring-boot-starter for client/server scenario.

           

          If that won't work, could you please paste me your dependency tree (obtained by mvn dependency:tree)?

          • 2. Re: 9.0.0.final with Spring Boot
            Adrian Smith Newbie

            Thanks for the reply.

             

            FYI - using Gradle I find that if I have a dependency for the embedded jar also brings in core and many others as additional dependencies. Not sure if this is what's intended?

             

            Anyhow, I have changed to just using core and that makes life easier - so thanks for that.

             

            I'm interested in using the spring-boot-starter, but some of the documentation is a little lightweight at the moment. I attach my Java based Spring configuration below and wonder if you have any comments about it in general and, in particular, if I could achieve the same using the Spring-Boot starter?

            • 3. Re: 9.0.0.final with Spring Boot
              Sebastian Łaskawiec Apprentice

              FYI - using Gradle I find that if I have a dependency for the embedded jar also brings in core and many others as additional dependencies. Not sure if this is what's intended?

              Definitely not! It's a bug. I created [ISPN-7849] Uber jars have lots of compile-time dependencies - JBoss Issue Tracker to fix it. In the meantime, feel free to exclude all those compile-time dependencies. The Uber Jar should work without them (but those provided are necessary, those are APIs).

               

              Thanks for noticing it. I don't know how it got slipped under our radar.

              Anyhow, I have changed to just using core and that makes life easier - so thanks for that.

              This is the suggested way... try it out with Uber Jars but when in trouble, switch to small jars.

              I'm interested in using the spring-boot-starter, but some of the documentation is a little lightweight at the moment. I attach my Java based Spring configuration below and wonder if you have any comments about it in general and, in particular, if I could achieve the same using the Spring-Boot starter?

              You could probably use InfinispanCacheConfigurer to replace defaultCacheManager producer. Apart from that and simplifying dependencies tree there's not much you can do. Your configuration is pretty advanced. I personally would even leave all the configuration bits as they are now (but please take this advice with a grain of salt, I don't know much about your use case).

              • 4. Re: 9.0.0.final with Spring Boot
                Galder Zamarreño Master

                I've seen some examples out there of uber jars in maven projects. This is not recommended as you can see.

                 

                If using gradle/maven, just don't use uber jars. Uber jars are for those still on ant or more lower level tools.