[jboss-user] [JBoss Cache] - Re: exception from CacheJmxWrapperMBean.getCache()
Tarundeep Singh
do-not-reply at jboss.com
Fri Mar 4 22:23:53 EST 2011
Tarundeep Singh [http://community.jboss.org/people/tarundeep_singh] created the discussion
"Re: exception from CacheJmxWrapperMBean.getCache()"
To view the discussion, visit: http://community.jboss.org/message/591336#591336
--------------------------------------------------------------
Hi Peter,
Good Morning.
I was struggling with this issue until yesterday. Saw your post, took some help from it. And then I faced the same problem as you did. I actually also got lucky to resolve this issue.
This is a two step process:
1. The call to cacheJmxWrapper.getCache() will be actually returning cacheJmxWrapper.getCache() an instance of org.jboss.cache.invocation.CacheInvocationDelegate. Therefore, the type casting needs to be corrected here.
2.
> > * java.lang.ClassCastException: org.jboss.cache.invocation.CacheInvocationDelegate cannot be cast to org.jboss.cache.Cache
> >
> at $Proxy17.getCache(Unknown Source)
This actually happenned since my both applications were using there own set of JBoss Cache related jars. And since different instances of class loaders were loading these jars, these class cast exception took place. Resolution to this was to take these Jboss cache related jars from each of the applications and store them inside the application servers instance.
The issue got resolved and a single instance of Jboss cache was accessible for both the applications. :) :)
This also answers that this is not a defect in JBoss Cache. :)
Thank you.
Enjoy.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/591336#591336]
Start a new discussion in JBoss Cache at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2052]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110304/bde05c9d/attachment-0001.html
More information about the jboss-user
mailing list