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


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




      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
      • 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.





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


                • Created:

                  Structure Helper Panel