Apache Roller
  1. Apache Roller
  2. ROL-1333

Class Cast Exception on weblog settings page

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 3.0
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Tomcat 5.5.20, hibernate 3.2
    • Browser Version:
      all
    • Database:
      mySQL 5.0.27
    • JDK Version:
      1.5.0_09
    • O/S Version:
      Win 2K Advanced Server

      Description

      Class Cast Exception (java.lang.Long) when an integer value appears in referer table, dayHits field, means no access to the settings page for a weblog after a comment is made.

      Source code appears to cast an Integer at line 393 in HibernateRefererManagerImpl.java, but exception says it's a Long. Tweeking DB setup made no difference, but making fields nullable and null appears to work, albeit at the expense of hit counting.

        Activity

        Hide
        Joel Grignou added a comment -

        You can replace the line 393 and casting first the object to Long, instead of Integer as Hibernate query returns a long when using aggregate functions like sum (at least that's how i see it).

        Line 393:
        hits = ((Long) resultsArray[0]).intValue();

        Line 397:
        hits = ((Long) resultsArray[1]).intValue();

        Show
        Joel Grignou added a comment - You can replace the line 393 and casting first the object to Long, instead of Integer as Hibernate query returns a long when using aggregate functions like sum (at least that's how i see it). Line 393: hits = ((Long) resultsArray [0] ).intValue(); Line 397: hits = ((Long) resultsArray [1] ).intValue();
        Hide
        Greg Trasuk added a comment -

        I just had the same thing happen using a Postgresql database. Switching to Hibernate 3.1.2 fixed it (current Hibernate version is 3.2.2).

        Show
        Greg Trasuk added a comment - I just had the same thing happen using a Postgresql database. Switching to Hibernate 3.1.2 fixed it (current Hibernate version is 3.2.2).
        Hide
        Glen Mazza added a comment -

        Unsure which specific fields are causing this issue (referrer table, dayHits field?--I don't know those fields). 2007 Bug reported against Roller 3.0. Please try again with Roller 5.0.1 or trunk.

        Show
        Glen Mazza added a comment - Unsure which specific fields are causing this issue (referrer table, dayHits field?--I don't know those fields). 2007 Bug reported against Roller 3.0. Please try again with Roller 5.0.1 or trunk.

          People

          • Assignee:
            Roller Unassigned
            Reporter:
            declan mcgarry
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development