本文介绍了JSR 352:Wildfly9/JBeret-如何调用不在同一部署文件级别包含的批处理作业的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含JAR库的WAR应用程序. JAR库包含批处理作业和批处理工件(META-INF/batch-jobs/...). WAR应用程序将此jar作为库包含在内,并定义了JAX-RS服务,该服务允许客户端调用调用JobOperator接口...

I have a WAR application that includes a JAR library. The JAR library contains the Batch Job and the Batch Artifacts (META-INF/batch-jobs/...). The WAR app includes this jar as a library and defines a JAX-RS Service that allows to clients to invoke the batch job calling the JobOperator Interface...

当我运行此部署时,JSR 352实现(JBeret)一直抱怨称调用JobOperator接口时找不到任何作业.但是,如果批处理作业和批处理工件作为战争部署,一切运行顺利...

When i run this deployment, the JSR 352 implementation (JBeret) keeps complaining that the Job cannot be found anyware when the JobOperator Interface is called... However, if the Batch Job and the Batch Artifacts are included as classes of the WAR deployment, everything runs smoothly...

那是什么问题?

推荐答案

经过少量"研究,我在以下链接中找到了答案(分散):

After a "little" research, i found the answer (dispersed) in the following links:

野蝇问题

邮件列表

简而言之,为了使这种部署生效,您必须修改调用Job Operator接口以调用请求的Job的部署(在我的情况下,这是WAR文件)...这些是修改:

Briefly, In order to put this kind of deployment to work, you have to modify the deployment that calls the Job Operator interface to invoke the requested Job (in my case, it was the WAR File)... These are the modifications:

  1. META-INF文件夹下包含一个空" batch-jobs文件夹. (我想空是可选的,因为我必须在该文件夹下放置一个README文件,以防止GIT删除该文件夹)

  1. Include an "empty" batch-jobs folder under the META-INF folder. (I guess the empty is optional, because i have to put a README file under that folder to prevent GIT from removing such folder)

META-INF/services文件夹下定义ServiceLoader(文件).此ServiceLoader(文件)必须调用:org.jberet.spi.JobXmlResolver,并且应包含以下实现作为内容:org.jberet.tools.MetaInfBatchJobsJobXmlResolver

Define a ServiceLoader (file) under META-INF/services folder. This ServiceLoader (file) must be called: org.jberet.spi.JobXmlResolver and should contain the following implementation as content: org.jberet.tools.MetaInfBatchJobsJobXmlResolver

仅此而已.

这篇关于JSR 352:Wildfly9/JBeret-如何调用不在同一部署文件级别包含的批处理作业的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 20:39