[
https://issues.jboss.org/browse/AS7-3291?page=com.atlassian.jira.plugin.s...
]
Madhumita Sadhukhan commented on AS7-3291:
------------------------------------------
I found a similar scenario fixed by Adam in 4.0.0.CR6 for your reference though the root
cause was different in this case:
https://community.jboss.org/message/634317
https://hibernate.onjira.com/browse/HHH-6784
You may use the following piece of code to check available integrators immediate after
initialization of ServiceRegistry in SFSBHibernateTransaction.java as follows
serviceRegistry = builder.buildServiceRegistry();
/*add after above line to print detected integrators*/
for (Integrator integrator :
((IntegratorService)serviceRegistry.getService(IntegratorService.class)).getIntegrators())
{
System.out.println("Integrators detected::"+ integrator.toString());
}
EnversIntegrator is always detected by default while initializing
Serviceregistry using Native Hibernate API causing a MappingException even when Envers is
not used
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
Key: AS7-3291
URL:
https://issues.jboss.org/browse/AS7-3291
Project: Application Server 7
Issue Type: Bug
Components: JPA / Hibernate, Test Suite
Affects Versions: 7.1.0.CR1
Reporter: Madhumita Sadhukhan
Assignee: Strong Liu
Please find the hibernate native api tests located at :
https://github.com/madhumita12/jboss-as/tree/master/testsuite/integration...
The tests are working fine with a workaround I have applied to them,hence I would
like to request you to run the HibernateNativeAPITransactionTestCase locally to see the
issue I have been mentioning before.
Also , please comment the workaround as follows before running the test in order to hit
around the issue:
In file SFSBHibernateTransaction please comment:
//
configuration.setProperty("hibernate.listeners.envers.autoRegister",
"false");
I am simply initialising BootstrapServiceRegistryBuilder and then passing the
configuration properties to it to initialize the ServiceRegistry.
I am not using any AuditListner or @Audited anywhere in my configuration/code.
However when I initialize ServiceRegistry it by default AUTORegisters/detects the
EnversIntegrator which tries to initialise AuditListner via Auditconfiguration and
crashes.
The workaround to this is to set the AUTO_REGISTER in EnversIntegrator to false as
above.
Stacktrace:
... 139 more
Caused by: org.hibernate.MappingException: Unable to create
AuditStrategy[org.hibernate.envers.strategy.DefaultAuditStrategy] instance.
at
org.hibernate.envers.configuration.AuditConfiguration.initializeAuditStrategy(AuditConfiguration.java:114)
at
org.hibernate.envers.configuration.AuditConfiguration.<init>(AuditConfiguration.java:101)
at
org.hibernate.envers.configuration.AuditConfiguration.getFor(AuditConfiguration.java:135)
at
org.hibernate.envers.event.EnversIntegrator.integrate(EnversIntegrator.java:63)
at
org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:295)
[hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1737)
[hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at
org.jboss.as.test.integration.hibernate.SFSBHibernateTransaction.setupConfig(SFSBHibernateTransaction.java:81)
[beans.jar:]
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira