2 Replies Latest reply on Jan 13, 2010 7:58 AM by Himanshu Gupta

    @NotAudited is not working.

    Himanshu Gupta Newbie

      I have annotated some of the properties in class but when I deploy the project it gives me mapping exception

       

      @Audited

      public class ResultCrimCase extends Base {

       

      private int resultCrimCaseId;

      private CrimResult crimResult;

      @Audited(targetAuditMode=RelationTargetAuditMode.NOT_AUDITED)

      private CrimChargeType crimChargeType;

       

      private String lastOnRecordName;

      ....
      ...
      }
      Error Log:
      Caused by: org.hibernate.MappingException: An audited relation from com.sterling.ag.model.ResultCrimCharge.crimChargeType to a not audited entity com.sterling.ag.model.CrimChargeType! Such mapping is possible, but has to be explicitly defined using @Audited(targetAuditM
      ode = NOT_AUDITED).
              at org.hibernate.envers.configuration.metadata.AuditMetadataGenerator.getReferencedIdMappingData(AuditMetadataGenerator.java:55
      0)
              at org.hibernate.envers.configuration.metadata.ToOneRelationMetadataGenerator.addToOne(ToOneRelationMetadataGenerator.java:57)
              at org.hibernate.envers.configuration.metadata.AuditMetadataGenerator.addValue(AuditMetadataGenerator.java:155)
              at org.hibernate.envers.configuration.metadata.AuditMetadataGenerator.addProperties(AuditMetadataGenerator.java:190)
              at org.hibernate.envers.configuration.metadata.AuditMetadataGenerator.generateSecondPass(AuditMetadataGenerator.java:487)
              at org.hibernate.envers.configuration.EntitiesConfigurator.configure(EntitiesConfigurator.java:113)
              at org.hibernate.envers.configuration.AuditConfiguration.<init>(AuditConfiguration.java:86)
              at org.hibernate.envers.configuration.AuditConfiguration.getFor(AuditConfiguration.java:99)
              at org.hibernate.envers.event.AuditEventListener.initialize(AuditEventListener.java:315)
              at org.hibernate.event.EventListeners$1.processListener(EventListeners.java:198)
              at org.hibernate.event.EventListeners.processListeners(EventListeners.java:181)
              at org.hibernate.event.EventListeners.initializeListeners(EventListeners.java:194)
              ... 218 more
      19:49:30,951 ERROR [StandardContext] Error listenerStart
      19:49:30,951 ERROR [StandardContext] Context [/ag-springmvc-web] startup failed due to previous errors
      19:49:30,951 INFO  [[/ag-springmvc-web]] Closing Spring root WebApplicationContext
      19:49:32,357 WARN  [ServiceController] Problem starting service jboss.web.deployment:war=ag-springmvc-web.war,id=241692130
      org.jboss.deployment.DeploymentException: URL file:/C:/Documents and Settings/hgupta/Desktop/jboss d k/server/default/tmp/deploy/tmp377
      56ag-springmvc-web-exp.war/ deployment failed
              at org.jboss.web.tomcat.service.TomcatDeployer.performDeployInternal(TomcatDeployer.java:379)
              at org.jboss.web.tomcat.service.TomcatDeployer.performDeploy(TomcatDeployer.java:104)
              at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:375)
              at org.jboss.web.WebModule.startModule(WebModule.java:83)
              at org.jboss.web.WebModule.startService(WebModule.java:61)
              at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
              at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
              at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:585)
              at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
              at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
              at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      Can someone help me out here?