Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-1053

conf/web.xml gets truncated

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • Major
    • None
    • JBossAS-3.2.6 Final
    • None
    • None

    Description

      SourceForge Submitter: bwallis42 .
      OS: Gentoo Linux, (kernel 2.6.7 and glibc 2.3.3)
      also on Solaris 8.
      JDK: 1.4.2_05 and 1.4.2_01

      When I start JBoss with the classpath including the conf
      directory where the web.xml file is, the web.xml file gets
      truncated.

      This didn't happen in JBoss 3.2.1 but does in 3.2.3.

      Workaround is to either write protect web.xml (and then
      it works fine, no errors either) or remove the conf
      directory from the classpath.

      See the thread in the forums for details, I've copied part
      of that discussion here which describes the problem and
      tries to point to where it might be occuring.

      http://jboss.org/index.html?module=bb&op=viewtopic&t=52741

      --------------------------
      OK, found what it is in our configuration that causes
      web.xml to be overwritten.

      For a reason that I cannot quite remember we have
      always had the server conf directory on our classpath
      when jboss starts up, something to do with using
      ClassLoader.getResource() for properties I think, anyway
      we don't use that anymore. Also when we changed from
      3.2.1 to 3.2.3 we also changed from jetty to tomcat.

      If I take the conf directory off the classpath then the
      web.xml file is not truncated, although it's last modified
      time is still updated.

      On a Solaris system I launched the JVM with truss and
      then matched up the tracing in the JBoss log with the
      truss output and found the following. (the first log shown
      at the end is the jboss log followed with the truss log)

      The first JBoss timestamp at 2004-08-10 14:37:35,460
      corresponds to a time of 123.4634 in the truss log and
      the last JBoss timestamp is a time of 123.5674 in the
      truss log so the jboss tracing overlaps the two truss
      entries shown.

      Notice that the second open call in the truss log has flags
      O_CREATE|O_TRUNC which is going to do exactly that,
      truncate the web.xml file. This second open call fits into
      the time between the last two jboss log entries shown
      which seem to be in the UnifiedClassLoader3.

      That's about as far as I can go as I don't know this area
      of the JBoss code at all.

      Is this a bug I should report? The work around is simple,
      don't put the conf dir on your classpath

      jboss log:
      ======
      2004-08-10 14:37:35,460 TRACE
      [org.jboss.mx.loading.UnifiedClassLoader]
      getResourceLocally(org.jboss.mx.loading.UnifiedClassLoader3@198ee2f

      { url=file:/vobs/NotificationSer vice_build/JAVA_dbg/run/NS_EFD/jboss/deploy/jbossweb-tomcat41.sar/ ,addedOrder=11}

      ), name=web.xml,
      resURL:file:/vobs/NotificationService_build/JAVA_dbg/run/NS_EFD/jboss/co
      nf/web.xml
      2004-08-10 14:37:35,464 TRACE
      [org.jboss.mx.loading.UnifiedClassLoader3] attempt(1)
      was: true for
      :org.jboss.mx.loading.UnifiedClassLoader3@198ee2f

      { url=file:/vobs/Notific ationService_build/JAVA_dbg/run/NS_EFD/jboss/deploy/jbossweb-tomcat41.sar/ ,addedOrder=11}


      2004-08-10 14:37:35,465 TRACE
      [org.jboss.mx.loading.LoadMgr3] registerLoaderThread,
      ucl=org.jboss.mx.loading.UnifiedClassLoader3@198ee2f

      { url=file:/vobs/NotificationServic e_build/JAVA_dbg/run/NS_EFD/jboss/deploy/jbossweb-tomcat41.sar/ ,addedOrder=11}

      , t=Thread[main,5,jboss], prevT=null
      2004-08-10 14:37:35,467 TRACE
      [org.jboss.mx.loading.LoadMgr3] Begin beginLoadTask,
      task=org.jboss.mx.loading.ClassLoadingTask@2c06b2{classname:
      java.io.FileOutputStream, r
      equestingThread: Thread[main,5,jboss],
      requestingClassLoader:
      org.jboss.mx.loading.UnifiedClassLoader3@198ee2f

      { url=file:/vobs/NotificationService_build/JAVA_dbg/run/NS_EF D/jboss/deploy/jbossweb-tomcat41.sar/ ,addedOrder=11}

      , loadedClass: null, loadOrder:
      2147483647, loadException: null, threadTaskCount: 0,
      state: 0}
      2004-08-10 14:37:35,468 TRACE
      [org.jboss.mx.loading.UnifiedClassLoader]
      loadClassLocally, name=java.io.FileOutputStream
      2004-08-10 14:37:35,469 TRACE
      [org.jboss.mx.loading.UnifiedLoaderRepository3]
      cacheLoadedClass, classname:
      java.io.FileOutputStream, class: class
      java.io.FileOutputStream,
      ucl:
      org.jboss.mx.loading.UnifiedClassLoader3@198ee2f

      { url=file:/vobs/NotificationService_build/JAVA_dbg/run/NS_EFD/jboss/deploy/jbossweb-tomcat41.sar/ ,addedOrder=11}


      2004-08-10 14:37:35,470 TRACE
      [org.jboss.mx.loading.LoadMgr3] End beginLoadTask,
      loadClassFromClassLoader
      2004-08-10 14:37:35,472 TRACE
      [org.jboss.mx.loading.LoadMgr3] Begin endLoadTask,
      task=org.jboss.mx.loading.ClassLoadingTask@2c06b2{classname:
      java.io.FileOutputStream, req
      uestingThread: Thread[main,5,jboss],
      requestingClassLoader:
      org.jboss.mx.loading.UnifiedClassLoader3@198ee2f

      { url=file:/vobs/NotificationService_build/JAVA_dbg/run/NS_EFD/ jboss/deploy/jbossweb-tomcat41.sar/ ,addedOrder=11}

      ,
      loadedClass: class
      java.io.FileOutputStream@7a78d3<CodeSource: null>,
      loadOrder: 2147483647, loadException: null, thre
      adTaskCount: 0, state: 4}
      2004-08-10 14:37:35,473 TRACE
      [org.jboss.mx.loading.UnifiedClassLoader3] release(1)
      for :org.jboss.mx.loading.UnifiedClassLoader3@198ee2f

      { url=file:/vobs/NotificationServi ce_build/JAVA_dbg/run/NS_EFD/jboss/deploy/jbossweb-tomcat41.sar/ ,addedOrder=11}


      2004-08-10 14:37:35,474 TRACE
      [org.jboss.mx.loading.UnifiedClassLoader3] released,
      holds: 0
      2004-08-10 14:37:35,522 TRACE
      [org.jboss.mx.loading.UnifiedClassLoader3] attempt(1)
      was: true for
      :org.jboss.mx.loading.UnifiedClassLoader3@198ee2f

      { url=file:/vobs/Notific ationService_build/JAVA_dbg/run/NS_EFD/jboss/deploy/jbossweb-tomcat41.sar/ ,addedOrder=11}

      truss log:
      =======

      19438: 123.5093
      open("/vobs/NotificationService_build/JAVA_dbg/run/NS_EFD/jboss/conf/web.xml",
      O_RDONLY|O_LARGEFILE) = 15
      19438: 123.5644
      open("/vobs/NotificationService_build/JAVA_dbg/run/NS_EFD/jboss/conf/web.xml",
      O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) =
      17

      Attachments

        Activity

          People

            starksm64 Scott Stark (Inactive)
            sourceforge-user SourceForge legacy user (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: