User: mgroot  
  Date: 01/01/16 13:23:14

  Modified:    src/main/org/jboss/util ClassPathExtension.java
  Log:
  Added nice error message if the classpath extension is not correct.
  
  Revision  Changes    Path
  1.10      +15 -6     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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- ClassPathExtension.java   2000/12/07 18:16:13     1.9
  +++ ClassPathExtension.java   2001/01/16 21:23:14     1.10
  @@ -20,7 +20,7 @@
    *      
    *   @see <related>
    *   @author Rickard �berg ([EMAIL PROTECTED])
  - *   @version $Revision: 1.9 $
  + *   @version $Revision: 1.10 $
    */
   public class ClassPathExtension
      implements ClassPathExtensionMBean, MBeanRegistration
  @@ -63,13 +63,16 @@
      
         MLet mlet = (MLet)Thread.currentThread().getContextClassLoader();
         
  +      URL u = null;
  +      
         if (url.endsWith("/"))
         {
            // Add all libs in directory
            File dir;
            try
            {
  -            URL u = new 
URL(getClass().getProtectionDomain().getCodeSource().getLocation(),url);
  +//            URL u = new 
URL(getClass().getProtectionDomain().getCodeSource().getLocation(),url);
  +                     u = new 
URL(getClass().getProtectionDomain().getCodeSource().getLocation(),url);
               dir = new File(u.getFile());
            } catch (MalformedURLException e)
            {
  @@ -100,7 +103,8 @@
                  // Add dir
                  try
                  {
  -                  URL u = new 
URL(getClass().getProtectionDomain().getCodeSource().getLocation(),url);
  +//                  URL u = new 
URL(getClass().getProtectionDomain().getCodeSource().getLocation(),url);
  +                  u = new 
URL(getClass().getProtectionDomain().getCodeSource().getLocation(),url);
                     mlet.addURL(u);
                  
                     // Add to java.class.path
  @@ -109,7 +113,8 @@
                     log.debug("Added directory:"+u);
                  } catch (MalformedURLException e)
                  {
  -                  URL u = new File(url).toURL();
  +//                  URL u = new File(url).toURL();
  +                  u = new File(url).toURL();
                     mlet.addURL(u);
                  
                     // Add to java.class.path
  @@ -120,13 +125,15 @@
               }
            } catch (Throwable ex)
            {
  +             log.warning("Classpath extension "+u+" is invalid.");
               ex.printStackTrace();
            }
         } else
         {
            try
            {
  -            URL u = new 
URL(getClass().getProtectionDomain().getCodeSource().getLocation(),url);
  +//            URL u = new 
URL(getClass().getProtectionDomain().getCodeSource().getLocation(),url);
  +            u = new 
URL(getClass().getProtectionDomain().getCodeSource().getLocation(),url);
               mlet.addURL(u);
            
               // Add to java.class.path
  @@ -137,7 +144,8 @@
            {
               try
               {
  -               URL u = new File(url).toURL();
  +//               URL u = new File(url).toURL();
  +               u = new File(url).toURL();
                  mlet.addURL(u);
            
                  // Add to java.class.path
  @@ -146,6 +154,7 @@
                  log.debug("Added library:"+url);
               } catch (MalformedURLException ex)
               {
  +               log.warning("Classpath extension "+u+" is invalid.");
                  log.exception(ex);
               }
            }
  
  
  

Reply via email to