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: Wed, 27 Sep 2023 14:53:26 +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=ABS3C4CyqdV36gZBnqOdiKLwOZxuFB9J3aiZ1I7hWOE=; b=nLS6qxhbarQYWb+HNMG9S730nGHXSLbPhNLtS7UsM3hK0mArsgF1ZbLP7snhPTXSf34pYCyFFpr6GhC0WCgH15gTFQ3DvlF0UC53Lvn0Mf+v5U/iEoqgGK7sGEqZkzIwLxxHj+eEP5xJH9b0nucfzhG8rDw3hiY8ZYnbdrO2+kEF3xmFV6Mab0V5gQRrtj9SIkycGgUFtyFs82N6sv2wI4vaGIFAcE+xhJ26MOf+bQZQwc8/zLwAuGC+pNOfhRv1c5JRlZZT17ZsYvt+q8BTnCuNeg3F7RFttbFscO72Ytb+ZnsRjWPRsLQ1FpSUXdzTxGHQWiqmm03HgWjaWwLGqg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vq9BueCTi5G7+UQWoxGPMmhD4zqPdkTaJyqTsdZy68HiqHPQkvnkTn7pNH4CJE5DvTYpTtk1Td5cqt+XV5uCp52kVLGDW/uaEh+/KbmJrrdlQdO5/CBAh2wTV2o/Gnmn0jl9LrOL1WzzexsC9eiVWDBHFl4by6xzWoFMcya30GZE83doEyHVBREJuQq4I8WnFtffMwPFOwXv1OsYuwD5DW+S/lZjI8KEA5lSN4rSlidEONv0yjQ9kIWlmu7KatFf2jR5alyiJ4vhtAdEf8i/7r842Qbo9tA4x88sKHJTf+JwOat8AR8hvFsXYYmcj1brOwNZ5vNdPaaDBt1cTgN/4Q==
  • 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+PNcA3kKRphOaruFaIrAutwxTgAADTYCAAAXJBQ==
  • Thread-topic: [External] : Re: [cdi-dev] Question about NullPointerException in CDI TCK BeanLookupUtils.java and arquillian test enricher

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