java.lang.ClassCastException

Hibernate JIRA | Henri ter Steeg | 1 decade ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    In one of my entity classes, I defined a String field 'aangesloten', together with a getter and a setter. Since this field represents a dutch type of yes/no field (Ja/Nee), I also added public boolean isAangesloten() This resulted in the stack trace below in Hibernate 2.1.2. I tried 2.1.4 as well and got the same error. I used a workaround, and renamed the boolean function to: public boolean aangesloten() BTW: I really like your Hibernate! Here's the stacktrace: org.springframework.beans.FatalBeanException: Could not instantiate class [nl.linkit.projects.sfdc.td.swing.ApparatuurOverzichtPanel]; constructor threw exception; nested exception is java.lang.ClassCastException: null java.lang.ClassCastException at net.sf.hibernate.type.StringType.toString(StringType.java:47) at net.sf.hibernate.type.NullableType.toString(NullableType.java:78) at net.sf.hibernate.impl.Printer.toString(Printer.java:49) at net.sf.hibernate.impl.Printer.toString(Printer.java:82) at net.sf.hibernate.impl.SessionImpl.flushEverything(SessionImpl.java:2245) at net.sf.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:1769) at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1536) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1501) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1491) at nl.linkit.projects.sfdc.db2.SynchronizedSession.find(SynchronizedSession.java:66) at nl.linkit.projects.sfdc.db2.ApparaatDaoHib.findStoringen(ApparaatDaoHib.java:44) at nl.linkit.projects.sfdc.manager2.ApparaatManager.findRecenteStoringen(ApparaatManager.java:58) at nl.linkit.projects.sfdc.manager2.ApparaatManager.refreshStoringen(ApparaatManager.java:62) at nl.linkit.projects.sfdc.manager2.ApparaatManager.<init>(ApparaatManager.java:43) at nl.linkit.projects.sfdc.manager2.ApparaatManagerFactory.getApparaatManager(ApparaatManagerFactory.java:31) at nl.linkit.projects.sfdc.td.swing.ApparaatStatusPanelFactory.getApparaatStatusPanel(ApparaatStatusPanelFactory.java:24) at nl.linkit.projects.sfdc.td.swing.ApparatuurOverzichtPanel.<init>(ApparatuurOverzichtPanel.java:65) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:66) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:395) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:214) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:177) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:159) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:183) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:268) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:58) at nl.linkit.projects.sfdc.td.TdConsole.main(TdConsole.java:16) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.sun.javaws.Launcher.executeApplication(Unknown Source) at com.sun.javaws.Launcher.executeMainClass(Unknown Source) at com.sun.javaws.Launcher.continueLaunch(Unknown Source) at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source) at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source) at com.sun.javaws.Launcher.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

    Hibernate JIRA | 1 decade ago | Henri ter Steeg
    java.lang.ClassCastException
  2. 0

    In one of my entity classes, I defined a String field 'aangesloten', together with a getter and a setter. Since this field represents a dutch type of yes/no field (Ja/Nee), I also added public boolean isAangesloten() This resulted in the stack trace below in Hibernate 2.1.2. I tried 2.1.4 as well and got the same error. I used a workaround, and renamed the boolean function to: public boolean aangesloten() BTW: I really like your Hibernate! Here's the stacktrace: org.springframework.beans.FatalBeanException: Could not instantiate class [nl.linkit.projects.sfdc.td.swing.ApparatuurOverzichtPanel]; constructor threw exception; nested exception is java.lang.ClassCastException: null java.lang.ClassCastException at net.sf.hibernate.type.StringType.toString(StringType.java:47) at net.sf.hibernate.type.NullableType.toString(NullableType.java:78) at net.sf.hibernate.impl.Printer.toString(Printer.java:49) at net.sf.hibernate.impl.Printer.toString(Printer.java:82) at net.sf.hibernate.impl.SessionImpl.flushEverything(SessionImpl.java:2245) at net.sf.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:1769) at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1536) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1501) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1491) at nl.linkit.projects.sfdc.db2.SynchronizedSession.find(SynchronizedSession.java:66) at nl.linkit.projects.sfdc.db2.ApparaatDaoHib.findStoringen(ApparaatDaoHib.java:44) at nl.linkit.projects.sfdc.manager2.ApparaatManager.findRecenteStoringen(ApparaatManager.java:58) at nl.linkit.projects.sfdc.manager2.ApparaatManager.refreshStoringen(ApparaatManager.java:62) at nl.linkit.projects.sfdc.manager2.ApparaatManager.<init>(ApparaatManager.java:43) at nl.linkit.projects.sfdc.manager2.ApparaatManagerFactory.getApparaatManager(ApparaatManagerFactory.java:31) at nl.linkit.projects.sfdc.td.swing.ApparaatStatusPanelFactory.getApparaatStatusPanel(ApparaatStatusPanelFactory.java:24) at nl.linkit.projects.sfdc.td.swing.ApparatuurOverzichtPanel.<init>(ApparatuurOverzichtPanel.java:65) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:66) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:395) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:214) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:177) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:159) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:183) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:268) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:58) at nl.linkit.projects.sfdc.td.TdConsole.main(TdConsole.java:16) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.sun.javaws.Launcher.executeApplication(Unknown Source) at com.sun.javaws.Launcher.executeMainClass(Unknown Source) at com.sun.javaws.Launcher.continueLaunch(Unknown Source) at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source) at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source) at com.sun.javaws.Launcher.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

    Hibernate JIRA | 1 decade ago | Henri ter Steeg
    java.lang.ClassCastException
  3. 0

    Shared hosting Bungeecord problems.

    GitHub | 3 years ago | Arksenu
    java.lang.ClassCastException: bka cannot be cast to fs All my servers are set to onlinemode: false Here is my config.yml groups: arksenu: - admin disabled_commands: - find player_limit: -1 stats: 347d1d62-6fb6-4869-bd43-7d0745de8e3c permissions: default: - bungeecord.command.server - bungeecord.command.list admin: - bungeecord.command.ip - bungeecord.command.alert - bungeecord.command.end - bungeecord.command.reload listeners: - max_players: 18 fallback_server: hub host: 0.0.0.0:35289 bind_local_address: true ping_passthrough: false tab_list: GLOBAL_PING default_server: hub forced_hosts: pvp.md-5.net: hub tab_size: 60 force_default_server: true motd: ’Network’ query_enabled: false query_port: 25565 timeout: 30000 connection_throttle: 4000 servers: hub: address: 108.170.8.146:35289 restricted: false motd: test UvGames: address: 66.85.165.170:26200 restricted: false motd: test UvPrison: address: 66.85.128.90:25928 restricted: false motd: test ip_forward: false online_mode: true And here is my console message -> UpstreamBridge has disconnected disconnected with: Exception Connecting:RuntimeException : Server is online mode! @ net.md_5.bungee.ServerConnector:188
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Shared hosting Bungeecord problems.

    GitHub | 3 years ago | Arksenu
    java.lang.ClassCastException: bka cannot be cast to fs All my servers are set to onlinemode: false Here is my config.yml groups: arksenu: - admin disabled_commands: - find player_limit: -1 stats: 347d1d62-6fb6-4869-bd43-7d0745de8e3c permissions: default: - bungeecord.command.server - bungeecord.command.list admin: - bungeecord.command.ip - bungeecord.command.alert - bungeecord.command.end - bungeecord.command.reload listeners: - max_players: 18 fallback_server: hub host: 0.0.0.0:35289 bind_local_address: true ping_passthrough: false tab_list: GLOBAL_PING default_server: hub forced_hosts: pvp.md-5.net: hub tab_size: 60 force_default_server: true motd: ’Network’ query_enabled: false query_port: 25565 timeout: 30000 connection_throttle: 4000 servers: hub: address: 108.170.8.146:35289 restricted: false motd: test UvGames: address: 66.85.165.170:26200 restricted: false motd: test UvPrison: address: 66.85.128.90:25928 restricted: false motd: test ip_forward: false online_mode: true And here is my console message -> UpstreamBridge has disconnected disconnected with: Exception Connecting:RuntimeException : Server is online mode! @ net.md_5.bungee.ServerConnector:188
  6. 0

    Help:basic RMI question

    Google Groups | 2 decades ago | Paolo De Lutiis
    java.lang.ClassCastException: serverPackage.ServerClass_Stub at clientPackage.myApplet.init(myApplet.java:line#) at sun.applet.AppletPanel.run(AppletPanel.java:273) at java.lang.Thread.

    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

      No message provided

      at net.sf.hibernate.type.StringType.toString()
    2. net.sf.hibernate
      SessionImpl.find
      1. net.sf.hibernate.type.StringType.toString(StringType.java:47)
      2. net.sf.hibernate.type.NullableType.toString(NullableType.java:78)
      3. net.sf.hibernate.impl.Printer.toString(Printer.java:49)
      4. net.sf.hibernate.impl.Printer.toString(Printer.java:82)
      5. net.sf.hibernate.impl.SessionImpl.flushEverything(SessionImpl.java:2245)
      6. net.sf.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:1769)
      7. net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1536)
      8. net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1501)
      9. net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1491)
      9 frames
    3. nl.linkit.projects
      ApparatuurOverzichtPanel.<init>
      1. nl.linkit.projects.sfdc.db2.SynchronizedSession.find(SynchronizedSession.java:66)
      2. nl.linkit.projects.sfdc.db2.ApparaatDaoHib.findStoringen(ApparaatDaoHib.java:44)
      3. nl.linkit.projects.sfdc.manager2.ApparaatManager.findRecenteStoringen(ApparaatManager.java:58)
      4. nl.linkit.projects.sfdc.manager2.ApparaatManager.refreshStoringen(ApparaatManager.java:62)
      5. nl.linkit.projects.sfdc.manager2.ApparaatManager.<init>(ApparaatManager.java:43)
      6. nl.linkit.projects.sfdc.manager2.ApparaatManagerFactory.getApparaatManager(ApparaatManagerFactory.java:31)
      7. nl.linkit.projects.sfdc.td.swing.ApparaatStatusPanelFactory.getApparaatStatusPanel(ApparaatStatusPanelFactory.java:24)
      8. nl.linkit.projects.sfdc.td.swing.ApparatuurOverzichtPanel.<init>(ApparatuurOverzichtPanel.java:65)
      8 frames
    4. Java RT
      Constructor.newInstance
      1. sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      2. sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
      3. sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
      4. java.lang.reflect.Constructor.newInstance(Unknown Source)
      4 frames
    5. Spring Beans
      DefaultListableBeanFactory.preInstantiateSingletons
      1. org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:66)
      2. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:395)
      3. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:214)
      4. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:177)
      5. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:159)
      6. org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:183)
      6 frames
    6. Spring Context
      ClassPathXmlApplicationContext.<init>
      1. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:268)
      2. org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:58)
      2 frames
    7. nl.linkit.projects
      TdConsole.main
      1. nl.linkit.projects.sfdc.td.TdConsole.main(TdConsole.java:16)
      1 frame
    8. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      4. java.lang.reflect.Method.invoke(Unknown Source)
      4 frames
    9. com.sun.javaws
      Launcher.run
      1. com.sun.javaws.Launcher.executeApplication(Unknown Source)
      2. com.sun.javaws.Launcher.executeMainClass(Unknown Source)
      3. com.sun.javaws.Launcher.continueLaunch(Unknown Source)
      4. com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
      5. com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
      6. com.sun.javaws.Launcher.run(Unknown Source)
      6 frames
    10. Java RT
      Thread.run
      1. java.lang.Thread.run(Unknown Source)
      1 frame