Unknown option: --glue com.app.saf.glue.mf - jmeter

I have used OS Process Sampler in my jmeter test plan
Command java
Value
-jar
test-automation-0.0.1-SNAPSHOT.jar
classpath:features/mf
--glue com.app.saf.glue.mf
--tags #LOANSETUP
When I run the test plan, I get the error:
Exception in thread "main" cucumber.runtime.CucumberException: Unknown option: --glue com.app.saf.glue.mf
at cucumber.runtime.RuntimeOptions.parse(RuntimeOptions.java:148)
at cucumber.runtime.RuntimeOptions.<init>(RuntimeOptions.java:85)
at cucumber.runtime.RuntimeOptions.<init>(RuntimeOptions.java:78)
at cucumber.runtime.RuntimeOptions.<init>(RuntimeOptions.java:70)
at cucumber.api.cli.Main.run(Main.java:31)
at cucumber.api.cli.Main.main(Main.java:18)
My Jmeter version is 3.2

Change your configuration to:
-jar
test-automation-0.0.1-SNAPSHOT.jar
classpath:features/mf
--glue
com.app.saf.glue.mf
--tags
#LOANSETUP

Related

Setting Environment Variables using Gradle with IntelliJ IDEA

In my Spring Boot project I have Environment Variables using a File:
When I select "Build and run using: " Gradle, IntelliJ doesn't take the environment variables value.
Caused by: java.lang.IllegalArgumentException: Not enough variable values available to expand 'SPRING_PROFILES_ACTIVE'
at org.springframework.web.util.UriComponents$VarArgsTemplateVariables.getValue(UriComponents.java:370)
at org.springframework.web.util.UriComponents.expandUriComponent(UriComponents.java:263)
at org.springframework.web.util.HierarchicalUriComponents$FullPathComponent.expand(HierarchicalUriComponents.java:923)
at org.springframework.web.util.HierarchicalUriComponents.expandInternal(HierarchicalUriComponents.java:440)
at org.springframework.web.util.HierarchicalUriComponents.expandInternal(HierarchicalUriComponents.java:53)
at org.springframework.web.util.UriComponents.expand(UriComponents.java:172)
at org.springframework.web.util.UriComponentsBuilder.build(UriComponentsBuilder.java:517)
at org.springframework.web.util.DefaultUriBuilderFactory.expand(DefaultUriBuilderFactory.java:154)
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:716)
at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:340)
at org.springframework.vault.core.VaultTemplate.lambda$doRead$5(VaultTemplate.java:461)
at org.springframework.vault.core.VaultTemplate.doWithSession(VaultTemplate.java:448)
at org.springframework.vault.core.VaultTemplate.doRead(VaultTemplate.java:458)
at org.springframework.vault.core.VaultTemplate.read(VaultTemplate.java:353)
at org.springframework.vault.core.lease.SecretLeaseContainer.doGetSecrets(SecretLeaseContainer.java:645)
at org.springframework.vault.core.lease.SecretLeaseContainer.doStart(SecretLeaseContainer.java:390)
at org.springframework.vault.core.lease.SecretLeaseContainer.start(SecretLeaseContainer.java:380)
at org.springframework.vault.core.lease.SecretLeaseContainer.addRequestedSecret(SecretLeaseContainer.java:343)
at org.springframework.vault.core.env.LeaseAwareVaultPropertySource.loadProperties(LeaseAwareVaultPropertySource.java:176)
at org.springframework.vault.core.env.LeaseAwareVaultPropertySource.<init>(LeaseAwareVaultPropertySource.java:161)
at org.springframework.vault.core.env.LeaseAwareVaultPropertySource.<init>(LeaseAwareVaultPropertySource.java:119)
at org.springframework.cloud.vault.config.VaultConfigDataLoader.createLeasingPropertySource(VaultConfigDataLoader.java:287)
at org.springframework.cloud.vault.config.VaultConfigDataLoader.createLeasingPropertySourceFailFast(VaultConfigDataLoader.java:310)
... 28 common frames omitted
Caused by: java.lang.IllegalArgumentException: Not enough variable values available to expand 'SPRING_PROFILES_ACTIVE'
Execution failed for task ':app:MyApplication.main()'.
> Process 'command '/usr/local/java/jdk-11.0.16.1.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
When I select "Build and run using: " IntelliJ IDEA runs without problem!
How to pass environment Variables value?

Jmeter || Error generating the report: java.lang.NullPointerException while running test from CMD

I am trying to execute a test from CMD but getting following error :
Command : jmeter -n -t D:\Users\load.test\Desktop\Performance\apache-jmeter-5.5\bin\UserServices.jmx -l D:\Users\load.test\Desktop\Performance\apache-jmeter-5.5\PerformanceData\MICR_Project\MICR_TestResults\DebugOOM\DebugOOM_1.csv -e -o D:\Users\load.test\Desktop\Performance\apache-jmeter-5.5\PerformanceData\MICR_Project\MICR_TestResults\DebugOOM\DebugOOM_1 -JURL=localhost -JPort=7058 -JUser=5 -JRampUp=1 -JDuration=900 -JRampUpSteps=1 -JOutputFileName=OutputOOM.jtl -JErrorFileName=ErrorOOM.jtl -JFlow1=100
What could be the possible reasons for this error as its not very informative.emphasized text
The NullPointerException is related to generating the HTML Reporting Dashboard, the dashboard generation fails because your test failed to execute at all - no Samplers were run.
The reason why no Samplers were run can be found in jmeter.log file, the most "popular" reasons are:
The number of threads in the Thread Group is 0
The test uses CSV Data Set Config for parameterization and the CSV file is not present.
The test uses a JMeter Plugin and the plugin is not installed

JMX connection to Springboot get connection refused

I am using springboot's sample project from: https://github.com/spring-guides/gs-spring-boot#run-the-application. This is the command I used to run the built jar file:
java -jar build/libs/gs-spring-boot-0.1.0.jar -
Dcom.sun.management.jmxremote -
Dcom.sun.management.jmxremote.port=12348 -
Dcom.sun.management.jmxremote.authenticate=false -
Dcom.sun.management.jmxremote.ssl=false -
Dcom.sun.management.jmxremote.rmi.port=12348 -
Djava.rmi.server.hostname=192.168.7.119
Then I tried to use jmxterm to connect:
java -jar ~/Downloads/jmxterm.jar -l localhost:12348
But getting connection refused error.
The -Dcom.sun... arguments must come before the -jar thing.jar . Anything after the -jar thing.jar are considered arguments to your application, and are passed into main.

Load test using Maven-jmeter plugin on Jenkins gives "Non HTTP response code: javax.net.ssl.SSLHandshakeException"

I am using Jmeter 3.0 for load testing API's. I am using Maven-Jmeter plugin to run my load tests. Currently using com.lazerycode.jmeter plugin version 2.0.3. Test's run fine on my local machine but when I run it via Jenkins, I get "Non HTTP response code: javax.net.ssl.SSLHandshakeException". I have googled and tried pretty much everything which is suggested in various forums but error doesn't go way. What am I missing? Any help is appreciated.
See error stack below.
httpSample t="1069" it="0" lt="0" ts="1485212600015" s="false" lb="ServiceProxy:TC#1: GET- Health Check For Proxy Service" **rc="Non HTTP response code: javax.net.ssl.SSLHandshakeException" rm="Non HTTP response message: Received fatal alert: handshake_failure"** tn="Service Proxy Regression Test Plan 1-1" dt="text" by="2566" ng="1" na="1">
****** received : [[[Non HTTP response code: javax.net.ssl.SSLHandshakeException]]]
****** comparison: [[[200 ]]]
class="java.lang.String">javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)
at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1979)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1086)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1332)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1359)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1343)
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)
...
I was able to solve the problem. Here is the solution:
1) I am using maven-jmeter plugin and maven-jmeter analysis plugin. In simple terms, running jmeter via a maven project. To solve the SSLHandshakeException problem, put your maven command in the "Execute Shell" area instead of "Goal" area in jenkins job. I also changed the command to "mvn -B -f ./pom.xml verify -s settings.xml".
However, after doing #1, I was seeing that my performance tests were running twice. So I followed the solution #2.
2) I used a freestyle project in jenkins instead of maven project. I put the command in "Execute shell" area. I was getting 'cmd fail' errors. This was due to old version of maven being used on slave. I specified exact version of maven I want to use on slave and things worked fine.
Here is how it looks like:
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export PATH=$JAVA_HOME/bin:$PATH
export http_proxy=http://example.com:8080
export HTTP_PROXY=http://example.com:8080
export https_proxy=http://example.com:8080
export HTTPS_PROXY=http://example.com:8080
/usr/share/maven-3.3.9/bin/mvn -B -f ./pom.xml verify -s settings.xml -DSERVICE_P_NUM_OF_USERS=1 -DSERVICE_P_RAMP_UP_TIME=1
I have seen this error. Then i figured out that the error was due to java version of Jenkins-slave. Upgrade java version and see if it helps.

Failure running sonar-runner locally

I have an instance of sonar running on my local machine at localhost:9000, and I'm able to go to and use the console. When I try to run sonar-runner from the command line for a project, I get a 500 error:
Exception in thread "main" org.sonar.runner.RunnerException: org.picocontainer.PicoLifecycleException: PicoLifecycleException: method 'public void org.sonar.batch.bootstrap.DatabaseCompatibility.start()', instance 'org.sonar.batch.bootstrap.DatabaseCompatibility#3848110b, org.sonar.api.utils.HttpDownloader$HttpException: Fail to download [http://localhost:9000/api/server]. Response code: 500
at org.sonar.runner.Runner.delegateExecution(Runner.java:288)
at org.sonar.runner.Runner.execute(Runner.java:151)
at org.sonar.runner.Main.execute(Main.java:84)
at org.sonar.runner.Main.main(Main.java:56)
Caused by: org.picocontainer.PicoLifecycleException: PicoLifecycleException: method 'public void org.sonar.batch.bootstrap.DatabaseCompatibility.start()', instance 'org.sonar.batch.bootstrap.DatabaseCompatibility#3848110b, org.sonar.api.utils.HttpDownloader$HttpException: Fail to download [http://localhost:9000/api/server]. Response code: 500
at org.picocontainer.monitors.NullComponentMonitor.lifecycleInvocationFailed(NullComponentMonitor.java:77)
...
...
But when i visit the url in my browser, I get the following xml response:
<server>
<id>20131007131041</id>
<version>3.4.1</version>
<status>UP</status>
</server>
I'm not sure where to go from here. Any advice?
The current workaround is to unset GEM_PATH and GEM_HOME variables before launching the sonar webservice:
unset GEM_PATH GEM_HOME
./sonar.sh console
This doesn't have to be done for the sonar-runner environment.
The problem is caused due to conflict with Ruby local installation.
As per the sonar-runner documentation you need to create a sonar-project.properties in your project root and then run sonar-runner from command line
ref Sonar runner docs
In my case it worked with following workaround
1: export GEM_HOME=''
2: export GEM_PATH=''
3: restart sonar webserver
4: run sonar-runner in project path

Resources