2014-06-25 38 views
2

嗨,大家能幫助我嗎我在設置我的web項目中的bean驗證時遇到問題。幫助<f:validateBean /> - 無法實例化類型爲javax.faces.Bean的驗證程序

我已閱讀以下問題,我懷疑他們是我的jar文件中的問題,但我不確定哪一個。任何人都可以指出這場衝突的原因。

Why won't work?

JSF1005: Cannot instantiate validator of type javax.faces.Bean

堆棧跟蹤

Jun 25, 2014 11:20:42 AM com.sun.faces.application.ApplicationImpl createValidator 
SEVERE: JSF1005: Cannot instantiate validator of type javax.faces.Bean 
Jun 25, 2014 11:20:42 AM org.apache.catalina.core.StandardWrapperValve invoke 
SEVERE: Servlet.service() for servlet [facesServlet] in context with path [/CorpSoaBackOffice2] threw exception [Expression Error: Named Object: javax.faces.Bean not found.] with root cause 
javax.faces.FacesException: Expression Error: Named Object: javax.faces.Bean not found. 
    at com.sun.faces.application.ApplicationImpl.createValidator(ApplicationImpl.java:1596) 
    at org.omnifaces.application.OmniApplication.createValidator(OmniApplication.java:115) 
    at org.springframework.faces.webflow.FlowApplication.createValidator(FlowApplication.java:169) 
    at org.omnifaces.application.OmniApplication.createValidator(OmniApplication.java:115) 
    at com.sun.faces.component.validator.ComponentValidators.addValidatorsToComponent(ComponentValidators.java:282) 
    at com.sun.faces.component.validator.ComponentValidators.addValidators(ComponentValidators.java:201) 
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.processValidators(ComponentTagHandlerDelegateImpl.java:621) 
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.privateOnComponentPopulated(ComponentTagHandlerDelegateImpl.java:605) 
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:217) 
    at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120) 
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95) 
    at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137) 
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:203) 
    at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120) 
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95) 
    at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137) 
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:203) 
    at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120) 
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95) 
    at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137) 
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:203) 
    at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120) 
    at com.sun.faces.facelets.tag.jsf.ValidatorTagHandlerDelegateImpl.applyWrapping(ValidatorTagHandlerDelegateImpl.java:209) 
    at com.sun.faces.facelets.tag.jsf.ValidatorTagHandlerDelegateImpl.apply(ValidatorTagHandlerDelegateImpl.java:86) 
    at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120) 
    at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137) 
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:203) 
    at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120) 
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95) 
    at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137) 
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:203) 
    at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120) 
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95) 
    at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137) 
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:203) 
    at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120) 
    at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137) 
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:203) 
    at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120) 
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95) 
    at com.sun.faces.facelets.tag.ui.DefineHandler.applyDefinition(DefineHandler.java:106) 
    at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:201) 
    at com.sun.faces.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:395) 
    at com.sun.faces.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:366) 
    at com.sun.faces.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:111) 
    at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137) 
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:203) 
    at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120) 
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95) 
    at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137) 
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:203) 
    at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120) 
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95) 
    at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137) 
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:203) 
    at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120) 
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95) 
    at com.sun.faces.facelets.tag.jsf.core.ViewHandler.apply(ViewHandler.java:219) 
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95) 
    at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93) 
    at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:87) 
    at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:312) 
    at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:371) 
    at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:350) 
    at com.sun.faces.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:199) 
    at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:169) 
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95) 
    at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93) 
    at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:87) 
    at com.sun.faces.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:161) 
    at com.sun.faces.application.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:995) 
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:99) 
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) 
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219) 
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) 
    at com.bdo.ces.utilities.jsf.NoCacheFilterImpl.doFilter(NoCacheFilterImpl.java:50) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) 
    at com.bdo.ces.utilities.jsf.IECompatibleJsfPagesFilterImpl.doFilter(IECompatibleJsfPagesFilterImpl.java:50) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) 
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) 
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118) 
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84) 
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) 
    at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113) 
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) 
    at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103) 
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) 
    at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113) 
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) 
    at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154) 
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) 
    at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45) 
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) 
    at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199) 
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) 
    at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110) 
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) 
    at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50) 
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) 
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) 
    at org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:125) 
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) 
    at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87) 
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) 
    at org.springframework.security.web.access.channel.ChannelProcessingFilter.doFilter(ChannelProcessingFilter.java:144) 
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) 
    at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192) 
    at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160) 
    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344) 
    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) 
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) 
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) 
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) 
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) 
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) 
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:947) 
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) 
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) 
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1009) 
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) 
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1686) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) 
    at java.lang.Thread.run(Thread.java:722) 

我的lib

antlr-2.7.7.jar 
aopalliance-1.0.jar 
aspectjrt-1.8.0.jar 
aspectjweaver-1.8.0.jar 
bcmail-jdk14-1.38.jar 
bcprov-jdk14-1.38.jar 
bctsp-jdk14-1.38.jar 
c3p0-0.9.2.1.jar 
ces-theme.jar 
classmate-1.0.0.jar 
commons-beanutils-1.8.0.jar 
commons-codec-1.5.jar 
commons-collections-2.1.jar 
commons-digester-1.7.jar 
commons-lang3-3.1.jar 
commons-logging-1.1.3.jar 
dom4j-1.6.1.jar 
gson-2.2.4.jar 
hibernate-c3p0-4.3.5.Final.jar 
hibernate-commons-annotations-4.0.4.Final.jar 
hibernate-core-4.3.5.Final.jar 
hibernate-jpa-2.1-api-1.0.0.Final.jar 
hibernate-validator-5.1.1.Final.jar 
itext-4.2.1.jar 
jandex-1.1.0.Final.jar 
jasperreports-3.5.3.jar 
javassist-3.18.1-GA.jar 
jboss-logging-3.1.3.GA.jar 
jboss-logging-annotations-1.2.0.Beta1.jar 
jboss-transaction-api_1.2_spec-1.0.0.Final.jar 
jcl-over-slf4j-1.7.7.jar 
jcommon-1.0.15.jar 
jdtcore-3.1.0.jar 
jfreechart-1.0.12.jar 
jsf-api-2.2.5.jar 
jsf-impl-2.2.5.jar 
jstl-1.2.jar 
jul-to-slf4j-1.7.7.jar 
log4j-over-slf4j-1.7.7.jar 
logback-classic-1.1.2.jar 
logback-core-1.1.2.jar 
mchange-commons-java-0.2.3.4.jar 
ognl-2.6.11.jar 
omnifaces-1.7.jar 
pdf-renderer-1.0.5.jar 
poi-3.10-FINAL.jar 
primefaces-5.0.jar 
primefaces-extensions-2.0.0.jar 
slf4j-api-1.7.7.jar 
spring-aop-4.0.5.RELEASE.jar 
spring-aspects-4.0.5.RELEASE.jar 
spring-beans-4.0.5.RELEASE.jar 
spring-binding-2.3.3.RELEASE.jar 
spring-context-4.0.5.RELEASE.jar 
spring-core-4.0.5.RELEASE.jar 
spring-expression-4.0.5.RELEASE.jar 
spring-faces-2.3.3.RELEASE.jar 
spring-jdbc-4.0.5.RELEASE.jar 
spring-js-2.3.3.RELEASE.jar 
spring-js-resources-2.3.3.RELEASE.jar 
spring-orm-4.0.5.RELEASE.jar 
spring-security-acl-3.2.4.RELEASE.jar 
spring-security-config-3.2.4.RELEASE.jar 
spring-security-core-3.2.4.RELEASE.jar 
spring-security-taglibs-3.2.4.RELEASE.jar 
spring-security-web-3.2.4.RELEASE.jar 
spring-tx-4.0.5.RELEASE.jar 
spring-web-4.0.5.RELEASE.jar 
spring-webflow-2.3.3.RELEASE.jar 
spring-webmvc-4.0.5.RELEASE.jar 
sqljdbc4.jar 
validation-api-1.1.0.Final.jar 
xml-apis-1.3.02.jar 

的Tomcat 7.0.39 LIB(在一個我們在正式版)

tomcat-util.jar 
annotations-api.jar 
catalina.jar 
catalina-ant.jar 
catalina-ha.jar 
catalina-tribes.jar 
ecj-4.2.1.jar 
el-api.jar 
jasper.jar 
jasper-el.jar 
jsp-api.jar 
servlet-api.jar 
tomcat-api.jar 
tomcat-coyote.jar 
tomcat-dbcp.jar 
tomcat-i18n-es.jar 
tomcat-i18n-fr.jar 
tomcat-i18n-ja.jar 
tomcat-jdbc.jar 

回答

1

顯然,這個時候問題不是我的錯,但與鑽嘴魚科(JSF-implement執行)將罐中的錯誤。

Bean validation doesn't work with mojarra 2.2.4

我通過創建一個ServletContextListener來試圖解決那裏。哪些工作,但我也發現,只需更新到bug已經修復的最新版本即可解決問題。

JSF的API-2.2.5.jar ---> JSF的API-2.2.7.jar

JSF的參數impl-2.2.5.jar ---> JSF的參數impl-2.2.7 .jar

相關問題