tuanhiep / mqttjmeter

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

FutureConnection - pom.xml #10

Closed jamgraham closed 9 years ago

jamgraham commented 9 years ago

Any ideas? I thought the FutureConnection dependency would be compiled into the mqtt.jar that's built with mvn clean install package But that does not appear to be the case.

Please help shed some light on this.

2015/05/07 14:37:25 INFO  - jmeter.engine.StandardJMeterEngine: Running the test! 
2015/05/07 14:37:25 INFO  - jmeter.samplers.SampleEvent: List of sample_variables: [] 
2015/05/07 14:37:25 INFO  - jmeter.gui.util.JMeterMenuBar: setRunning(true,*local*) 
2015/05/07 14:37:25 INFO  - jmeter.engine.StandardJMeterEngine: Starting ThreadGroup: 1 : Thread Group 
2015/05/07 14:37:25 INFO  - jmeter.engine.StandardJMeterEngine: Starting 1 threads for group Thread Group. 
2015/05/07 14:37:25 INFO  - jmeter.engine.StandardJMeterEngine: Thread will continue on error 
2015/05/07 14:37:25 INFO  - jmeter.threads.ThreadGroup: Starting thread group number 1 threads 1 ramp-up 1 perThread 1000.0 delayedStart=false 
2015/05/07 14:37:25 INFO  - jmeter.threads.ThreadGroup: Started thread group number 1 
2015/05/07 14:37:25 INFO  - jmeter.engine.StandardJMeterEngine: All thread groups have been started 
2015/05/07 14:37:25 INFO  - jmeter.threads.JMeterThread: Thread started: Thread Group 1-1 
2015/05/07 14:37:25 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:610)
    at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:998)
    at org.apache.jorphan.collections.HashTree.traverse(HashTree.java:980)
    at org.apache.jmeter.threads.JMeterThread.threadStarted(JMeterThread.java:579)
    at org.apache.jmeter.threads.JMeterThread.initRun(JMeterThread.java:567)
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:257)
    at java.lang.Thread.run(Thread.java:745)

2015/05/07 14:37:25 INFO  - jmeter.threads.JMeterThread: Thread finished: Thread Group 1-1 
2015/05/07 14:37:25 INFO  - jmeter.engine.StandardJMeterEngine: Notifying test listeners of end of test 
2015/05/07 14:37:25 INFO  - jmeter.gui.util.JMeterMenuBar: setRunning(false,*local*) 
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>