Netbeans IDE错误:发生了java.lang.NoClassDefFoundError异常

时间:2013-07-08 09:18:50

标签: java exception netbeans-7

当我使用netbeans打开java项目时,我有一个例外: 发生了java.lang.NoClassDefFoundError异常。 但是,系统应继续工作而不会出现进一步的问题。 单击“显示堆栈跟踪的详细信息”。

显示详细信息:


java.lang.NoClassDefFoundError: Could not initialize class org.netbeans.modules.glassfish.javaee.Hk2LibraryProvider
    at org.netbeans.modules.glassfish.javaee.Hk2JavaEEPlatformImpl.(Hk2JavaEEPlatformImpl.java:114)
    at org.netbeans.modules.glassfish.javaee.Hk2JavaEEPlatformFactory.getJ2eePlatformImpl(Hk2JavaEEPlatformFactory.java:125)
    at org.netbeans.modules.j2ee.deployment.impl.ServerInstance.getJ2eePlatformImpl(ServerInstance.java:347)
    at org.netbeans.modules.j2ee.deployment.impl.query.J2eePlatformSourceForBinaryQuery.findSourceRoots2(J2eePlatformSourceForBinaryQuery.java:103)
    at org.netbeans.api.java.queries.SourceForBinaryQuery.findSourceRoots2(SourceForBinaryQuery.java:126)
    at org.netbeans.modules.parsing.impl.indexing.PathRegistry.sourceForBinaryQuery(PathRegistry.java:195)
    at org.netbeans.api.java.source.ClassIndex.createQueriesForRoots(ClassIndex.java:658)
    at org.netbeans.api.java.source.ClassIndex.access$700(ClassIndex.java:100)
    at org.netbeans.api.java.source.ClassIndex$6.run(ClassIndex.java:620)
    at org.openide.util.Mutex.readAccess(Mutex.java:367)
    at org.netbeans.api.java.source.ClassIndex.reset(ClassIndex.java:600)
    at org.netbeans.api.java.source.ClassIndex.(ClassIndex.java:299)
    at org.netbeans.api.java.source.ClassIndex.(ClassIndex.java:275)
    at org.netbeans.api.java.source.ClasspathInfo.getClassIndex(ClasspathInfo.java:380)
    at org.netbeans.modules.j2ee.metadata.model.api.support.annotation.AnnotationModelHelper.registerPersistentObjectManager(AnnotationModelHelper.java:129)
    at org.netbeans.modules.j2ee.metadata.model.api.support.annotation.AnnotationModelHelper.createPersistentObjectManager(AnnotationModelHelper.java:121)
    at org.netbeans.modules.j2ee.dd.impl.ejb.annotation.EnterpriseBeansImpl.initialize(EnterpriseBeansImpl.java:93)
    at org.netbeans.modules.j2ee.dd.impl.ejb.annotation.EnterpriseBeansImpl.create(EnterpriseBeansImpl.java:84)
    at org.netbeans.modules.j2ee.dd.impl.ejb.annotation.EjbJarImpl.(EjbJarImpl.java:77)
    at org.netbeans.modules.j2ee.dd.impl.ejb.annotation.EjbJarMetadataModelImpl.(EjbJarMetadataModelImpl.java:88)
    at org.netbeans.modules.j2ee.dd.spi.ejb.EjbJarMetadataModelFactory.createMetadataModel(EjbJarMetadataModelFactory.java:57)
    at org.netbeans.modules.web.project.EjbJarProvider.getMetadataModel(EjbJarProvider.java:110)
    at org.netbeans.modules.j2ee.api.ejbjar.EjbJar.getMetadataModel(EjbJar.java:186)
    at org.netbeans.modules.web.project.WebProject$ProjectOpenedHookImpl.projectOpened(WebProject.java:1021)
    at org.netbeans.spi.project.ui.ProjectOpenedHook$1.projectOpened(ProjectOpenedHook.java:85)
    at org.netbeans.spi.project.ui.support.UILookupMergerSupport$OpenHookImpl.projectOpened(UILookupMergerSupport.java:244)
    at org.netbeans.spi.project.ui.ProjectOpenedHook$1.projectOpened(ProjectOpenedHook.java:85)
[catch] at org.netbeans.modules.project.ui.OpenProjectList.notifyOpened(OpenProjectList.java:1218)
    at org.netbeans.modules.project.ui.OpenProjectList.doOpenProject(OpenProjectList.java:1299)
    at org.netbeans.modules.project.ui.OpenProjectList.open(OpenProjectList.java:791)
    at org.netbeans.modules.project.ui.OpenProjectList$5.run(OpenProjectList.java:659)
    at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1432)
    at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2044)

Netbeans有什么问题,如何解决?

resolved: need to update IDE

4 个答案:

答案 0 :(得分:2)

就我而言,这种情况是由于NetBeans IDE的可用更新引起的。尝试更新IDE,重新启动NetBeans并查看会发生什么。

答案 1 :(得分:1)

我也面临同样的问题,这是因为多次安装

Netbeans的。它安装了多个服务器,例如玻璃鱼(在我的

中)

case),所以删除其他未使用的服务器。它解决了这个问题。

答案 2 :(得分:0)

您可以安装不支持IDE的字体。请删除lib和jar文件中的字体。

答案 3 :(得分:0)

我遇到了同样的问题:通过安装Java RE来解决