javax.jcr.nodetype.ConstraintViolationException | Community
Skip to main content
AEMLearner-1989
Level 4
Aug 18, 2017 8:11 AM UTC

javax.jcr.nodetype.ConstraintViolationException

Hi Team,

I have changed the method from GET to POST in  HTML form ...I am getting the following error

“javax.jcr.nodetype.ConstraintViolationException: no matching property definition found

When i hit the submit button.

Any pointer here??

Regards,

Sathya

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

6 replies

kautuk_sahni
Employee
Aug 21, 2017 2:03 PM UTC

Can you share POST body of AJAX?

This is the exact problem you are facing:- AJAX POST Method Call error : javax.jcr.nodetype.ConstraintViolationException

//If the property name contains a namespace, and the namespace isn't there, JCR tries to create the namespace for you. But if you don't have enough permissions to do so, it will throw this kind of exception. Don't post JSON string, but rather simple form-like data. This will work fine then.

Also, When posting data from an HTML form to AEM - post the data to a Sling Servlet using AJAX. See this community article:

https://helpx.adobe.com/experience-manager/using/custom-sling-servlets.html

~kautuk

Translate
Kautuk Sahni
AEMLearner-1989
Level 4
Aug 22, 2017 10:28 AM UTC

dataVal = {"fname": fname, "phoneno": phoneno, "email": email, "state": state, "city": city, "alterphoneno": alterphoneno, "coatchingfor": coatchingfor, "pagetitle": hdenbpgtitle, "bpgtitle": bpgtitle, "utm_param": fullpageurl};

            $.ajax({

                async: false,

                type: "POST",

                url: urls,

                data: dataVal,

                success: function (msg) {

                    if (JSON.stringify(msg.success)) {

                        var leadid = msg.LeadID;

                        $('form').attr('action', '/content/pagepath?id=" + leadid);

                    } else {

                        alert('Sorry, Try again');

                        return false;

                    }

                }

Translate
smacdonald2008
Level 10
Aug 22, 2017 5:05 PM UTC

See the article that Prince pointed you to. You will learn how to post values to an Experience Manager Sling Servlet.

Translate
Prince_Shivhare
New Participant
Aug 18, 2017 8:23 AM UTC

Hi Sathya,

Are you using sling servlet using ajax?

did you checked Adobe Experience Manager Help | Submitting Adobe Experience Manager form data to Java Sling Servlets  for reference?

Regards,
Prince

Translate
AEMLearner-1989
Level 4
Aug 18, 2017 2:48 PM UTC

Yes Prince.. you are ryt..I am using ajax

Translate