Storm Crawler with Java 11

谁说我不能喝 提交于 2021-01-28 20:18:00

问题


Trying to update the Java version from Java 8 to Java 11 to compile and run the StromCrawler.

My question- Does Storm Crawler is supported on Java 11?.

As we I update the java version in my POM and build the project I was successfully build the project but when I tried to run the project I am getting the Following error while running the InjectorTopology-

560  [main] INFO  c.a.h.c.InjectorTopology - ####### The Injector Topology Started #######
563  [main] INFO  c.a.h.c.u.PropertyFileReader - Enter Load Properties File
564  [main] INFO  c.a.h.c.u.PropertyFileReader - Exit Load Properties File
Exception in thread "main" java.lang.ExceptionInInitializerError
        at java.base/java.lang.J9VMInternals.ensureError(J9VMInternals.java:186)
        at java.base/java.lang.J9VMInternals.recordInitializationFailure(J9VMInternals.java:175)
        at clojure.lang.Namespace.<init>(Namespace.java:34)
        at clojure.lang.Namespace.findOrCreate(Namespace.java:176)
        at clojure.lang.Var.internPrivate(Var.java:151)
        at org.apache.storm.LocalCluster.<clinit>(Unknown Source)
        at com.digitalpebble.stormcrawler.ConfigurableTopology.submit(ConfigurableTopology.java:75)
        at com.vinn.hel.crawler.InjectorTopology.run(InjectorTopology.java:57)
        at com.digitalpebble.stormcrawler.ConfigurableTopology.start(ConfigurableTopology.java:50)
        at com.vinn.hel.crawler.InjectorTopology.main(InjectorTopology.java:40)
Caused by: java.lang.IllegalArgumentException: Must hint overloaded method: toArray, compiling:(clojure/gvec.clj:131:1)
        at clojure.lang.Compiler.analyzeSeq(Compiler.java:6730)
        at clojure.lang.Compiler.analyze(Compiler.java:6524)
        at clojure.lang.Compiler.analyze(Compiler.java:6485)
        at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:5861)
        at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:6179)
        at clojure.lang.Compiler.analyzeSeq(Compiler.java:6723)
        at clojure.lang.Compiler.analyze(Compiler.java:6524)
        at clojure.lang.Compiler.analyze(Compiler.java:6485)
        at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:5861)
        at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5296)
        at clojure.lang.Compiler$FnExpr.parse(Compiler.java:3925)
        at clojure.lang.Compiler.analyzeSeq(Compiler.java:6721)
        at clojure.lang.Compiler.analyze(Compiler.java:6524)
        at clojure.lang.Compiler.eval(Compiler.java:6779)
        at clojure.lang.Compiler.load(Compiler.java:7227)
        at clojure.lang.RT.loadResourceScript(RT.java:371)
        at clojure.lang.RT.loadResourceScript(RT.java:362)
        at clojure.lang.RT.load(RT.java:446)
        at clojure.lang.RT.load(RT.java:412)
        at clojure.core$load$fn__1621.invoke(core.clj:5866)
        at clojure.core$load.doInvoke(core.clj:5865)
        at clojure.lang.RestFn.invoke(RestFn.java:408)
        at clojure.core$eval2892.invoke(core.clj:6497)
        at clojure.lang.Compiler.eval(Compiler.java:6782)
        at clojure.lang.Compiler.load(Compiler.java:7227)
        at clojure.lang.RT.loadResourceScript(RT.java:371)
        at clojure.lang.RT.loadResourceScript(RT.java:362)
        at clojure.lang.RT.load(RT.java:446)
        at clojure.lang.RT.load(RT.java:412)
        at clojure.lang.RT.doInit(RT.java:454)
        at clojure.lang.RT.<clinit>(RT.java:330)
        ... 8 more
Caused by: java.lang.IllegalArgumentException: Must hint overloaded method: toArray
        at clojure.lang.Compiler$NewInstanceMethod.parse(Compiler.java:8050)
        at clojure.lang.Compiler$NewInstanceExpr.build(Compiler.java:7642)
        at clojure.lang.Compiler$NewInstanceExpr$DeftypeParser.parse(Compiler.java:7523)
        at clojure.lang.Compiler.analyzeSeq(Compiler.java:6723)
        ... 38 more```

回答1:


To add to Joachim's comment, it looks like Clojure 1.8 is needed in order to run Java 11. Storm 1.2.3 comes with Clojure 1.7.

You could override the dependency in the POM of your StormCrawler project but this will work only in local mode. In deployed mode, you'd also need to change the dependency where Storm is installed.

It might be easier to use StormCrawler 2.x and the latest Apache Storm, which does not depend on Clojure at all or simply run it with Java 8.



来源:https://stackoverflow.com/questions/64912045/storm-crawler-with-java-11

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!