I added a logging event at the very start of the handle() method.

Gary

On 2022/11/13 13:24:19 "Gary D. Gregory" wrote:
> On 2022/11/13 12:58:41 Oleg Kalnichevski wrote:
> > On Sat, 2022-11-12 at 23:21 +0000, Gary D. Gregory wrote:
> > > Hi All:
> > > 
> > > I am trying to bump HC from 5.1.3 to 5.2 in Apache Commons VFS and I
> > > get an odd failure.
> > > 
> > > To reproduce:
> > > 
> > > git clone https://gitbox.apache.org/repos/asf/commons-vfs.git
> > > cd commons-vfs
> > > 
> > > Then, this works:
> > > 
> > > mvn clean test-compile exec:java -
> > > Dexec.mainClass=org.apache.commons.vfs2.util.NHttpFileServer -
> > > Dexec.args=". 0" -Dexec.classpathScope=test -e -pl commons-vfs2 -
> > > DNHttpFileServer.debug=true -Dhttpclient5.version=5.1.3
> > > 
> > > A file server on the current folder is now listening on the port
> > > displayed on the console as the 0 arg allocates an ephemeral port.
> > > 
> > > Test it with:
> > > 
> > > curl http://localhost:<ThePort>/pom.xml
> > > 
> > > You see the pom.xml 
> > > 
> > > Next, this does not work, the only difference is the
> > > httpclient5.version passed on the command line:
> > > 
> > > mvn clean test-compile exec:java -
> > > Dexec.mainClass=org.apache.commons.vfs2.util.NHttpFileServer -
> > > Dexec.args=". 0" -Dexec.classpathScope=test -e -pl commons-vfs2 -
> > > DNHttpFileServer.debug=true -Dhttpclient5.version=5.2
> > > 
> > > curl http://localhost:<ThePort>/pom.xml
> > > 
> > > Gives you something like:
> > > 
> > > curl: (7) Failed to connect to localhost port 65079 after 2257 ms:
> > > Connection refused
> > > 
> > > Thoughts?
> > > 
> > > Gary
> > > 
> > 
> > Why there is no logging on the server side? There is not a single bit
> > of information that could help make even the wildest guess as to what
> > the cause of the problem might be.
> 
> Hello Oleg and All,
> 
> Well, the class org.apache.commons.vfs2.util.NHttpFileServer is a clone of 
> https://github.com/apache/httpcomponents-core/blob/master/httpcore5/src/test/java/org/apache/hc/core5/http/examples/AsyncFileServerExample.java
>  with a touch more logging, and minus the content type parsing.
> 
> The logging is done to the console just like AsyncFileServerExample and 
> enabled with -DNHttpFileServer.debug=true as the examples below show. 
> 
> I am happy to add logging but where? The method 
> org.apache.commons.vfs2.util.NHttpFileServer.HttpFileHandler.handle(Message<HttpRequest,
>  Void>, ResponseTrigger, HttpContext) might not even be invoked and it will 
> eith log or throw an exception.
> 
> TY
> Gary
> 
> > 
> > Oleg
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
> > For additional commands, e-mail: dev-h...@hc.apache.org
> > 
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
> For additional commands, e-mail: dev-h...@hc.apache.org
> 
> 

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

Reply via email to