我一直在创建风暴拓扑并使用Eclipse进行测试,它正在运行。但是现在我用集群测试它,当我打包jar时它带有这些消息:
............................................... ...................
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Storm.Prova 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ Storm.Prova ---
[INFO] Deleting /home/amnor/Baixades/V0.10.0/workspace/Storm.Prova/target
[INFO]
[INFO] --- maven-resources-plugin:2.3:resources (default-resources) @ Storm.Prova ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/amnor/Baixades/V0.10.0/workspace/Storm.Prova/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.0.2:compile (default-compile) @ Storm.Prova ---
[INFO] Compiling 2 source files to /home/amnor/Baixades/V0.10.0/workspace/Storm.Prova/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.713s
[INFO] Finished at: Mon May 09 11:01:02 CEST 2016
[INFO] Final Memory: 18M/178M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project Storm.Prova: Compilation failure: Compilation failure:
[ERROR] /home/amnor/Baixades/V0.10.0/workspace/Storm.Prova/src/main/java/Storm/practice/Storm/Prova/ProvaTopology.java:[101,28] error: incompatible types
[ERROR]
[ERROR] could not parse error message: required: int
[ERROR] found: Integer
[ERROR] /home/amnor/Baixades/V0.10.0/workspace/Storm.Prova/src/main/java/Storm/practice/Storm/Prova/ProvaTopology.java:108: error: no suitable constructor found for Values(String,String,int,int)
[ERROR] _collector.emit(new Values(tuple.getString(0),tuple.getString(1),z,tam));// id));
[ERROR] ^
[ERROR]
[ERROR] constructor Values.Values() is not applicable
[ERROR] (actual and formal argument lists differ in length)
[ERROR] /home/amnor/Baixades/V0.10.0/workspace/Storm.Prova/src/main/java/Storm/practice/Storm/Prova/ProvaTopology.java:[111,31] error: no suitable constructor found for Values(String,String,int,int)
[ERROR]
[ERROR] constructor Values.Values() is not applicable
[ERROR] (actual and formal argument lists differ in length)
[ERROR] /home/amnor/Baixades/V0.10.0/workspace/Storm.Prova/src/main/java/Storm/practice/Storm/Prova/ProvaTopology.java:[115,30] error: no suitable constructor found for Values(String,String,int,int)
....
............................................... .....................
还有更多,奇怪的是它在Eclipse上运行完美而且没有显示任何编译错误。
任何想法为什么会这样?
谢谢!
这是我的POM文件
<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>Storm.practice</groupId>
<artifactId>Storm.Prova</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Storm.Prova</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.storm</groupId>
<artifactId>storm-core</artifactId>
<version>0.10.0</version>
</dependency>
<dependency>
<groupId>org.apache.storm</groupId>
<artifactId>storm-redis</artifactId>
<version>0.10.0</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies> <build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.4.0</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>Storm.practice.Storm.Prova.ProvaTopology</mainClass>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>Storm.practice.Storm.Prova</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>