Re: [json-lib-user] java.lang.NoSuchMethodException
Brought to you by:
aalmiray
From: Tim H. <har...@ya...> - 2012-03-09 21:37:37
|
Sounds suspiciously like you might be picking an incorrect version of your source off the classpath. It is a common technique when you see this to pull out the code into a stand alone app as you have done. If that test is telling you that it works then you are either picking up a wrong version of JSON lib, or an older compile of your source. You probably just need to closely inspect your classpath is my guess. >________________________________ > From: Eric Kolotyluk <eri...@gm...> >To: jso...@li... >Sent: Friday, March 9, 2012 1:09 PM >Subject: [json-lib-user] java.lang.NoSuchMethodException > >When I run the following code > > Server [] servers = (Server[]) >JSONArray.toArray(jsonArray, Server.class); // line 1308 > >I get > >net.sf.json.JSONException: java.lang.NoSuchMethodException: >com.kodak.vip.sct.view.PreferencesDialog$ServerPanel$Server.<init>() > at net.sf.json.JSONObject.toBean(JSONObject.java:288) > at net.sf.json.JSONArray.toArray(JSONArray.java:318) > at net.sf.json.JSONArray.toArray(JSONArray.java:250) > at >com.kodak.vip.sct.view.PreferencesDialog$ServerPanel$ServerComboBox.<init>(PreferencesDialog.java:1308) > >So far as I can tell, json-lib thinks it cannot find the no-arg >constructor for my Server class. But it is there, I can see it. > >I have even tested this same line of code in a stand-alone test >application and it works fine, but when I am using it in my real >application I get this exception. > >What could be causing json-lib to be confused? > >Cheers, Eric > >------------------------------------------------------------------------------ >Virtualization & Cloud Management Using Capacity Planning >Cloud computing makes use of virtualization - but cloud computing >also focuses on allowing computing to be delivered as a service. >http://www.accelacomm.com/jaw/sfnl/114/51521223/ >_______________________________________________ >json-lib-user mailing list >jso...@li... >https://lists.sourceforge.net/lists/listinfo/json-lib-user > > > |