Skip to main content
Level 2
Oct 30, 2024 8:10 PM UTC
Solved

Adaptive Form fails to make a REST call

I'm getting the following error when I submit my form. I have the submit action set to "submit to REST endpoint" and "enable POST request" checked with the path to the servlet.



30.10.2024 15:25:41.668 *ERROR* [[0:0:0:0:0:0:0:1] [1730316341654] POST /content/forms/af/poster-api-registration/jcr:content/guideContainer.af.submit.jsp HTTP/1.1] com.adobe.aemds.guide.service.impl.RESTSubmitActionService Failed to make REST call
org.apache.http.client.ClientProtocolException: null
...
Caused by: org.apache.http.ProtocolException: Target host is not specified

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
wizard04wsuAccepted solution
Level 2
Nov 14, 2024 4:05 PM UTC

It is now working, but unfortunately I don't know what change actually resolved the problem.

4 replies

Adobe Employee
Oct 31, 2024 1:24 AM UTC

Hello @wizard04wsu 

 

Can you please confirm if your REST endpoint is hosted internally in the AEM server or on external server?

Can you try directly hitting that REST endpoint through postman with complete url and see if you are getting any response?

 

The error is pointing to "Target host not specified" which means the URL provided is not complete.

 

Thanks,

Rahul Pandey

Translate
Level 2
Oct 31, 2024 2:19 PM UTC

It is hosted internally. I tried with postman this morning. It is getting a response with this error instead:

 

31.10.2024 10:05:35.030 *ERROR* [[0:0:0:0:0:0:0:1] [1730383535026] POST /bin/poster-api-auth0 HTTP/1.1] org.apache.sling.servlets.post.impl.operations.ModifyOperation Unable to create resource named poster-api-auth0 in /bin
31.10.2024 10:05:35.031 *ERROR* [[0:0:0:0:0:0:0:1] [1730383535026] POST /bin/poster-api-auth0 HTTP/1.1] org.apache.sling.servlets.post.impl.operations.ModifyOperation Exception during response processing.
org.apache.sling.api.resource.PersistenceException: Unable to create node at /bin/poster-api-auth0

...

Caused by: javax.jcr.nodetype.ConstraintViolationException: No default node type available for /bin/poster-api-auth0

Translate
Pulkit_Jain_
Adobe Employee
Adobe Employee
Nov 3, 2024 2:09 PM UTC

@wizard04wsu 

You can provide a path of the resource itself instead of the complete URL, to post data to an internal server.

Did you exclude the path "/bin/poster-api-auth0" from the authentication requirement under the "Sling authentication service" under http://host:port/system/console/configMgr

Translate
wizard04wsuAuthorAccepted solution
Level 2
Nov 14, 2024 4:05 PM UTC

It is now working, but unfortunately I don't know what change actually resolved the problem.

Translate