Example usage for java.rmi RemoteException getMessage

List of usage examples for java.rmi RemoteException getMessage

Introduction

In this page you can find the example usage for java.rmi RemoteException getMessage.

Prototype

public String getMessage() 

Source Link

Document

Returns the detail message, including the message from the cause, if any, of this exception.

Usage

From source file:org.wso2.carbon.mediator.bam.config.ui.BamServerProfileUtils.java

public String decryptPassword(String cipherTextPassword) {
    try {//  www .  j  ava  2 s  .  c o m
        return client.base64DecodeAndDecrypt(cipherTextPassword);
    } catch (RemoteException e) {
        String errorMsg = "Error while decrypting the password. " + e.getMessage();
        log.error(errorMsg, e);
    }
    return "";
}

From source file:org.wso2.carbon.mediator.bam.config.ui.DdlAjaxProcessorHelper.java

public String getServerProfileNames(String serverProfilePath) {
    StringBuilder serverProfileNamesString = new StringBuilder("");
    try {//  w w  w .j a  v a  2  s. c o  m
        String[] serverProfileNames = client.getServerProfilePathList(serverProfilePath);
        if (serverProfileNames != null) {
            for (String serverProfileName : serverProfileNames) {
                serverProfileNamesString.append("<option>"
                        + serverProfileName.split("/")[serverProfileName.split("/").length - 1] + "</option>");
            }
        }
    } catch (RemoteException e) {
        String errorMsg = "Error while getting Server Profile Name List. " + e.getMessage();
        log.error(errorMsg, e);
    }
    return serverProfileNamesString.toString();
}

From source file:org.wso2.carbon.mediator.bam.ui.DdlAjaxProcessorHelper.java

private BamServerConfig getResource(String bamServerProfileLocation) {
    try {/*  w  w w  .j av  a2  s  .  c o m*/
        String resourceString = client.getResourceString(bamServerProfileLocation);
        OMElement resourceElement = new StAXOMBuilder(
                new ByteArrayInputStream(resourceString.getBytes(Charset.forName("UTF-8"))))
                        .getDocumentElement();

        BamServerConfigBuilder bamServerConfigBuilder = new BamServerConfigBuilder();
        bamServerConfigBuilder.createBamServerConfig(resourceElement);
        return bamServerConfigBuilder.getBamServerConfig();
    } catch (RemoteException e) {
        String errorMsg = "Error while getting the resource. " + e.getMessage();
        log.error(errorMsg, e);
    } catch (XMLStreamException e) {
        String errorMsg = "Error while creating OMElement from a string. " + e.getMessage();
        log.error(errorMsg, e);
    }
    return null;
}

From source file:org.wso2.carbon.mediator.bam.ui.DdlAjaxProcessorHelper.java

public String getServerProfileNames(String serverProfilePath) {
    StringBuilder serverProfileNamesStringBuilder = new StringBuilder("");
    try {/*from   w  ww  . j a v  a 2  s. c  om*/
        String[] serverProfileNames = client.getServerProfilePathList(serverProfilePath);
        for (String serverProfileName : serverProfileNames) {
            serverProfileNamesStringBuilder.append("<option>"
                    + serverProfileName.split("/")[serverProfileName.split("/").length - 1] + "</option>");
        }
    } catch (RemoteException e) {
        String errorMsg = "Error while getting Server Profile Names. " + e.getMessage();
        log.error(errorMsg, e);
    }
    return serverProfileNamesStringBuilder.toString();
}

From source file:org.wso2.carbon.registry.permission.test.GRegLoginPermissionServiceTestCase.java

@Test(groups = {
        "wso2.greg" }, description = "test add a role with login permission", expectedExceptions = AxisFault.class)
public void testAddLoginPermissionUser() throws Exception {

    String permission[] = { "/permission/admin/login" };
    String userList[] = { userName };
    String sessionCookieUser = null;
    boolean status;

    addRoleWithUser(permission, userList);
    //sessionCookieUser = authenticatorClient.login(userName, userPassword, FrameworkSettings.HOST_NAME);
    log.info("Newly Created User Logged in :" + userName);

    try {//  w w w  .  j av a 2 s.  c o m
        status = false;
        ResourceAdminServiceClient resourceAdminServiceClient = new ResourceAdminServiceClient(backendURL,
                userName, userPassword);
        // greg_login_user does not have permission to add a Text resource
        resourceAdminServiceClient.addTextResource("/", "login.txt", "", "", "");
    } catch (RemoteException e) {
        status = true;
        assertTrue(e.getMessage().contains("Access Denied"),
                "Access Denied Remote" + " Exception assertion Failed :");
        log.info("greg_login_user does not have permission to add a text resource :");
        throw new AxisFault("AxisFault");
    }
    assertTrue(status, "User can't upload resource having only login permission");
    //authenticatorClient.logOut();
}

From source file:org.wso2.carbon.registry.permission.test.GRegMetaDataPermissionServiceTestCase.java

@Test(groups = { "wso2.greg" }, description = "test add a role with login permission")
public void testAddMetaDataPermissionUser() throws Exception {

    userPassword = "welcome";
    String permission1[] = { "/permission/admin/login" };
    //                                "/permission/admin/manage/resources/govern/metadata"};
    String permission2[] = { "/permission/admin/login", "/permission/admin/manage/resources" };
    String sessionCookieUser;//from  ww w.  ja va 2s  .c  o  m
    boolean status;
    String resourceName = "echo.wsdl";
    String fetchUrl = "https://raw.githubusercontent.com/wso2/wso2-qa-artifacts/master/automation-artifacts/greg/wsdl/echo.wsdl";
    addRoleWithUser(permission1);
    try {
        status = false;
        resourceAdminServiceClient = new ResourceAdminServiceClient(
                automationContext.getContextUrls().getBackEndUrl(), userName, userPassword);
        // greg_meta_user does not have permission to add a Text resource
        resourceAdminServiceClient.addTextResource("/", "resource.txt", "", "", "");
    } catch (RemoteException e) {
        status = true;
        assertTrue(e.getMessage().contains("Access Denied."),
                "Access Denied Remote" + " Exception assertion Failed :");
        log.info("greg_login_user does not have permission to add a text resource :");

    }
    assertTrue(status, "Only user with write permission can put text resource");
    deleteRoleAndUsers(roleName, userName);
    addRoleWithUser(permission2);
    resourceAdminServiceClient = new ResourceAdminServiceClient(
            automationContext.getContextUrls().getBackEndUrl(), userName, userPassword);
    log.info("Newly Created User Loged in :" + userName);
    Thread.sleep(30000); //wait 30 sec before import WSDL
    resourceAdminServiceClient.addWSDL(resourceName, "", fetchUrl);
    resourceAdminServiceClient
            .deleteResource("/_system/governance/trunk/services/" + "org/wso2/carbon/core/services/echo/");
    resourceAdminServiceClient
            .deleteResource("/_system/governance/trunk/wsdls/org/" + "wso2/carbon/core/services/echo/");

}

From source file:org.wso2.carbon.registry.permission.test.old.GRegLoginPermissionServiceTestCase.java

@Test(groups = {
        "wso2.greg" }, description = "test add a role with login permission", expectedExceptions = AxisFault.class)
public void testAddLoginPermissionUser() throws Exception {

    EnvironmentBuilder builder = new EnvironmentBuilder().greg(userId);
    ManageEnvironment environment = builder.build();

    String permission[] = { "/permission/admin/login" };
    String userList[] = { userName };
    String sessionCookieUser = null;
    boolean status;

    addRoleWithUser(permission, userList);
    //sessionCookieUser = authenticatorClient.login(userName, userPassword, FrameworkSettings.HOST_NAME);
    log.info("Newly Created User Logged in :" + userName);

    try {/*  w  w  w . ja va2s .com*/
        status = false;
        resourceAdminServiceClient = new ResourceAdminServiceClient(
                environment.getGreg().getProductVariables().getBackendUrl(), userName, userPassword);
        // greg_login_user does not have permission to add a Text resource
        resourceAdminServiceClient.addTextResource("/", "login.txt", "", "", "");
    } catch (RemoteException e) {
        status = true;
        assertTrue(e.getMessage().contains("Access Denied"),
                "Access Denied Remote" + " Exception assertion Failed :");
        log.info("greg_login_user does not have permission to add a text resource :");
        throw new AxisFault("AxisFault");
    }
    assertTrue(status, "User can't upload resource having only login permission");
    //authenticatorClient.logOut();
}

From source file:org.wso2.carbon.registry.permission.test.old.GRegMetaDataPermissionServiceTestCase.java

@Test(groups = { "wso2.greg" }, description = "test add a role with login permission")
public void testAddMetaDataPermissionUser()
        throws Exception, RemoteException, ResourceAdminServiceExceptionException,
        LoginAuthenticationExceptionException, LogoutAuthenticationExceptionException {

    userPassword = "welcome";
    String permission1[] = { "/permission/admin/login" };
    //                                "/permission/admin/manage/resources/govern/metadata"};
    String permission2[] = { "/permission/admin/login", "/permission/admin/manage/resources" };
    String sessionCookieUser;/*ww w .  ja v  a2  s.c om*/
    boolean status;
    String resourceName = "echo.wsdl";
    String fetchUrl = "https://svn.wso2.org/repos/wso2/carbon/platform/branches/4.0.0/platform-integration/"
            + "clarity-tests/1.0.1/org.wso2.carbon.automation.test.repo/src/main/resources/artifacts/GREG/wsdl/echo.wsdl";
    addRolewithUser(permission1);

    try {
        status = false;
        resourceAdminServiceClient = new ResourceAdminServiceClient(
                environment.getGreg().getProductVariables().getBackendUrl(), userName, userPassword);
        // greg_meta_user does not have permission to add a Text resource
        resourceAdminServiceClient.addTextResource("/", "resource.txt", "", "", "");
    } catch (RemoteException e) {
        status = true;
        assertTrue(e.getMessage().contains("Access Denied."),
                "Access Denied Remote" + " Exception assertion Failed :");
        log.info("greg_login_user does not have permission to add a text resource :");

    }
    assertTrue(status, "Only user with write permission can put text resource");
    builder = new EnvironmentBuilder().greg(userId);
    environment = builder.build();

    deleteRoleAndUsers(roleName, userName);
    addRolewithUser(permission2);

    resourceAdminServiceClient = new ResourceAdminServiceClient(
            environment.getGreg().getProductVariables().getBackendUrl(), userName, userPassword);
    log.info("Newly Created User Loged in :" + userName);
    resourceAdminServiceClient.addWSDL(resourceName, "", fetchUrl);
    resourceAdminServiceClient
            .deleteResource("/_system/governance/trunk/services/" + "org/wso2/carbon/core/services/echo/");
    resourceAdminServiceClient
            .deleteResource("/_system/governance/trunk/wsdls/org/" + "wso2/carbon/core/services/echo/");
    deleteRoleAndUsers(roleName, userName);
    log.info("*********GReg Metadata Permission Asigning Scenario test - Passed**********");
}

From source file:org.wso2.carbon.rssmanager.ui.RSSManagerClient.java

public void createDatabase(String environmentName, DatabaseInfo database) throws AxisFault {
    try {//w  w  w .  j a va  2 s  .  c o m
        stub.addDatabase(environmentName, database);
    } catch (RemoteException e) {
        handleException(bundle.getString("rss.manager.failed.to.create.database") + " '" + database.getName()
                + "' : " + e.getMessage(), e);
    } catch (RSSAdminRSSManagerExceptionException e) {
        handleException(bundle.getString("rss.manager.failed.to.create.database") + " '" + database.getName()
                + "' : " + e.getFaultMessage().getRSSManagerException().getErrorMessage(), e);
    }

}

From source file:org.wso2.carbon.rssmanager.ui.RSSManagerClient.java

public void createDatabaseUser(String environmentName, DatabaseUserInfo user) throws AxisFault {

    try {// ww  w.  java 2  s  . co  m
        stub.addDatabaseUser(environmentName, user);
    } catch (RemoteException e) {
        handleException(bundle.getString("rss.manager.failed.to.create.database.user") + " : " + e.getMessage(),
                e);
    } catch (RSSAdminRSSManagerExceptionException e) {
        handleException(bundle.getString("rss.manager.failed.to.create.database.user") + " : "
                + e.getFaultMessage().getRSSManagerException().getErrorMessage(), e);
    }

}