Spring Batch 3.0.2 Dependency with Javax. Batch. Runtime. Jobinstance

Updates:

After adding javax.batch-api-1.0.jar file, the below exception is gone and the application is up an running.

Origianl Post

I have been using Java 6 along with Spring batch and Integration for a year by now. Application is a stand alone java application using Java 1.6.

Since the version of spring batch is so outdated, I am trying to update the libraries today. I upgraded,

  • Spring framework from 3.2 to 4.1.2
  • Spring batch from 2.1 to 3.0.2
  • Spring Integration from 2.2 to 4.1

Due to the upgrade, I added a new jar file which is Spring-retry-1.1.jar

After the upgrade, I am having below exception.

Caused by: java.lang.ClassNotFoundException: javax.batch.runtime.JobInstance
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)

It looks like spring batch core 3.0.2 does not support Java SE6 for me. It looks like Java EE7 package. However when I dig the spring batch document, it says it support Java 6,7,8.

Does anybody knows what is going on Spring batch core 3.0.2 with Java version?

1

1 Answer

This is not a java version issue - it looks your missing jars on your run-time class path

How are you managing your dependencies? The spring batch 3.0.2 depends on a jar --> Javax.batch API that contains the class in question.

For a list of full dependencies check out -->

Note the dependency is not optional. The Spring JobInstance class implements the JobInstance and as such is a required dependency.

Class JobInstance

    All Implemented Interfaces:
    java.io.Serializable, javax.batch.runtime.JobInstance 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Maya Lin-Takahashi

Maya Lin-Takahashi

Consumer Tech & Gadget Reviewer

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.

Share this article
Twitter Facebook Pinterest