tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Date Fri, 02 Feb 2007 09:44:40 GMT
Fran Varin wrote:
> Well, let me see if I can paint an accurate picture...The application as it
> is currently running in WAS uses a properties file to externalize everything
> we need to connect to a datasource. The code itself will add the initial
> context class name to the properties file that is handed to
> javax.naming.initialcontext at the time the context object is constructed.
> We use WAS' admin console to define the datasources and it really is that
> simple. 

I don't think you need to manually specify the initial context factory, 
Tomcat prepares the environment for you:

  java.naming.factory.url.pkgs = org.apache.naming
  java.naming.factory.initial =

If you configure a global resource, you'll need to put a ResourceLink in 
the context to make it accessible.  There are some things to look out 
for when specifying contexts*.

Setup a GlobalNamingResources/Resource, with your driver & db details 
(e.g. with MySQL, using DBCP):

       validationQuery="select count(*) from a_table"


Place the ResourceLink in the context, and put the context config in 
it's own file.

<Context ... >

  conf/Catalina/testhostname/ROOT.xml  (ROOT context)

If/when this doesn't work, we'll know your config and will be able to 
debug the remaining problems.


*The default/root context must be called ROOT.xml

> I've looked at so many resources from the apache Tomcat site (as well as
> googled a bunch) and everything seems to dance around the specific steps
> necessary for accomplishing this. I have to be missing something...this
> can't be this hard. As I mentioned in a previous response...frustration with
> Tomcat is at an all time high here as everything we do, no matter how simple
> it seems, turns into an adventure. We are basically new users of Tomcat and
> like the idea of using it for testing purposes and possibly for some smaller
> apps in production. But, at this point we cannot begin to support it mostly
> because of the lack of accessible, thorough documentation that does not
> assume you understand the internal structure. 
> Sorry for the rant! :(
> Fran
> Nelson, Tracy M. wrote:
>> | From: Fran Varin []
>> | Sent: Thursday, 01 February, 2007 08:05
>> | 
>> | It boils down to my attempt at using
>> | "". However, when I do I
>> | receive "javax.naming.NameNotFoundException: Name jdbc is not bound 
>> | in this Context:".
>> Are you using the initial context returned from getInitialContext()
>> directly, or are you obtaining a root context from the initial context?
>> Have you tried both methods of associating the "java" URL prefix with this
>> factory? (Both adding a property to your file, and
>> defining
>> an environment variable.)
>> If the IBM factory returns a root context, you will probably want to write
>> a
>> simple wrapper that gets an initial context from javaURLContextFactory,
>> then
>> looks up a root context and returns that.
>> -----------------------------------------
>> ------------------------------------------------------------
>> The information contained in this message is confidential
>> proprietary property of Nelnet, Inc. and its affiliated 
>> companies (Nelnet) and is intended for the recipient only.
>> Any reproduction, forwarding, or copying without the express
>> permission of Nelnet is strictly prohibited. If you have
>> received this communication in error, please notify us
>> immediately by replying to this e-mail.
>> ------------------------------------------------------------
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail:
>> To unsubscribe, e-mail:
>> For additional commands, e-mail:

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message