dblevins    2005/08/26 17:50:13

  Modified:    modules/core/src/java/org/openejb/loader
                        OpenEJBInstance.java
  Log:

  Improved code that checks for a valid installation
  
  Revision  Changes    Path
  1.2       +5 -9      
openejb1/modules/core/src/java/org/openejb/loader/OpenEJBInstance.java
  
  Index: OpenEJBInstance.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb1/modules/core/src/java/org/openejb/loader/OpenEJBInstance.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- OpenEJBInstance.java      12 Jul 2005 23:51:16 -0000      1.1
  +++ OpenEJBInstance.java      26 Aug 2005 21:50:13 -0000      1.2
  @@ -99,7 +99,7 @@
               return classLoader.loadClass("org.openejb.OpenEJB");
           } catch (Exception e) {
               try {
  -                checkOpenEjbHome();
  +                
checkOpenEjbHome(SystemInstance.get().getHome().getDirectory());
                   FileUtils home = SystemInstance.get().getHome();
                   classPath.addJarsToPath(home.getDirectory("lib"));
               } catch (Exception e2) {
  @@ -127,16 +127,12 @@
       // TODO: move this part back into the LoaderServlet
       String INSTRUCTIONS = "Please edit the web.xml of the openejb_loader 
webapp and set the openejb.home init-param to the full path where OpenEJB is 
installed.";
   
  -    private void checkOpenEjbHome() throws Exception {
  +    private void checkOpenEjbHome(File openejbHome) throws Exception {
           try {
   
  -            // The openejb.home must be set
  -            String homePath = System.getProperty("openejb.home");
  -            if (homePath == null)
  -                handleError(NO_HOME, INSTRUCTIONS);
  -
  +            String homePath = openejbHome.getAbsolutePath();
  +            
               // The openejb.home must exist
  -            File openejbHome = new File(homePath);
               if (!openejbHome.exists())
                   handleError(BAD_HOME + homePath, NOT_THERE, INSTRUCTIONS);
   
  
  
  

Reply via email to