You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@batchee.apache.org by "Alexander Falb (JIRA)" <ji...@apache.org> on 2018/11/28 12:28:00 UTC

[jira] [Created] (BATCHEE-135) Command "Names" not working

Alexander Falb created BATCHEE-135:
--------------------------------------

             Summary: Command "Names" not working
                 Key: BATCHEE-135
                 URL: https://issues.apache.org/jira/browse/BATCHEE-135
             Project: BatchEE
          Issue Type: Bug
          Components: batchee-cli
    Affects Versions: 0.5-incubating
            Reporter: Alexander Falb


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:

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

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:
{code}
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
{code}
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:
{code}
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)
{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)