Uploaded image for project: 'LAMS Development'
  1. LAMS Development
  2. LDEV-2537

Illegal attempt to dereference collection

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: 2.4
    • Component/s: Admin
    • Labels:
      None

      Description

      Added a user using 'create new user' link in 'group mgmt', then went to 'find users', typed in the username of the new user, and clicked 'delete user'. Got this exception, might be something to do with change to Hibernate 3.3:

       FATAL org.lamsfoundation.lams.web.util.CustomStrutsExceptionHandler - org.springframework.orm.hibernate3.HibernateQueryException: illegal attempt to dereference collection [group0_.group_id.users] with element property reference [userId] [select count(*) from org.lamsfoundation.lams.learningdesign.Group group where group.users.userId = :userID]; nested exception is org.hibernate.QueryException: illegal attempt to dereference collection [group0_.group_id.users] with element property reference [userId] [select count(*) from org.lamsfoundation.lams.learningdesign.Group group where group.users.userId = :userID]
              at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:657)
              at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
              at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:424)
              at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:339)
              at org.lamsfoundation.lams.learningdesign.dao.hibernate.GroupDAO.getCountGroupsForUser(GroupDAO.java:73)
              at org.lamsfoundation.lams.usermanagement.service.UserManagementService.userHasData(UserManagementService.java:755)
              at org.lamsfoundation.lams.usermanagement.service.UserManagementService$$FastClassByCGLIB$$aa86f00b.invoke(<generated>)
              at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
              at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:700)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
              at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
              at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:635)
              at org.lamsfoundation.lams.usermanagement.service.UserManagementService$$EnhancerByCGLIB$$48504cf9.userHasData(<generated>)
              at org.lamsfoundation.lams.admin.web.UserAction.remove(UserAction.java:301)

        Activity

        Hide
        marcin Marcin Cieslak added a comment -
        Following Hibernate migration guide:
        http://community.jboss.org/wiki/HibernateCoreMigrationGuide32#hql
        previous syntax was always incorrect and started throwing exceptions after upgrade.

        Fixed by using explicit JOIN rather than implicit one.
        Show
        marcin Marcin Cieslak added a comment - Following Hibernate migration guide: http://community.jboss.org/wiki/HibernateCoreMigrationGuide32#hql previous syntax was always incorrect and started throwing exceptions after upgrade. Fixed by using explicit JOIN rather than implicit one.
        Hide
        ernieg Ernie Ghiglione added a comment -
        Tested and closed.
        Show
        ernieg Ernie Ghiglione added a comment - Tested and closed.

          People

          • Assignee:
            marcin Marcin Cieslak
            Reporter:
            jundirl Jun-Dir Liew
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development