Apologies to all those who had this email blocked by their content and virus checkers, I really should have thought of that with a .bat attachment.
Here is the java source files as attachments and the .bat file contents as
plain text below -
set LOG4JCONFIG=log4j.configuration=log4j.conf
set HOST=
set PORT=
IF "%1" == "-f" set PROP=%2
IF "%1" == "-h" set HOST=-Dhttp.proxyHost=%2 -Dhttps.proxyHost=%2
IF "%1" == "-p" set PORT=-Dhttp.proxyPort=%2 -Dhttps.proxyPort=%2
IF "%1" == "-u" set USER=-Dproxy.authentication.username=%2
IF "%1" == "-w" set PASS=-Dproxy.authentication.password=%2
IF "%3" == "-f" set PROP=%4
IF "%3" == "-h" set HOST=-Dhttp.proxyHost=%4 -Dhttps.proxyHost=%4
IF "%3" == "-p" set PORT=-Dhttp.proxyPort=%4 -Dhttps.proxyPort=%4
IF "%3" == "-u" set USER=-Dproxy.authentication.username=%4
IF "%3" == "-w" set PASS=-Dproxy.authentication.password=%4
IF "%5" == "-f" set PROP=%6
IF "%5" == "-h" set HOST=-Dhttp.proxyHost=%6 -Dhttps.proxyHost=%6
IF "%5" == "-p" set PORT=-Dhttp.proxyPort=%6 -Dhttps.proxyPort=%6
IF "%5" == "-u" set USER=-Dproxy.authentication.username=%6
IF "%5" == "-w" set PASS=-Dproxy.authentication.password=%6
IF "%7" == "-f" set PROP=%8
IF "%7" == "-h" set HOST=-Dhttp.proxyHost=%8 -Dhttps.proxyHost=%8
IF "%7" == "-p" set PORT=-Dhttp.proxyPort=%8 -Dhttps.proxyPort=%8
IF "%7" == "-u" set USER=-Dproxy.authentication.username=%8
IF "%7" == "-w" set PASS=-Dproxy.authentication.password=%8
IF "%9" == "-f" set PROP=%10
IF "%9" == "-h" set HOST=-Dhttp.proxyHost=%10 -Dhttps.proxyHost=%10
IF "%9" == "-p" set PORT=-Dhttp.proxyPort=%10 -Dhttps.proxyPort=%10
IF "%9" == "-u" set USER=-Dproxy.authentication.username=%10
IF "%9" == "-w" set PASS=-Dproxy.authentication.password=%10
set LOCALCLASSPATH=%CLASSPATH%
for %%i in ("..\lib\*.jar") do CALL ..\lcp.bat %%i
for %%i in ("..\ext\*.jar") do CALL ..\lcp.bat %%i
java -cp %LOCALCLASSPATH%;ApacheJMeter.jar -D%LOG4JCONFIG% %HOST% %PORT%
%USER% %PASS% org.apache.jmeter.NewDriver %PROP%
<<ProxyAuthenticator.java>> <<NewDriver.java>>
-----Original Message-----
From: MCMURTRIE, Dion
Sent: Friday, August 02, 2002 11:30 AM
To: '[EMAIL PROTECTED]'
Cc: 'JMeter Users List'
Subject: RE: Problems with proxy server and redirection
Sorry I should have mentioned that. I downloaded from
http://jakarta.apache.org/builds/jakarta-jmeter/release/v1.7/ApacheJMeter_1.
7.zip
<http://jakarta.apache.org/builds/jakarta-jmeter/release/v1.7/ApacheJMeter_1
.7.zip> but when I click Help->About Apache JMeter it identifies itself as
Apache JMeter Version1.7Beta3. There was a
http://jakarta.apache.org/builds/jakarta-jmeter/release/v1.7/ApacheJMeter_1.
7Beta3.zip
<http://jakarta.apache.org/builds/jakarta-jmeter/release/v1.7/ApacheJMeter_1
.7Beta3.zip> , but that was not the one that I downloaded...not sure why it
says that it is Apache JMeter Version1.7Beta3.
The really odd thing is that up to yesterday afternoon I could not
get it to work. I ran it this morning before sending this email, and it now
works. I can't explain it. Perhaps some environmental changes that I am
unaware of to do with our proxy and firewalls? Historically what was it that
caused the redirection errors in JMeter?
On the proxy authentication thing, I just created a class I called
ProxyAuthenticator (see attached) that subclassed java.net.Authenticator.
Then I modified (the benefit of opensource products) the class that the
jmeter.bat file was running (may/may not have been the right place, but I
just wanted to see it work) org.apache.jmeter.NewDriver so that it
constructed an instance of my ProxyAuthenticator class and then called set
it as the default authenticator. See the attached modified NewDriver file
for exact implementation. Finally I modified jmeter.bat to pass in my values
as system properties because it was the easiest thing to do at the time. All
are attached if you want to have a look.
If it is true that there is no mechanism for Proxy Authentication in
JMeter (I'll take your word for it since I see you wrote the NewDriver
class) it would be a really good feature to add. Most big corporations (and
even smaller ones) have environments where it is necessary to sidestep
firewalls and proxy servers. For us there is a firewall and proxy between us
and our development and testing regions.
BTW thanks for the fast response...
<< File: jmeter.bat >> << File: NewDriver.java >> << File:
ProxyAuthenticator.java >>
-----Original Message-----
From: Mike Stover [SMTP:[EMAIL PROTECTED]]
Sent: Thursday, August 01, 2002 10:13 PM
To: JMeter Users List; MCMURTRIE, Dion
Subject: Re: Problems with proxy server and
redirection
Two things:
Which version of JMeter are you running? The
redirection problems have been fixed in the most
recent version.
I'd like to see your authentication solution -
JMeter's proxy doesn't account for proxy
authentication.
-Mike
--- "MCMURTRIE, Dion" <[EMAIL PROTECTED]>
wrote:
> I'm trying to get jMeter to work in my work
> environment and having quite a
> bit of trouble.
>
> Firstly access to the web site that I wish to test
> using jMeter is behind a
> firewall via a proxy server. I saw that proxy server
> and port options could
> be specified to the jmeter.bat file and did that,
> but I received a 407 http
> error "Proxy authentication required".
>
> I could not find anywhere to put my proxy
> authentication information into
> jMeter so I hacked the class started by the
> jmeter.bat file just so that I
> could keep going until I found the right way to set
> the proxy authentication
> information. The thing that I added was a subclass
> of java.net.Authenticator
> that would authenticate to my proxy for me. That
> seemed to work for me, but
> does anyone know the correct jMeter way to set up
> proxy Authentication?
>
> Anyway that seemed to get me past the proxy
> authentication although a little
> hacky, and now I am getting the following exception
> whenever I request a url
> (for example http://www.mgcars.org.uk/index.html
> <http://www.mgcars.org.uk/index.html> ) -
>
> java.net.ProtocolException: Server redirected too
> many times (5)
> at
>
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection
> .java:556)
> at
>
sun.net.www.protocol.http.HttpURLConnection.getHeaderFieldKey(HttpURLConnect
> ion.java:814)
> at
>
org.apache.jmeter.protocol.http.sampler.HTTPSampler.saveConnectionCookies(HT
> TPSampler.java:502)
> at
>
org.apache.jmeter.protocol.http.sampler.HTTPSampler.sample(HTTPSampler.java:
> 442)
> at
>
org.apache.jmeter.protocol.http.sampler.HTTPSampler.sample(HTTPSampler.java:
> 164)
> at
>
org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:138)
> at java.lang.Thread.run(Thread.java:484)
>
> Does anyone know the cause of this and if it can be
> fixed? I have tried
> calling a number of different URLs and the result is
> always the same.
>
> Any help much appreciated.
>
> Thanks,
> Dion.
>
>
----------------------------------------------------------------------------
-------
>
> The contents of this message are the views of the
> Author and do not necessarily reflect the views of
> SUNCORP METWAY LTD ABN 66 010 831 722.
>
> The content of this e-mail, including attachments is
> a confidential communication between the Suncorp
> Metway Group and the intended addressee. Any
> unauthorised use of the contents is expressly
> prohibited. If you have received this e-mail in
> error please contact the sender immediately and then
> delete the message and any attachment(s).
>
> http://www.suncorp.com.au
>
>
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>
=====
Mike Stover
Apache JMeter developer
Contact Info:
Email: [EMAIL PROTECTED]
Yahoo Instant Messenger: mstover_ya
ICQ: 152975688
__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com
ProxyAuthenticator.java
Description: Binary data
NewDriver.java
Description: Binary data
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

