cancel
Showing results for 
Search instead for 
Did you mean: 

Missing Annotation class for NotEmptyCuppyConstraint in Hybris Wiki trail for Validation

geffchang
Active Contributor
0 Kudos

Hybris 5.7 Validation trail: https://wiki.hybris.com/pages/viewpage.action?pageId=294094213

In the Validation trail, under "Writing a custom validation constraint", I'm getting an error when I click "Create" for a new "NotEmptyCuppyConstraint". The cause is the blank read-only "Annotation class" field. I already did an "ant all updatesystem -Dtenant=master" before starting the Hybris server.

How do I fix this?

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

I found that hybris does not support custom annotation for custom constraint.Look at this class AttributeConstraintValidator.In this class,look at this method isConstraintValidForAccessor.

geffchang
Active Contributor
0 Kudos

I checked the API for AttributeConstraint validator (https://download.hybris.com/api/5.7.0/commercesuite/), but I do not see a method named isConstraintValidForAccessor.

Former Member
0 Kudos

This is a private method in AttributeConstraintValidator.That's really weird.

By the way,can i add you as friend on Skype?So we can communicate on skype about hybris whenever we have problems

Former Member
0 Kudos

my skype account is nogrethumphrey@gmail.com

Former Member
0 Kudos

Your workaround method does not work in hybris 6.0.I tried.But your method works with TypeConstraint

Former Member
0 Kudos

Hi,Did you find the answer?

geffchang
Active Contributor
0 Kudos

I do not have correct answer, but I found a workaround to make the constraint work. See my answer: http://answers.sap.com/answers/12787051/view.html

geffchang
Active Contributor
0 Kudos

My workaround was to manually define the Annotation class Default value with "de.hybris.platform.cuppytrail.constraints.NotEmptyCuppy" via HMC:

If somebody else can provide a reason why I got the error (Did I miss something, or is there a problem with the wiki / steps?), I'd appreciate it.