Announcement Announcement Module
Collapse
No announcement yet.
CommandLineJobRunner getting FileNotFoundException when deploying to new environment Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • CommandLineJobRunner getting FileNotFoundException when deploying to new environment

    We have multiple batch jobs that all work fine in our current server environment:

    Current Environment
    • java version "1.6.0_43"
    • Java(TM) SE Runtime Environment (build 1.6.0_43-b01)
    • Java HotSpot(TM) Server VM (build 20.14-b01, mixed mode)
    • Machine hardware: sun4u
    • SunOS version: 5.10
    • Processor type: sparc
    • Hardware: SUNW,Sun-Fire-480R

    However, when we deploy it to the new server environment, we are getting a
    Code:
    FileNotFound
    exception.

    Code:
    ERROR (CommandLineJobRunner.java:355) - Job Terminated in error: Failed to load bean class: mypackage.myJobListener; nested exception is java.io.FileNotFoundException: class path resource [mypackage/MyJobListener.class] cannot be opened because it does not exist
    New Environment
    • java version "1.6.0_43"
    • Java(TM) SE Runtime Environment (build 1.6.0_43-b01)
    • Java HotSpot(TM) Server VM (build 20.14-b01, mixed mode)
    • Machine hardware: sun4v
    • SunOS version: 5.10
    • Processor type: sparc
    • Hardware: sparc SUNW,T5240

    The
    Code:
    $CLASSPATH
    variables are the same between environments.

    The listener that it is looking for is annotated as a
    Code:
    @Component
    , but since it works fine in one environment and not the other, I'm not certain if that has anything to do with this.

    Does anyone know of anything else to check as to why the jobs are not working in the new environment?

  • #2
    Sounds like a class path issue of some kind. Have you tried running your class with the -verbose:class JVM option? That will tell you where the JVM is looking for a particular class.

    Comment


    • #3
      no luck

      The [Loaded...] messages stop when the exception happens (no note as to where it is trying to it load from); the messages do continue past the exception for shutting down the job.

      Up until that point, it is finding the the classes where you would expect.

      The Listerner is inside of the jar file that is running, so I don't get why it wouldn't find it. Again, this is only happening in the new environment.

      Comment


      • #4
        Looks like the issue had to do with a corrupted jar file.

        We ran jar -tf on all of the project jar files. For one of the jar files, it recieved an error:

        Code:
        java.util.zip.ZipException: invalid END header (bad central directory offset)
        Redploying the jar file seemed to take care of the issue.

        Not certain why the jar file had issues. We use ANT to build the jar files, and then combine them into a tar file for deployment. We SFTP the tar file to the unix server, and then untar it. For some reason, the jar files sometimes are having issues, but redeploying seemes to clear it up.
        Last edited by rumn8tr; Apr 22nd, 2013, 09:20 AM.

        Comment

        Working...
        X