Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 328174

Summary: Provide ability to turn off tomcat naming (jndi) support
Product: [RT] Gemini.Web Reporter: Dmitry Sklyut <dmitry>
Component: unknownAssignee: Violeta Georgieva <milesg78>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: alex.blewitt, glyn.normington, milesg78
Version: unspecified   
Target Milestone: 2.1.0.M01   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 332042    
Bug Blocks: 361144, 361173    
Attachments:
Description Flags
Patch proposal
none
Patch proposal glyn.normington: review+

Description Dmitry Sklyut CLA 2010-10-19 15:33:26 EDT
Build Identifier: 

Tomcat insists on registering a System level properties for Context.INITIAL_CONTEXT_FACTORY and Context.URL_PKG_PREFIXES.  This interferes with gemini naming.  Gemini Naming can't find the class specified by Context.INITIAL_CONTEXT_FACTORY (mainly because catalina bundle does not export it) and fails to create any InitialContext.

Looking for a way to set "useNaming" flag to "false" in org.eclipse.gemini.web.tomcat.internal.Tomcat.  Maybe with a system property?  -DuseNaming=false?

Reproducible: Always
Comment 1 Dmitry Sklyut CLA 2010-10-19 15:33:48 EDT
Discussion from Virgo mailing list: http://dev.eclipse.org/mhonarc/lists/virgo-dev/msg00293.html
Comment 2 Glyn Normington CLA 2010-10-20 03:48:27 EDT
Flagging as an enhancement, especially as this will involve an externals change.
Comment 3 Violeta Georgieva CLA 2011-05-18 09:13:08 EDT
With migration to Tomcat 7 now we can introduce such switch. See TODO comment in
org.eclipse.gemini.web.tomcat.internal.OsgiAwareEmbeddedTomcat.init() method.
Comment 4 Violeta Georgieva CLA 2011-07-19 09:52:19 EDT
Created attachment 199902 [details]
Patch proposal

Could you please review the patch and comment.

Thanks
Violeta
Comment 5 Violeta Georgieva CLA 2011-10-17 10:34:46 EDT
Created attachment 205335 [details]
Patch proposal

Change the meaning of the property from 

useTomcatNaming - true/false

to

useNaming - tomcat/osgi/disabled

"tomcat" is by default if the property is not set
Comment 6 Glyn Normington CLA 2011-10-17 10:36:44 EDT
Comment on attachment 205335 [details]
Patch proposal

Looks good to me.
Comment 7 Violeta Georgieva CLA 2011-10-17 14:17:27 EDT
Change is tested, committed and pushed.
Commit Id: 64696debc57e333d5adb55ae5f3ff56fc931c17f
Documentation will be covered in Bug 361173
Comment 8 Alex Blewitt CLA 2011-10-18 05:55:07 EDT
Given that both the Jetty and Tomcat distributions can be used, why not move towards OSGi as the standard property for both of those and change in a future release, instead of having tomcat as the default?
Comment 9 Glyn Normington CLA 2011-10-18 06:08:04 EDT
(In reply to comment #8)
> Given that both the Jetty and Tomcat distributions can be used, why not move
> towards OSGi as the standard property for both of those and change in a future
> release, instead of having tomcat as the default?

I'm not sure I understand.

Gemini Web is currently tied to Tomcat. Virgo Jetty Server uses Jetty as an alternative RFC 66 (OSGi Web Applications) container to Gemini Web which is used by Virgo Tomcat Server. So there is no obvious need for Gemini Web to support Jetty.