Executing JBoss ON API method getLiveResourceAvailability fails with "Can't commit because the transaction is in aborted state"

Solution Unverified - Updated -

Issue

  • Method getLiveAvailability fires Hibernate exception
  • Executing getLiveResourceAvailability method throws the following transaction exception:

    Wrapped java.lang.RuntimeException: [Warning] javax.transaction.RollbackException: [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] Can't commit because the transaction is in aborted state (<Unknown source>#1)
    
  • We get the follwoing exception:

    org.apache.maven.lifecycle.LifecycleExecutionException: Unexpected Exception caught: javax.transaction.RollbackException: [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] Can't commit because the transaction is in aborted state
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
        ...
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
    Caused by: org.apache.maven.plugin.MojoExecutionException: Unexpected Exception caught: javax.transaction.RollbackException: [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] Can't commit because the transaction is in aborted state
        at com.example.xyz.mavenplugin.remote.RemoteDeploymentMojo.execute(RemoteDeploymentMojo.java:319)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
        ... 22 more
    Caused by: java.lang.RuntimeException: [Warning] javax.transaction.RollbackException: [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] Can't commit because the transaction is in aborted state
        at org.rhq.enterprise.server.remote.RemoteSafeInvocationHandler.invoke(RemoteSafeInvocationHandler.java:113)
        at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:809)
        at org.jboss.remoting.transport.servlet.ServletServerInvoker.processRequest(ServletServerInvoker.java:232)
        at sun.reflect.GeneratedMethodAccessor218.invoke(Unknown Source)
        ...
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
        at java.lang.Thread.run(Thread.java:619)
    ...
    Caused by: org.hibernate.PersistentObjectException: [Warning] detached entity passed to persist: org.rhq.core.domain.configuration.definition.ConfigurationDefinition
        at org.rhq.core.util.exception.WrappedRemotingException.getCause(WrappedRemotingException.java:121)
        at java.lang.Throwable.printStackTraceAsCause(Throwable.java:495)
        at java.lang.Throwable.printStackTraceAsCause(Throwable.java:497)
        ... 22 more
    
  • Server log contains the following warning:

    WARN  [com.arjuna.ats.arjuna.logging.arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator_2] TwoPhaseCoordinator.beforeCompletion - failed for com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple@812aa1
    javax.persistence.PersistenceException: org.hibernate.PersistentObjectException: detached entity passed to persist: org.rhq.core.domain.configuration.definition.ConfigurationDefinition
        at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:629)
        at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:524)
        ... 
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
        at java.lang.Thread.run(Thread.java:619)
    Caused by: org.hibernate.PersistentObjectException: detached entity passed to persist: org.rhq.core.domain.configuration.definition.ConfigurationDefinition
        at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:79)
        at org.hibernate.impl.SessionImpl.firePersistOnFlush(SessionImpl.java:644)
        at org.hibernate.impl.SessionImpl.persistOnFlush(SessionImpl.java:636)
        at org.hibernate.engine.CascadingAction$9.cascade(CascadingAction.java:323)
        at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
        at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:216)
        at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)
        at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
        at org.hibernate.event.def.AbstractFlushingEventListener.cascadeOnFlush(AbstractFlushingEventListener.java:131)
        at org.hibernate.event.def.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:122)
        at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:65)
        at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
        at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
        at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
        at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:515)
        ... 101 more
    

Environment

  • JBoss Operations Network (ON)
    • 3.0, 3.0.1, 3.1
  • Executing the ON Remote API method ResourceManager.getLiveResourceAvailability

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content