java.lang.NoClassDefFoundError:在匿名内部类中 [英] java.lang.NoClassDefFoundError: in anonymous inner class

查看:70
本文介绍了java.lang.NoClassDefFoundError:在匿名内部类中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在VMWare服务器内的带有sun/oracle JVM 1.6_23的Linux Red Hat上运行此代码.

Im' running this code on a Linux Red Hat with the sun/oracle JVM 1.6_23, inside a VMWare server.

一段时间后,JVM似乎无法访问我的匿名内部类.

After some times the JVM seem to be unable to access my anonymous inner classes.

我的类路径很好,因为它可以工作一段时间.

My classpath is fine, since it works for a period.

我得到的只是这样的错误:

All i got is errors like this one :

java.lang.NoClassDefFoundError : com/mycompany/impl/MyClassImpl $ 1 com.mycompany.impl.MyClassImpl.markAsDeletable ( MyClassImpl.java :45)上

第45行是下面的第一行,找不到我的新谓词

line 45 is the first line below, it can't find my new Predicate

        DomaineVO domaineVO = Iterables.find(domainesVO, new Predicate<DomaineVO>() {

            @Override
            public boolean apply(DomaineVO input) {
                return input.getId().equals(domaine.getIdentifier().toString());
            }
        });

有什么想法吗?

推荐答案

最后,我认为我们可能已经把矛头指向了这个问题.

Finally, i think we might have put the finger on the problem.

我们在码头上运行此代码,并使用.war文件的自动部署.默认情况下,jetty使用java.io.tmpdir部署.war文件.

We are running this code on jetty, and we use automatic deploy of the .war files. By default jetty use the java.io.tmpdir to deploy the .war files.

我们的问题仅存在于Linux上,而且大多是在清晨(第一位上班族使用该应用程序后).

Our problem was only on linux, and mostly early in the morning (as soon as the first office worker use the app).

原因是在夜间清理/tmp(由我们服务器上的LOGROTATE命令完成).

The cause was the cleaning of the /tmp at night (made by a LOGROTATE command on our servers).

经验法则:切勿长时间使用/tmp,并使码头在您自己的目录中部署战争.

Rules of thumb : Never use /tmp for too long time, and make jetty deploy war in a directory of your own.

谢谢大家

这篇关于java.lang.NoClassDefFoundError:在匿名内部类中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆