Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cu-dev] JNDI search in ContextServiceDefinitionBean
  • From: Nathan Rauh <nathan.rauh@xxxxxxxxxx>
  • Date: Fri, 25 Mar 2022 21:01:27 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=us.ibm.com; dmarc=pass action=none header.from=us.ibm.com; dkim=pass header.d=us.ibm.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=tSNADGOEOAMrxMNw/KpRf4coEk22OcqZV72PBsWtRUY=; b=YmtWhNIWIvo45SdywU8BXoh/idJRb9SCTuP74mEN2yMGOlVe8yy24v3hAiJstFKeAqcLpwCOZcCFeivg7BzvOrMok+js4/sqhdXCO7RUgPgU9mqDZTvruon1ii4h7as0SupVWnDcKbiglVd+jlpyyjLpnDc2YSGlsh7I+fOLsKXPrIGh6VaTRnYwR9NaLQFIQbPKWPrU2y7D9DpnaGmlFD8+y0B6xGsw07vFhGTK9Ap3CoroPlcrDsMVwUeFCmAkK0V+HWgDW5NQL+umzV4hBO8fCtmCX+zhsHx+1RKQJxrA45T8r4Fkxqwcoiuht+0iu2CgTGy+SH7OeoVsaRtQEA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UOsiT+bc4XqKmb1joPoPIlySAXOU6xA1oxXwBjN5rRvWu/tTdKmT1H54vGOP+6g90I6z5e64mEq4MzEmX7SEs3O4nliEfuTSkci2TVrU/mmZ7zcPQjZwgYjOb/OUtzL3I3X2KbFlDi7MbT009LaoCBSGGT4mDLaKk8ZJKIVdRD/EfucELNsLjQ79WJ53D3LVnajfkNjp/8pkvcad+nLoa8dT4VXZwjhEH5yVzhjpiUxWS5wOhBaO40C4kFeeyQKN6/df8biMh8dmNHNmps+i875LQB68RZODW+bvv7grqz/kQl/pjSczv3OiJ8/efPgbLOF8RUIK3sWPvl0n3mz9mA==
  • Delivered-to: cu-dev@xxxxxxxxxxx
  • List-archive: <https://www.eclipse.org/mailman/private/cu-dev/>
  • List-help: <mailto:cu-dev-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/cu-dev>, <mailto:cu-dev-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/cu-dev>, <mailto:cu-dev-request@eclipse.org?subject=unsubscribe>
  • Thread-index: AQHYQHrDK0WjReFtu0SCe05ztwkyU6zQQjWA
  • Thread-topic: [EXTERNAL] [cu-dev] JNDI search in ContextServiceDefinitionBean

Petr,

 

Thanks for spotting that, it is clearly looking up the wrong JNDI name. My initial reaction was how can that possibly be passing when I run the TCK with Open Liberty?

After investigating, it turns out that it isn’t passing.  Instead, it isn’t running that code at all because it’s unreachable.

 

I recall that when reviewing the new EJB tests earlier this year, I had spotted a couple of occurrences of dead code that the developer had copied over from the servlet tests for use as a starting point/reference for writing some similar EJB tests.  The dead code that I spotted at that time was removed. However, it looks like this is some additional dead code from that point which went unnoticed until now.

 

Just for fun, I added some code to enable it locally and was happy to confirm that Open Liberty does indeed fail when trying to run with that incorrect JNDI name,

javax.naming.NameNotFoundException: java:comp/concurrent/ContextB

 

While we could opt to try to make this into a new working test (which would require more than just correcting the JNDI name because assertions would also need to match the different configuration within the EJB), I don’t see any point in that given that there is already other coverage in both EJBs and servlets.  Let’s just remove it.

 

 

From: cu-dev <cu-dev-bounces@xxxxxxxxxxx> on behalf of Petr Aubrecht <aubrecht@xxxxxxxxxxxx>
Reply-To: cu developer discussions <cu-dev@xxxxxxxxxxx>
Date: Friday, March 25, 2022 at 2:01 PM
To: "cu-dev@xxxxxxxxxxx" <cu-dev@xxxxxxxxxxx>
Subject: [EXTERNAL] [cu-dev] JNDI search in ContextServiceDefinitionBean

 

Hello,

I would like to ask you for help -- ContextServiceDefinitionBean class defines ContextB with this name:

@ContextServiceDefinition(name = "java:module/concurrent/ContextB",...

But it looks up in this way:

InitialContext.doLookup("java:comp/concurrent/ContextB");

Shouldn't the names match? Or is the module/comp mismatch intentional?

 

We tried to fix it (using java:module for both) and this tests works:

https://github.com/aubi/concurrency-api/pull/1/commits/fd0c15a35c29d14683e1d6369f27a6b470cc193f

Thank you

Petr


Back to the top