在Eclipse中进行完全发布时获取0字节.jar文件

时间:2015-11-25 12:44:36

标签: java eclipse maven jboss publish

我使用Eclipse Galileo(Build id:20100218-1602)和JBoss EAP 4.3 Runtime以及jdk1.6.0_29。

我将我的资源添加到服务器,然后执行"完全发布"我的资源。国家来自"重新发表"到"同步"一切似乎都很好。

我右键单击我的服务器,单击"开始"。启动期间发生错误。

--- Incompletely deployed packages ---
org.jboss.deployment.DeploymentInfo@cac31a84 { url=file:*repository*/server/default/deploy/*project*_srv_mod_vin_int.war/ }
  deployer: MBeanProxyExt[jboss.web:service=WebServer]
  status: Deployment FAILED reason: URL file:*repository*/server/default/deploy/*project*_srv_mod_vin_int.war/ deployment failed
  state: FAILED
  watch: file:*repository*/server/default/deploy/*project*_srv_mod_vin_int.war/WEB-INF/web.xml
  altDD: null
  lastDeployed: 1448379140991
  lastModified: 1448378977301
  mbeans:

--- MBeans waiting for other MBeans ---  
ObjectName: jboss.web.deployment:war=*project*_srv_mod_vin_int.war,id=->893183356  
  State: FAILED  
  Reason: org.jboss.deployment.DeploymentException: URL file:*repository*/server/default/deploy/*project*_srv_mod_vin_int.war/ deployment failed

--- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---  
ObjectName: jboss.web.deployment:war=*project*_srv_mod_vin_int.war,id=-893183356  
  State: FAILED  
  Reason: org.jboss.deployment.DeploymentException: URL file:*repository*/server/default/deploy/*project*_srv_mod_vin_int.war/ deployment failed

在eclipse控制台日志中,我发现以下异常:

[24 nov. 2015 16:32:21,538] - [ERROR] - [THREAD main] - org.springframework.web.context.ContextLoader[org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:353)] - Context initialization failed
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:fmwk-application-context_module_service.xml]
Offending resource: class path resource [application-context_module_service.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [fmwk-application-context_module_service.xml]; nested exception is java.io.FileNotFoundException: class path resource [fmwk-application-context_module_service.xml] cannot be opened because it does not exist

文件 application-context_module_service.xml 引用 fmwk-application-context_module_service.xml

<import resource="classpath:fmwk-application-context_module_service.xml" />

我的项目中存在 fmwk-application-context_module_service.xml 文件。

在我的服务器上对存储库 server \ default \ deploy \ 项目 _srv_mod_vin_int.war \ WEB-INF \ lib 进行一些研究后,我发现我的一个jar文件,项目 _srv_mod_vin_framework.jar ,通常包含文件 fmwk-application-context_module_service.xml 的文件大小为0 Ko。

在这种状态下,我用我的maven任务中的正确jar文件替换了0 Ko jar文件(右键单击&#34;导出&#34;也很好)并且它可以工作。但是,我想了解这里发生了什么,为什么我要发布一个0 Ko jar文件以及我可以做些什么而不必做这个技巧

那么,之后,我进入我的工作区进入 .metadata.plugins \ org.jboss.ide.eclipse.as.core \ JBoss_EAP_4.3_Runtime_Server1300265697099 \ log 文件,我发现了一个例外:

!SESSION 2015-11-24 15:13:39.287
-----------------------------------------------  
eclipse.buildId=unknown  
java.version=1.6.0_29  
java.vendor=Sun Microsystems Inc.  
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=fr_FR  
Framework arguments:  -product org.eclipse.epp.package.jee.product  
Command-line arguments:  -os win32 -ws win32 -arch x86 -product  org.eclipse.epp.package.jee.product  

!ENTRY org.jboss.ide.eclipse.as.core 0 33685505 2015-11-24 16:29:37.364  
!MESSAGE 595 files modified in module *project*_srv_mod_vin_int

!ENTRY org.jboss.ide.eclipse.as.core 0 33685505 2015-11-24 16:29:37.588  
!MESSAGE 276 files modified in module *project*_srv_mod_vin_services

!ENTRY org.jboss.ide.eclipse.as.core 4 33685506 2015-11-24 16:29:37.596  
!MESSAGE Full publish failed for module *project*_srv_mod_vin_framework  
!SUBENTRY 1 org.jboss.ide.eclipse.as.core 4 33685513 2015-11-24 16:29:37.596  
!MESSAGE unable to assemble module *project*_srv_mod_vin_framework  
!STACK 0  
java.util.zip.ZipException: ZIP file must have at least one entry  
    at java.util.zip.ZipOutputStream.finish(ZipOutputStream.java:304)  
    at java.util.zip.DeflaterOutputStream.close(DeflaterOutputStream.java:146)  
    at java.util.zip.ZipOutputStream.close(ZipOutputStream.java:321)  
    at org.jboss.ide.eclipse.as.core.server.xpl.ModulePackager.finished(ModulePackager.java:59)  
    at org.jboss.ide.eclipse.as.core.publishers.PublishUtil.packModuleIntoJar(PublishUtil.java:234)  
    at org.jboss.ide.eclipse.as.core.publishers.JstPublisher.fullPublish(JstPublisher.java:121)  
    at org.jboss.ide.eclipse.as.core.publishers.JstPublisher.publishModule(JstPublisher.java:93)  
    at org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod.publishModule(LocalPublishMethod.java:71)  
    at org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior.publishModule(DeployableServerBehavior.java:65)  
    at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModule(ServerBehaviourDelegate.java:949)  
    at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModules(ServerBehaviourDelegate.java:1039)  
    at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:872)  
    at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:708)  
    at org.eclipse.wst.server.core.internal.Server.publishImpl(Server.java:2731)  
    at org.eclipse.wst.server.core.internal.Server$PublishJob.run(Server.java:278)  
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)  

我想我得到了ZipException,因为之前出现了问题而且我没有任何内容可以放入我的档案文件中?

然后我去.metadata.plugins \ org.eclipse.wst.server.core \ publish \ publish.dat

在这个文件中,我发现提到了 application-context_module_service.xml ,但不是 fmwk-application-context_module_service.xml

没有找到它是因为我有一个类似的项目,构建在相同的架构上,具有相同的.xml文件。这个正确发布,而publish.dat确实提到了 fmwk-application-context_module_service.xml

fmwk-application-context_module_service.xml 引用上的两个项目之间没有区别。

有人可以帮我吗?我对.metadata存储库中的最终日志文件进行了一些研究,这些文件可以准确地告诉我遇到的错误是什么,以及为什么我发布的jar大小为0 Ko但是我找不到比我在这里暴露的内容更多的东西。我无法进一步发布这个publish.dat文件。

如果你能给我一些小费或帮助,我将非常感激。 谢谢。

1 个答案:

答案 0 :(得分:0)

终于找到了错误的根源。它位于.settings / org.eclipse.wst.common.component。

合并后,此文件丢失了<wb-module></wb-module><wb-ressource></wb-ressource>

我将文件还原为旧版本,效果很好。