users@glassfish.java.net

Re: "Cannot write to an JAR archive open for reading" Exception?

From: Hong Zhang <Hong.Zhang_at_Sun.COM>
Date: Mon, 26 Mar 2007 21:25:42 -0400

Hi, Edek

>currently I am trying to deploy my EAR (which composes of 2 wars and 4 ejb jars plus a few libs) module by module to find out which one is causing trouble. So far I have a different problem with JNDI and MDBs. When it pin the topic problem down I may be able to write a test for it, now I do not
>know where to start writing the test.
>The application is not large, beginning of development. BTW, I'm migrating from JBoss,
>to make sure it is portable from the beginning (actually, some of the code has not been deployed on JBoss yet)
>
>While I like solving problems on my own, I write here to get help, so I'll either compile a test
>that causes the problem or share the file.
>Is there no hint where to look judging from the call stack? To me it seems it opens a JAR
>(extracted from EAR and copied somewhere, I imagine) and ... ?
>
>
The top line in the stack trace just catch the exception and log the
message, so not much clue there. I did do a search in the glassfish
source code and the only few occurrences of this error string is from
(glassfish/appserv-commons/src/java/com/sun/enterprise/deployment/deploy/shared/)InputJarArchive,
by throwing UnsupportedOperationException with this error message.
Presumably, the UnsupportedOperationException should never be
encountered in the normal code path. I am not sure why those unsupported
methods will be invoked in your case, that's why I want to get a
reproducible test case to take a closer look.

>The problem is consistent, and also appears on 9.0_01 (build b02-p01)
>Silly question: what I should I look for in the logs (what level?)?
>
>
You can set the log level for deployment to "FINE" to see if you have
more messages in the server.log. The default level is INFO.

I can understand the frustration associated with the migration, but
hopefully after this initial exercise, things will be a lot easier onward.

Thanks for your patience.

- Hong

>
>
>>Hi, Edek
>>It's hard to tell from the stack trace. Is there
>> anything more in the
>>erver.log which is related to this?
>>Do you see this problem consistently when you
>> tried to deploy your
>>rchive or only intermittently? Is it possible you
>>could share your
>>application or provide a small test case for us to
>>look into this?
>>
>> Thanks,
>> Hong
>>glassfish_at_javadesktop.org wrote:
>>
>>
>>
>>>Hello,
>>>
>>>my EAR passed all verifier tests, but during
>>>
>>>
>>deployment I get this exception.
>>
>>
>>>Does anyone have a clue what is wrong?
>>>
>>>This is AS 9.1 b33e-beta, on Linux, jdk 1.6.0
>>>
>>>[#|2007-03-26T22:25:17.146+0200|SEVERE|sun-appserver9
>>>
>>>
>>.1|javax.enterprise.system.tools.deployment|_ThreadID=
>>33;_ThreadName=Thread-121;_RequestID=e5e13cb4-9b3f-4bc
>>3-808b-c6b5b877ce65;|Exception occured in J2EEC Phase
>>
>>
>>>com.sun.enterprise.deployment.backend.IASDeploymentEx
>>>
>>>
>>ception: Fatal Error from EJB Compiler -- Failed to
>>save deployment descriptor for: XXXX
>>
>>
>>>cause: Cannot write to an JAR archive open for
>>>
>>>
>>reading
>>
>>
>>> at
>>>
>>>
>>com.sun.enterprise.instance.BaseManager.saveAppDescrip
>>tor(BaseManager.java:737)
>>
>>
>>> at
>>>
>>>
>>com.sun.enterprise.deployment.backend.EJBCompiler.preD
>>eployApp(EJBCompiler.java:285)
>>
>>
>>> at
>>>
>>>
>>com.sun.enterprise.deployment.backend.EJBCompiler.comp
>>ile(EJBCompiler.java:214)
>>
>>
>>> at
>>>
>>>
>>com.sun.enterprise.deployment.backend.AppDeployer.runE
>>JBC(AppDeployer.java:299)
>>
>>
>>> at
>>>
>>>
>>com.sun.enterprise.deployment.backend.AppDeployer.depl
>>oy(AppDeployer.java:220)
>>
>>
>>> at
>>>
>>>
>>com.sun.enterprise.deployment.backend.AppDeployer.doRe
>>questFinish(AppDeployer.java:132)
>>
>>
>>> at
>>>
>>>
>>com.sun.enterprise.deployment.phasing.J2EECPhase.runPh
>>ase(J2EECPhase.java:174)
>>
>>
>>> at
>>>
>>>
>>com.sun.enterprise.deployment.phasing.DeploymentPhase.
>>executePhase(DeploymentPhase.java:95)
>>
>>
>>> at
>>>
>>>
>>com.sun.enterprise.deployment.phasing.PEDeploymentServ
>>ice.executePhases(PEDeploymentService.java:892)
>>
>>
>>> at
>>>
>>>
>>com.sun.enterprise.deployment.phasing.PEDeploymentServ
>>ice.deploy(PEDeploymentService.java:266)
>>
>>
>>> at
>>>
>>>
>>com.sun.enterprise.deployment.phasing.PEDeploymentServ
>>ice.deploy(PEDeploymentService.java:761)
>>
>>
>>> at
>>>
>>>
>>com.sun.enterprise.management.deploy.DeployThread.depl
>>oy(DeployThread.java:174)
>>
>>
>>> at
>>>
>>>
>>com.sun.enterprise.management.deploy.DeployThread.run(
>>DeployThread.java:210)
>>
>>
>>>|#]
>>>
>>>Thanks,
>>>Edek
>>>[Message sent by forum member 'edek234' (edek234)]
>>>
>>>http://forums.java.net/jive/thread.jspa?messageID=209
>>>
>>>
>>937
>>
>>
>>>-----------------------------------------------------
>>>
>>>
>[Message sent by forum member 'edek234' (edek234)]
>
>http://forums.java.net/jive/thread.jspa?messageID=209970
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>
>