java.lang.Integer cannot be cast to java.lang.String

0
Hi all!
I get this error while running my mdx query:

Warning: Could not get charToByteConverterClass!
Warning: Could not get charToByteConverterClass!
Warning: Could not get charToByteConverterClass!
Warning: Could not get charToByteConverterClass!
Warning: Could not get charToByteConverterClass!
Warning: Could not get charToByteConverterClass!
Warning: Could not get charToByteConverterClass!
[JPivot] 21 apr 2017 16:48:13,861 ERROR [Session 08BEA8C58E687AE8F99184BC19FA07A1] com.tonbeller.wcf.component.RendererTag#doEndTag: trouble rendering table01
java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
at mondrian.rolap.RolapMemberBase.getName(RolapMemberBase.java:233)
at mondrian.olap.OlapElementBase.getCaption(OlapElementBase.java:84)
at mondrian.olap.MemberBase.getCaption(MemberBase.java:108)
at mondrian.rolap.DelegatingRolapMember.getCaption(DelegatingRolapMember.java:176)
at com.tonbeller.jpivot.mondrian.MondrianMember.getLabel(MondrianMember.java:79)
at com.tonbeller.jpivot.table.SpanBuilderImpl$RenderSwitch.visitMember(SpanBuilderImpl.java:111)
at com.tonbeller.jpivot.mondrian.MondrianMember.accept(MondrianMember.java:161)
at com.tonbeller.jpivot.table.SpanBuilderImpl.build(SpanBuilderImpl.java:142)
at com.tonbeller.jpivot.table.SpanBuilderDecorator.build(SpanBuilderDecorator.java:34)
at com.tonbeller.jpivot.table.navi.DrillExpandUI$DomDecorator.build(DrillExpandUI.java:81)
at com.tonbeller.jpivot.table.SpanBuilderDecorator.build(SpanBuilderDecorator.java:34)
at com.tonbeller.jpivot.table.navi.DrillExpandUI$DomDecorator.build(DrillExpandUI.java:81)
at com.tonbeller.jpivot.table.SpanBuilderDecorator.build(SpanBuilderDecorator.java:34)
at com.tonbeller.jpivot.table.navi.DrillExpandUI$DomDecorator.build(DrillExpandUI.java:81)
at com.tonbeller.jpivot.table.AxisHeaderBuilderSupport.build(AxisHeaderBuilderSupport.java:63)
at com.tonbeller.jpivot.table.AxisBuilderSupport.buildHeading(AxisBuilderSupport.java:253)
at com.tonbeller.jpivot.table.RowAxisBuilderImpl.buildRow(RowAxisBuilderImpl.java:51)
at com.tonbeller.jpivot.table.TableComponent.buildRows2Dim(TableComponent.java:490)
at com.tonbeller.jpivot.table.TableComponent.render2(TableComponent.java:274)
at com.tonbeller.jpivot.table.TableComponent.render(TableComponent.java:235)
at com.tonbeller.wcf.component.RendererTag.doEndTag(RendererTag.java:137)
at org.apache.jsp.testpage_jsp._jspx_meth_wcf_005frender_005f6(testpage_jsp.java:1398)
at org.apache.jsp.testpage_jsp._jspService(testpage_jsp.java:238)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.tonbeller.wcf.controller.RequestFilter$MyHandler.normalRequest(RequestFilter.java:139)
at com.tonbeller.wcf.controller.RequestFilter.doFilter(RequestFilter.java:264)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1852)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
[JPivot] 21 apr 2017 16:48:13,956 ERROR [Session 08BEA8C58E687AE8F99184BC19FA07A1] com.tonbeller.wcf.controller.RequestFilter$MyHandler#handleException: exeption
org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:549)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:455)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.tonbeller.wcf.controller.RequestFilter$MyHandler.normalRequest(RequestFilter.java:139)
at com.tonbeller.wcf.controller.RequestFilter.doFilter(RequestFilter.java:264)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1852)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.servlet.ServletException: javax.servlet.jsp.JspException: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
at org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:908)
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:841)
at org.apache.jsp.testpage_jsp._jspService(testpage_jsp.java:272)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
... 23 more
Caused by: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
at mondrian.rolap.RolapMemberBase.getName(RolapMemberBase.java:233)
at mondrian.olap.OlapElementBase.getCaption(OlapElementBase.java:84)
at mondrian.olap.MemberBase.getCaption(MemberBase.java:108)
at mondrian.rolap.DelegatingRolapMember.getCaption(DelegatingRolapMember.java:176)
at com.tonbeller.jpivot.mondrian.MondrianMember.getLabel(MondrianMember.java:79)
at com.tonbeller.jpivot.table.SpanBuilderImpl$RenderSwitch.visitMember(SpanBuilderImpl.java:111)
at com.tonbeller.jpivot.mondrian.MondrianMember.accept(MondrianMember.java:161)
at com.tonbeller.jpivot.table.SpanBuilderImpl.build(SpanBuilderImpl.java:142)
at com.tonbeller.jpivot.table.SpanBuilderDecorator.build(SpanBuilderDecorator.java:34)
at com.tonbeller.jpivot.table.navi.DrillExpandUI$DomDecorator.build(DrillExpandUI.java:81)
at com.tonbeller.jpivot.table.SpanBuilderDecorator.build(SpanBuilderDecorator.java:34)
at com.tonbeller.jpivot.table.navi.DrillExpandUI$DomDecorator.build(DrillExpandUI.java:81)
at com.tonbeller.jpivot.table.SpanBuilderDecorator.build(SpanBuilderDecorator.java:34)
at com.tonbeller.jpivot.table.navi.DrillExpandUI$DomDecorator.build(DrillExpandUI.java:81)
at com.tonbeller.jpivot.table.AxisHeaderBuilderSupport.build(AxisHeaderBuilderSupport.java:63)
at com.tonbeller.jpivot.table.AxisBuilderSupport.buildHeading(AxisBuilderSupport.java:253)
at com.tonbeller.jpivot.table.RowAxisBuilderImpl.buildRow(RowAxisBuilderImpl.java:51)
at com.tonbeller.jpivot.table.TableComponent.buildRows2Dim(TableComponent.java:490)
at com.tonbeller.jpivot.table.TableComponent.render2(TableComponent.java:274)
at com.tonbeller.jpivot.table.TableComponent.render(TableComponent.java:235)
at com.tonbeller.wcf.component.RendererTag.doEndTag(RendererTag.java:137)
at org.apache.jsp.testpage_jsp._jspx_meth_wcf_005frender_005f6(testpage_jsp.java:1398)
at org.apache.jsp.testpage_jsp._jspService(testpage_jsp.java:238)
... 26 more
[JPivot] 21 apr 2017 16:48:14,081 ERROR [Session 08BEA8C58E687AE8F99184BC19FA07A1] com.tonbeller.wcf.controller.RequestFilter$MyHandler#handleException: cause
javax.servlet.ServletException: javax.servlet.jsp.JspException: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
at org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:908)
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:841)
at org.apache.jsp.testpage_jsp._jspService(testpage_jsp.java:272)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.tonbeller.wcf.controller.RequestFilter$MyHandler.normalRequest(RequestFilter.java:139)
at com.tonbeller.wcf.controller.RequestFilter.doFilter(RequestFilter.java:264)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1852)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
at mondrian.rolap.RolapMemberBase.getName(RolapMemberBase.java:233)
at mondrian.olap.OlapElementBase.getCaption(OlapElementBase.java:84)
at mondrian.olap.MemberBase.getCaption(MemberBase.java:108)
at mondrian.rolap.DelegatingRolapMember.getCaption(DelegatingRolapMember.java:176)
at com.tonbeller.jpivot.mondrian.MondrianMember.getLabel(MondrianMember.java:79)
at com.tonbeller.jpivot.table.SpanBuilderImpl$RenderSwitch.visitMember(SpanBuilderImpl.java:111)
at com.tonbeller.jpivot.mondrian.MondrianMember.accept(MondrianMember.java:161)
at com.tonbeller.jpivot.table.SpanBuilderImpl.build(SpanBuilderImpl.java:142)
at com.tonbeller.jpivot.table.SpanBuilderDecorator.build(SpanBuilderDecorator.java:34)
at com.tonbeller.jpivot.table.navi.DrillExpandUI$DomDecorator.build(DrillExpandUI.java:81)
at com.tonbeller.jpivot.table.SpanBuilderDecorator.build(SpanBuilderDecorator.java:34)
at com.tonbeller.jpivot.table.navi.DrillExpandUI$DomDecorator.build(DrillExpandUI.java:81)
at com.tonbeller.jpivot.table.SpanBuilderDecorator.build(SpanBuilderDecorator.java:34)
at com.tonbeller.jpivot.table.navi.DrillExpandUI$DomDecorator.build(DrillExpandUI.java:81)
at com.tonbeller.jpivot.table.AxisHeaderBuilderSupport.build(AxisHeaderBuilderSupport.java:63)
at com.tonbeller.jpivot.table.AxisBuilderSupport.buildHeading(AxisBuilderSupport.java:253)
at com.tonbeller.jpivot.table.RowAxisBuilderImpl.buildRow(RowAxisBuilderImpl.java:51)
at com.tonbeller.jpivot.table.TableComponent.buildRows2Dim(TableComponent.java:490)
at com.tonbeller.jpivot.table.TableComponent.render2(TableComponent.java:274)
at com.tonbeller.jpivot.table.TableComponent.render(TableComponent.java:235)
at com.tonbeller.wcf.component.RendererTag.doEndTag(RendererTag.java:137)
at org.apache.jsp.testpage_jsp._jspx_meth_wcf_005frender_005f6(testpage_jsp.java:1398)
at org.apache.jsp.testpage_jsp._jspService(testpage_jsp.java:238)
... 26 more
 
 
this is the query:
SELECT {[Measures].[quantita_media], [Measures].[quantita_totale]} ON
COLUMNS,
{([Periodo], [ScontrinoFiscale],[Articolo])} ON ROWS
FROM [Vendite]

and this is the cube:
<Schema name="New Schema1">  <Cube name="Vendite" cache="true" enabled="true">    <Table name="vendita_ft" schema="public">    </Table>    <Dimension type="StandardDimension" foreignKey="data" highCardinality="false" name="Periodo">      <Hierarchy name="tempo" hasAll="true">        <Table name="data_dt" schema="public">        </Table>        <Level name="giorno" table="data_dt" column="giorno" nameColumn="giorno" type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never">        </Level>        <Level name="mese" table="data_dt" column="mese" type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never">        </Level>        <Level name="anno" table="data_dt" column="anno"  type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never">        </Level>        <Level name="data" table="data_dt" column="data"  type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never">        </Level>      </Hierarchy>    </Dimension>    <Dimension type="StandardDimension" foreignKey="nome" highCardinality="false" name="Articolo">      <Hierarchy name="prodotto" hasAll="true">        <Table name="prodotto_dt" schema="public">        </Table>        <Level name="nome" table="prodotto_dt" column="nome"  type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never">        </Level>        <Level name="descrizione" table="prodotto_dt" column="descrizione"  type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never">        </Level>      </Hierarchy>    </Dimension>    <Dimension type="StandardDimension" foreignKey="codice" highCardinality="false" name="ScontrinoFiscale">      <Hierarchy name="scontrino" hasAll="true" primaryKey="codice">        <Table name="scontrino_dt" schema="public">        </Table>        <Level name="codice" table="scontrino_dt" column="codice"  type="Integer" uniqueMembers="false" levelType="Regular" hideMemberIf="Never">        </Level>        <Level name="totale" table="scontrino_dt" column="totale"  type="Integer" uniqueMembers="false" levelType="Regular" hideMemberIf="Never">        </Level>      </Hierarchy>    </Dimension>    <Measure name="quantita_media" column="quantita" aggregator="avg" visible="true">    </Measure>    <Measure name="quantita_totale" column="quantita" datatype="Integer" aggregator="sum" visible="true">    </Measure>  </Cube></Schema>

nicola.cambara's picture
Joined: Apr 21 2017 - 7:45am
Last seen: 3 months 19 hours ago

1 Answer:

0

Need to convert Integer to String. 
Just create the convert epxression in measuere expression section.
Otherwise convert the data in the datasource level.
Which ever you decide is best for you. 
 

joseng62's picture
216
Joined: Dec 5 2014 - 2:43am
Last seen: 1 month 2 weeks ago
Feedback