Sling servlet project compilation error
Hi Team,
I'm doing below exercise. I created a new project and followed the steps given in below link and also created JSON bundle and installed it in AEM.
However when I'm compiling/installing my project using Maven I'm getting below error.
[ERROR] core/servlets/SimpleServlet.java:[73,11] cannot find symbol
[ERROR] symbol: class JSONObject
I have verified in system console that JSON bundle is active. And below is the Manifest file which I used to create and install JSON bundle.
Bundle-ManifestVersion: 2
Bundle-Name: SimpleJSON
Bundle-SymbolicName: simpleJSON
Bundle-Version: 1.0.0
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Import-Package: org.json.simple,org.json.simple.parser
Export-Package: org.json.simple,
org.json.simple.parser
To resolve this, I have added below dependency in POM file also but didn't worked out ( Removed this dependency in POM later).
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20180130</version>
</dependency>
However when I install the package "ajaxHTL.ui.apps-1.0-SNAPSHOT.zip" directly, i see the application works fine with servlet call successfully.
Also added this jar "json-simple-1.1.1.jar" to project build path in ecplise but still getting error when compiling or installing with Maven. ( Later removed this jar from build path)
So not sure what step I'm missing in my project.
Any help in resolving this compilation error and calling servlet?
Thanks.