Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdi-dev] [External] : Re: Question about NullPointerException in CDI TCK BeanLookupUtils.java and arquillian test enricher
  • From: Anil Kedia <anil.kedia@xxxxxxxxxx>
  • Date: Mon, 2 Oct 2023 14:04:57 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=kd4UrbDoJzimTT73RMLz7bEpOhQzHEVy2qfwmJwvIBA=; b=kP2UCDcZaFlTnigIuLDlLXuVhsuwNTOEUEDYOd909tlt6nVGG2/65IlRWlHPkb/Lzw1rkTPfDRAR1Ww/eBoZdPVG/AYtVJPWUeZxdGhOFxJ+HJD0jrhAv3uBFQ0qLRe6/JPLCGQ+4RqFabKjXec1h7+nWTwF2mRkUXGWXCwRh0+OaSsP+QKkp+OriTJEhXTHIgT1uA26n1ARTBRJCQ7Az1LxXDCUvTJDKLbmmrXKMmIO4u/AgDXliZAq7QHiROCxegJ57Y4A29UHEvTFp6W/63W1TLKrT2ffDBTkbE413u30HwUopUXJjhdNhLTwjfpaQB7sUhHlKl85MCGSwkApUw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CDpi3L2mZQevXbZcnq7l9jL50Q46t5vgVO2ANPcjLXihyf5TZjxXX4hXWPvtuoRuP5fVGaFsfRlYm5kGECuHzntTU2FvHzhFS9YbPFMrivC2rOfzLx+lO7DGBzu0iGsBcZkgfIghD5ZsOh636GblYMgvcKcV1gh7z/CaTGxET8M/QQJxMQGG1kPMD3yK9Kxqrsp35tgjoSNR+QmskSo04TA+iNCljhDHC9RGccQARWpdT/Pq4GtwJ93cwoFFnKJWzO/Vxm7Adb3b9UuqNm39/2/U3A6+L2ti0T99TZc8+0KwGlwsBvYJzZyx9LVSKZtnc2ozjgp6y1UdSazfU4pKxw==
  • Delivered-to: cdi-dev@xxxxxxxxxxx
  • List-archive: <https://www.eclipse.org/mailman/private/cdi-dev/>
  • List-help: <mailto:cdi-dev-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/cdi-dev>, <mailto:cdi-dev-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/cdi-dev>, <mailto:cdi-dev-request@eclipse.org?subject=unsubscribe>
  • Thread-index: AQHZ8UtNUab+PNcA3kKRphOaruFaIrAutwxTgAADTYCAAAXJBYAHbG8AgABjTe4=
  • Thread-topic: [External] : Re: [cdi-dev] Question about NullPointerException in CDI TCK BeanLookupUtils.java and arquillian test enricher

Thanks, Matej. The issue is resolved, and we’re all set for now. I’ll go through the links that you have provided to improve my understanding for the future.

 

Regards

Anil

From: Matej Novotny <manovotn@xxxxxxxxxx>
Date: Monday, October 2, 2023 at 4:09 AM
To: Anil Kedia <anil.kedia@xxxxxxxxxx>
Cc: cdi developer discussions <cdi-dev@xxxxxxxxxxx>, Stephen Felts <stephen.felts@xxxxxxxxxx>, Gurunandan Rao <gurunandan.rao@xxxxxxxxxx>
Subject: Re: [External] : Re: [cdi-dev] Question about NullPointerException in CDI TCK BeanLookupUtils.java and arquillian test enricher

I don't think the TCK documentation covers these details because every impl might use a different approach - after all, you need some Arq. container to run inside and that's what holds the Arq. dep setup.

As for deps that TCK brings in, I think it only covers the BOM of Arquillian, which sets the overarching version, and then some descriptors and SPIs that are being used.

Which actual parts of Arq. your container needs is for you to set up.

If that's any help, you could dive into what Weld used with its embedded container; here are some links:

 

Regards

Matej

 

 

On Wed, Sep 27, 2023 at 4:53 PM Anil Kedia <anil.kedia@xxxxxxxxxx> wrote:

Thanks Matej for the quick response.

 

Is there documentation for the Arquillian configuration and using the jakarta variant modules in CDI TCK 3.0.3 that I can refer to? I changed the default servlet protocol to be 5.0 in “arquillian.xml”.

 

<defaultProtocol type="Servlet 5.0"/>

 

In our pom.xml, we define a “xml” type dependency for “cdi-tck-impl” with version 3.0.3. This automatically pulls other dependencies for arquillian. Does this need to be changed to use  “jakarta-“ suffix. Any other changes needed in arquillian.xml?

 

        <dependency>

            <groupId>jakarta.enterprise</groupId>

            <artifactId>cdi-tck-impl</artifactId>

            <version>${cdi.tck.version}</version>

            <type>xml</type>

            <classifier>suite</classifier>

            <scope>test</scope>

            <exclusions>

                <exclusion>

                    <artifactId>el-api</artifactId>

                    <groupId>javax.el</groupId>

                </exclusion>

            </exclusions>

        </dependency>

 

Regards

Anil

 

From: Matej Novotny <manovotn@xxxxxxxxxx>
Date: Wednesday, September 27, 2023 at 10:25 AM
To: cdi developer discussions <cdi-dev@xxxxxxxxxxx>
Cc: Anil Kedia <anil.kedia@xxxxxxxxxx>, Stephen Felts <stephen.felts@xxxxxxxxxx>
Subject: [External] : 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