[jboss-jira] [JBoss JIRA] (WFLY-9565) No batch environment for ear classloader

Sverre Boschman (JIRA) issues at jboss.org
Thu Nov 23 04:23:00 EST 2017


Sverre Boschman created WFLY-9565:
-------------------------------------

             Summary: No batch environment for ear classloader
                 Key: WFLY-9565
                 URL: https://issues.jboss.org/browse/WFLY-9565
             Project: WildFly
          Issue Type: Bug
          Components: Batch
    Affects Versions: 11.0.0.Final, 12.0.0.Alpha1
            Reporter: Sverre Boschman
            Assignee: Cheng Fang
            Priority: Minor
         Attachments: jbatch-test.zip

Starting a batch job inside an EJB module packaged in an EAR on application startup throws a 'WFLYBATCH000019: No batch environment was found for class loader' exception. The reported class loader is the 'ear class loader'. On WF10 this works as expected: the job runs.

{noformat}
[WildFly 11] Caused by: javax.batch.operations.BatchRuntimeException: WFLYBATCH000019: No batch environment was found for class loader: ModuleClassLoader for Module "deployment.jbatch-test-wf11-ear-0.0.1-SNAPSHOT.ear" from Service Module Loader
[WildFly 11]    at org.wildfly.extension.batch.jberet.DefaultBatchEnvironment.getJobRepository(DefaultBatchEnvironment.java:67)
[WildFly 11]    at org.jberet.operations.JobOperatorImpl.<init>(JobOperatorImpl.java:51)
[WildFly 11]    at org.jberet.spi.JobOperatorContext.create(JobOperatorContext.java:60)
[WildFly 11]    at org.wildfly.extension.batch.jberet.BatchSubsystemDefinition$BatchSubsystemAdd.lambda$new$0(BatchSubsystemDefinition.java:180)
[WildFly 11]    at org.jberet.spi.ContextClassLoaderJobOperatorContextSelector$1.run(ContextClassLoaderJobOperatorContextSelector.java:42)
[WildFly 11]    at org.jberet.spi.ContextClassLoaderJobOperatorContextSelector$1.run(ContextClassLoaderJobOperatorContextSelector.java:32)
[WildFly 11]    at org.jberet.spi.ContextClassLoaderJobOperatorContextSelector.getJobOperatorContext(ContextClassLoaderJobOperatorContextSelector.java:60)
[WildFly 11]    at org.jberet.spi.JobOperatorContext.getJobOperatorContext(JobOperatorContext.java:49)
[WildFly 11]    at org.jberet.operations.DelegatingJobOperator.getDelegate(DelegatingJobOperator.java:112)
[WildFly 11]    at org.jberet.operations.DelegatingJobOperator.start(DelegatingJobOperator.java:67)
{noformat}

Starting the job at startup (this class is inside the EJB module):
{code:java}
@ApplicationScoped
public class EjbLoader {
	public void init(
			@SuppressWarnings("unused") @Observes @Initialized(ApplicationScoped.class) Object init)
	{
		BatchRuntime.getJobOperator().start("jbatch-test-job.xml", new Properties());
	}
}
{code}




--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the jboss-jira mailing list