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

NoClassDefFoundError: com/hazelcast/com/eclipsesource/json/JsonObject when using Payara Server and hazelcast-aws #10994

Closed
Imadevops opened this issue Jul 27, 2017 · 1 comment

Comments

@Imadevops
Copy link

@Imadevops Imadevops commented Jul 27, 2017

Hazelcast comes bundled with Payara which is an OSGI environment. The com.hazelcast.com.eclipsesource.json.JsonObject class is not exported in the OSGI metadata in the MANIFEST of the Hazelcast.jar. Therefore cannot be loaded by classes in the hazelcast-aws-2.0.1.jar. Because of this, when we use the hazelcast-aws-2.0.1.jar and the Discovery SPI strategy with iam-role we get NoClassDefFoundError: com/hazelcast/com/eclipsesource/json/JsonObject . The discovery works fine when we provide the proper access-key and secret-key but fails with iam-role.

I raised an issue with the Payara team (payara/Payara#1806) regarding this. The suggested workaround was to manually edit the hazelcast.jar MANIFEST file and add com.hazelcast.com.eclipsesource.json;version="3.7.4" to the Export-Package section. This resolved our issue.

Contents of hazelcast-config.xml

<?xml version="1.0" encoding="UTF-8"?>
<hazelcast xsi:schemaLocation="http://www.hazelcast.com/schema/config hazelcast-config-3.7.xsd"
           xmlns="http://www.hazelcast.com/schema/config"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <group>
        <name>group-name</name>
        <password>group-pass</password>
    </group>
  <properties>
     <property name="hazelcast.discovery.enabled">true</property>
  </properties>
   <network>
        <port auto-increment="false">5700</port>
        <outbound-ports>
            <ports>0</ports>
        </outbound-ports>
        <join>
            <multicast enabled="false" />
            <tcp-ip enabled="false" />
            <aws enabled="false" />
           <discovery-strategies>
              <discovery-strategy  enabled="true" class="com.hazelcast.aws.AwsDiscoveryStrategy">
                <properties>
                   <property name="access-key">my-access-key</property>
                   <property name="secret-key">my-secret-key</property>
                   <property name="iam-role">IAM_ROLE</property>
                   <property name="region">us-west-1</property>
                   <property name="tag-key">TagName</property>
                   <property name="tag-value">TagValue</property>
                   <property name="hz-port">5700</property>
                </properties>
              </discovery-strategy>
            </discovery-strategies>
        </join>
      </network>
</hazelcast>

Environment

  • Payara Version: 4.1.1.171.1
  • Hazelcast Version: 3.7.4
  • JDK Version: 8 u131 - OpenJDK
  • Operating System: Linux - Amazon Linux
@mesutcelik
Copy link
Contributor

@mesutcelik mesutcelik commented Sep 22, 2017

As discussed with @jerrinot , I am closing the issue here but have created a new one on hazelcast-aws repository. hazelcast/hazelcast-aws#42

Hi @Imadevops ,
please follow up the issue for further update.

Thanks a lot for heads up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

4 participants
You can’t perform that action at this time.