无法使用spring batch admin启动spring boot Web应用程序

我正在尝试运行带有嵌入式tomcat的Web应用程序,包括许多 spring 批处理作业和spring批处理管理员 . 但是当我尝试运行生成的胖 jar 时,我得到以下错误, Spring 季批处理或启动团队的任何人都可以帮忙:

Error registering Tomcat:j2eeType=WebModule,name=//localhost/*,J2EEApplication=none,J2EEServer=none

添加更多信息:spring boot的版本:来自spring.io parent pom version 1.0.3.RELEASE的1.1.9.RELEASE我尝试从STS运行它以及使用mvn spring-boot:run以相同的效果运行 . 批处理作业从文件读取并写入hornetq .

完整的堆栈跟踪如下:

2014-11-14 14:22:45.236 ERROR 404 --- [ost-startStop-1] org.apache.tomcat.util.modeler.Registry  : Error registering Tomcat:j2eeType=WebModule,name=//localhost/*,J2EEApplication=none,J2EEServer=none`

javax.management.RuntimeOperationsException: null
    at com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:411)`
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerWithRepository(DefaultMBeanServerInterceptor.java:1898)`
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:966)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:900)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:324)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522)    
    at org.apache.tomcat.util.modeler.Registry.registerComponent(Registry.java:742)
    at org.apache.catalina.util.LifecycleMBeanBase.register(LifecycleMBeanBase.java:158)
    at org.apache.catalina.util.LifecycleMBeanBase.initInternal(LifecycleMBeanBase.java:61)
    at org.apache.catalina.core.ContainerBase.initInternal(ContainerBase.java:1084)
    at org.apache.catalina.core.StandardContext.initInternal(StandardContext.java:6506)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalArgumentException: Repository: cannot add mbean for pattern name Tomcat:j2eeType=WebModule,name=//localhost/*,J2EEApplication=none,J2EEServer=none
    ... 19 common frames omitted

回答(1)

2 years ago

我假设该名称不是有效的对象名称: //localhost/*

你可以试着用不同的名字,或者逃避或quote这个名字 . 这应该可以解决问题 .