Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Critical Critical
    • Resolution: Unresolved
    • Affects Version/s: 5.0.1
    • Fix Version/s: 5.2.0
    • Component/s: None
    • Labels:
      None
    • Environment:
      Liferay Portal version 5.0.1
      Derby DB 10.3
    • Similar Issues:
      Show 5 results 

      Description

      When I'm trying to access a folder in the document library that contains a file, then a Execpetion is thrown:
      java.lang.ClassCastException: java.lang.Long cannot be cast to [Ljava.lang.Object;
      at com.liferay.portlet.documentlibrary.service.persistence.DLFileEntryAndShortcutFinderImpl.findByFolderIds(DLFileEntryAndShortcutFinderImpl.java:156)
      at com.liferay.portlet.documentlibrary.service.impl.DLFileEntryLocalServiceImpl.getFileEntriesAndShortcuts(DLFileEntryLocalServiceImpl.java:574)
      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:597)
      ...

      In "DLFileEntryAndShortcutFinderImpl.java" this statement is executed:
      ( SELECT folderId AS folderId, name AS name, title AS title, 0 AS fileShortcutId FROM DLFileEntry WHERE DLFileEntry.folderId = ? )
      UNION ALL
      ( SELECT toFolderId AS folderId, toName AS name, DLFileEntry.title AS title, fileShortcutId AS fileShortcutId FROM DLFileShortcut
      INNER JOIN DLFileEntry ON (DLFileEntry.folderId = DLFileShortcut.toFolderId) AND (DLFileEntry.name = DLFileShortcut.toName)
      WHERE DLFileShortcut.folderId = ? ) ORDER BY title ASC

      Code:
      Iterator itr = QueryUtil.iterate(
      q, HibernateUtil.getDialect(), begin, end);

      while (itr.hasNext()) {
      Object[] array = (Object[])itr.next();

      Long folderId = (Long)array[0];
      String name = (String)array[1];
      //String title = (String)array[2];
      long fileShortcutId = ((Long)array[3]).longValue();

      Object obj = null;

      if (fileShortcutId > 0)

      { obj = DLFileShortcutUtil.findByPrimaryKey(fileShortcutId); }

      else

      { obj = DLFileEntryUtil.findByF_N(folderId.longValue(), name); }

      fileEntriesAndShortcuts.add(obj);
      }

      If you are using HSLDB you get an Object[] for each iter.next()
      but for Derby Db you get a Long representing the folderid.

      Does anyone have solution for this?

        Activity

        No workflow transitions have been executed yet.

          People

          • Assignee:
            SE Support
            Reporter:
            Tobias Kaefer
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development

                Structure Helper Panel