JBoss5: Cannot deploy due to java.util.zip.ZipException: error in opening zip file

爷,独闯天下 提交于 2019-12-17 10:54:37

问题


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

The mentioned ear and war file are both in the deploy directory.

Does anybody have hints?


回答1:


I've seen this when FTP'ing a file with transfer mode set to ASCII instead of binary.




回答2:


I got a very similar error and it was due to the number of maximum open files being reached. I started the application after a ulimit -n 8192 and it was able to "unzip" the file.




回答3:


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

If you are uploading to a server over a slow link then try uploading the archive to a directory that JBoss does not monitor then move the archive into the deploy directory. The move will be an atomic operation or at least a lot faster than the upload.

I deploy archives by rsync'ing to ~/deployment-unit/ and then running a remote script over ssh to do the final move into JBoss's deployment directory.




回答4:


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)




回答5:


Ok, I finally found the solution to my problem. It seems that there's a bug in Eclipse which prevent the creation of the .settings/org.eclipse.wst.common.component file. This file should be created when setting the EJB3 and Java6 facets in project properties.

Here is an org.eclipse.wst.common.component example file :

<?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.




回答6:


Sometimes this errors shows because of version of compilation of jar/ear difers from the jdk on the server.




回答7:


I have experienced the same problem with JBoss 5.1.0.GA and Seam 2.1.1.GA. The JDK is java jdk1.6.0._07 for both Eclipse 3.5 and JBoss.

I was able to fix the problem. Maybe the origin of the problem has to do with you concrete case, or may not, but in any event, I thought that it may help.

I am creating the application EAR file using the build file that is included in the Seam installation examples; my build file it is a modified version of the one that comes with the bookings example. This sampl build file does an include to the build file that is common to all examples. It provides a lot of functionality that you can take advantage to create your distribution files.

The common build examples offers several fileset and path entries that you can override to include the libraries that are unique to your project.

Concretely, I was overriding "build.classpath.extras" and "ear.lib.extras".

I wanted to include a determined library in the EJB jar file that gets packaged into the EAR file (the jar file where my model and action classes are); so I just overrided "jar.extras" in my build file.

At that time is when I suffered this problem. Although my desired library in the root was copied into the root folder of the EJB jar file, apparently without problems, JBoss was dropping this error message.

So I just stopped using "jar.extras", and I moved the reference to the desired library to "build.classpath.extras": the effect of this action was that the the library was copied to the \lib folder of the EAR file. Now the application seems to work well, and the problem dissapeared.




回答8:


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).




回答9:


I solved this problem by running the server with the same JDK as i used to compile/build the EAR.




回答10:


I added below mentioned code in web.xml under yourServletName and the error got removed

<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>



回答11:


Are you able to open the ear file outside of JBoss (using WinZip or WinRAR)? It could be that the zip file is corrupted.

You could try writing a little test program using java.util.zip.ZipFile.open() and see if you can debug this in a more isolated situation.




回答12:


Could this be a permissions issue? I see you're running under Mac OS. When you successfully open the EAR file, what user are you running as? When you run JBoss, what user does it run as? Does it have read access to the file?




回答13:


I also have this, but when I add an maven-war-plugin and maven-ejb-plugin to my projects everything works again...




回答14:


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!




回答15:


I just discovered that if you don't specify a version number at the maven-war-plugin it will use some kind of alpha version. give it the version number 2.0, for me that worked.




回答16:


Well, I'm facing the same problem for three days.. look at your classpath for files with .rar extentions or another type of these files, in my case, I remove a .rar file from my classpath and everthing works great.




回答17:


I had the same problem on my Mac. My windows dev machine (client at work :-/) is too slow to run GateIN and eclipse so I installed GateIN on my Macbooc Pro and let eclipse copy the ear to it when built. I saw on the console: exception in the zip.

So I decided to investigate if I could perhaps open the archive using Stuffit Manager. The moment I opened it, apparently the file got 'touched' somehow and the GateIN scanner, detecting the change immediately redeployed, this time without error. So I guess that the Mac was simply too fast to try to redeploy before the ear was fully copied... If you have a problem, just use the touch command...




回答18:


I've seen nested jars do this too (jar within another jar, or an empty jar). In my case it was a microsoft sql jdbc driver jar. The OP's seems to be TwitterPoCEJB.jar, by looking at the stack trace.

There are a lot of things that can cause this though, as mentioned previously simply a bad zip, etc..

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).




回答19:


Helpful http://community.jboss.org/message/205738




回答20:


We fixed this issue by updating from jdk1.6.0._06 to jdk1.6.0._26. The jar was packed with _26 and deployed fine there in JBoss 6.0. However, our customer could not deploy with _06. Hope that helps!




回答21:


Had the same problem, using JBoss 4.4.2 and building my app with maven-war-plugin (specifyng as outputDirectory the JBoss deploy dir). It seems that JBoss tries to reload a partially copied war, because its ScannerThread activates while maven is still building the war. I partially resolved increasing the scan time from 5000 msec (the default) to 15 secs. This does not solve the problem, but at least it happens less frequently!

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



回答22:


May be its your web.xml file problem, i'm also face same kind of issue, After a lot of different tries, I was about to go down the road discussed another article about the web.xml and web-app 3.0. This got me to thinking and I checked out my web.xml. Sure enough, the following line was right there at the top.

<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">

I changed over to a 2.5 web-app spec. Both the WAR and EAR would not deploy.

<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">



回答23:


I have the problem, but it is due to their being zip files down in the webapp. When Eclipse tries to deploy the webapp to the dev tomcat server, it is trying to unzip the zip files. Yes, I inherited this webapp. Now I'll try to add it to a filter to keep this from happening, wish me luck.




回答24:


I had the same error when deploying a war, for me it was a problem related to the extraction of wildfly archive using 'z' option in tar, I typed

    tar -xvzf wildfly_v_.tar.gz

then I removed and reinstalled all but this time with

    tar -xvf wildfly_v_.tar.gz 

after configuration I deployed and the problem disappeared - I think it was an issue related to gzip




回答25:


I had this exact issue and discovered that I had corrupt/empty jar files in the WEB-INF/lib directory. Once I replaced each with a good copy, deployment went off without a hitch.



来源:https://stackoverflow.com/questions/646322/jboss5-cannot-deploy-due-to-java-util-zip-zipexception-error-in-opening-zip-fi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!