Java.util.zip.ZipException in deploying Glassfish applications (v3)
I have a strange exception from my EJB3.1 application, during application deployment the ZipException
:
[#|2010-05-15T16:01:44.688+0100|SEVERE|glassfish3.0.1|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=22;_ThreadName=Thread-1;|WEB9051: Error trying to scan the classes at /Users/kevin/Documents/netbeans/WebAlbums/trunk/WebAlbums3/WebAlbums3-ea/dist/gfdeploy/WebAlbums3-Service.jar for annotations in which a ServletContainerInitializer has expressed interest
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:114)
at java.util.jar.JarFile.<init>(JarFile.java:133)
at java.util.jar.JarFile.<init>(JarFile.java:70)
at org.glassfish.web.loader.ServletContainerInitializerUtil.getInitializerList(ServletContainerInitializerUtil.java:255)
at org.apache.catalina.core.StandardContext.callServletContainerInitializers(StandardContext.java:5331)
at com.sun.enterprise.web.WebModule.callServletContainerInitializers(WebModule.java:550)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5263)
at com.sun.enterprise.web.WebModule.start(WebModule.java:499)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:928)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:912)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:694)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1947)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1619)
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:90)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:126)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:241)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:236)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:339)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:183)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:272)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:305)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:320)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1176)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$900(CommandRunnerImpl.java:83)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1224)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:365)
at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:204)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:100)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
at java.lang.Thread.run(Thread.java:637)
|#]
I really don't know how to investigate this error; I know this is not related to Glassfish installation (same problem on Ubuntu and Mac).
EDIT: (classpath details seem to be useless)
the problem with ... / WebAlbums 3-ea / dist / gfdeploy / WebAlbums3-Service.jar is that this file is not actually present where Glassfish is looking for it ... Instead, I have a folder called WebAlbums3-Service_jar
(I am using Netbeans 6.8, Glassfish v3, Servlet3, EJB 3.1, JPA / Hibernate)
thanks for the help
EDIT: The issue (both ZipException and EJBs already loaded) was solved by fetching the EJB interfaces outside of where the implementation was defined (the implementation classes were loaded with each of the modules, hence the EJB exception)
a source to share
I've seen several references to this issue on the internet, like this one that mentions it as non-blocking:
If you get the following error after deploying an EAR, don't worry, it's quite normal: "WEB9051: Error while trying to scan classes in ... /eclipseApps/Seven/SevenEJB.jar for annotations in which ServletContainerInitializer expressed interest." See here.
And also in Issue 11149 or Issue 11341 . Your case seems different, but if it is not (if you have a jar with a "+" in the filename), it should be fixed in GF v3.0.1.
If this does not apply to you, I suggest creating a problem . Even if they are not blocking, this is clearly not normal.
a source to share
Error while trying to scan classes in / Users / kevin / Documents / netbeans / WebAlbums / trunk / WebAlbums 3 / WebAlbums3-ea / dist / gfdeploy / WebAlbums3-Service.jar for annotations where the servlet-container-initializer showed interest
java.util.zip.ZipException: error in opening zip file
It looks like the JAR file is corrupted. Recompile / replace it. If you use FTP during deployment, make sure you send binaries as binary data, not text data.
It can also be caused by the temporary storage being full or not writable.
Update : Google will find out that this could be JDK specific as well. Try updating your JDK to the latest version.
a source to share
Can I open a zip file using winzip or 7zip? Can you open the file programmatically with ZipFile? I'm sure one of these questions will be evaluated as false.
I had some strange zip errors a while ago related to special characters in the names of the contained file (where special means, non-ASCII characters).
a source to share
Having '_' instead of '.' is normal when you are using exploded deployment (which is how the deployed artifact is supposed to be deployed)
It might be "normal", but GF is looking for a file called myEJB.jar, which isn't there. There is only an exploded artifact, which is then not deployed.
The issue (both ZipException and EJBs already loaded) was solved by fetching the EJB interfaces outside of where the implementation was defined (the implementation classes were loaded with each of the modules, hence the EJB exception)
Not sure if I understand how this cures the above problem. My implementation class is a single message bean.
a source to share