User: oberg   
  Date: 00/11/15 08:43:57

  Modified:    src/main/org/jboss/util ClassPathExtension.java
  Log:
  Add libraries to system property java.class.path too. This will allow javac usage to 
work (=JSP works now!)
  
  Revision  Changes    Path
  1.6       +32 -3     jboss/src/main/org/jboss/util/ClassPathExtension.java
  
  Index: ClassPathExtension.java
  ===================================================================
  RCS file: 
/products/cvs/ejboss/jboss/src/main/org/jboss/util/ClassPathExtension.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ClassPathExtension.java   2000/11/13 15:17:43     1.5
  +++ ClassPathExtension.java   2000/11/15 16:43:57     1.6
  @@ -20,7 +20,7 @@
    *      
    *   @see <related>
    *   @author Rickard �berg ([EMAIL PROTECTED])
  - *   @version $Revision: 1.5 $
  + *   @version $Revision: 1.6 $
    */
   public class ClassPathExtension
      extends ServiceMBeanSupport
  @@ -62,6 +62,9 @@
      public void initService()
         throws java.lang.Exception
      {
  +      String separator = System.getProperty("path.separator");
  +      String classPath = System.getProperty("java.class.path");
  +   
         MLet mlet = (MLet)Thread.currentThread().getContextClassLoader();
         
         if (url.endsWith("/"))
  @@ -89,6 +92,9 @@
                     Logger.debug("Added library:"+file);
                     mlet.addURL(file);
                     
  +                  // Add to java.class.path
  +                  classPath += separator + file.getFile();
  +                  
                     found++;
                  }
               }
  @@ -100,10 +106,19 @@
                  {
                     URL u = new 
URL(getClass().getProtectionDomain().getCodeSource().getLocation(),url);
                     mlet.addURL(u);
  +                  
  +                  // Add to java.class.path
  +                  classPath += separator + u.getFile();
  +                  
                     Logger.debug("Added directory:"+u);
                  } catch (MalformedURLException e)
                  {
  -                  mlet.addURL(new File(url).toURL());
  +                  URL u = new File(url).toURL();
  +                  mlet.addURL(u);
  +                  
  +                  // Add to java.class.path
  +                  classPath += separator + u.getFile();
  +                  
                     Logger.debug("Added directory:"+url);
                  }
               }
  @@ -117,13 +132,27 @@
            {
               URL u = new 
URL(getClass().getProtectionDomain().getCodeSource().getLocation(),url);
               mlet.addURL(u);
  +            
  +            // Add to java.class.path
  +            classPath += separator + u.getFile();
  +            
               Logger.debug("Added library:"+u);
            } catch (MalformedURLException e)
            {
  -            mlet.addURL(new File(url).toURL());
  +            URL u = new File(url).toURL();
  +            mlet.addURL(u);
  +            
  +            // Add to java.class.path
  +            classPath += separator + u.getFile();
  +            
               Logger.debug("Added library:"+url);
            }
         }
  +      
  +      // Set java.class.path
  +      System.setProperty("java.class.path", classPath);
  +      Logger.debug("Classpath is now:"+classPath);
  +      
      }
      // Protected -----------------------------------------------------
   }
  
  
  

Reply via email to