2 Replies Latest reply on Jul 17, 2006 2:05 PM by andsch

    From JIRA Issue to Patch on Production System

    asbager

      Hi,

      this may be a simple question, but I wonder how patches are supposed to be supplied to a JBoss AS in a production environment.

      Looking at several JIRA issues (Status: closed; Resolution:Done), I didn't find any patches to unzip/unjar to a JBoss installation directory or things like that. Rather, the sources that have been changed for resolving the issue, are given.

      But how is one supposed to deploy these changes?

      The possiblities I see so far, are:

      1) Getting the JBoss source once, merging the sources of JIRA issues when needed and then building the server again. But then one would have to make changes to config files in the source distribution either. So this is not a very convenient way to apply patches in production systems.

      2) So, the other way to do it could be using the --patchdir=dir option of the run.sh-Script for running JBoss.
      As far as I see, one or more separate classloaders are instantiated for loading sources in the patchdir directory. And I assume that loading system classes of the JBoss AS (i.e. classes in package org.jboss...) is first delegated to the classloaders of the patchdir. Thus, the equivalent (buggy) class, that has been installed before, does not get loaded any more but the class in the patchdir does. Is that right???

      So, if this is right, can I simply put a Java source file (.java) of a JIRA issue to the patchdir and JBoss compiles it on the fly or do I have to compile the file, put in a jar file and then put the jar file to the patchdir?

      This all seems a little complicated to me (there might be administrators who have to patch systems and even don't know the Java language), so maybe I have overlooked something really basic???

      Kind regards
      Andreas

        • 1. Re: From JIRA Issue to Patch on Production System
          andsch

          Hi,

          the second approach seems to work when using the --bootdir=dir option of run.sh instead of --patchdir.

          Here is what I did for testing purposes:
          1) Added extra log-Statements to org.jboss.system.server.ServerImpl
          2) Compiled that file with the Jar-Files of the jbossInstallDir/lib directory on the classpath
          3) Put the compiled ServerImpl.class in a jar-File, say a.jar
          4) Run the server with --bootdir=myDir where myDir contained a.jar
          5) Received the log statements on the console

          But I'm not yet sure exactly when to use --bootdir and when to use --patchdir. Can someone please shed some light on this?

          Regards

          • 2. Re: From JIRA Issue to Patch on Production System
            andsch

            Hi,

            so far as I can see, one has to use bootdir if any class must be patched that is loaded via the ServerLoader according to section 2.2.2.4.3. The Complete Class Loading Model im Adminguide of the JBoss Admin-Guide (concerning JBoss AS 4.0.3SP1).

            Anything else should be patched via patchdir. The reason not to use bootdir as well is that some required classes might not be available via ServerLoader.

            All in all, nearly anything can be patched, except:
            1) org.jboss.Main / org.jboss.system.server.ServerLoader
            2) Application classes (in .ears, .wars, ...) if a loader-repository is configured or some other configuration prevents the respective deployer from using the JBoss-Classloader

            Is that correct so far?

            By the way, what about the possibility to provide patches that are loaded by the Classloader of a particular loader-repository (which then would have to be configured)? Deployed applications could then be patched the way the JBoss server itself gets patched.

            Kind regards