You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@storm.apache.org by Ferran Muñoz <fe...@gmail.com> on 2015/05/06 11:30:44 UTC

Conflict with json-simple

Hi,

I am using a library in a bolt of my topology that depends on json-simple
v1.1.1 because it uses the JSONObject constructor that accepts a
java.util.Map parameter.

I have a conflict because Storm depends on json-simple v1.1. So, when I run
my topology I get the exception:

java.lang.NoSuchMethodError: org.json.simple.JSONObject: method
<init>(Ljava/util/Map;)V not found

How can I tackle with this?

Thanks in advance and best regards,

Ferran

Re: Conflict with json-simple

Posted by Jeff Maass <JM...@cccis.com>.
Let us see your POM file please.

From: Ferran Muñoz <fe...@gmail.com>>
Reply-To: "user@storm.apache.org<ma...@storm.apache.org>" <us...@storm.apache.org>>
Date: 2015,Wednesday, May 6 at 04:30
To: "user@storm.apache.org<ma...@storm.apache.org>" <us...@storm.apache.org>>
Subject: Conflict with json-simple

Hi,

I am using a library in a bolt of my topology that depends on json-simple v1.1.1 because it uses the JSONObject constructor that accepts a java.util.Map parameter.

I have a conflict because Storm depends on json-simple v1.1. So, when I run my topology I get the exception:

java.lang.NoSuchMethodError: org.json.simple.JSONObject: method <init>(Ljava/util/Map;)V not found

How can I tackle with this?

Thanks in advance and best regards,

Ferran

Re: Conflict with json-simple

Posted by 임정택 <ka...@gmail.com>.
Yes, please refer
https://github.com/apache/storm/blob/master/bin/storm.py#L110 to how Storm
build classpath while submitting.

2015-05-07 0:24 GMT+09:00 Jeff Maass <JM...@cccis.com>:

>  HeartSaVioR:
>
>  Is this correct?
>
>  so, effectively, storm forces topology code to make use of the version
> of its libraries.
>
>  In this instance, the developer’s topology wishes to make use of
> com.googlecode.json-simple version 1.1.1
> Storm version 0.9.4 uses com.googlecode.json-simple version 1.1
> Therefore, all topologies run on 0.9.4 are forced to use version 1.1 of
> com.googlecode.json-simple
>
>  Storm version 0.9.4:
> http://mvnrepository.com/artifact/org.apache.storm/storm-core/0.9.4
>
>  If we wanted to use a later version of com.googlecode.json-simple, we
> could go to the lib directory of our storm installation, and replace the
> lower version of the jar.  For instance, in my
> installation, /opt/apache-storm-0.9.4/lib, the jar is json-simple-1.1.jar.
>  I would delete json-simple-1.1.jar and replace it with
> json-simple-1.1.1.jar.  At that point, all I would need to do is kill the
> worker in any topologies requiring com.googlecode.json-simple version 1.1.1
> ( If they had not already died due to an un-hanlded exception ).  The
> supervisor would then restart the worker, which would pick up the new,
> 1.1.1 jar.
>
>  This will only work if the com.google.code.json-simple library, 1.1.1 is
> backwards compatible with the com.google.cod.json-simple 1.1 library.
>
>
>   From: 임정택 <ka...@gmail.com>
> Reply-To: "user@storm.apache.org" <us...@storm.apache.org>
> Date: 2015,Wednesday, May 6 at 09:44
> To: "user@storm.apache.org" <us...@storm.apache.org>
> Subject: Re: Conflict with json-simple
>
>   Hi.
>
>  Unfortunately, Storm adds all jars in <storm root>/lib directory to
> classpath first.
> Recently Storm relocates some libraries to reduce dependency conflict
> (please see http://storm.apache.org/2014/11/25/storm093-released.html)
> but json-simple is not in.
>
>  You can try replacing json-simple-1.1.jar to json-simple-1.1.1.jar in
> your storm cluster's lib directory and restart cluster / submit your
> topology, but please note that it should be backward compatible to let
> Storm runs without issue.
>
>  Bests.
> Jungtaek Lim (HeartSaVioR)
>
> 2015-05-06 18:30 GMT+09:00 Ferran Muñoz <fe...@gmail.com>:
>
>>  Hi,
>>
>>  I am using a library in a bolt of my topology that depends on
>> json-simple v1.1.1 because it uses the JSONObject constructor that accepts
>> a java.util.Map parameter.
>>
>>  I have a conflict because Storm depends on json-simple v1.1. So, when I
>> run my topology I get the exception:
>>
>>  java.lang.NoSuchMethodError: org.json.simple.JSONObject: method
>> <init>(Ljava/util/Map;)V not found
>>
>>  How can I tackle with this?
>>
>>  Thanks in advance and best regards,
>>
>>  Ferran
>>
>
>
>
>  --
>  Name : 임 정택
> Blog : http://www.heartsavior.net / http://dev.heartsavior.net
> Twitter : http://twitter.com/heartsavior
> LinkedIn : http://www.linkedin.com/in/heartsavior
>



-- 
Name : 임 정택
Blog : http://www.heartsavior.net / http://dev.heartsavior.net
Twitter : http://twitter.com/heartsavior
LinkedIn : http://www.linkedin.com/in/heartsavior

Re: Conflict with json-simple

Posted by Jeff Maass <JM...@cccis.com>.
HeartSaVioR:

Is this correct?

so, effectively, storm forces topology code to make use of the version of its libraries.

In this instance, the developer’s topology wishes to make use of com.googlecode.json-simple version 1.1.1
Storm version 0.9.4 uses com.googlecode.json-simple version 1.1
Therefore, all topologies run on 0.9.4 are forced to use version 1.1 of com.googlecode.json-simple

Storm version 0.9.4:
http://mvnrepository.com/artifact/org.apache.storm/storm-core/0.9.4

If we wanted to use a later version of com.googlecode.json-simple, we could go to the lib directory of our storm installation, and replace the lower version of the jar.  For instance, in my installation, /opt/apache-storm-0.9.4/lib, the jar is json-simple-1.1.jar.  I would delete json-simple-1.1.jar and replace it with json-simple-1.1.1.jar.  At that point, all I would need to do is kill the worker in any topologies requiring com.googlecode.json-simple version 1.1.1 ( If they had not already died due to an un-hanlded exception ).  The supervisor would then restart the worker, which would pick up the new, 1.1.1 jar.

This will only work if the com.google.code.json-simple library, 1.1.1 is backwards compatible with the com.google.cod.json-simple 1.1 library.


From: 임정택 <ka...@gmail.com>>
Reply-To: "user@storm.apache.org<ma...@storm.apache.org>" <us...@storm.apache.org>>
Date: 2015,Wednesday, May 6 at 09:44
To: "user@storm.apache.org<ma...@storm.apache.org>" <us...@storm.apache.org>>
Subject: Re: Conflict with json-simple

Hi.

Unfortunately, Storm adds all jars in <storm root>/lib directory to classpath first.
Recently Storm relocates some libraries to reduce dependency conflict (please see http://storm.apache.org/2014/11/25/storm093-released.html) but json-simple is not in.

You can try replacing json-simple-1.1.jar to json-simple-1.1.1.jar in your storm cluster's lib directory and restart cluster / submit your topology, but please note that it should be backward compatible to let Storm runs without issue.

Bests.
Jungtaek Lim (HeartSaVioR)

2015-05-06 18:30 GMT+09:00 Ferran Muñoz <fe...@gmail.com>>:
Hi,

I am using a library in a bolt of my topology that depends on json-simple v1.1.1 because it uses the JSONObject constructor that accepts a java.util.Map parameter.

I have a conflict because Storm depends on json-simple v1.1. So, when I run my topology I get the exception:

java.lang.NoSuchMethodError: org.json.simple.JSONObject: method <init>(Ljava/util/Map;)V not found

How can I tackle with this?

Thanks in advance and best regards,

Ferran



--
Name : 임 정택
Blog : http://www.heartsavior.net / http://dev.heartsavior.net
Twitter : http://twitter.com/heartsavior
LinkedIn : http://www.linkedin.com/in/heartsavior

Re: Conflict with json-simple

Posted by 임정택 <ka...@gmail.com>.
Hi.

Unfortunately, Storm adds all jars in <storm root>/lib directory to
classpath first.
Recently Storm relocates some libraries to reduce dependency conflict
(please see http://storm.apache.org/2014/11/25/storm093-released.html) but
json-simple is not in.

You can try replacing json-simple-1.1.jar to json-simple-1.1.1.jar in your
storm cluster's lib directory and restart cluster / submit your topology,
but please note that it should be backward compatible to let Storm runs
without issue.

Bests.
Jungtaek Lim (HeartSaVioR)

2015-05-06 18:30 GMT+09:00 Ferran Muñoz <fe...@gmail.com>:

> Hi,
>
> I am using a library in a bolt of my topology that depends on json-simple
> v1.1.1 because it uses the JSONObject constructor that accepts a
> java.util.Map parameter.
>
> I have a conflict because Storm depends on json-simple v1.1. So, when I
> run my topology I get the exception:
>
> java.lang.NoSuchMethodError: org.json.simple.JSONObject: method
> <init>(Ljava/util/Map;)V not found
>
> How can I tackle with this?
>
> Thanks in advance and best regards,
>
> Ferran
>



-- 
Name : 임 정택
Blog : http://www.heartsavior.net / http://dev.heartsavior.net
Twitter : http://twitter.com/heartsavior
LinkedIn : http://www.linkedin.com/in/heartsavior