Results 1 to 7 of 7

Thread: batchMBeanExporter failed to start - spring batch admin

  1. #1
    Join Date
    Dec 2010
    Posts
    12

    Default 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 utionMetrics@8497f6] with key 'spring.application:type=JobExecution,name=analysi sJob,step=performAnalysisartition3'; nested exception is javax.management.MalformedObjectNameException: Invalid character `:' in value
    at org.springframework.jmx.export.MBeanExporter.regis terBeanNameOrInstance(MBeanExporter.java:602)
    at org.springframework.batch.admin.jmx.BatchMBeanExpo rter.registerSteps(BatchMBeanExporter.java:125)
    at org.springframework.batch.admin.jmx.BatchMBeanExpo rter.doStart(BatchMBeanExporter.java:281)
    at org.springframework.batch.admin.jmx.BatchMBeanExpo rter.start(BatchMBeanExporter.java:234)
    at org.springframework.context.support.DefaultLifecyc leProcessor.doStart(DefaultLifecycleProcessor.java :166)
    ... 24 more

    Caused by: javax.management.MalformedObjectNameException: Invalid character `:' in value
    at javax.management.ObjectName.parseValue(ObjectName. java:958)
    at javax.management.ObjectName.checkValue(ObjectName. java:990)
    at javax.management.ObjectName.construct(ObjectName.j ava:709)
    at javax.management.ObjectName.<init>(ObjectName.java :1446)
    at javax.management.ObjectName.getInstance(ObjectName .java:1346)
    at org.springframework.jmx.support.ObjectNameManager. getInstance(ObjectNameManager.java:95)
    at org.springframework.jmx.export.naming.MetadataNami ngStrategy.getObjectName(MetadataNamingStrategy.ja va:128)
    at org.springframework.jmx.export.MBeanExporter.getOb jectName(MBeanExporter.java:728)
    at org.springframework.jmx.export.MBeanExporter.regis terBeanInstance(MBeanExporter.java:631)
    at org.springframework.jmx.export.MBeanExporter.regis terBeanNameOrInstance(MBeanExporter.java:598)
    ... 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?

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

  2. #2
    Join Date
    Jun 2005
    Posts
    4,230

    Default

    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. #3
    Join Date
    Dec 2010
    Posts
    12

    Default

    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 http://download.oracle.com/javase/6/...bjectName.html, cannot contain the colon character.

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

  4. #4
    Join Date
    Jul 2011
    Posts
    2

    Default

    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 at 02:34 PM. Reason: additional information

  5. #5
    Join Date
    Jul 2011
    Posts
    2

    Default

    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. #6
    Join Date
    Jun 2005
    Posts
    4,230

    Default

    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. #7
    Join Date
    Mar 2007
    Posts
    26

    Default

    I am having same issue with 1.2.0 as well.

    Thanks,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •