Almost. The problem with your patch, from my viewpoint, is that it uses 
ServerLoader.addLibrary(). This forces the 
javax-management-monitor-Monitor-patch.jar patch to jboss-jmx.jar to reside in 
the same directory as the rest of the boot JARs. That means that I either add 
my javax-management-monitor-Monitor-patch.jar patch JAR to the 
${JBOSS_HOME}/lib directory, which means I'm directly fiddling with the Jboss 
distribution and I want to treat that as read-only, or I move all of 
${JBOSS_HOME}/lib over to someplace under my own control, which means I am 
over-treating the correction. It seems that if the patch to Main uses 
ServerLoader.addURL() instead, I can keep the bulk of the boot JARs in 
${JBOSS_HOME}/lib and still have the Monitor patch in a directory under my 
control. I include a proposed alternative patch to org.jboss.Main below based 
on the 3.2.5 version.


  | --- /cygdrive/c/jboss-3.2.5-src/system/src/main/org/jboss/Main.java 
2004-06-15 11:44:28.000000000 -0700
  | +++ /cygdrive/c/eclipse/workspaceExo/Jboss-patches/org/jboss/Main.java      
2004-12-30 12:48:25.956603200 -0800
  | @@ -10,7 +10,9 @@
  |  package org.jboss;
  |  
  |  import java.io.File;
  | +import java.lang.reflect.Method;
  |  import java.net.URL;
  | +import java.net.URLDecoder;
  |  import java.net.MalformedURLException;
  |  import java.util.Properties;
  |  import java.util.List;
  | @@ -22,8 +24,8 @@
  |  
  |  import org.jboss.system.server.Server;
  |  import org.jboss.system.server.ServerConfig;
  | -import org.jboss.system.server.ServerLoader;
  |  import org.jboss.system.server.ServerConfigUtil;
  | +import org.jboss.system.server.ServerLoader;
  |  
  |  /**
  |   * Provides a command line interface to start the JBoss server.
  | @@ -41,7 +43,7 @@
  |   * @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
  |   * @author <a href="mailto:[EMAIL PROTECTED]">Jason Dillon</a>
  |   * @author <a href="mailto:[EMAIL PROTECTED]">Adrian Brock</a>
  | - * @version $Revision: 1.17.2.13 $
  | + * @version $Revision: 1.17.2.16 $
  |   */
  |  public class Main
  |  {
  | @@ -49,10 +51,15 @@
  |     private String jaxpLibs = "xercesImpl.jar,xml-apis.jar,xalan.jar";
  |  
  |     /** The JMX library to use. */
  | -   private String jmxLibs = "jboss-jmx.jar,dom4j.jar,gnu-regexp.jar";
  | +   private String jmxLibs = 
"jboss-jmx.jar,dom4j.jar,jaxen.jar,gnu-regexp.jar";
  |  
  |     private String concurrentLib = "concurrent.jar";
  |  
  | +   /** Extra jars added to the start of the boot classpath. This can be 
used
  | +    to override jboss /lib boot classes
  | +    */
  | +   private List bootUrls = new LinkedList();
  | +
  |     /** Extra libraries to load the server with .*/
  |     private List extraLibraries = new LinkedList();
  |  
  | @@ -95,7 +102,7 @@
  |            * this path through the decoder so that is JBoss starts in a 
path with
  |            * spaces we don't come crashing down.
  |           */
  | -         path = java.net.URLDecoder.decode(path);
  | +         path = urlDecode(path);
  |           File runJar = new File(path);
  |           File homeFile = runJar.getParentFile().getParentFile();
  |           homeDir = homeFile.getCanonicalPath();
  | @@ -114,6 +121,12 @@
  |        // Load the server instance
  |        ServerLoader loader = new ServerLoader(props);
  |  
  | +      // Add any extra libraries
  | +      for (int i = 0; i < bootUrls.size(); i++)
  | +      {
  | +         loader.addURL((URL) bootUrls.get(i));
  | +      }
  | +
  |        // Add JAXP and JMX libs
  |        loader.addLibraries(jaxpLibs);
  |        loader.addLibraries(jmxLibs);
  | @@ -192,6 +205,7 @@
  |           new LongOpt("configuration", LongOpt.REQUIRED_ARGUMENT, null, 
'c'),
  |           new LongOpt("version", LongOpt.NO_ARGUMENT, null, 'V'),
  |           new LongOpt("jaxp", LongOpt.REQUIRED_ARGUMENT, null, 'j'),
  | +         new LongOpt("bootlib", LongOpt.REQUIRED_ARGUMENT, null, 'B'),
  |           new LongOpt("library", LongOpt.REQUIRED_ARGUMENT, null, 'L'),
  |           new LongOpt("classpath", LongOpt.REQUIRED_ARGUMENT, null, 'C'),
  |           new LongOpt("properties", LongOpt.REQUIRED_ARGUMENT, null, 'P'),
  | @@ -234,6 +248,7 @@
  |                 System.out.println("    -n, --netboot=<url>           Boot 
from net with the given url as base");
  |                 System.out.println("    -c, --configuration=<name>    Set 
the server configuration name");
  |                 System.out.println("    -j, --jaxp=<type>             Set 
the JAXP impl type (ie. crimson)");
  | +               System.out.println("    -B, --bootlib=<filename>      Add 
an extra library to the front bootclasspth");
  |                 System.out.println("    -L, --library=<filename>      Add 
an extra library to the loaders classpath");
  |                 System.out.println("    -C, --classpath=<url>         Add 
an extra url to the loaders classpath");
  |                 System.out.println("    -P, --properties=<url>        Load 
system properties from the given url");
  | @@ -338,6 +353,11 @@
  |                 break;
  |              }
  |  
  | +            case 'B':
  | +               arg = getopt.getOptarg();
  | +               bootUrls.add(makeURL(arg));
  | +               break;
  | +
  |              case 'L':
  |                 arg = getopt.getOptarg();
  |                 extraLibraries.add(arg);
  | @@ -381,6 +401,27 @@
  |     }
  |  
  |     /**
  | +    * Decode the path depending upon whether we have java1.4 or java1.3 
installed
  | +    *
  | +    * @param path the path to decode
  | +    * @return the decoded path
  | +    * @throws Exception for any error
  | +    */
  | +   private String urlDecode(String path) throws Exception
  | +   {
  | +      Method decode;
  | +      try
  | +      {
  | +         decode = URLDecoder.class.getMethod("decode", new Class[] { 
String.class, String.class });
  | +         return (String) decode.invoke(null, new Object[] { path, "UTF-8" 
});
  | +      }
  | +      catch (NoSuchMethodException e)
  | +      {
  | +         return URLDecoder.decode(path);
  | +      }
  | +   }
  | +
  | +   /**
  |      * This is where the magic begins.
  |      *
  |      * <P>Starts up inside of a "jboss" thread group to allow better
  | 

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

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


-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to