Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No enum constant com.hazelcast.config.PartitionGroupConfig.MemberGroupType.NULL #487

Closed
Pepstock opened this issue May 25, 2013 · 0 comments

Comments

Projects
None yet
1 participant
@Pepstock
Copy link

commented May 25, 2013

Trying to create a configuration object by API, seralizing and deserializing the objects (by HC builder), due to an error of PartitionGroup (because if I set it by API it works) I have the following exception:

Exception in thread "main" java.lang.RuntimeException: java.lang.IllegalArgumentException: No enum constant com.hazelcast.config.PartitionGroupConfig.MemberGroupType.NULL
at com.hazelcast.config.XmlConfigBuilder.build(XmlConfigBuilder.java:165)
at com.hazelcast.config.XmlConfigBuilder.build(XmlConfigBuilder.java:152)
at com.hazelcast.config.XmlConfigBuilder.build(XmlConfigBuilder.java:148)
at org.pepstock.test.ConfTest.main(ConfTest.java:49)
Caused by: java.lang.IllegalArgumentException: No enum constant com.hazelcast.config.PartitionGroupConfig.MemberGroupType.NULL
at java.lang.Enum.valueOf(Unknown Source)
at com.hazelcast.config.PartitionGroupConfig$MemberGroupType.valueOf(PartitionGroupConfig.java:37)
at com.hazelcast.config.XmlConfigBuilder.handlePartitionGroup(XmlConfigBuilder.java:886)
at com.hazelcast.config.XmlConfigBuilder.handleConfig(XmlConfigBuilder.java:240)
at com.hazelcast.config.XmlConfigBuilder.parse(XmlConfigBuilder.java:209)
at com.hazelcast.config.XmlConfigBuilder.build(XmlConfigBuilder.java:163)
... 3 more

This is source code (with HC 2.5.1):

public class ConfTest {

/**
 * @param args
 */
public static void main(String[] args) {
    Config cfg = new Config();
    NetworkConfig network = cfg.getNetworkConfig();
    network.setPort(5900);
    network.setPortAutoIncrement(true);
    Join join = network.getJoin();
    join.getMulticastConfig().setEnabled(true);
    join.getMulticastConfig().setMulticastGroup("233.0.0.2");
    join.getMulticastConfig().setMulticastPort(11111);

    ConfigXmlGenerator gen = new ConfigXmlGenerator();

    String ss = gen.generate(cfg);
    System.out.println(ss);

    XmlConfigBuilder builder = new XmlConfigBuilder(new ByteArrayInputStream(ss.getBytes())); 

    Config cfg1 = builder.build();
}

}

This is XML generated:


<hazelcast xmlns="http://www.hazelcast.com/schema/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.hazelcast.com/schema/config http://www.hazelcast.com/schema/config/hazelcast-config-2.5.xsd">
     <group>
          <name>dev</name>
          <password>dev-pass</password>
     </group>
     <management-center enabled="false" update-interval="5">null</management-center>
     <network>
          <port auto-increment="true">5900</port>
          <join>
               <multicast enabled="true">
                    <multicast-group>233.0.0.2</multicast-group>
                    <multicast-port>11111</multicast-port>
                    <multicast-timeout-seconds>2</multicast-timeout-seconds>
                    <multicast-time-to-live-seconds>32</multicast-time-to-live-seconds>
               </multicast>
               <tcp-ip enabled="false"/>
               <aws enabled="false">
                    <access-key>null</access-key>
                    <secret-key>null</secret-key>
                    <region>null</region>
                    <security-group-name>null</security-group-name>
                    <tag-key>null</tag-key>
                    <tag-value>null</tag-value>
               </aws>
          </join>
          <interfaces enabled="false"/>
          <ssl enabled="false"/>
          <socket-interceptor enabled="false"/>
          <symmetric-encryption enabled="false"/>
          <asymmetric-encryption enabled="false"/>
     </network>
     <partition-group enabled="false" group-type="null"/>
     <merge-policies>
          <map-merge-policy name="hz.ADD_NEW_ENTRY">
               <class-name>com.hazelcast.merge.AddNewEntryMergePolicy</class-name>
          </map-merge-policy>
          <map-merge-policy name="hz.HIGHER_HITS">
               <class-name>com.hazelcast.merge.HigherHitsMergePolicy</class-name>
          </map-merge-policy>
          <map-merge-policy name="hz.LATEST_UPDATE">
               <class-name>com.hazelcast.merge.LatestUpdateMergePolicy</class-name>
          </map-merge-policy>
          <map-merge-policy name="hz.PASS_THROUGH">
               <class-name>com.hazelcast.merge.PassThroughMergePolicy</class-name>
          </map-merge-policy>
     </merge-policies>
</hazelcast>

@mdogan mdogan closed this in 76c71f0 May 27, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.