3

我有一个使用 jar 创建的 jar,onejar-maven-plugin用于监听来自 tibco 的 jms 消息并进行相应处理。它工作正常,但是当我使用这个 jar 签名jarsigner并尝试运行它时,它会引发以下异常:

org.apache.commons.logging.LogConfigurationException: java.lang.StackOverflowError (Caused by java.lang.StackOverflowError)
    at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:538)
    at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
    at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
    at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
    at org.springframework.context.support.AbstractApplicationContext.<init>(AbstractApplicationContext.java:160)
    at org.springframework.context.support.AbstractRefreshableApplicationContext.<init>(AbstractRefreshableApplicationContext.java:89)
    at org.springframework.context.support.AbstractRefreshableConfigApplicationContext.<init>(AbstractRefreshableConfigApplicationContext.java:59)

    at org.springframework.context.support.AbstractXmlApplicationContext.<init>(AbstractXmlApplicationContext.java:61)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:136)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
    at com.adobe.jobcloud.envoy.client.PushToPrereleaseWorker.main(PushToPrereleaseWorker.java:33)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.simontuffs.onejar.Boot.run(Boot.java:340)
    at com.simontuffs.onejar.Boot.main(Boot.java:166)
Caused by: java.lang.StackOverflowError
    at com.simontuffs.onejar.OneJarFile.getJarEntry(OneJarFile.java:43)
    at java.util.jar.JarFile.getManEntry(Unknown Source)
    at java.util.jar.JarFile.getManifestFromReference(Unknown Source)
    at java.util.jar.JarFile.getManifest(Unknown Source)
    at java.util.jar.JarFile.maybeInstantiateVerifier(Unknown Source)
    at java.util.jar.JarFile.getInputStream(Unknown Source)
    at com.simontuffs.onejar.OneJarFile.getJarEntry(OneJarFile.java:50)
    at java.util.jar.JarFile.getManEntry(Unknown Source)
    at java.util.jar.JarFile.getManifestFromReference(Unknown Source)
    at java.util.jar.JarFile.getManifest(Unknown Source)
    at java.util.jar.JarFile.maybeInstantiateVerifier(Unknown Source)
    at java.util.jar.JarFile.getInputStream(Unknown Source)
    at com.simontuffs.onejar.OneJarFile.getJarEntry(OneJarFile.java:50)
    at java.util.jar.JarFile.getManEntry(Unknown Source)
    at java.util.jar.JarFile.getManifestFromReference(Unknown Source)
    at java.util.jar.JarFile.getManifest(Unknown Source)

另外,如果我用maven-jarsigner-plugin它来签名,结果是完全一样的。我一无所知,并坚持这个问题。

任何帮助将不胜感激。

4

1 回答 1

0

Have you tried to increase the -Xss JVM option? To 4096k at first, then lower it until it fails again. Working with ciphers generally maybe need more than default stack size. For the maven jarsigner plugin you can edit .mavenrc file in your linux home directory and add these lines:

#!/bin/bash
export JAVA_HOME=/usr/lib/jvm/java-6-sun-i586 #(or another)
export M2_HOME=/usr/local/lib/apache-maven/apache-maven-3.0.4
export MAVEN_OPTS="-Xss4096k -XX:MaxPermSize=128m -Xmx384m"

I don't know how to do this under windows, but there must be similar solution (here?)

于 2013-03-08T22:16:56.797 回答