Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jmeter.JMeter: Error in NonGUIDriver java.lang.NullPointerException #113

Closed
Thrilochana opened this issue Jan 28, 2015 · 20 comments
Closed
Labels

Comments

@Thrilochana
Copy link

I am trying to execute Jmeter websocket sampler (https://github.com/maciejzaleski/JMeter-WebSocketSampler) tests. I get the following error. Could anyone please help?

2015/01/28 15:35:23 ERROR - jmeter.save.SaveService: Conversion error com.thoughtworks.xstream.converters.ConversionException: JMeter.plugins.functional.samplers.websocket.WebSocketSampler : JMeter.plugins.functional.samplers.websocket.WebSocketSampler
---- Debugging information ----
message : JMeter.plugins.functional.samplers.websocket.WebSocketSampler
cause-exception : com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message : JMeter.plugins.functional.samplers.websocket.WebSocketSampler
class : org.apache.jorphan.collections.ListedHashTree
required-type : org.apache.jorphan.collections.ListedHashTree
converter-type : org.apache.jmeter.save.converters.HashTreeConverter
path : /jmeterTestPlan/hashTree/hashTree/hashTree/JMeter.plugins.functional.samplers.websocket.WebSocketSampler
line number : 29
------------------------------- : JMeter.plugins.functional.samplers.websocket.WebSocketSampler : JMeter.plugins.functional.samplers.websocket.WebSocketSampler
---- Debugging information ----
message : JMeter.plugins.functional.samplers.websocket.WebSocketSampler
cause-exception : com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message : JMeter.plugins.functional.samplers.websocket.WebSocketSampler
class : org.apache.jorphan.collections.ListedHashTree
required-type : org.apache.jorphan.collections.ListedHashTree
converter-type : org.apache.jmeter.save.converters.HashTreeConverter
path : /jmeterTestPlan/hashTree/hashTree/hashTree/JMeter.plugins.functional.samplers.websocket.WebSocketSampler

line number : 29

message : JMeter.plugins.functional.samplers.websocket.WebSocketSampler : JMeter.plugins.functional.samplers.websocket.WebSocketSampler
---- Debugging information ----
message : JMeter.plugins.functional.samplers.websocket.WebSocketSampler
cause-exception : com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message : JMeter.plugins.functional.samplers.websocket.WebSocketSampler
class : org.apache.jorphan.collections.ListedHashTree
required-type : org.apache.jorphan.collections.ListedHashTree
converter-type : org.apache.jmeter.save.converters.HashTreeConverter
path : /jmeterTestPlan/hashTree/hashTree/hashTree/JMeter.plugins.functional.samplers.websocket.WebSocketSampler

line number : 29

cause-exception : com.thoughtworks.xstream.converters.ConversionException
cause-message : JMeter.plugins.functional.samplers.websocket.WebSocketSampler : JMeter.plugins.functional.samplers.websocket.WebSocketSampler
first-jmeter-class : org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:65)
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/JMeter.plugins.functional.samplers.websocket.WebSocketSampler
line number : 29

version : 2.11 r1554548

2015/01/28 15:35:23 ERROR - jmeter.JMeter: Error in NonGUIDriver java.lang.NullPointerException
at org.apache.jmeter.gui.tree.JMeterTreeModel.addSubTree(JMeterTreeModel.java:92)
at org.apache.jmeter.JMeter.runNonGui(JMeter.java:754)
at org.apache.jmeter.JMeter.startNonGui(JMeter.java:732)
at org.apache.jmeter.JMeter.start(JMeter.java:390)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.jmeter.NewDriver.main(NewDriver.java:259)

@Ardesco
Copy link
Contributor

Ardesco commented Jan 28, 2015

How are you running it?

Sounds like a duplicate of #97

@Thrilochana
Copy link
Author

I am running from mvn(mvn verify). Tests are created using websocket sampler(this is a plugin), is this an issue?

@Thrilochana
Copy link
Author

I checked the issue 97, but it sounded different than this. I am trying to run a sample Jmeter test file(jmx file) created using websocket sampler.

I created tests from HTTP sampler and ran, this works fine.

Having issues in running tests created by websocket sampler. Do we have to provide any parameters in the POM if we are using customized plugins for jmeter? Please suggest

here is the pom.xml
pom_jmeter_maven

@Ardesco
Copy link
Contributor

Ardesco commented Jan 29, 2015

Yes you need to add them as a dependency for the plugin and then if you want them copied into the /lib/ext directory you need to specify this in your configuration.

Have a look at https://github.com/jmeter-maven-plugin/jmeter-maven-plugin/wiki/Adding%20Additional%20Libraries%20To%20The%20Classpath

jmeter-plugins used to have a transitive dependency issue that could affect you if you use maven 2, I don't know if they have fixed it yet or not.

@Thrilochana
Copy link
Author

Jmeter plugins does not contain the websocket sampler plugin(https://github.com/maciejzaleski/JMeter-WebSocketSampler). What should we do in this case?

I have added websocket jmeter plugin and dependencies to target\jmeter\lib\ext

@Ardesco
Copy link
Contributor

Ardesco commented Jan 29, 2015

then you will need to specify the maven dependency for WebSocketSampler. Use the documentation above as an example of the information required, just replace jmeter plugins artefact information with WebSocketSampler artefact information

@Thrilochana
Copy link
Author

Thank you so much Ardesco. I am able to run my tests

@Ardesco
Copy link
Contributor

Ardesco commented Jan 29, 2015

Excellent :)

@rpagadala
Copy link

Hi All,

Even though after I have added the kg.apc plugin and dependency in the pom.xml .still getting the NoNGUIDriver issue through the mvn

See the attached jmx file.I am using JMter Latest version 2.13.

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.cc.rest.perf</groupId>
    <artifactId>cc-rest-perf</artifactId>
    <version>0.0.1-SNAPSHOT</version>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.14.1</version>
            </plugin>
            <plugin>
                <groupId>com.lazerycode.jmeter</groupId>
                <artifactId>jmeter-maven-plugin</artifactId>
                <version>1.10.1</version>
                <executions>
                    <execution>
                        <id>jmeter-tests</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>jmeter</goal>
                        </goals>
                        <configuration>
                            <jmeterPlugins>
                                <plugin>
                                    <groupId>kg.apc</groupId>
                                    <artifactId>jmeter-plugins</artifactId>
                                </plugin>
                            </jmeterPlugins>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
        </dependency>

        <!--<dependency>
        <groupId>org.apache.jmeter</groupId>
        <artifactId>ApacheJMeter_http</artifactId>
        <version>2.13</version>
        </dependency>

        <dependency>
        <groupId>org.apache.jmeter</groupId>
        <artifactId>ApacheJMeter_components</artifactId>
        <version>2.13</version>
        </dependency>

        <dependency>
        <groupId>org.apache.jmeter</groupId>
        <artifactId>ApacheJMeter_functions</artifactId>
        <version>2.13</version>
    </dependency>

        <dependency>
        <groupId>org.apache.jmeter</groupId>
        <artifactId>ApacheJMeter_config</artifactId>
        <version>2.13</version>
    </dependency>

        <dependency>
        <groupId>org.apache.jmeter</groupId>
        <artifactId>ApacheJMeter_java</artifactId>
        <version>2.13</version>
    </dependency>

        <dependency>
        <groupId>org.apache.jmeter</groupId>
        <artifactId>ApacheJMeter_jdbc</artifactId>
        <version>2.13</version>
    </dependency>

        <dependency>
        <groupId>org.apache.jmeter</groupId>
        <artifactId>ApacheJMeter_jms</artifactId>
        <version>2.13</version>
    </dependency>

        <dependency>
        <groupId>org.apache.jmeter</groupId>
        <artifactId>ApacheJMeter_junit</artifactId>
        <version>2.13</version>
    </dependency>

        <dependency>
        <groupId>org.apache.jmeter</groupId>
        <artifactId>ApacheJMeter_ldap</artifactId>
        <version>2.13</version>
    </dependency>

    <dependency>
        <groupId>org.apache.jmeter</groupId>
        <artifactId>ApacheJMeter_mail</artifactId>
        <version>2.13</version>
    </dependency>

    <dependency>
        <groupId>org.apache.jmeter</groupId>
        <artifactId>ApacheJMeter_monitors</artifactId>
        <version>2.13</version>
    </dependency>

    <dependency>
        <groupId>org.apache.jmeter</groupId>
        <artifactId>ApacheJMeter_report</artifactId>
        <version>2.12</version>
    </dependency>

    <dependency>
        <groupId>org.apache.jmeter</groupId>
        <artifactId>ApacheJMeter_tcp</artifactId>
        <version>2.13</version>
    </dependency>

        <dependency>
        <groupId>org.apache.jmeter</groupId>
        <artifactId>ApacheJMeter_core</artifactId>
        <version>2.13</version>
    </dependency>-->

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-pool2</artifactId>
            <version>2.4.1</version>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-math3</artifactId>
            <version>3.4.1</version>
        </dependency>

        <dependency>
            <groupId>kg.apc</groupId>
            <artifactId>jmeter-plugins</artifactId>
            <version>1.0.0</version>
        </dependency>

    </dependencies>
    <name>cc-rest-perf</name>
</project>

It's a roadblock for me.!

Please help me!

Thanks,
Raj

usedLaterJMterversion.txt

@rpagadala
Copy link

image

image

Thanks,
Raj

@Ardesco
Copy link
Contributor

Ardesco commented Dec 12, 2015

Please read this again:

https://github.com/jmeter-maven-plugin/jmeter-maven-plugin/wiki/Adding%20Additional%20Libraries%20To%20The%20Classpath

You need to add the dependency to the plugin, you cant just add it as a general dependency in your POM. All the general dependencies you have added to your POM look to be redundant.

@rpagadala
Copy link

Hi Mark,

Exactly I did the same thing shows in the link which you have provided(2nd one).

I have attached the JMX file, Error file & POM file and also I have attached the bin & lib screenshots from the target folder which generates after mvn install

Please guide me where I am missing.

error.txt
JMXfile.txt
pom.txt
bin.pdf
lib-sc1.pdf

Thanks,
Rajani

@afranken
Copy link
Contributor

Hi Rajani,
I'm afraid you did not follow the instructions.
Just as Mark wrote, you have to declare the dependency for the jmeter-maven-plugin, not in the dependencies element of the POM.
Look at the description again, please.
Cheers,
Arne

@Ardesco
Copy link
Contributor

Ardesco commented Dec 13, 2015

Or in other words copy/paste this from the wiki:

+---+
<project>
    [...]
        <build>
            <plugins>
                <plugin>
                    <groupId>com.lazerycode.jmeter</groupId>
                    <artifactId>jmeter-maven-plugin</artifactId>
                    <version>1.10.1</version>
                    <executions>
                        <execution>
                            <id>jmeter-tests</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>jmeter</goal>
                            </goals>
                            <configuration>
                                <jmeterPlugins>
                                    <plugin>
                                        <groupId>kg.apc</groupId>
                                        <artifactId>jmeter-plugins</artifactId>
                                    </plugin>
                                </jmeterPlugins>
                            </configuration>
                        </execution>
                    </executions>
                    <dependencies>
                        <dependency>
                            <groupId>kg.apc</groupId>
                            <artifactId>jmeter-plugins</artifactId>
                            <version>1.0.0</version>
                        </dependency>
                    </dependencies>
                </plugin>
            </plugins>
        </build>
    [...]
</project>
+---+

@rpagadala
Copy link

Hi Mark & Arne,

Even though POM configured correctly when I goggled it seems plug- in/mvn 2 issue. I saw your response in the following links.
http://stackoverflow.com/questions/32343437/error-in-nonguidriver-conversionexception-com-atlantbh-jmeter-plugins-jsonutils

#92

I couldn't find solution any where nor I even did not see any examples who have tried with the Stepping Thread Group .I don't know what else to do where to go.

I have tried the same JMX with normal Thread Group executed successfully, If I use Stepping Thread Group throws error. Error is specific to the Stepping Thread Group

[debug] JMeter is called with the following command line arguments: -n -t C:\gitrepository\cc-rest-perf\src\test\jmeter\CC_REST.jmx -l C:\gitrepository\cc-rest-perf\target\jmeter\results\20151213-CC_R
EST.jtl -d C:\gitrepository\cc-rest-perf\target\jmeter -j C:\gitrepository\cc-rest-perf\target\jmeter\logs\CC_REST.jmx.log
[info] Executing test: CC_REST.jmx
[debug] Error in NonGUIDriver java.lang.IllegalArgumentException: Problem loading XML from:'C:\gitrepository\cc-rest-perf\src\test\jmeter\CC_REST.jmx', conversion error com.thoughtworks.xstream.conver
ters.ConversionException: kg.apc.jmeter.threads.SteppingThreadGroup : kg.apc.jmeter.threads.SteppingThreadGroup
[debug] ---- Debugging information ----
[debug] message : kg.apc.jmeter.threads.SteppingThreadGroup
[debug] cause-exception : com.thoughtworks.xstream.mapper.CannotResolveClassException
[debug] cause-message : kg.apc.jmeter.threads.SteppingThreadGroup
[debug] class : org.apache.jorphan.collections.ListedHashTree
[debug] required-type : org.apache.jorphan.collections.ListedHashTree
[debug] converter-type : org.apache.jmeter.save.converters.HashTreeConverter
[debug] path : /jmeterTestPlan/hashTree/hashTree/kg.apc.jmeter.threads.SteppingThreadGroup
[debug] line number : 14
[debug] ------------------------------- : kg.apc.jmeter.threads.SteppingThreadGroup : kg.apc.jmeter.threads.SteppingThreadGroup
[debug] ---- Debugging information ----
[debug] message : kg.apc.jmeter.threads.SteppingThreadGroup
[debug] cause-exception : com.thoughtworks.xstream.mapper.CannotResolveClassException
[debug] cause-message : kg.apc.jmeter.threads.SteppingThreadGroup
[debug] class : org.apache.jorphan.collections.ListedHashTree
[debug] required-type : org.apache.jorphan.collections.ListedHashTree
[debug] converter-type : org.apache.jmeter.save.converters.HashTreeConverter
[debug] path : /jmeterTestPlan/hashTree/hashTree/kg.apc.jmeter.threads.SteppingThreadGroup
[debug] line number : 14
[debug] -------------------------------
[debug] message : kg.apc.jmeter.threads.SteppingThreadGroup : kg.apc.jmeter.threads.SteppingThreadGroup
[debug] ---- Debugging information ----
[debug] message : kg.apc.jmeter.threads.SteppingThreadGroup
[debug] cause-exception : com.thoughtworks.xstream.mapper.CannotResolveClassException
[debug] cause-message : kg.apc.jmeter.threads.SteppingThreadGroup
[debug] class : org.apache.jorphan.collections.ListedHashTree
[debug] required-type : org.apache.jorphan.collections.ListedHashTree
[debug] converter-type : org.apache.jmeter.save.converters.HashTreeConverter
[debug] path : /jmeterTestPlan/hashTree/hashTree/kg.apc.jmeter.threads.SteppingThreadGroup
[debug] line number : 14
[debug] -------------------------------
[debug] cause-exception : com.thoughtworks.xstream.converters.ConversionException
[debug] cause-message : kg.apc.jmeter.threads.SteppingThreadGroup : kg.apc.jmeter.threads.SteppingThreadGroup
[debug] first-jmeter-class : org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:67)
[debug] class : org.apache.jmeter.save.ScriptWrapper
[debug] required-type : org.apache.jorphan.collections.ListedHashTree
[debug] converter-type : org.apache.jmeter.save.ScriptWrapperConverter
[debug] path : /jmeterTestPlan/hashTree/hashTree/kg.apc.jmeter.threads.SteppingThreadGroup
[debug] line number : 14

Thanks,
Rajani

@rpagadala
Copy link

Where Can I find the Stepping Thread Group Project Repository in the Githiub

@rpagadala
Copy link

When I looked at top of the error I see this

[WARNING] The POM for kg.apc:perfmon:jar:1.0.0 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details

#92
And I have seen response from Ardesco "problem with the jmeter-plugins artifact "

There is no solution?
Could some one please guide me what to do next?

Thanks,
Rajani

@afranken
Copy link
Contributor

To make sure that the solution is clear:
This is a usage problem which can be solved by following the plugin documentation:
https://github.com/jmeter-maven-plugin/jmeter-maven-plugin/wiki/Adding%20Additional%20Libraries%20To%20The%20Classpath

@rpagadala
Copy link

Thanks to Mark, Frank & Ardesco!

I have realized where I did a mistake!

Thanks,
Raj

@sripappula
Copy link

hi raj,

I'm having the same issue, can you provide me the solution which resolved your problem?

thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants