Announcement Announcement Module
No announcement yet.
batchMBeanExporter failed to start - spring batch admin Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • batchMBeanExporter failed to start - spring batch admin

    I have embedded spring batch admin into my own web application. I see from time to time that the context initialization fails with the following exception

    Caused by: org.springframework.jmx.export.UnableToRegisterMBe anException: Unable to register MBean [org.springframework.batch.admin.jmx.SimpleStepExec [email protected]] with key 'spring.application:type=JobExecution,name=analysi sJob,step=performAnalysisartition3'; nested exception is Invalid character `:' in value
    at org.springframework.jmx.export.MBeanExporter.regis terBeanNameOrInstance(
    at org.springframework.batch.admin.jmx.BatchMBeanExpo rter.registerSteps(
    at org.springframework.batch.admin.jmx.BatchMBeanExpo rter.doStart(
    at org.springframework.batch.admin.jmx.BatchMBeanExpo rter.start(
    at leProcessor.doStart( :166)
    ... 24 more

    Caused by: Invalid character `:' in value
    at java:958)
    at java:990)
    at ava:709)
    at<init>( :1446)
    at .java:1346)
    at getInstance(
    at org.springframework.jmx.export.naming.MetadataNami ngStrategy.getObjectName(MetadataNamingStrategy.ja va:128)
    at org.springframework.jmx.export.MBeanExporter.getOb jectName(
    at org.springframework.jmx.export.MBeanExporter.regis terBeanInstance(
    at org.springframework.jmx.export.MBeanExporter.regis terBeanNameOrInstance(
    ... 28 more

    This seems to be an issue due to the ":" symbol in the partitioned step's name. Is there a way I can override the naming convention for step names in a partition?

    I am using v1.2 in Tomcat 6.0. Has anyone come across such a situation before? Is JMX mandatory for spring batch admin to work?

    Last edited by Venk; Jan 14th, 2011, 09:04 AM.

  • #2
    JMX is not mandatory and you can disable it by overriding the bean named "batchMBeanExporter" (just put in a dummy String or something). This is a bug though, so if you raise a JIRA it will get fixed (patches and pull requests welcome).


    • #3
      Thanks for the quick response Dave. I'll raise a JIRA on this.

      Looking through the partition implementation, the following is what I found though:

      The SimpleStepExecutionSplitter is hardcoded to use ":" as a separator in generating step names and the StepParserStepFactoryBean invariably uses a Simple step execution splitter for creating partitions. And JMX Object names, as per the javadocs at, cannot contain the colon character.

      Last edited by Venk; Jan 14th, 2011, 10:02 AM.


      • #4
        Any fix to this? I'm getting the exact-same issue. I'm at 1.2.0.RELEASE of Spring Batch Admin. Spring Batch version is 2.1.7.RELEASE.
        Last edited by jewellcj; Jul 22nd, 2011, 02:34 PM. Reason: additional information


        • #5
          Temporarily worked-around by cloning the source of SimpleStepExecutionSplitter into a class FixedSimpleStepExecutionSplitter and changing the STEP_NAME_SEPARATOR constant from ":" to "_" . Tried subclassing SimpleStepExecutionSplitter (which is obviously preferable) but unfortunately it's not amenable to being extended.


          • #6
            I think it's fixed in master in the MBean exporter (I'm surprised that didn't make it into 1.2.0, but it's a while ago, so if you say it's not there, it probably isn't).


            • #7
              I am having same issue with 1.2.0 as well.