繁体   English   中英

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

[英]Getting a 0 byte .jar file while doing full publish in Eclipse

我在JBoss EAP 4.3运行时和jdk1.6.0_29中使用Eclipse Galileo(版本ID:20100218-1602)。

我将资源添加到服务器,然后对资源进行“完全发布”。 状态从“重新发布”变为“已同步”,一切似乎都很好。

我右键单击我的服务器,然后单击“开始”。 启动过程中发生错误。

--- 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在我的项目中确实存在。

在存储库服务器\\ 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文件(右键单击并且“导出”也很好),并且可以正常工作。 但是,我想了解这里发生的事情,为什么要发布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文件了。

如果您能给我一些提示或帮助,我将非常感谢。 谢谢。

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

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

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

暂无
暂无

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

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