运行jar包时出现java virtual machine launcher Unable to access jarfile:JMZ-DESK.jar 请高手指点...

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了运行jar包时出现java virtual machine launcher Unable to access jarfile:JMZ-DESK.jar 请高手指点...相关的知识,希望对你有一定的参考价值。

workspace\.metadata\.log
看下log吧
有可能是编码问题
参考技术A 这个JAR文件不能运行.

运行jar包时出现异常:Exception in thread "main" java.lang.ExceptionInInitializerError

/usr/local/java/jdk1.8.0_60/bin/java
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/jstorm-2.2.1/wait_deploy/test-jstorm-bolt.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/jstorm-2.2.1/lib/logback-classic-1.0.13.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Exception in thread "main" java.lang.ExceptionInInitializerError
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:264)
        at backtype.storm.config$loading__4958__auto__.invoke(config.clj:17)
        at backtype.storm.config__init.load(Unknown Source)
        at backtype.storm.config__init.<clinit>(Unknown Source)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:348)
        at clojure.lang.RT.loadClassForName(RT.java:2093)
        at clojure.lang.RT.load(RT.java:430)
        at clojure.lang.RT.load(RT.java:411)
        at clojure.core$load$fn__1476.invoke(core.clj:5641)
        at clojure.core$load.doInvoke(core.clj:5640)
        at clojure.lang.RestFn.invoke(RestFn.java:408)
        at clojure.core$load_one.invoke(core.clj:5446)
        at clojure.core$load_lib$fn__1425.invoke(core.clj:5486)
        at clojure.core$load_lib.doInvoke(core.clj:5485)
        at clojure.lang.RestFn.applyTo(RestFn.java:142)
        at clojure.core$apply.invoke(core.clj:626)
        at clojure.core$load_libs.doInvoke(core.clj:5528)
        at clojure.lang.RestFn.applyTo(RestFn.java:137)
        at clojure.core$apply.invoke(core.clj:628)
        at clojure.core$use.doInvoke(core.clj:5618)
        at clojure.lang.RestFn.invoke(RestFn.java:408)
        at backtype.storm.command.config_value$loading__4958__auto__.invoke(config_value.clj:16)
        at backtype.storm.command.config_value__init.load(Unknown Source)
        at backtype.storm.command.config_value__init.<clinit>(Unknown Source)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:348)
        at clojure.lang.RT.loadClassForName(RT.java:2093)
        at clojure.lang.RT.load(RT.java:430)
        at clojure.lang.RT.load(RT.java:411)
        at clojure.core$load$fn__1476.invoke(core.clj:5641)
        at clojure.core$load.doInvoke(core.clj:5640)
        at clojure.lang.RestFn.invoke(RestFn.java:408)
        at clojure.lang.Var.invoke(Var.java:379)
        at backtype.storm.command.config_value.<clinit>(Unknown Source)
Caused by: java.lang.RuntimeException: java.io.IOException: Found multiple defaults.yaml resources. You‘re probably bundling the Storm jars with your topology jar. [jar:file:/usr/local/jstorm-2.2.1/jstorm-core-2.2.1.jar!/defaults.yaml, jar:file:/usr/local/jstorm-2.2.1/wait_deploy/test-jstorm-bolt.jar!/defaults.yaml]
        at backtype.storm.utils.Utils.findAndReadConfigFile(Utils.java:222)
        at backtype.storm.utils.Utils.readDefaultConfig(Utils.java:266)
        at backtype.storm.utils.Utils.readStormConfig(Utils.java:292)
        at backtype.storm.utils.Utils.<clinit>(Utils.java:62)
        ... 36 more
Caused by: java.io.IOException: Found multiple defaults.yaml resources. You‘re probably bundling the Storm jars with your topology jar. [jar:file:/usr/local/jstorm-2.2.1/jstorm-core-2.2.1.jar!/defaults.yaml, jar:file:/usr/local/jstorm-2.2.1/wait_deploy/test-jstorm-bolt.jar!/defaults.yaml]
        at backtype.storm.utils.Utils.getConfigFileInputStream(Utils.java:248)
        at backtype.storm.utils.Utils.findAndReadConfigFile(Utils.java:202)
        ... 39 more
Failed to get config java.library.path
None


cannot concatenate ‘str‘ and ‘NoneType‘ objects
Syntax: [jstorm jar topology-jar-path class ...]

    Runs the main method of class with the specified arguments.
    The jstorm jars and configs in $JSTORM_CONF_DIR/storm.yaml are put on the classpath.
    The process is configured so that StormSubmitter
    (https://github.com/alibaba/jstorm/wiki/JStorm-Chinese-Documentation)
    will upload the jar at topology-jar-path when the topology is submitted.

错误原因是:在打jar包的时候,把jstorm-core这个jar包也包含进去了,如下图:
技术分享图片

打包时,移除该jar,再次部署即可。

或者:
在pom文件中修改storm-core的scope为provided

<dependency>
    <groupId>org.apache.storm</groupId>
    <artifactId>storm-core</artifactId>
    <version>1.1.0</version>
     <!--本地调试的时候,屏蔽掉scope,等打包部署的时候再放开-->
    <scope>provided</scope>
</dependency>

这样在idea打包时,就不会包含改 jar了。

小注:
provided是表明了dependency 由JDK或者容器提供,例如Servlet AP和一些Java EE APIs。这个scope 只能作用在编译和测试时,同时没有传递性。




以上是关于运行jar包时出现java virtual machine launcher Unable to access jarfile:JMZ-DESK.jar 请高手指点...的主要内容,如果未能解决你的问题,请参考以下文章

从 Mac OS X 10.6 64 位 macbook 运行时出现 CORBA 异常

Java:Linux上java -jar xxx.jar命令执行jar包时出现Error: Invalid or corrupt jarfile xxx.jar解决方案

spark提交jar包时出现unsupported major.minor version 52.0错误的解决方案

java.lang.RuntimeException:尝试在 Elastic MapReduce 上运行 Jar 作业时出现 java.lang.ClassNotFoundException

用MyEclipse导入JSP项目包时出现这样的红叉,怎么解决

运行使用 SBT 和 ProGuard 构建的独立 jar 时出现 AbstractMethodError