Added following dependencies to the pom file (not sure if it's the right way to
go though):
<dependency>
<groupId>javax.faces</groupId>
<artifactId>javax.faces-api</artifactId>
<version>2.2</version>
<scope>test</scope>
</dependency>
And it fixed the original exception, but now I'm getting this:
java.lang.RuntimeException: Error instantiating class
org.apache.bval.cdi.BValExtension
at
org.jboss.weld.util.ServiceLoader.prepareInstance(ServiceLoader.java:245)
at org.jboss.weld.util.ServiceLoader.loadService(ServiceLoader.java:214)
at
org.jboss.weld.util.ServiceLoader.loadServiceFile(ServiceLoader.java:182)
at org.jboss.weld.util.ServiceLoader.reload(ServiceLoader.java:162)
at org.jboss.weld.util.ServiceLoader.iterator(ServiceLoader.java:297)
at com.google.common.collect.Iterables.addAll(Iterables.java:352)
at org.jboss.weld.environment.se.Weld.getExtensions(Weld.java:718)
at org.jboss.weld.environment.se.Weld.createDeployment(Weld.java:632)
at org.jboss.weld.environment.se.Weld.initialize(Weld.java:543)
at
org.apache.camel.test.cdi.CamelCdiDeployment$1.evaluate(CamelCdiDeployment.java:68)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:119)
at
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42)
at
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234)
at
com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: java.lang.NoSuchMethodError:
javax.validation.Configuration.getBootstrapConfiguration()Ljavax/validation/BootstrapConfiguration;
at org.apache.bval.cdi.BValExtension.<init>(BValExtension.java:94)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at
org.jboss.weld.util.ServiceLoader.prepareInstance(ServiceLoader.java:240)
... 21 more
Any idea how to resolve this one? Am I doing something totally wrong here?
Dmitry
-----Original Message-----
From: dimas [mailto:[email protected]]
Sent: June-01-16 12:27 PM
To: [email protected]
Subject: camel-test-cdi + OpenEJB fails on weld dependency?
Hi All,
Here is my app environment: Camel-CDI 2.17.1, TomEE/openejb-core 7.0.0.
I'm trying to test the app using camel-test-cdi and getting this exception:
java.lang.RuntimeException: Error instantiating class
org.apache.deltaspike.jsf.impl.scope.mapped.MappedJsf2ScopeExtension
at
org.jboss.weld.util.ServiceLoader.prepareInstance(ServiceLoader.java:245)
at org.jboss.weld.util.ServiceLoader.loadService(ServiceLoader.java:214)
at
org.jboss.weld.util.ServiceLoader.loadServiceFile(ServiceLoader.java:182)
at org.jboss.weld.util.ServiceLoader.reload(ServiceLoader.java:162)
at org.jboss.weld.util.ServiceLoader.iterator(ServiceLoader.java:297)
at com.google.common.collect.Iterables.addAll(Iterables.java:352)
at org.jboss.weld.environment.se.Weld.getExtensions(Weld.java:718)
at org.jboss.weld.environment.se.Weld.createDeployment(Weld.java:632)
at org.jboss.weld.environment.se.Weld.initialize(Weld.java:543)
at
org.apache.camel.test.cdi.CamelCdiDeployment$1.evaluate(CamelCdiDeployment.java:68)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:119)
at
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42)
at
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234)
at
com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: java.lang.NoClassDefFoundError:
javax/faces/bean/ApplicationScoped
at
org.apache.deltaspike.jsf.impl.scope.mapped.MappedJsf2ScopeExtension.<init>(MappedJsf2ScopeExtension.java:56)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at
org.jboss.weld.util.ServiceLoader.prepareInstance(ServiceLoader.java:240)
... 21 more
Caused by: java.lang.ClassNotFoundException:
javax.faces.bean.ApplicationScoped
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 27 more
I'm not sure why weld classes are loaded, why my test depends from
javax.faces.bean.ApplicationScoped (so far there is no UI of any kind) and what
to do in order to resolve the error.
Cheers,
Dmitry
--
View this message in context:
http://camel.465427.n5.nabble.com/camel-test-cdi-OpenEJB-fails-on-weld-dependency-tp5783365.html
Sent from the Camel - Users mailing list archive at Nabble.com.