Servet not getting resolved
Hi ,
I tried to create a sample servlet in aem 6.3 .
Please see below for the piece of code :
// all the import statements
@SlingServlet(
paths={"/bin/customservlet"}
)
public class Test extends SlingAllMethodsServlet {
private static final long serialVersionUID = 1L;
protected static final Logger LOGGER = LoggerFactory.getLogger(Test.class);
@Override
protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response) throws ServletException, IOException {
LOGGER.info("ENTERED THE SERVLET");
}
}
When I am trying to hit the servlet using locahost:4502/bin/customservlet - it is giving the following message
Resource at '/bin/customservlet' not found: No resource found
RequestURI=/bin/customservlet
Servlet= /apps/sling/servlet/errorhandler/404.html
I am not sure why I am getting this error.I checked error logs as well which is giving the following error :
31.01.2018 11:01:08.475 *INFO* [0:0:0:0:0:0:0:1 [1517376668472] GET /bin/customservlet HTTP/1.1] org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Resource /bin/customservlet not found
31.01.2018 11:01:08.478 *ERROR* [0:0:0:0:0:0:0:1 [1517376668472] GET /bin/customservlet HTTP/1.1] org.apache.sling.servlets.resolver.internal.SlingServletResolver Calling the error handler resulted in an error
java.lang.Error: Unresolved compilation problems:
Only a type can be imported. com.adobe.cq.sightly.WCMUse resolves to a package
WCMUse cannot be resolved to a type
The method activate() of type ResponseStatus must override or implement a supertype method
The method getResponse() is undefined for the type ResponseStatus
at apps.sling.servlet.errorhandler.ResponseStatus.<init>(ResponseStatus.java:18)
Please let me know how I will be able to resolve it.
Thanks,
Pallavi
