应用程序从java 6迁移到java 7

时间:2014-03-06 11:30:37

标签: java java-7

我正在使用一些专有的应用服务器(用于SIP协议),我们使用嵌入式tomcat(用于HTTP协议)。我们用java 1.6u21运行它。

现在我想使用java 1.7u51,所以我编译了java1.7u51上的所有代码。当我启动服务器时,我收到以下错误:

org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.session.StandardManager[]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5294)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.IllegalAccessError: tried to access class sun.security.provider.SunEntries from class sun.security.provider.Sun
    at sun.security.provider.Sun.<init>(Sun.java:55)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at java.lang.Class.newInstance(Class.java:374)
    at sun.security.jca.ProviderConfig$2.run(ProviderConfig.java:221)
    at sun.security.jca.ProviderConfig$2.run(ProviderConfig.java:206)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.security.jca.ProviderConfig.doLoadProvider(ProviderConfig.java:206)
    at sun.security.jca.ProviderConfig.getProvider(ProviderConfig.java:187)
    at sun.security.jca.ProviderList.getProvider(ProviderList.java:232)
    at sun.security.jca.ProviderList.getService(ProviderList.java:330)
    at sun.security.jca.GetInstance.getInstance(GetInstance.java:157)
    at java.security.cert.CertificateFactory.getInstance(CertificateFactory.java:183)
    at sun.security.pkcs.PKCS7.parseSignedData(PKCS7.java:271)
    at sun.security.pkcs.PKCS7.parse(PKCS7.java:158)
    at sun.security.pkcs.PKCS7.parse(PKCS7.java:126)
    at sun.security.pkcs.PKCS7.<init>(PKCS7.java:108)
    at sun.security.util.SignatureFileVerifier.<init>(SignatureFileVerifier.java:96)
    at java.util.jar.JarVerifier.processEntry(JarVerifier.java:286)
    at java.util.jar.JarVerifier.update(JarVerifier.java:218)
    at java.util.jar.JarFile.initializeVerifier(JarFile.java:345)
    at java.util.jar.JarFile.getInputStream(JarFile.java:412)
    at sun.misc.URLClassPath$JarLoader$2.getInputStream(URLClassPath.java:775)
    at sun.misc.Resource.cachedInputStream(Resource.java:77)
    at sun.misc.Resource.getByteBuffer(Resource.java:160)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:436)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:412)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at sun.security.jca.ProviderConfig$2.run(ProviderConfig.java:215)
    at sun.security.jca.ProviderConfig$2.run(ProviderConfig.java:206)

我在网上搜索,发现当我们在diff java版本上编译src并在不同版本上运行app时,java.lang.IllegalAccessError就出现了。但就我而言,我已经在java1.7u51上编译并运行了应用程序。

我想知道为什么会遇到这个问题。

仅供参考......我正在使用嵌入式tomcat 7。

1 个答案:

答案 0 :(得分:0)

它看起来更像是一个jar版本的问题。如果您正在使用任何第三方jar,请确保正确的版本在类路径中并重新编译整个应用程序并检查它