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

Does not compile: unreported exception #131

Closed
drallgood opened this issue Mar 19, 2015 · 9 comments
Closed

Does not compile: unreported exception #131

drallgood opened this issue Mar 19, 2015 · 9 comments

Comments

@drallgood
Copy link

docker-maven-plugin/src/main/java/org/jolokia/docker/maven/access/ContainerHostConfig.java:[24,28] unreported exception org.json.JSONException; must be caught or declared to be thrown

@rhuss
Copy link
Collaborator

rhuss commented Mar 19, 2015

That's strange. AFAIS JSONException is a runtime exception. And it compiles perfectly for me (on a fresh checked out repo). Which branch did you use ? Did you changed the pom.xml ?

Currently we are using

   <dependency>
      <groupId>org.json</groupId>
      <artifactId>json</artifactId>
      <version>20140107</version>
    </dependency>

@drallgood
Copy link
Author

Very strange indeed.

You're right, it is a RuntimeException and thus shouldn't cause any issues.

I checked out the master branch and didn't change anything significant yet (trying to add #130).

@drallgood
Copy link
Author

My environment:

Apache Maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 2014-08-11T22:58:10+02:00)
Maven home: /usr/local/Cellar/maven/3.2.3/libexec
Java version: 1.8.0_25, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.10.3", arch: "x86_64", family: "mac"

@rhuss
Copy link
Collaborator

rhuss commented Mar 19, 2015

And that what I did which worked for me:

10:23 [/tmp] $ git clone git@github.com:rhuss/docker-maven-plugin.git
Cloning into 'docker-maven-plugin'...
remote: Counting objects: 4214, done.
remote: Compressing objects: 100% (40/40), done.
remote: Total 4214 (delta 10), reused 0 (delta 0), pack-reused 4156
Receiving objects: 100% (4214/4214), 901.40 KiB | 694.00 KiB/s, done.
Resolving deltas: 100% (1791/1791), done.
Checking connectivity... done.
10:23 [/tmp] $ cd docker-maven-plugin/
10:23 [/tmp/docker-maven-plugin] (master) $ mvn -version
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T18:29:23+01:00)
Maven home: /usr/local/Cellar/maven/3.2.5/libexec
Java version: 1.8.0_40, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.10.2", arch: "x86_64", family: "mac"
10:23 [/tmp/docker-maven-plugin] (master) $ mvn install
....

Except for minor version differences (Maven 3.2.3 vs. 3.2.5, Java 1.8.0_25 vs 1.8.0_40) there are no differences. Could you pastebin a full mvn -X install for more details ?

@rhuss
Copy link
Collaborator

rhuss commented Mar 19, 2015

BTW, OS X 10.10.3, this is a beta version, or ?

@drallgood
Copy link
Author

Yep.

Pastebin didn't work so I put it in my dropbox:
https://dl.dropboxusercontent.com/u/17133427/share/2015-03-19_dockerMavenPlugin_131.txt

I get the distinct feeling that there is an old version of the json dependency interfering somehow...

@rhuss
Copy link
Collaborator

rhuss commented Mar 19, 2015

Whats interesting: In you debug output I find this

[DEBUG] found MojoAnnotatedClass:org.json.JSONException:MojoAnnotatedClass{className='org.json.JSONException',
parentClassName='java.lang.Exception', mojo=null, execute=null, parameters=null, components=null}

whereas when I run it, it's

[DEBUG] found MojoAnnotatedClass:org.json.JSONException:MojoAnnotatedClass{className='org.json.JSONException',
parentClassName='java.lang.RuntimeException', mojo=null, execute=null, parameters=null, components=null}

Could you try to remove your ~/.m2/repository/org/json/json/20140107/ and try it again ?
BTW, for me, the directory looks like

12:42 [/tmp/docker-maven-plugin] (master) $ ls -l ~/.m2/repository/org/json/json/20140107/
total 84
-rw-r--r-- 1 roland staff   187 Mar 18 09:09 _remote.repositories
-rw-r--r-- 1 roland staff 64952 Mar 18 09:09 json-20140107.jar
-rw-r--r-- 1 roland staff    40 Mar 18 09:09 json-20140107.jar.sha1
-rw-r--r-- 1 roland staff  4188 Mar 18 09:09 json-20140107.pom
-rw-r--r-- 1 roland staff    40 Mar 18 09:09 json-20140107.pom.sha1

@rhuss
Copy link
Collaborator

rhuss commented Mar 19, 2015

BTW, its here where the exception changed from Exception to RuntimeException: stleary/JSON-java@0759465

@drallgood
Copy link
Author

yep. That did it. No idea why but I guess it somehow contained a broken/old version that pretended to be the current one.

Thanks!

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

No branches or pull requests

2 participants