[jboss-user] [Microcontainer] - Re: Hot-deployment on AS 5.x

jaikiran do-not-reply at jboss.com
Wed May 13 07:45:02 EDT 2009


Moving our email discussion to the forum. 

Jesper, me and Emanuel were seeing a JVM crash when the application was hot-deployed in a tight loop. This issue (the JVM crash and neither the IOException) does not occur in AS-4.2.x (not yet sure why) but appears to be happening in AS-5. Here's some details:

"Jesper" wrote : 
  | Jesper Pedersen wrote:
  | > Hey.
  | >
  | > Repository information:
  | >
  | > svn co https://svn.jboss.org/repos/jbossprofiler/branches/JBossProfiler2
  | > ant clean web
  | > cp dist/jboss-profiler.war AS5/deploy
  | >
  | > and surf to:
  | >
  | > localhost:8080/jboss-profiler/index.xhtml
  | >
  | > Just keep deploying the .WAR file in tight loop
  | >
  | > Best regards,
  | >  Jesper
  | >   
  | 

"jaikiran" wrote : 
  | I have managed to narrow this down to the VFS handling of ZipFile(entries). Having said that, i would not have expected the JVM to crash, but throw an IOException (as you first reported in the JIRA). Here's what's happening:
  | 
  | 1) HDScanner picks up the archived deployment (.war)
  | 2) VFS starts temping this by extracting the contents of the .war (ZipEntryHandler class). Internally it opens a InputStream for the zip entries.
  | 3) When this processing is in progress, if we hot deploy the .war again, the InputStream that VFS is processing on, becomes stale (and ideally should throw IOException).
  | 4) Finally the error.
  | 
  | Just to check whether i was guessing this right, i deployed the .war in exploded format and i could see that it moved past this and failed a bit later where VFS tried to work on the WEB-INF/lib/*.jar entries (the same zip entry processing logic with the InputStream). It failed with the same JVM crash here too.
  | 
  | So finally just to test, i removed all the jars from the lib folder, updated the web.xml to just contain the welcome-file section and deployed the war in exploded format. All this to ensure that no zip file processing happens. After this, i can successfully deploy this application in a tight loop without any issues - but obviously,  this application is now of no use without any of its functionalities :)
  | 
  | Now that it's been tracked down to the zip file handling, i am going to see how JBossAS-4.x handles this, since we don't see this issue there.
  | 
  | P.S: The java dump during the crash helped in narrowing down this issue:
  | 
  | When deployed as archive :
  | 
  |   | Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
  |   | J  java.nio.Bits.copyToByteArray(JLjava/lang/Object;JJ)V
  |   | J  java.nio.DirectByteBuffer.get([BII)Ljava/nio/ByteBuffer;
  |   | J  java.io.FilterInputStream.read([B)I
  |   | J  org.jboss.virtual.plugins.context.zip.ZipEntryInputStream.read([B)I
  |   | v  ~I2CAdapter
  |   | j  org.jboss.virtual.VFSUtils.copyStream(Ljava/io/InputStream;Ljava/io/OutputStream;)V+53
  |   | j  org.jboss.virtual.VFSUtils.copyStreamAndClose(Ljava/io/InputStream;Ljava/io/OutputStream;)V+2
  |   | v  ~C2IAdapter
  |   | J  org.jboss.virtual.plugins.context.zip.ZipEntryContext.initEntries()V
  |   | v  ~I2CAdapter
  |   | j  org.jboss.virtual.plugins.context.zip.ZipEntryContext.ensureEntries()V+19
  |   | v  ~C2IAdapter
  |   | J  org.jboss.virtual.plugins.context.zip.ZipEntryContext.checkIfModified()V
  |   | J  org.jboss.virtual.plugins.context.zip.ZipEntryContext.getChild(Lorg/jboss/virtual/plugins/context/zip/ZipEntryHandler;Ljava/lang/String;)Lorg/jboss/virtual/spi/VirtualFileHandler;
  |   | J  org.jboss.virtual.plugins.context.AbstractVirtualFileHandler.structuredFindChild(Ljava/lang/String;)Lorg/jboss/virtual/spi/VirtualFileHandler;
  |   | J  org.jboss.virtual.VirtualFile.getChild(Ljava/lang/String;)Lorg/jboss/virtual/VirtualFile;
  |   | v  ~I2CAdapter
  |   | j  org.jboss.deployers.vfs.plugins.structure.explicit.DeclaredStructure.determineStructure(Lorg/jboss/deployers/vfs/spi/structure/StructureContext;)Z+56
  |   | 
  | 
  | 
  | 
  | When deployed in exploded format (and internally processing *.jar in the lib of WEB-INF):
  | 
  |   | J  java.util.zip.ZipFile.getEntry(JLjava/lang/String;Z)J
  |   | J  java.util.zip.ZipFile.getInputStream(Ljava/util/zip/ZipEntry;)Ljava/io/InputStream;
  |   | J  org.jboss.virtual.plugins.context.zip.ZipFileWrapper.openStream(Ljava/util/zip/ZipEntry;)Ljava/io/InputStream;
  |   | J  org.jboss.virtual.plugins.context.zip.ZipEntryHandler.openStream()Ljava/io/InputStream;
  |   | J  org.jboss.classloading.plugins.vfs.VFSResourceContext.getInputStream()Ljava/io/InputStream;
  |   | J  org.jboss.deployers.plugins.annotations.GenericAnnotationResourceVisitor.visit(Lorg/jboss/classloading/spi/visitor/ResourceContext;)V
  |   | J  org.jboss.classloading.plugins.vfs.VFSResourceVisitor.visit(Lorg/jboss/virtual/VirtualFile;)V
  |   | J  org.jboss.virtual.plugins.vfs.helpers.WrappingVirtualFileHandlerVisitor.visit(Lorg/jboss/virtual/spi/VirtualFileHandler;)V
  |   | J  org.jboss.virtual.plugins.context.AbstractVFSContext.visit(Lorg/jboss/virtual/spi/VirtualFileHandler;Lorg/jboss/virtual/spi/VirtualFileHandlerVisitor;ZZZZLorg/jboss/virtual/VirtualFileFilter;)V
  |   | J  org.jboss.virtual.plugins.context.AbstractVFSContext.visit(Lorg/jboss/virtual/spi/VirtualFileHandler;Lorg/jboss/virtual/spi/VirtualFileHandlerVisitor;ZZZZLorg/jboss/virtual/VirtualFileFilter;)V
  |   | J  org.jboss.virtual.plugins.context.AbstractVFSContext.visit(Lorg/jboss/virtual/spi/VirtualFileHandler;Lorg/jboss/virtual/spi/VirtualFileHandlerVisitor;ZZZZLorg/jboss/virtual/VirtualFileFilter;)V
  |   | 
  | 






View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4230795#4230795

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4230795



More information about the jboss-user mailing list