Uploaded image for project: 'JCommune'
  1. JCommune
  2. JC-965

Stack Trace on viewing pages which look for UserSid

VotersWatchers
    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.20 Larks
    • Fix Version/s: 0.20 Larks
    • Labels:
      None

      Description

      Steps to reproduce:

      1. Create a clean database
      2. Start JCommune so that tables are created, don't do anything else
      3. Start Poulpe on the same DB, log in as admin/admin
      4. Create component, section and a branch
      5. Stop Poulpe
      6. Start JCommune again and go onto main page
      • AR: you'll see an exception
      • ER: weeeell.. we don't expect this exception to happen

      @Develoers: this happens because JCommune expects some Sids already be present in the tables (it's probably created while user registration), the logic in our ACL utils is that if it can't find OID or SID (don't quite remember), it will create one which causes an INSERT statement to be created. Write mode is not supported by our architecture if it doesn't happen through transactional level of services. Thus all the tags (this happens in other circumstances for some other pages where hasPermission tag is used) should also go through Service Layer to execute their operations.

      Here is the exception itself:

      org.apache.jasper.JasperException: An exception occurred processing JSP page /WEB-INF/jsp/sectionList.jsp at line 64
      
      61: 
      62:     <%-- Topics table --%>
      63:     <c:forEach var="section" items="${sectionList}">
      64:         <jtalks:isSectionVisible section="${section}">
      65: 
      66:             <table id="topics-table" cellpadding="0" cellspacing="0" border="0"
      67:                    class="table table-striped table-bordered">
      ======================================================================
      
      java.lang.IllegalArgumentException: Transaction must be running
      	org.springframework.util.Assert.isTrue(Assert.java:65)
      	org.springframework.security.acls.jdbc.JdbcMutableAclService.createOrRetrieveSidPrimaryKey(JdbcMutableAclService.java:208)
      	org.springframework.security.acls.jdbc.JdbcMutableAclService.createObjectIdentity(JdbcMutableAclService.java:150)
      	org.springframework.security.acls.jdbc.JdbcMutableAclService.createAcl(JdbcMutableAclService.java:105)
      	org.jtalks.common.security.acl.AclUtil.getAclFor(AclUtil.java:74)
      	org.jtalks.jcommune.service.security.AclGroupPermissionEvaluator.hasPermission(AclGroupPermissionEvaluator.java:97)
      	org.jtalks.jcommune.web.tags.HasPermission.doStartTag(HasPermission.java:91)
      	org.apache.jsp.tag.web.isSectionVisible_tag._jspx_meth_jtalks_005fhasPermission_005f0(isSectionVisible_tag.java:194)
      	org.apache.jsp.tag.web.isSectionVisible_tag._jspx_meth_c_005fforEach_005f0(isSectionVisible_tag.java:159)
      	org.apache.jsp.tag.web.isSectionVisible_tag.doTag(isSectionVisible_tag.java:97)

        Attachments

          Issue Links

            Structure

              Activity

                People

                • Assignee:
                  ilzul Ilya Zhulanov
                  Reporter:
                  ctapobep Stanislav Bashkyrtsev
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Due:
                    Created:
                    Updated:
                    Resolved:

                    Time Tracking

                    Estimated:
                    Original Estimate - 8h
                    8h
                    Remaining:
                    Remaining Estimate - 0h
                    0h
                    Logged:
                    Time Spent - 8h
                    8h

                      Structure Helper Panel