0 Replies Latest reply on Jul 7, 2015 7:43 AM by Brajendra Singh

    Caused by: java.lang.ClassNotFoundException: org.jgroups.Channel from [Module "deployment

    Brajendra Singh Newbie

      Hi,

       

        We are trying to configure second level cache replication using ehcache-core-2.6.11.jar, ehcache-jgroupsreplication-1.7.jar and hibernate-3.3.2.jar with JBoss AS 7.5.0 and All these jars are placed under WEB-INF/lib directory.

      When we start jboss, getting following Exception in our logs.

       

      net.sf.ehcache.CacheException: java.lang.NoClassDefFoundError: org/jgroups/Channel

          at net.sf.ehcache.CacheManager.init(CacheManager.java:401)

          at net.sf.ehcache.CacheManager.<init>(CacheManager.java:317)

          at org.hibernate.cache.EhCacheProvider.start(EhCacheProvider.java:134)

          at org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge.start(RegionFactoryCacheProviderBridge.java:72)

          at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:221)

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

          at com.deploy.atao.persist.hibernate.HibernateFactory.build(HibernateFactory.java:142)

          at com.deploy.atao.persist.hibernate.HibernateFactory.haltOnBuilding(HibernateFactory.java:315)

          at com.deploy.atao.persist.hibernate.HibernateFactory.getSessionFactory(HibernateFactory.java:283)

          at com.deploy.atao.persist.hibernate.HibSessionData.getSession(HibSessionData.java:107)

          at com.deploy.atao.persist.hibernate.HibSessionData.<init>(HibSessionData.java:70)

          at com.deploy.atao.persist.SessionFactory.getSession(SessionFactory.java:43)

          at com.deploy.atao.persist.SessionFactory.getSession(SessionFactory.java:58)

          at com.deploy.atao.persist.SessionProvider.get(SessionProvider.java:28)

          at com.deploy.atao.persist.SessionProvider.get(SessionProvider.java:18)

          at com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:58)

          at com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)

          at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)

          at com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)

          at com.google.inject.Scopes$1$1.get(Scopes.java:54)

          at com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)

          at com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)

          at com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)

          at com.google.inject.SingleMethodInjector.inject(SingleMethodInjector.java:84)

          at com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:99)

          at com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:94)

          at com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)

          at com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)

          at com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)

          at com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)

          at com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)

          at com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)

          at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)

          at com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)

          at com.google.inject.Scopes$1$1.get(Scopes.java:54)

          at com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)

          at com.google.inject.SingleFieldInjector.inject(SingleFieldInjector.java:56)

          at com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:99)

          at com.google.inject.MembersInjectorImpl$1.call(MembersInjectorImpl.java:76)

          at com.google.inject.MembersInjectorImpl$1.call(MembersInjectorImpl.java:74)

          at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:804)

          at com.google.inject.MembersInjectorImpl.injectAndNotify(MembersInjectorImpl.java:74)

          at com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:61)

          at com.google.inject.InjectorImpl.injectMembers(InjectorImpl.java:726)

          at com.deploy.atao.utils.ClassFactory.injectDependencies(ClassFactory.java:68)

          at com.deploy.application.scheduledjob.handlers.ScheduledJobHandlerBase.init(ScheduledJobHandlerBase.java:100)

          at com.deploy.application.scheduledjob.handlers.JobScheduler.init(JobScheduler.java:63)

          at com.deploy.atao.scheduler.quartz.QuartzJob.execute(QuartzJob.java:86)

          at com.deploy.atao.scheduler.quartz.QuartzJob.execute(QuartzJob.java:41)

          at org.quartz.core.JobRunShell.run(JobRunShell.java:202)

          at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)

       

      Caused by: java.lang.NoClassDefFoundError: org/jgroups/Channel

          at net.sf.ehcache.distribution.jgroups.JGroupsCacheManagerPeerProviderFactory.createCachePeerProvider(JGroupsCacheManagerPeerProviderFactory.java:69)

          at net.sf.ehcache.config.ConfigurationHelper.createCachePeerProviders(ConfigurationHelper.java:132)

          at net.sf.ehcache.CacheManager.configure(CacheManager.java:721)

          at net.sf.ehcache.CacheManager.doInit(CacheManager.java:439)

          at net.sf.ehcache.CacheManager.init(CacheManager.java:377)

       

          ... 50 more

       

      Caused by: java.lang.ClassNotFoundException: org.jgroups.Channel from [Module "deployment.atao.ear.atao.war:main" from Service Module Loader]

          at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:447)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:414)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:414)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389)

          at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134)

          at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)

       

       

      We are able to resolve this issue by copying jgroups-3.2.13.Final.jar into WEB-INF/lib directory but we don't want to copy this jar from "org.jgruops" module to WEB-INF/lib directory. Can any one suggest me how to use jgroups-3.2.13.Final.jar from "org.jgruops" instead of making duplicate jar in WEB-INF/lib dierctory?

       

      We also tried by adding dependency org.jgroups in jboss-deployment-structure.xml but it didn't help.

       

      <?xml version="1.0" encoding="UTF-8"?>

      <jboss-deployment-structure>

      <deployment>

          <dependencies>

              <module  name="org.jgroups" slot="main"/>

          </dependencies>

      </deployment>

      </jboss-deployment-structure>

       

      Thanks in Advance!!