Examples of PackageManagerException


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

         IOUtil.copy(fileToInstall, destFile);
      }
      catch (IOException e)
      {

         throw new PackageManagerException("Could not install file: " + fileMetadata.getName() + " from package: "
               + pkgMeta.getName() + " version: " + pkgMeta.getVersion() + " into " + dest.getAbsolutePath());
      }

   }
View Full Code Here

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

      File relativePathToFile = new File(jbossHome, installedFile.getInstalledPath());
      File fileToUninstall = new File(relativePathToFile, installedFile.getFileName());
     
      if (!fileToUninstall.exists())
      {
         throw new PackageManagerException("Installed file missing: " + fileToUninstall.getAbsolutePath()
               + " - cannot uninstall!");
      }
      if (fileToUninstall.isDirectory())
      {
         throw new PackageManagerException("Installed file is a directory : " + fileToUninstall.getAbsolutePath()
               + " - cannot uninstall!");
      }
      fileToUninstall.delete();
      logger.info("Uninstalled file " + fileToUninstall + " from package  " + pkg.getPackageName());
View Full Code Here

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

      }
      File fileToInstall = new File(srcPathOfFileToInstall, fileMeta.getName());

      if (!fileToInstall.exists())
      {
         throw new PackageManagerException(fileToInstall.getAbsolutePath() + " does not exist, package: " + pkgCtx
               + " being installed from " + pkgCtx.getPackageRoot()
               + " is probably corrupt!");
      }

      if (fileMeta.getDestPath() == null)
      {
         throw new PackageManagerException("File " + fileMeta.getName() + " in package: " + pkgCtx
               + " does not specify a destination");
      }
      String destServerHome = this.packageMgrContext.getJBossServerHome();
      File locationToInstall = new File(destServerHome, fileMeta.getDestPath());
      // TODO: Provide an option on <file> to allow for creating missing destination folders
      // Till then just throw an exception if dest-path is not actually available
      if (!locationToInstall.exists() || !locationToInstall.isDirectory())
      {
         throw new PackageManagerException("dest-path " + locationToInstall.getAbsolutePath() + " for file: "
               + fileMeta.getName() + " in package: " + pkgCtx
               + " is either not present or is not a directory");
      }
      try
      {
View Full Code Here

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

   @Override
   public void installPackage(String pkgPath, InstallOptions installOptions) throws PackageManagerException
   {
      if (pkgPath == null)
      {
         throw new PackageManagerException("Package path is null");
      }
      URL packageURL = null;
      try
      {
         packageURL = this.getPackageURL(pkgPath);
      }
      catch (MalformedURLException mue)
      {
         throw new PackageManagerException("Cannot parse path " + pkgPath, mue);
      }
      this.installPackage(packageURL, installOptions);
     
   }
View Full Code Here

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

   @Override
   public void installPackage(URL packageURL, InstallOptions installOptions) throws PackageManagerException
   {
      if (packageURL == null)
      {
         throw new PackageManagerException("Package URL is null");
      }

      // create a package context
      PackageContext pkgCtx = new DefaultPackageContext(this.pkgMgrCtx, packageURL);
      this.installPackage(pkgCtx, installOptions);
View Full Code Here

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

    */
   protected void installPackage(PackageContext pkgContext, InstallOptions installOptions) throws PackageManagerException
   {
      if (pkgContext == null)
      {
         throw new PackageManagerException("Package context is null");
      }

      // check if package is already installed
      boolean packageAlreadyInstalled = this.pkgDatabaseManager.isPackageInstalled(pkgContext.getPackageName());
      if (packageAlreadyInstalled)
      {
         throw new PackageManagerException("Package " + pkgContext + " is already installed");
      }
      logger.debug("New package " + pkgContext + " being installed");
      // proceed with installation of the package

      if (pkgContext.getInstallationFiles() == null)
      {
         throw new PackageManagerException("There are no files to install for package: " + pkgContext);
      }
      // work on dependencies first (because if deps are not satisfied then no point
      // running the pre-install step.
      // BUT, think about this (should we first run pre-install and then deps?).
      // What would be a ideal behaviour?
View Full Code Here

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

         // check if other packages are dependent on this package
         // If yes, then do NOT remove this package. Else remove this package
         Set<PersistentPackage> dependentPackages = this.pkgDatabaseManager.getDependentPackages(packageName);
         if (dependentPackages != null && !dependentPackages.isEmpty())
         {
            throw new PackageManagerException("Other packages are dependent on package " + packageName
                  + " - cannot remove this package!");
         }
      }
      // pre-uninstall step
      this.preUnInstallPackage(installedPackage);
View Full Code Here

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

   @Override
   public void updatePackage(String packageFilePath, UpgradeOptions upgradeOptions) throws PackageManagerException
   {
      if (packageFilePath == null)
      {
         throw new PackageManagerException("Package path is null");
      }
      URL packageURL = null;
      try
      {
         packageURL = this.getPackageURL(packageFilePath);
      }
      catch (MalformedURLException mue)
      {
         throw new PackageManagerException("Cannot parse path " + packageFilePath, mue);
      }
      this.updatePackage(packageURL, upgradeOptions);
     
   }
View Full Code Here

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

   @Override
   public void updatePackage(URL packageURL, UpgradeOptions upgradeOptions) throws PackageManagerException
   {
      if (packageURL == null)
      {
         throw new PackageManagerException("Package URL is null");
      }

      // create a package context
      PackageContext pkgCtx = new DefaultPackageContext(this.pkgMgrCtx, packageURL);
      this.updatePackage(pkgCtx, upgradeOptions);     
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!");
      }
      try
      {
         File destFile = new File(destDir, scriptFile.getName());
         IOUtil.copy(scriptFile, destFile);
         logger.debug("Stored script file " + scriptFile + " at " + destDir);
      }
      catch (IOException e)
      {
         throw new PackageManagerException("Could not store script due to exception ", e);
      }
   }
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.