UnsupportedClassVersionError-AMQPSpout:风暴拓扑未运行(UnsupportedClassVersionError-AMQPSpout: storm topology not running)
在尝试提交风暴拓扑时,
./storm jar /home/winoria1/Desktop/stormtopology.jar com.storm.StormTopology
我得到以下错误 -
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/rapportive/storm/spout/AMQPSpout : Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:643) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:277) at java.net.URLClassLoader.access$000(URLClassLoader.java:73) at java.net.URLClassLoader$1.run(URLClassLoader.java:212) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:205) at java.lang.ClassLoader.loadClass(ClassLoader.java:323) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) at java.lang.ClassLoader.loadClass(ClassLoader.java:268) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:643) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:277) at java.net.URLClassLoader.access$000(URLClassLoader.java:73) at java.net.URLClassLoader$1.run(URLClassLoader.java:212) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:205) at java.lang.ClassLoader.loadClass(ClassLoader.java:323) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) at java.lang.ClassLoader.loadClass(ClassLoader.java:268) at com.winoria.frequest.SuggestionTopology.main(SuggestionTopology.java:28)
我的java版本是
winoria1 @ winoria:〜$ java -version
java version "1.6.0_27" OpenJDK Runtime Environment (IcedTea6 1.12.6) (6b27-1.12.6-1ubuntu0.12.04.4) OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
winoria1 @ winoria:〜$ javac -version
javac 1.6.0_27 winoria1@winoria:~$
请帮助我.....
While trying to submit a storm topology ,
./storm jar /home/winoria1/Desktop/stormtopology.jar com.storm.StormTopology
I am getting following error-
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/rapportive/storm/spout/AMQPSpout : Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:643) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:277) at java.net.URLClassLoader.access$000(URLClassLoader.java:73) at java.net.URLClassLoader$1.run(URLClassLoader.java:212) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:205) at java.lang.ClassLoader.loadClass(ClassLoader.java:323) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) at java.lang.ClassLoader.loadClass(ClassLoader.java:268) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:643) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:277) at java.net.URLClassLoader.access$000(URLClassLoader.java:73) at java.net.URLClassLoader$1.run(URLClassLoader.java:212) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:205) at java.lang.ClassLoader.loadClass(ClassLoader.java:323) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) at java.lang.ClassLoader.loadClass(ClassLoader.java:268) at com.winoria.frequest.SuggestionTopology.main(SuggestionTopology.java:28)
my java version is
winoria1@winoria:~$ java -version
java version "1.6.0_27" OpenJDK Runtime Environment (IcedTea6 1.12.6) (6b27-1.12.6-1ubuntu0.12.04.4) OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
winoria1@winoria:~$ javac -version
javac 1.6.0_27 winoria1@winoria:~$
any one help me please.....
原文:
最满意答案
您可以查看Github上的源代码: XmlReader.cs 。
如下所示,这些方法具有不同的行为:
// Checks that the current node is an element and advances the reader to the next node. public virtual void ReadStartElement() { if (MoveToContent() != XmlNodeType.Element) { throw new XmlException(Res.Xml_InvalidNodeType, this.NodeType.ToString(), this as IXmlLineInfo); } Read(); } // Checks whether the current node is a content (non-whitespace text, CDATA, Element, EndElement, EntityReference // or EndEntity) node. If the node is not a content node, then the method skips ahead to the next content node or // end of file. Skips over nodes of type ProcessingInstruction, DocumentType, Comment, Whitespace and SignificantWhitespace. public virtual XmlNodeType MoveToContent() { do { switch (this.NodeType) { case XmlNodeType.Attribute: MoveToElement(); goto case XmlNodeType.Element; case XmlNodeType.Element: case XmlNodeType.EndElement: case XmlNodeType.CDATA: case XmlNodeType.Text: case XmlNodeType.EntityReference: case XmlNodeType.EndEntity: return this.NodeType; } } while (Read()); return this.NodeType; }
所以
ReadStartElement
方法调用MoveToContent
可以进行多次Read
调用以查找内容节点。 在此之后,ReadStartElement
将读取当前的起始元素。You can check at the source code on Github: XmlReader.cs.
As you can see below, the methods have not the same behavior:
// Checks that the current node is an element and advances the reader to the next node. public virtual void ReadStartElement() { if (MoveToContent() != XmlNodeType.Element) { throw new XmlException(Res.Xml_InvalidNodeType, this.NodeType.ToString(), this as IXmlLineInfo); } Read(); } // Checks whether the current node is a content (non-whitespace text, CDATA, Element, EndElement, EntityReference // or EndEntity) node. If the node is not a content node, then the method skips ahead to the next content node or // end of file. Skips over nodes of type ProcessingInstruction, DocumentType, Comment, Whitespace and SignificantWhitespace. public virtual XmlNodeType MoveToContent() { do { switch (this.NodeType) { case XmlNodeType.Attribute: MoveToElement(); goto case XmlNodeType.Element; case XmlNodeType.Element: case XmlNodeType.EndElement: case XmlNodeType.CDATA: case XmlNodeType.Text: case XmlNodeType.EntityReference: case XmlNodeType.EndEntity: return this.NodeType; } } while (Read()); return this.NodeType; }
So the
ReadStartElement
method, callsMoveToContent
wich can make severalRead
calls in order to find a content node. After this,ReadStartElement
reads the current starting element.
相关问答
更多-
你不需要使用字符串; 你应该能够在子XElement.Load使用XElement.Load : XElement someElement; using(XmlReader stanzaReader = xmlReader.ReadSubtree()) { someElement = XElement.Load(stanzaReader); } 请注意,这不是一个真正的“新”xml阅读器 - 它与外部阅读器密切相关(但受限于一组节点)。 You shouldn't need to work wit ...
-
这是有效的。 对不起,它不是100%通用的,但它可能会给你一个想法: public void ReadXml(System.Xml.XmlReader reader) { ReadAttributes(this, reader); reader.Read(); //advance switch (reader.Name) { case "Record": case "Field": break; default: ...
-
ReadElementContentAsString读取读者并将其推进到下一个元素。 因此,使用Read in while跳过下一个B元素。 而是使用Value属性。 using (XmlReader xmlReader = XmlReader.Create(new StringReader(str))) { while (xmlReader.Read()) { if (xmlReader.NodeType == XmlNodeType.Element && xmlReade ...
-
是的,我相信你确实需要经常匹配它们。 这是因为ReadStartElement和ReadEndElement将XmlReader移动到下一个节点。 但是,他们会检查不同的东西。 这在代码中不必要地添加冗长只是我总是喜欢使用XPathNavigator导航XML的一个原因。 它的便利性简直无与伦比(除非你将它与LINQ进行比较。) Yes, I believe you do need to match them most often. This is because both the ReadStartEle ...
-
XmlReader不断读取(XmlReader read continually)[2022-11-10]
尝试这个: using (XmlReader xmlReader = XmlReader.Create("file.xml")) { while (xmlReader.Read()) { if (xmlReader.ReadToFollowing("SponsorID")) { string sponsorId = xmlReader.ReadElementContentAsString(); // proce ... -
为多个XmlReader.Read()用法重置StreamReader(Reset StreamReader for multiple XmlReader.Read() usages)[2023-06-18]
您不能只更改BaseStream的位置,因为StreamReader正在缓冲底层流中的数据。 它只会StreamReader的行为,没有什么好处会产生。 您应该每次都处理旧的StreamReader并创建一个新的StreamReader 。 You can't just change the position in the BaseStream, because the StreamReader is buffering the data from the underlying stream. It wil ... -
压缩部分看起来很好。 MemoryStream可能不是大型文档的最佳选择,但在更改之前检查您的方案的性能是否正常。 “提取特定元素”部分将不会读取任何内容,因为读取器仅向前,因此在执行该部分时已经读取了所有内容。 您可能想要重新创建阅读器。 For future reference: The code in the Question does not work properly. Passing an XmlReader to a StreamWriter doesn't work as expected. ...
-
在此之前,您必须为“root”调用ReadStartElement 。 reader->ReadStartElement( "root" ); reader->ReadStartElement( "Description" ); 编辑 :读取属性 reader->ReadToFollowing( "Description" ); reader->MoveToFirstAttribute(); String ^ m_sVersion = reader->Value; reader->Mo ...
-
您可以查看Github上的源代码: XmlReader.cs 。 如下所示,这些方法具有不同的行为: // Checks that the current node is an element and advances the reader to the next node. public virtual void ReadStartElement() { if (MoveToContent() != XmlNodeType.Element) { throw new XmlExcep ...
-
ReadElementContentAsString读取元素及其内容。 因此,要么您不应该使用
节点,要么只使用ReadContentAsString 。 XmlReader reader = XmlReader.Create("data.xml", new XmlReaderSettings { IgnoreWhitespace = true }); reader.ReadStartElement("recipe"); // reader.ReadStartElement("name"); - ...