storm localcluster 无法加载 Bolt
storm localcluster could not load Bolt
我正在尝试调试非常简单的拓扑结构(1 个 spout 1 个 bolt)
public class JoinerTopologyTest {
public static void main(String[] args) throws IOException {
Config conf = new Config();
conf.setNumWorkers(5);
conf.setDebug(true);
TopologyBuilder builder = new TopologyBuilder();
builder.setSpout("SPOUT-1",new MySpout(),1);
builder.setBolt("BOLT-1",new Bolt1(), 3)
.shuffleGrouping("SPOUT-1");
//builder.setBolt("JOINER", new JoinerBolt(),1)
// .shuffleGrouping("BOLT-1")
// .shuffleGrouping("SPOUT-1","str1");
final LocalCluster cluster = new LocalCluster();
cluster.submitTopology("TOPO1",conf,builder.createTopology());
System.in.read();
cluster.shutdown();
}
}
但是当我从 InteliJ IDEA 运行 它时,我得到:
java.lang.RuntimeException: java.lang.ClassNotFoundException: com.pixonic.zephyr.compaction.tests.Bolt1
at org.apache.storm.utils.Utils.javaDeserialize(Utils.java:181) ~[storm-core-1.0.1.jar:1.0.1]
at org.apache.storm.utils.Utils.getSetComponentObject(Utils.java:430) ~[storm-core-1.0.1.jar:1.0.1]
和
[Thread-15] ERROR o.a.s.d.worker - Error on initialization of server mk-worker
java.lang.RuntimeException: java.lang.ClassNotFoundException: org.apache.storm.daemon.acker
at org.apache.storm.utils.Utils.javaDeserialize(Utils.java:181) ~[storm-core-1.0.1.jar:1.0.1]
at org.apache.storm.utils.Utils.getSetComponentObject(Utils.java:430) ~[storm-core-1.0.1.jar:1.0.1]
但相同的拓扑结构 运行 在集群模式下运行良好。
PS 在我的 pom.xml 调试模式下我有:
<dependency>
<groupId>org.apache.storm</groupId>
<artifactId>storm-core</artifactId>
<version>1.0.1</version>
<scope>compile</scope>
</dependency>
编辑
重现错误的项目:https://github.com/holinov/storm-101-localcluster/tree/master
按照评论中的要求张贴在这里
已解决
要运行或在IDEA中调试Topology不要使用maven 运行ner。
只需右键单击 topology class 并选择 Debug->JoinerTopologyTest...main() 没有 MVN 图标
我正在尝试调试非常简单的拓扑结构(1 个 spout 1 个 bolt)
public class JoinerTopologyTest {
public static void main(String[] args) throws IOException {
Config conf = new Config();
conf.setNumWorkers(5);
conf.setDebug(true);
TopologyBuilder builder = new TopologyBuilder();
builder.setSpout("SPOUT-1",new MySpout(),1);
builder.setBolt("BOLT-1",new Bolt1(), 3)
.shuffleGrouping("SPOUT-1");
//builder.setBolt("JOINER", new JoinerBolt(),1)
// .shuffleGrouping("BOLT-1")
// .shuffleGrouping("SPOUT-1","str1");
final LocalCluster cluster = new LocalCluster();
cluster.submitTopology("TOPO1",conf,builder.createTopology());
System.in.read();
cluster.shutdown();
}
}
但是当我从 InteliJ IDEA 运行 它时,我得到:
java.lang.RuntimeException: java.lang.ClassNotFoundException: com.pixonic.zephyr.compaction.tests.Bolt1 at org.apache.storm.utils.Utils.javaDeserialize(Utils.java:181) ~[storm-core-1.0.1.jar:1.0.1] at org.apache.storm.utils.Utils.getSetComponentObject(Utils.java:430) ~[storm-core-1.0.1.jar:1.0.1]
和
[Thread-15] ERROR o.a.s.d.worker - Error on initialization of server mk-worker java.lang.RuntimeException: java.lang.ClassNotFoundException: org.apache.storm.daemon.acker at org.apache.storm.utils.Utils.javaDeserialize(Utils.java:181) ~[storm-core-1.0.1.jar:1.0.1] at org.apache.storm.utils.Utils.getSetComponentObject(Utils.java:430) ~[storm-core-1.0.1.jar:1.0.1]
但相同的拓扑结构 运行 在集群模式下运行良好。 PS 在我的 pom.xml 调试模式下我有:
<dependency> <groupId>org.apache.storm</groupId> <artifactId>storm-core</artifactId> <version>1.0.1</version> <scope>compile</scope> </dependency>
编辑
重现错误的项目:https://github.com/holinov/storm-101-localcluster/tree/master
按照评论中的要求张贴在这里
已解决
要运行或在IDEA中调试Topology不要使用maven 运行ner。 只需右键单击 topology class 并选择 Debug->JoinerTopologyTest...main() 没有 MVN 图标