java.lang.Throwable: Could not access /usr/share/jmeter/lib/junit

Bug #459251 reported by Craig
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
commons-httpclient (Ubuntu)
Fix Released
Undecided
Unassigned
jakarta-jmeter (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

I install jmeter, loaded a test case, and tried to run it. This is the result:

$ jmeter
[warning] /usr/bin/jmeter: Unable to locate jboss-j2ee in /usr/share/java
[warning] /usr/bin/jmeter: No JAVA_CMD set for run_java, falling back to JAVA_CMD = java
java.lang.Throwable: Could not access /usr/share/jmeter/lib/junit
 at org.apache.jmeter.NewDriver.<clinit>(NewDriver.java:96)

ProblemType: Bug
Architecture: amd64
Date: Fri Oct 23 13:20:56 2009
DistroRelease: Ubuntu 9.10
Package: jmeter 2.3.4-0ubuntu4
PackageArchitecture: all
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-14.48-generic
SourcePackage: jakarta-jmeter
Uname: Linux 2.6.31-14-generic x86_64

Revision history for this message
Craig (candrews-integralblue) wrote :
Revision history for this message
Onkar Shinde (onkarshinde) wrote :

Do you have a sample test plan which I can use to reproduce the problem?

Apparently some files required by junit module were not part of the upstream distribution. They have been checked in recently in upstream SVN. I will need to backport them as patch.

Revision history for this message
Onkar Shinde (onkarshinde) wrote :
Revision history for this message
Craig (candrews-integralblue) wrote :

This error occurs for every jmeter test case I've tried.

Revision history for this message
Onkar Shinde (onkarshinde) wrote :

While the missing directory error is always there, it surely doesn't affect every testcase. I just tried HTTP sampling (www.google.com) and it works without problem.

I suppose the problem is seen only when running junit sampling. Can you please confirm and if possible add a sample .jmx file?

Revision history for this message
Onkar Shinde (onkarshinde) wrote :

On further analysis i found out that the files missing are just dummy test cases. They are not referred from junit module and hence should not cause any problem in functionality.

Revision history for this message
Craig (candrews-integralblue) wrote :

Sorry, I'm away from my computer, so I can't upload the exact jmeter test. But, it was very simple: it only had one HTTPClient Sampler (perhaps that's the trouble maker?) and a Aggregate Report listener.

Revision history for this message
Onkar Shinde (onkarshinde) wrote :

There was indeed a problem with HTTP Sampler. That bug is bug #457660. Are you talking about same?

The problem is your bug report is not very clear about what exactly the problem is. The warnings you see on the console are fine as long as they do not affect functionality.

Revision history for this message
Craig (candrews-integralblue) wrote :

My apologies - by bug report does suck. I swear - I don't normally make such horrifically vague and uninformative bug reports!

When using the "HTTP Request Sampler," jmeter seems to work correctly.

When using the "HTTP Request HTTPClient Sampler," I get the attached output in jmeter.log. IMHO, the most interesting part of the log is this:

"ERROR - jmeter.threads.JMeterThread: Test failed! java.lang.NoClassDefFoundError: org/apache/commons/codec/DecoderException
 at org.apache.commons.httpclient.HttpMethodBase.<init>(HttpMethodBase.java:220)
 at org.apache.commons.httpclient.methods.GetMethod.<init>(GetMethod.java:89)
 at org.apache.jmeter.protocol.http.sampler.HTTPSampler2.sample(HTTPSampler2.java:833)
 at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1037)
 at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1023)
 at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:346)
 at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:243)
 at java.lang.Thread.run(Thread.java:636)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.codec.DecoderException
 at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
 at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336)
 ... 8 more"

"org.apache.commons.codec.DecoderException" can be found in Apache Commons Codec, which is Ubuntu's libcommons-codec-java, which I do have installed. In /usr/share/java/commons-codec-1.3.jar, org.apache.commons.codec.DecoderException is defined... so I don't know why jmeter is unable to find it.

Revision history for this message
Craig (candrews-integralblue) wrote :

Simple jmeter test that demonstrates the issue

Revision history for this message
Onkar Shinde (onkarshinde) wrote :

Thanks for the sample test case.
The problem is that even though libcommons-httpclient-java depends on libcommons-codec-java, it does not add commons-codec.jar in classpath (usually done in MANIFEST.MF file). At the same time jmeter launcher script does not explicitly add commons-codec.jar in classpath. So even though the library is available you get class not found exception.

I will fix this soonish.

Revision history for this message
Onkar Shinde (onkarshinde) wrote :

This also needs fixing in libcommons-httpclient-java so other packages which depends on it don't face this problem.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package jakarta-jmeter - 2.3.4-0ubuntu5

---------------
jakarta-jmeter (2.3.4-0ubuntu5) karmic; urgency=low

  * Workaround a bug in libcommons-httpclient-java. (LP: #459251)
  * debian/wrappers/jmeter
    - Add commons-codec to classpath.

 -- Onkar Shinde <email address hidden> Mon, 26 Oct 2009 12:24:25 +0530

Changed in jakarta-jmeter (Ubuntu):
status: New → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package commons-httpclient - 3.1-8

---------------
commons-httpclient (3.1-8) unstable; urgency=low

  [Damien Raude-Morvan]
  * Fix debian/watch: use http://www.apache.org/dist/

  [Onkar Shinde]
  * debian/patches/04_fix_classpath.patch
    - Add appropriate jar files in classpath using manifest attribute.
      (LP: #459251)
  * debian/ant.properties
    - Add properties to set target JVM version 1.4.
 -- Ubuntu Archive Auto-Sync <email address hidden> Mon, 23 Nov 2009 18:26:11 +0000

Changed in commons-httpclient (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.