# Cache in Data Center throws ClassCastException when casting to the same class

**URL:** <https://community.developer.atlassian.com/t/cache-in-data-center-throws-classcastexception-when-casting-to-the-same-class/3232>\
**Category:** Jira Server\
**Tags:** jira-server, java, data-center\
**Created:** [May 1, 2017, 11:01am UTC](https://community.developer.atlassian.com/t/cache-in-data-center-throws-classcastexception-when-casting-to-the-same-class/3232 "2017-05-01T11:01:45Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![tom.kucharski](https://avatars.discourse-cdn.com/v4/letter/t/ce7236/32.png) [@tom.kucharski](https://community.developer.atlassian.com/u/tom.kucharski)\
**Post date:** [May 1, 2017, 11:31am UTC](https://community.developer.atlassian.com/t/cache-in-data-center-throws-classcastexception-when-casting-to-the-same-class/3232/2 "2017-05-01T11:31:29Z")

</div>

> [@mike.niwinski](#):
>
> POJO cannot be cast to com.softwareplant.util.lang.POJO

It is good to mention that we ended up with “no security manager: RMI class loader disabled” if a class was not added to the application classpath.

```auto
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
	java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
	java.lang.ClassNotFoundException: com.softwareplant.util.lang.POJO (no security manager: RMI class loader disabled)
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:355)
	at sun.rmi.transport.Transport$1.run(Transport.java:200)
	at sun.rmi.transport.Transport$1.run(Transport.java:197)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
	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)
	at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:276)
	at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:253)
	at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:162)
	at net.sf.ehcache.distribution.RMICachePeer_Stub.remove(Unknown Source)
	at net.sf.ehcache.distribution.RMISynchronousCacheReplicator.replicateRemovalNotification(RMISynchronousCacheReplicator.java:243)
	at net.sf.ehcache.distribution.RMISynchronousCacheReplicator.notifyElementRemoved(RMISynchronousCacheReplicator.java:229)
	at net.sf.ehcache.event.RegisteredEventListeners.internalNotifyElementRemoved(RegisteredEventListeners.java:144)
	at net.sf.ehcache.event.RegisteredEventListeners.notifyElementRemoved(RegisteredEventListeners.java:124)
	at net.sf.ehcache.Cache.notifyRemoveInternalListeners(Cache.java:2322)
	at net.sf.ehcache.Cache.removeInternal(Cache.java:2305)
	at net.sf.ehcache.Cache.remove(Cache.java:2207)
	at net.sf.ehcache.Cache.remove(Cache.java:2125)
	at net.sf.ehcache.constructs.EhcacheDecoratorAdapter.remove(EhcacheDecoratorAdapter.java:154)
	at com.atlassian.cache.ehcache.LoadingCache.remove(LoadingCache.java:208)
	at com.atlassian.cache.ehcache.DelegatingCache.remove(DelegatingCache.java:134)

```

---

_[View the full topic](https://community.developer.atlassian.com/t/cache-in-data-center-throws-classcastexception-when-casting-to-the-same-class/3232)._
