在SpringXD Singlenode

时间:2015-07-24 22:37:43

标签: spring-batch spring-xd

在SpringXD Singlenode(1.2.0 Distribution)中部署Spring批处理作业时抛出异常

请告诉我,如何修复此例外(或)需要进一步的详细信息

=============================================== ============================

org.springframework.beans.factory.BeanDefinitionStoreException:名称为'注册商'的无效bean定义。在类路径资源[META-INF / spring-xd / plugins / job / job-module-beans.xml]中定义:无法解析占位符' xd.job.name'在字符串值" $ {xd.job.name}&#34 ;;嵌套异常是java.lang.IllegalArgumentException:无法解析占位符' xd.job.name'在字符串值" $ {xd.job.name}"

以下是追踪

2015-07-24T15:29:11-0700 1.2.0.RELEASE INFO DeploymentsPathChildrenCache-0 container.DeploymentListener - 部署模块[ModuleDescriptor @ 6435a6c5 moduleName =' category',moduleLabel =' category',group =' testcategory',sourceChannelName = [null],sinkChannelName = [null],index = 0,type = job,parameters = map [' dateFormat' - > ' yyyy-MM-dd',' makeUnique' - > ' true'],children = list [[empty]]] 2015-07-24T15:29:12-0700 1.2.0.RELEASE WARN DeploymentsPathChildrenCache-0 annotation.AnnotationConfigApplicationContext - 上下文初始化期间遇到的异常 - 取消刷新尝试 org.springframework.beans.factory.BeanDefinitionStoreException:名称为' registrar'的bean定义无效。在类路径资源[META-INF / spring-xd / plugins / job / job-module-beans.xml]中定义:无法解析占位符' xd.job.name'在字符串值" $ {xd.job.name}&#34 ;;嵌套异常是java.lang.IllegalArgumentException:无法解析占位符' xd.job.name'在字符串值" $ {xd.job.name}"     在org.springframework.beans.factory.config.PlaceholderConfigurerSupport.doProcessProperties(PlaceholderConfigurerSupport.java:211)〜[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]     在org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.processProperties(PropertyPlaceholderConfigurer.java:222)〜[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]     在org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:86)〜[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]     在org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:265)〜[spring-context-4.1.6.RELEASE.jar:4.1.6.RELEASE]     在org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:162)〜[spring-context-4.1.6.RELEASE.jar:4.1.6.RELEASE]     在org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:606)〜[spring-context-4.1.6.RELEASE.jar:4.1.6.RELEASE]     在org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:462)〜[spring-context-4.1.6.RELEASE.jar:4.1.6.RELEASE]     在org.springframework.boot.SpringApplication.refresh(SpringApplication.java:686)[spring-boot-1.2.3.RELEASE.jar:1.2.3.RELEASE]     在org.springframework.boot.SpringApplication.run(SpringApplication.java:320)[spring-boot-1.2.3.RELEASE.jar:1.2.3.RELEASE]     在org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:139)[spring-boot-1.2.3.RELEASE.jar:1.2.3.RELEASE]     在org.springframework.xd.module.core.SimpleModule.initialize(SimpleModule.java:213)[spring-xd-module-1.2.0.RELEASE.jar:1.2.0.RELEASE]     在org.springframework.xd.dirt.module.ModuleDeployer.doDeploy(ModuleDeployer.java:217)[spring-xd-dirt-1.2.0.RELEASE.jar:1.2.0.RELEASE]     在org.springframework.xd.dirt.module.ModuleDeployer.deploy(ModuleDeployer.java:200)[spring-xd-dirt-1.2.0.RELEASE.jar:1.2.0.RELEASE]     在org.springframework.xd.dirt.server.container.DeploymentListener.deployModule(DeploymentListener.java:365)[spring-xd-dirt-1.2.0.RELEASE.jar:1.2.0.RELEASE]     在org.springframework.xd.dirt.server.container.DeploymentListener.deployJobModule(DeploymentListener.java:291)[spring-xd-dirt-1.2.0.RELEASE.jar:1.2.0.RELEASE]     在org.springframework.xd.dirt.server.container.DeploymentListener.onChildAdded(DeploymentListener.java:181)[spring-xd-dirt-1.2.0.RELEASE.jar:1.2.0.RELEASE]     在org.springframework.xd.dirt.server.container.DeploymentListener.childEvent(DeploymentListener.java:149)[spring-xd-dirt-1.2.0.RELEASE.jar:1.2.0.RELEASE]     在org.apache.curator.framework.recipes.cache.PathChildrenCache $ 5.apply(PathChildrenCache.java:509)[curator-recipes-2.6.0.jar:na]     在org.apache.curator.framework.recipes.cache.PathChildrenCache $ 5.apply(PathChildrenCache.java:503)[curator-recipes-2.6.0.jar:na]     在org.apache.curator.framework.listen.ListenerContainer $ 1.run(ListenerContainer.java:92)[curator-framework-2.6.0.jar:na]     在com.google.common.util.concurrent.MoreExecutors $ SameThreadExecutorService.execute(MoreExecutors.java:297)[guava-16.0.1.jar:na]     在org.apache.curator.framework.listen.ListenerContainer.forEach(ListenerContainer.java:83)[curator-framework-2.6.0.jar:na]     在org.apache.curator.framework.recipes.cache.PathChildrenCache.callListeners(PathChildrenCache.java:500)[curator-recipes-2.6.0.jar:na]     在org.apache.curator.framework.recipes.cache.EventOperation.invoke(EventOperation.java:35)[curator-recipes-2.6.0.jar:na]     在org.apache.curator.framework.recipes.cache.PathChildrenCache $ 10.run(PathChildrenCache.java:762)[curator-recipes-2.6.0.jar:na]     at java.util.concurrent.Executors $ RunnableAdapter.call(Executors.java:511)[na:1.8.0_31]     at java.util.concurrent.FutureTask.run(FutureTask.java:266)[na:1.8.0_31]     at java.util.concurrent.Executors $ RunnableAdapter.call(Executors.java:511)[na:1.8.0_31]     at java.util.concurrent.FutureTask.run(FutureTask.java:266)[na:1.8.0_31]     在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[na:1.8.0_31]     at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:617)[na:1.8.0_31]     在java.lang.Thread.run(Thread.java:745)[na:1.8.0_31] 引起:java.lang.IllegalArgumentException:无法解析占位符' xd.job.name'在字符串值" $ {xd.job.name}"

1 个答案:

答案 0 :(得分:0)

创建作业时,通常会传递namedefinition参数。 definition将放在xd.job.name中,作为当前职位名称的占位符。当引用job-module-beans.xml时,它将被填写,例如在xd.job.name中。

看看这个例子:

xd:> job create --name helloWord --definition "hellojob" --deploy
xd:> job launch helloWord --params {"someStringParam":"foobar","-someOtherParam(long)":"123456"}

确保在部署期间创建作业时传递正确的definition