Examples of PackageManagerException


Examples of org.jboss.ejb3.packagemanager.exception.PackageManagerException

            path = new File(root, script.getPath());
         }
         File scriptFile = new File(path, scriptFileName);
         if (!scriptFile.exists())
         {
            throw new PackageManagerException("Script file " + scriptFile + " for " + pkgCtx + " does not exist!");
         }
         scriptProcessor.processPreInstallScript(this.pkgMgrCtx, pkgCtx, scriptFile);
      }

   }
View Full Code Here

Examples of org.jboss.ejb3.packagemanager.exception.PackageManagerException

         File packageManagerHome = this.pkgMgrCtx.getPackageManagerEnvironment().getPackageManagerHome();
         File scriptFileLocation = new File(packageManagerHome, script.getPath());
         File scriptFile = new File(scriptFileLocation, script.getName());
         if (!scriptFile.exists())
         {
            throw new PackageManagerException("Script file " + scriptFile + " for package "
                  + installedPackage.getPackageName() + " does not exist!");
         }
         scriptProcessor.processPreUnInstallScript(this.pkgMgrCtx, installedPackage, scriptFile);
      }
View Full Code Here

Examples of org.jboss.ejb3.packagemanager.exception.PackageManagerException

            path = new File(root, script.getPath());
         }
         File scriptFile = new File(path, scriptFileName);
         if (!scriptFile.exists())
         {
            throw new PackageManagerException("Script file " + scriptFile + " for " + pkgCtx + " does not exist!");
         }
         scriptProcessor.processPostInstallScript(this.pkgMgrCtx, pkgCtx, scriptFile);

      }
   }
View Full Code Here

Examples of org.jboss.ejb3.packagemanager.exception.PackageManagerException

         File packageManagerHome = this.pkgMgrCtx.getPackageManagerEnvironment().getPackageManagerHome();
         File scriptFileLocation = new File(packageManagerHome, script.getPath());
         File scriptFile = new File(scriptFileLocation, script.getName());
         if (!scriptFile.exists())
         {
            throw new PackageManagerException("Script file " + scriptFile + " for package "
                  + installedPackage.getPackageName() + " does not exist!");
         }
         scriptProcessor.processPostUnInstallScript(this.pkgMgrCtx, installedPackage, scriptFile);
      }
   }
View Full Code Here

Examples of org.jboss.ejb3.packagemanager.exception.PackageManagerException

      }
      catch (CmdLineParser.OptionException e)
      {
         System.err.println("Error parsing command " + e.getMessage());
         printUsage();
         throw new PackageManagerException(e.getMessage());
      }
      // get package manager home
      String packageManagerHome = (String) cmdLineParser.getOptionValue(packageManagerHomeCmdOption);
      if (packageManagerHome == null)
      {
         throw new PackageManagerException("Package manager home has not been set");
      }
    
      File pmHome = new File(packageManagerHome);
      if (!pmHome.exists())
      {
         throw new PackageManagerException("Package manager home " + pmHome + " does not exist!");
      }
      logger.info("Using Package Manager Home: " + packageManagerHome);
      PackageManagerEnvironment env = new PackageManagerEnvironment(packageManagerHome);
     
      // Run the setup script
      String schemaSetupScript = (String) cmdLineParser.getOptionValue(schemaFileCmdOption);
      if (schemaSetupScript != null)
      {
         File schemaFile = new File(schemaSetupScript);
         if (!schemaFile.exists())
         {
            throw new PackageManagerException(
                  "Could not setup the database for package manager, because of non-existent schema file "
                        + schemaSetupScript);
         }
         Connection conn = null;
         // We use Derby Embedded which is file based (so point to the DB home).
         // TODO: This should ideally be handled by the PackageDatabaseManager,
         // or some central place which is aware of the DB type. Let's just
         // do this here for now.
         File dbHome = env.getDataDir();
         // set the Derby system home property to point to the package manager db
         System.setProperty("derby.system.home", dbHome.getAbsolutePath());
         logger.info("Package manager DB home set to " + System.getProperty("derby.system.home"));

         try
         {
            conn = DriverManager.getConnection("jdbc:derby:pmdb;create=true");
            DBUtil.runSql(conn, schemaFile);
            logger.info("Successfully setup the package manager database");
         }
         catch (SQLException sqle)
         {
            throw new PackageManagerException("Could not setup package manager database: ", sqle);
         }
         catch (IOException ioe)
         {
            throw new PackageManagerException("Could not setup package manager database: ", ioe);
         }
         finally
         {
            if (conn != null)
            {
View Full Code Here

Examples of org.jboss.ejb3.packagemanager.exception.PackageManagerException

      }
      catch (CmdLineParser.OptionException e)
      {
         System.err.println("Error parsing command " + e.getMessage());
         printUsage();
         throw new PackageManagerException(e.getMessage());
      }
      File currentDir = new File(".");
      // Get the package manager home from system property. If not set, then defaults to
      // current directory
      String packageManagerHomeEnvVariableValue = System.getProperty(Constants.PACKAGE_MANAGER_HOME_SYSTEM_PROPERTY, currentDir.getAbsolutePath());
      // Override the package manager home if it's explicitly passed through the -p option
      String packageManagerHome = (String) cmdLineParser.getOptionValue(packageManagerHomeCmdOption,packageManagerHomeEnvVariableValue);
      if (packageManagerHome == null)
      {
         throw new PackageManagerException("Package manager home has not been set");
      }
    
      File pmHome = new File(packageManagerHome);
      if (!pmHome.exists())
      {
         throw new PackageManagerException("Package manager home " + pmHome + " does not exist!");
      }
      logger.info("Using Package Manager Home: " + packageManagerHome);
      PackageManagerEnvironment env = new PackageManagerEnvironment(packageManagerHome);
      // Check for JBOSS_HOME
      String jbossHome = (String) cmdLineParser.getOptionValue(jbossHomeCmdOption);
      if (packageManagerHome == null)
      {
         throw new PackageManagerException("Package manager home has not been set");
      }
      if (jbossHome == null)
      {
         throw new PackageManagerException("JBoss Home has not been set");
      }
      File jbHome = new File(jbossHome);
      if (!jbHome.exists())
      {
         throw new PackageManagerException("JBoss home " + jbHome + " does not exist!");
      }
      logger.info("Using JBoss Home: " + jbossHome);
     
      // Create a package manager now
      PackageManager pm = PackageManagerFactory.getDefaultPackageManager(env, jbossHome);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.