2 Replies Latest reply on Aug 19, 2014 8:30 AM by Felipe Reis

    Infinispan start fails with java.lang.UnsupportedClassVersionError

    Felipe Reis Newbie

      I have configured Infinispan to start eagerly in Jboss 7.1.1.Final

       

              <subsystem xmlns="urn:jboss:domain:infinispan:1.2" default-cache-container="hibernate">
                  <cache-container name="hibernate" default-cache="local-query" jndi-name="infinispan/hibernate" start="EAGER">
                      <local-cache name="entity">
                          <transaction mode="NON_XA"/>
                          <eviction strategy="LRU" max-entries="10000"/>
                          <expiration max-idle="100000"/>
                      </local-cache>
                      <local-cache name="local-query">
                          <transaction mode="NONE"/>
                          <eviction strategy="LRU" max-entries="10000"/>
                          <expiration max-idle="100000"/>
                      </local-cache>
                      <local-cache name="timestamps">
                          <transaction mode="NONE"/>
                          <eviction strategy="NONE"/>
                      </local-cache>
                  </cache-container>
              </subsystem>
      

       

      When I start the server I'm getting the following error:

       

       

      22:43:33,077 ERROR [stderr] (pool-3-thread-1) Exception in thread "pool-3-thread-1" java.lang.UnsupportedClassVersionError: java/util/concurrent/atomic/LongAdder : Unsupported major.minor version 52.0
      22:43:33,081 ERROR [stderr] (pool-3-thread-1) at java.lang.ClassLoader.findBootstrapClass(Native Method)
      22:43:33,081 ERROR [stderr] (pool-3-thread-1) at java.lang.ClassLoader.findBootstrapClassOrNull(ClassLoader.java:1070)
      22:43:33,082 ERROR [stderr] (pool-3-thread-1) at java.lang.ClassLoader.loadClass(ClassLoader.java:414)
      22:43:33,084 ERROR [stderr] (pool-3-thread-1) at java.lang.ClassLoader.loadClass(ClassLoader.java:412)
      22:43:33,086 ERROR [stderr] (pool-3-thread-1) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
      22:43:33,086 ERROR [stderr] (pool-3-thread-1) at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
      22:43:33,108 ERROR [stderr] (pool-3-thread-1) at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:395)
      22:43:33,109 ERROR [stderr] (pool-3-thread-1) at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
      22:43:33,110 ERROR [stderr] (pool-3-thread-1) at java.lang.Class.forName0(Native Method)
      22:43:33,112 ERROR [stderr] (pool-3-thread-1) at java.lang.Class.forName(Class.java:190)
      22:43:33,113 ERROR [stderr] (pool-3-thread-1) at org.infinispan.util.concurrent.ConcurrentMapFactory.<clinit>(ConcurrentMapFactory.java:103)
      22:43:33,114 ERROR [stderr] (pool-3-thread-1) at org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:140)
      22:43:33,116 ERROR [stderr] (pool-3-thread-1) at org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:244)
      22:43:33,117 ERROR [stderr] (pool-3-thread-1) at org.jboss.as.clustering.infinispan.DefaultEmbeddedCacheManager.<init>(DefaultEmbeddedCacheManager.java:86)
      22:43:33,149 ERROR [stderr] (pool-3-thread-1) at org.jboss.as.clustering.infinispan.subsystem.EmbeddedCacheManagerService.start(EmbeddedCacheManagerService.java:65)
      22:43:33,152 ERROR [stderr] (pool-3-thread-1) at org.jboss.as.clustering.msc.AsynchronousService$1.run(AsynchronousService.java:59)
      22:43:33,154 ERROR [stderr] (pool-3-thread-1) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      22:43:33,155 ERROR [stderr] (pool-3-thread-1) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      22:43:33,157 ERROR [stderr] (pool-3-thread-1) at java.lang.Thread.run(Thread.java:745)
      

       

      If I remove the start="EAGER" bit the server starts normally

       

      I'm using jdk1.7.0_67

        • 1. Re: Infinispan start fails with java.lang.UnsupportedClassVersionError
          Wolf-Dieter Fink Master

          Class-Version 52.0 is Java8, as you use Java7 to start the classloading will fail

          Did you compile something with Java8 or use libraries from Java8 (maybe by accident) ?

          1 of 1 people found this helpful
          • 2. Re: Infinispan start fails with java.lang.UnsupportedClassVersionError
            Felipe Reis Newbie

            Thanks Wolf, I must have done some compiling using a JDK 1.8 installation. I have clean the temp folders and tried again and it that exception no longer happens.

             

            At startup I get the following INFO:

             

            09:25:39,910 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 31) JBAS010280: Activating Infinispan subsystem.

             

            However I'm getting an exception as soon as Infinispan tries to start up the first cache region:

             

            09:25:56,461 INFO  [org.jboss.as.clustering.infinispan] (MSC service thread 1-4) JBAS010281: Started myapp-web.war#myPersistenceUnit.com.mycompany.MyCachedEntity cache from hibernate container

            09:25:56,469 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.persistenceunit."myapp-web.war#myPersistenceUnit": org.jboss.msc.service.StartException in service jboss.persistenceunit."myapp-web.war#myPersistenceUnit": Failed to start service

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_67]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_67]

              at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_67]

            Caused by: java.lang.NullPointerException

              at org.hibernate.cache.infinispan.InfinispanRegionFactory.getCache(InfinispanRegionFactory.java:445)

              at org.hibernate.cache.infinispan.InfinispanRegionFactory.buildEntityRegion(InfinispanRegionFactory.java:198)

              at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:339)

              at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1737)

              at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:84)

              at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:904)

              at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:889)

              at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73)

              at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:162)

              at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.start(PersistenceUnitServiceImpl.java:85)

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

              ... 3 more