Issue Details (XML | Word | Printable)

Key: JERSEY-601
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Pavel Bucek
Reporter: okrische
Votes: 2
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
jersey

CDIExtension: NPE not yet resolved, since lookup fails in JNDI with some container

Created: 09/Nov/10 05:38 AM   Updated: 08/Feb/12 03:14 PM   Resolved: 08/Feb/12 03:14 PM
Component/s: None
Affects Version/s: 1.5
Fix Version/s: 1.12

Time Tracking:
Not Specified

Tags:
Participants: okrische, Pavel Bucek and sandoz


 Description  « Hide

The workaround by using JNDI to initialize CDIExcension does not work for my servlet container (resin)
Instead I receive a "NameNotFoundException" from my ServletContainer.

The problem is the used name in CDIExtension:

String JNDI_CDIEXTENSION_NAME = "/com.sun.jersey.config/CDIExtension";

I have changed the name to a string without the special chararacter "/", and then it worked:

String JNDI_CDIEXTENSION_NAME = "com.sun.jersey.config.CDIExtension";

I tried it with:

  • jersey 1.5-ea03 (with the JNDI workaround)
  • Resin 4.0.10 as servlet container

A sample war archive i have uploaded here:

My former bug at resin is:

The bug is a blocker, since i can not use Jersey at all.



sandoz added a comment - 10/Nov/10 02:15 AM

As a temporary work around until a weld/GlassFish proxying bug is fixed, which is why JNDI is being used, can you set the following system property to a value of "true":

com.sun.jersey.server.impl.cdi.lookupExtensionInBeanManager

This will disable the JNDI workaround, so that Jersey's CDIExtension is looked up using the CDI BeanManager.


okrische added a comment - 10/Nov/10 03:33 AM

If i will disable the JNDI workaround, then i get a NullPointerException with Resin 4.0.10 as well.

(thats why i changed from 1.4 to 1.5-ea03, hoping, the JNDI workaround will fix it)

The "weld/glassfish proxying bug" therefore applies to other servlet containers as well?


okrische added a comment - 13/Nov/10 08:50 AM - edited

Hello,

the priority can be lowered down from blocker.

Using a new resin version (4.0.13 instead of 4.0.10) the lookup in the BeanManager seems to work again, so i can use the suggested workaround by setting the system-property "com.sun.jersey.server.impl.cdi.lookupExtensionInBeanManager=true"

Still doesnt change the fact, that you use JNDIs "rebind" without ever having created the context. Which will still raise the "NameNotFoundException" in my servlet container.

http://bugs.caucho.com/view.php?id=4215

Cheers.


sandoz added a comment - 22/Nov/10 02:11 AM

The JNDI work around will be removed once GlassFish/Weld integration issues are fixed.


Pavel Bucek added a comment - 08/Feb/12 03:14 PM

I believe this is already fixed (it was causing some issues on other container too (WLS)), see patch for revision 4970.

Feel free to reopen if I'm wrong.