Uploaded image for project: 'BatchEE'
  1. BatchEE
  2. BATCHEE-135

Command "Names" not working

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 0.5-incubating
    • 0.6
    • batchee-cli
    • None

    Description

      If the batchname.xml resides inside an JAR inside an WAR file, bin/batchee names -archive mybatcharchive.war does NOT list batchname as available batch:

      $ ./bin/batchee names -archive mybatcharchive.war
      [... a lot of startup lines, including the batchee ascii logo ...]
      names
      -----
      $
      

      The structure in detail is like this: I have a aggregator Maven module with packaging WAR and multiple Maven modules (packaging jar) containing batch.xml(s) and Java sources. Compiled and packaged it looks something like this:

      mybatcharchive.war
      \- WEB-INF
         \- lib
            +- batchmoduleA.jar ... this is a file, not a folder!
            |  +- META-INF
            |  |  \- batch-jobs
            |  |     \- batchname.xml
            |  \- com
            |     \- package
            |        +- MyBatchlet.class
            |        \- ... more classes
            \- batchmoduleB.jar ... this is a file, not a folder!
               +- META-INF
               |  \- batch-jobs
               |     \- anotherbatch.xml
               \- com2
                  \- package2
                     +- MyBatchlet2.class
                     \- ... more classes
      

      I traced the problem down to org.apache.batchee.cli.command.Names#findInJar. In my case, file isĀ file:/D:/toolsrunner-1.5/work/mybatcharchive.war/WEB-INF/lib/batchmoduleA.jar which cant be opend by new JarFile(file) and throws an exception:

      java.io.FileNotFoundException: file:\D:\tools\runner-1.5\work\mybatcharchive.war\WEB-INF\lib\batchmoduleA.jar (The filename, directory name, or volume label syntax is incorrect)
        at  java.util.zip.ZipFile.open(Native Method)
        at  java.util.zip.ZipFile.<init>(ZipFile.java:225)
        at  java.util.zip.ZipFile.<init>(ZipFile.java:155)
        at  java.util.jar.JarFile.<init>(JarFile.java:166)
        at  java.util.jar.JarFile.<init>(JarFile.java:130)
        at  org.apache.batchee.cli.command.Names.findInJar(Names.java:72)
        at  org.apache.batchee.cli.command.Names.doRun(Names.java:62)
        at  org.apache.batchee.cli.command.JobOperatorCommand.run(JobOperatorCommand.java:187)
        at  org.apache.batchee.cli.BatchEECLI.main(BatchEECLI.java:166)
        at  sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at  java.lang.reflect.Method.invoke(Method.java:498)
        at  org.apache.batchee.cli.bootstrap.Bootstrap.main(Bootstrap.java:62)
      

      Attachments

        Activity

          People

            rsandtner Reinhard Sandtner
            elexx Alexander Falb
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: