Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-9940

Kafka WIH tests are failing due to "EntityManagerFactory is closed"

    XMLWordPrintable

Details

    • NEW
    • NEW
    • ---
    • ---

    Description

      There are some failures when executing Kafka WIH tests from the jbpm-work-items repo

      It seems, they're failing when an exception is thrown from the Kafka WIH and the runtime strategy used is PER_REQUEST.

      Caused by: 
      java.lang.IllegalStateException: EntityManagerFactory is closed 
      at org.hibernate.internal.SessionFactoryImpl.validateNotClosed(SessionFactoryImpl.java:531) 
      at org.hibernate.internal.SessionFactoryImpl.createEntityManager(SessionFactoryImpl.java:613) 
      at org.hibernate.internal.SessionFactoryImpl.createEntityManager(SessionFactoryImpl.java:154) 
      at sun.reflect.GeneratedMethodAccessor79.invoke(Unknown Source) 
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
      at java.lang.reflect.Method.invoke(Method.java:498) 
      at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.invokeProxyMethod(AbstractEntityManagerFactoryBean.java:497) 
      at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean$ManagedEntityManagerFactoryInvocationHandler.invoke(AbstractEntityManagerFactoryBean.java:680) 
      at com.sun.proxy.$Proxy129.createEntityManager(Unknown Source) 
      at org.kie.spring.persistence.AbstractKieSpringJpaManager.getCommandScopedEntityManager(AbstractKieSpringJpaManager.java:86) 
      at org.kie.spring.persistence.KieSpringTaskJpaManager.beginCommandScopedEntityManager(KieSpringTaskJpaManager.java:49) 
      at org.jbpm.services.task.persistence.TaskTransactionInterceptor.execute(TaskTransactionInterceptor.java:73) 
      at org.jbpm.services.task.persistence.TaskTransactionInterceptor.execute(TaskTransactionInterceptor.java:49) 
      at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:39) 
      at org.drools.persistence.jta.TransactionLockInterceptor.execute(TransactionLockInterceptor.java:73) 
      at org.drools.persistence.jta.TransactionLockInterceptor.execute(TransactionLockInterceptor.java:45) 
      at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:39) 
      at org.drools.persistence.jpa.OptimisticLockRetryInterceptor.internalExecute(OptimisticLockRetryInterceptor.java:102) 
      at org.drools.persistence.jpa.OptimisticLockRetryInterceptor.execute(OptimisticLockRetryInterceptor.java:83) 
      at org.drools.persistence.jpa.OptimisticLockRetryInterceptor.execute(OptimisticLockRetryInterceptor.java:44) 
      at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:39) 
      at org.jbpm.runtime.manager.impl.error.ExecutionErrorHandlerInterceptor.internalExecute(ExecutionErrorHandlerInterceptor.java:66) 
      at org.jbpm.runtime.manager.impl.error.ExecutionErrorHandlerInterceptor.execute(ExecutionErrorHandlerInterceptor.java:52) 
      at org.jbpm.runtime.manager.impl.error.ExecutionErrorHandlerInterceptor.execute(ExecutionErrorHandlerInterceptor.java:29) 
      at org.drools.core.runtime.InternalLocalRunner.execute(InternalLocalRunner.java:37) 
      at org.drools.core.runtime.InternalLocalRunner.execute(InternalLocalRunner.java:41) 
      at org.jbpm.services.task.commands.TaskCommandExecutorImpl.execute(TaskCommandExecutorImpl.java:49) 
      at org.jbpm.services.task.impl.command.CommandBasedTaskService.execute(CommandBasedTaskService.java:159) 
      at org.jbpm.kie.services.impl.AbstractDeploymentService.commonDeploy(AbstractDeploymentService.java:156) 
      ... 57 more
      

      If you run these tests individually they all work fine, so it seems that something is not properly cleaned-up after test execution. Tried to use a DirtyContext AFTER_EACH_METHOD annotation but didn't help.

      So right now, only thing I can think of is to force surefire plugin to not reuse forks.

      Attachments

        Activity

          People

            antferna Antonio Fernandez Alhambra
            antferna Antonio Fernandez Alhambra
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: