Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.NoClassDefFoundError: org/terracotta/entity/SyncMessageCodec #1535

Closed
mathieucarbou opened this issue Oct 12, 2016 · 2 comments
Closed

Comments

@mathieucarbou
Copy link
Member

mathieucarbou commented Oct 12, 2016

Is there a packaging issue with the latest ehcache dependency ? I have a project depending on:

<dependency>
  <groupId>org.ehcache</groupId>
  <artifactId>ehcache-clustered</artifactId>
  <version>3.2.0-SNAPSHOT</version>
</dependency>

When creating a clustered CM, I have the exception:

java.lang.NoClassDefFoundError: org/terracotta/entity/SyncMessageCodec
    at org.ehcache.clustered.client.internal.lock.VoltronReadWriteLockEntityClientService.getMessageCodec(VoltronReadWriteLockEntityClientService.java:52)
    at com.terracotta.connection.entity.TerracottaEntityRef.fetchEntity(TerracottaEntityRef.java:80)
    at org.ehcache.clustered.client.internal.lock.VoltronReadWriteLock.createClientEntity(VoltronReadWriteLock.java:125)
    at org.ehcache.clustered.client.internal.lock.VoltronReadWriteLock.tryLock(VoltronReadWriteLock.java:64)
    at org.ehcache.clustered.client.internal.lock.VoltronReadWriteLock.tryWriteLock(VoltronReadWriteLock.java:54)
    at org.ehcache.clustered.client.internal.EhcacheClientEntityFactory.create(EhcacheClientEntityFactory.java:98)
    at org.ehcache.clustered.client.internal.service.DefaultClusteringService.autoCreateEntity(DefaultClusteringService.java:198)
    at org.ehcache.clustered.client.internal.service.DefaultClusteringService.start(DefaultClusteringService.java:146)
    at org.ehcache.core.internal.service.ServiceLocator.startAllServices(ServiceLocator.java:118)
    at org.ehcache.core.EhcacheManager.init(EhcacheManager.java:560)
    at org.terracotta.websessions.store.ehcache3.Ehcache3SessionStore.doInit(Ehcache3SessionStore.java:64)
    at org.terracotta.websessions.api.AbstractSessionStore.init(AbstractSessionStore.java:69)
    at org.terracotta.websessions.support.tomcat8.TerracottaTomcatStore.initInternal(TerracottaTomcatStore.java:52)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
    at org.apache.catalina.session.PersistentManagerBase.startInternal(PersistentManagerBase.java:847)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5206)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1403)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1393)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: org.terracotta.entity.SyncMessageCodec
    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)
    ... 25 more
@mathieucarbou
Copy link
Member Author

mathieucarbou commented Oct 12, 2016

SyncMessageCodec is into entity-server-api so this is normal that the client classpath does not have this class.

The issue is that the common module depends on org.terracotta:entity-server-api (it shouldn't) and some code used on client-side is using the server api, i.e. LockMessaging is using the server api but is also used into VoltronReadWriteLockEntityClientService.

@mathieucarbou
Copy link
Member Author

Note: build process did not catch the error because of this issue: Terracotta-OSS/galvan#99

AbfrmBlr added a commit that referenced this issue Oct 13, 2016
Fix #1535 Clean up server dependencies that leaked on client
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants