0

JOnAS で Java EE アプリをデプロイしようとしていますが、まだNo Validation Provider Found例外が発生します。このアプリを Glassfish や JBossAS などの他の Java EE コンテナーで実行しようとしましたが、すべて問題ありませんでした。追加した :

    <dependency>
        <groupId>org.ow2.jonas</groupId>
        <artifactId>jonas-validation-hibernate</artifactId>
        <version>5.2.2</version>
    </dependency>

また

    <dependency>
         <groupId>javax.validation</groupId>
         <artifactId>validation-api</artifactId>
         <version>1.0.0.GA</version>
    </dependency>

しかし、結果は同じでした。

スタックトレースは次のとおりです。

2012-02-25 13:00:25,195 : INFO : RMI TCP Connection(4)-127.0.0.1 : WebappLoader.start :    Dual registration of jndi stream handler: factory already defined
2012-02-25 13:00:25,865 : INFO : RMI TCP Connection(4)-127.0.0.1 : ApplicationContext.log :    Initializing Spring FrameworkServlet 'dispatcher'
2012-02-25 13:00:26,846 : SEVERE : RMI TCP Connection(4)-127.0.0.1 : ApplicationContext.log :    StandardWrapper.Throwable
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.validation.beanvalidation.LocalValidatorFactoryBean#0': Invocation of init method failed; nested exception is javax.validation.ValidationException: Could not create Configuration.
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
    at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:631)
    at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:588)
    at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:645)
    at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:508)
    at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:449)
    at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:133)
    at javax.servlet.GenericServlet.init(GenericServlet.java:212)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4420)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4733)
    at org.ow2.jonas.web.tomcat6.JOnASStandardContext.start(JOnASStandardContext.java:312)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
    at org.ow2.jonas.web.tomcat6.Tomcat6Service.__doRegisterWar(Tomcat6Service.java:764)
    at org.ow2.jonas.web.tomcat6.Tomcat6Service.doRegisterWar(Tomcat6Service.java)
    at org.ow2.jonas.web.base.BaseWebContainerService.registerWar(BaseWebContainerService.java:1019)
    at org.ow2.jonas.web.base.BaseWebContainerService.registerWar(BaseWebContainerService.java:1257)
    at org.ow2.jonas.web.base.proxy.HttpOnDemandProxy.addWar(HttpOnDemandProxy.java:352)
    at org.ow2.jonas.web.base.WARDeployer.doDeploy(WARDeployer.java:70)
    at org.ow2.util.ee.deploy.impl.deployer.AbsDeployer$1.execute(AbsDeployer.java:93)
    at org.ow2.util.ee.deploy.impl.deployer.AbsDeployer$1.execute(AbsDeployer.java:91)
    at org.ow2.util.execution.helper.RunnableHelper.execute(RunnableHelper.java:77)
    at org.ow2.util.ee.deploy.impl.deployer.AbsDeployer.deploy(AbsDeployer.java:91)
    at org.ow2.util.ee.deploy.impl.deployer.DeployerManager.deploy(DeployerManager.java:148)
    at org.ow2.jonas.lib.jmbeans.J2EEServer.__deploy(J2EEServer.java:823)
    at org.ow2.jonas.lib.jmbeans.J2EEServer.deploy(J2EEServer.java)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:458)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
    at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1427)
    at javax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:72)
    at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1265)
    at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1360)
    at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:788)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
    at sun.rmi.transport.Transport$1.run(Transport.java:159)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
Caused by: javax.validation.ValidationException: Could not create Configuration.
    at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:198)
    at org.springframework.validation.beanvalidation.LocalValidatorFactoryBean.afterPropertiesSet(LocalValidatorFactoryBean.java:184)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
    ... 63 more
Caused by: javax.validation.ValidationException: No Validation Provider Found. Check that a Validation Provider implementation is provided
    at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:193)
    ... 66 more
2012-02-25 13:00:26,854 : SEVERE : RMI TCP Connection(4)-127.0.0.1 : StandardContext.loadOnStartup :    Servlet /car-rental threw load() exception
javax.validation.ValidationException: No Validation Provider Found. Check that a Validation Provider implementation is provided
    at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:193)
    at org.springframework.validation.beanvalidation.LocalValidatorFactoryBean.afterPropertiesSet(LocalValidatorFactoryBean.java:184)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
    at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:631)
    at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:588)
    at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:645)
    at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:508)
    at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:449)
    at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:133)
    at javax.servlet.GenericServlet.init(GenericServlet.java:212)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4420)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4733)
    at org.ow2.jonas.web.tomcat6.JOnASStandardContext.start(JOnASStandardContext.java:312)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
    at org.ow2.jonas.web.tomcat6.Tomcat6Service.__doRegisterWar(Tomcat6Service.java:764)
    at org.ow2.jonas.web.tomcat6.Tomcat6Service.doRegisterWar(Tomcat6Service.java)
    at org.ow2.jonas.web.base.BaseWebContainerService.registerWar(BaseWebContainerService.java:1019)
    at org.ow2.jonas.web.base.BaseWebContainerService.registerWar(BaseWebContainerService.java:1257)
    at org.ow2.jonas.web.base.proxy.HttpOnDemandProxy.addWar(HttpOnDemandProxy.java:352)
    at org.ow2.jonas.web.base.WARDeployer.doDeploy(WARDeployer.java:70)
    at org.ow2.util.ee.deploy.impl.deployer.AbsDeployer$1.execute(AbsDeployer.java:93)
    at org.ow2.util.ee.deploy.impl.deployer.AbsDeployer$1.execute(AbsDeployer.java:91)
    at org.ow2.util.execution.helper.RunnableHelper.execute(RunnableHelper.java:77)
    at org.ow2.util.ee.deploy.impl.deployer.AbsDeployer.deploy(AbsDeployer.java:91)
    at org.ow2.util.ee.deploy.impl.deployer.DeployerManager.deploy(DeployerManager.java:148)
    at org.ow2.jonas.lib.jmbeans.J2EEServer.__deploy(J2EEServer.java:823)
    at org.ow2.jonas.lib.jmbeans.J2EEServer.deploy(J2EEServer.java)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:458)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
    at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1427)
    at javax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:72)
    at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1265)
    at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1360)
    at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:788)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
    at sun.rmi.transport.Transport$1.run(Transport.java:159)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
4

1 に答える 1

2

Jonas 5.2.0.1 と spring MVC 3.1.1.RELEASE で同じ問題に遭遇しました。私はこのように解決しました:

pom.xmlの依存関係の中で、次を追加しました。

<dependency>
    <groupId>javax.validation</groupId>
    <artifactId>validation-api</artifactId>
    <version>1.0.0.GA</version>
</dependency>
<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-validator</artifactId>
    <version>4.2.0.Final</version>
</dependency>

JONAS_BASE/conf ディレクトリに、classloader-default-filtering.xmlファイルがあります。このファイルを編集して、次の行を追加する必要があります。

<default-filters>
  <filter-name>org.apache.commons.digester.*</filter-name>
  <filter-name>org.springframework.*</filter-name>
  <filter-name>org.slf4j.*</filter-name>
  <filter-name>javax.validation.*</filter-name>
  <filter-name>org.hibernate.validator.*</filter-name>
</default-filters>

このようにして、Jonas から提供されたものではなく、確実に自分のjar を使用できます。Jonas を使用して奇妙なエラーが発生するたびに、そのようなフィルターを追加して、ここに由来するかどうかを再度確認します...

同じディレクトリで、「検証」がjonas.propertiesファイルの Jonas サービスの一部ではないことを確認します。私の場合、次の行があります。

jonas.services    jtm,security,resource,ejb3,web,ear,depmonitor

これら 2 つのファイルを編集したら、忘れずに Jonas を再起動してください。

お役に立てれば !

于 2012-02-29T09:52:51.183 に答える