Package java.lang

Examples of java.lang.Exception


                invalidateSession();
            }
        } catch (RemoteException e) {
            String msg = "Cannot shutdown the server. "  + e.getMessage();
            log.error(msg, e);
            throw new Exception(msg, e);
        }
        return result;
    }
View Full Code Here


            result.setUserTimezone(original.getUserTimezone());
            result.setCarbonVersion(original.getCarbonVersion());
        } catch (RemoteException e) {
            String msg = "Cannot get server data. Backend service may be unavailable";
            log.error(msg, e);
            throw new Exception(msg, e);
        }
        return result;
    }
View Full Code Here

    if (ontology==null) {
      try {
        ontology = OntologyFactory.getOntology();
      } catch (Exception e) {
        throw new Exception("Failed to instantiate ontology");
      }
    }

    //foreach sample file
    for (int i=0; i<sampleFiles.length; i++) {
View Full Code Here

    if (ontology==null) {
      try {
        ontology = OntologyFactory.getOntology();
      } catch (Exception e) {
        throw new Exception("Failed to instantiate ontology");
      }
    }

    //foreach sample file
    for (int i=0; i<sampleFiles.length; i++) {
View Full Code Here

            Application app = configManager.getExtensionDescriptor(
                     em.getName(), em.getLocation(), true);
            RoleMapper.removeRoleMapper(app.getRoleMapper().getName());
            appName = app.getRegistrationName();
        } catch (Exception ce) {
            throw new Exception(ce);
        }

        String contextRoot = null;
        ElementProperty ep = em.getElementPropertyByName("contextRoot");
        if(ep != null ){
            contextRoot = ep.getValue();
        } else {
            contextRoot = em.getName();
        }
             
        String virtualServers = null;
        try {
            virtualServers = configManager.getVirtualServers(em.getName());
        } catch(Exception ce) {
                 throw new Exception("Exception getting virtual servers by app name "
                    + appName, ce);
          
        }

        try {
            getWebContainer().unloadWebModule(contextRoot, appName,
                                         virtualServers, wbd);
            // XXX : Fix me
            return true;
        } catch (Exception ex) {
            _logger.log(Level.WARNING,"Exception thrown in the unload" + ex.toString());
            return false;
        } finally {
            try {
              Switch.getSwitch().getNamingManager().unbindObjects(wbd);
            } catch (javax.naming.NamingException nameEx) {
                throw new Exception("[WebExtensionLoader] "
                + " Exception during namingManager.unbindObject",
                nameEx);
            }
        }
        
View Full Code Here

            Application app = configManager.getExtensionDescriptor(
                     em.getName(), em.getLocation(), true);
            RoleMapper.removeRoleMapper(app.getRoleMapper().getName());
            appName = app.getRegistrationName();
        } catch (Exception ce) {
            throw new Exception(ce);
        }
       
        String contextRoot = null;
        ElementProperty ep = em.getElementPropertyByName("contextRoot");
        if(ep != null ){
            contextRoot = ep.getValue();
        } else {
            contextRoot = em.getName();
        }
       
        String virtualServers = null;
        try {
            virtualServers = configManager.getVirtualServers(em.getName());
        } catch(Exception ce) {
                 throw new Exception("Exception getting virtual servers by app name "
                    + appName, ce);
          
        }   
       
        return getWebContainer().disableWebModule(contextRoot,
View Full Code Here

        setJ2eeAppBean(null);
        if (throwables != null && !throwables.isEmpty()) {
            //we don't have the ability to return all errors.  so return the
            //first one, enough to signal the problem.
            String msg = throwables.get(0).getMessage();
            Exception ex = new Exception(msg);
            ex.initCause(throwables.get(0));
            throw ex;
        } else {
            return true;
        }
       
View Full Code Here

        } catch (Exception e) {
            System.out.println("Message check failed: ");
            e.printStackTrace();
        }
        if (failbuild)
            throw new Exception("Message check failed. \n" +
                "See error in build output or call ant runmessagecheck.");
    }   
View Full Code Here

            gms = (GroupManager) ctx.getBean("org.apache.jetspeed.security.GroupManager");
        }
        catch (Exception ex)
        {
            ex.printStackTrace();
            throw new Exception("Exception while setup SSO TEST");
        }
    }
View Full Code Here

            }
            catch (SSOException ssoex)
            {
                System.out.println("SSO Credential add FAILED for Group:" + TEST_GROUP + " site: " + TEST_URL);
                ssoex.printStackTrace();
                throw new Exception(ssoex.getMessage());
            }
        }
        else
        {
            System.out.println("Group:" + TEST_GROUP + " site: " + TEST_URL + " has already a remote credential");
        }

        // Create Principal for User
        principal = new UserPrincipalImpl(TEST_GROUP_USER);
        principals = new HashSet();
        principals.add(principal);
        subject = new Subject(true, principals, new HashSet(), new HashSet());

        // User should have credential for site
        if (ssoBroker.hasSSOCredentials(subject, TEST_URL) == false)
        {
            // Group expansion failed. User not recognized
            System.out.println("No SSO Credential for user:" + TEST_GROUP_USER + " site: " + TEST_URL);

            // Test failure
            try
            {
                ums.removeUser(TEST_GROUP_USER);
                gms.removeGroup(TEST_GROUP);
            }
            catch (SecurityException sex)
            {
                assertTrue("could not remove user and group. exception caught: " + sex, false);
            }

            throw new Exception("SSO Unit test for Group support failed");
        }
        else
        {
            // Group lookup succesful
            System.out.println("SSO Test for Group support successful" + "\nSSO Credential for user:" + TEST_GROUP_USER
                    + " site: " + TEST_URL + " found. User is member of Group " + TEST_GROUP);
        }

        // Cleanup test.

        /*
         * For hypersonic the cascading deletes are not generated by Torque and the remove credentials fails with a
         * constraint error. Comment test out for M1 release but the problem needs to be addressed for the upcoming
         * releases
         */
        try
        {
            // Remove credential for Site
            ssoBroker.removeCredentialsForSite("/group/" + TEST_GROUP, TEST_URL);
            System.out.println("SSO Credential removed for Group:" + TEST_GROUP + " site: " + TEST_URL);
        }
        catch (SSOException ssoex)
        {
            System.out.println("SSO Credential remove FAILED for Group:" + TEST_GROUP + " site: " + TEST_URL);
            throw new Exception(ssoex.getMessage());
        }

        try
        {
            ums.removeUser(TEST_GROUP_USER);
View Full Code Here

TOP

Related Classes of java.lang.Exception

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.