I am deploying the simplest servlet - keep getting the error when I call it from a web page using simple ajax call. (this works locally btw)
Status
500
Message
javax.jcr.nodetype.ConstraintViolationException: No child node definition for wcm found in node /bin
Location invalid link: /bin/wcm/imf/SampleTest/bin/wcm/imf/SampleTest
Parent Location /bin/wcm/imf
Path
/bin/wcm/imf/SampleTest
@Component(metatype = false)
@Service
@Properties({
@Property(name = "sling.servlet.paths", value = "/bin/wcm/imf/SampleTest"),
@Property(name = "sling.servlet.methods", value = "GET")
})
public class SampleTestServlet extends SlingAllMethodsServlet {
private final static Logger log = LoggerFactory.getLogger(SampleTestServlet.class);
@Reference
protected SlingSettingsService settingsService;
@Override
protected void doGet(SlingHttpServletRequest request,
SlingHttpServletResponse response) throws ServletException,
IOException {
response.getWriter().println("hi");
}
}
Solved! Go to Solution.
Views
Replies
Total Likes
Sounds like there dependencies on author that are not on the other server. Assume your bundle is successfully installed on Author and depends on BundleA. However BunldeA is not installed on Publisher. In this case - your bundle can be set to active on Author but not on Publisher.
Views
Replies
Total Likes
First off, you should try to avoid registering servlets by path. This means that you aren't taking advantage of one of the key features of Apache Sling -- the ability to use resources to model your path space.
That said, it looks to me like the problem is in how your AJAX code is accessing the servlet. It appears to be making a POST request, yet your servlet is only registered to accept GET requests.
The subject line mentions deploying - are you sure that the servlet has been deployed? You can check this using the OSGi web console.
Regards,
Justin
Views
Replies
Total Likes
Sounds like there dependencies on author that are not on the other server. Assume your bundle is successfully installed on Author and depends on BundleA. However BunldeA is not installed on Publisher. In this case - your bundle can be set to active on Author but not on Publisher.
Views
Replies
Total Likes
If it works locally - that means you have not deployed (or placed into an active state) your OSGi bundle that contains the servlet to AEM publish.
Views
Replies
Total Likes
I had originially a completely working sample using proper matching GET to GET
What i noticed is, the component in system/console/components when I deploy on local, shows status "Active". I deploy the snapshot to my staging environemnt, it shows "registered" with no way to switch it on.
Why would a component only be registered and not active? I also updated it to read "immediate=true". The bundle is active as well.
Views
Replies
Total Likes
So to give more info, i use same method to deploy to local/stage
a. build the bundle locally using maven (follow all the guidelines)
b. Take the jar from bundle/target and upload it to system/console
Views
Replies
Total Likes