Package com.sun.appserv.addons

Examples of com.sun.appserv.addons.AddonFatalException


                Object obj =
                createClassLoader(jarFile.toURI().toURL()).
                loadClass(service).newInstance();
                _install(obj, addonName);
            } else {
                throw new AddonFatalException
                (localStrings.getString("addon.servicenotfound",
                addonName, getServiceInterface()));
            }
        } catch (Exception e) {
            throw new AddonFatalException(e);
        }
    }
View Full Code Here


       
        try {
            JarFactory tmpJar = new JarFactory(tmpWorkDir);
            tmpJar.unJar(new File(installerJar));
        } catch (ZipException zipEx) {
            throw new AddonFatalException("Could not unbundle jar "+installerJar, zipEx);
        } catch (IOException ioEx) {
            throw new AddonFatalException("Could not unbundle jar "+installerJar, ioEx);
        }


       
        File apiFrom = new File(tmpWorkDir + File.separator + API_JAR);
        File apiTo = new File(appServerLibDir + File.separator + API_JAR);

        File implNew = new File(tmpWorkDir + File.separator + IMPL_JAR);
        File implOrig = new File(appServerLibDir + File.separator + IMPL_JAR);
        File implOld = new File(appServerLibDir + File.separator + IMPL_JAR + ".old");

        // check if api jar already exists.  If it does, that's an error.
        if (apiTo.exists()) {
            throw new AddonFatalException("JSF API jar already exists - have you installed a different version already?  If so, uninstall it before running this upgrade.");
        }

        // check if a backup impl file already exists, If it does, that's an error.
        if (implOld.exists()) {
            throw new AddonFatalException("JSF Impl backup jar already exists - have you installed a different version already?  If so, uninstall it before running this upgrade.");
        }

        System.out.println("Installing new api file "+apiTo);
        copyFile(apiFrom, apiTo);

        if (!implOrig.exists()) {
            throw new AddonFatalException("JSF implementation jar does not exist at: "+implOrig);
        }

        System.out.println("Backing up old impl file to "+implOld);
        if (!implOrig.renameTo(implOld)) {
            throw new AddonFatalException("Could not backup JSF impl jar from "+implOrig+" to "+implOld);
        }

        System.out.println("Installing new impl file "+implOrig);
        copyFile(implNew, implOrig);
View Full Code Here

        // delete impl jar immedately, replace with backed up jar
        File implJar = new File(appServerLibDir + File.separator + IMPL_JAR);
        implJar.delete();
        File implJarOld = new File(appServerLibDir + File.separator + IMPL_JAR + ".old");
        if (!implJarOld.renameTo(implJar)) {
            throw new AddonFatalException("SEVERE ERROR: Could not restore old version of JSF impl, App Server is now in an inconsistent state, required immediate attention.");
        }

    }
View Full Code Here

   
    public void upgrade(InstallationContext ic, AddonVersion av) throws AddonFatalException {
        System.out.println("JSF1.2 Installer: Nothing to upgrade ...");

        throw new AddonFatalException("This code should never be called...  There is no upgrade available.");

    }
View Full Code Here

                out.write(buf, 0, len);
            }
            in.close();
            out.close();
        } catch (Exception e){
            throw new AddonFatalException("Exception copying file from "+sourceFile+" to "+destinationFile,  e);
        }
    }
View Full Code Here

TOP

Related Classes of com.sun.appserv.addons.AddonFatalException

Copyright © 2018 www.massapicom. 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.