Re: Error while using Custom Samplers

2016-10-14 Thread Allexandre Sampaio
Well, I've just taken the old version of JMeter I had here... now I'm
upgrading it to the newest version.

About the mongodb driver that came with JMeter, I didin't even thought in
removing it, and it was the problem
Now I removed and replaced it with the same mongodb driver I used to
compile the project, and the sampler works!

Thank you, Felix, you helped me a lot!

Att.,

*Allexandre Sampaio*
*Sistemas de Informação - IFBA*
*Vitória da Conquista - BA*
*(77) 99964 3521*

2016-10-14 15:17 GMT-03:00 Felix Schumacher <
felix.schumac...@internetallee.de>:

>
>
> Am 14. Oktober 2016 17:11:30 MESZ, schrieb Allexandre Sampaio <
> allexandre...@gmail.com>:
> >Right, I'm using the version 3.0.0 of mongo-java-driver (available in
> >http://central.maven.org/maven2/org/mongodb/mongo-java-driver/3.0.0/).
> >The missing method is the "getDatabase(DB_NAME)", that returns the
> >instance
> >of the database. (I did some tests while coding the sampler and the
> >getDatabase method worked fine).
> >Actually, I'm coding my own sampler, that's because I need to do some
> >specific operations in the database, using my own dataset, so, I
> >couldn't
> >use the mongodb sampler recomended.
> >Finally, I'm using JMeter version 2.13, on a Ubuntu 16.10 desktop with
> >Java
> >8.
>
> Did you remove the mongodb driver that came with JMeter?
>
> And why are you still using JMeter 2.13?
>
> Felix
>
> >
> >
> >Att.,
> >
> >*Allexandre Sampaio*
> >*Sistemas de Informação - IFBA*
> >*Vitória da Conquista - BA*
> >*(77) 99964 3521*
> >
> >2016-10-14 11:42 GMT-03:00 Felix Schumacher <
> >felix.schumac...@internetallee.de>:
> >
> >>
> >>
> >> Am 14. Oktober 2016 15:08:54 MESZ, schrieb Allexandre Sampaio <
> >> allexandre...@gmail.com>:
> >> >Hi, I'm having some trouble while using custom samplers on JMeter.
> >> >When I try to load the tests, the console shows a message that says
> >> >"NoSuchMethodError", refering to a method from the
> >> >mongo-java-driver-3.0.0
> >> >library.
> >> >After search for help, I couldn't fix the problem, in every topic
> >I've
> >> >read, the indicated fix method was by putting the library .jar in
> >the
> >> >JMeter lib/ext folder,but I'm sure I did this!
> >> >Did anyone have had a problem like this?
> >>
> >> I haven't used the mongodb sampler, but to get more help, it
> >certainly
> >> would help to give more information.
> >>
> >> What driver jar did you use exactly, which method is missing? Which
> >> sampler did you use? Which version is your JMeter?
> >>
> >> It might be helpful to have your Java version or OS and it's version.
> >>
> >> Regards,
> >> Felix
> >> >
> >> >Thanks,
> >> >*Allexandre Sampaio*
> >>
> >>
> >> -
> >> To unsubscribe, e-mail: user-unsubscr...@jmeter.apache.org
> >> For additional commands, e-mail: user-h...@jmeter.apache.org
> >>
> >>
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@jmeter.apache.org
> For additional commands, e-mail: user-h...@jmeter.apache.org
>
>


Re: Error while using Custom Samplers

2016-10-14 Thread Felix Schumacher


Am 14. Oktober 2016 17:11:30 MESZ, schrieb Allexandre Sampaio 
:
>Right, I'm using the version 3.0.0 of mongo-java-driver (available in
>http://central.maven.org/maven2/org/mongodb/mongo-java-driver/3.0.0/).
>The missing method is the "getDatabase(DB_NAME)", that returns the
>instance
>of the database. (I did some tests while coding the sampler and the
>getDatabase method worked fine).
>Actually, I'm coding my own sampler, that's because I need to do some
>specific operations in the database, using my own dataset, so, I
>couldn't
>use the mongodb sampler recomended.
>Finally, I'm using JMeter version 2.13, on a Ubuntu 16.10 desktop with
>Java
>8.

Did you remove the mongodb driver that came with JMeter?

And why are you still using JMeter 2.13?

Felix

>
>
>Att.,
>
>*Allexandre Sampaio*
>*Sistemas de Informação - IFBA*
>*Vitória da Conquista - BA*
>*(77) 99964 3521*
>
>2016-10-14 11:42 GMT-03:00 Felix Schumacher <
>felix.schumac...@internetallee.de>:
>
>>
>>
>> Am 14. Oktober 2016 15:08:54 MESZ, schrieb Allexandre Sampaio <
>> allexandre...@gmail.com>:
>> >Hi, I'm having some trouble while using custom samplers on JMeter.
>> >When I try to load the tests, the console shows a message that says
>> >"NoSuchMethodError", refering to a method from the
>> >mongo-java-driver-3.0.0
>> >library.
>> >After search for help, I couldn't fix the problem, in every topic
>I've
>> >read, the indicated fix method was by putting the library .jar in
>the
>> >JMeter lib/ext folder,but I'm sure I did this!
>> >Did anyone have had a problem like this?
>>
>> I haven't used the mongodb sampler, but to get more help, it
>certainly
>> would help to give more information.
>>
>> What driver jar did you use exactly, which method is missing? Which
>> sampler did you use? Which version is your JMeter?
>>
>> It might be helpful to have your Java version or OS and it's version.
>>
>> Regards,
>> Felix
>> >
>> >Thanks,
>> >*Allexandre Sampaio*
>>
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@jmeter.apache.org
>> For additional commands, e-mail: user-h...@jmeter.apache.org
>>
>>


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



Re: Error while using Custom Samplers

2016-10-14 Thread Allexandre Sampaio
Right, I'm using the version 3.0.0 of mongo-java-driver (available in
http://central.maven.org/maven2/org/mongodb/mongo-java-driver/3.0.0/).
The missing method is the "getDatabase(DB_NAME)", that returns the instance
of the database. (I did some tests while coding the sampler and the
getDatabase method worked fine).
Actually, I'm coding my own sampler, that's because I need to do some
specific operations in the database, using my own dataset, so, I couldn't
use the mongodb sampler recomended.
Finally, I'm using JMeter version 2.13, on a Ubuntu 16.10 desktop with Java
8.


Att.,

*Allexandre Sampaio*
*Sistemas de Informação - IFBA*
*Vitória da Conquista - BA*
*(77) 99964 3521*

2016-10-14 11:42 GMT-03:00 Felix Schumacher <
felix.schumac...@internetallee.de>:

>
>
> Am 14. Oktober 2016 15:08:54 MESZ, schrieb Allexandre Sampaio <
> allexandre...@gmail.com>:
> >Hi, I'm having some trouble while using custom samplers on JMeter.
> >When I try to load the tests, the console shows a message that says
> >"NoSuchMethodError", refering to a method from the
> >mongo-java-driver-3.0.0
> >library.
> >After search for help, I couldn't fix the problem, in every topic I've
> >read, the indicated fix method was by putting the library .jar in the
> >JMeter lib/ext folder,but I'm sure I did this!
> >Did anyone have had a problem like this?
>
> I haven't used the mongodb sampler, but to get more help, it certainly
> would help to give more information.
>
> What driver jar did you use exactly, which method is missing? Which
> sampler did you use? Which version is your JMeter?
>
> It might be helpful to have your Java version or OS and it's version.
>
> Regards,
> Felix
> >
> >Thanks,
> >*Allexandre Sampaio*
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@jmeter.apache.org
> For additional commands, e-mail: user-h...@jmeter.apache.org
>
>


Re: Error while using Custom Samplers

2016-10-14 Thread Felix Schumacher


Am 14. Oktober 2016 15:08:54 MESZ, schrieb Allexandre Sampaio 
:
>Hi, I'm having some trouble while using custom samplers on JMeter.
>When I try to load the tests, the console shows a message that says
>"NoSuchMethodError", refering to a method from the
>mongo-java-driver-3.0.0
>library.
>After search for help, I couldn't fix the problem, in every topic I've
>read, the indicated fix method was by putting the library .jar in the
>JMeter lib/ext folder,but I'm sure I did this!
>Did anyone have had a problem like this?

I haven't used the mongodb sampler, but to get more help, it certainly would 
help to give more information.

What driver jar did you use exactly, which method is missing? Which sampler did 
you use? Which version is your JMeter?

It might be helpful to have your Java version or OS and it's version.

Regards,
Felix
>
>Thanks,
>*Allexandre Sampaio*


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



Re: HttpClient SSL Handshake and self-signed certificate

2016-10-14 Thread Ivan Rancati
hi,
No idea whether JMeter validates the hostname. I thought not, as I have
some tests that access the server by IP address, and the server certificate
has a hostname.
A couple of ideas to try to narrow down the problem

- check jmeter.log
You should see some INFO entries from jmeter.util.SSLManager, see if your
keystore and aliases are loaded as expected.
- java keytool problems
I once could not get the keytool to work (it might have been a OpenJDK on
Linux issue, I did not get around to try with Oracle JDK); I exported
certificate/key to a .p12 file instead and it worked.

Btw, for quicker troubleshooting, you can also pass all the SSL options
directly from the command line, as opposite to editing jmeter.properties,
i.e.
-Djavax.net.ssl.keyStoreType=PKCS12

hope this helps
Ivan

On Fri, Oct 14, 2016 at 12:35 PM, Stuart Barlow 
wrote:

> Hi
>
> In test environments self-signed certificates are common and they're not
> always created in the right way. I'm trying to connect via HTTPS Request to
> a website that uses a self-signed cert where the hostname is not correctly
> set inside the cert. The CN field has a value like "test-web-cert" and that
> cert is also used by two different domains. It's deployed for both
> https://www.test1.thirdpartywebsite.com and https://www.test2.thirdpartywe
> bsite.com
>
> I can access these websites from a browser and can view the certificate
> this way. The browser is more forgiving than JMeter. I tried exporting it
> from the browser and importing into the truststore used by JMeter (I set
> javax.net.ssl.trustStore and javax.net.ssl.trustStorePassword in
> system.properties) and also into the cacerts in my JRE lib/security folder.
> Both of these didn't work.
>
> I always see this in the Response Tab of a Results Tree:
>
> java.net.SocketTimeoutException: Read timed out
> at java.net.SocketInputStream.socketRead0(Native Method)
> at java.net.SocketInputStream.socketRead(SocketInputStream.java
> :116)
> at java.net.SocketInputStream.read(SocketInputStream.java:170)
> at java.net.SocketInputStream.read(SocketInputStream.java:141)
> at sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
> at sun.security.ssl.InputRecord.read(InputRecord.java:503)
> at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.
> java:973)
> at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSo
> cketImpl.java:1375)
> at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.
> java:1403)
> at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.
> java:1387)
> at org.apache.http.conn.ssl.SSLSocketFactory.createLayeredSocke
> t(SSLSocketFactory.java:573)
> at org.apache.http.conn.ssl.SSLSocketFactory.createLayeredSocke
> t(SSLSocketFactory.java:447)
> at org.apache.jmeter.protocol.http.sampler.LazySchemeSocketFact
> ory.createLayeredSocket(LazySchemeSocketFactory.java:121)
> at org.apache.http.impl.conn.DefaultClientConnectionOperator.
> updateSecureConnection(DefaultClientConnectionOperator.java:219)
> at org.apache.http.impl.conn.ManagedClientConnectionImpl.layerP
> rotocol(ManagedClientConnectionImpl.java:421)
> at org.apache.jmeter.protocol.http.sampler.MeasuringConnectionM
> anager$MeasuredConnection.layerProtocol(MeasuringConnectionM
> anager.java:152)
> at org.apache.http.impl.client.DefaultRequestDirector.establish
> Route(DefaultRequestDirector.java:815)
> at org.apache.http.impl.client.DefaultRequestDirector.tryConnec
> t(DefaultRequestDirector.java:616)
> at org.apache.http.impl.client.DefaultRequestDirector.execute(D
> efaultRequestDirector.java:447)
> at org.apache.http.impl.client.AbstractHttpClient.doExecute(Abs
> tractHttpClient.java:884)
> at org.apache.http.impl.client.CloseableHttpClient.execute(Clos
> eableHttpClient.java:82)
> at org.apache.http.impl.client.CloseableHttpClient.execute(Clos
> eableHttpClient.java:55)
> at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeR
> equest(HTTPHC4Impl.java:619)
> at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(
> HTTPHC4Impl.java:379)
> at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sam
> ple(HTTPSamplerProxy.java:74)
> at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.samp
> le(HTTPSamplerBase.java:1146)
> at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.samp
> le(HTTPSamplerBase.java:1135)
> at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(
> JMeterThread.java:465)
> at org.apache.jmeter.threads.JMeterThread.processSampler(JMeter
> Thread.java:410)
> at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java
> :241)
> at java.lang.Thread.run(Thread.java:745)
>
> My theory at the moment is that the SSL handshake is dropped because of
> hostname validation. I'm trying to connect to
> htt

Error while using Custom Samplers

2016-10-14 Thread Allexandre Sampaio
Hi, I'm having some trouble while using custom samplers on JMeter.
When I try to load the tests, the console shows a message that says
"NoSuchMethodError", refering to a method from the mongo-java-driver-3.0.0
library.
After search for help, I couldn't fix the problem, in every topic I've
read, the indicated fix method was by putting the library .jar in the
JMeter lib/ext folder,but I'm sure I did this!
Did anyone have had a problem like this?

Thanks,
*Allexandre Sampaio*


HttpClient SSL Handshake and self-signed certificate

2016-10-14 Thread Stuart Barlow

Hi

In test environments self-signed certificates are common and they're 
not always created in the right way. I'm trying to connect via HTTPS 
Request to a website that uses a self-signed cert where the hostname is 
not correctly set inside the cert. The CN field has a value like 
"test-web-cert" and that cert is also used by two different domains. 
It's deployed for both https://www.test1.thirdpartywebsite.com and 
https://www.test2.thirdpartywebsite.com


I can access these websites from a browser and can view the certificate 
this way. The browser is more forgiving than JMeter. I tried exporting 
it from the browser and importing into the truststore used by JMeter (I 
set javax.net.ssl.trustStore and javax.net.ssl.trustStorePassword in 
system.properties) and also into the cacerts in my JRE lib/security 
folder. Both of these didn't work.


I always see this in the Response Tab of a Results Tree:

java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:170)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
at sun.security.ssl.InputRecord.read(InputRecord.java:503)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973)
	at 
sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
	at 
sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
	at 
sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
	at 
org.apache.http.conn.ssl.SSLSocketFactory.createLayeredSocket(SSLSocketFactory.java:573)
	at 
org.apache.http.conn.ssl.SSLSocketFactory.createLayeredSocket(SSLSocketFactory.java:447)
	at 
org.apache.jmeter.protocol.http.sampler.LazySchemeSocketFactory.createLayeredSocket(LazySchemeSocketFactory.java:121)
	at 
org.apache.http.impl.conn.DefaultClientConnectionOperator.updateSecureConnection(DefaultClientConnectionOperator.java:219)
	at 
org.apache.http.impl.conn.ManagedClientConnectionImpl.layerProtocol(ManagedClientConnectionImpl.java:421)
	at 
org.apache.jmeter.protocol.http.sampler.MeasuringConnectionManager$MeasuredConnection.layerProtocol(MeasuringConnectionManager.java:152)
	at 
org.apache.http.impl.client.DefaultRequestDirector.establishRoute(DefaultRequestDirector.java:815)
	at 
org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:616)
	at 
org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:447)
	at 
org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:884)
	at 
org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
	at 
org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55)
	at 
org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:619)
	at 
org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:379)
	at 
org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)
	at 
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1146)
	at 
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1135)
	at 
org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:465)
	at 
org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:410)

at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:241)
at java.lang.Thread.run(Thread.java:745)

My theory at the moment is that the SSL handshake is dropped because of 
hostname validation. I'm trying to connect to 
https://www.test1.thirdpartywebsite.com but the certificate contains 
value test-web-cert. They don't match so the connection is dropped. I'm 
able to use curl with the -k option to retrieve the content if that's 
relevant.


Can anyone tell me if there is a way in JMeter to disable hostname 
validation during SSL Handshake?



Thanks,

Stuart

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