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 2012/06/20 11:40:24 UTC

[Bug 53440] New: SSL connection leads ArrayStoreException on JDK 6

https://issues.apache.org/bugzilla/show_bug.cgi?id=53440

          Priority: P2
            Bug ID: 53440
          Assignee: issues@jmeter.apache.org
           Summary: SSL connection leads ArrayStoreException on JDK 6
          Severity: normal
    Classification: Unclassified
                OS: Windows XP
          Reporter: patrick.heusser@gmail.com
          Hardware: PC
            Status: NEW
           Version: 2.7
         Component: Main
           Product: JMeter

On Windows with JDK 6 when establishing a connection over SSL i got the stack
posted below with the array ArrayStoreException... This is reproducable and
does NOT happen on a JDK 5 installation. 

This happens just at runtime. The code can be compiled with JDK 5 and JDK 6... 

Exact java version that produces the error:
> java -version
java version "1.6.0_30"
Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
Java HotSpot(TM) Client VM (build 20.5-b03, mixed mode, sharing)

workaround:
Use a JDK 1.5



STACK-TRACE
-----------
java.lang.ArrayStoreException:
org.apache.jmeter.util.JsseSSLManager$WrappedX509KeyManager
    at
org.apache.jmeter.util.JsseSSLManager.createContext(JsseSSLManager.java:241)
    at
org.apache.jmeter.util.JsseSSLManager.getContext(JsseSSLManager.java:198)
    at
org.apache.jmeter.util.HttpSSLProtocolSocketFactory.getSSLSocketFactory(HttpSSLProtocolSocketFactory.java:103)
    at
org.apache.jmeter.util.HttpSSLProtocolSocketFactory.createSocket(HttpSSLProtocolSocketFactory.java:147)
    at
org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
    at
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
    at
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
    at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
    at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
    at
org.apache.jmeter.protocol.http.sampler.HTTPHC3Impl.sample(HTTPHC3Impl.java:249)
    at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
    at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1060)
    at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1049)
    at
org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:442)
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:271)
    at java.lang.Thread.run(Unknown Source)


Best regards,
patrick

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

[Bug 53440] SSL connection leads ArrayStoreException on JDK 6

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

--- Comment #4 from Sebb <se...@apache.org> ---
I've managed now to set up a test with Tomcat. 
It uses clientAuth="true" and requires a certificate.

I was able to connect to Tomcat with Firefox and with JMeter; no problems were
encountered with 1.5.0_22, 1.6.0_33, 1.7.0_05.

This is looking like a problem with your Java 6 installation, i.e. the bug
should be closed as "WORKSFORME" unless you can provide a test case that can be
repeated by others.

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

[Bug 53440] SSL connection leads ArrayStoreException on JDK 6

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

--- Comment #3 from Sebb <se...@apache.org> ---
We really need to be able to reproduce the issue.

Can you provide a simple test case that exhibits the problem, together with any
changes you made to jmeter.properties or system.properties?

Also, it would be helpful to have the jmeter logs for both runs.

If necessary, feel free to replace the names of servers etc with place-holders.

Also, just in case it is a specific issue with Java 1.6.0_30, can you try with
the current release, i.e.  1.6.0_33?

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

[Bug 53440] SSL connection leads to ArrayStoreException on JDK 6 with some KeyManagerFactory SPI

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

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

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

--- Comment #7 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
Date: Sat Jun 23 22:06:21 2012
New Revision: 1353205

URL: http://svn.apache.org/viewvc?rev=1353205&view=rev
Log:
Bug 53440 - SSL connection leads to ArrayStoreException on JDK 6 with some
KeyManagerFactory SPI
Bugzilla Id: 53440

Modified:
   jmeter/trunk/src/core/org/apache/jmeter/util/JsseSSLManager.java
   jmeter/trunk/xdocs/changes.xml

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

[Bug 53440] SSL connection leads to ArrayStoreException on JDK 6 with some KeyManagerFactory SPI

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

--- Comment #10 from Patrick Heusser <pa...@gmail.com> ---
hi guys

i tested the nightly build r1353803 this morning. 

=> it was a full success! the exception has gone.

thanks a lot,
patrick

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

[Bug 53440] SSL connection leads ArrayStoreException on JDK 6

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

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

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

--- Comment #1 from Sebb <se...@apache.org> ---
The code in question is:

KeyManager[] managers = managerFactory.getKeyManagers();
...
for (int i = 0; i < managers.length; i++) {
    if (managers[i] instanceof X509KeyManager) {
        X509KeyManager manager = (X509KeyManager) managers[i];
        managers[i] = new WrappedX509KeyManager(manager, keys); // line 241
    }
}

Now WrappedX509KeyManager implements X509KeyManager which extends KeyManager.
I don't see how the code would even compile unless this were true, so an
ArrayStoreException should be impossible.

I've tried with java.version=1.6.0_31 on Windows and it works fine for me.

Please can you provide the simplest possible test script that shows the
problem, along with log files for Java 1.5 and 1.6?

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

[Bug 53440] SSL connection leads ArrayStoreException on JDK 6

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

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

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

--- Comment #5 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
Hello Sebb,
I think issue is possible because we don't know the real type of array
allocated.

Take the following snippet:
    public static void main(String[] args) {
        Number[] t = new Integer[5];
        t[0] = new Long(123);
    }

Long is a Number but it provokes an ArrayStoreException cause allocated array
elements if not a Long array.

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

[Bug 53440] SSL connection leads to ArrayStoreException on JDK 6 with some KeyManagerFactory SPI

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|SSL connection leads        |SSL connection leads to
                   |ArrayStoreException on JDK  |ArrayStoreException on JDK
                   |6                           |6 with some
                   |                            |KeyManagerFactory SPI

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

[Bug 53440] SSL connection leads ArrayStoreException on JDK 6

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

--- Comment #6 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
To be clearer it can happen if SPI does not allocate a KeyManager array but a
subclass.

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

[Bug 53440] SSL connection leads to ArrayStoreException on JDK 6 with some KeyManagerFactory SPI

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

--- Comment #9 from Patrick Heusser <pa...@gmail.com> ---
hi jmeter team

i did some more testing with different JVM versions. i found, that my
observation is very specific to the version i used (see bug submission). i did
tests with the two version listed below, both work OK! 

still, i gonna try your nightly fix. sorry to be a bit slow on that, i'm in a
rather restricted environment where it's a bit hard to test such stuff...

one note: i'm extremely impressed by the work and commitment that you guys do.
respect and thanks a lot! JMeter is a cool tool :-)

JVM WORKS OK: 
D:\Data\Rad\shared\programs\Java\jre6_32bit\bin>java -version
java version "1.6.0_33"
Java(TM) SE Runtime Environment (build 1.6.0_33-b03)
Java HotSpot(TM) Client VM (build 20.8-b03, mixed mode, sharing)

JVM WORKS OK: 
D:\Data\Rad\shared\programs\Java\jdk1.7.0_05_32bit\bin>java -version
java version "1.7.0_05"
Java(TM) SE Runtime Environment (build 1.7.0_05-b05)
Java HotSpot(TM) Client VM (build 23.1-b03, mixed mode)

cheers,
patrick

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

[Bug 53440] SSL connection leads to ArrayStoreException on JDK 6 with some KeyManagerFactory SPI

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

--- Comment #8 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
Hello M. Heusser,
It would be helpful if you could confirm that issue is fixed for you using a
nightly build that will be generated within hours.
- http://jmeter.apache.org/nightly.html
As I was not able to reproduce it on my configuration.
Thank you
Regards
Philippe

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

[Bug 53440] SSL connection leads ArrayStoreException on JDK 6

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

--- Comment #2 from Patrick Heusser <pa...@gmail.com> ---
hi

thx for looking at it.

i had a quick look at the code too. for both java API 1.5 and 1.6 the hierarchy
is the same and it compiles with both, but does fail at runtime. so it must be
obviously related to the JDK and NOT Jmeter itself. it would be nice, if Jmeter
could work "around" it. the sampler with the request fails completely, may be a
simple try/catch helps.

our server under test asks for a client certificate, even though it's not
required in the end. my guess is this causes the failure. 

regards,

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