无法使用kafka-storm向apache storm提交拓扑(Unable to submit topology to apache storm using kafka-storm)
将我的拓扑结构提交给Apache Storm(版本0.10.0.2.4.0.0-169)时,我遇到了一个错误,它使用了来自storm-kafka的Kafka spout。 我正在使用github的最新版本的storm-kafka,并且正在运行kafka 0.9.0.2.4。
我可以使用maven下载的jar文件为storm-core和storm-kafka运行这个拓扑的相当普通版本,但是我需要对spout类进行更改,所以我必须从源代码下载并自己构建它们,它编译在我的maven中的ubuntu dev环境,但是在将拓扑提交到storm时我收到错误。
“找到了多个defaults.yaml资源。您可能正在使用拓扑jar构建Storm jar”
我假设这是因为我在我的maven依赖项中包含了storm-core(我从源代码编译的本地版本(并添加到我的本地maven资源库),因为在storm-kafka中需要它,并且从mvn中提取的版本缺少所需的类通过最新版本的storm-kafka)但是,如果我将storm-core设置为pom.xml中提供的,我在提交时会收到以下错误 -
“java.lang.class.NoClassDefFoundError:org / apache / storm / spout / scheme”
我假设是因为它试图使用一些包含缺少最新文件的storm-core版本。
我似乎陷入了一个循环,为了编译最新版本的storm-kafka,我需要最新版本的storm-core,需要从源代码自编译,但我似乎无法将其部署到服务器没有造成冲突。
我是否需要在风暴服务器上更新该jar? 我担心的是,我最终需要更新它的依赖项等。
下面是我的pom.xml文件
<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.automatedintelligence.datastorm</groupId> <artifactId>DataStorm</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>jar</packaging> <name>DataStorm</name> <url>https://github.com/markmcgookin/DataStorm</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <repositories> <repository> <id>local-maven-repo</id> <url>file:///${project.basedir}/src/main/java/dependency/repo</url> </repository> <repository> <id>central</id> <url>http://central.maven.org/maven2/</url> </repository> <repository> <id>github-releases</id> <url>http://oss.sonatype.org/content/repositories/github-releases/</url> </repository> <repository> <id>mvnrepository</id> <url>http://mvnrepository.com/</url> </repository> <repository> <id>clojars.org</id> <url>http://clojars.org/repo</url> </repository> <repository> <id>twitter4j</id> <url>http://twitter4j.org/maven2</url> </repository> </repositories> <dependencies> <dependency> <groupId>com.googlecode.json-simple</groupId> <artifactId>json-simple</artifactId> <version>1.1</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-collections4</artifactId> <version>4.0</version> </dependency> <dependency> <groupId>org.apache.hbase</groupId> <artifactId>hbase-client</artifactId> <version>1.0.0</version> <exclusions> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> </exclusion> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> </exclusion> <exclusion> <groupId>log4j</groupId> <artifactId>log4j</artifactId> </exclusion> <exclusion> <groupId>org.slf4j</groupId> <artifactId>log4j-over-slf4j</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-common</artifactId> <version>2.7.2</version> <exclusions> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> </exclusion> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> </exclusion> <exclusion> <groupId>log4j</groupId> <artifactId>log4j</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>storm</groupId> <artifactId>storm</artifactId> <version>0.9.0-rc2</version> <scope>provided</scope> <exclusions> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> </exclusion> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> </exclusion> <exclusion> <groupId>log4j</groupId> <artifactId>log4j</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.apache.kafka</groupId> <artifactId>kafka_2.11</artifactId> <version>0.9.0.0</version> <exclusions> <exclusion> <groupId>org.apache.zookeeper</groupId> <artifactId>zookeeper</artifactId> </exclusion> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> </exclusion> <exclusion> <groupId>log4j</groupId> <artifactId>log4j</artifactId> </exclusion> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.apache.storm</groupId> <artifactId>storm-kafka</artifactId> <version>2.0.0</version> </dependency> <dependency> <groupId>org.apache.storm</groupId> <artifactId>storm-core</artifactId> <version>2.0.0</version> <scope>provided</scope> </dependency> </dependencies> <build> <plugins> <!-- bind the maven-assembly-plugin to the package phase this will create a jar file without the Storm dependencies suitable for deployment to a cluster.--> <plugin> <artifactId>maven-assembly-plugin</artifactId> <configuration> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> <archive> <manifest> <mainClass/> </manifest> </archive> </configuration> <executions> <execution> <id>make-assembly</id> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>com.theoryinpractise</groupId> <artifactId>clojure-maven-plugin</artifactId> <version>1.3.8</version> <extensions>true</extensions> <configuration> <sourceDirectories> <sourceDirectory>src/clj</sourceDirectory> </sourceDirectories> </configuration> <executions> <execution> <id>compile</id> <phase>compile</phase> <goals> <goal>compile</goal> </goals> </execution> <execution> <id>test</id> <phase>test</phase> <goals> <goal>test</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.6</source> <target>1.6</target> <excludes> <exclude>sl4j:log4j:log4j:jar:</exclude> </excludes> </configuration> </plugin> </plugins> </build>
I am getting an error when submitting my topology to Apache Storm (Version 0.10.0.2.4.0.0-169) that utilities a Kafka spout from storm-kafka. I am using the latest version of storm-kafka from github, and am running kafka 0.9.0.2.4.
I can run a fairly vanilla version of this topology by using maven downloaded jar files for storm-core and storm-kafka but I needed to make changes to the spout class so I had to download from source and build them myself, it compiles on my ubuntu dev environment in maven, but I am getting an error when submitting the topology to storm.
"Found multiple defaults.yaml resources. You're probably building the Storm jars with your topology jar"
I assume this is because I am including storm-core in my maven dependencies (a local version I compiled from source (and added to my local maven repository) because it is needed in storm-kafka and the version pulled from mvn is missing classes required by the latest version of storm-kafka) however, if I set the storm-core to provided in pom.xml I get the following error on submission -
"java.lang.class.NoClassDefFoundError: org/apache/storm/spout/scheme"
Which I assume is because it is trying to use some included version of storm-core that lacks some up to date files.
I seem to be stuck in a cycle that, to compile the latest version of storm-kafka I need the latest version of storm-core which needs to be self compiled from source, however I don't seem to be able to deploy this to the server without causing a clash.
Do I need to update that jar on the storm server? My concern here is that I will end up needing to update it's dependencies etc.
Below is my pom.xml file
<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.automatedintelligence.datastorm</groupId> <artifactId>DataStorm</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>jar</packaging> <name>DataStorm</name> <url>https://github.com/markmcgookin/DataStorm</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <repositories> <repository> <id>local-maven-repo</id> <url>file:///${project.basedir}/src/main/java/dependency/repo</url> </repository> <repository> <id>central</id> <url>http://central.maven.org/maven2/</url> </repository> <repository> <id>github-releases</id> <url>http://oss.sonatype.org/content/repositories/github-releases/</url> </repository> <repository> <id>mvnrepository</id> <url>http://mvnrepository.com/</url> </repository> <repository> <id>clojars.org</id> <url>http://clojars.org/repo</url> </repository> <repository> <id>twitter4j</id> <url>http://twitter4j.org/maven2</url> </repository> </repositories> <dependencies> <dependency> <groupId>com.googlecode.json-simple</groupId> <artifactId>json-simple</artifactId> <version>1.1</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-collections4</artifactId> <version>4.0</version> </dependency> <dependency> <groupId>org.apache.hbase</groupId> <artifactId>hbase-client</artifactId> <version>1.0.0</version> <exclusions> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> </exclusion> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> </exclusion> <exclusion> <groupId>log4j</groupId> <artifactId>log4j</artifactId> </exclusion> <exclusion> <groupId>org.slf4j</groupId> <artifactId>log4j-over-slf4j</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-common</artifactId> <version>2.7.2</version> <exclusions> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> </exclusion> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> </exclusion> <exclusion> <groupId>log4j</groupId> <artifactId>log4j</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>storm</groupId> <artifactId>storm</artifactId> <version>0.9.0-rc2</version> <scope>provided</scope> <exclusions> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> </exclusion> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> </exclusion> <exclusion> <groupId>log4j</groupId> <artifactId>log4j</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.apache.kafka</groupId> <artifactId>kafka_2.11</artifactId> <version>0.9.0.0</version> <exclusions> <exclusion> <groupId>org.apache.zookeeper</groupId> <artifactId>zookeeper</artifactId> </exclusion> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> </exclusion> <exclusion> <groupId>log4j</groupId> <artifactId>log4j</artifactId> </exclusion> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.apache.storm</groupId> <artifactId>storm-kafka</artifactId> <version>2.0.0</version> </dependency> <dependency> <groupId>org.apache.storm</groupId> <artifactId>storm-core</artifactId> <version>2.0.0</version> <scope>provided</scope> </dependency> </dependencies> <build> <plugins> <!-- bind the maven-assembly-plugin to the package phase this will create a jar file without the Storm dependencies suitable for deployment to a cluster.--> <plugin> <artifactId>maven-assembly-plugin</artifactId> <configuration> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> <archive> <manifest> <mainClass/> </manifest> </archive> </configuration> <executions> <execution> <id>make-assembly</id> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>com.theoryinpractise</groupId> <artifactId>clojure-maven-plugin</artifactId> <version>1.3.8</version> <extensions>true</extensions> <configuration> <sourceDirectories> <sourceDirectory>src/clj</sourceDirectory> </sourceDirectories> </configuration> <executions> <execution> <id>compile</id> <phase>compile</phase> <goals> <goal>compile</goal> </goals> </execution> <execution> <id>test</id> <phase>test</phase> <goals> <goal>test</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.6</source> <target>1.6</target> <excludes> <exclude>sl4j:log4j:log4j:jar:</exclude> </excludes> </configuration> </plugin> </plugins> </build>
原文:https://stackoverflow.com/questions/36402724
最满意答案
问题是你的
rStr
的值为'table 0 ("classifier"):\r\n'
。 该字符串显然不代表整数。请注意,
rStr
也没有=
,所以你的rStr.rfind('=') + 1
只是0
。 这让我相信你正在使用的字符串不是你想要的字符串。 例如,当你真的只想操作行时,你可能正在尝试解析表的标题。The problem is that your
rStr
has a value of'table 0 ("classifier"):\r\n'
. That string obviously doesn't represent an integer.Note that
rStr
also doesn't have an=
in it so yourrStr.rfind('=') + 1
just comes out to0
. This leads me to believe that the string that you're working with isn't the string that you want. e.g. perhaps you're trying to parse the header of a table when you really only want to operate on the rows.
相关问答
更多-
看起来您在模型上声明了IntegerField ,但数据库中存储了一个空字符串。 也许你可以去清理你的数据库: UPDATE whatever SET int_field = NULL WHERE int_field = ''; Looks like you have an IntegerField declared on your model, but there is an empty string stored in the database. Perhaps you can go clean up ...
-
对于具有基数10 get_prep_value的int(),django无效的文字(django invalid literal for int() with base 10 get_prep_value)[2023-02-05]
我认为您在index.html页面的url模板标记中错误地传递了stage对象而不是stage.pk作为参数。 尝试改变 {% url 'autostages:detail' stage %} 至 {% url 'autostages:detail' stage.pk %} 实际上,当您将stage对象作为参数传递时,您在模型中定义的表示即stage_number被用作参数的值。 S1不是整数导致错误。 I think you have incorrectly passed the stage obje ... -
吉列尔莫·查莫罗和口袋国王都在这里找到了我。 在我的views.py snip中发布的(看似无关的)逻辑块中,有以下代码: if (request.is_ajax()): latest_line_id = request.GET.get('latest_id', '') if latest_line_id == '-1': # Return all lines json_data = serializers.serialize("json", list(reversed(Li ...
-
Django Python:基数为10的int()的文字无效:'arcetina'(Django Python: invalid literal for int() with base 10: 'arcetina')[2023-07-18]
正如错误所示,您正在传递一个字符串来过滤一个整数字段。 (实际上它是一个外键,但它存储为整数ID。) 如果要过滤相关模型中的字段,则需要使用双下划线语法: posts = Post.objects.filter(author__username=components[0]) 另请注意,拥有全局posts是一个非常糟糕的主意,尤其是当您在视图中对其进行变更时。 所有请求都会看到相同的列表; 一旦您按用户对其进行过滤,或将其撤消,下一个请求将会看到已修改的查询集。 您应该删除全局变量并每次从头开始查询Post ... -
python:ValueError:int()的基数为10的无效文字:''(python : ValueError: invalid literal for int() with base 10: ' ')[2022-01-23]
您看到的“空间”似乎是NUL(“\ x00”)。 您的文件有99.9%的可能性以UTF-16,UTF-16LE或UTF-16BE编码。 如果这是一个一次性文件,只需用记事本打开它并保存为“ANSI”,而不是“Unicode”而不是“Unicode bigendian”。 但是,如果您需要按原样处理它,则需要知道/检测编码是什么。 要找出哪个,请执行以下操作: print repr(open("yourfile.txt", "rb").read(20)) 并将输出的srtart与以下内容进行比较: >>> ... -
Python 3,ValueError:基数为10的int()的无效文字:''(Python 3, ValueError: invalid literal for int() with base 10: '')[2023-12-04]
您收到错误的原因是您无法将最后一行''转换为基数为10的整数。 或者,您可以阅读所有这样的行: with open("lab2.txt", "r") as file_: for line in file_: text = line.rstrip() changein = int(text) coinsin = formatplural(changein,"cent") print ("The minimum amount of chan ... -
问题是你的rStr的值为'table 0 ("classifier"):\r\n' 。 该字符串显然不代表整数。 请注意, rStr也没有= ,所以你的rStr.rfind('=') + 1只是0 。 这让我相信你正在使用的字符串不是你想要的字符串。 例如,当你真的只想操作行时,你可能正在尝试解析表的标题。 The problem is that your rStr has a value of 'table 0 ("classifier"):\r\n'. That string obviously doe ...
-
这是Django版本的错误 。 我安装了Django 1.10并且看到了这个错误。 如问题中提到的升级到1.10.8解决了问题。 It's a bug in Django not in raven which is solved in Django 1.10.8, by just upgrading django-1.10 to django-1.10.8 it works fine.
-
如果用户不输入任何内容,换句话说就是空字符串,则不处理 >>> int('') Traceback (most recent call last): File "
", line 1, in int('') ValueError: invalid literal for int() with base 10: '' 您可以使用各种技术更强大地接受来自用户的输入。 You are not handling if the user enters nothing ... -
ValueError:基数为10的int()的无效文字:' - '(Python)(ValueError: invalid literal for int() with base 10: '-' (Python))[2022-05-08]
你对map和列表理解感到困惑 pixels = [map(int, x) for x in array] 在这里,您获取array每个元素,将其命名为x ,然后将函数int应用于x每个元素 。 但是x是一个字符串,它的元素是字符,所以你最终将函数int应用于'-' ,然后是'9' ,然后是'9' ,所以一个...... 你想做的可能就是 pixels = map(int, array) 此外,如果文件的每一行都有多个数字,则应更改 array.append(line) 对于 array.append( ...