English 中文(简体)
JBoss5:由于java.util.zip.ZipException:无法打开zip文件中的错误,无法部署。
原标题:
  • 时间:2009-03-14 17:33:42
  •  标签:

I have a web client and a EJB project, which I created with Eclipse 3.4. When I want to deploy it on Jboss 5.0.1, I receive the error below. I searched a lot but I wasn t able to find a solution to this.

18:21:21,899 INFO  [ServerImpl] Starting JBoss (Microcontainer)...
18:21:21,900 INFO  [ServerImpl] Release ID: JBoss [Morpheus] 5.0.1.GA (build: SVNTag=JBoss_5_0_1_GA date=200902231221)
18:21:21,900 INFO  [ServerImpl] Bootstrap URL: null
18:21:21,900 INFO  [ServerImpl] Home Dir: /Applications/jboss-5.0.1.GA
18:21:21,900 INFO  [ServerImpl] Home URL: file:/Applications/jboss-5.0.1.GA/
18:21:21,901 INFO  [ServerImpl] Library URL: file:/Applications/jboss-5.0.1.GA/lib/
18:21:21,901 INFO  [ServerImpl] Patch URL: null
18:21:21,901 INFO  [ServerImpl] Common Base URL: file:/Applications/jboss-5.0.1.GA/common/
18:21:21,902 INFO  [ServerImpl] Common Library URL: file:/Applications/jboss-5.0.1.GA/common/lib/
18:21:21,902 INFO  [ServerImpl] Server Name: default
18:21:21,902 INFO  [ServerImpl] Server Base Dir: /Applications/jboss-5.0.1.GA/server
18:21:21,902 INFO  [ServerImpl] Server Base URL: file:/Applications/jboss-5.0.1.GA/server/
18:21:21,902 INFO  [ServerImpl] Server Config URL: file:/Applications/jboss-5.0.1.GA/server/default/conf/
18:21:21,902 INFO  [ServerImpl] Server Home Dir: /Applications/jboss-5.0.1.GA/server/default
18:21:21,902 INFO  [ServerImpl] Server Home URL: file:/Applications/jboss-5.0.1.GA/server/default/
18:21:21,903 INFO  [ServerImpl] Server Data Dir: /Applications/jboss-5.0.1.GA/server/default/data
18:21:21,903 INFO  [ServerImpl] Server Library URL: file:/Applications/jboss-5.0.1.GA/server/default/lib/
18:21:21,903 INFO  [ServerImpl] Server Log Dir: /Applications/jboss-5.0.1.GA/server/default/log
18:21:21,903 INFO  [ServerImpl] Server Native Dir: /Applications/jboss-5.0.1.GA/server/default/tmp/native
18:21:21,903 INFO  [ServerImpl] Server Temp Dir: /Applications/jboss-5.0.1.GA/server/default/tmp
18:21:21,903 INFO  [ServerImpl] Server Temp Deploy Dir: /Applications/jboss-5.0.1.GA/server/default/tmp/deploy
18:21:22,669 INFO  [ServerImpl] Starting Microcontainer, bootstrapURL=file:/Applications/jboss-5.0.1.GA/server/default/conf/bootstrap.xml
18:21:23,535 INFO  [VFSCacheFactory] Initializing VFSCache [org.jboss.virtual.plugins.cache.CombinedVFSCache]
18:21:23,541 INFO  [VFSCacheFactory] Using VFSCache [CombinedVFSCache[real-cache: null]]
18:21:23,942 INFO  [CopyMechanism] VFS temp dir: /Applications/jboss-5.0.1.GA/server/default/tmp
18:21:23,943 INFO  [ZipEntryContext] VFS force nested jars copy-mode is enabled.
18:21:26,263 INFO  [ServerInfo] Java version: 1.5.0_16,Apple Inc.
18:21:26,264 INFO  [ServerInfo] Java Runtime: Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b06-284)
18:21:26,264 INFO  [ServerInfo] Java VM: Java HotSpot(TM) Server VM 1.5.0_16-133,Apple Inc.
18:21:26,264 INFO  [ServerInfo] OS-System: Mac OS X 10.5.6,i386
18:21:26,336 INFO  [JMXKernel] Legacy JMX core initialized
18:21:30,432 INFO  [ProfileServiceImpl] Loading profile: default from: org.jboss.system.server.profileservice.repository.SerializableDeploymentRepository@e1d5d9(root=/Applications/jboss-5.0.1.GA/server, key=org.jboss.profileservice.spi.ProfileKey@143b82c3[domain=default,server=default,name=default])
18:21:30,436 INFO  [ProfileImpl] Using repository:org.jboss.system.server.profileservice.repository.SerializableDeploymentRepository@e1d5d9(root=/Applications/jboss-5.0.1.GA/server, key=org.jboss.profileservice.spi.ProfileKey@143b82c3[domain=default,server=default,name=default])
18:21:30,436 INFO  [ProfileServiceImpl] Loaded profile: ProfileImpl@ae002e{key=org.jboss.profileservice.spi.ProfileKey@143b82c3[domain=default,server=default,name=default]}
18:21:32,935 INFO  [WebService] Using RMI server codebase: http://localhost:8083/
18:21:42,572 INFO  [NativeServerConfig] JBoss Web Services - Stack Native Core
18:21:42,573 INFO  [NativeServerConfig] 3.0.5.GA
18:21:52,836 ERROR [AbstractKernelController] Error installing to ClassLoader: name=vfsfile:/Applications/jboss-5.0.1.GA/server/default/deploy/TwitterEAR.ear/ state=Describe mode=Manual requiredState=ClassLoader
org.jboss.deployers.spi.DeploymentException: Error creating classloader for vfsfile:/Applications/jboss-5.0.1.GA/server/default/deploy/TwitterEAR.ear/
    at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
    at org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext.createClassLoader(AbstractDeploymentContext.java:576)
    at org.jboss.deployers.structure.spi.helpers.AbstractDeploymentUnit.createClassLoader(AbstractDeploymentUnit.java:159)
    at org.jboss.deployers.spi.deployer.helpers.AbstractClassLoaderDeployer.deploy(AbstractClassLoaderDeployer.java:53)
    at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
    at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
    at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
    at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
    at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
    at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
    at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
    at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
    at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
    at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
    at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:698)
    at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:304)
    at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:205)
    at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:405)
    at org.jboss.Main.boot(Main.java:209)
    at org.jboss.Main$1.run(Main.java:547)
    at java.lang.Thread.run(Thread.java:613)
Caused by: java.lang.Error: Error visiting FileHandler@5567366[path=TwitterEAR.ear/TwitterPoCEJB.jar context=file:/Applications/jboss-5.0.1.GA/server/default/deploy/ real=file:/Applications/jboss-5.0.1.GA/server/default/deploy/TwitterEAR.ear/TwitterPoCEJB.jar/]
    at org.jboss.classloading.plugins.vfs.PackageVisitor.determineAllPackages(PackageVisitor.java:98)
    at org.jboss.deployers.vfs.plugins.classloader.VFSDeploymentClassLoaderPolicyModule.determineCapabilities(VFSDeploymentClassLoaderPolicyModule.java:108)
    at org.jboss.classloading.spi.dependency.Module.getCapabilities(Module.java:654)
    at org.jboss.classloading.spi.dependency.Module.determinePackageNames(Module.java:713)
    at org.jboss.classloading.spi.dependency.Module.getPackageNames(Module.java:698)
    at org.jboss.deployers.vfs.plugins.classloader.VFSDeploymentClassLoaderPolicyModule.determinePolicy(VFSDeploymentClassLoaderPolicyModule.java:129)
    at org.jboss.deployers.vfs.plugins.classloader.VFSDeploymentClassLoaderPolicyModule.determinePolicy(VFSDeploymentClassLoaderPolicyModule.java:48)
    at org.jboss.classloading.spi.dependency.policy.ClassLoaderPolicyModule.getPolicy(ClassLoaderPolicyModule.java:195)
    at org.jboss.deployers.vfs.plugins.classloader.VFSDeploymentClassLoaderPolicyModule.getPolicy(VFSDeploymentClassLoaderPolicyModule.java:122)
    at org.jboss.deployers.vfs.plugins.classloader.VFSDeploymentClassLoaderPolicyModule.getPolicy(VFSDeploymentClassLoaderPolicyModule.java:48)
    at org.jboss.classloading.spi.dependency.policy.ClassLoaderPolicyModule.registerClassLoaderPolicy(ClassLoaderPolicyModule.java:131)
    at org.jboss.deployers.plugins.classloading.AbstractLevelClassLoaderSystemDeployer.createClassLoader(AbstractLevelClassLoaderSystemDeployer.java:120)
    at org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext.createClassLoader(AbstractDeploymentContext.java:562)
    ... 21 more
Caused by: java.lang.RuntimeException: java.util.zip.ZipException: error in opening zip file
    at org.jboss.virtual.plugins.context.AbstractExceptionHandler.handleZipEntriesInitException(AbstractExceptionHandler.java:39)
    at org.jboss.virtual.plugins.context.helpers.NamesExceptionHandler.handleZipEntriesInitException(NamesExceptionHandler.java:63)
    at org.jboss.virtual.plugins.context.zip.ZipEntryContext.ensureEntries(ZipEntryContext.java:610)
    at org.jboss.virtual.plugins.context.zip.ZipEntryContext.checkIfModified(ZipEntryContext.java:757)
    at org.jboss.virtual.plugins.context.zip.ZipEntryContext.getChildren(ZipEntryContext.java:829)
    at org.jboss.virtual.plugins.context.zip.ZipEntryHandler.getChildren(ZipEntryHandler.java:159)
    at org.jboss.virtual.plugins.context.DelegatingHandler.getChildren(DelegatingHandler.java:121)
    at org.jboss.virtual.plugins.context.AbstractVFSContext.getChildren(AbstractVFSContext.java:211)
    at org.jboss.virtual.plugins.context.AbstractVFSContext.visit(AbstractVFSContext.java:328)
    at org.jboss.virtual.plugins.context.AbstractVFSContext.visit(AbstractVFSContext.java:298)
    at org.jboss.virtual.VFS.visit(VFS.java:433)
    at org.jboss.virtual.VirtualFile.visit(VirtualFile.java:437)
    at org.jboss.virtual.VirtualFile.getChildren(VirtualFile.java:386)
    at org.jboss.virtual.VirtualFile.getChildren(VirtualFile.java:367)
    at org.jboss.classloading.plugins.vfs.PackageVisitor.visit(PackageVisitor.java:200)
    at org.jboss.virtual.plugins.vfs.helpers.WrappingVirtualFileHandlerVisitor.visit(WrappingVirtualFileHandlerVisitor.java:62)
    at org.jboss.virtual.plugins.context.AbstractVFSContext.visit(AbstractVFSContext.java:353)
    at org.jboss.virtual.plugins.context.AbstractVFSContext.visit(AbstractVFSContext.java:298)
    at org.jboss.virtual.VFS.visit(VFS.java:433)
    at org.jboss.virtual.VirtualFile.visit(VirtualFile.java:437)
    at org.jboss.classloading.plugins.vfs.PackageVisitor.determineAllPackages(PackageVisitor.java:94)
    ... 33 more
Caused by: java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:203)
    at java.util.zip.ZipFile.<init>(ZipFile.java:234)
    at org.jboss.virtual.plugins.context.zip.ZipFileWrapper.ensureZipFile(ZipFileWrapper.java:175)
    at org.jboss.virtual.plugins.context.zip.ZipFileWrapper.acquire(ZipFileWrapper.java:245)
    at org.jboss.virtual.plugins.context.zip.ZipEntryContext.initEntries(ZipEntryContext.java:470)
    at org.jboss.virtual.plugins.context.zip.ZipEntryContext.ensureEntries(ZipEntryContext.java:603)
    ... 51 more
18:21:56,772 INFO  [JMXConnectorServerService] JMX Connector server: service:jmx:rmi://localhost/jndi/rmi://localhost:1090/jmxconnector
18:21:56,959 INFO  [MailService] Mail Service bound to java:/Mail
18:21:59,450 WARN  [JBossASSecurityMetadataStore] WARNING! POTENTIAL SECURITY RISK. It has been detected that the MessageSucker component which sucks messages from one node to another has not had its password changed from the installation default. Please see the JBoss Messaging user guide for instructions on how to do this.
18:21:59,489 WARN  [AnnotationCreator] No ClassLoader provided, using TCCL: org.jboss.managed.api.annotation.ManagementComponent
18:21:59,789 INFO  [TransactionManagerService] JBossTS Transaction Service (JTA version) - JBoss Inc.
18:21:59,789 INFO  [TransactionManagerService] Setting up property manager MBean and JMX layer
18:22:00,040 INFO  [TransactionManagerService] Initializing recovery manager
18:22:00,160 INFO  [TransactionManagerService] Recovery manager configured
18:22:00,160 INFO  [TransactionManagerService] Binding TransactionManager JNDI Reference
18:22:00,184 INFO  [TransactionManagerService] Starting transaction recovery manager
18:22:01,243 INFO  [Http11Protocol] Initializing Coyote HTTP/1.1 on http-localhost%2F127.0.0.1-8080
18:22:01,244 INFO  [AjpProtocol] Initializing Coyote AJP/1.3 on ajp-localhost%2F127.0.0.1-8009
18:22:01,244 INFO  [StandardService] Starting service jboss.web
18:22:01,247 INFO  [StandardEngine] Starting Servlet Engine: JBoss Web/2.1.2.GA
18:22:01,336 INFO  [Catalina] Server startup in 161 ms
18:22:01,360 INFO  [TomcatDeployment] deploy, ctxPath=/invoker
18:22:02,014 INFO  [TomcatDeployment] deploy, ctxPath=/web-console
18:22:02,459 INFO  [TomcatDeployment] deploy, ctxPath=/jbossws
18:22:02,570 INFO  [RARDeployment] Required license terms exist, view vfszip:/Applications/jboss-5.0.1.GA/server/default/deploy/jboss-local-jdbc.rar/META-INF/ra.xml
18:22:02,586 INFO  [RARDeployment] Required license terms exist, view vfszip:/Applications/jboss-5.0.1.GA/server/default/deploy/jboss-xa-jdbc.rar/META-INF/ra.xml
18:22:02,645 INFO  [RARDeployment] Required license terms exist, view vfszip:/Applications/jboss-5.0.1.GA/server/default/deploy/jms-ra.rar/META-INF/ra.xml
18:22:02,663 INFO  [RARDeployment] Required license terms exist, view vfszip:/Applications/jboss-5.0.1.GA/server/default/deploy/mail-ra.rar/META-INF/ra.xml
18:22:02,705 INFO  [RARDeployment] Required license terms exist, view vfszip:/Applications/jboss-5.0.1.GA/server/default/deploy/quartz-ra.rar/META-INF/ra.xml
18:22:02,801 INFO  [SimpleThreadPool] Job execution threads will use class loader of thread: main
18:22:02,850 INFO  [QuartzScheduler] Quartz Scheduler v.1.5.2 created.
18:22:02,857 INFO  [RAMJobStore] RAMJobStore initialized.
18:22:02,858 INFO  [StdSchedulerFactory] Quartz scheduler  DefaultQuartzScheduler  initialized from default resource file in Quartz package:  quartz.properties 
18:22:02,858 INFO  [StdSchedulerFactory] Quartz scheduler version: 1.5.2
18:22:02,859 INFO  [QuartzScheduler] Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED started.
18:22:03,888 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager  jboss.jca:service=DataSourceBinding,name=DefaultDS  to JNDI name  java:DefaultDS 
18:22:04,530 INFO  [ServerPeer] JBoss Messaging 1.4.1.GA server [0] started
18:22:04,624 INFO  [QueueService] Queue[/queue/DLQ] started, fullSize=200000, pageSize=2000, downCacheSize=2000
18:22:04,632 WARN  [ConnectionFactoryJNDIMapper] supportsFailover attribute is true on connection factory: jboss.messaging.connectionfactory:service=ClusteredConnectionFactory but post office is non clustered. So connection factory will *not* support failover
18:22:04,632 WARN  [ConnectionFactoryJNDIMapper] supportsLoadBalancing attribute is true on connection factory: jboss.messaging.connectionfactory:service=ClusteredConnectionFactory but post office is non clustered. So connection factory will *not* support load balancing
18:22:04,742 INFO  [ConnectionFactory] Connector bisocket://localhost:4457 has leasing enabled, lease period 10000 milliseconds
18:22:04,742 INFO  [ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory@6af9ad started
18:22:04,746 INFO  [QueueService] Queue[/queue/ExpiryQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000
18:22:04,747 INFO  [ConnectionFactory] Connector bisocket://localhost:4457 has leasing enabled, lease period 10000 milliseconds
18:22:04,747 INFO  [ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory@5ac953 started
18:22:04,750 INFO  [ConnectionFactory] Connector bisocket://localhost:4457 has leasing enabled, lease period 10000 milliseconds
18:22:04,750 INFO  [ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory@e8fa3a started
18:22:05,050 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager  jboss.jca:service=ConnectionFactoryBinding,name=JmsXA  to JNDI name  java:JmsXA 
18:22:05,073 INFO  [TomcatDeployment] deploy, ctxPath=/
18:22:05,178 INFO  [TomcatDeployment] deploy, ctxPath=/jmx-console
18:22:05,290 ERROR [ProfileServiceBootstrap] Failed to load profile: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

DEPLOYMENTS IN ERROR:
  Deployment "vfsfile:/Applications/jboss-5.0.1.GA/server/default/deploy/TwitterEAR.ear/" is in error due to the following reason(s): java.util.zip.ZipException: error in opening zip file

18:22:05,301 INFO  [Http11Protocol] Starting Coyote HTTP/1.1 on http-localhost%2F127.0.0.1-8080
18:22:05,364 INFO  [AjpProtocol] Starting Coyote AJP/1.3 on ajp-localhost%2F127.0.0.1-8009
18:22:05,373 INFO  [ServerImpl] JBoss (Microcontainer) [5.0.1.GA (build: SVNTag=JBoss_5_0_1_GA date=200902231221)] Started in 43s:467ms

提到的 ear 和 war 文件都在部署目录中。

有人有提示吗?

问题回答

我看到了这个,在FTP传输模式设置为ASCII而不是二进制时传输一个文件的时候。

The problem is most likely in the low level format of the ZIP file, possibly the result of JBoss trying to deploy a partially uploaded archive,

Caused by: java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:203)
    at java.util.zip.ZipFile.<init>(ZipFile.java:234

如果您在通过慢速链接上传服务器,则尝试将归档上传到JBoss不监视的目录,然后将归档移动到“deploy”目录中。移动将是原子操作,或至少比上传快得多。

我通过将归档文件rsync-ing到〜/部署单元/,然后通过ssh运行远程脚本来执行最终移动到JBoss的部署目录。

我得到了一个非常相似的错误,它是由于打开文件数达到了最大值而导致的。我在 ulimit -n 8192 后启动了应用程序,它能够“解压”文件。

I had the same problem with a "big" EAR deployed via ANT using a copy task. It seems that JBoss was trying to unzip it before it was totally copied. I solved the pb using a move task instead of a copy (taking care that the source folder for the move was on the same disk partition)

好的,我终于找到了解决我的问题的方法。似乎Eclipse中存在一个bug,阻止了创建.settings/org.eclipse.wst.common.component文件。当设置项目属性中的EJB3和Java6面向时,应该创建此文件。

这是一个 org.eclipse.wst.common.component 示例文件:

<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
    <wb-module deploy-name="project_name">
        <wb-resource deploy-path="/" source-path="/src/main/java"/>
        <wb-resource deploy-path="/" source-path="/src/main/resources"/>
        <wb-resource deploy-path="/" source-path="/src/test/java"/>
        <wb-resource deploy-path="/" source-path="/src/test/resources"/>
        <property name="java-output-path"/>
    </wb-module>
</project-modules>

The deploy paths must be defined in order to be able to create the EJB Jar file used by the server on deployment. Once created, Jboss publish the EJB module correctly.

有时候这个错误是因为 jar/ear 编译版本与服务器上的 jdk 不一致所造成的。

我在JBoss 5.1.0.GA和Seam 2.1.1.GA中也遇到了同样的问题。 JDK对于Eclipse 3.5和JBoss都是java jdk1.6.0._07。

我已经解决了这个问题。也许这个问题的起源与你的具体情况有关,也可能并不是,但无论如何,我认为这可能有所帮助。

我正在使用Seam安装示例中包含的构建文件创建应用程序EAR文件;我的构建文件是预订示例附带的那个的修改版本。此示例构建文件包括了共同于所有示例的构建文件。它提供了许多功能,可以利用这些功能来创建您的分发文件。

常见构建示例提供了几个文件集和路径条目,您可以覆盖它们以包含适用于您的项目的唯一的库。

具体来说,我覆盖了“build.classpath.extras”和“ear.lib.extras”。

我想把一个决定好的库加入到 EJB jar 文件中,这个文件会打包成 EAR 文件(这个 jar 文件包含了我的模型和操作类);所以我在构建文件中覆盖了 "jar.extras"。

那时候是我遇到这个问题的时候。尽管我所期望的根目录下的库已经被复制到 EJB jar 文件的根目录下,看起来没有问题,但 JBoss 仍然报错。

所以我停止使用“jar.extras”,并将对所需库的引用移动到“build.classpath.extras”:这个动作的效果是将库复制到EAR文件的lib文件夹中。现在应用程序似乎工作正常,问题消失了。

I had the same problem, mine solution/problem was that I added the jar that was causing the problem as a EE dependency in my EJB. The jar was included in the EAR file, but wasn t in the org.eclipse.wst.common.component correspondent file. I added the dependency in the EAR file, and my problem was solved (At least I think, I had a problem after doing this with eclipse, but when I solve it, the publish went fine).

我通过使用与编译/构建 EAR 相同的 JDK 运行服务器来解决了这个问题。

我在你的Servlet名称下的web.xml中添加了下文提到的代码,错误已经被解决。

<servlet-name>youServletName</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
 **<init-param>
  <param-name>contextClass</param-name>
  <param-value>org.jboss.spring.vfs.context.VFSXmlWebApplicationContext</param-value>
</init-param> 
<load-on-startup>2</load-on-startup>**
</servlet>

你能够在JBoss以外(使用WinZip或WinRAR)打开这个ear文件吗?可能是压缩文件已经损坏了。

你可以尝试使用java.util.zip.ZipFile.open()编写一个小测试程序,看看是否可以在更隔离的情况下调试此问题。

这可能是权限问题吗?我看到您正在使用Mac OS运行。成功打开EAR文件时,您是作为哪个用户运行的?当您运行JBoss时,它运行为哪个用户?它是否具有文件的读取权限?

我也有这个问题,但是当我给我的项目添加了maven-war-plugin和maven-ejb-plugin之后,一切又恢复正常了...

try install web tools platform (WTP) from the eclipse update... I heard that there was some kind of bug, you will need version 3.0.4. I can t find the link, sorry... hope this will help!

我刚刚发现,如果您没有在maven-war-plugin中指定版本号,它将使用某种alpha版本。 为我提供版本号2.0,这对我有用。

嗯,我已经面临相同的问题三天了..请查看您的类路径,找出扩展名为.rar或其他类型的这些文件,在我的情况下,我从我的类路径中移除了一个.rar文件,一切都运行得很好。

我在我的 Mac 上遇到了同样的问题。我的 Windows 开发机器(在工作中充当客户端 :-/)运行 GateIN 和 eclipse 太慢了,因此我在我的 Macbooc Pro 上安装了 GateIN,并在构建时让 eclipse 将 ear 文件复制到它上面。我在控制台上看到:压缩包中有异常。

所以我决定调查一下是否可以使用Stuffit Manager打开存档。当我打开它时,显然文件会被某种方式触碰到,并且GateIN扫描程序立即检测到更改并重新部署,这次没有出错。所以我想,Mac可能太快了,在ear完全复制之前尝试重新部署...如果你有问题,只需使用touch命令...

我也见过嵌套的罐子这样做(一个罐子内部有另一个罐子或一个空罐子)。在我的情况下,这是一个微软 SQL JDBC 驱动程序罐。通过查看堆栈跟踪,OP 的似乎是 TwitterPoCEJB.jar。

有很多事情可能会导致这种情况,可能只是一个糟糕的ZIP文件等,如前所述。

If it is a nested jar problem, you can tell the VFS what locations contain nested jars, although by default the ./deploy directory is one of them, so anything in there should be fine (unless you ve got a jboss-{something}.xml explicitly configuring things otherwise).

我们通过从jdk1.6.0._06更新到jdk1.6.0._26解决了这个问题。jar文件已经打包成_26版本,并在JBoss 6.0上成功部署。然而,我们的客户无法在_06版本上部署。希望这可以帮到您!

有同样的问题,使用JBoss 4.4.2和使用maven-war-plugin构建我的应用程序(将输出目录指定为JBoss部署目录)。似乎JBoss试图重新加载部分复制的war,因为当maven仍在构建war时,其ScannerThread激活了。我部分解决了这个问题,将扫描时间从5000毫秒(默认值)增加到15秒。这并不能解决问题,但至少发生的频率减少了!

   <!-- Frequency in milliseconds to rescan the URLs for changes -->
  <attribute name="ScanPeriod">15000</attribute>

也许是您的web.xml文件问题,我也面临同样的问题。在尝试了很多不同的方法后,我想起了另一篇关于web.xml和web-app 3.0的文章。这让我思考并检查了我的web.xml文件。果然,在顶部就有以下行。

<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">

我改成了2.5的Web应用规范,但WAR和EAR都无法部署。

<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">

我有问题,但这是由于Web应用程序中有zip文件。当Eclipse尝试将Web应用程序部署到开发tomcat服务器时,它试图解压缩zip文件。是的,我继承了这个Web应用程序。现在我会尝试将其添加到一个过滤器中,以防止发生这种情况,祝我好运。

我在部署war时遇到了相同的错误,对我来说,这是与使用tar中的z选项提取wildfly存档相关的问题,我输入了:

    tar -xvzf wildfly_v_.tar.gz

然后我卸载并重新安装了所有的东西,但这一次用……(需要更多上下文才能正确翻译)

    tar -xvf wildfly_v_.tar.gz 

配置完成后,我部署了,问题消失了 - 我认为这是和gzip有关的问题。

我曾经遇到过这个问题,并发现我在WEB-INF / lib目录中有损坏/空的jar文件。一旦我用好的拷贝替换了每个文件,部署就可以顺利进行。





相关问题
热门标签