deltaspike-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Kaltepoth <christ...@kaltepoth.de>
Subject Re: Example of DeltaSpike/Hibernate:JPA/Weld in JavaSE?
Date Mon, 09 Mar 2015 07:55:25 GMT
AFAIK both Hibernate and Weld require Jandex in different versions. Make
sure you are using an up to date version of Janex. I had similar problems
in the past and adding a <dependencyManagment> section for Jandex fixed the
problem for me.

Christian

2015-03-08 21:12 GMT+01:00 Deven Phillips <deven.phillips@gmail.com>:

> I keep running into problems trying to get this combination to work. I
> found a few mailing list posts about excluding jandex from the Weld
> dependencies, but I still get errors. The errors seem to indicate that the
> missing jandex library is the problem, but when I do not exclude jandex I
> get different errors. Any help would be greatly appreciated... I'm certain
> it is a classloader problem of some sort, but I cannot seem to track it
> down. I have tried excluding at compile and including at either runtime or
> test stage with no luck.
>
> The example project can be found at:
> https://github.com/InfoSec812/restlet-deltaspike-demo
>
> With jandex excluded:
>
> ERROR ToDoDAO Error getting ToDo list
> javax.enterprise.inject.CreationException
>     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:408)
>     at java.lang.Class.newInstance(Class.java:438)
>     at
> org.jboss.weld.security.NewInstanceAction.run(NewInstanceAction.java:33)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at
> org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:40)
>     at
> org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:50)
>     at
> org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:90)
>     at
>
> org.jboss.weld.injection.ConstructorInjectionPoint.newInstance(ConstructorInjectionPoint.java:127)
>     at
>
> org.jboss.weld.injection.ConstructorInjectionPoint.invokeAroundConstructCallbacks(ConstructorInjectionPoint.java:92)
>     at
>
> org.jboss.weld.injection.ConstructorInjectionPoint.newInstance(ConstructorInjectionPoint.java:78)
>     at
>
> org.jboss.weld.injection.producer.AbstractInstantiator.newInstance(AbstractInstantiator.java:28)
>     at
>
> org.jboss.weld.injection.producer.BasicInjectionTarget.produce(BasicInjectionTarget.java:116)
>     at
>
> org.jboss.weld.injection.producer.BeanInjectionTarget.produce(BeanInjectionTarget.java:175)
>     at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:158)
>     at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:96)
>     at
>
> org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:744)
>     at
>
> org.jboss.weld.injection.producer.AbstractMemberProducer.getReceiver(AbstractMemberProducer.java:128)
>     at
>
> org.jboss.weld.injection.producer.AbstractMemberProducer.produce(AbstractMemberProducer.java:148)
>     at
>
> org.jboss.weld.bean.AbstractProducerBean.create(AbstractProducerBean.java:183)
>     at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:96)
>     at
>
> org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:98)
>     at
>
> org.jboss.weld.bean.proxy.CachedBeanInstance.getInstance(CachedBeanInstance.java:66)
>     at
>
> org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:99)
>     at
>
> org.jboss.weld.proxies.EntityManager$1823090656$Proxy$_$$_WeldClientProxy.find(Unknown
> Source)
>     at com.zanclus.test.data.ToDoDAO.deleteToDo(ToDoDAO.java:71)
>     at
> com.zanclus.test.data.ToDoDAO$Proxy$_$$_WeldClientProxy.deleteToDo(Unknown
> Source)
>     at
> com.zanclus.test.data.ToDoDAOTest.testDeleteToDo(ToDoDAOTest.java:92)
>     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:483)
>     at
>
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
>     at
>
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
>     at
>
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
>     at
>
> org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner$ContainerAwareMethodInvoker.invokeMethod(CdiTestRunner.java:340)
>     at
>
> org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner$ContainerAwareMethodInvoker.evaluate(CdiTestRunner.java:312)
>     at
>
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
>     at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
>     at
>
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
>     at
>
> org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner.runChild(CdiTestRunner.java:174)
>     at
>
> org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner.runChild(CdiTestRunner.java:75)
>     at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
>     at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
>     at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
>     at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
>     at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
>     at
>
> org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner$BeforeClassStatement.evaluate(CdiTestRunner.java:366)
>     at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
>     at
>
> org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner.run(CdiTestRunner.java:141)
>     at org.junit.runners.Suite.runChild(Suite.java:128)
>     at org.junit.runners.Suite.runChild(Suite.java:27)
>     at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
>     at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
>     at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
>     at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
>     at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
>     at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
>     at
>
> org.apache.deltaspike.testcontrol.api.junit.CdiTestSuiteRunner.run(CdiTestSuiteRunner.java:114)
>     at
>
> org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
>     at
>
> org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
>     at
>
> org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
>     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:483)
>     at
>
> org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
>     at
>
> org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
>     at
>
> org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
>     at
>
> org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107)
>     at
> org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68)
> Caused by: java.lang.NoClassDefFoundError: org/jboss/jandex/IndexView
>     at
>
> org.hibernate.jpa.boot.spi.Bootstrap.getEntityManagerFactoryBuilder(Bootstrap.java:51)
>     at
>
> org.hibernate.jpa.HibernatePersistenceProvider.getEntityManagerFactoryBuilderOrNull(HibernatePersistenceProvider.java:129)
>     at
>
> org.hibernate.ejb.HibernatePersistence.getEntityManagerFactoryBuilderOrNull(HibernatePersistence.java:93)
>     at
>
> org.hibernate.jpa.HibernatePersistenceProvider.getEntityManagerFactoryBuilderOrNull(HibernatePersistenceProvider.java:86)
>     at
>
> org.hibernate.ejb.HibernatePersistence.getEntityManagerFactoryBuilderOrNull(HibernatePersistence.java:101)
>     at
>
> org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:67)
>     at
>
> org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:54)
>     at
>
> javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:63)
>     at
>
> javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:47)
>     at com.zanclus.test.Producer.<init>(Producer.java:22)
>     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:408)
>     at
>
> org.jboss.weld.injection.ConstructorInjectionPoint.newInstance(ConstructorInjectionPoint.java:119)
>     ... 62 more
> Caused by: java.lang.ClassNotFoundException: org.jboss.jandex.IndexView
>     at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
>     at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
>     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
>     ... 77 more
>
>
> With jandex included:
>
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.142 sec
> <<< FAILURE!
>
> Results :
>
> Tests in error:
>   com.zanclus.test.CdiSuiteLevelTest:
> org.jboss.jandex.ClassInfo.hasNoArgsConstructor()Z
>



-- 
Christian Kaltepoth
Blog: http://blog.kaltepoth.de/
Twitter: http://twitter.com/chkal
GitHub: https://github.com/chkal

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message