java.lang.ClassCastException

The field 'singleton' with root name 'CacheManager.singleton' cannot be assigned to a variable of type net/sf/ehcache/CacheManager. This root has a type net.sf.ehcache.CacheManager. Perhaps you have the same root name assigned more than once to variables of different types.

Samebug tips0

There are no available Samebug tips for this exception. If you know how to solve this issue, help other users by writing a short tip.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web19611

  • via Terracotta by ndhiver, 11 months ago
    The field 'singleton' with root name 'CacheManager.singleton' cannot be assigned to a variable of type net/sf/ehcache/CacheManager. This root has a type net.sf.ehcache.CacheManager. Perhaps you have the same root name assigned more than once to variables of different types.
  • Field "com.myapp.model.CommentList.comments" is a reference field (interface/Object) of type com.myapp.behaviours.IComment but DataNucleus is unable to assign an object of type "com.myapp.model.ShortComment" to this field. You can only assign this field to a type specified by the "implementation-classes" extension attribute.
  • ... I'm trying to work with generics mostly for practice and for a little idea I had. At the moment I have a problem with: ClassCastException:java.lang.Class cannot be cast to ... I am developing a GWT application in Eclipse
  • Stack trace

    • java.lang.ClassCastException: The field 'singleton' with root name 'CacheManager.singleton' cannot be assigned to a variable of type net/sf/ehcache/CacheManager. This root has a type net.sf.ehcache.CacheManager. Perhaps you have the same root name assigned more than once to variables of different types. at net.sf.ehcache.CacheManager.__tc_getsingleton(CacheManager.java) at net.sf.ehcache.CacheManager.create(CacheManager.java:370) at net.sf.ehcache.hibernate.SingletonEhCacheProvider.start(SingletonEhCacheProvider.java:123) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:183) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294) at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:805) at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:745) at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:134) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1201) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1171) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.aw$original$_AW_$createBean$_AW_$org_springframework_beans_factory_support_AbstractAutowireCapableBeanFactory(AbstractAutowireCapableBeanFactory.java:425) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory_1_674776996_662555251___AW_JoinPoint.proceed(Unknown Source) at com.tcspring.GetBeanProtocol.beanNameCflow(GetBeanProtocol.java:72) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory_1_674776996_662555251___AW_JoinPoint.proceed(Unknown Source) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory_1_674776996_662555251___AW_JoinPoint.invoke(Unknown Source) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:284) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:244) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3764) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4216) at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1173) at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:549) at org.apache.catalina.manager.HTMLManagerServlet.doGet(HTMLManagerServlet.java:105) at javax.servlet.http.HttpServlet.service(HttpServlet.java:627) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) at java.lang.Thread.run(Thread.java:595)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    You’re the first here who have seen this exception.