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

java.lang.NoSuchMethodError: org.json.JSONObject.putOnce(... #217

Closed
ghost opened this issue Oct 6, 2015 · 6 comments
Closed

java.lang.NoSuchMethodError: org.json.JSONObject.putOnce(... #217

ghost opened this issue Oct 6, 2015 · 6 comments
Labels

Comments

@ghost
Copy link

ghost commented Oct 6, 2015

I can retrieve Users, Projects, Issues etc..
but when I try to insert a new Issue:

Issue issue  = IssueFactory.create(projectTest.getId, "Test INSERT")
issueManager.createIssue(issue)

i get:

18:10:13.740 [http-nio-8080-exec-10] WARN  com.bqn.backoffice.redmine - Issue [id=null, subject=Test de INSERT]
java.lang.NoSuchMethodError: org.json.JSONObject.putOnce(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    at org.json.JSONWriter.key(JSONWriter.java:210) ~[json-20090211.jar:0.0.20131108.vaadin1]
    at com.taskadapter.redmineapi.internal.RedmineJSONBuilder.toSimpleJSON(RedmineJSONBuilder.java:220) ~[redmine-java-api-2.4.0.jar:na]
    at com.taskadapter.redmineapi.internal.Transport.addObject(Transport.java:220) ~[redmine-java-api-2.4.0.jar:na]
    at com.taskadapter.redmineapi.IssueManager.createIssue(IssueManager.java:173) ~[redmine-java-api-2.4.0.jar:na]
@ghost
Copy link
Author

ghost commented Oct 6, 2015

Environment:
Redmine version 3.1.1.stable
Ruby version 1.9.3-p484 (2013-11-22) [x86_64-linux]
Rails version 4.2.4

@ghost
Copy link
Author

ghost commented Oct 6, 2015

18:05:58.234 [http-nio-8080-exec-10] DEBUG c.t.r.internal.comm.BaseCommunicator - GET http://localhost:3000//projects/test.json?include=trackers&key=ca7a15f89d1d753646538a186ef6de5754118881 HTTP/1.1
18:05:58.335 [http-nio-8080-exec-10] DEBUG c.t.redmineapi.RedmineManager - {"project":{"id":1,"name":"Test","identifier":"test","description":"","homepage":"","status":1,"trackers":[{"id":1,"name":"Bug"},{"id":2,"name":"Feature"},{"id":3,"name":"Support"}],"created_on":"2015-10-06T19:14:39Z","updated_on":"2015-10-06T19:14:39Z"}}
18:05:59.002 [http-nio-8080-exec-10] DEBUG c.t.r.internal.comm.BaseCommunicator - GET http://localhost:3000//issues/1.json?include=null&key=ca7a15f89d1d753646538a186ef6de5754118881 HTTP/1.1
18:05:59.051 [http-nio-8080-exec-10] DEBUG c.t.redmineapi.RedmineManager - {"issue":{"id":1,"project":{"id":1,"name":"Test"},"tracker":{"id":1,"name":"Bug"},"status":{"id":1,"name":"New"},"priority":{"id":2,"name":"Normal"},"author":{"id":6,"name":"BackOffice BQN"},"subject":"prueba","description":"","start_date":"2015-10-06","done_ratio":0,"spent_hours":0.0,"created_on":"2015-10-06T19:23:49Z","updated_on":"2015-10-06T19:23:49Z"}}

@alexeyOnGitHub
Copy link
Member

my first guess would be that you have some incompatible version of json library in the classpath.
I see "json-20090211.jar:0.0.20131108.vaadin1" in your output. what is that? is it some custom version of json library packed with vaadin?

@ghost
Copy link
Author

ghost commented Oct 19, 2015

Like you said it was an incompatibility library dependenci between two modules I've been using.

Tks.

@ghost ghost closed this as completed Oct 19, 2015
@alexeyOnGitHub
Copy link
Member

it may be helpful to other developers if you provide a brief description on how you identified the duplicate jar...

@cudu
Copy link

cudu commented Mar 28, 2019

this code will help u

<dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-test</artifactId>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <groupId>com.vaadin.external.google</groupId>
          <artifactId>android-json</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants