0
當我使用JSF 2.1提交表單並使用JBoss服務器時,出現標題異常。javax.servlet.ServletException:HV000030:找不到可用於類型爲java.util.Date的驗證程序
我想使用和學習hibernate註釋。
我的實體Bean是這樣的:
@NotEmpty
@Temporal(TemporalType.DATE)
private Date date;
我得到這個錯誤頁面:
JBWEB000071: root cause
javax.validation.UnexpectedTypeException: HV000030: No validator could be found for type: java.util.Date.
org.hibernate.validator.internal.engine.ConstraintTree.verifyResolveWasUnique(ConstraintTree.java:411)
org.hibernate.validator.internal.engine.ConstraintTree.findMatchingValidatorClass(ConstraintTree.java:392)
org.hibernate.validator.internal.engine.ConstraintTree.getInitializedValidator(ConstraintTree.java:350)
org.hibernate.validator.internal.engine.ConstraintTree.validateConstraints(ConstraintTree.java:171)
org.hibernate.validator.internal.engine.ConstraintTree.validateComposingConstraints(ConstraintTree.java:259)
org.hibernate.validator.internal.engine.ConstraintTree.validateConstraints(ConstraintTree.java:154)
org.hibernate.validator.internal.engine.ConstraintTree.validateConstraints(ConstraintTree.java:124)
org.hibernate.validator.internal.metadata.core.MetaConstraint.validateConstraint(MetaConstraint.java:86)
org.hibernate.validator.internal.engine.ValidatorImpl.validatePropertyForDefaultGroup(ValidatorImpl.java:820)
org.hibernate.validator.internal.engine.ValidatorImpl.validatePropertyForCurrentGroup(ValidatorImpl.java:733)
org.hibernate.validator.internal.engine.ValidatorImpl.validateValueInContext(ValidatorImpl.java:690)
org.hibernate.validator.internal.engine.ValidatorImpl.validateValue(ValidatorImpl.java:169)
javax.faces.validator.BeanValidator.validate(BeanValidator.java:315)
javax.faces.component.UIInput.validateValue(UIInput.java:1153)
javax.faces.component.UIInput.validate(UIInput.java:971)
javax.faces.component.UIInput.executeValidate(UIInput.java:1237)
javax.faces.component.UIInput.processValidators(UIInput.java:702)
javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1216)
javax.faces.component.UIForm.processValidators(UIForm.java:253)
javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1216)
javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1216)
javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:1164)
com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
是否有人知道這是爲什麼?
謝謝