java.lang.ClassCastException: java.lang.Integer

Pentaho BI Platform Tracking | Brian Vandenberg | 9 years ago
  1. 0

    STR: 1) Alter a level property to use the captionColumn attribute to use a column in the DB whose data type is an integer (and probably other non-string types) 2) Use an application that takes advantage of the captionColumn attribute 3) An exception similar to the following will occur: java.lang.ClassCastException: java.lang.Integer at mondrian.rolap.RolapMember.getName(RolapMember.java:377) at org.freeolap.olap.mondrian.MondrianCube.fillMembers(MondrianCube.java:172) at org.freeolap.olap.mondrian.MondrianCube.fillMembers(MondrianCube.java:178) at org.freeolap.olap.mondrian.MondrianCube.fillMembers(MondrianCube.java:178) at org.freeolap.olap.mondrian.MondrianCube.fillMembers(MondrianCube.java:178) at org.freeolap.olap.mondrian.MondrianCube.fillMembers(MondrianCube.java:178) at org.freeolap.olap.mondrian.MondrianCube.exploreCube(MondrianCube.java:140) at org.freeolap.olap.mondrian.MondrianCube.connect(MondrianCube.java:81) at org.freeolap.FreeOlapPlugin.doConnect(FreeOlapPlugin.java:162) at org.freeolap.FreeOlapPlugin.connect(FreeOlapPlugin.java:129) at org.freeolap.ApplicationWorkbenchWindowAdvisor.postWindowOpen(ApplicationWorkbenchWindowAdvisor.java:62) at org.eclipse.ui.internal.WorkbenchWindow.fireWindowOpened(WorkbenchWindow.java:1128) at org.eclipse.ui.internal.WorkbenchWindow.open(WorkbenchWindow.java:685) at org.eclipse.ui.internal.Workbench.busyOpenWorkbenchWindow(Workbench.java:819) at org.eclipse.ui.internal.Workbench.doOpenFirstTimeWindow(Workbench.java:1453) at org.eclipse.ui.internal.Workbench.access$10(Workbench.java:1451) at org.eclipse.ui.internal.Workbench$17.run(Workbench.java:1415) at org.eclipse.ui.internal.Workbench.runStartupWithProgress(Workbench.java:1430) at org.eclipse.ui.internal.Workbench.openFirstTimeWindow(Workbench.java:1413) at org.eclipse.ui.internal.WorkbenchConfigurer.openFirstTimeWindow(WorkbenchConfigurer.java:190) at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:708) at org.eclipse.ui.internal.Workbench.init(Workbench.java:1101) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1863) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:422) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.freeolap.Application.run(Application.java:20) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) at org.eclipse.core.launcher.Main.basicRun(Main.java:280) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952) In this instance I was using FreeAnalysis. It looks as if getName() is expecting Property.NAME.name to return a string, but if I'm not mistaken it's annoyed because the data type of the column being retrieved is not a string, but I could just be flat wrong because the stack trace says line 377, but 377 occurs between these two functions on a blank line: void makeUniqueName(HierarchyUsage hierarchyUsage) { if (parentMember == null && key != null) { String n = hierarchyUsage.getName(); if (n != null) { String name = keyToString(key); n = Util.quoteMdxIdentifier(n); this.uniqueName = Util.makeFqName(n, name); if (getLogger().isDebugEnabled()) { getLogger().debug("RolapMember.makeUniqueName: uniqueName=" +uniqueName); } } } } private void setUniqueName(Object key) { String name = keyToString(key); this.uniqueName = (parentMember == null) ? Util.makeFqName(getHierarchy(), name) : Util.makeFqName(parentMember, name); } ... which leads me to believe that the current version of FreeAnalysis may have been compiled with an earlier version of mondrian, so I'm really not certain where this error is truly happening. At the very least what I'm asking for is: catch this exception and re-throw it with a more descriptive message. As a last resort I just did a search/replace to remove all captionColumn entries in my schema on the off chance that guess might fix it (after having exhausted all other attempts at fixing it by looking at the other more likely suspects), and it just so happened that it did.

    Pentaho BI Platform Tracking | 9 years ago | Brian Vandenberg
    java.lang.ClassCastException: java.lang.Integer
  2. 0

    STR: 1) Alter a level property to use the captionColumn attribute to use a column in the DB whose data type is an integer (and probably other non-string types) 2) Use an application that takes advantage of the captionColumn attribute 3) An exception similar to the following will occur: java.lang.ClassCastException: java.lang.Integer at mondrian.rolap.RolapMember.getName(RolapMember.java:377) at org.freeolap.olap.mondrian.MondrianCube.fillMembers(MondrianCube.java:172) at org.freeolap.olap.mondrian.MondrianCube.fillMembers(MondrianCube.java:178) at org.freeolap.olap.mondrian.MondrianCube.fillMembers(MondrianCube.java:178) at org.freeolap.olap.mondrian.MondrianCube.fillMembers(MondrianCube.java:178) at org.freeolap.olap.mondrian.MondrianCube.fillMembers(MondrianCube.java:178) at org.freeolap.olap.mondrian.MondrianCube.exploreCube(MondrianCube.java:140) at org.freeolap.olap.mondrian.MondrianCube.connect(MondrianCube.java:81) at org.freeolap.FreeOlapPlugin.doConnect(FreeOlapPlugin.java:162) at org.freeolap.FreeOlapPlugin.connect(FreeOlapPlugin.java:129) at org.freeolap.ApplicationWorkbenchWindowAdvisor.postWindowOpen(ApplicationWorkbenchWindowAdvisor.java:62) at org.eclipse.ui.internal.WorkbenchWindow.fireWindowOpened(WorkbenchWindow.java:1128) at org.eclipse.ui.internal.WorkbenchWindow.open(WorkbenchWindow.java:685) at org.eclipse.ui.internal.Workbench.busyOpenWorkbenchWindow(Workbench.java:819) at org.eclipse.ui.internal.Workbench.doOpenFirstTimeWindow(Workbench.java:1453) at org.eclipse.ui.internal.Workbench.access$10(Workbench.java:1451) at org.eclipse.ui.internal.Workbench$17.run(Workbench.java:1415) at org.eclipse.ui.internal.Workbench.runStartupWithProgress(Workbench.java:1430) at org.eclipse.ui.internal.Workbench.openFirstTimeWindow(Workbench.java:1413) at org.eclipse.ui.internal.WorkbenchConfigurer.openFirstTimeWindow(WorkbenchConfigurer.java:190) at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:708) at org.eclipse.ui.internal.Workbench.init(Workbench.java:1101) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1863) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:422) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.freeolap.Application.run(Application.java:20) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) at org.eclipse.core.launcher.Main.basicRun(Main.java:280) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952) In this instance I was using FreeAnalysis. It looks as if getName() is expecting Property.NAME.name to return a string, but if I'm not mistaken it's annoyed because the data type of the column being retrieved is not a string, but I could just be flat wrong because the stack trace says line 377, but 377 occurs between these two functions on a blank line: void makeUniqueName(HierarchyUsage hierarchyUsage) { if (parentMember == null && key != null) { String n = hierarchyUsage.getName(); if (n != null) { String name = keyToString(key); n = Util.quoteMdxIdentifier(n); this.uniqueName = Util.makeFqName(n, name); if (getLogger().isDebugEnabled()) { getLogger().debug("RolapMember.makeUniqueName: uniqueName=" +uniqueName); } } } } private void setUniqueName(Object key) { String name = keyToString(key); this.uniqueName = (parentMember == null) ? Util.makeFqName(getHierarchy(), name) : Util.makeFqName(parentMember, name); } ... which leads me to believe that the current version of FreeAnalysis may have been compiled with an earlier version of mondrian, so I'm really not certain where this error is truly happening. At the very least what I'm asking for is: catch this exception and re-throw it with a more descriptive message. As a last resort I just did a search/replace to remove all captionColumn entries in my schema on the off chance that guess might fix it (after having exhausted all other attempts at fixing it by looking at the other more likely suspects), and it just so happened that it did.

    Pentaho BI Platform Tracking | 9 years ago | Brian Vandenberg
    java.lang.ClassCastException: java.lang.Integer
  3. 0

    Jasperanalysis error | Jaspersoft Community

    jaspersoft.com | 1 year ago
    java.lang.ClassCastException: java.math.BigDecimal
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    SET_MAX_AGE in FRMREPORTSINTEG bean

    Oracle Community | 10 years ago | 447028
    java.lang.ClassCastException: java.lang.Integer
  6. 0

    Cast object[][] into strings

    Coderanch | 2 decades ago | marko markovic
    java.lang.ClassCastException: java.lang.Integer

    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

      java.lang.Integer

      at mondrian.rolap.RolapMember.getName()
    2. mondrian.rolap
      RolapMember.getName
      1. mondrian.rolap.RolapMember.getName(RolapMember.java:377)
      1 frame
    3. org.freeolap.olap
      MondrianCube.connect
      1. org.freeolap.olap.mondrian.MondrianCube.fillMembers(MondrianCube.java:172)
      2. org.freeolap.olap.mondrian.MondrianCube.fillMembers(MondrianCube.java:178)
      3. org.freeolap.olap.mondrian.MondrianCube.fillMembers(MondrianCube.java:178)
      4. org.freeolap.olap.mondrian.MondrianCube.fillMembers(MondrianCube.java:178)
      5. org.freeolap.olap.mondrian.MondrianCube.fillMembers(MondrianCube.java:178)
      6. org.freeolap.olap.mondrian.MondrianCube.exploreCube(MondrianCube.java:140)
      7. org.freeolap.olap.mondrian.MondrianCube.connect(MondrianCube.java:81)
      7 frames
    4. org.freeolap
      ApplicationWorkbenchWindowAdvisor.postWindowOpen
      1. org.freeolap.FreeOlapPlugin.doConnect(FreeOlapPlugin.java:162)
      2. org.freeolap.FreeOlapPlugin.connect(FreeOlapPlugin.java:129)
      3. org.freeolap.ApplicationWorkbenchWindowAdvisor.postWindowOpen(ApplicationWorkbenchWindowAdvisor.java:62)
      3 frames
    5. Eclipse UI
      WorkbenchConfigurer.openFirstTimeWindow
      1. org.eclipse.ui.internal.WorkbenchWindow.fireWindowOpened(WorkbenchWindow.java:1128)
      2. org.eclipse.ui.internal.WorkbenchWindow.open(WorkbenchWindow.java:685)
      3. org.eclipse.ui.internal.Workbench.busyOpenWorkbenchWindow(Workbench.java:819)
      4. org.eclipse.ui.internal.Workbench.doOpenFirstTimeWindow(Workbench.java:1453)
      5. org.eclipse.ui.internal.Workbench.access$10(Workbench.java:1451)
      6. org.eclipse.ui.internal.Workbench$17.run(Workbench.java:1415)
      7. org.eclipse.ui.internal.Workbench.runStartupWithProgress(Workbench.java:1430)
      8. org.eclipse.ui.internal.Workbench.openFirstTimeWindow(Workbench.java:1413)
      9. org.eclipse.ui.internal.WorkbenchConfigurer.openFirstTimeWindow(WorkbenchConfigurer.java:190)
      9 frames
    6. Workbench
      WorkbenchAdvisor.openWindows
      1. org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:708)
      1 frame
    7. Eclipse UI
      Workbench.createAndRunWorkbench
      1. org.eclipse.ui.internal.Workbench.init(Workbench.java:1101)
      2. org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1863)
      3. org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:422)
      3 frames
    8. Eclipse UI
      PlatformUI.createAndRunWorkbench
      1. org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
      1 frame
    9. org.freeolap
      Application.run
      1. org.freeolap.Application.run(Application.java:20)
      1 frame
    10. Eclipse Core
      PlatformActivator$1.run
      1. org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
      1 frame
    11. Eclipse OSGi
      EclipseStarter.run
      1. org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
      2. org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
      3. org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
      4. org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
      4 frames
    12. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:585)
      4 frames
    13. Equinox
      Main.main
      1. org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
      2. org.eclipse.core.launcher.Main.basicRun(Main.java:280)
      3. org.eclipse.core.launcher.Main.run(Main.java:977)
      4. org.eclipse.core.launcher.Main.main(Main.java:952)
      4 frames