Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demo jpa-cdi-testing does not work on java 14 #43

Open
Bukama opened this issue Mar 21, 2020 · 2 comments
Open

Demo jpa-cdi-testing does not work on java 14 #43

Bukama opened this issue Mar 21, 2020 · 2 comments

Comments

@Bukama
Copy link

Bukama commented Mar 21, 2020

As I'm trying to setup our projects to make JPA tests possible without using Arquillian (which is a pain due long deployment times on WAS 9) I found @gunnarmorling demo jpa-cdi-testing project which seems to do exactly this.

So I just cloned it, importet it into IntelliJ and executed the tests. But both fail with this error message:

2020-03-21 20:34:50 INFO  Version:148 - WELD-000900: 3.0.5 (Final)

org.jboss.weld.exceptions.WeldException: WELD-001524: Unable to load proxy class for bean Built-in Bean [javax.transaction.UserTransaction] with qualifiers [@Default] with class interface javax.transaction.UserTransaction using classloader jdk.internal.loader.ClassLoaders$AppClassLoader@2626b418

	at org.jboss.weld.bean.proxy.ProxyFactory.getProxyClass(ProxyFactory.java:370)
	at org.jboss.weld.bean.proxy.ProxyFactory.run(ProxyFactory.java:324)
	at org.jboss.weld.bean.proxy.ProxyFactory.create(ProxyFactory.java:316)
	at org.jboss.weld.bean.builtin.ee.AbstractEEBean.<init>(AbstractEEBean.java:36)
	at org.jboss.weld.module.jta.UserTransactionBean.<init>(UserTransactionBean.java:52)
	at org.jboss.weld.module.jta.WeldTransactionsModule.preBeanRegistration(WeldTransactionsModule.java:46)
	at org.jboss.weld.module.WeldModules.preBeanRegistration(WeldModules.java:158)
	at org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:224)
	at org.jboss.weld.bootstrap.WeldStartup.deployBeans(WeldStartup.java:432)
	at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:86)
	at org.jboss.weld.environment.se.Weld.initialize(Weld.java:800)
	at org.jboss.weld.junit.AbstractWeldInitiator.initWeldContainer(AbstractWeldInitiator.java:495)
	at org.jboss.weld.junit4.WeldInitiator.access$300(WeldInitiator.java:90)
	at org.jboss.weld.junit4.WeldInitiator$1.evaluate(WeldInitiator.java:226)
	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	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.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230)
	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58)
Caused by: java.lang.Error: java.lang.NoSuchFieldException: override
	at org.jboss.classfilewriter.ClassFile$1.run(ClassFile.java:394)
	at org.jboss.classfilewriter.ClassFile$1.run(ClassFile.java:385)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:551)
	at org.jboss.classfilewriter.ClassFile.<clinit>(ClassFile.java:385)
	at org.jboss.weld.bean.proxy.ProxyFactory.newClassFile(ProxyFactory.java:476)
	at org.jboss.weld.bean.proxy.ProxyFactory.createProxyClass(ProxyFactory.java:436)
	at org.jboss.weld.bean.proxy.ProxyFactory.getProxyClass(ProxyFactory.java:362)
	... 28 more
Caused by: java.lang.NoSuchFieldException: override
	at java.base/java.lang.Class.getDeclaredField(Class.java:2417)
	at org.jboss.classfilewriter.ClassFile$1.run(ClassFile.java:392)
	... 34 more


Process finished with exit code -1

Would really see this demo working again so I can try to adopt things of it for our scenario.

@gunnarmorling
Copy link
Member

That's a compatibility issue with Java versions, see jbossas/jboss-classfilewriter#18. This was implemented based on JDK 8 back then, dependencies would need updating for newer JDKs. Perhaps you could send a PR for doing so?

@Bukama
Copy link
Author

Bukama commented Mar 22, 2020

Ah thanks! After switching to JDK 8 the demo project works fine.
Will have a look if I can manage to update the dependencies. Could take some time as I'm still struggeling (understanding) with all this WELD stuff. But I'll keep in mind!

@Bukama Bukama changed the title Demo jpa-cdi-testing does not work Demo jpa-cdi-testing does not work on java 14 Mar 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants