ConversionException in running a Jmeter jmx file with Ultimate thread group in Intellij maven - maven

Facing the below issue in running Ultimate thread group jmx in intellij maven (please note, for normal thread group jmx file, there is no issue. And in pom file also the required dependencies are added, which i believe is the ctg(custom thread group) one) . I am getting this error for that jmx execution alone -
missing class Conversion Exception:
required-type-ListedHashTree
converter-type-ScriptWrapperConverter
What needs to be changed now to make it executable in intellij . I am using mvn commands to trigger the jmx

I think you need to add the following dependency to your project classpath:
jmeter-plugins-casutg
Something like:
<dependency>
<groupId>kg.apc</groupId>
<artifactId>jmeter-plugins-casutg</artifactId>
<version>2.10</version>
</dependency>
You may find Five Ways To Launch a JMeter Test without Using the JMeter GUI article and jmeter-from-code repository for some examples.

I had found the solution to this. Apart from adding it to the dependency,
You need to add this also to the jmeter extensions in the pom.xml
<jmeterExtensions>
<artifact>kg.apc:jmeter-plugins-casutg:2.8</artifact>
</jmeterExtensions>
My script started running after this change in pom.xml

Related

add external libraries jar to jmeter-maven-plugin

Hello I'm using this https://github.com/jmeter-maven-plugin/jmeter-maven-plugin currently which the sample project works fine with a simple jmeter test.
However, I was wondering how does jars get added to the /lib folder.
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-s3</artifactId>
<version>1.12.174</version>
I need the above dependencies for my testplan in which my preprocessors uses certain imports from within it.
In JMeter its just drag and drop all jars related into the folder.
I tried adding the top code into the pom file to no avail since after running it the log file says unable to resolve import. There seem to be plugins documentation but I thought dependencies labelled on the pom files gets built with any JMeter tests.
Any help or clarification is appreciated.
See Adding jar's to the /lib directory
add any additional Java libraries to JMeter's lib/ directory by using the <testPlanLibraries> configuration element
<configuration>
<testPlanLibraries>
<artifact>org.apache.activemq:activemq-spring:5.15.2</artifact>
In your case
<artifact>com.amazonaws:aws-java-sdk-s3:1.12.174</artifact>

Remote debug or local debug with tomcat embedded in Spring boot

I am working on a new project which embedded a tomcat with the dependency spring-boot-starter-tomcat:2.5.3 (into vaadin-spring-boot-starter).
I am building my project into a .jar, and launching it with "mvn spring-boot:run".
But because of the embedded tomcat, I am unable to use the debug mode with Eclipse.
I have already try to launch a remote debug session, with :
MAVEN_OPTS= -Xmx1024M -XX:MaxPermSize=256M -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000
Eclipse connects itself well, but breakpoints are not working and it shows me only one thread, without any more informations.
So, do you have any idea how can I make it works ?
Thanks you for your time !
When running application using mvn spring-boot:run you can attach debugger like this:
mvn spring-boot:run -Dspring-boot.run.jvmArguments="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=*:8000"
By providing spring-boot.run.jvmArguments system property.
Alternatively, you can build application first and then run it using the following command:
java -jar app.jar -Dagentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:8000
When you provide debugger configuration using MAVEN_OPTS, the debugger is attached to the Maven process, however, the application is running in a separate Java process without a debugger attached.
The easiest way to debug a Spring Boot application from an IDE is to not use Maven at all but instead directly launch the main method from the #SpringBootApplication class.
As a third solution, I have installed Spring Tools 4 on the Eclipse Marketplace.
It makes me able to launch a #SpringBootApplication in debug mode, like Leif Astrand said, but with an IHM (Boot Dashboard).
Another solution is described here:
https://vaadin.com/forum/thread/17519592/debug-with-intellij
This solution also helped me get around the problem of connecting the remote debugger, but breakpoints not being reached (see my comment above).
You can add a JVM arg to the config params of the plugin, like this:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<!-- my edits start -->
<configuration>
<jvmArguments>
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000
</jvmArguments>
</configuration>
<!-- my edits end -->
</plugin>

Running Spring Boot "context loads" test in maven causes OutOfMemoryError

I have a multi-module Maven project with two modules being Spring Boot applications. Each of them has a simple test that the Spring application context loads successfully (my tests are very similar to this one). I run this tests with the following command in project root:
mvn -P IntegrationTests clean test
During context initialization things go out of my control, the application "eats" memory (heap size grows quickly to 4 gigabytes) and then the context fails to start with java.lang.OutOfMemoryError: PermGen space error (yes, I run it in Java 7).
Monitoring task manager during testing I noticed that maven spawns two new processes that have something to do with surefire plugin. I have no idea where it comes from, because I don't add the surefire plugin in my pom.xml.
Previously when encountered the same error somewhere I specified VM options (-Xmx256m -Xms128m -XX:MaxPermSize=256m -XX:PermSize=128m for example) and the problem was solved.
This time I tried to
set MAVEN_OPTS environment variable
set VM options (when running mvn test in IntelliJ IDEA) - it affected main java process but not its children
add -Drun.jvmArguments="..." in command line
but the problem persists.
Please help me to fight the OutOfMemoryError in tests.
Add Surefire plugin explicitly to module-specific pom.xml and configure VM options there. I like this solution because this way VM options are
passed to the spawned surefire processes (which should solve your problem)
affect only test application builds
shared between developers in your team
configurable independently for every module
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-Xmx256m -Xms128m -XX:MaxPermSize=256m -XX:PermSize=128m</argLine>
</configuration>
</plugin>
<!-- your other plugins go here -->
</plugins>
</build>

Mule Munit test with maven : mule-domain-config.xml file not found?

Mule Munit test with maven : mule-domain-config.xml file not found
I am getting an error while trying to run Munit using Maven. It's a domain project and my Munit test cases are available in mule projects. when I ran maven, it is giving me file not found exception (mule-domain-config.xml). I tried all possible ways by checking in this site but of no luck. Below is the stack trace.
INFO 2017-01-06 01:15:01,226 [main] org.mule.munit.runner.MuleContextManager: Loading mule-app.properties ... INFO 2017-01-06 01:15:01,319 [main] org.mule.munit.runner.domain.MunitDomainContextBuilder: Loading mule-deploy.properties ... java.lang.RuntimeException: org.mule.api.config.ConfigurationException: mule-domain-config.xml (java.io.FileNotFoundException)
i already checked my pom configuration and i used an AnypointStudio.exe clean also.
Please add domain project dependency with test scope to your pom file like
<dependency>
<groupId>domain project group id</groupId>
<artifactId>domain project name</artifactId>
<version>domain version</version>
<scope>test</scope>
</dependency>
Hope this helps.
Can you check if you are loading your mule domain config xml in your munit settings.
For instance...
<munit:config name="munit" doc:name="MUnit configuration"/>
<spring:beans>
<spring:import resource="classpath:my-munit-test.xml"/>
<spring:import resource="mule-domain-config.xml"/>
</spring:beans>
<munit:test name="tesad-test-suite-FlowTest"...
Check the spring:import lines
Also, as #anupambhusari said , please check that you are importing your domain config properly
I am not sure if you found a solution of this problem, but I got this working by adding Mule domain project in build path, from Configure Build Path option.

Maven Spring project not executing due to ClassNotFoundException

I'm working on a Spring/Maven tutorial to test splitting up Spring bean definitions between multiple files. My issue is that mvn -X -e exec:java shows build failure, but running as a Java application within STS shows the proper output.
My project is set up as com.jason.basicOne, with com.jason as the groupId and basicOne as the artifactId. The only compiler warning within STS is due to an imported class not being used.
Things I've done:
Used the <import /> tags to reference the secondary files, and enabled the usage within Spring Properties.
Refreshed the project several times via mvn clean and mvn package
But the ClassNotFoundException still shows up for com.jason.App. What other things should I look for?
EDIT
I found the error. In my pom.xml, I use the exec-maven-plugin to enable execution via mvn exec:java on the command line. The plugin definition was set to a previous project, from which I cut and pasted to the new project. The updated package name was not included, which is why the project executed via STS and not command line.
Your example compiles correctly if you
1. check com.jason.App class. Should it read com.jason.basicOne.App instead?
2. see if your pom.xml has right spring jars.
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>3.0.3.RELEASE</version>
</dependency>
Make sure your ".m2/" does not have an old spring which is referenced by your pom.xml

Resources