Search in sources :

Example 26 with GemFireConfigException

use of org.apache.geode.GemFireConfigException in project geode by apache.

the class ManagementAgent method registerAccessControlMBean.

private void registerAccessControlMBean() {
    try {
        AccessControlMBean acc = new AccessControlMBean();
        ObjectName accessControlMBeanON = new ObjectName(ResourceConstants.OBJECT_NAME_ACCESSCONTROL);
        MBeanServer platformMBeanServer = ManagementFactory.getPlatformMBeanServer();
        Set<ObjectName> names = platformMBeanServer.queryNames(accessControlMBeanON, null);
        if (names.isEmpty()) {
            try {
                platformMBeanServer.registerMBean(acc, accessControlMBeanON);
                logger.info("Registered AccessControlMBean on " + accessControlMBeanON);
            } catch (InstanceAlreadyExistsException | MBeanRegistrationException | NotCompliantMBeanException e) {
                throw new GemFireConfigException("Error while configuring accesscontrol for jmx resource", e);
            }
        }
    } catch (MalformedObjectNameException e) {
        throw new GemFireConfigException("Error while configuring accesscontrol for jmx resource", e);
    }
}
Also used : MalformedObjectNameException(javax.management.MalformedObjectNameException) GemFireConfigException(org.apache.geode.GemFireConfigException) NotCompliantMBeanException(javax.management.NotCompliantMBeanException) InstanceAlreadyExistsException(javax.management.InstanceAlreadyExistsException) AccessControlMBean(org.apache.geode.management.internal.security.AccessControlMBean) MBeanRegistrationException(javax.management.MBeanRegistrationException) ObjectName(javax.management.ObjectName) MBeanServer(javax.management.MBeanServer)

Example 27 with GemFireConfigException

use of org.apache.geode.GemFireConfigException in project geode by apache.

the class AutoBalancerJUnitTest method testMinimalConfiguration.

@Test
public void testMinimalConfiguration() {
    AutoBalancer autoR = new AutoBalancer();
    try {
        autoR.init(null);
        fail();
    } catch (GemFireConfigException e) {
    // expected
    }
    Properties props = getBasicConfig();
    autoR.init(props);
}
Also used : GemFireConfigException(org.apache.geode.GemFireConfigException) Properties(java.util.Properties) Test(org.junit.Test) IntegrationTest(org.apache.geode.test.junit.categories.IntegrationTest)

Example 28 with GemFireConfigException

use of org.apache.geode.GemFireConfigException in project geode by apache.

the class JettyHelperJUnitTest method testSetPortWithBindAddress.

@Test
public void testSetPortWithBindAddress() throws Exception {
    try {
        final Server jetty = JettyHelper.initJetty("10.123.50.1", 10480, SSLConfigurationFactory.getSSLConfigForComponent(SecurableCommunicationChannel.WEB));
        assertNotNull(jetty);
        assertNotNull(jetty.getConnectors()[0]);
        assertEquals(10480, ((ServerConnector) jetty.getConnectors()[0]).getPort());
    } catch (GemFireConfigException e) {
        fail(e.getMessage());
    }
}
Also used : Server(org.eclipse.jetty.server.Server) GemFireConfigException(org.apache.geode.GemFireConfigException) Test(org.junit.Test) UnitTest(org.apache.geode.test.junit.categories.UnitTest)

Aggregations

GemFireConfigException (org.apache.geode.GemFireConfigException)28 IOException (java.io.IOException)11 SystemConnectException (org.apache.geode.SystemConnectException)10 Properties (java.util.Properties)7 ForcedDisconnectException (org.apache.geode.ForcedDisconnectException)7 DistributedSystemDisconnectedException (org.apache.geode.distributed.DistributedSystemDisconnectedException)6 Test (org.junit.Test)6 UnknownHostException (java.net.UnknownHostException)5 CancelException (org.apache.geode.CancelException)5 ByteArrayInputStream (java.io.ByteArrayInputStream)4 DataInputStream (java.io.DataInputStream)4 InetSocketAddress (java.net.InetSocketAddress)4 GemFireIOException (org.apache.geode.GemFireIOException)4 VersionedDataInputStream (org.apache.geode.internal.VersionedDataInputStream)4 MemberShunnedException (org.apache.geode.internal.tcp.MemberShunnedException)4 GemFireSecurityException (org.apache.geode.security.GemFireSecurityException)4 InputStream (java.io.InputStream)3 InvocationTargetException (java.lang.reflect.InvocationTargetException)3 ServerSocket (java.net.ServerSocket)3 NetView (org.apache.geode.distributed.internal.membership.NetView)3