Expand my Community achievements bar.

SOLVED

POST form error - javax.jcr.nodetype.ConstraintViolationException: no matching property definition found for

Avatar

Former Community Member

Hi all,

I'm having an issue with the above error when I do a form POST. I have done several research but failed to resolve the above problem. According to what I discover, the solution seems to be "when the default sling servlet is handling the request. It’s trying to add properties to the JCR node but it can’t due to the node type definition. Make sure that the bundle is started and the servlet is working correctly and it should function as expected" but I have no idea how to do that. Can anyone enlighten me on this?

I'm currently on CQ5.5

Thanks

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Do you have an OSGI bundle that has the servlet for your form defined? Or are you using the OOB CQ form?

If you are using the OOB CQ form, what action are you trying to do?

If you have an OSGI bundle for the Servlet logic, go to http://localhost:4502/system/console and view the bundles associated with your CQ instance listed there.

Find your OSGI bundle in the list and see if it is running (running bundles will have a 'stop' button beside them). If it is not running, try force starting it. If that does not work, there must be some issues with how you had built the bundle (Issues with your maven project if you use one to build the OSGI bundle).

View solution in original post

3 Replies

Avatar

Level 7

As the explanation says:

If you are doing a post of data from a form, you need to specify a special servlet to handle this post if you, in that form, has values that are not the ones usually expected for the node which you do the post to. I guess that you are trying to post data to you own servlet ? In that case, follow Anwars tips above. If that's not the case, then you need to check what you are sending from the form and which resource the "post" will end up on.

It would be great if you could provide some examples so we could help you further.

Regards
Johan

Avatar

Correct answer by
Former Community Member

Do you have an OSGI bundle that has the servlet for your form defined? Or are you using the OOB CQ form?

If you are using the OOB CQ form, what action are you trying to do?

If you have an OSGI bundle for the Servlet logic, go to http://localhost:4502/system/console and view the bundles associated with your CQ instance listed there.

Find your OSGI bundle in the list and see if it is running (running bundles will have a 'stop' button beside them). If it is not running, try force starting it. If that does not work, there must be some issues with how you had built the bundle (Issues with your maven project if you use one to build the OSGI bundle).

Avatar

Former Community Member

Hi Anwar,

I check the bundle at the link you directed and tried a restart of the bundle. It still prompts the same error.


Hi Johan,

I'm following the example posted by Antony on http://antonyh.co.uk/blog/2012/05/15/multi-page-forms-in-cq5-html.html , download link for the cq5 package at http://www.filedropper.com/multipage-form . After installing the package, I could run the example at http://localhost:port/content/geometrixx/en/form-demo.html without any issue but when I tried to integrate the component into my website page using the following code


<cq:include script="/apps/multipageform/components/sample/GET.jsp"/>

The component was able to render on the webpage but when I tried to submit the form, I hit the error as mentioned in the subject title.


The things that I want to achieve is to process inputs from user via a form at server end and return the corrected inputs back to user end. I have implemented the client side processing using javascript but on the event that javascript is disabled on client browser I want to be able to do similar processing on the server end. Let me know if there is any alternative to achieve this.

 

Thanks

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----