Re: TestRewriteValve Fails When Specifying Custom Output Directory

2023-03-20 Thread Igal Sapir
Mark,

On Mon, Mar 20, 2023 at 5:10 AM Mark Thomas  wrote:

> On 18/03/2023 20:53, Igal Sapir wrote:
> > Mark,
> >
> > On Thu, Mar 16, 2023 at 2:12 AM Mark Thomas  wrote:
> >
> >> On 15/03/2023 21:16, Igal Sapir wrote:
> >>
> >> 
> >>
> >>> It is mostly solved, and that might be sufficient.
> >>>
> >>> So while `ant clean test` now completes without failures, the part that
> >>> still doesn't work is when I specify a custom "Working Directory" in
> the
> >>> IDE in order to make JSP files resolved.  In my setup that is
> >>> "/workspace/build/tomcat/main/build", or /build, and the
> >>> file is searched for at
> >>> "/workspace/build/tomcat/main/build/test/conf/TesterRewriteMapB.txt"
> >> which
> >>> is not found.
> >>
> >> Can you expand on "make JSP files resolved"? What doesn't work if you
> >> don't specify a custom working directory?
> >>
> >
> > When I do not set the custom working directory, or if use the default in
> > IntelliJ IDEA, $MODULE_WORKING_DIR$, I get the following errors in the
> > console:
>
> This looks like it is getting into the details of how Idea is configured
>   which I'm not familiar with.
>
> The expectation is that the working directory is the root of the source
> tree which I think is "/workspace/build/tomcat/main" in your setup.
>
> For the Ant script we can at least make everything relative to the
> location of the script. When running from an IDE, we are at the mercy of
> whatever the IDE has configured to be the working directory.
>

Yeah, that's the only way I got it to work in the IDE so far.

Thank you for fixing it for the Ant script.  This is great as it allows me
to run the unit tests which is the most important thing.  I can work around
running the test in the IDE when needed.

Igal



>
> Mark
>
> >
> > === begin console output ===
> > /opt/java/zulu17.30.15-ca-jdk17.0.1-linux_x64/bin/java -agentlib:jdwp=
> > transport=dt_socket,address=127.0.0.1:33187,suspend=y,server=n
> >
> -javaagent:/opt/jetbrains/idea-IC-223.8836.41/plugins/java/lib/rt/debugger-agent.jar
> > -Dfile.encoding=UTF-8 -classpath
> >
> /workspace/src/tomcat/main/.idea/output/production/tomcat:/opt/java/apache-ant-1.10.8/lib/ant.jar:/workspace/build/tomcat-build-libs/junit-4.13.2/junit-4.13.2.jar:/workspace/build/tomcat-build-libs/ecj-4.26/ecj-4.26.jar:/workspace/build/tomcat-build-libs/easymock-4.3/easymock-4.3.jar:/workspace/build/tomcat-build-libs/hamcrest-2.2/hamcrest-2.2.jar:/workspace/build/tomcat-build-libs/cglib-3.3.0/cglib-nodep-3.3.0.jar:/workspace/build/tomcat-build-libs/objenesis-3.3/objenesis-3.3.jar:/workspace/build/tomcat-build-libs/bnd-6.4.0/biz.aQute.bnd-6.4.0.jar:/workspace/build/tomcat-build-libs/migration-1.0.6/jakartaee-migration-1.0.6-shaded.jar:/workspace/build/tomcat-build-libs/unboundid-6.0.7/unboundid-ldapsdk-6.0.7.jar:/opt/jetbrains/idea-IC-223.8836.41/lib/idea_rt.jar
> > org.apache.catalina.startup.Bootstrap
> > Connected to the target VM, address: '127.0.0.1:33187', transport:
> 'socket'
> > Mar 18, 2023 1:40:07 PM org.apache.catalina.startup.ClassLoaderFactory
> > validateFile
> > WARNING: Problem with directory [/workspace/src/tomcat/main/lib], exists:
> > [false], isDirectory: [false], canRead: [false]
> > Mar 18, 2023 1:40:07 PM org.apache.catalina.startup.ClassLoaderFactory
> > validateFile
> > WARNING: Problem with directory [/workspace/src/tomcat/main/lib], exists:
> > [false], isDirectory: [false], canRead: [false]
> > Mar 18, 2023 1:40:07 PM org.apache.catalina.startup.ClassLoaderFactory
> > validateFile
> > WARNING: Problem with directory [/workspace/src/tomcat/main/lib], exists:
> > [false], isDirectory: [false], canRead: [false]
> > Mar 18, 2023 1:40:07 PM org.apache.catalina.startup.ClassLoaderFactory
> > validateFile
> > WARNING: Problem with directory [/workspace/src/tomcat/main/lib], exists:
> > [false], isDirectory: [false], canRead: [false]
> > Mar 18, 2023 1:40:08 PM org.apache.catalina.startup.VersionLoggerListener
> > log
> > INFO: Server version name: Apache Tomcat/11.0.x-dev
> > Mar 18, 2023 1:40:08 PM org.apache.catalina.startup.VersionLoggerListener
> > log
> > INFO: Server built: unknown
> > Mar 18, 2023 1:40:08 PM org.apache.catalina.startup.VersionLoggerListener
> > log
> > INFO: Server version number: 11.0.x
> > Mar 18, 2023 1:40:08 PM org.apache.catalina.startup.VersionLoggerListener
> > log
> > INFO: OS Name: Linux
> > Mar 18, 2023 1:40:08 PM org.apache.catalina.startup.VersionLoggerListener
> > log
> > INFO: OS Version: 5.19.0-32-generic
> > Mar 18, 2023 1:40:08 PM org.apache.catalina.startup.VersionLoggerListener
> > log
> > INFO: Architecture: amd64
> > Mar 18, 2023 1:40:08 PM org.apache.catalina.startup.VersionLoggerListener
> > log
> > INFO: Java Home: /opt/java/zulu17.30.15-ca-jdk17.0.1-linux_x64
> > Mar 18, 2023 1:40:08 PM org.apache.catalina.startup.VersionLoggerListener
> > log
> > INFO: JVM Version: 17.0.1+12-LTS
> > Mar 18, 2023 1:40:08 PM org.apache.catalina.startup.VersionLoggerListener
> > log
> > INFO: JVM Vendor: Azul 

Re: TestRewriteValve Fails When Specifying Custom Output Directory

2023-03-20 Thread Mark Thomas

On 18/03/2023 20:53, Igal Sapir wrote:

Mark,

On Thu, Mar 16, 2023 at 2:12 AM Mark Thomas  wrote:


On 15/03/2023 21:16, Igal Sapir wrote:




It is mostly solved, and that might be sufficient.

So while `ant clean test` now completes without failures, the part that
still doesn't work is when I specify a custom "Working Directory" in the
IDE in order to make JSP files resolved.  In my setup that is
"/workspace/build/tomcat/main/build", or /build, and the
file is searched for at
"/workspace/build/tomcat/main/build/test/conf/TesterRewriteMapB.txt"

which

is not found.


Can you expand on "make JSP files resolved"? What doesn't work if you
don't specify a custom working directory?



When I do not set the custom working directory, or if use the default in
IntelliJ IDEA, $MODULE_WORKING_DIR$, I get the following errors in the
console:


This looks like it is getting into the details of how Idea is configured 
 which I'm not familiar with.


The expectation is that the working directory is the root of the source 
tree which I think is "/workspace/build/tomcat/main" in your setup.


For the Ant script we can at least make everything relative to the 
location of the script. When running from an IDE, we are at the mercy of 
whatever the IDE has configured to be the working directory.


Mark



=== begin console output ===
/opt/java/zulu17.30.15-ca-jdk17.0.1-linux_x64/bin/java -agentlib:jdwp=
transport=dt_socket,address=127.0.0.1:33187,suspend=y,server=n
-javaagent:/opt/jetbrains/idea-IC-223.8836.41/plugins/java/lib/rt/debugger-agent.jar
-Dfile.encoding=UTF-8 -classpath
/workspace/src/tomcat/main/.idea/output/production/tomcat:/opt/java/apache-ant-1.10.8/lib/ant.jar:/workspace/build/tomcat-build-libs/junit-4.13.2/junit-4.13.2.jar:/workspace/build/tomcat-build-libs/ecj-4.26/ecj-4.26.jar:/workspace/build/tomcat-build-libs/easymock-4.3/easymock-4.3.jar:/workspace/build/tomcat-build-libs/hamcrest-2.2/hamcrest-2.2.jar:/workspace/build/tomcat-build-libs/cglib-3.3.0/cglib-nodep-3.3.0.jar:/workspace/build/tomcat-build-libs/objenesis-3.3/objenesis-3.3.jar:/workspace/build/tomcat-build-libs/bnd-6.4.0/biz.aQute.bnd-6.4.0.jar:/workspace/build/tomcat-build-libs/migration-1.0.6/jakartaee-migration-1.0.6-shaded.jar:/workspace/build/tomcat-build-libs/unboundid-6.0.7/unboundid-ldapsdk-6.0.7.jar:/opt/jetbrains/idea-IC-223.8836.41/lib/idea_rt.jar
org.apache.catalina.startup.Bootstrap
Connected to the target VM, address: '127.0.0.1:33187', transport: 'socket'
Mar 18, 2023 1:40:07 PM org.apache.catalina.startup.ClassLoaderFactory
validateFile
WARNING: Problem with directory [/workspace/src/tomcat/main/lib], exists:
[false], isDirectory: [false], canRead: [false]
Mar 18, 2023 1:40:07 PM org.apache.catalina.startup.ClassLoaderFactory
validateFile
WARNING: Problem with directory [/workspace/src/tomcat/main/lib], exists:
[false], isDirectory: [false], canRead: [false]
Mar 18, 2023 1:40:07 PM org.apache.catalina.startup.ClassLoaderFactory
validateFile
WARNING: Problem with directory [/workspace/src/tomcat/main/lib], exists:
[false], isDirectory: [false], canRead: [false]
Mar 18, 2023 1:40:07 PM org.apache.catalina.startup.ClassLoaderFactory
validateFile
WARNING: Problem with directory [/workspace/src/tomcat/main/lib], exists:
[false], isDirectory: [false], canRead: [false]
Mar 18, 2023 1:40:08 PM org.apache.catalina.startup.VersionLoggerListener
log
INFO: Server version name: Apache Tomcat/11.0.x-dev
Mar 18, 2023 1:40:08 PM org.apache.catalina.startup.VersionLoggerListener
log
INFO: Server built: unknown
Mar 18, 2023 1:40:08 PM org.apache.catalina.startup.VersionLoggerListener
log
INFO: Server version number: 11.0.x
Mar 18, 2023 1:40:08 PM org.apache.catalina.startup.VersionLoggerListener
log
INFO: OS Name: Linux
Mar 18, 2023 1:40:08 PM org.apache.catalina.startup.VersionLoggerListener
log
INFO: OS Version: 5.19.0-32-generic
Mar 18, 2023 1:40:08 PM org.apache.catalina.startup.VersionLoggerListener
log
INFO: Architecture: amd64
Mar 18, 2023 1:40:08 PM org.apache.catalina.startup.VersionLoggerListener
log
INFO: Java Home: /opt/java/zulu17.30.15-ca-jdk17.0.1-linux_x64
Mar 18, 2023 1:40:08 PM org.apache.catalina.startup.VersionLoggerListener
log
INFO: JVM Version: 17.0.1+12-LTS
Mar 18, 2023 1:40:08 PM org.apache.catalina.startup.VersionLoggerListener
log
INFO: JVM Vendor: Azul Systems, Inc.
Mar 18, 2023 1:40:08 PM org.apache.catalina.startup.VersionLoggerListener
log
INFO: CATALINA_BASE: /workspace/src/tomcat/main
Mar 18, 2023 1:40:08 PM org.apache.catalina.startup.VersionLoggerListener
log
INFO: CATALINA_HOME: /workspace/src/tomcat/main
Mar 18, 2023 1:40:08 PM org.apache.catalina.startup.VersionLoggerListener
log
INFO: Command line argument: -agentlib:jdwp=transport=dt_socket,address=
127.0.0.1:33187,suspend=y,server=n
Mar 18, 2023 1:40:08 PM org.apache.catalina.startup.VersionLoggerListener
log
INFO: Command line argument:
-javaagent:/opt/jetbrains/idea-IC-223.8836.41/plugins/java/lib/rt/debugger-agent.jar
Mar 18, 2023 1:40:08 PM 

Re: TestRewriteValve Fails When Specifying Custom Output Directory

2023-03-18 Thread Igal Sapir
Mark,

On Thu, Mar 16, 2023 at 2:12 AM Mark Thomas  wrote:

> On 15/03/2023 21:16, Igal Sapir wrote:
>
> 
>
> > It is mostly solved, and that might be sufficient.
> >
> > So while `ant clean test` now completes without failures, the part that
> > still doesn't work is when I specify a custom "Working Directory" in the
> > IDE in order to make JSP files resolved.  In my setup that is
> > "/workspace/build/tomcat/main/build", or /build, and the
> > file is searched for at
> > "/workspace/build/tomcat/main/build/test/conf/TesterRewriteMapB.txt"
> which
> > is not found.
>
> Can you expand on "make JSP files resolved"? What doesn't work if you
> don't specify a custom working directory?
>

When I do not set the custom working directory, or if use the default in
IntelliJ IDEA, $MODULE_WORKING_DIR$, I get the following errors in the
console:

=== begin console output ===
/opt/java/zulu17.30.15-ca-jdk17.0.1-linux_x64/bin/java -agentlib:jdwp=
transport=dt_socket,address=127.0.0.1:33187,suspend=y,server=n
-javaagent:/opt/jetbrains/idea-IC-223.8836.41/plugins/java/lib/rt/debugger-agent.jar
-Dfile.encoding=UTF-8 -classpath
/workspace/src/tomcat/main/.idea/output/production/tomcat:/opt/java/apache-ant-1.10.8/lib/ant.jar:/workspace/build/tomcat-build-libs/junit-4.13.2/junit-4.13.2.jar:/workspace/build/tomcat-build-libs/ecj-4.26/ecj-4.26.jar:/workspace/build/tomcat-build-libs/easymock-4.3/easymock-4.3.jar:/workspace/build/tomcat-build-libs/hamcrest-2.2/hamcrest-2.2.jar:/workspace/build/tomcat-build-libs/cglib-3.3.0/cglib-nodep-3.3.0.jar:/workspace/build/tomcat-build-libs/objenesis-3.3/objenesis-3.3.jar:/workspace/build/tomcat-build-libs/bnd-6.4.0/biz.aQute.bnd-6.4.0.jar:/workspace/build/tomcat-build-libs/migration-1.0.6/jakartaee-migration-1.0.6-shaded.jar:/workspace/build/tomcat-build-libs/unboundid-6.0.7/unboundid-ldapsdk-6.0.7.jar:/opt/jetbrains/idea-IC-223.8836.41/lib/idea_rt.jar
org.apache.catalina.startup.Bootstrap
Connected to the target VM, address: '127.0.0.1:33187', transport: 'socket'
Mar 18, 2023 1:40:07 PM org.apache.catalina.startup.ClassLoaderFactory
validateFile
WARNING: Problem with directory [/workspace/src/tomcat/main/lib], exists:
[false], isDirectory: [false], canRead: [false]
Mar 18, 2023 1:40:07 PM org.apache.catalina.startup.ClassLoaderFactory
validateFile
WARNING: Problem with directory [/workspace/src/tomcat/main/lib], exists:
[false], isDirectory: [false], canRead: [false]
Mar 18, 2023 1:40:07 PM org.apache.catalina.startup.ClassLoaderFactory
validateFile
WARNING: Problem with directory [/workspace/src/tomcat/main/lib], exists:
[false], isDirectory: [false], canRead: [false]
Mar 18, 2023 1:40:07 PM org.apache.catalina.startup.ClassLoaderFactory
validateFile
WARNING: Problem with directory [/workspace/src/tomcat/main/lib], exists:
[false], isDirectory: [false], canRead: [false]
Mar 18, 2023 1:40:08 PM org.apache.catalina.startup.VersionLoggerListener
log
INFO: Server version name: Apache Tomcat/11.0.x-dev
Mar 18, 2023 1:40:08 PM org.apache.catalina.startup.VersionLoggerListener
log
INFO: Server built: unknown
Mar 18, 2023 1:40:08 PM org.apache.catalina.startup.VersionLoggerListener
log
INFO: Server version number: 11.0.x
Mar 18, 2023 1:40:08 PM org.apache.catalina.startup.VersionLoggerListener
log
INFO: OS Name: Linux
Mar 18, 2023 1:40:08 PM org.apache.catalina.startup.VersionLoggerListener
log
INFO: OS Version: 5.19.0-32-generic
Mar 18, 2023 1:40:08 PM org.apache.catalina.startup.VersionLoggerListener
log
INFO: Architecture: amd64
Mar 18, 2023 1:40:08 PM org.apache.catalina.startup.VersionLoggerListener
log
INFO: Java Home: /opt/java/zulu17.30.15-ca-jdk17.0.1-linux_x64
Mar 18, 2023 1:40:08 PM org.apache.catalina.startup.VersionLoggerListener
log
INFO: JVM Version: 17.0.1+12-LTS
Mar 18, 2023 1:40:08 PM org.apache.catalina.startup.VersionLoggerListener
log
INFO: JVM Vendor: Azul Systems, Inc.
Mar 18, 2023 1:40:08 PM org.apache.catalina.startup.VersionLoggerListener
log
INFO: CATALINA_BASE: /workspace/src/tomcat/main
Mar 18, 2023 1:40:08 PM org.apache.catalina.startup.VersionLoggerListener
log
INFO: CATALINA_HOME: /workspace/src/tomcat/main
Mar 18, 2023 1:40:08 PM org.apache.catalina.startup.VersionLoggerListener
log
INFO: Command line argument: -agentlib:jdwp=transport=dt_socket,address=
127.0.0.1:33187,suspend=y,server=n
Mar 18, 2023 1:40:08 PM org.apache.catalina.startup.VersionLoggerListener
log
INFO: Command line argument:
-javaagent:/opt/jetbrains/idea-IC-223.8836.41/plugins/java/lib/rt/debugger-agent.jar
Mar 18, 2023 1:40:08 PM org.apache.catalina.startup.VersionLoggerListener
log
INFO: Command line argument: -Dfile.encoding=UTF-8
Mar 18, 2023 1:40:08 PM org.apache.catalina.core.AprLifecycleListener
lifecycleEvent
INFO: The Apache Tomcat Native library which allows using OpenSSL was not
found on the java.library.path:
[/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib]
Mar 18, 2023 1:40:08 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-8080"]

Re: TestRewriteValve Fails When Specifying Custom Output Directory

2023-03-16 Thread Mark Thomas

On 15/03/2023 21:16, Igal Sapir wrote:




It is mostly solved, and that might be sufficient.

So while `ant clean test` now completes without failures, the part that
still doesn't work is when I specify a custom "Working Directory" in the
IDE in order to make JSP files resolved.  In my setup that is
"/workspace/build/tomcat/main/build", or /build, and the
file is searched for at
"/workspace/build/tomcat/main/build/test/conf/TesterRewriteMapB.txt" which
is not found.


Can you expand on "make JSP files resolved"? What doesn't work if you 
don't specify a custom working directory?


Mark

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: TestRewriteValve Fails When Specifying Custom Output Directory

2023-03-15 Thread Igal Sapir
Mark,

On Wed, Mar 15, 2023 at 5:08 AM Mark Thomas  wrote:

> On 15/03/2023 01:52, Igal Sapir wrote:
> > Hello,
> >
> > test/org/apache/catalina/valves/rewrite/TestRewriteValve.java fails with
> > file not found when a custom tomcat.output directory is specified in
> > build.properties.
> >
> > I have the Tomcat source code (main branch) at /workspace/src/tomcat/main
> > (let's call it ), and the following in build.properties:
> >
> > tomcat.output=/workspace/build/tomcat/main
> >
> > That setup allows me to have different directories for the different
> active
> > versions of Tomcat, where the leaf directory can also be 10.0.x, 9.0.x,
> > 8.5.x, etc, and has been working well for a while.
> >
> > A recent update to TestRewriteValve works with the default configuration,
> > but with my setup it fails with a FileNotFoundException. Details below
> [1].
> >
> > I can see that with the default configuration the file is loaded
> > from /workspace/src/tomcat/main/test/conf/TesterRewriteMapB.txt, i.e.
> > /test/conf/TesterRewriteMapB.txt, but with the custom
> tomcat.output
> > the file is searched for at
> > /workspace/build/tomcat/main/build/test/conf/TesterRewriteMapB.txt, i.e.
> > /build/test/conf/TesterRewriteMapB.txt
> >
> > Is it possible to specify the file path differently so that it would work
> > with a custom tomcat.output directory?
>
> I think I have fixed this. Please test and report back.
>
> Mark
>

It is mostly solved, and that might be sufficient.

So while `ant clean test` now completes without failures, the part that
still doesn't work is when I specify a custom "Working Directory" in the
IDE in order to make JSP files resolved.  In my setup that is
"/workspace/build/tomcat/main/build", or /build, and the
file is searched for at
"/workspace/build/tomcat/main/build/test/conf/TesterRewriteMapB.txt" which
is not found.

Thank you for the quick turnaround,

Igal


> -
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
>
>


Re: TestRewriteValve Fails When Specifying Custom Output Directory

2023-03-15 Thread Mark Thomas

On 15/03/2023 01:52, Igal Sapir wrote:

Hello,

test/org/apache/catalina/valves/rewrite/TestRewriteValve.java fails with
file not found when a custom tomcat.output directory is specified in
build.properties.

I have the Tomcat source code (main branch) at /workspace/src/tomcat/main
(let's call it ), and the following in build.properties:

tomcat.output=/workspace/build/tomcat/main

That setup allows me to have different directories for the different active
versions of Tomcat, where the leaf directory can also be 10.0.x, 9.0.x,
8.5.x, etc, and has been working well for a while.

A recent update to TestRewriteValve works with the default configuration,
but with my setup it fails with a FileNotFoundException. Details below [1].

I can see that with the default configuration the file is loaded
from /workspace/src/tomcat/main/test/conf/TesterRewriteMapB.txt, i.e.
/test/conf/TesterRewriteMapB.txt, but with the custom tomcat.output
the file is searched for at
/workspace/build/tomcat/main/build/test/conf/TesterRewriteMapB.txt, i.e.
/build/test/conf/TesterRewriteMapB.txt

Is it possible to specify the file path differently so that it would work
with a custom tomcat.output directory?


I think I have fixed this. Please test and report back.

Mark

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org