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

javax.transaction dependency should be compile

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Blocker Blocker
    • 8.0.0.Final
    • 8.0.0.CR1
    • Build
    • None

      ISPN-5541 made all javax dependencies provided, including javax.transaction. This dependency though is needed for building transactional configuration, even if you're using no transactional configurations. E.g. constructing new DefaultCacheManager() without that dependency throws:

      Exception in thread "main" java.lang.NoClassDefFoundError: javax/transaction/TransactionManager
      	at org.infinispan.configuration.cache.TransactionConfiguration.<clinit>(TransactionConfiguration.java:30)
      	at org.infinispan.configuration.cache.TransactionConfigurationBuilder.<init>(TransactionConfigurationBuilder.java:37)
      	at org.infinispan.configuration.cache.ConfigurationBuilder.<init>(ConfigurationBuilder.java:53)
      	at org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:213)
      	at org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:134)
      	at org.infinispan.tutorial.simple.functional.InfinispanFunctional.main(InfinispanFunctional.java:22)
      	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:497)
      	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
      Caused by: java.lang.ClassNotFoundException: javax.transaction.TransactionManager
      	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      	... 11 more
      

      The quick fix is to reinstate not-provided for javax.transaction. Longer term, this dependency should not kick in unless you have a transactional cache configuration.

              ttarrant@redhat.com Tristan Tarrant
              rh-ee-galder Galder ZamarreƱo
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: