在我决定从tomee web profiler迁移到jetty(9.0.7)之前,我一直在我的jsf 2.2应用程序中使用omnifaces而没有问题。它似乎有一些注释和CDI相关的问题阻止Weld(2.1.2.Final)和Omnifaces(1.7)很好地适应,我使用Omnifaces的唯一功能是隐藏我的URL的扩展名。
项目设置的简要视图:
相关的POM依赖项:
<!--OmniFaces-->
<dependency>
<groupId>org.omnifaces</groupId>
<artifactId>omnifaces</artifactId>
<version>1.7</version>
</dependency>
<!--Weld for cdi in jetty-->
<dependency>
<groupId>org.jboss.weld.servlet</groupId>
<artifactId>weld-servlet</artifactId>
<version>${weld.version}</version>
<scope>runtime</scope>
</dependency>
web.xml中的:
<context-param>
<param-name>org.omnifaces.FACES_VIEWS_SCAN_PATHS</param-name>
<param-value>/*.xhtml</param-value>
</context-param>
所有焊接相关的内容都来自override-web.xml(在web.xml之后解析):
<!--WELD-->
<listener>
<listener-class>org.jboss.weld.environment.servlet.Listener</listener-class>
</listener>
<resource-env-ref>
<resource-env-ref-name>BeanManager</resource-env-ref-name>
<resource-env-ref-type>
javax.enterprise.inject.spi.BeanManager
</resource-env-ref-type>
</resource-env-ref>
<!--weld complains if the following is not done manually :-S-->
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
我试图保持我的应用程序不受不必要的xml配置的限制,直到现在我还设法这样做了。如果我通过在beans.xml中添加以下内容来指示焊接排除Omnifaces中有问题的类:< / p>
<scan>
<exclude name="org.omnifaces" />
<exclude name="org.omnifaces.cdi.param.RequestParameterProducer"/>
<exclude name="org.omnifaces.validator.JsfLabelMessageInterpolator"/>
<exclude name="org.omnifaces.util.Platform"/>
</scan>
然后一切运行正常,omnifaces做它的工作,并从网址中删除扩展,焊接不会抱怨什么,所以我的问题是这是否是现在唯一的方法,或者是有没有更好的方法来解决这个问题,而不会污染我的beans.xml?
下面是我在使用mtn jetty时遇到的异常的副本:运行:
org.jboss.weld.resources.spi.ResourceLoadingException: Exception while loading class org.omnifaces.cdi.param.RequestParameterProducer
at org.jboss.weld.resources.ClassTransformer.getBackedAnnotatedType(ClassTransformer.java:179) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.resources.ClassTransformer.getBackedAnnotatedType(ClassTransformer.java:194) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.bootstrap.BeanDeployer.loadAnnotatedType(BeanDeployer.java:119) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:96) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.bootstrap.ConcurrentBeanDeployer$1.doWork(ConcurrentBeanDeployer.java:62) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.bootstrap.ConcurrentBeanDeployer$1.doWork(ConcurrentBeanDeployer.java:60) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:60) [weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:53) [weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [na:1.7.0_13]
at java.util.concurrent.FutureTask.run(FutureTask.java:166) [na:1.7.0_13]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_13]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_13]
at java.lang.Thread.run(Thread.java:722) [na:1.7.0_13]
Caused by: java.lang.TypeNotPresentException: Type javax.validation.ConstraintViolation not present
at sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:117) ~[na:1.7.0_13]
at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:125) ~[na:1.7.0_13]
at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49) ~[na:1.7.0_13]
at sun.reflect.generics.visitor.Reifier.reifyTypeArguments(Reifier.java:68) ~[na:1.7.0_13]
at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:138) ~[na:1.7.0_13]
at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49) ~[na:1.7.0_13]
at sun.reflect.generics.repository.MethodRepository.getReturnType(MethodRepository.java:68) ~[na:1.7.0_13]
at java.lang.reflect.Method.getGenericReturnType(Method.java:244) ~[na:1.7.0_13]
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedMethod.<init>(BackedAnnotatedMethod.java:38) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedMethod.of(BackedAnnotatedMethod.java:32) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType$BackedAnnotatedMethods.computeValue(BackedAnnotatedType.java:193) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType$BackedAnnotatedMethods.computeValue(BackedAnnotatedType.java:186) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.util.LazyValueHolder.get(LazyValueHolder.java:35) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType$EagerlyInitializedLazyValueHolder.<init>(BackedAnnotatedType.java:154) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType$BackedAnnotatedMethods.<init>(BackedAnnotatedType.java:186) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType$BackedAnnotatedMethods.<init>(BackedAnnotatedType.java:186) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType.<init>(BackedAnnotatedType.java:66) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType.of(BackedAnnotatedType.java:47) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.resources.ClassTransformer$TransformClassToBackedAnnotatedType.load(ClassTransformer.java:83) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.resources.ClassTransformer$TransformClassToBackedAnnotatedType.load(ClassTransformer.java:80) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3589) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2374) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2337) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2252) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at com.google.common.cache.LocalCache.get(LocalCache.java:3990) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3994) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4878) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.util.cache.LoadingCacheUtils.getCacheValue(LoadingCacheUtils.java:52) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.util.cache.LoadingCacheUtils.getCastCacheValue(LoadingCacheUtils.java:80) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.resources.ClassTransformer.getBackedAnnotatedType(ClassTransformer.java:175) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
... 12 common frames omitted
Caused by: java.lang.ClassNotFoundException: javax.validation.ConstraintViolation
at java.net.URLClassLoader$1.run(URLClassLoader.java:366) ~[na:1.7.0_13]
at java.net.URLClassLoader$1.run(URLClassLoader.java:355) ~[na:1.7.0_13]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.7.0_13]
at java.net.URLClassLoader.findClass(URLClassLoader.java:354) ~[na:1.7.0_13]
at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:420) ~[jetty-webapp-9.0.7.v20131107.jar:9.0.7.v20131107]
at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:382) ~[jetty-webapp-9.0.7.v20131107.jar:9.0.7.v20131107]
at java.lang.Class.forName0(Native Method) ~[na:1.7.0_13]
at java.lang.Class.forName(Class.java:266) ~[na:1.7.0_13]
at sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:114) ~[na:1.7.0_13]
... 41 common frames omitted
20:26:49.562 [weld-worker-1] INFO org.jboss.weld.Bootstrap - WELD-000119: Not generating any bean definitions from org.omnifaces.validator.JsfLabelMessageInterpolator because of underlying class loading error: Type javax.validation.MessageInterpolator not found. If this is unexpected, enable DEBUG logging to see the full error.
20:26:49.574 [weld-worker-1] DEBUG org.jboss.weld.Bootstrap - Catching
org.jboss.weld.resources.spi.ResourceLoadingException: Error loading class org.omnifaces.validator.JsfLabelMessageInterpolator
at org.jboss.weld.resources.AbstractClassLoaderResourceLoader.classForName(AbstractClassLoaderResourceLoader.java:44) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.bootstrap.BeanDeployer.loadClass(BeanDeployer.java:106) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:94) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.bootstrap.ConcurrentBeanDeployer$1.doWork(ConcurrentBeanDeployer.java:62) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.bootstrap.ConcurrentBeanDeployer$1.doWork(ConcurrentBeanDeployer.java:60) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:60) [weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:53) [weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [na:1.7.0_13]
at java.util.concurrent.FutureTask.run(FutureTask.java:166) [na:1.7.0_13]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_13]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_13]
at java.lang.Thread.run(Thread.java:722) [na:1.7.0_13]
Caused by: java.lang.NoClassDefFoundError: javax/validation/MessageInterpolator
at java.lang.ClassLoader.defineClass1(Native Method) ~[na:1.7.0_13]
at java.lang.ClassLoader.defineClass(ClassLoader.java:791) ~[na:1.7.0_13]
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) ~[na:1.7.0_13]
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) ~[na:1.7.0_13]
at java.net.URLClassLoader.access$100(URLClassLoader.java:71) ~[na:1.7.0_13]
at java.net.URLClassLoader$1.run(URLClassLoader.java:361) ~[na:1.7.0_13]
at java.net.URLClassLoader$1.run(URLClassLoader.java:355) ~[na:1.7.0_13]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.7.0_13]
at java.net.URLClassLoader.findClass(URLClassLoader.java:354) ~[na:1.7.0_13]
at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:420) ~[jetty-webapp-9.0.7.v20131107.jar:9.0.7.v20131107]
at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:382) ~[jetty-webapp-9.0.7.v20131107.jar:9.0.7.v20131107]
at org.jboss.weld.resources.AbstractClassLoaderResourceLoader.classForName(AbstractClassLoaderResourceLoader.java:40) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
... 11 common frames omitted
Caused by: java.lang.ClassNotFoundException: javax.validation.MessageInterpolator
at java.net.URLClassLoader$1.run(URLClassLoader.java:366) ~[na:1.7.0_13]
at java.net.URLClassLoader$1.run(URLClassLoader.java:355) ~[na:1.7.0_13]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.7.0_13]
at java.net.URLClassLoader.findClass(URLClassLoader.java:354) ~[na:1.7.0_13]
at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:420) ~[jetty-webapp-9.0.7.v20131107.jar:9.0.7.v20131107]
at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:382) ~[jetty-webapp-9.0.7.v20131107.jar:9.0.7.v20131107]
... 23 common frames omitted
20:26:49.769 [weld-worker-2] INFO org.jboss.weld.Bootstrap - WELD-000119: Not generating any bean definitions from org.omnifaces.util.Platform because of underlying class loading error: Type javax.validation.ValidatorFactory not found. If this is unexpected, enable DEBUG logging to see the full error.
20:26:49.780 [weld-worker-2] DEBUG org.jboss.weld.Bootstrap - Catching
org.jboss.weld.resources.spi.ResourceLoadingException: Error while loading class org.omnifaces.util.Platform
at org.jboss.weld.resources.ClassTransformer.getBackedAnnotatedType(ClassTransformer.java:186) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.resources.ClassTransformer.getBackedAnnotatedType(ClassTransformer.java:194) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.bootstrap.BeanDeployer.loadAnnotatedType(BeanDeployer.java:119) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:96) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.bootstrap.ConcurrentBeanDeployer$1.doWork(ConcurrentBeanDeployer.java:62) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.bootstrap.ConcurrentBeanDeployer$1.doWork(ConcurrentBeanDeployer.java:60) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:60) [weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:53) [weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [na:1.7.0_13]
at java.util.concurrent.FutureTask.run(FutureTask.java:166) [na:1.7.0_13]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_13]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_13]
at java.lang.Thread.run(Thread.java:722) [na:1.7.0_13]
Caused by: java.lang.NoClassDefFoundError: javax/validation/ValidatorFactory
at java.lang.Class.getDeclaredMethods0(Native Method) ~[na:1.7.0_13]
at java.lang.Class.privateGetDeclaredMethods(Class.java:2451) ~[na:1.7.0_13]
at java.lang.Class.getDeclaredMethods(Class.java:1810) ~[na:1.7.0_13]
at org.jboss.weld.security.GetDeclaredMethodsAction.run(GetDeclaredMethodsAction.java:30) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.security.GetDeclaredMethodsAction.run(GetDeclaredMethodsAction.java:22) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.7.0_13]
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType$BackedAnnotatedMethods.computeValue(BackedAnnotatedType.java:192) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType$BackedAnnotatedMethods.computeValue(BackedAnnotatedType.java:186) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.util.LazyValueHolder.get(LazyValueHolder.java:35) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType$EagerlyInitializedLazyValueHolder.<init>(BackedAnnotatedType.java:154) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType$BackedAnnotatedMethods.<init>(BackedAnnotatedType.java:186) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType$BackedAnnotatedMethods.<init>(BackedAnnotatedType.java:186) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType.<init>(BackedAnnotatedType.java:66) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType.of(BackedAnnotatedType.java:47) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.resources.ClassTransformer$TransformClassToBackedAnnotatedType.load(ClassTransformer.java:83) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.resources.ClassTransformer$TransformClassToBackedAnnotatedType.load(ClassTransformer.java:80) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3589) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2374) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2337) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2252) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at com.google.common.cache.LocalCache.get(LocalCache.java:3990) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3994) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4878) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.util.cache.LoadingCacheUtils.getCacheValue(LoadingCacheUtils.java:52) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.util.cache.LoadingCacheUtils.getCastCacheValue(LoadingCacheUtils.java:80) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.resources.ClassTransformer.getBackedAnnotatedType(ClassTransformer.java:175) ~[weld-servlet-2.1.2.Final.jar:2014-01-09 09:23]
... 12 common frames omitted
Caused by: java.lang.ClassNotFoundException: javax.validation.ValidatorFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:366) ~[na:1.7.0_13]
at java.net.URLClassLoader$1.run(URLClassLoader.java:355) ~[na:1.7.0_13]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.7.0_13]
at java.net.URLClassLoader.findClass(URLClassLoader.java:354) ~[na:1.7.0_13]
at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:420) ~[jetty-webapp-9.0.7.v20131107.jar:9.0.7.v20131107]
at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:382) ~[jetty-webapp-9.0.7.v20131107.jar:9.0.7.v20131107]
... 38 common frames omitted
答案 0 :(得分:2)
Caused by: java.lang.ClassNotFoundException: javax.validation.ConstraintViolation
Caused by: java.lang.ClassNotFoundException: javax.validation.MessageInterpolator
Caused by: java.lang.ClassNotFoundException: javax.validation.ValidatorFactory
这些问题是由于运行时类路径中缺少JSR303 Bean Validation API而引起的,而OmniFaces CDI bean期望它存在。这确实是OmniFaces依赖文档中的一个不明确之处。这将被解决。
除了明确地将这些类作为正确的CDI托管bean进行扫描之外,您还可以考虑实际安装JSR303 API,并在必要时安装JSR303实现以及Jetty中的CDI API / impl。 how to install CDI in Tomcat上的答案也适用于您的Jetty案例。