com.thoughtworks.xstream.converters.ConversionException while running Jmeter from Jenkins shell - jmeter

While running Jmeter jmx script from Jenkins command line I am getting the below error.
Error in NonGUIDriver java.lang.IllegalArgumentException:
Problem loading XML from:'/Users/msn/apache-jmeter-2.13/bin/testMsn.jmx',
conversion error com.thoughtworks.xstream.converters.ConversionException:
org/apache/commons/lang3/CharUtils : org/apache/commons/lang3/CharUtils
I have all the plug-in installed in my Jmeter/lib/ext.
Can someone help me point out which jar is missing to resolve this issue
Building in workspace /Users/Shared/Jenkins/Home/jobs/Jmeter-First/workspace
[workspace] $ /bin/sh -xe /Users/Shared/Jenkins/tmp/hudson6757313439371769855.sh
+ /Users/msn/apache-jmeter-2.13/bin/jmeter.sh -n -t /Users/msn/apache-jmeter- 2.13/bin/TestPlan.jmx
Error in NonGUIDriver java.lang.IllegalArgumentException: Problem loading XML from:'/Users/msn/apache-jmeter-2.13/bin/TestPlan.jmx', conversion error com.thoughtworks.xstream.converters.ConversionException: org/apache/commons/lang3/CharUtils : org/apache/commons/lang3/CharUtils
---- Debugging information ----
message : org/apache/commons/lang3/CharUtils
cause-exception : java.lang.NoClassDefFoundError
cause-message : org/apache/commons/lang3/CharUtils
first-jmeter-class : org.apache.jmeter.samplers.SampleSaveConfiguration. <clinit>(SampleSaveConfiguration.java:323)
class : org.apache.jmeter.save.ScriptWrapper
required-type : org.apache.jmeter.reporters.ResultCollector
converter-type : org.apache.jmeter.save.ScriptWrapperConverter
path : /jmeterTestPlan/hashTree/hashTree/hashTree/ResultCollector
line number : 46
version : 2.13 r1665067
------------------------------
Finished: SUCCESS

lang3.CharUtils is part of Apache Commons Lang library (http://mvnrepository.com/artifact/org.apache.commons/commons-lang3). So make sure it is available on your classpath (for example commons-lang3-3.3.2.jar).
Also, make sure you are not confusing it with Commons Lang library (http://mvnrepository.com/artifact/commons-lang/commons-lang) which is a predecessor of aforementioned Apache Commons Lang. For example commons-lang-2.4.jar.

After having the same issue and not being able to resolve it by the commonly suggested solution (installing plugins-manager.jar), I was able to fix the issue by reinstalling JMeter on my machine.

Related

Unable to open Jmeter frm cmd prompt

Facing this exception while trying to open Jmeter.
java.lang.IllegalArgumentException: Problem loading XML from:'D:\PerformanceTest\trunk\v2\Jmeter\loadscript\loadscript.jmx'.
Cause:
CannotResolveClassException: com.tag.jmeter.ext.config.PropertyReader
Detail:com.thoughtworks.xstream.converters.ConversionException:
---- Debugging information ----
cause-exception : com.thoughtworks.xstream.converters.ConversionException
cause-message :
first-jmeter-class : org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:67)
class : org.apache.jmeter.save.ScriptWrapper
required-type : org.apache.jmeter.save.ScriptWrapper
converter-type : org.apache.jmeter.save.ScriptWrapperConverter
path : /jmeterTestPlan/hashTree/hashTree/com.tag.jmeter.ext.config.PropertyReader
line number : 50
It's because the author of the script for some unknown reason included this useless plugin into his test plan.
You need to install the plugin in order to be able to open it in JMeter
I would suggest to remove the plugin from the test plan on next available opportunity and switch to built-in mechanisms for configuring JMeter and reading properties, if reading an external .properties file is a must you can pass it to JMeter via -q command-line argument

How to install plugin manager and perfmon metric collector on remote server in Non- GUI mode?

I have installed jmeter 5.2.1 on one of remote AWS server.
I want to collect summary report of response and server information as well with perfmon metric.
I have downloaded jmeter-plugins-manager-1.6.jar and jmeter-plugins-perfmon-2.1.jar and copied to /lib/ext
I then created a test script from jmeter on my local machine and copied to server and tried to run the same jmeter -n -t AWS.jmx -l awsresults.jtl
But I am getting an error as :
Error in NonGUIDriver java.lang.IllegalArgumentException: Problem loading XML from:'/root/apache-jmeter-5.2.1/bin/AWS.jmx'.
Cause:
ClassNotFoundException: kg.apc.jmeter.vizualizers.CorrectedResultCollector
Detail:com.thoughtworks.xstream.converters.ConversionException:
---- Debugging information ----
cause-exception : java.lang.NoClassDefFoundError
cause-message : kg/apc/jmeter/vizualizers/CorrectedResultCollector
first-jmeter-class : org.apache.jmeter.save.SaveService$XStreamWrapper$1.realClass(SaveService.java:98)
class : org.apache.jmeter.save.ScriptWrapper
required-type : org.apache.jmeter.save.ScriptWrapper
converter-type : org.apache.jmeter.save.ScriptWrapperConverter
path : /jmeterTestPlan/hashTree/hashTree/hashTree/kg.apc.jmeter.perfmon.PerfMonCollector
line number : 219
version : 5.2.1
When I run this on local machine in jmeter its working as expected.
Can someone please help me to understand and solve the error.?
Edit:
`
2021-03-01 09:23:36,931 INFO k.a.j.p.PerfMonCollector: PerfMon metrics will be stored in /tmp/perfmon_7034792572732251249.jtl
2021-03-01 09:23:36,931 ERROR o.a.j.JMeter: Uncaught exception in thread Thread[StandardJMeterEngine,5,main]
java.lang.NoClassDefFoundError: kg/apc/perfmon/metrics/MetricParams
at kg.apc.jmeter.perfmon.PerfMonCollector.initiateConnector(PerfMonCollector.java:200) ~[jmeter-plugins-perfmon-2.1.jar:?]
at kg.apc.jmeter.perfmon.PerfMonCollector.initiateConnectors(PerfMonCollector.java:175) ~[jmeter-plugins-perfmon-2.1.jar:?]
at kg.apc.jmeter.perfmon.PerfMonCollector.testStarted(PerfMonCollector.java:126) ~[jmeter-plugins-perfmon-2.1.jar:?]
at org.apache.jmeter.reporters.ResultCollector.testStarted(ResultCollector.java:351) ~[ApacheJMeter_core.jar:5.2.1]
at kg.apc.jmeter.vizualizers.CorrectedResultCollector.testStarted(CorrectedResultCollector.java:28) ~[jmeter-plugins-cmn-jmeter-0.4.jar:?]
at org.apache.jmeter.engine.StandardJMeterEngine.notifyTestListenersOfStart(StandardJMeterEngine.java:206) ~[ApacheJMeter_core.jar:5.2.1]
at org.apache.jmeter.engine.StandardJMeterEngine.run(StandardJMeterEngine.java:381) ~[ApacheJMeter_core.jar:5.2.1]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_282]
Caused by: java.lang.ClassNotFoundException: kg.apc.perfmon.metrics.MetricParams
at java.net.URLClassLoader.findClass(URLClassLoader.java:382) ~[?:1.8.0_282]
at java.lang.ClassLoader.loadClass(ClassLoader.java:418) ~[?:1.8.0_282]
at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[?:1.8.0_282]
... 8 more
2021-03-01 09:23:36,937 INFO o.a.j.r.ResultCollector: Shutdown hook started
2021-03-01 09:23:36,937 INFO o.a.j.r.ResultCollector: Shutdown hook ended
`
Thanks,
The error means that you don't have the PerfMon plugin installed on your AWS instance, I don't think that the current version of JMeter Plugins Manager can detect/install the missing plugins in non-GUI mode so you will need to do this manually.
Something like:
Download JMeter Plugins Manager:
wget https://jmeter-plugins.org/get/ -O /opt/apache-jmeter-5.2.1/lib/ext/jmeter-plugins-manager.jar
Download JMeter Plugins Command Line Runner
wget https://repo1.maven.org/maven2/kg/apc/cmdrunner/2.2/cmdrunner-2.2.jar -P /opt/apache-jmeter-5.2.1/lib/
Install JMeter Plugins Manager Command Line Utility:
java -cp /opt/apache-jmeter-5.2.1/lib/ext/jmeter-plugins-manager.jar org.jmeterplugins.repository.PluginManagerCMDInstaller
Install the PerfMon Plugin:
/opt/apache-jmeter-5.2.1/bin/./PluginsManagerCMD.sh install jpgc-perfmon
That's it, now you should be able to execute your test
P.S. According to JMeter Best Practices you should always be using the latest version of JMeter so consider upgrading to JMeter 5.4.1 or whatever its the current JMeter latest stable version

Jmeter plugin error for PerfMonCollector listener while running Performance Metrics Collector

I am trying to run performance test using jmeter in non-gui mode to map CPU/Memory Utilization for the server machine. However i am experiencing an error while running the test in non-gui mode.
Error in NonGUIDriver java.lang.IllegalArgumentException: Problem loading XML from:'/Users/vikasgupta/Downloads/apache-jmeter-5.2.1/bin/Check FreePlays.jmx'.
Cause:
CannotResolveClassException: kg.apc.jmeter.perfmon.PerfMonCollector
Detail:com.thoughtworks.xstream.converters.ConversionException:
---- Debugging information ----
cause-exception : com.thoughtworks.xstream.converters.ConversionException
cause-message :
first-jmeter-class : org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:67)
class : org.apache.jmeter.save.ScriptWrapper
required-type : org.apache.jorphan.collections.ListedHashTree
converter-type : org.apache.jmeter.save.ScriptWrapperConverter
path : /jmeterTestPlan/hashTree/hashTree/hashTree/kg.apc.jmeter.perfmon.PerfMonCollector
line number : 266
version : 5.0 r1840935
PerfMon (Servers Performance Monitoring) plugin
CannotResolveClassException: kg.apc.jmeter.perfmon.PerfMonCollector
Your test contains PerfMon Metrics Collector listener and your JMeter installation doesn't have this JMeter PerfMon Plugin.
Just install PerfMon (Servers Performance Monitoring) plugin using JMeter Plugins Manager and you should be able to open the script.
If there are any other missing plugins - JMeter Plugins Manager will detect them and ask you whether it should download them

Spring Boot Project Jar file not reading File placed on classpath

I am connecting my Spring Boot app with Google Cloud Sql and it got connected by placing Credential File in src/main/resources but Issue comes when I try to run the Jar File - [FileNotFound]
:: Spring Boot :: (v2.0.3.RELEASE)
application.properties-
spring.cloud.gcp.credentials.location=classpath:ArpanShoppingApp-863d536d1f93.json
and running jar file gives exception
java -jar CloudSQLConnect-1.0.jar
Exception-
2018-06-22 10:46:38.393 INFO 1172 --- [ main] o.s.c.g.s.a.GcpCloudSqlAutoConfiguration : Default MYSQL JdbcUrl provider. Connecting to jdbc:mysql://google/google_sql?cloudSqlInstance=mindful-highway-207309:asia-south1:shopping-db&socketFactory=com.google.cloud.sql.mysql.SocketFactory&useSSL=false with driver com.mysql.jdbc.Driver
2018-06-22 10:46:38.401 INFO 1172 --- [ main] o.s.c.g.s.a.GcpCloudSqlAutoConfiguration : Error reading Cloud SQL credentials file.
java.io.FileNotFoundException: class path resource [ArpanShoppingApp-863d536d1f93.json] cannot be resolved to absolute file path because it does not reside in the file system: jar:file:/Users/arpan/Documents/workspace-sts-3.8.4.RELEASE/CloudSQLConnect/target/CloudSQLConnect-1.0.jar!/BOOT-INF/classes!/ArpanShoppingApp-863d536d1f93.json
at org.springframework.util.ResourceUtils.getFile(ResourceUtils.java:217) ~[spring-core-5.0.7.RELEASE.jar!/:5.0.7.RELEASE]
at org.springframework.core.io.AbstractFileResolvingResource.getFile(AbstractFileResolvingResource.java:133) ~[spring-core-5.0.7.RELEASE.jar!/:5.0.7.RELEASE]
at org.springframework.cloud.gcp.sql.autoconfig.GcpCloudSqlAutoConfiguration.setCredentialsProperty(GcpCloudSqlAutoConfiguration.java:167) [spring-cloud-gcp-starter-sql-1.0.0.M1.jar!/:1.0.0.M1]
at org.springframework.cloud.gcp.sql.autoconfig.GcpCloudSqlAutoConfiguration.defaultJdbcInfoProvider(GcpCloudSqlAutoConfiguration.java:107) [spring-cloud-gcp-starter-sql-1.0.0.M1.jar!/:1.0.0.M1]
at org.springframework.cloud.gcp.sql.autoconfig.GcpCloudSqlAutoConfiguration$$EnhancerBySpringCGLIB$$edf77794.CGLIB$defaultJdbcInfoProvider$1(<generated>) [spring-cloud-gcp-starter-sql-1.0.0.M1.jar!/:1.0.0.M1]
This appears to be a limitation of spring-cloud-gcp. It seems like credential files must be on the filesystem and cannot be package into a jar. The latest code has a better error message than the M1 version that you're using.

Spring Boot and Axis2 client runtime issue with Rampart

I am trying to use Axis 2 client to work with a soap based web service. I use Rampart 1.7.1 for WSO Authentication. After I created the stub code using axis2tools I installed the jar files into maven repository and use them as dependency in my pom.xml file. Also I use spring boot for the rest of application which I use the generated libraries as soap client api.
Everything is good in dev environment I can work with web service. And also when I use
mvn spring-boot:run
it works fine and webservice communication is good from UI to Webservice and back(end to end).
when I use
java -jar target/fatjar.jar
When I send request to web service I receive the following error at console:
2017-11-17 16:00:35.140 WARN 31114 --- [nio-8080-exec-2] o.a.axis2.deployment.AxisConfigBuilder : Unable to instantiate deployer org.apache.axis2.deployment.ServiceDeployer; see debug logs for more details
2017-11-17 16:00:35.161 INFO 31114 --- [nio-8080-exec-2] o.a.axis2.deployment.DeploymentEngine : No services directory was found under /home/mehdi/Workspace/EclipseWS/src/main/resources/axis.
2017-11-17 16:00:35.179 INFO 31114 --- [nio-8080-exec-2] o.a.axis2.deployment.ModuleDeployer : Deploying module: rampart-1.7.1 - file:/home/mehdi/Workspace/EclipseWS/src/main/resources/axis/modules/rampart-1.7.1.mar
2017-11-17 16:00:35.185 ERROR 31114 --- [nio-8080-exec-2] o.a.axis2.deployment.ModuleDeployer : The rampart-1.7.1.jar module, which is not valid, caused The /home/mehdi/Workspace/EclipseWS/target/cybersourceClient-0.0.1-SNAPSHOT.jar!/BOOT-INF/lib/rampart-1.7.1.jar file cannot be found.
org.apache.axis2.AxisFault: The /home/mehdi/Workspace/EclipseWS/target/cybersourceClient-0.0.1-SNAPSHOT.jar!/BOOT-INF/lib/rampart-1.7.1.jar file cannot be found.
at org.apache.axis2.deployment.repository.util.DeploymentFileData.setClassLoader(DeploymentFileData.java:118) [axis2-kernel-1.7.1.jar!/:1.7.1]
at org.apache.axis2.deployment.ModuleDeployer.deploy(ModuleDeployer.java:133) ~[axis2-kernel-1.7.1.jar!/:1.7.1]
at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:144) [axis2-kernel-1.7.1.jar!/:1.7.1]
at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:585) [axis2-kernel-1.7.1.jar!/:1.7.1]
at org.apache.axis2.deployment.RepositoryListener.loadClassPathModules(RepositoryListener.java:222) [axis2-kernel-1.7.1.jar!/:1.7.1]
same line when I use "mvn spring-boot:run" is
2017-11-17 16:13:14.270 WARN 7823 --- [nio-8080-exec-9] o.a.axis2.deployment.AxisConfigBuilder : Unable to instantiate deployer org.apache.axis2.deployment.ServiceDeployer; see debug logs for more details
2017-11-17 16:13:14.286 INFO 7823 --- [nio-8080-exec-9] o.a.axis2.deployment.DeploymentEngine : No services directory was found under /home/mehdi/Workspace/EclipseWS/src/main/resources/axis.
2017-11-17 16:13:14.301 INFO 7823 --- [nio-8080-exec-9] o.a.axis2.deployment.ModuleDeployer : Deploying module: rampart-1.7.1 - file:/home/mehdi/Workspace/EclipseWS/src/main/resources/axis/modules/rampart-1.7.1.mar
2017-11-17 16:13:14.304 INFO 7823 --- [nio-8080-exec-9] o.a.axis2.deployment.ModuleDeployer : Deploying module: rampart-1.7.1 - file:/home/mehdi/.m2/repository/org/apache/rampart/rampart/1.7.1/rampart-1.7.1.jar
Please notice that it fails for:
...The rampart-1.7.1.jar module, which is not valid,...
I don't know why with maven launch it works but with java -jar throws exception.
According to Spring Boot documentation (Further Config section) in here
I needed to add the rampart library to unpacked list in spring-boot-maven-plugin as follows:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<requiresUnpack>
<requiresUnpack>
<groupId>org.apache.rampart</groupId>
<artifactId>rampart</artifactId>
</requiresUnpack>
</requiresUnpack>
</configuration>
</plugin>

Resources