Uploaded image for project: 'Service Packs and Hot Fixes'
  1. Service Packs and Hot Fixes
  2. MNT-12433

Unable to use EHCache after VM Termination event

    Details

    • Type: Service Pack Request
    • Status: Closed (View Workflow)
    • Resolution: Won't Fix
    • Affects Version/s: 4.1.9.4, 4.2.3.3
    • Fix Version/s: None
    • Component/s: Auditing, Repository
    • Labels:
      None
    • Environment:
      RHEL,tomcat,postgres
    • Bug Priority:
      Category 2
    • ACT Numbers:

      00173021

      Description

      Description:

      When using a custom public service with an Auditable annotation in one of its methods and calling this public method from a custom class method (onShutdown) that extends from AbstractLifecycleBean the AuditMethodInterceptor throws an exception on shutdown instead of logging to the database or adding an entry in the logs (log4j.logger.org.alfresco.support=DEBUG)

      Steps to Reproduce:

      • Create a public service class (see attached project for files MyCustomService.java and MyCustomServiceImpl.java) and implement a method which uses the Auditable annotation.
      • Create a custom bootstrap class (as defined in the file bootstrap-context.xml) that extends the class class AbstractLifecycleBean and calls the previously defined public service's annotated method (see file MyBootstrapImpl.java on methods onBootstrap & onShutdown)
      • Deploy these files in an alfresco.war (can create an amp with the included maven project)
      • Turn on the logger
        log4j.logger.org.alfresco.support=DEBUG
      • Start a connection to the alfresco database and take note to the table "alf_audit_entry" before tomcat starts with the customizations
      • Start tomcat and the onBootstrap method is called and the method doSomeWork is also called, when the method is called an entry is created in the database in the table "alf_audit_entry"
      • Shut down tomcat

      Expected Behavior:

      On shutdown an audit entry is created

      Observed Behavior:

      In the alfresco logs an error is thrown

      ERROR [audit.model.AuditModelRegistryImpl] [main] Failed to load audit model: file:/Users/joseportillo/Documents/alfresco/installs/414/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/extension/audit/customservice-audit.xml
      org.alfresco.error.AlfrescoRuntimeException: 08180020 Failed to get from EhCache as state invalid:
      state: STATUS_SHUTDOWN
      key: ContentData.237
      at org.alfresco.repo.cache.EhCacheAdapter.get(EhCacheAdapter.java:93)
      at org.alfresco.repo.cache.TransactionalCache.getSharedCacheValue(TransactionalCache.java:415)

      Analysis to Date:

      The same error is reproduced when using a custom class which implements from SmartLifecycle and also when using a custom subsystem (see attached file MyChildApplicationContextFactory.java on the destroy methods) in all cases the same error is thrown on shutdown.

        Attachments

          Structure

            Activity

              People

              • Assignee:
                closedissues Closed Issues
                Reporter:
                jportillo Jose Portillo
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Structure Helper Panel