title: Errors while deploying an enterprise application on glassfish's admin console
body: <p>I created an enterprise application using session Beans, Data Assess Object(DAO) and a remote interface embeded in a java class library, and a .war file as the application client, when I deploy it on Netbeans IDE it works fine and deploys.  However, when I undeploy it and try to deploy it through uploading the .ear file in the Glassfish's admin console panel it give me the error:</p>
  
  <pre><code> SEVERE: LDR5203: An error occurred while adding URL   [file:/C:/Users/MACDONALD/.netbeans/7.1.2/config/GF3/domain1/applications/Jerger/lib/Jergli    b.jar] to the 
  EJB class loader. Please check the content of this URL. 
  SEVERE: LDR5200:MalformedURLException.
  java.util.zip.ZipException: zip file is empty   
  at java.util.zip.ZipFile.open(Native Method)    
  at java.util.zip.ZipFile.&lt;init&gt;(ZipFile.java:214)   
  at java.util.zip.ZipFile.&lt;init&gt;(ZipFile.java:144)   
  at java.util.jar.JarFile.&lt;init&gt;(JarFile.java:152)   
  at java.util.jar.JarFile.&lt;init&gt;(JarFile.java:116)   
  at com.sun.enterprise.loader.ASURLClassLoader$ProtectedJarFile.&lt;init&gt;  (ASURLClassLoader.java:913)  
  at com.sun.enterprise.loader.ASURLClassLoader$URLEntry.init(ASURLClassLoader.java:980)  
  at com.sun.enterprise.loader.ASURLClassLoader$URLEntry.&lt;init&gt;(ASURLClassLoader.java:971)    
  at com.sun.enterprise.loader.ASURLClassLoader.appendURL(ASURLClassLoader.java:298)  
  at com.sun.enterprise.loader.ASURLClassLoader.addURL(ASURLClassLoader.java:280) 
  at org.glassfish.javaee.full.deployment.EarLibClassLoader.&lt;init&gt;(EarLibClassLoader.java:57) 
  at org.glassfish.javaee.full.deployment.EarHandler$1.run(EarHandler.java:333)   
  at org.glassfish.javaee.full.deployment.EarHandler$1.run(EarHandler.java:330)   
  at java.security.AccessController.doPrivileged(Native Method)   
  at org.glassfish.javaee.full.deployment.EarHandler.getClassLoader(EarHandler.java:330)  
  at   org.glassfish.deployment.common.DeploymentContextImpl.createClassLoader(DeploymentContextImpl.java:218)    
  at org.glassfish.deployment.common.DeploymentContextImpl.createDeploymentClassLoader(DeploymentContextImpl.java:199)    
  at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:346)  
  at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)  
  at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389) 
  at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348)  
  at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)  
  at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085) 
  at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95) 
  at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)  
  at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)  
  at org.glassfish.admin.rest.ResourceUtil.runCommand(ResourceUtil.java:214)  
  at org.glassfish.admin.rest.ResourceUtil.runCommand(ResourceUtil.java:207)  
  at org.glassfish.admin.rest.resources.TemplateListOfResource.createResource(TemplateListOfResource.java:148)    
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)    
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)    
  at java.lang.reflect.Method.invoke(Method.java:601) 
  at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60) 
  at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)    
  at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75) 
  at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)  
  at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:134)  
  at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
  at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:134)  
  at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
  at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
  at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
  at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84) 
  at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)   
  at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)   
  at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)    
  at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)    
  at com.sun.jersey.server.impl.container.grizzly.GrizzlyContainer._service(GrizzlyContainer.java:182)    
  at com.sun.jersey.server.impl.container.grizzly.GrizzlyContainer.service(GrizzlyContainer.java:147) 
  at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:148)   
  at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)   
  at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)   
  at com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(ContainerMapper.java:354) 
  at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)    
  at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849) 
  at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746) 
  at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)  
  at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)   
  at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
  at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)  
  at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)   
  at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)    
  at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)    
  at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)    
  at com.sun.grizzly.ContextTask.run(ContextTask.java:71) 
  at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)   
  at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)  
  at java.lang.Thread.run(Thread.java:722)
  WARNING: DPL8004: file open failure; file =    file:/C:/Users/MACDONALD/.netbeans/7.1.2/config/GF3/domain1/applications/Jerger/lib/Jerglib    .jar
  WARNING: zip file is empty --  invalid zip file:     file:/C:/Users/MACDONALD/.netbeans/7.1.2/config/GF3/domain1/applications/Jerger/lib/Jerglib    .jar
  WARNING: DPL8004: file open failure; file =    file:/C:/Users/MACDONALD/.netbeans/7.1.2/config/GF3/domain1/applications/Jerger/lib/Jerglib    .jar
  WARNING: zip file is empty --  invalid zip file:    file:/C:/Users/MACDONALD/.netbeans/7.1.2/config/GF3/domain1/applications/Jerger/lib/Jerglib    .jar
  SEVERE: Exception while parsing file f   file:/C:/Users/MACDONALD/.netbeans/7.1.2/config/GF3/domain1/applications/Jerger/lib/Jerglib    .jar
  java.lang.NullPointerException  
  at com.sun.enterprise.deployment.deploy.shared.InputJarArchive$ArchiveJarEntrySource.  &lt;init&gt;(InputJarArchive.java:573) 
  at com.sun.enterprise.deployment.deploy.shared.InputJarArchive$ArchiveJarEntrySource.&lt;init&gt;(InputJarArchive.java:565)   
  at   com.sun.enterprise.deployment.deploy.shared.InputJarArchive.createEntryEnumeration(InputJarArchive.java:443)   
  at com.sun.enterprise.deployment.deploy.shared.InputJarArchive.entries(InputJarArchive.java:196)    
  at com.sun.enterprise.deployment.deploy.shared.InputJarArchive.entries(InputJarArchive.java:175)    
  at com.sun.enterprise.v3.server.ReadableArchiveScannerAdapter.onSelectedEntries(ReadableArchiveScannerAdapter.java:128) 
  at org.glassfish.hk2.classmodel.reflect.Parser.doJob(Parser.java:348)   
  at org.glassfish.hk2.classmodel.reflect.Parser.access$300(Parser.java:70)   
  at org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:307)   
  at org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:296)  
  at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)   
  at java.util.concurrent.FutureTask.run(FutureTask.java:166) 
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)  
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)  
  at java.lang.Thread.run(Thread.java:722)
  WARNING: DPL8004: file open failure; file =   file:/C:/Users/MACDONALD/.netbeans/7.1.2/config/GF3/domain1/applications/Jerger/lib/Jerglib    .jar
  WARNING: zip file is empty --  invalid zip file: file:/C:/Users/MACDONALD/.netbeans/7.1.2/config/GF3/domain1/applications/Jerger/lib/Jerglib    .jar
  WARNING: DPL8004: file open failure; file = file:/C:/Users/MACDONALD/.netbeans/7.1.2/config/GF3/domain1/applications/Jerger/lib/Jerglib    .jar
  WARNING: zip file is empty --  invalid zip file: file:/C:/Users/MACDONALD/.netbeans/7.1.2/config/GF3/domain1/applications/Jerger/lib/Jerglib    .jar
  SEVERE: Exception while deploying the app [Jerger]
  SEVERE: java.lang.NullPointerException  
  at com.sun.enterprise.deployment.deploy.shared.InputJarArchive$ArchiveJarEntrySource.&lt;init&gt;(InputJarArchive.java:573)   
  at com.sun.enterprise.deployment.deploy.shared.InputJarArchive$ArchiveJarEntrySource.&lt;init&gt;(InputJarArchive.java:565)   
  at com.sun.enterprise.deployment.deploy.shared.InputJarArchive.createEntryEnumeration(InputJarArchive.java:443) 
  at com.sun.enterprise.deployment.deploy.shared.InputJarArchive.entries(InputJarArchive.java:196)    
  at com.sun.enterprise.deployment.deploy.shared.InputJarArchive.access$100(InputJarArchive.java:73)  
  at com.sun.enterprise.deployment.deploy.shared.InputJarArchive$1.enumeration(InputJarArchive.java:159)  
  at com.sun.enterprise.deployment.deploy.shared.InputJarArchive$CollectionWrappedEnumeration.&lt;init&gt;(InputJarArchive.java:716)    
  at com.sun.enterprise.deployment.deploy.shared.InputJarArchive.getDirectories(InputJarArchive.java:154) 
  at org.glassfish.deployment.common.DeploymentUtils.isEARFromIntrospecting(DeploymentUtils.java:338) 
  at org.glassfish.deployment.common.DeploymentUtils.isEAR(DeploymentUtils.java:326)  
  at org.glassfish.deployment.common.DeploymentUtils.hasResourcesXML(DeploymentUtils.java:255)
  at org.glassfish.deployment.common.DeploymentUtils.hasResourcesXML(DeploymentUtils.java:268)
  at com.sun.enterprise.connectors.connector.module.ResourcesCompositeSniffer.handles(ResourcesCompositeSniffer.java:77)  
  at org.glassfish.internal.deployment.GenericCompositeSniffer.handles(GenericCompositeSniffer.java:80)   
  at com.sun.enterprise.v3.server.SnifferManagerImpl.getCompositeSniffers(SnifferManagerImpl.java:190)    
  at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:603) 
  at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:368)  
  at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)  
  at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389) 
  at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348)  
  at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)  
  at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085) 
  at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95) 
  at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)  
  at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)  
  at org.glassfish.admin.rest.ResourceUtil.runCommand(ResourceUtil.java:214)  
  at org.glassfish.admin.rest.ResourceUtil.runCommand(ResourceUtil.java:207)  
  at org.glassfish.admin.rest.resources.TemplateListOfResource.createResource(TemplateListOfResource.java:148)    
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)    
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)    
  at java.lang.reflect.Method.invoke(Method.java:601) 
  at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60) 
  at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)    
  at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75) 
  at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)  
  at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:134)  
  at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
  at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:134)  
  at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
  at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
  at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
  at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84) 
  at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)   
  at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)   
  at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)    
  at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)    
  at com.sun.jersey.server.impl.container.grizzly.GrizzlyContainer._service(GrizzlyContainer.java:182)    
  at com.sun.jersey.server.impl.container.grizzly.GrizzlyContainer.service(GrizzlyContainer.java:147) 
  at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:148)   
  at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)   
  at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)   
  at com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(ContainerMapper.java:354) 
  at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)    
  at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849) 
  at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746) 
  at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)  
  at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)   
  at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
  at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)  
  at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)   
  at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)    
  at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)    
  at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)    
  at com.sun.grizzly.ContextTask.run(ContextTask.java:71) 
  at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)   
  at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)  
  at java.lang.Thread.run(Thread.java:722)
  SEVERE: Exception while deploying the app [Jerger]
  INFO: Exception Occurred :Error occurred during deployment: Exception while deploying   the app [Jerger]. Please see server.log for more details.
  </code></pre>
  
  <p>Can someone tell me what could be the problem, it works fine when I deployed with Netbeans IDE but doesn't when I try this way.</p>