尝试加载外部库会导致JRE死亡

时间:2016-07-11 03:43:09

标签: java tomcat

我正在尝试重新启动一个旧项目,当我的服务器死亡时,我必须重新启动它。这个项目通过USB hardware interface读出并读取了几个硬件传感器,并且DID工作,这是我最后一次编译和运行它。那是一年多以前,对旧的JDK(可能是1.6)和旧版的Tomcat(可能是6)。这一次,使用Java 8和Tomcat 8,当我的新Tomcat安装尝试启动时,我收到了一个非常可怕的错误:

    CRIT: Couldn't get method ID <init> from tagLossEvent_class
    Exception in thread "localhost-startStop-1" java.lang.NoSuchMethodError: <init>
            at java.lang.ClassLoader$NativeLibrary.load(Native Method)
            at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
            at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1845)
            at java.lang.Runtime.loadLibrary0(Runtime.java:870)
            at java.lang.System.loadLibrary(System.java:1122)
            at com.phidgets.Phidget.<clinit>(Phidget.java:26)
            at com.electricgearbox.temperature.PhidgetSensor.<init>(PhidgetSensor.java:33)
            at com.electricgearbox.temperature.PhidgetSensor.getInstance(PhidgetSensor.java:45)
            at com.electricgearbox.temperature.TempServletListener.contextInitialized(TempServletListener.java:21)
            at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4811)
            at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5251)
            at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
            at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
            at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
            at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
            at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:940)
            at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1816)
            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
            at java.util.concurrent.FutureTask.run(FutureTask.java:266)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
            at java.lang.Thread.run(Thread.java:745)

它导致整个JDK关闭。有没有人见过这样的东西,你知道我怎么能解决这个问题吗?

1 个答案:

答案 0 :(得分:1)

当外部库jar与升级的java版本不兼容时,通常会发生这种情况,请检查phidget.jar的版本并将其升级到最新版本。

希望这有帮助。