Adaptive Form fails to make a REST call | Community
Skip to main content
Level 2
October 30, 2024
Solved

Adaptive Form fails to make a REST call

  • October 30, 2024
  • 3 replies
  • 1057 views

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.
Best answer by wizard04wsu

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

3 replies

Adobe Employee
October 31, 2024

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

Level 2
October 31, 2024

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

Pulkit_Jain_
Adobe Employee
Adobe Employee
November 3, 2024

@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

wizard04wsuAuthorAccepted solution
Level 2
November 14, 2024

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