Hi,
I have included google gson dependency in the pom.xml of my project as shown below:
<dependency><groupId>com.google.code.gson</groupId><artifactId>gson</artifactId><version>2.2.2</version></dependency>
I am able to build the project without any issues but when I am hitting the URL, the page does not load. I can see that in the system/console the project bundle is not getting started. Further, upon looking in the details of the bundle, it shows an error "com.google.gson,version=[2.2,3) -- Cannot be resolved"
Any idea what could possible go wrong.
Thanks,
Solved! Go to Solution.
Views
Replies
Total Likes
Read this Sling Article that uses a JSON API:
http://helpx.adobe.com/experience-manager/using/custom-sling-servlets.html
It uses org.json.simple.JSONObject API similar to GSON. As shown in the article - you have to wrap the JAR file (in your case -- com.google.code.gson) in a bundle fragment and deploy to CQ. You can follow the same steps as talked in the article. Replace JSONObject API with GSON API.
Hope this helps.
Views
Replies
Total Likes
Does this artifact represent a OSGI bundle? And even if it does, do you deploy this artifact into CQ?
Jörg
Views
Replies
Total Likes
Read this Sling Article that uses a JSON API:
http://helpx.adobe.com/experience-manager/using/custom-sling-servlets.html
It uses org.json.simple.JSONObject API similar to GSON. As shown in the article - you have to wrap the JAR file (in your case -- com.google.code.gson) in a bundle fragment and deploy to CQ. You can follow the same steps as talked in the article. Replace JSONObject API with GSON API.
Hope this helps.
Views
Replies
Total Likes
Thanks for the article. It really helped. I have been able to get the code with simple Json working but not with Gson. However, I am going ahead with implementing simple Json. Doesn't look much different from Gson anyway.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies