AnsweredAssumed Answered

Failed load audit model, please help

Question asked by aique on Apr 15, 2010
Latest reply on Apr 16, 2010 by aique
Hi!.

I'm developing a J2EE app with the Alfresco SDK and the JCR API.

The versions are 3.3 in both.

I have a form to log in using the next code into a servlet:

       ApplicationContext context = new ClassPathXmlApplicationContext("classpath:alfresco/application-context.xml");
       Repository repository = (Repository)context.getBean("JCR.Repository");
       Session session = repository.login(new SimpleCredentials(usuario, password.toCharArray()));

When I complete the form and submit it I get this error:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'copyService' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'NodeService' while setting bean property 'nodeService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'NodeService': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'AuditMethodInterceptor' defined in class path resource [alfresco/public-services-context.xml]: Cannot resolve reference to bean 'auditComponent' while setting bean property 'auditComponent'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auditComponent' defined in class path resource [alfresco/audit-services-context.xml]: Cannot resolve reference to bean 'auditModel.modelRegistry' while setting bean property 'auditModelRegistry'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'Audit' defined in class path resource [alfresco/bootstrap-context.xml]: Invocation of init method failed; nested exception is org.alfresco.repo.audit.model.AuditModelException: 03150001 Failed to load audit model: file:/C:/TFM/entorno/tomcat/webapps/wdi/WEB-INF/classes/alfresco/audit/alfresco-audit-cmis.xml

I have open the file in the path C:/TFM/entorno/tomcat/webapps/wdi/WEB-INF/classes/alfresco/audit/alfresco-audit-cmis.xml and this is the content:

<?xml version="1.0" encoding="UTF-8"?>

<Audit xmlns="http://www.alfresco.org/repo/audit/model/3.2"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.alfresco.org/repo/audit/model/3.2 alfresco-audit-3.2.xsd">

    <DataExtractors>
       <DataExtractor name="simpleValue" registeredName="auditModel.extractor.simpleValue"/>
       <DataExtractor name="nullValue" registeredName="auditModel.extractor.nullValue"/>
       <DataExtractor name="changeLog" registeredName="CMISChangeLogDataExtractor"/>
    </DataExtractors>

    <PathMappings>
        <PathMap source="/CMISChangeLog" target="/CMISChangeLog" />
        <PathMap source="/alfresco-api/post/FileFolderService/create" target="/CMISChangeLog/CREATED" />
        <PathMap source="/alfresco-api/post/NodeService/setProperties" target="/CMISChangeLog/UPDATED" />
        <PathMap source="/alfresco-api/post/NodeService/addProperties" target="/CMISChangeLog/UPDATED" />
        <PathMap source="/alfresco-api/post/NodeService/setProperty" target="/CMISChangeLog/UPDATED" />
        <PathMap source="/alfresco-api/post/NodeService/removeProperty" target="/CMISChangeLog/UPDATED" />
        <PathMap source="/alfresco-node/beforeDeleteNode" target="/CMISChangeLog/DELETED" />
        <PathMap source="/alfresco-api/post/PermissionService/setPermission" target="/CMISChangeLog/SECURITY" />
        <PathMap source="/alfresco-api/post/PermissionService/setInheritParentPermissions" target="/CMISChangeLog/SECURITY" />
        <PathMap source="/alfresco-api/post/PermissionService/clearPermission" target="/CMISChangeLog/SECURITY" />
        <PathMap source="/alfresco-api/post/PermissionService/deletePermission" target="/CMISChangeLog/SECURITY" />
    </PathMappings>

    <Application name="CMISChangeLog" key="CMISChangeLog">
        <AuditPath key="CREATED">
            <AuditPath key="result">
                <RecordValue key="value" dataExtractor="changeLog" />
            </AuditPath>
            <AuditPath key="error">
                <RecordValue key="value" dataExtractor="nullValue" />
            </AuditPath>
        </AuditPath>

        <AuditPath key="UPDATED">
            <AuditPath key="args">
                 <AuditPath key="nodeRef">
                    <RecordValue key="value" dataExtractor="changeLog" />
                 </AuditPath>
            </AuditPath>
            <AuditPath key="error">
                <RecordValue key="value" dataExtractor="nullValue" />
            </AuditPath>
        </AuditPath>

        <AuditPath key="DELETED">
            <AuditPath key="node">
                <RecordValue key="value" dataExtractor="changeLog" />
            </AuditPath>
        </AuditPath>
       
        <AuditPath key="SECURITY">
            <AuditPath key="args">
                 <AuditPath key="nodeRef">
                    <RecordValue key="value" dataExtractor="changeLog" />
                 </AuditPath>
            </AuditPath>
            <AuditPath key="error">
                <RecordValue key="value" dataExtractor="nullValue" />
            </AuditPath>
        </AuditPath>       
    </Application>

</Audit>

Any one knows what's happen?.

Thanks for your help, I'm really stuck.

Outcomes