Menu

#15 Destination for AntCompiler

closed-fixed
5
2004-01-21
2003-12-22
No

I've attempted to use the new AntCompilerAdapter to
compile JSPs under Jasper/Tomcat. It seems to work,
with one problem: Jasper and the servlet container want
the .class file to be in the same directory as the .java
file. Janino is putting it elsewhere -- I'm guessing it's
going under "user.dir". The path looks like this:

myappdir/null/org/apache/jsp/my_jsp_page.class

Jasper violates the rule that says that java and class
files that use a package must be in a directory structure
that matches the package. Instead, it just puts things in
a "work" dir.

The AntCompilerAdapter may have to examine a few
more of the configuration parameters that it is currently
ignoring.

Discussion

  • Arno Unkrig

    Arno Unkrig - 2003-12-25

    Logged In: YES
    user_id=865893

    To be honest... I'm not the ANT type of guy, and I also have
    no TOMCAT configuration running on my home PC.

    The AntCompilerAdapter writes its class files to the
    directory given by

    DefaultCompilerAdapter.destDir

    (or the current directory if "null"). It is very difficult
    for me to figure out which configuration parameters the
    AntCompilerAdapter should honor and how. Can you create a
    short spec for that, and I would implement it? Or you would
    fix AntCompilerAdapter yourself? It's only 50 lines of code...

     
  • Arno Unkrig

    Arno Unkrig - 2003-12-25
    • status: open --> pending-accepted
     
  • Arno Unkrig

    Arno Unkrig - 2004-01-08

    Logged In: YES
    user_id=865893

    The AntCompilerAdapter was largely improved in 1.0.13. Can
    you please try again with this new version?

     
  • Chris Cleveland

    Chris Cleveland - 2004-01-09
    • status: pending-accepted --> open-accepted
     
  • Chris Cleveland

    Chris Cleveland - 2004-01-09

    Logged In: YES
    user_id=68865

    Nope, doesn't work. Same problem: it's not putting the
    generated class files in the same directory as the Java
    source. I have no idea where it's actually putting them.

    You can't use classFiles[j].storeInOutputDirectory
    (this.outputDirectory) because that method creates a
    directory structure that matches the packages.

     
  • Arno Unkrig

    Arno Unkrig - 2004-01-19

    Logged In: YES
    user_id=865893

    Could you please set "DEBUG = true" in "Compiler.java" and
    send me the output?

     
  • Arno Unkrig

    Arno Unkrig - 2004-01-21

    Logged In: YES
    user_id=865893

    I'm getting closer... it's not an ANT feature, but a JAVAC
    feature: If no destination directory is specified ("-d"), then
    JAVAC stores the class file in the same directory as the
    source file, regardless of the name of that directory. I will fix
    JANINO to mimic this behavior.

     
  • Arno Unkrig

    Arno Unkrig - 2004-01-21

    Logged In: YES
    user_id=865893

    Release in 1.0.17.

     
  • Arno Unkrig

    Arno Unkrig - 2004-01-21
    • status: open-accepted --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB