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.

Terracotta | ndhiver | 8 years ago
  1. 0

    Spring, EhCache and Tomcat context restarting

    Terracotta | 8 years ago | ndhiver
    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.
  2. 0

    Problem persisting collection of interfaces in JDO/Datanucleus. "unable to assign an object of type.."

    Stack Overflow | 6 years ago | Tom
    java.lang.ClassCastException: 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.
  3. 0

    Android ClassCastException android.widget.TextView cannot be cast to android.widget.Spinner

    programwith.com | 1 year ago
    java.lang.ClassCastException: [J cannot be cast to [B at ... I'm trying to run Weka, a Java machine learning library, in a barebones Android app. Created a new project, added Weka as a library (Weka for Android), and put in a few lines of code to test that the ... I have a JSP application that works perfectly fine on localhost and openshift rhc server, however, when I upload it to the production server it gives the error - HTTP Status 500 - An exception ... 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 and use jdom2 to read some custom xml property files. Following a recent update my application now fails with the above error when trying to read the xml ... I've problem when I deploy 2 same apps on my tomcat. Wars are the same, only app name is diffrent. Tomcat randomly returns (only for 2nd loaded app): error 500 java.lang.ClassCastException: ... weblogic.application.ModuleException:
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    EclipseLink - Users - inactiveUnitOfWork with OptimisticLockException

    nabble.com | 11 months ago
    java.lang.ClassCastException: org.eclipse.persistence.internal.jpa.parsing.DotNode cannot be cast to org.eclipse.persistence.internal.jpa.parsing.VariableNode   at org.eclipse.persistence.internal.jpa.parsing.FetchJoinNode.validate(FetchJoinNode.java:73)   at org.eclipse.persistence.internal.jpa.parsing.FromNode.validate(FromNode.java:69)   at org.eclipse.persistence.internal.jpa.parsing.ParseTree.validate(ParseTree.java:199)   at org.eclipse.persistence.internal.jpa.parsing.ParseTree.validate(ParseTree.java:183)   at org.eclipse.persistence.internal.jpa.parsing.ParseTree.validate(ParseTree.java:173)   at org.eclipse.persistence.internal.jpa.parsing.JPQLParseTree.populateReadQueryInternal(JPQLParseTree.java:110)   at org.eclipse.persistence.internal.jpa.parsing.JPQLParseTree.populateQuery(JPQLParseTree.java:84)   at org.eclipse.persistence.internal.jpa.EJBQueryImpl.buildEJBQLDatabaseQuery(EJBQueryImpl.java:216)   at org.eclipse.persistence.internal.jpa.EJBQueryImpl.buildEJBQLDatabaseQuery(EJBQueryImpl.java:187)   at org.eclipse.persistence.internal.jpa.EJBQueryImpl.<init>(EJBQueryImpl.java:139)   at org.eclipse.persistence.internal.jpa.EJBQueryImpl.<init>(EJBQueryImpl.java:123)   at org.eclipse.persistence.internal.jpa.EntityManagerImpl.createQuery(EntityManagerImpl.java:1374) > > Is there a workaround for this? > > Thanks,  Constantino > > ________________________________ > From: Cronemberger, Constantino > Sent: 01 December 2010 16:51 > To: > Subject: Re: [eclipselink-users] inactiveUnitOfWork with OptimisticLockException > > Hi, > > I am using JPA. > > When I throw a runtime exception manually I don't see this problem. > > I am using Spring to control the transaction, so it is doing the commit. > > Here is my persistence.xml: > > <?xml version="1.0" encoding="UTF-8" ?> > <persistence version="2.0" xmlns=" " xmlns:xsi=" "            xsi:schemaLocation=" >                                   ">   <persistence-unit name="test" transaction-type="JTA">   <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>       <!-- For some reason EclipseLink does not recognize this datassource.            It was necessary to add a property with name            "javax.persistence.jtaDataSource" at the end of this file.       <jta-data-source>java:comp/env/jdbc/testDs</jta-data-source>          -->       <class>com.test.TestClassA</class>       <class>com.test.TestClassB</class>       <validation-mode>CALLBACK</validation-mode>       <properties>           <property name="eclipselink.target-server" value="Weblogic"/>           <property name="eclipselink.weaving" value="static"/>           <property name="eclipselink.weaving.lazy" value="true"/>           <property name="eclipselink.jdbc.batch-writing" value="JDBC" />           <property name="eclipselink.persistence-context.flush-mode" value="COMMIT" />           <property name="eclipselink.cache.size.default" value="1000" />           <property name="eclipselink.cache.coordination.protocol" value="rmi" />           <property name="javax.persistence.jtaDataSource"                     value="java:comp/env/jdbc/testDs"/>           <property name="javax.persistence.query.timeout" value="120"/>       </properties>   </persistence-unit> > </persistence> > The two stack traces I get are: > > from weblogic: > > ####<01-Dec-2010 16:44:33 o'clock BRST> <Warning> <JTA> <SPMADLT0374> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1291229073404> <BEA-110401> <Ignoring error in afterCompletion. Object=org.eclipse.persistence.transaction.JTASynchronizationListener@99eb16<mailto:Object=org.eclipse.persistence.transaction.JTASynchronizationListener@99eb16>, Exception=Exception [EclipseLink-23011] (Eclipse Persistence Services - 2.2.0.v20101117-r8503): org.eclipse.persistence.exceptions.TransactionException > Exception Description: Error trying to format exception message: UnitOfWork [{0}] was rendered inactive before associated externally managed transaction was complete.  The arguments are: [Exception [EclipseLink-4022] (Eclipse Persistence Services - 2.2.0.v20101117-r8503): org.eclipse.persistence.exceptions.DatabaseException > Exception Description: Accessor or its connection has been set to null.  This can occur if the ClientSession or UnitOfWork was released in a seperate thread, for instance if a Timeout occurred.] > Exception [EclipseLink-23011] (Eclipse Persistence Services - 2.2.0.v20101117-r8503): org.eclipse.persistence.exceptions.TransactionException > Exception Description: Error trying to format exception message: UnitOfWork [{0}] was rendered inactive before associated externally managed transaction was complete.  The arguments are: [Exception [EclipseLink-4022] (Eclipse Persistence Services - 2.2.0.v20101117-r8503): org.eclipse.persistence.exceptions.DatabaseException > Exception Description: Accessor or its connection has been set to null.  This can occur if the ClientSession or UnitOfWork was released in a seperate thread, for instance if a Timeout occurred.]
  6. 0

    EclipseLink - Users - inactiveUnitOfWork with OptimisticLockException

    nabble.com | 11 months ago
    java.lang.ClassCastException: org.eclipse.persistence.internal.jpa.parsing.DotNode cannot be cast to org.eclipse.persistence.internal.jpa.parsing.VariableNode   at org.eclipse.persistence.internal.jpa.parsing.FetchJoinNode.validate(FetchJoinNode.java:73)   at org.eclipse.persistence.internal.jpa.parsing.FromNode.validate(FromNode.java:69)   at org.eclipse.persistence.internal.jpa.parsing.ParseTree.validate(ParseTree.java:199)   at org.eclipse.persistence.internal.jpa.parsing.ParseTree.validate(ParseTree.java:183)   at org.eclipse.persistence.internal.jpa.parsing.ParseTree.validate(ParseTree.java:173)   at org.eclipse.persistence.internal.jpa.parsing.JPQLParseTree.populateReadQueryInternal(JPQLParseTree.java:110)   at org.eclipse.persistence.internal.jpa.parsing.JPQLParseTree.populateQuery(JPQLParseTree.java:84)   at org.eclipse.persistence.internal.jpa.EJBQueryImpl.buildEJBQLDatabaseQuery(EJBQueryImpl.java:216)   at org.eclipse.persistence.internal.jpa.EJBQueryImpl.buildEJBQLDatabaseQuery(EJBQueryImpl.java:187)   at org.eclipse.persistence.internal.jpa.EJBQueryImpl.<init>(EJBQueryImpl.java:139)   at org.eclipse.persistence.internal.jpa.EJBQueryImpl.<init>(EJBQueryImpl.java:123)   at org.eclipse.persistence.internal.jpa.EntityManagerImpl.createQuery(EntityManagerImpl.java:1374) > > Is there a workaround for this? > > Thanks,  Constantino > > ________________________________ > From: Cronemberger, Constantino > Sent: 01 December 2010 16:51 > To: > Subject: Re: [eclipselink-users] inactiveUnitOfWork with OptimisticLockException > > Hi, > > I am using JPA. > > When I throw a runtime exception manually I don't see this problem. > > I am using Spring to control the transaction, so it is doing the commit. > > Here is my persistence.xml: > > <?xml version="1.0" encoding="UTF-8" ?> > <persistence version="2.0" xmlns=" " xmlns:xsi=" "            xsi:schemaLocation=" >                                   ">   <persistence-unit name="test" transaction-type="JTA">   <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>       <!-- For some reason EclipseLink does not recognize this datassource.            It was necessary to add a property with name            "javax.persistence.jtaDataSource" at the end of this file.       <jta-data-source>java:comp/env/jdbc/testDs</jta-data-source>          -->       <class>com.test.TestClassA</class>       <class>com.test.TestClassB</class>       <validation-mode>CALLBACK</validation-mode>       <properties>           <property name="eclipselink.target-server" value="Weblogic"/>           <property name="eclipselink.weaving" value="static"/>           <property name="eclipselink.weaving.lazy" value="true"/>           <property name="eclipselink.jdbc.batch-writing" value="JDBC" />           <property name="eclipselink.persistence-context.flush-mode" value="COMMIT" />           <property name="eclipselink.cache.size.default" value="1000" />           <property name="eclipselink.cache.coordination.protocol" value="rmi" />           <property name="javax.persistence.jtaDataSource"                     value="java:comp/env/jdbc/testDs"/>           <property name="javax.persistence.query.timeout" value="120"/>       </properties>   </persistence-unit> > </persistence> > The two stack traces I get are: > > from weblogic: > > ####<01-Dec-2010 16:44:33 o'clock BRST> <Warning> <JTA> <SPMADLT0374> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1291229073404> <BEA-110401> <Ignoring error in afterCompletion. Object=org.eclipse.persistence.transaction.JTASynchronizationListener@99eb16<mailto:Object=org.eclipse.persistence.transaction.JTASynchronizationListener@99eb16>, Exception=Exception [EclipseLink-23011] (Eclipse Persistence Services - 2.2.0.v20101117-r8503): org.eclipse.persistence.exceptions.TransactionException > Exception Description: Error trying to format exception message: UnitOfWork [{0}] was rendered inactive before associated externally managed transaction was complete.  The arguments are: [Exception [EclipseLink-4022] (Eclipse Persistence Services - 2.2.0.v20101117-r8503): org.eclipse.persistence.exceptions.DatabaseException > Exception Description: Accessor or its connection has been set to null.  This can occur if the ClientSession or UnitOfWork was released in a seperate thread, for instance if a Timeout occurred.] > Exception [EclipseLink-23011] (Eclipse Persistence Services - 2.2.0.v20101117-r8503): org.eclipse.persistence.exceptions.TransactionException > Exception Description: Error trying to format exception message: UnitOfWork [{0}] was rendered inactive before associated externally managed transaction was complete.  The arguments are: [Exception [EclipseLink-4022] (Eclipse Persistence Services - 2.2.0.v20101117-r8503): org.eclipse.persistence.exceptions.DatabaseException > Exception Description: Accessor or its connection has been set to null.  This can occur if the ClientSession or UnitOfWork was released in a seperate thread, for instance if a Timeout occurred.]

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. 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()
    2. Ehcache
      SingletonEhCacheProvider.start
      1. net.sf.ehcache.CacheManager.__tc_getsingleton(CacheManager.java)
      2. net.sf.ehcache.CacheManager.create(CacheManager.java:370)
      3. net.sf.ehcache.hibernate.SingletonEhCacheProvider.start(SingletonEhCacheProvider.java:123)
      3 frames
    3. Hibernate
      SessionFactoryImpl.<init>
      1. org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:183)
      1 frame
    4. Hibernate
      Configuration.buildSessionFactory
      1. org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
      1 frame
    5. Hibernate
      AbstractSessionFactoryBean.afterPropertiesSet
      1. org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:805)
      2. org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:745)
      3. org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:134)
      3 frames
    6. Spring Beans
      AbstractAutowireCapableBeanFactory_1_674776996_662555251___AW_JoinPoint.proceed
      1. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1201)
      2. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1171)
      3. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.aw$original$_AW_$createBean$_AW_$org_springframework_beans_factory_support_AbstractAutowireCapableBeanFactory(AbstractAutowireCapableBeanFactory.java:425)
      4. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory_1_674776996_662555251___AW_JoinPoint.proceed(Unknown Source)
      4 frames
    7. com.tcspring
      GetBeanProtocol.beanNameCflow
      1. com.tcspring.GetBeanProtocol.beanNameCflow(GetBeanProtocol.java:72)
      1 frame
    8. Spring Beans
      DefaultListableBeanFactory.preInstantiateSingletons
      1. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory_1_674776996_662555251___AW_JoinPoint.proceed(Unknown Source)
      2. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory_1_674776996_662555251___AW_JoinPoint.invoke(Unknown Source)
      3. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java)
      4. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
      5. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
      6. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
      7. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
      8. org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:284)
      8 frames
    9. Spring Context
      AbstractApplicationContext.refresh
      1. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
      1 frame
    10. Spring
      ContextLoaderListener.contextInitialized
      1. org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:244)
      2. org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187)
      3. org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
      3 frames
    11. Glassfish Core
      StandardContext.start
      1. org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3764)
      2. org.apache.catalina.core.StandardContext.start(StandardContext.java:4216)
      2 frames
    12. org.apache.catalina
      HTMLManagerServlet.doGet
      1. org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1173)
      2. org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:549)
      3. org.apache.catalina.manager.HTMLManagerServlet.doGet(HTMLManagerServlet.java:105)
      3 frames
    13. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:627)
      2. javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
      2 frames
    14. Glassfish Core
      CoyoteAdapter.service
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
      3. org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      4. org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
      5. org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
      6. org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      7. org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
      8. org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
      9. org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
      9 frames
    15. Grizzly HTTP
      LeaderFollowerWorkerThread.runIt
      1. org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
      2. org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
      3. org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
      4. org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
      4 frames
    16. Tomcat Util
      ThreadPool$ControlRunnable.run
      1. org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
      1 frame
    17. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:595)
      1 frame