calls to native JSONObject methods results in compiler error when using 'webdsl run'
The webdsl run command passes the –test arg to the webdsl compiler, and during java compilation, I get this error when using JSONObject’s:
.../.servletapp/src-generated/webdsl/generated/domain/Publication.java:5130: unreported exception org.json.JSONException; must be caught or declared to be thrown obj2.put("month", this.getMonth()); (where obj2 is a JSONObject)
When using webdsl build (which doesn’t pass the –test arg), this error is not thrown and the app builds succesfully.
Probably because of a caching bug, calling run after build will work:webdsl cleanall build -> no errors
webdsl cleanall run -> compile error
webdsl cleanall build run -> no error
Submitted by Elmer van Chastelet on 17 June 2011 at 14:49
Issue Log
This is caused by
json-20080701.jar
in/src/org/webdsl/dsl/project/template-java-servlet/lib-test/
. The source of theput
method throws theJSONException
. When thelib-test
jars are not included, then the definition ofJSONObject
comes from/java-runtime/src/org/json/JSONObject.java
where theput
method does not throw the exception. Thejson-20080701.jar
is a dependency of selenium, so removing it may cause problems.
fixed in r5681
Log in to post comments