0

I have two AEM instances, one local, and one on our dev machine, that have the same code, setup, etc..

URL's are correctly resolving as custom servlets that are defined by the path. However, on another machine that sits on the client's environment, the URLs resolve to the DefaultSlingServlet. I've tried to find out what the differences could be between that environment and the others, but I haven't come up with any ideas since they have the same version of AEM 5.6.1, running the same JDK, using the same exact installation bundle.

URL endpoint is resolving to our custom servlets on most AEM instances, but to the default servlet on a machine that is housed elsewhere.

We've tried setting up the servlet to resolve by path, and also by resourceType, and with both approaches they work fine on the first set of machines and balk on the other. So it is not the way path vs. resourceType in servlet definition.

Has anyone hit this quirky behavior? I imagine that it must be related to settings on the different environments but so far no luck in finding differences.

Thanks for any ideas!

(btw, when I post to the custom servlet on the bad machine, it reports a PersistencException (when defined by path), or a ConstraintViolationException (when defined by resourceType). But that is to be expected since it is the default servlet trying to do something to the node that it is not allowed to do)

Megan M.
  • 1
  • 1

2 Answers2

1

You should check whether the servlet service is actually registered, using the OSGi console at /system/console/components and/or /system/console/services, and compare between working and non-working instances.

The /system/console/requests page can also help as it shows how requests are dispatched.

Worst case, DEBUG level logs should help see exactly how servlets are resolved.

Bertrand Delacretaz
  • 6,100
  • 19
  • 24
  • Thanks Bertrand - I actually have never looked at /system/console/requests in Felix, only the resource resolver. Good to know! I'm going to give these a look and we've already requested the DEBUG logs from the owner of other instance so hopefully will get some answers on there. I'll post back here what I find out. – Megan M. Sep 29 '14 at 16:10
0

As pointed by Bertrand, your Servlets are not registered in OSGi.

By default all your GET requests are handled by DefaultGetServlet and all your POST requests goto SlingPOSTServlet (which gives persistence exceptions when you are posting)

Goto your felix console and check if the servlets are deployed.

Also if you want to see which servlet is invoked for any particular request then use the servlet resolver tool:

/system/console/servletresolver

Rajesh Pantula
  • 10,061
  • 9
  • 43
  • 52
  • Thanks Rajesh. The servlets are set up the same and are working well on our internal dev environment (i.e., resolving correctly and triggered by doPost). They are not resolving on the external machine for some reason -- even though it is set up exactly the same :( – Megan M. Sep 29 '14 at 16:03
  • I think it must have something to do with their configuration. We've asked them to change log level to DEBUG and hopefully that will reveal something different! – Megan M. Sep 29 '14 at 16:04