Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

servlet only working on cloud author, not publish instance?

Avatar

Level 9

We created a simple servlet with a fixed path of /bin/demo/querybuilder.

 

 

 

 

 

(service = Servlet.class, property = { Constants.SERVICE_DESCRIPTION + "=Query Builder servlet",
		"sling.servlet.methods=" + HttpConstants.METHOD_GET, "sling.servlet.paths=" + "/bin/demo/querybuilder" })
public class SimonServlet extends SlingSafeMethodsServlet {

 

 

 

 

 

This works great on local sdk, and works hitting the cloud author instance.  However, when we hit the corresponding publish instance, we get:

 

 

 

 

 

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head>
	<title>404 Not Found</title>
</head>
<body>
	<h1>Not Found</h1>
	<p>The requested URL was not found on this server.</p>
</body>
</html>

 

 

 

 

 

Any ideas how we get them onto publish? Our content gets pushed onto the publish instance automatically.   A servlet which can't be published is of no use.

 

Update:

added the following line:

 

 

/005 { /type "allow" /url "/bin/myapi/*"    }

 

 

to 

 

 

myapp.dispatcher.cloud/src/conf.dispatcher.d/filters/filters.any

 

 

and deployed to dev cloud instance.  This seems to work, EXCEPT its stripping all the request headers. even things like X-Correlation-Token. 

 

How to get AEM to not remove the request headers for serlvets?

12 Replies