java.util.zip.ZipException: Error opening file When Deploying an Application to Weblogic Server

Posted by lmestre on Oracle Blogs See other posts from Oracle Blogs or by lmestre
Published on Mon, 21 Oct 2013 21:44:46 +0000 Indexed on 2013/10/21 21:59 UTC
Read the original article Hit count: 268

Filed under:
The latest weeks we had a hard time trying to solve a deployment issue.

* WebLogic Server 10.3.6
* Target: WLS Cluster


<21-10-2013 05:29:40 PM CLST> <Error> <Console> <BEA-240003> <Console encountered the following error weblogic.management.DeploymentException:
        at weblogic.servlet.internal.WarDeploymentFactory.findOrCreateComponentMBeans(WarDeploymentFactory.java:69)
        at weblogic.application.internal.MBeanFactoryImpl.findOrCreateComponentMBeans(MBeanFactoryImpl.java:48)
        at weblogic.application.internal.MBeanFactoryImpl.createComponentMBeans(MBeanFactoryImpl.java:110)
        at weblogic.application.internal.MBeanFactoryImpl.initializeMBeans(MBeanFactoryImpl.java:76)
        at weblogic.management.deploy.internal.MBeanConverter.createApplicationMBean(MBeanConverter.java:89)
        at weblogic.management.deploy.internal.MBeanConverter.createApplicationForAppDeployment(MBeanConverter.java:67)
        at weblogic.management.deploy.internal.MBeanConverter.setupNew81MBean(MBeanConverter.java:315)
        at weblogic.deploy.internal.targetserver.operations.ActivateOperation.compatibilityProcessor(ActivateOperation.java:81)
        at weblogic.deploy.internal.targetserver.operations.AbstractOperation.setupPrepare(AbstractOperation.java:295)
        at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:97)
        at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217)
        at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:747)
        at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1216)
        at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:250)
        at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
        at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:171)
        at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:13)
        at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:46)
        at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
Caused by: java.util.zip.ZipException: Error opening file - C:\Oracle\Middleware\user_projects\domains\MyDomain\servers\MyServer\stage\myapp\myapp.war Message - error in opening zip file
        at weblogic.servlet.utils.WarUtils.existsInWar(WarUtils.java:87)
        at weblogic.servlet.utils.WarUtils.isWebServices(WarUtils.java:76)
        at weblogic.servlet.internal.WarDeploymentFactory.findOrCreateComponentMBeans(WarDeploymentFactory.java:61)

So the first idea you have with that error is that the war file is corrupted or has incorrect privileges.        

We tried:
1. Unzipping the  war file, the file was perfect.
2. Checking the size, same size as in other environments.
3. Checking the ownership of the file, same as in other environments.
4. Checking the permissions of the file, same as other applications.

Then we accepted the file was fine, so we tried enabling some deployment debugs, but no clues.

We also tried:

1. Delete all contents of <MyDomain/servers/<MyServer>/tmp> a and <MyDomain/servers/<MyServer>/cache> folders, the issue persisted.
2. When renaming the application the deployment was sucessful
3. When targeting to the Admin Server, deployment was also working.
4. Using 'Copy this application onto every target for me' didn't help either.


Finally, my friend 'Test Case' solved the issue again.

I saw this name in the config.xml

<jdbc-system-resource>
    <name>myapp</name>
    <target></target>
    <descriptor-file-name>jdbc/myapp-jdbc.xml</descriptor-file-name>
  </jdbc-system-resource>



So, it turned out that customer had created a DataSource with the same name as the application 'myapp' in the above example.

By deleting the datasource and created another exact DataSource with a different name the issue was solved.

At this point, Do you know Why 'java.util.zip.ZipException: Error opening file' was occurring?

Because all names is WebLogic Server need to be unique.

References:

http://docs.oracle.com/cd/E23943_01/web.1111/e13709/setup.htm
"Assigning Names to WebLogic Server Resources
Make sure that each configurable resource in your WebLogic Server environment has a unique name. Each, domain, server, machine, cluster, JDBC data source, virtual host, or other resource must have a unique name."

Enjoy!

© Oracle Blogs or respective owner

Related posts about /Oracle