Search code examples
javahibernatepluginsjava.util.concurrentswtbot

java.lang.NoClassDefFoundError: edu/emory/mathcs/backport/java/util/concurrent/BlockingQueue


I am working with SWTBot, and created a plugin in order to test my application's GUI. At the point i have been able to initiate the bot, but i am not getting the following exception when testing the product:

java.lang.NoClassDefFoundError: edu/emory/mathcs/backport/java/util/concurrent/BlockingQueue
    at net.sf.ehcache.config.ConfigurationHelper.createCache(ConfigurationHelper.java:418)
    at net.sf.ehcache.config.ConfigurationHelper.createDefaultCache(ConfigurationHelper.java:334)
    at net.sf.ehcache.CacheManager.configure(CacheManager.java:306)
    at net.sf.ehcache.CacheManager.init(CacheManager.java:226)
    at net.sf.ehcache.CacheManager.<init>(CacheManager.java:213)
    at net.sf.ehcache.hibernate.EhCacheProvider.start(EhCacheProvider.java:127)
    at org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge.start(RegionFactoryCacheProviderBridge.java:72)
    at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:250)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1385)
    at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:954)

It happens when the program tries to build a session factory in Hibernate. I've been googling a lot and most of the answers i found are related with maven/spring usage, which is not what i am using.

The problem seems to be the lack of backport.util.concurrent.jar, which is (or should be) included in the java.util.concurrent.jar.

I managed to create a plugin from the backport.util.concurrent.jar and include it in my target-definitions, but the problem still persists.

Does anyone have a clue of how this problem can be solved? Any help will be much appreciated.

Thanks in advance!


Solution

  • I figured it out. I thought the problem was in my swtbot tester plugin, but it was indeed in one of the several plugins present in the product i am testing. Solution was to add the dependency in the correct plugin of the product (instead of adding it in the swtbot tester plugin).

    Thanks anyway