简体   繁体   English

Eclipse 错误导出战争

[英]Eclipse error exporting war

I'm trying to export a Web Project as a WAR file, I get this error:我正在尝试将 Web 项目导出为 WAR 文件,但出现此错误:

org.eclipse.core.commands.ExecutionException: Error exportingC:/Users/jp/Desktop/beta.war
at org.eclipse.jst.j2ee.internal.archive.operations.ComponentExportOperation.execute(ComponentExportOperation.java:150)
at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl$1.run(DataModelPausibleOperationImpl.java:385)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2345)
at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.runOperation(DataModelPausibleOperationImpl.java:410)
at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.runOperation(DataModelPausibleOperationImpl.java:360)
at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.doExecute(DataModelPausibleOperationImpl.java:247)
at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.executeImpl(DataModelPausibleOperationImpl.java:219)
at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.cacheThreadAndContinue(DataModelPausibleOperationImpl.java:89)
at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.execute(DataModelPausibleOperationImpl.java:207)
at org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizard$1CatchThrowableRunnableWithProgress.run(DataModelWizard.java:220)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Caused by: org.eclipse.jst.jee.archive.ArchiveSaveFailureException: java.lang.NullPointerException
at org.eclipse.jst.j2ee.internal.archive.operations.FlatComponentArchiver.saveArchive(FlatComponentArchiver.java:126)
at org.eclipse.jst.j2ee.internal.archive.operations.ComponentExportOperation.export(ComponentExportOperation.java:193)
at org.eclipse.jst.j2ee.internal.archive.operations.ComponentExportOperation.execute(ComponentExportOperation.java:136)
... 10 more
Caused by: java.lang.NullPointerException

Any ideas about the java.lang.NullPointerException?关于 java.lang.NullPointerException 的任何想法? It's a project that has a lot of dependencies, but they seem to be fine (at least Eclipse is not complaining)这是一个有很多依赖的项目,但它们似乎很好(至少 Eclipse 没有抱怨)

UPDATE I tried several approaches, among them: re-installed Eclipse, created the workspace again, fresh project configuration, downloaded the full repository again... nothing seems to work.更新我尝试了几种方法,其中包括:重新安装 Eclipse,再次创建工作区,全新的项目配置,再次下载完整的存储库......似乎没有任何效果。

As additional information, other web projects can be exported to WAR files without issues.作为附加信息,其他 Web 项目可以毫无问题地导出到 WAR 文件。 I read that this may be caused by web.xml misconfiguration, but I couldn't find errors in mine.我读到这可能是由 web.xml 错误配置引起的,但我找不到我的错误。 Any ideas?有任何想法吗?

This issue is not code specific, this issue is eclipse specific.这个问题不是特定于代码的,这个问题是特定于 eclipse 的。 In some cases, if you have added eclipse updates which doesn't have proper license then this issue might arise.在某些情况下,如果您添加了没有适当许可的 eclipse 更新,则可能会出现此问题。 I use eclipse Kepler, I had faced same issue, no other solution worked for me, so I simply used another copy eclipse and then I easily exported new war.我使用 eclipse Kepler,我遇到了同样的问题,没有其他解决方案对我有用,所以我只是使用了另一个副本 eclipse,然后我轻松地导出了新的战争。

PS- With older eclipse, I could export other projects, but I had faced this problem with only one project. PS- 使用较旧的 eclipse,我可以导出其他项目,但我只在一个项目中遇到了这个问题。

The issue was caused by a couple of hard-coded paths for some imported libraries.该问题是由一些导入库的几个硬编码路径引起的。 After moving the project to a different path, it still had the old path referenced.将项目移动到不同的路径后,它仍然引用了旧路径。 And for some reason I don't understand, Eclipse didn't catch it.出于某种我不明白的原因,Eclipse 没有发现它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM