是否有一个使用Seam Validation验证方法参数的简单示例?

时间:2013-06-17 12:01:34

标签: seam hibernate-validator

我被困了...... 我知道https://github.com/gunnarmorling/methodvalidation-integration/tree/master/methodvalidation-cdi,它运行正常,我知道有Seam验证可以帮助我在Hibernate Validator 4.2.0中验证我的方法参数

我重构了上面的例子以使用Seam Validation:

  • AutoValidatingValidationInterceptor替换为Seam Validation的类
  • beans.xml更改为使用org.jboss.seam.validation.ValidationInterceptor
  • 更改了CdiMethodValidationTest以使用Seam Validation的ValidationInterceptor
  • seam-validation-apiseam-validation 3.1.0.Final添加到Maven POM
  • 在POM中将arquillian-weld-se-embedded-1更改为arquillian-weld-ee-embedded-1.1

我得到的只是

java.lang.NoSuchMethodError: org.jboss.weld.bootstrap.api.Bootstrap.parse(Ljava/lang/Iterable;)Lorg/jboss/weld/bootstrap/spi/BeansXml;
at org.jboss.arquillian.container.weld.ee.embedded_1_1.mock.TestContainer.<init>(TestContainer.java:215)
at org.jboss.arquillian.container.weld.ee.embedded_1_1.WeldEEMockContainer.deploy(WeldEEMockContainer.java:76)
at org.jboss.arquillian.impl.handler.ContainerDeployer.callback(ContainerDeployer.java:62)
at org.jboss.arquillian.impl.handler.ContainerDeployer.callback(ContainerDeployer.java:50)
at org.jboss.arquillian.impl.event.MapEventManager.fire(MapEventManager.java:63)
at org.jboss.arquillian.impl.context.AbstractEventContext.fire(AbstractEventContext.java:115)
at org.jboss.arquillian.impl.EventTestRunnerAdaptor.beforeClass(EventTestRunnerAdaptor.java:96)
at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:162)
at org.jboss.arquillian.junit.Arquillian$3$1.evaluate(Arquillian.java:186)
at org.jboss.arquillian.junit.Arquillian$MultiStatementExecutor.execute(Arquillian.java:297)
at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:182)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:127)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

我做错了什么?

0 个答案:

没有答案