Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdi-dev] Question about NullPointerException in CDI TCK BeanLookupUtils.java and arquillian test enricher

As for Arquillian, note that there were new modules added that use jakarta.* packages, so you will need to swap to those. The old ones were kept for compatibility.
For instance, the example you used is the CDI enricher, the jakarta variant is here - https://github.com/arquillian/arquillian-core/tree/1.7.0.Alpha10/testenrichers/cdi-jakarta
They all have same GAVs except the new ones end with "-jakarta" suffixes.

> Any ideas why the following NullPointerException might happen and if the CDI TCK 3.0.3 is jakarta EE9 compliant?

Yes, 3.0.3 should be the latest for EE9.
The NPE is likely a misconfiguration in Arq. like I said above, the exception shows that the BeanManager object in null and if you look into AbstractTest in TCKs, that one should be injected by Arq.

Regards
Matej


On Wed, Sep 27, 2023 at 4:15 PM Anil Kedia via cdi-dev <cdi-dev@xxxxxxxxxxx> wrote:

Hi,

I work on the WebLogic server team and currently working on getting the CDI TCK 3.0.3 to work with a Jakarta EE9 compliant release of the WebLogic server. We are using CDI TCK 3.0.3 and seeing below “java.lang.NullPointerException”. The BeanManager is null, I checked everything and don’t see anything obvious.

 

My understanding is that CDI TCK 3.0.3 maps to Jakarta EE9 release. It uses “org.jboss.arquillian: arquillian-parent” version “1.7.0.Alpha10” and some of the classes in this version such as use “javax.*” packages instead of “jakarta.*” (e. g. CDIExtension.java in org.jboss.arquillian.testenricher.cdi.container package). I’m not sure if that will cause any issues or not.

 

Any ideas why the following NullPointerException might happen and if the CDI TCK 3.0.3 is jakarta EE9 compliant?

 

java.lang.NullPointerException

                at org.jboss.cdi.tck.util.BeanLookupUtils.getBeans(BeanLookupUtils.java:88)

                at org.jboss.cdi.tck.util.BeanLookupUtils.getContextualReference(BeanLookupUtils.java:51)

                at org.jboss.cdi.tck.AbstractTest.getContextualReference(AbstractTest.java:152)

                at org.jboss.cdi.tck.interceptors.tests.contract.invocationContext.InvocationContextTest.testGetTimerMethod(InvocationContextTest.java:60)

                at org.jboss.arquillian.testng.Arquillian$3.invoke(Arquillian.java:146)

                at org.jboss.arquillian.container.test.impl.execution.LocalTestExecuter.execute(LocalTestExecuter.java:57)

                at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)

                at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:103)

                at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:90)

                at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:133)

                at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:105)

                at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:62)

 

Thanks

Anil

_______________________________________________
cdi-dev mailing list
cdi-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/cdi-dev

Back to the top