tuanhiep / mqttjmeter

This is the plugin for Jmeter to Test MQTT protocol
Apache License 2.0
86 stars 56 forks source link

Class [FutureConnection] not found exception #8

Closed yjp211 closed 9 years ago

yjp211 commented 9 years ago

I got a exception as this:

2015/01/20 14:18:24 ERROR - jmeter.threads.JMeterThread: Test failed! java.lang.NoClassDefFoundError: org/fusesource/mqtt/client/FutureConnection at org.apache.jmeter.protocol.mqtt.client.MqttPublisher.setupTest(MqttPublisher.java:98) at org.apache.jmeter.protocol.mqtt.client.MqttPublisher.setupTest(MqttPublisher.java:79) at org.apache.jmeter.protocol.mqtt.sampler.PublisherSampler.threadStarted(PublisherSampler.java:419) at org.apache.jmeter.threads.JMeterThread$ThreadListenerTraverser.addNode(JMeterThread.java:599) at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:961) at org.apache.jorphan.collections.HashTree.traverse(HashTree.java:946) at org.apache.jmeter.threads.JMeterThread.threadStarted(JMeterThread.java:568) at org.apache.jmeter.threads.JMeterThread.initRun(JMeterThread.java:556) at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:254) at java.lang.Thread.run(Unknown Source)

tuanhiep commented 9 years ago

you missed some libraries

Best Regards,

TRAN Tuan Hiep

Management Suite team Astek Sud Est for Amadeus IT Group SA

http://trantuanhiep.fr/

On Tue, Jan 20, 2015 at 7:33 AM, yjp notifications@github.com wrote:

Closed #8 https://github.com/tuanhiep/mqtt-jmeter/issues/8.

— Reply to this email directly or view it on GitHub https://github.com/tuanhiep/mqtt-jmeter/issues/8#event-221416193.

jamgraham commented 9 years ago

Any advice on how to resolve this error? I'm getting the same.

@tuanhiep / @yjp211

jamgraham commented 9 years ago

Looks like updating the pom.xml with dependencies solved the problem..

<!-- 
 Licensed to the Apache Software Foundation (ASF) under one
 or more contributor license agreements.  See the NOTICE file
 distributed with this work for additional information
 regarding copyright ownership.  The ASF licenses this file
 to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License. 

  Copyright 2014 University Joseph Fourier, LIG Laboratory, ERODS Team

-->
<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>fr.liglab.erods.jmeter.mqtt</groupId>
    <artifactId>mqtt-jmeter</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>Apache JMeter :: MQTT Injector</name>
    <description>MQTT Injector for Apache JMeter</description>

    <properties>
        <jmeter-version>2.10</jmeter-version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.apache.jmeter</groupId>
            <artifactId>ApacheJMeter_core</artifactId>
            <version>${jmeter-version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.jmeter</groupId>
            <artifactId>ApacheJMeter_java</artifactId>
            <version>${jmeter-version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.fusesource.mqtt-client</groupId>
            <artifactId>mqtt-client</artifactId>
            <version>1.4</version>
        </dependency>
    </dependencies>

    <build>
        <finalName>${project.artifactId}</finalName>
        <defaultGoal>install</defaultGoal>
        <plugins>

    <plugin>
                <artifactId>maven-assembly-plugin</artifactId>

                <configuration>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                </configuration>

                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.5.1</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
ZackLee commented 8 years ago

@jamgraham thx! Work for me too!