Hitachi Vantara Pentaho Community Forums
Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: java.lang.Integer cannot be cast to java.lang.String everywhere

  1. #1
    Join Date
    Aug 2012
    Posts
    12

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

    Hello:

    Im having some troubles with PRD and OLAP/OLAP4j via Mondrian XML/A:

    My query

    SELECT {[Measures]} ON COLUMNS,
    {[Website].[Id].[358]} ON ROWS
    FROM Visits
    WHERE ([Time].[Day].[5] : [Time].[Day].[7])

    My schema

    <Schema name="Visit schema">
    <Cube name="Visits" visible="true" cache="true" enabled="true">
    <Table name="visit_fact">
    </Table>
    <Dimension type="TimeDimension" visible="true" foreignKey="visit_time_id" highCardinality="false" name="Time">
    <Hierarchy name="Hierarchy" visible="true" hasAll="true" primaryKey="time_id">
    <Table name="time_dim">
    </Table>
    <Level name="Year" visible="true" table="time_dim" column="time_year" nameColumn="time_year" ordinalColumn="time_year" type="String" internalType="String" uniqueMembers="false" levelType="TimeYears" hideMemberIf="Never">
    </Level>
    <Level name="Quarter" visible="true" table="time_dim" column="time_quarter_of_year" nameColumn="time_quarter_of_year" ordinalColumn="time_quarter_of_year" type="String" internalType="String" uniqueMembers="false" levelType="TimeQuarters" hideMemberIf="Never">
    </Level>
    <Level name="Month" visible="true" table="time_dim" column="time_month" nameColumn="time_month" ordinalColumn="time_month" type="String" internalType="String" uniqueMembers="false" levelType="TimeMonths" hideMemberIf="Never">
    </Level>
    <Level name="Day" visible="true" table="time_dim" column="time_day" nameColumn="time_day" ordinalColumn="time_day" type="String" internalType="String" uniqueMembers="false" levelType="TimeDays" hideMemberIf="Never">
    </Level>
    <Level name="Hour" visible="true" table="time_dim" column="time_hour" nameColumn="time_hour" ordinalColumn="time_hour" type="String" internalType="String" uniqueMembers="false" levelType="TimeHours" hideMemberIf="Never">
    </Level>
    <Level name="Day of week" visible="true" table="time_dim" column="time_day_of_week" nameColumn="time_day_of_week" ordinalColumn="time_day_of_week" type="String" internalType="String" uniqueMembers="false" levelType="TimeUndefined" hideMemberIf="Never">
    </Level>
    </Hierarchy>
    </Dimension>
    <Dimension type="StandardDimension" visible="true" foreignKey="visit_website_id" highCardinality="false" name="Website">
    <Hierarchy name="Hierarchy" visible="true" hasAll="true" primaryKey="website_id">
    <Table name="website_dim">
    </Table>
    <Level name="Id" visible="true" table="website_dim" column="website_id" nameColumn="website_id" ordinalColumn="website_id" type="String" internalType="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never">
    </Level>
    <Level name="Name" visible="true" table="website_dim" column="website_name" nameColumn="website_name" ordinalColumn="website_name" type="String" internalType="String" uniqueMembers="true" levelType="Regular" hideMemberIf="Never">
    </Level>
    <Level name="Operator name" visible="true" table="website_dim" column="website_operator_name" nameColumn="website_operator_name" ordinalColumn="website_operator_name" type="String" internalType="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never">
    </Level>
    <Level name="Operator country" visible="true" table="website_dim" column="website_operator_country" nameColumn="website_operator_country" ordinalColumn="website_operator_country" type="String" internalType="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never">
    </Level>
    <Level name="Comment" visible="true" table="website_dim" column="website_comment" nameColumn="website_comment" ordinalColumn="website_comment" type="String" internalType="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never">
    </Level>
    </Hierarchy>
    </Dimension>
    <Dimension type="StandardDimension" visible="true" foreignKey="visit_product_id" highCardinality="false" name="Product">
    <Hierarchy name="Hierarchy" visible="true" hasAll="true" primaryKey="product_id">
    <Table name="product_dim">
    </Table>
    <Level name="Name" visible="true" table="product_dim" column="product_name" nameColumn="product_name" ordinalColumn="product_name" type="String" internalType="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never">
    </Level>
    <Level name="Active" visible="true" table="product_dim" column="product_active" nameColumn="product_active" ordinalColumn="product_active" type="Boolean" internalType="Object" uniqueMembers="false" levelType="Regular" hideMemberIf="Never">
    </Level>
    </Hierarchy>
    </Dimension>
    <Measure name="Total visits" column="visit_id" datatype="Integer" aggregator="count" visible="true">
    </Measure>
    </Cube>
    </Schema>

    The Mondrian server exception

    Name:  PRD exception.jpg
Views: 90
Size:  41.5 KB

    It happens every time I try to access a Numeric field in MySQL, even though I map it as a String

    Also say that the Schema workbench and the Mondrian wepapp itself work perfectly.

    Any advice? What I'm I doing wrong?

    Thanks a lot
    Greetings
    Attached Images Attached Images   
    Last edited by Asker1234; 08-27-2012 at 08:34 AM.

  2. #2
    Join Date
    Mar 2003
    Posts
    8,085

    Default

    This error comes from the server. Check the server's log for a detailed error message. (All your posted exception is saying is: "The server reported an error and the message is ..").

    My gut feeling tells me that your schema does not match your database structure and that you have a type mismatch.
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  3. #3
    Join Date
    Aug 2012
    Posts
    12

    Default

    edited
    Attached Images Attached Images  
    Last edited by Asker1234; 08-28-2012 at 09:37 AM.

  4. #4
    Join Date
    Aug 2012
    Posts
    12

    Default

    edited
    Attached Images Attached Images  
    Last edited by Asker1234; 08-28-2012 at 09:36 AM.

  5. #5
    Join Date
    Aug 2012
    Posts
    12

    Default

    edited
    Attached Images Attached Images  
    Last edited by Asker1234; 08-28-2012 at 09:36 AM.

  6. #6
    Join Date
    Aug 2012
    Posts
    12

    Default

    edited
    Last edited by Asker1234; 08-28-2012 at 09:37 AM.

  7. #7
    Join Date
    Aug 2012
    Posts
    12

    Default

    Hi

    This is the trace of my server

    Name:  PRD exception.jpg
Views: 104
Size:  16.5 KB

    This happens every time I try to access a numeric field in MySQL, even though I map them as Strings in Mondrian.

    MY schema:

    <Schema name="Visit schema">
    <Cube name="Visits" visible="true" cache="true" enabled="true">
    <Table name="visit_fact">
    </Table>
    <Dimension type="TimeDimension" visible="true" foreignKey="visit_time_id" highCardinality="false" name="Time">
    <Hierarchy name="Hierarchy" visible="true" hasAll="true" primaryKey="time_id">
    <Table name="time_dim">
    </Table>
    <Level name="Year" visible="true" table="time_dim" column="time_year" nameColumn="time_year" ordinalColumn="time_year" type="String" internalType="String" uniqueMembers="false" levelType="TimeYears" hideMemberIf="Never">
    </Level>
    <Level name="Quarter" visible="true" table="time_dim" column="time_quarter_of_year" nameColumn="time_quarter_of_year" ordinalColumn="time_quarter_of_year" type="String" internalType="String" uniqueMembers="false" levelType="TimeQuarters" hideMemberIf="Never">
    </Level>
    <Level name="Month" visible="true" table="time_dim" column="time_month" nameColumn="time_month" ordinalColumn="time_month" type="String" internalType="String" uniqueMembers="false" levelType="TimeMonths" hideMemberIf="Never">
    </Level>
    <Level name="Day" visible="true" table="time_dim" column="time_day" nameColumn="time_day" ordinalColumn="time_day" type="String" internalType="String" uniqueMembers="false" levelType="TimeDays" hideMemberIf="Never">
    </Level>
    <Level name="Hour" visible="true" table="time_dim" column="time_hour" nameColumn="time_hour" ordinalColumn="time_hour" type="String" internalType="String" uniqueMembers="false" levelType="TimeHours" hideMemberIf="Never">
    </Level>
    <Level name="Day of week" visible="true" table="time_dim" column="time_day_of_week" nameColumn="time_day_of_week" ordinalColumn="time_day_of_week" type="String" internalType="String" uniqueMembers="false" levelType="TimeUndefined" hideMemberIf="Never">
    </Level>
    </Hierarchy>
    </Dimension>
    <Dimension type="StandardDimension" visible="true" foreignKey="visit_website_id" highCardinality="false" name="Website">
    <Hierarchy name="Hierarchy" visible="true" hasAll="true" primaryKey="website_id">
    <Table name="website_dim">
    </Table>
    <Level name="Id" visible="true" table="website_dim" column="website_id" nameColumn="website_id" ordinalColumn="website_id" type="String" internalType="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never">
    </Level>
    <Level name="Name" visible="true" table="website_dim" column="website_name" nameColumn="website_name" ordinalColumn="website_name" type="String" internalType="String" uniqueMembers="true" levelType="Regular" hideMemberIf="Never">
    </Level>
    <Level name="Operator name" visible="true" table="website_dim" column="website_operator_name" nameColumn="website_operator_name" ordinalColumn="website_operator_name" type="String" internalType="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never">
    </Level>
    <Level name="Operator country" visible="true" table="website_dim" column="website_operator_country" nameColumn="website_operator_country" ordinalColumn="website_operator_country" type="String" internalType="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never">
    </Level>
    <Level name="Comment" visible="true" table="website_dim" column="website_comment" nameColumn="website_comment" ordinalColumn="website_comment" type="String" internalType="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never">
    </Level>
    </Hierarchy>
    </Dimension>
    <Dimension type="StandardDimension" visible="true" foreignKey="visit_product_id" highCardinality="false" name="Product">
    <Hierarchy name="Hierarchy" visible="true" hasAll="true" primaryKey="product_id">
    <Table name="product_dim">
    </Table>
    <Level name="Name" visible="true" table="product_dim" column="product_name" nameColumn="product_name" ordinalColumn="product_name" type="String" internalType="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never">
    </Level>
    <Level name="Active" visible="true" table="product_dim" column="product_active" nameColumn="product_active" ordinalColumn="product_active" type="Boolean" internalType="Object" uniqueMembers="false" levelType="Regular" hideMemberIf="Never">
    </Level>
    </Hierarchy>
    </Dimension>
    <Measure name="Total visits" column="visit_id" datatype="Integer" aggregator="count" visible="true">
    </Measure>
    </Cube>
    </Schema>

    This happens only in the Mondrian server, not in the Schema Workbench

    Greetings,
    Thanks a lot

  8. #8
    Join Date
    Aug 2012
    Posts
    12

    Default

    Edited
    Last edited by Asker1234; 08-28-2012 at 09:37 AM.

  9. #9
    Join Date
    Aug 2012
    Posts
    12

    Default

    Edited
    Last edited by Asker1234; 08-28-2012 at 09:37 AM.

  10. #10
    Join Date
    Mar 2003
    Posts
    8,085

    Default

    Can you copy the text out of the console (or open the file "pentaho.log" in your installation) and paste that text in here.

    Right now your screenshots are incredible hard to read (as you can see when looking at this thread).
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.