I'm trying to deploy an EAR file to a Glassfish 5 server. The exact version is GlassFish Server Open Source Edition 5.0 (build 25)
. The deploy is done via the admin GUI and lists one additional library that has been placed in the domain's applib folder. When attempting to deploy, it immediately fails with a message of the form Error occurred during deployment: java.io.IOException: invalid zip file: file:/C:/glassfish5/glassfish/tmp/(ear_file_name).ear. Please see server.log for more details.
The file name will be that of the EAR file with some form of timestamp or random number after it. I checked in the temp directory and can see that an EAR file of 0 bytes in size was created there. Initially this was the Windows temp folder and I suspected an access issue, so I set the JVM to use a different folder for temporary files as you can see above. This failed as well. I tried running Glassfish with a user with admin rights, again to no avail.
What can be done to fix this?
Additional information:
- The EAR file is on the same host as the Glassfish server, it's not uploaded to the Glassfish admin console via some remote host. I'm opening the GUI on the localhost (it's a Windows machine I'm accessing via remote desktop).
- I'm not deploying via Netbeans. I'm deploying via the Glassfish admin console, default port 4848. The browser is Google Chrome.
- Deploying via command line using the deploy command in the
asadmin
prompt (or directly viaasadmin deploy --libraries=[jar in applibs] [ear file]
) works fine.
The log file from the server at the time of deploying is below:
[2019-07-17T17:16:48.174+0200] [glassfish 5.0] [INFO] [] [org.glassfish.admingui] [tid: _ThreadID=46 _ThreadName=admin-listener(4)] [timeMillis: 1563376608174] [levelValue: 800] [[
GUI deployment: uploadToTempfile]]
[2019-07-17T17:16:48.175+0200] [glassfish 5.0] [INFO] [] [org.glassfish.admingui] [tid: _ThreadID=46 _ThreadName=admin-listener(4)] [timeMillis: 1563376608175] [levelValue: 800] [[
uploadFileName=Test-app-ear-3.0.0.0-SNAPSHOT.ear]]
[2019-07-17T17:16:48.177+0200] [glassfish 5.0] [INFO] [] [] [tid: _ThreadID=46 _ThreadName=Thread-8] [timeMillis: 1563376608177] [levelValue: 800] [[
================== availabilityEnabled skipped ]]
[2019-07-17T17:16:48.183+0200] [glassfish 5.0] [WARNING] [NCLS-DEPLOYMENT-00019] [javax.enterprise.system.tools.deployment.common] [tid: _ThreadID=47 _ThreadName=admin-listener(5)] [timeMillis: 1563376608183] [levelValue: 900] [[
file open failure; file = file:/C:/glassfish5/glassfish/tmp/Test-app-ear-31280879560892113076.0.0.0-SNAPSHOT.ear]]
[2019-07-17T17:16:48.183+0200] [glassfish 5.0] [WARNING] [NCLS-DEPLOYMENT-00020] [javax.enterprise.system.tools.deployment.common] [tid: _ThreadID=47 _ThreadName=admin-listener(5)] [timeMillis: 1563376608183] [levelValue: 900] [[
exception message: zip file is empty -- invalid zip file: invalid zip file: file:/C:/glassfish5/glassfish/tmp/Test-app-ear-31280879560892113076.0.0.0-SNAPSHOT.ear]]
[2019-07-17T17:16:48.185+0200] [glassfish 5.0] [WARNING] [NCLS-DEPLOYMENT-00019] [javax.enterprise.system.tools.deployment.common] [tid: _ThreadID=47 _ThreadName=admin-listener(5)] [timeMillis: 1563376608185] [levelValue: 900] [[
file open failure; file = file:/C:/glassfish5/glassfish/tmp/Test-app-ear-31280879560892113076.0.0.0-SNAPSHOT.ear]]
[2019-07-17T17:16:48.185+0200] [glassfish 5.0] [WARNING] [NCLS-DEPLOYMENT-00020] [javax.enterprise.system.tools.deployment.common] [tid: _ThreadID=47 _ThreadName=admin-listener(5)] [timeMillis: 1563376608185] [levelValue: 900] [[
exception message: zip file is empty -- invalid zip file: invalid zip file: file:/C:/glassfish5/glassfish/tmp/Test-app-ear-31280879560892113076.0.0.0-SNAPSHOT.ear]]
[2019-07-17T17:16:48.187+0200] [glassfish 5.0] [WARNING] [NCLS-DEPLOYMENT-00019] [javax.enterprise.system.tools.deployment.common] [tid: _ThreadID=47 _ThreadName=admin-listener(5)] [timeMillis: 1563376608187] [levelValue: 900] [[
file open failure; file = file:/C:/glassfish5/glassfish/tmp/Test-app-ear-31280879560892113076.0.0.0-SNAPSHOT.ear]]
[2019-07-17T17:16:48.187+0200] [glassfish 5.0] [WARNING] [NCLS-DEPLOYMENT-00020] [javax.enterprise.system.tools.deployment.common] [tid: _ThreadID=47 _ThreadName=admin-listener(5)] [timeMillis: 1563376608187] [levelValue: 900] [[
exception message: zip file is empty -- invalid zip file: invalid zip file: file:/C:/glassfish5/glassfish/tmp/Test-app-ear-31280879560892113076.0.0.0-SNAPSHOT.ear]]
[2019-07-17T17:16:48.187+0200] [glassfish 5.0] [SEVERE] [] [javax.enterprise.system.core] [tid: _ThreadID=47 _ThreadName=admin-listener(5)] [timeMillis: 1563376608187] [levelValue: 1000] [[
java.io.IOException: invalid zip file: file:/C:/glassfish5/glassfish/tmp/Test-app-ear-31280879560892113076.0.0.0-SNAPSHOT.ear
java.io.IOException: invalid zip file: file:/C:/glassfish5/glassfish/tmp/Test-app-ear-31280879560892113076.0.0.0-SNAPSHOT.ear
at com.sun.enterprise.deployment.deploy.shared.InputJarArchive$ArchiveJarEntrySource.<init>(InputJarArchive.java:582)
at com.sun.enterprise.deployment.deploy.shared.InputJarArchive$ArchiveJarEntrySource.<init>(InputJarArchive.java:573)
at com.sun.enterprise.deployment.deploy.shared.InputJarArchive.createEntryEnumeration(InputJarArchive.java:451)
at com.sun.enterprise.deployment.deploy.shared.InputJarArchive.entries(InputJarArchive.java:203)
at com.sun.enterprise.deployment.deploy.shared.InputJarArchive.entries(InputJarArchive.java:182)
at org.glassfish.internal.deployment.GenericHandler.expand(GenericHandler.java:91)
at org.glassfish.javaee.full.deployment.EarHandler.expand(EarHandler.java:156)
at com.sun.enterprise.v3.server.ApplicationLifecycle.getContext(ApplicationLifecycle.java:1810)
at com.sun.enterprise.v3.server.ApplicationLifecycle.access$200(ApplicationLifecycle.java:115)
at com.sun.enterprise.v3.server.ApplicationLifecycle$DeploymentContextBuidlerImpl.build(ApplicationLifecycle.java:1673)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:426)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:540)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:536)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Unknown Source)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:535)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:566)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:558)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Unknown Source)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:557)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1465)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:110)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1847)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1723)
at org.glassfish.admin.rest.utils.ResourceUtil.runCommand(ResourceUtil.java:254)
at org.glassfish.admin.rest.utils.ResourceUtil.runCommand(ResourceUtil.java:232)
at org.glassfish.admin.rest.utils.ResourceUtil.runCommand(ResourceUtil.java:276)
at org.glassfish.admin.rest.resources.TemplateListOfResource.createResource(TemplateListOfResource.java:134)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:76)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:148)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:191)
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:200)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:103)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:493)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:415)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:104)
at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:277)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:272)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:268)
at org.glassfish.jersey.internal.Errors.process(Errors.java:316)
at org.glassfish.jersey.internal.Errors.process(Errors.java:298)
at org.glassfish.jersey.internal.Errors.process(Errors.java:268)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:289)
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:256)
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:703)
at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:377)
at org.glassfish.admin.rest.adapter.RestAdapter$2.service(RestAdapter.java:316)
at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:179)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:463)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:168)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:206)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:180)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:242)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:539)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:593)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:573)
at java.lang.Thread.run(Unknown Source)
]]
[2019-07-17T17:16:48.192+0200] [glassfish 5.0] [INFO] [] [org.glassfish.admingui] [tid: _ThreadID=46 _ThreadName=admin-listener(4)] [timeMillis: 1563376608192] [levelValue: 800] [[
Exception Occurred :Error occurred during deployment: java.io.IOException: invalid zip file: file:/C:/glassfish5/glassfish/tmp/Test-app-ear-31280879560892113076.0.0.0-SNAPSHOT.ear. Please see server.log for more details.]]