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

json-lib needs to be upgraded to 2.4 #2

Open
abhinavlele opened this issue Jan 29, 2012 · 0 comments
Open

json-lib needs to be upgraded to 2.4 #2

abhinavlele opened this issue Jan 29, 2012 · 0 comments

Comments

@abhinavlele
Copy link

Adding a new view from code gives the following error with the older library. It works fine with 2.4 (json-lib).

Exception in thread "main" net.sf.json.JSONException: java.lang.NoSuchMethodException: Property 'text' has no getter method
at net.sf.json.JSONObject._fromBean(JSONObject.java:958)
at net.sf.json.JSONObject.fromObject(JSONObject.java:193)
at net.sf.json.JSONObject._processValue(JSONObject.java:2778)
at net.sf.json.JSONObject.processValue(JSONObject.java:2837)
at net.sf.json.JSONObject.setInternal(JSONObject.java:2852)
at net.sf.json.JSONObject._accumulate(JSONObject.java:2725)
at net.sf.json.JSONObject.accumulate(JSONObject.java:1631)
at com.fourspaces.couchdb.Document.addView(Document.java:198)
at couch.Main.createViewGetSession(Main.java:37)
at couch.Main.main(Main.java:23)
Caused by: java.lang.NoSuchMethodException: Property 'text' has no getter method
at org.apache.commons.beanutils.PropertyUtilsBean.getSimpleProperty(PropertyUtilsBean.java:1127)
at org.apache.commons.beanutils.PropertyUtilsBean.getNestedProperty(PropertyUtilsBean.java:686)
at org.apache.commons.beanutils.PropertyUtilsBean.getProperty(PropertyUtilsBean.java:715)
at org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:290)
at net.sf.json.JSONObject._fromBean(JSONObject.java:930)
... 9 more

Sample Code:

Document doc = new Document();
doc.addView("checkexist", "getSessions", "function(doc) {\n emit(doc.sessionID, doc); \n}");
db.saveDocument(doc);

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

1 participant