You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@jmeter.apache.org by bu...@apache.org on 2015/05/27 18:12:31 UTC

[Bug 57956] New: The hc.parameters reference in jmeter.properties doesn't work when JMeter is not started in bin

https://bz.apache.org/bugzilla/show_bug.cgi?id=57956

            Bug ID: 57956
           Summary: The hc.parameters reference in jmeter.properties
                    doesn't work when JMeter is not started in bin
           Product: JMeter
           Version: 2.13
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Main
          Assignee: issues@jmeter.apache.org
          Reporter: imikla@gmail.com

There is a reference in the jmeter.properties file:

# define a properties file for overriding Apache HttpClient parameters
# See: TBA
# Uncomment this line if you put anything in hc.parameters file
#hc.parameters.file=hc.parameters

Setup:

1. HttpClient4 used in script.

2. In jmeter.properties, uncomment the line:

     #hc.parameters.file=hc.parameters

3. In the file httpclient.parameters uncomment and modify:

     #http.authentication.preemptive$Boolean=true

   to:

     http.authentication.preemptive$Boolean=false

4. In user.properties, add the line:

     httpclient4.retrycount=1

5. In hc.parameters, uncomment and modify:

     #http.connection.stalecheck$Boolean=false

   to:

     http.connection.stalecheck$Boolean=true


Script is in its own project folder. JMeter bin is specified on the path.

Issue:

When script is run, the following error is written to the log file:

ERROR - jmeter.protocol.http.sampler.HttpClientDefaultParameters: Problem
loading properties java.io.FileNotFoundException: hc.parameters (The system
cannot find the file specified)

Work-around:

If EITHER the hc.parameters file is copied into the folder where JMeter is
started (ugly)

OR the line:

  hc.parameters.file=hc.parameters

is added to the file user.properties (less ugly but not documented usage), the
error does not occur.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 57956] The hc.parameters reference in jmeter.properties doesn't work when JMeter is not started in bin

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=57956

Michael Aichlmayr <im...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|WORKSFORME                  |---

--- Comment #5 from Michael Aichlmayr <im...@gmail.com> ---
It specifically says in the jmeter.properties file, uncomment the line:

#httpclient.parameters.file=httpclient.parameters

if you put anything in httpclient.parameters.

It specifically says in the jmeter.properties file, uncomment the line:

#hc.parameters.file=hc.parameters

if you put anything in hc.parameters.

If you read my original settings, you will see that I do modify (add something
to)
both of these files.

When the line:

  #hc.parameters.file=hc.parameters

is uncommented without uncommenting the line:

  #httpclient.parameters.file=httpclient.parameters

JMeter reports that it cannot open hc.parameters. This makes no sense.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 57956] The hc.parameters reference in jmeter.properties doesn't work when JMeter is not started in bin

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=57956

Sebb <se...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #1 from Sebb <se...@apache.org> ---
(In reply to Michael Aichlmayr from comment #0)

> OR the line:
> 
>   hc.parameters.file=hc.parameters
> 
> is added to the file user.properties (less ugly but not documented usage),
> the error does not occur.

That does not make sense.
The entries from user.properties are merged with the ones from
jmeter.properties, so it does not matter where the property is defined.
I just tried.

==

JMeter uses the path name to open the file.
If you use a relative path name then it does not currently check the home
directory as well. This is not a bug.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 57956] The hc.parameters reference in jmeter.properties doesn't work when JMeter is not started in bin

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=57956

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |p.mouawad@ubik-ingenierie.c
                   |                            |om

--- Comment #2 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
It does not make sense at first look but I reproduce the bug.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 57956] The hc.parameters reference in jmeter.properties doesn't work when JMeter is not started in bin

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=57956

Sebb <se...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |WORKSFORME
             Status|NEW                         |RESOLVED

--- Comment #4 from Sebb <se...@apache.org> ---
There are two different parameters files; one for Apache Commons HttpClient
(property: httpclient.parameters.file) and the other for Apache HttpComponents
HttpClient (property: hc.parameters.file).

The relevant file is opened when the sampler class is loaded, which will only
occur if there is an instance of the relevant sampler in the test plan *and*
the property is defined.

It does not make sense to edit the httpclient.parameters file, nor enable the
property httpclient.parameters.file if the test plan only uses HttpClient4

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 57956] The hc.parameters reference in jmeter.properties doesn't work when JMeter is not started in bin

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=57956

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Hardware|PC                          |All
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #8 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
Date: Sat Jun 13 21:17:47 2015
New Revision: 1685333

URL: http://svn.apache.org/r1685333
Log:
Bug 57956 - The hc.parameters reference in jmeter.properties doesn't work when
JMeter is not started in bin
Bugzilla Id: 57956

Modified:
   
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC3Impl.java
   
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
    jmeter/trunk/xdocs/changes.xml


Date: Sat Jun 13 21:32:18 2015
New Revision: 1685335

URL: http://svn.apache.org/r1685335
Log:
Bug 57956 - The hc.parameters reference in jmeter.properties doesn't work when
JMeter is not started in bin
Rollback and fix differently.
Bugzilla Id: 57956

Modified:
   
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC3Impl.java
   
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
   
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HttpClientDefaultParameters.java

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 57956] The hc.parameters reference in jmeter.properties doesn't work when JMeter is not started in bin

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=57956

Michael Aichlmayr <im...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

--- Comment #3 from Michael Aichlmayr <im...@gmail.com> ---
OK. I have made a fresh installation of JMeter and I believe I have resolved
the problem, but there is still appears to be an issue, so I am not going to
mark this resolved yet.

It turns out that I didn't uncomment the line in jmeter.properties for
httpclient.parameters.file which is required because I have modified the file
httpclient.parameters.

By changing (in addition to the original customizations above):

  #httpclient.parameters.file=httpclient.parameters

to:

  httpclient.parameters.file=httpclient.parameters

the error:
  ERROR - jmeter.protocol.http.sampler.HttpClientDefaultParameters:
    Problem loading properties java.io.FileNotFoundException: hc.parameters
    (The system cannot find the file specified)

goes away.

So it would appear that either the error is wrong, or uncommenting the
hc.parameters.file line requires the httpclient.parameters.file line to be
uncommented as well or for some reason the hc.parameters file cannot be found
(doesn't make sense to me, but maybe there is a logical explanation).

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 57956] The hc.parameters reference in jmeter.properties doesn't work when JMeter is not started in bin

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=57956

--- Comment #7 from Michael Aichlmayr <im...@gmail.com> ---
You are right. It does happen regardless of whether or not
httpclient.parameters.file is exposed or not. When I retested, I realized that
I was thrown off by the fact that the error only happens once per startup. That
is, when I start JMeter, load a test-plan, and run the test-plan, the error
occurs. If I run the test-plan a second time, the error does not occur. Because
I was not aware of this behavior, my edit of jmeter.properties appeared to fix
it when in fact it was only that the error had already occurred once.

Regards settings, we have many tens of JMeter projects and try to have a base
configuration that works with the majority of them. Some of the settings I
reported may not make sense for what I was doing at the time that I discovered
the issue I was reporting.

I am puzzled that only the hc.parameters file is expected to be in the current
folder when all the other files are found in bin regardless of the startup
folder (at least that has been my experience). The way we use JMeter to-date is
to start in a project folder so that logs and all output is relative to the
project and the JMeter installation does not get polluted with run-data.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 57956] The hc.parameters reference in jmeter.properties doesn't work when JMeter is not started in bin

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=57956

Michael Aichlmayr <im...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |imikla@gmail.com
                 OS|                            |All

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 57956] The hc.parameters reference in jmeter.properties doesn't work when JMeter is not started in bin

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=57956

--- Comment #6 from Sebb <se...@apache.org> ---
(In reply to Michael Aichlmayr from comment #5)
> It specifically says in the jmeter.properties file, uncomment the line:
> 
> #httpclient.parameters.file=httpclient.parameters
> 
> if you put anything in httpclient.parameters.
> 
> It specifically says in the jmeter.properties file, uncomment the line:
> 
> #hc.parameters.file=hc.parameters
> 
> if you put anything in hc.parameters.

Yes.

> If you read my original settings, you will see that I do modify (add
> something to)
> both of these files.

But if the test only uses HttpClient4, then updating httpclient.parameters
makes no sense. Nor does it make sense to enable the property
httpclient.parameters.file.
Neither action will have any effect on the test, because they only apply to the
HttpClient3.1 sampler.

> When the line:
> 
>   #hc.parameters.file=hc.parameters
> 
> is uncommented without uncommenting the line:
> 
>   #httpclient.parameters.file=httpclient.parameters
> 
> JMeter reports that it cannot open hc.parameters. This makes no sense.

When I try the same test, the log shows it cannot open hc.parameters
This is expected because the file is in bin, not in the current directory.

This error happens regardless of the setting of httpclient.parameters.file.

The *.parameters.file properties are independent.

-- 
You are receiving this mail because:
You are the assignee for the bug.