Re: PropertyResourceBundle problems

2002-08-28 Thread Randy Secrist

I was finally able to figure this out.  I wasn't aware that a properties
file needed to have a .properties extension for a PropertiesResourceBundle
to pick it up.  Other than this - the config was fine.  I still haven't seen
any documentation on that extension requirement, as it isn't mentioned
specifically in Sun's docs.  I will now hang my head in shame.  This is
something I had forgotten...

Thanks for your help.

Randy

- Original Message -
From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Tuesday, August 27, 2002 10:37 PM
Subject: Re: PropertyResourceBundle problems


>
>
> On Tue, 27 Aug 2002, Randy Secrist wrote:
>
> > Date: Tue, 27 Aug 2002 21:58:00 -0600
> > From: Randy Secrist <[EMAIL PROTECTED]>
> > Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> > To: Tomcat Users List <[EMAIL PROTECTED]>
> > Subject: Re: PropertyResourceBundle problems
> >
> > Lets try this route then:
> >
> > Is there ANY way to get the actual class path the TC class loader uses
to
> > load classes at runtime from within a servlet out of ANY context?
> >
>
> No.  The problem is that there *is* no such thing as a "class path for the
> TC class class loader used to load classes at runtime from within a
> servlet".  The classpath system property is global to the entire JVM that
> is running Tomcat, so it is (obviously) not capable of representing the
> set of classes available to each individual webapp.
>
> Class loaders only know what repositories they are loading classes (and
> static resources) from -- in the particular case of Tomcat, they are all
> subclasses of java.net.URLClassLoader so you can call getRepositories() --
> but it won't help you much.  See the following docs for more details:
>
>   http://jakarta.apache.org/tomcat/tomcat-4.0-doc/class-loader-howto.html
>   http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html
>
> The real issue is that there's something you are doing wrong that nobody
> has been able to figure out yet.  Thousands of apps all over the world
> (including every app running Struts) is able to load resources from
> /WEB-INF/classes or /WEB-INF/lib if they use the correct invocation.
>
> Note that if you really did copy your properties file to
> "/web-inf/classes" instead of "/WEB-INF/classes", give up and start over
> -- pretty much everything about servlets and JSP pages is case sensitive.
>
> Craig
>
>
> > This is obviously not stored in the System.properties - is it kept
> > internally anywhere?
> >
> > Randy
> > - Original Message -
> > From: "Randy Secrist" <[EMAIL PROTECTED]>
> > To: "Tomcat Users List" <[EMAIL PROTECTED]>
> > Sent: Tuesday, August 27, 2002 9:21 PM
> > Subject: Re: PropertyResourceBundle problems
> >
> >
> > > I did copy the props file to the web-inf/classes - however TC still
> > doesn't
> > > know what to do with it...
> > >
> > >
> > > - Original Message -
> > > From: "randie ursal" <[EMAIL PROTECTED]>
> > > To: "Tomcat Users List" <[EMAIL PROTECTED]>
> > > Sent: Tuesday, August 27, 2002 9:05 PM
> > > Subject: Re: PropertyResourceBundle problems
> > >
> > >
> > > > i have that same problem, and i solve it through the efforts of some
> > > > people on this
> > > > list.
> > > >
> > > > i just place my property file on WEB-INF/classes of my web
> > > > application...that's it
> > > > everything works fine now. =)...no need to place it on other
> > repositories.
> > > >
> > > > this is my code in reading the property file:
> > > >ResourceBundle oRes =
PropertyResourceBundle.getBundle("MyProperty");
> > > >
> > > > Randy Secrist wrote:
> > > >
> > > > >Hello,
> > > > >
> > > > >This is probably a very simple question - but I want to have a
servlet
> > > load
> > > > >a PropertyResourceBundle and am having problems getting TC to find
the
> > > > >resource...
> > > > >
> > > > >I want to do this:
> > > > >props = (PropertyResourceBundle)
> > > > >PropertyResourceBundle.getBundle("SystemConfig");
> > > > >
> > > > >I have tried moving the properties file into the WEB-INF/classes,
> > > > >COMMON/classes, pack

Re: PropertyResourceBundle problems

2002-08-28 Thread Jakarta Tomcat Newsgroup (@Basebeans.com)

Subject: Re: PropertyResourceBundle problems
From: [EMAIL PROTECTED] (Jakarta Tomcat Newsgroup (@Basebeans.com))
 ===
Subject: Re: PropertyResourceBundle problems
From: [EMAIL PROTECTED] (Jakarta Tomcat Newsgroup (@Basebeans.com))
 ===
Subject: Re: PropertyResourceBundle problems
From: "Randy Secrist" <[EMAIL PROTECTED]>
 ===
Still at it.  getRepositories() won't help a bit since (like you said) that
class loader doesn't keep track of the class path over the scope it presides
over...

My key question
May I assume that if I can load a class from this JAR, and the
ResourceBundle is in the same JAR - shouldn't I be able to get to it as
well?
If not - why would that be the case?  Nonetheless - I've pulled it out of
the JAR and into a */classes dir with no difference...

I've read the docs, fought the fight - I'm going to bed.  I'll try to
provide a little more information below on every element pertaining to the
web app - and maybe I'll get lucky tomorrow.  :)  I just can't think of what
it was I may have done different than those millions of people out there.
These are the worst because you know it is something SO small.  That is why
I wish I could verify this somehow.

Here is what I have.
JAR LOCATION:

I have a .jar file with this structure:

META-INF (dir)
com (dir - all my classes / servlets)
SystemConfig (my properties file)
someClass.class
someClass.java

Thats it for the .jar.  It has resided all over my catalina.home directory -
any any WEB-INF/lib or WEB-INF/classes I can find.
(WEB-INF) should be upper case correct?  I have it as upper case at the
moment.

CONTEXT CONFIG:

Tomcat version 4.0.4.
Running out of the ROOT context within a multiple host / context
environment - using a JNDIRealm.
reloadable is set to false - however I restart the server after each new
attempt.  (old habits die hard)

SERVLET CODE:

My Servlet:
makes this call in it's init method: (as a singleton)
webProps = WebProperties.getInstance();

which in WebProperties singleton constructor calls:
  try {
   props = (PropertyResourceBundle)
PropertyResourceBundle.getBundle("SystemConfig");
   System.out.println("WebProperties - Load Success!");
   this.init();
  }
  catch (java.lang.Throwable e) {
   System.err.println("WebProperties - Load Failure!");
   throw new ResourceFailure(e);
  }

The exception is ALWAYS thrown on the getBundle call.
resulting in java.util.MissingResourceException: Can't find bundle for base
name SystemConfig, locale en_US

Anywho - thanks for your patience.

Randy



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Re: PropertyResourceBundle problems

2002-08-28 Thread Jakarta Tomcat Newsgroup (@Basebeans.com)

Subject: Re: PropertyResourceBundle problems
From: [EMAIL PROTECTED] (Jakarta Tomcat Newsgroup (@Basebeans.com))
 ===
Subject: Re: PropertyResourceBundle problems
From: [EMAIL PROTECTED] (Jakarta Tomcat Newsgroup (@Basebeans.com))
 ===
Subject: Re: PropertyResourceBundle problems
From: [EMAIL PROTECTED] (Jakarta Tomcat Newsgroup (@Basebeans.com))
 ===
Subject: Re: PropertyResourceBundle problems
From: [EMAIL PROTECTED] (Jakarta Tomcat Newsgroup (@Basebeans.com))
 ===
Subject: Re: PropertyResourceBundle problems
From: [EMAIL PROTECTED] (Jakarta Tomcat Newsgroup (@Basebeans.com))
 ===
Subject: Re: PropertyResourceBundle problems
From: [EMAIL PROTECTED] (Jakarta Tomcat Newsgroup (@Basebeans.com))
 ===
Subject: Re: PropertyResourceBundle problems
From: [EMAIL PROTECTED] (Jakarta Tomcat Newsgroup (@Basebeans.com))
 ===
Subject: Re: PropertyResourceBundle problems
From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
 ===


On Tue, 27 Aug 2002, Randy Secrist wrote:

> Date: Tue, 27 Aug 2002 21:58:00 -0600
> From: Randy Secrist <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: Tomcat Users List <[EMAIL PROTECTED]>
> Subject: Re: PropertyResourceBundle problems
>
> Lets try this route then:
>
> Is there ANY way to get the actual class path the TC class loader uses to
> load classes at runtime from within a servlet out of ANY context?
>

No.  The problem is that there *is* no such thing as a "class path for the
TC class class loader used to load classes at runtime from within a
servlet".  The classpath system property is global to the entire JVM that
is running Tomcat, so it is (obviously) not capable of representing the
set of classes available to each individual webapp.

Class loaders only know what repositories they are loading classes (and
static resources) from -- in the particular case of Tomcat, they are all
subclasses of java.net.URLClassLoader so you can call getRepositories() --
but it won't help you much.  See the following docs for more details:

  http://jakarta.apache.org/tomcat/tomcat-4.0-doc/class-loader-howto.html
  http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html

The real issue is that there's something you are doing wrong that nobody
has been able to figure out yet.  Thousands of apps all over the world
(including every app running Struts) is able to load resources from
/WEB-INF/classes or /WEB-INF/lib if they use the correct invocation.

Note that if you really did copy your properties file to
"/web-inf/classes" instead of "/WEB-INF/classes", give up and start over
-- pretty much everything about servlets and JSP pages is case sensitive.

Craig


> This is obviously not stored in the System.properties - is it kept
> internally anywhere?
>
> Randy
> - Original Message -
> From: "Randy Secrist" <[EMAIL PROTECTED]>
> To: "Tomcat Users List" <[EMAIL PROTECTED]>
> Sent: Tuesday, August 27, 2002 9:21 PM
> Subject: Re: PropertyResourceBundle problems
>
>
> > I did copy the props file to the web-inf/classes - however TC still
> doesn't
> > know what to do with it...
> >
> >
> > ----- Original Message -
> > From: "randie ursal" <[EMAIL PROTECTED]>
> > To: "Tomcat Users List" <[EMAIL PROTECTED]>
> > Sent: Tuesday, August 27, 2002 9:05 PM
> > Subject: Re: PropertyResourceBundle problems
> >
> >
> > > i have that same problem, and i solve it through the efforts of some
> > > people on this
> > > list.
> > >
> > > i just place my property file on WEB-INF/classes of my web
> > > application...that's it
> > > everything works fine now. =)...no need to place it on other
> repositories.
> > >
> > > this is my code in reading the property file:
> > >ResourceBundle oRes = PropertyResourceBundle.getBundle("MyProperty");
> > >
> > > Randy Secrist wrote:
> > >
> > > >Hello,
> > > >
> > > >This is probably a very simple question - but I want to have a servlet
> > load
> > > >a PropertyResourceBundle and am having problems getting TC to find the
> > > >resource...
> > > >
> > > >I want to do this:
> > > >props = (PropertyResourceBundle)
> > > >PropertyResourceBundle.getBundle("SystemConfig");
> > > >
> > > >I have tried moving the properties file into the WEB-INF/classes,
> > > >COMMON/classes, packaging it with my webapp.jar, and dropping it in
> > > >COMMON/lib, and WEB-INF/lib...  I even moved it into bootstrap.jar
> since
> > > >that is apparently the Sys

Re: PropertyResourceBundle problems

2002-08-27 Thread Jakarta Tomcat Newsgroup (@Basebeans.com)

Subject: Re: PropertyResourceBundle problems
From: [EMAIL PROTECTED] (Jakarta Tomcat Newsgroup (@Basebeans.com))
 ===
Subject: Re: PropertyResourceBundle problems
From: "Randy Secrist" <[EMAIL PROTECTED]>
 ===
Still at it.  getRepositories() won't help a bit since (like you said) that
class loader doesn't keep track of the class path over the scope it presides
over...

My key question
May I assume that if I can load a class from this JAR, and the
ResourceBundle is in the same JAR - shouldn't I be able to get to it as
well?
If not - why would that be the case?  Nonetheless - I've pulled it out of
the JAR and into a */classes dir with no difference...

I've read the docs, fought the fight - I'm going to bed.  I'll try to
provide a little more information below on every element pertaining to the
web app - and maybe I'll get lucky tomorrow.  :)  I just can't think of what
it was I may have done different than those millions of people out there.
These are the worst because you know it is something SO small.  That is why
I wish I could verify this somehow.

Here is what I have.
JAR LOCATION:

I have a .jar file with this structure:

META-INF (dir)
com (dir - all my classes / servlets)
SystemConfig (my properties file)
someClass.class
someClass.java

Thats it for the .jar.  It has resided all over my catalina.home directory -
any any WEB-INF/lib or WEB-INF/classes I can find.
(WEB-INF) should be upper case correct?  I have it as upper case at the
moment.

CONTEXT CONFIG:

Tomcat version 4.0.4.
Running out of the ROOT context within a multiple host / context
environment - using a JNDIRealm.
reloadable is set to false - however I restart the server after each new
attempt.  (old habits die hard)

SERVLET CODE:

My Servlet:
makes this call in it's init method: (as a singleton)
webProps = WebProperties.getInstance();

which in WebProperties singleton constructor calls:
  try {
   props = (PropertyResourceBundle)
PropertyResourceBundle.getBundle("SystemConfig");
   System.out.println("WebProperties - Load Success!");
   this.init();
  }
  catch (java.lang.Throwable e) {
   System.err.println("WebProperties - Load Failure!");
   throw new ResourceFailure(e);
  }

The exception is ALWAYS thrown on the getBundle call.
resulting in java.util.MissingResourceException: Can't find bundle for base
name SystemConfig, locale en_US

Anywho - thanks for your patience.

Randy



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Re: PropertyResourceBundle problems

2002-08-27 Thread Jakarta Tomcat Newsgroup (@Basebeans.com)

Subject: Re: PropertyResourceBundle problems
From: [EMAIL PROTECTED] (Jakarta Tomcat Newsgroup (@Basebeans.com))
 ===
Subject: Re: PropertyResourceBundle problems
From: [EMAIL PROTECTED] (Jakarta Tomcat Newsgroup (@Basebeans.com))
 ===
Subject: Re: PropertyResourceBundle problems
From: [EMAIL PROTECTED] (Jakarta Tomcat Newsgroup (@Basebeans.com))
 ===
Subject: Re: PropertyResourceBundle problems
From: [EMAIL PROTECTED] (Jakarta Tomcat Newsgroup (@Basebeans.com))
 ===
Subject: Re: PropertyResourceBundle problems
From: [EMAIL PROTECTED] (Jakarta Tomcat Newsgroup (@Basebeans.com))
 ===
Subject: Re: PropertyResourceBundle problems
From: [EMAIL PROTECTED] (Jakarta Tomcat Newsgroup (@Basebeans.com))
 ===
Subject: Re: PropertyResourceBundle problems
From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
 ===


On Tue, 27 Aug 2002, Randy Secrist wrote:

> Date: Tue, 27 Aug 2002 21:58:00 -0600
> From: Randy Secrist <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: Tomcat Users List <[EMAIL PROTECTED]>
> Subject: Re: PropertyResourceBundle problems
>
> Lets try this route then:
>
> Is there ANY way to get the actual class path the TC class loader uses to
> load classes at runtime from within a servlet out of ANY context?
>

No.  The problem is that there *is* no such thing as a "class path for the
TC class class loader used to load classes at runtime from within a
servlet".  The classpath system property is global to the entire JVM that
is running Tomcat, so it is (obviously) not capable of representing the
set of classes available to each individual webapp.

Class loaders only know what repositories they are loading classes (and
static resources) from -- in the particular case of Tomcat, they are all
subclasses of java.net.URLClassLoader so you can call getRepositories() --
but it won't help you much.  See the following docs for more details:

  http://jakarta.apache.org/tomcat/tomcat-4.0-doc/class-loader-howto.html
  http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html

The real issue is that there's something you are doing wrong that nobody
has been able to figure out yet.  Thousands of apps all over the world
(including every app running Struts) is able to load resources from
/WEB-INF/classes or /WEB-INF/lib if they use the correct invocation.

Note that if you really did copy your properties file to
"/web-inf/classes" instead of "/WEB-INF/classes", give up and start over
-- pretty much everything about servlets and JSP pages is case sensitive.

Craig


> This is obviously not stored in the System.properties - is it kept
> internally anywhere?
>
> Randy
> - Original Message -
> From: "Randy Secrist" <[EMAIL PROTECTED]>
> To: "Tomcat Users List" <[EMAIL PROTECTED]>
> Sent: Tuesday, August 27, 2002 9:21 PM
> Subject: Re: PropertyResourceBundle problems
>
>
> > I did copy the props file to the web-inf/classes - however TC still
> doesn't
> > know what to do with it...
> >
> >
> > ----- Original Message -
> > From: "randie ursal" <[EMAIL PROTECTED]>
> > To: "Tomcat Users List" <[EMAIL PROTECTED]>
> > Sent: Tuesday, August 27, 2002 9:05 PM
> > Subject: Re: PropertyResourceBundle problems
> >
> >
> > > i have that same problem, and i solve it through the efforts of some
> > > people on this
> > > list.
> > >
> > > i just place my property file on WEB-INF/classes of my web
> > > application...that's it
> > > everything works fine now. =)...no need to place it on other
> repositories.
> > >
> > > this is my code in reading the property file:
> > >ResourceBundle oRes = PropertyResourceBundle.getBundle("MyProperty");
> > >
> > > Randy Secrist wrote:
> > >
> > > >Hello,
> > > >
> > > >This is probably a very simple question - but I want to have a servlet
> > load
> > > >a PropertyResourceBundle and am having problems getting TC to find the
> > > >resource...
> > > >
> > > >I want to do this:
> > > >props = (PropertyResourceBundle)
> > > >PropertyResourceBundle.getBundle("SystemConfig");
> > > >
> > > >I have tried moving the properties file into the WEB-INF/classes,
> > > >COMMON/classes, packaging it with my webapp.jar, and dropping it in
> > > >COMMON/lib, and WEB-INF/lib...  I even moved it into bootstrap.jar
> since
> > > >that is apparently the System classpath TC uses.  Still no luck...
> > > >
> > > >Everytime I get a java.util.MissingResourceExce

Re: PropertyResourceBundle problems

2002-08-27 Thread Jakarta Tomcat Newsgroup (@Basebeans.com)

Subject: Re: PropertyResourceBundle problems
From: "Randy Secrist" <[EMAIL PROTECTED]>
 ===
Still at it.  getRepositories() won't help a bit since (like you said) that
class loader doesn't keep track of the class path over the scope it presides
over...

My key question
May I assume that if I can load a class from this JAR, and the
ResourceBundle is in the same JAR - shouldn't I be able to get to it as
well?
If not - why would that be the case?  Nonetheless - I've pulled it out of
the JAR and into a */classes dir with no difference...

I've read the docs, fought the fight - I'm going to bed.  I'll try to
provide a little more information below on every element pertaining to the
web app - and maybe I'll get lucky tomorrow.  :)  I just can't think of what
it was I may have done different than those millions of people out there.
These are the worst because you know it is something SO small.  That is why
I wish I could verify this somehow.

Here is what I have.
JAR LOCATION:

I have a .jar file with this structure:

META-INF (dir)
com (dir - all my classes / servlets)
SystemConfig (my properties file)
someClass.class
someClass.java

Thats it for the .jar.  It has resided all over my catalina.home directory -
any any WEB-INF/lib or WEB-INF/classes I can find.
(WEB-INF) should be upper case correct?  I have it as upper case at the
moment.

CONTEXT CONFIG:

Tomcat version 4.0.4.
Running out of the ROOT context within a multiple host / context
environment - using a JNDIRealm.
reloadable is set to false - however I restart the server after each new
attempt.  (old habits die hard)

SERVLET CODE:

My Servlet:
makes this call in it's init method: (as a singleton)
webProps = WebProperties.getInstance();

which in WebProperties singleton constructor calls:
  try {
   props = (PropertyResourceBundle)
PropertyResourceBundle.getBundle("SystemConfig");
   System.out.println("WebProperties - Load Success!");
   this.init();
  }
  catch (java.lang.Throwable e) {
   System.err.println("WebProperties - Load Failure!");
   throw new ResourceFailure(e);
  }

The exception is ALWAYS thrown on the getBundle call.
resulting in java.util.MissingResourceException: Can't find bundle for base
name SystemConfig, locale en_US

Anywho - thanks for your patience.

Randy



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Re: PropertyResourceBundle problems

2002-08-27 Thread Jakarta Tomcat Newsgroup (@Basebeans.com)

Subject: Re: PropertyResourceBundle problems
From: [EMAIL PROTECTED] (Jakarta Tomcat Newsgroup (@Basebeans.com))
 ===
Subject: Re: PropertyResourceBundle problems
From: [EMAIL PROTECTED] (Jakarta Tomcat Newsgroup (@Basebeans.com))
 ===
Subject: Re: PropertyResourceBundle problems
From: [EMAIL PROTECTED] (Jakarta Tomcat Newsgroup (@Basebeans.com))
 ===
Subject: Re: PropertyResourceBundle problems
From: [EMAIL PROTECTED] (Jakarta Tomcat Newsgroup (@Basebeans.com))
 ===
Subject: Re: PropertyResourceBundle problems
From: [EMAIL PROTECTED] (Jakarta Tomcat Newsgroup (@Basebeans.com))
 ===
Subject: Re: PropertyResourceBundle problems
From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
 ===


On Tue, 27 Aug 2002, Randy Secrist wrote:

> Date: Tue, 27 Aug 2002 21:58:00 -0600
> From: Randy Secrist <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: Tomcat Users List <[EMAIL PROTECTED]>
> Subject: Re: PropertyResourceBundle problems
>
> Lets try this route then:
>
> Is there ANY way to get the actual class path the TC class loader uses to
> load classes at runtime from within a servlet out of ANY context?
>

No.  The problem is that there *is* no such thing as a "class path for the
TC class class loader used to load classes at runtime from within a
servlet".  The classpath system property is global to the entire JVM that
is running Tomcat, so it is (obviously) not capable of representing the
set of classes available to each individual webapp.

Class loaders only know what repositories they are loading classes (and
static resources) from -- in the particular case of Tomcat, they are all
subclasses of java.net.URLClassLoader so you can call getRepositories() --
but it won't help you much.  See the following docs for more details:

  http://jakarta.apache.org/tomcat/tomcat-4.0-doc/class-loader-howto.html
  http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html

The real issue is that there's something you are doing wrong that nobody
has been able to figure out yet.  Thousands of apps all over the world
(including every app running Struts) is able to load resources from
/WEB-INF/classes or /WEB-INF/lib if they use the correct invocation.

Note that if you really did copy your properties file to
"/web-inf/classes" instead of "/WEB-INF/classes", give up and start over
-- pretty much everything about servlets and JSP pages is case sensitive.

Craig


> This is obviously not stored in the System.properties - is it kept
> internally anywhere?
>
> Randy
> - Original Message -
> From: "Randy Secrist" <[EMAIL PROTECTED]>
> To: "Tomcat Users List" <[EMAIL PROTECTED]>
> Sent: Tuesday, August 27, 2002 9:21 PM
> Subject: Re: PropertyResourceBundle problems
>
>
> > I did copy the props file to the web-inf/classes - however TC still
> doesn't
> > know what to do with it...
> >
> >
> > ----- Original Message -
> > From: "randie ursal" <[EMAIL PROTECTED]>
> > To: "Tomcat Users List" <[EMAIL PROTECTED]>
> > Sent: Tuesday, August 27, 2002 9:05 PM
> > Subject: Re: PropertyResourceBundle problems
> >
> >
> > > i have that same problem, and i solve it through the efforts of some
> > > people on this
> > > list.
> > >
> > > i just place my property file on WEB-INF/classes of my web
> > > application...that's it
> > > everything works fine now. =)...no need to place it on other
> repositories.
> > >
> > > this is my code in reading the property file:
> > >ResourceBundle oRes = PropertyResourceBundle.getBundle("MyProperty");
> > >
> > > Randy Secrist wrote:
> > >
> > > >Hello,
> > > >
> > > >This is probably a very simple question - but I want to have a servlet
> > load
> > > >a PropertyResourceBundle and am having problems getting TC to find the
> > > >resource...
> > > >
> > > >I want to do this:
> > > >props = (PropertyResourceBundle)
> > > >PropertyResourceBundle.getBundle("SystemConfig");
> > > >
> > > >I have tried moving the properties file into the WEB-INF/classes,
> > > >COMMON/classes, packaging it with my webapp.jar, and dropping it in
> > > >COMMON/lib, and WEB-INF/lib...  I even moved it into bootstrap.jar
> since
> > > >that is apparently the System classpath TC uses.  Still no luck...
> > > >
> > > >Everytime I get a java.util.MissingResourceException
> > > >
> > > >What am I doing wrong?
> > > >
> > > >Randy
> 

Re: PropertyResourceBundle problems

2002-08-27 Thread Randy Secrist

Still at it.  getRepositories() won't help a bit since (like you said) that
class loader doesn't keep track of the class path over the scope it presides
over...

My key question
May I assume that if I can load a class from this JAR, and the
ResourceBundle is in the same JAR - shouldn't I be able to get to it as
well?
If not - why would that be the case?  Nonetheless - I've pulled it out of
the JAR and into a */classes dir with no difference...

I've read the docs, fought the fight - I'm going to bed.  I'll try to
provide a little more information below on every element pertaining to the
web app - and maybe I'll get lucky tomorrow.  :)  I just can't think of what
it was I may have done different than those millions of people out there.
These are the worst because you know it is something SO small.  That is why
I wish I could verify this somehow.

Here is what I have.
JAR LOCATION:

I have a .jar file with this structure:

META-INF (dir)
com (dir - all my classes / servlets)
SystemConfig (my properties file)
someClass.class
someClass.java

Thats it for the .jar.  It has resided all over my catalina.home directory -
any any WEB-INF/lib or WEB-INF/classes I can find.
(WEB-INF) should be upper case correct?  I have it as upper case at the
moment.

CONTEXT CONFIG:

Tomcat version 4.0.4.
Running out of the ROOT context within a multiple host / context
environment - using a JNDIRealm.
reloadable is set to false - however I restart the server after each new
attempt.  (old habits die hard)

SERVLET CODE:

My Servlet:
makes this call in it's init method: (as a singleton)
webProps = WebProperties.getInstance();

which in WebProperties singleton constructor calls:
  try {
   props = (PropertyResourceBundle)
PropertyResourceBundle.getBundle("SystemConfig");
   System.out.println("WebProperties - Load Success!");
   this.init();
  }
  catch (java.lang.Throwable e) {
   System.err.println("WebProperties - Load Failure!");
   throw new ResourceFailure(e);
  }

The exception is ALWAYS thrown on the getBundle call.
resulting in java.util.MissingResourceException: Can't find bundle for base
name SystemConfig, locale en_US

Anywho - thanks for your patience.

Randy



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: PropertyResourceBundle problems

2002-08-27 Thread Jakarta Tomcat Newsgroup (@Basebeans.com)

Subject: Re: PropertyResourceBundle problems
From: [EMAIL PROTECTED] (Jakarta Tomcat Newsgroup (@Basebeans.com))
 ===
Subject: Re: PropertyResourceBundle problems
From: [EMAIL PROTECTED] (Jakarta Tomcat Newsgroup (@Basebeans.com))
 ===
Subject: Re: PropertyResourceBundle problems
From: [EMAIL PROTECTED] (Jakarta Tomcat Newsgroup (@Basebeans.com))
 ===
Subject: Re: PropertyResourceBundle problems
From: [EMAIL PROTECTED] (Jakarta Tomcat Newsgroup (@Basebeans.com))
 ===
Subject: Re: PropertyResourceBundle problems
From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
 ===


On Tue, 27 Aug 2002, Randy Secrist wrote:

> Date: Tue, 27 Aug 2002 21:58:00 -0600
> From: Randy Secrist <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: Tomcat Users List <[EMAIL PROTECTED]>
> Subject: Re: PropertyResourceBundle problems
>
> Lets try this route then:
>
> Is there ANY way to get the actual class path the TC class loader uses to
> load classes at runtime from within a servlet out of ANY context?
>

No.  The problem is that there *is* no such thing as a "class path for the
TC class class loader used to load classes at runtime from within a
servlet".  The classpath system property is global to the entire JVM that
is running Tomcat, so it is (obviously) not capable of representing the
set of classes available to each individual webapp.

Class loaders only know what repositories they are loading classes (and
static resources) from -- in the particular case of Tomcat, they are all
subclasses of java.net.URLClassLoader so you can call getRepositories() --
but it won't help you much.  See the following docs for more details:

  http://jakarta.apache.org/tomcat/tomcat-4.0-doc/class-loader-howto.html
  http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html

The real issue is that there's something you are doing wrong that nobody
has been able to figure out yet.  Thousands of apps all over the world
(including every app running Struts) is able to load resources from
/WEB-INF/classes or /WEB-INF/lib if they use the correct invocation.

Note that if you really did copy your properties file to
"/web-inf/classes" instead of "/WEB-INF/classes", give up and start over
-- pretty much everything about servlets and JSP pages is case sensitive.

Craig


> This is obviously not stored in the System.properties - is it kept
> internally anywhere?
>
> Randy
> - Original Message -
> From: "Randy Secrist" <[EMAIL PROTECTED]>
> To: "Tomcat Users List" <[EMAIL PROTECTED]>
> Sent: Tuesday, August 27, 2002 9:21 PM
> Subject: Re: PropertyResourceBundle problems
>
>
> > I did copy the props file to the web-inf/classes - however TC still
> doesn't
> > know what to do with it...
> >
> >
> > ----- Original Message -
> > From: "randie ursal" <[EMAIL PROTECTED]>
> > To: "Tomcat Users List" <[EMAIL PROTECTED]>
> > Sent: Tuesday, August 27, 2002 9:05 PM
> > Subject: Re: PropertyResourceBundle problems
> >
> >
> > > i have that same problem, and i solve it through the efforts of some
> > > people on this
> > > list.
> > >
> > > i just place my property file on WEB-INF/classes of my web
> > > application...that's it
> > > everything works fine now. =)...no need to place it on other
> repositories.
> > >
> > > this is my code in reading the property file:
> > >ResourceBundle oRes = PropertyResourceBundle.getBundle("MyProperty");
> > >
> > > Randy Secrist wrote:
> > >
> > > >Hello,
> > > >
> > > >This is probably a very simple question - but I want to have a servlet
> > load
> > > >a PropertyResourceBundle and am having problems getting TC to find the
> > > >resource...
> > > >
> > > >I want to do this:
> > > >props = (PropertyResourceBundle)
> > > >PropertyResourceBundle.getBundle("SystemConfig");
> > > >
> > > >I have tried moving the properties file into the WEB-INF/classes,
> > > >COMMON/classes, packaging it with my webapp.jar, and dropping it in
> > > >COMMON/lib, and WEB-INF/lib...  I even moved it into bootstrap.jar
> since
> > > >that is apparently the System classpath TC uses.  Still no luck...
> > > >
> > > >Everytime I get a java.util.MissingResourceException
> > > >
> > > >What am I doing wrong?
> > > >
> > > >Randy
> > > >
> > > >
> > > >--
> > > >To unsubscribe, e-mail:
> > <

Re: PropertyResourceBundle problems

2002-08-27 Thread Jakarta Tomcat Newsgroup (@Basebeans.com)

Subject: Re: PropertyResourceBundle problems
From: [EMAIL PROTECTED] (Jakarta Tomcat Newsgroup (@Basebeans.com))
 ===
Subject: Re: PropertyResourceBundle problems
From: [EMAIL PROTECTED] (Jakarta Tomcat Newsgroup (@Basebeans.com))
 ===
Subject: Re: PropertyResourceBundle problems
From: [EMAIL PROTECTED] (Jakarta Tomcat Newsgroup (@Basebeans.com))
 ===
Subject: Re: PropertyResourceBundle problems
From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
 ===


On Tue, 27 Aug 2002, Randy Secrist wrote:

> Date: Tue, 27 Aug 2002 21:58:00 -0600
> From: Randy Secrist <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: Tomcat Users List <[EMAIL PROTECTED]>
> Subject: Re: PropertyResourceBundle problems
>
> Lets try this route then:
>
> Is there ANY way to get the actual class path the TC class loader uses to
> load classes at runtime from within a servlet out of ANY context?
>

No.  The problem is that there *is* no such thing as a "class path for the
TC class class loader used to load classes at runtime from within a
servlet".  The classpath system property is global to the entire JVM that
is running Tomcat, so it is (obviously) not capable of representing the
set of classes available to each individual webapp.

Class loaders only know what repositories they are loading classes (and
static resources) from -- in the particular case of Tomcat, they are all
subclasses of java.net.URLClassLoader so you can call getRepositories() --
but it won't help you much.  See the following docs for more details:

  http://jakarta.apache.org/tomcat/tomcat-4.0-doc/class-loader-howto.html
  http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html

The real issue is that there's something you are doing wrong that nobody
has been able to figure out yet.  Thousands of apps all over the world
(including every app running Struts) is able to load resources from
/WEB-INF/classes or /WEB-INF/lib if they use the correct invocation.

Note that if you really did copy your properties file to
"/web-inf/classes" instead of "/WEB-INF/classes", give up and start over
-- pretty much everything about servlets and JSP pages is case sensitive.

Craig


> This is obviously not stored in the System.properties - is it kept
> internally anywhere?
>
> Randy
> - Original Message -
> From: "Randy Secrist" <[EMAIL PROTECTED]>
> To: "Tomcat Users List" <[EMAIL PROTECTED]>
> Sent: Tuesday, August 27, 2002 9:21 PM
> Subject: Re: PropertyResourceBundle problems
>
>
> > I did copy the props file to the web-inf/classes - however TC still
> doesn't
> > know what to do with it...
> >
> >
> > ----- Original Message -
> > From: "randie ursal" <[EMAIL PROTECTED]>
> > To: "Tomcat Users List" <[EMAIL PROTECTED]>
> > Sent: Tuesday, August 27, 2002 9:05 PM
> > Subject: Re: PropertyResourceBundle problems
> >
> >
> > > i have that same problem, and i solve it through the efforts of some
> > > people on this
> > > list.
> > >
> > > i just place my property file on WEB-INF/classes of my web
> > > application...that's it
> > > everything works fine now. =)...no need to place it on other
> repositories.
> > >
> > > this is my code in reading the property file:
> > >ResourceBundle oRes = PropertyResourceBundle.getBundle("MyProperty");
> > >
> > > Randy Secrist wrote:
> > >
> > > >Hello,
> > > >
> > > >This is probably a very simple question - but I want to have a servlet
> > load
> > > >a PropertyResourceBundle and am having problems getting TC to find the
> > > >resource...
> > > >
> > > >I want to do this:
> > > >props = (PropertyResourceBundle)
> > > >PropertyResourceBundle.getBundle("SystemConfig");
> > > >
> > > >I have tried moving the properties file into the WEB-INF/classes,
> > > >COMMON/classes, packaging it with my webapp.jar, and dropping it in
> > > >COMMON/lib, and WEB-INF/lib...  I even moved it into bootstrap.jar
> since
> > > >that is apparently the System classpath TC uses.  Still no luck...
> > > >
> > > >Everytime I get a java.util.MissingResourceException
> > > >
> > > >What am I doing wrong?
> > > >
> > > >Randy
> > > >
> > > >
> > > >--
> > > >To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > > >For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>

Re: PropertyResourceBundle problems

2002-08-27 Thread Jakarta Tomcat Newsgroup (@Basebeans.com)

Subject: Re: PropertyResourceBundle problems
From: [EMAIL PROTECTED] (Jakarta Tomcat Newsgroup (@Basebeans.com))
 ===
Subject: Re: PropertyResourceBundle problems
From: [EMAIL PROTECTED] (Jakarta Tomcat Newsgroup (@Basebeans.com))
 ===
Subject: Re: PropertyResourceBundle problems
From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
 ===


On Tue, 27 Aug 2002, Randy Secrist wrote:

> Date: Tue, 27 Aug 2002 21:58:00 -0600
> From: Randy Secrist <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: Tomcat Users List <[EMAIL PROTECTED]>
> Subject: Re: PropertyResourceBundle problems
>
> Lets try this route then:
>
> Is there ANY way to get the actual class path the TC class loader uses to
> load classes at runtime from within a servlet out of ANY context?
>

No.  The problem is that there *is* no such thing as a "class path for the
TC class class loader used to load classes at runtime from within a
servlet".  The classpath system property is global to the entire JVM that
is running Tomcat, so it is (obviously) not capable of representing the
set of classes available to each individual webapp.

Class loaders only know what repositories they are loading classes (and
static resources) from -- in the particular case of Tomcat, they are all
subclasses of java.net.URLClassLoader so you can call getRepositories() --
but it won't help you much.  See the following docs for more details:

  http://jakarta.apache.org/tomcat/tomcat-4.0-doc/class-loader-howto.html
  http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html

The real issue is that there's something you are doing wrong that nobody
has been able to figure out yet.  Thousands of apps all over the world
(including every app running Struts) is able to load resources from
/WEB-INF/classes or /WEB-INF/lib if they use the correct invocation.

Note that if you really did copy your properties file to
"/web-inf/classes" instead of "/WEB-INF/classes", give up and start over
-- pretty much everything about servlets and JSP pages is case sensitive.

Craig


> This is obviously not stored in the System.properties - is it kept
> internally anywhere?
>
> Randy
> - Original Message -
> From: "Randy Secrist" <[EMAIL PROTECTED]>
> To: "Tomcat Users List" <[EMAIL PROTECTED]>
> Sent: Tuesday, August 27, 2002 9:21 PM
> Subject: Re: PropertyResourceBundle problems
>
>
> > I did copy the props file to the web-inf/classes - however TC still
> doesn't
> > know what to do with it...
> >
> >
> > ----- Original Message -
> > From: "randie ursal" <[EMAIL PROTECTED]>
> > To: "Tomcat Users List" <[EMAIL PROTECTED]>
> > Sent: Tuesday, August 27, 2002 9:05 PM
> > Subject: Re: PropertyResourceBundle problems
> >
> >
> > > i have that same problem, and i solve it through the efforts of some
> > > people on this
> > > list.
> > >
> > > i just place my property file on WEB-INF/classes of my web
> > > application...that's it
> > > everything works fine now. =)...no need to place it on other
> repositories.
> > >
> > > this is my code in reading the property file:
> > >ResourceBundle oRes = PropertyResourceBundle.getBundle("MyProperty");
> > >
> > > Randy Secrist wrote:
> > >
> > > >Hello,
> > > >
> > > >This is probably a very simple question - but I want to have a servlet
> > load
> > > >a PropertyResourceBundle and am having problems getting TC to find the
> > > >resource...
> > > >
> > > >I want to do this:
> > > >props = (PropertyResourceBundle)
> > > >PropertyResourceBundle.getBundle("SystemConfig");
> > > >
> > > >I have tried moving the properties file into the WEB-INF/classes,
> > > >COMMON/classes, packaging it with my webapp.jar, and dropping it in
> > > >COMMON/lib, and WEB-INF/lib...  I even moved it into bootstrap.jar
> since
> > > >that is apparently the System classpath TC uses.  Still no luck...
> > > >
> > > >Everytime I get a java.util.MissingResourceException
> > > >
> > > >What am I doing wrong?
> > > >
> > > >Randy
> > > >
> > > >
> > > >--
> > > >To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > > >For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
>

Re: PropertyResourceBundle problems

2002-08-27 Thread Jakarta Tomcat Newsgroup (@Basebeans.com)

Subject: Re: PropertyResourceBundle problems
From: [EMAIL PROTECTED] (Jakarta Tomcat Newsgroup (@Basebeans.com))
 ===
Subject: Re: PropertyResourceBundle problems
From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
 ===


On Tue, 27 Aug 2002, Randy Secrist wrote:

> Date: Tue, 27 Aug 2002 21:58:00 -0600
> From: Randy Secrist <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: Tomcat Users List <[EMAIL PROTECTED]>
> Subject: Re: PropertyResourceBundle problems
>
> Lets try this route then:
>
> Is there ANY way to get the actual class path the TC class loader uses to
> load classes at runtime from within a servlet out of ANY context?
>

No.  The problem is that there *is* no such thing as a "class path for the
TC class class loader used to load classes at runtime from within a
servlet".  The classpath system property is global to the entire JVM that
is running Tomcat, so it is (obviously) not capable of representing the
set of classes available to each individual webapp.

Class loaders only know what repositories they are loading classes (and
static resources) from -- in the particular case of Tomcat, they are all
subclasses of java.net.URLClassLoader so you can call getRepositories() --
but it won't help you much.  See the following docs for more details:

  http://jakarta.apache.org/tomcat/tomcat-4.0-doc/class-loader-howto.html
  http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html

The real issue is that there's something you are doing wrong that nobody
has been able to figure out yet.  Thousands of apps all over the world
(including every app running Struts) is able to load resources from
/WEB-INF/classes or /WEB-INF/lib if they use the correct invocation.

Note that if you really did copy your properties file to
"/web-inf/classes" instead of "/WEB-INF/classes", give up and start over
-- pretty much everything about servlets and JSP pages is case sensitive.

Craig


> This is obviously not stored in the System.properties - is it kept
> internally anywhere?
>
> Randy
> - Original Message -
> From: "Randy Secrist" <[EMAIL PROTECTED]>
> To: "Tomcat Users List" <[EMAIL PROTECTED]>
> Sent: Tuesday, August 27, 2002 9:21 PM
> Subject: Re: PropertyResourceBundle problems
>
>
> > I did copy the props file to the web-inf/classes - however TC still
> doesn't
> > know what to do with it...
> >
> >
> > ----- Original Message -
> > From: "randie ursal" <[EMAIL PROTECTED]>
> > To: "Tomcat Users List" <[EMAIL PROTECTED]>
> > Sent: Tuesday, August 27, 2002 9:05 PM
> > Subject: Re: PropertyResourceBundle problems
> >
> >
> > > i have that same problem, and i solve it through the efforts of some
> > > people on this
> > > list.
> > >
> > > i just place my property file on WEB-INF/classes of my web
> > > application...that's it
> > > everything works fine now. =)...no need to place it on other
> repositories.
> > >
> > > this is my code in reading the property file:
> > >ResourceBundle oRes = PropertyResourceBundle.getBundle("MyProperty");
> > >
> > > Randy Secrist wrote:
> > >
> > > >Hello,
> > > >
> > > >This is probably a very simple question - but I want to have a servlet
> > load
> > > >a PropertyResourceBundle and am having problems getting TC to find the
> > > >resource...
> > > >
> > > >I want to do this:
> > > >props = (PropertyResourceBundle)
> > > >PropertyResourceBundle.getBundle("SystemConfig");
> > > >
> > > >I have tried moving the properties file into the WEB-INF/classes,
> > > >COMMON/classes, packaging it with my webapp.jar, and dropping it in
> > > >COMMON/lib, and WEB-INF/lib...  I even moved it into bootstrap.jar
> since
> > > >that is apparently the System classpath TC uses.  Still no luck...
> > > >
> > > >Everytime I get a java.util.MissingResourceException
> > > >
> > > >What am I doing wrong?
> > > >
> > > >Randy
> > > >
> > > >
> > > >--
> > > >To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > > >For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > > --
> > >
> > > Randie V. Ursal
> > > Design Engineering Department
> > &g

Re: PropertyResourceBundle problems

2002-08-27 Thread Jakarta Tomcat Newsgroup (@Basebeans.com)

Subject: Re: PropertyResourceBundle problems
From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
 ===


On Tue, 27 Aug 2002, Randy Secrist wrote:

> Date: Tue, 27 Aug 2002 21:58:00 -0600
> From: Randy Secrist <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: Tomcat Users List <[EMAIL PROTECTED]>
> Subject: Re: PropertyResourceBundle problems
>
> Lets try this route then:
>
> Is there ANY way to get the actual class path the TC class loader uses to
> load classes at runtime from within a servlet out of ANY context?
>

No.  The problem is that there *is* no such thing as a "class path for the
TC class class loader used to load classes at runtime from within a
servlet".  The classpath system property is global to the entire JVM that
is running Tomcat, so it is (obviously) not capable of representing the
set of classes available to each individual webapp.

Class loaders only know what repositories they are loading classes (and
static resources) from -- in the particular case of Tomcat, they are all
subclasses of java.net.URLClassLoader so you can call getRepositories() --
but it won't help you much.  See the following docs for more details:

  http://jakarta.apache.org/tomcat/tomcat-4.0-doc/class-loader-howto.html
  http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html

The real issue is that there's something you are doing wrong that nobody
has been able to figure out yet.  Thousands of apps all over the world
(including every app running Struts) is able to load resources from
/WEB-INF/classes or /WEB-INF/lib if they use the correct invocation.

Note that if you really did copy your properties file to
"/web-inf/classes" instead of "/WEB-INF/classes", give up and start over
-- pretty much everything about servlets and JSP pages is case sensitive.

Craig


> This is obviously not stored in the System.properties - is it kept
> internally anywhere?
>
> Randy
> - Original Message -
> From: "Randy Secrist" <[EMAIL PROTECTED]>
> To: "Tomcat Users List" <[EMAIL PROTECTED]>
> Sent: Tuesday, August 27, 2002 9:21 PM
> Subject: Re: PropertyResourceBundle problems
>
>
> > I did copy the props file to the web-inf/classes - however TC still
> doesn't
> > know what to do with it...
> >
> >
> > ----- Original Message -
> > From: "randie ursal" <[EMAIL PROTECTED]>
> > To: "Tomcat Users List" <[EMAIL PROTECTED]>
> > Sent: Tuesday, August 27, 2002 9:05 PM
> > Subject: Re: PropertyResourceBundle problems
> >
> >
> > > i have that same problem, and i solve it through the efforts of some
> > > people on this
> > > list.
> > >
> > > i just place my property file on WEB-INF/classes of my web
> > > application...that's it
> > > everything works fine now. =)...no need to place it on other
> repositories.
> > >
> > > this is my code in reading the property file:
> > >ResourceBundle oRes = PropertyResourceBundle.getBundle("MyProperty");
> > >
> > > Randy Secrist wrote:
> > >
> > > >Hello,
> > > >
> > > >This is probably a very simple question - but I want to have a servlet
> > load
> > > >a PropertyResourceBundle and am having problems getting TC to find the
> > > >resource...
> > > >
> > > >I want to do this:
> > > >props = (PropertyResourceBundle)
> > > >PropertyResourceBundle.getBundle("SystemConfig");
> > > >
> > > >I have tried moving the properties file into the WEB-INF/classes,
> > > >COMMON/classes, packaging it with my webapp.jar, and dropping it in
> > > >COMMON/lib, and WEB-INF/lib...  I even moved it into bootstrap.jar
> since
> > > >that is apparently the System classpath TC uses.  Still no luck...
> > > >
> > > >Everytime I get a java.util.MissingResourceException
> > > >
> > > >What am I doing wrong?
> > > >
> > > >Randy
> > > >
> > > >
> > > >--
> > > >To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > > >For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > > --
> > >
> > > Randie V. Ursal
> > > Design Engineering Department
> > > NEC Telecom Software Philippines, Inc.
> > > office : +63(032) 233-9142 (loc.3119)
> > > mobile : +63(0917) 467-8244
> > > email  : [EMAIL PROTECTED]
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> >
>
>
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Re: PropertyResourceBundle problems

2002-08-27 Thread Craig R. McClanahan



On Tue, 27 Aug 2002, Randy Secrist wrote:

> Date: Tue, 27 Aug 2002 21:58:00 -0600
> From: Randy Secrist <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: Tomcat Users List <[EMAIL PROTECTED]>
> Subject: Re: PropertyResourceBundle problems
>
> Lets try this route then:
>
> Is there ANY way to get the actual class path the TC class loader uses to
> load classes at runtime from within a servlet out of ANY context?
>

No.  The problem is that there *is* no such thing as a "class path for the
TC class class loader used to load classes at runtime from within a
servlet".  The classpath system property is global to the entire JVM that
is running Tomcat, so it is (obviously) not capable of representing the
set of classes available to each individual webapp.

Class loaders only know what repositories they are loading classes (and
static resources) from -- in the particular case of Tomcat, they are all
subclasses of java.net.URLClassLoader so you can call getRepositories() --
but it won't help you much.  See the following docs for more details:

  http://jakarta.apache.org/tomcat/tomcat-4.0-doc/class-loader-howto.html
  http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html

The real issue is that there's something you are doing wrong that nobody
has been able to figure out yet.  Thousands of apps all over the world
(including every app running Struts) is able to load resources from
/WEB-INF/classes or /WEB-INF/lib if they use the correct invocation.

Note that if you really did copy your properties file to
"/web-inf/classes" instead of "/WEB-INF/classes", give up and start over
-- pretty much everything about servlets and JSP pages is case sensitive.

Craig


> This is obviously not stored in the System.properties - is it kept
> internally anywhere?
>
> Randy
> - Original Message -
> From: "Randy Secrist" <[EMAIL PROTECTED]>
> To: "Tomcat Users List" <[EMAIL PROTECTED]>
> Sent: Tuesday, August 27, 2002 9:21 PM
> Subject: Re: PropertyResourceBundle problems
>
>
> > I did copy the props file to the web-inf/classes - however TC still
> doesn't
> > know what to do with it...
> >
> >
> > - Original Message -
> > From: "randie ursal" <[EMAIL PROTECTED]>
> > To: "Tomcat Users List" <[EMAIL PROTECTED]>
> > Sent: Tuesday, August 27, 2002 9:05 PM
> > Subject: Re: PropertyResourceBundle problems
> >
> >
> > > i have that same problem, and i solve it through the efforts of some
> > > people on this
> > > list.
> > >
> > > i just place my property file on WEB-INF/classes of my web
> > > application...that's it
> > > everything works fine now. =)...no need to place it on other
> repositories.
> > >
> > > this is my code in reading the property file:
> > >ResourceBundle oRes = PropertyResourceBundle.getBundle("MyProperty");
> > >
> > > Randy Secrist wrote:
> > >
> > > >Hello,
> > > >
> > > >This is probably a very simple question - but I want to have a servlet
> > load
> > > >a PropertyResourceBundle and am having problems getting TC to find the
> > > >resource...
> > > >
> > > >I want to do this:
> > > >props = (PropertyResourceBundle)
> > > >PropertyResourceBundle.getBundle("SystemConfig");
> > > >
> > > >I have tried moving the properties file into the WEB-INF/classes,
> > > >COMMON/classes, packaging it with my webapp.jar, and dropping it in
> > > >COMMON/lib, and WEB-INF/lib...  I even moved it into bootstrap.jar
> since
> > > >that is apparently the System classpath TC uses.  Still no luck...
> > > >
> > > >Everytime I get a java.util.MissingResourceException
> > > >
> > > >What am I doing wrong?
> > > >
> > > >Randy
> > > >
> > > >
> > > >--
> > > >To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > > >For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > > --
> > >
> > > Randie V. Ursal
> > > Design Engineering Department
> > > NEC Telecom Software Philippines, Inc.
> > > office : +63(032) 233-9142 (loc.3119)
> > > mobile : +63(0917) 467-8244
> > > email  : [EMAIL PROTECTED]
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> >
>
>
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Re: PropertyResourceBundle problems

2002-08-27 Thread Randy Secrist

Lets try this route then:

Is there ANY way to get the actual class path the TC class loader uses to
load classes at runtime from within a servlet out of ANY context?

This is obviously not stored in the System.properties - is it kept
internally anywhere?

Randy
- Original Message -
From: "Randy Secrist" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Tuesday, August 27, 2002 9:21 PM
Subject: Re: PropertyResourceBundle problems


> I did copy the props file to the web-inf/classes - however TC still
doesn't
> know what to do with it...
>
>
> - Original Message -
> From: "randie ursal" <[EMAIL PROTECTED]>
> To: "Tomcat Users List" <[EMAIL PROTECTED]>
> Sent: Tuesday, August 27, 2002 9:05 PM
> Subject: Re: PropertyResourceBundle problems
>
>
> > i have that same problem, and i solve it through the efforts of some
> > people on this
> > list.
> >
> > i just place my property file on WEB-INF/classes of my web
> > application...that's it
> > everything works fine now. =)...no need to place it on other
repositories.
> >
> > this is my code in reading the property file:
> >ResourceBundle oRes = PropertyResourceBundle.getBundle("MyProperty");
> >
> > Randy Secrist wrote:
> >
> > >Hello,
> > >
> > >This is probably a very simple question - but I want to have a servlet
> load
> > >a PropertyResourceBundle and am having problems getting TC to find the
> > >resource...
> > >
> > >I want to do this:
> > >props = (PropertyResourceBundle)
> > >PropertyResourceBundle.getBundle("SystemConfig");
> > >
> > >I have tried moving the properties file into the WEB-INF/classes,
> > >COMMON/classes, packaging it with my webapp.jar, and dropping it in
> > >COMMON/lib, and WEB-INF/lib...  I even moved it into bootstrap.jar
since
> > >that is apparently the System classpath TC uses.  Still no luck...
> > >
> > >Everytime I get a java.util.MissingResourceException
> > >
> > >What am I doing wrong?
> > >
> > >Randy
> > >
> > >
> > >--
> > >To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> > >For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> > >
> > >
> > >
> > >
> > >
> >
> > --
> >
> > Randie V. Ursal
> > Design Engineering Department
> > NEC Telecom Software Philippines, Inc.
> > office : +63(032) 233-9142 (loc.3119)
> > mobile : +63(0917) 467-8244
> > email  : [EMAIL PROTECTED]
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> >
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Re: PropertyResourceBundle problems

2002-08-27 Thread Randy Secrist

I did copy the props file to the web-inf/classes - however TC still doesn't
know what to do with it...


- Original Message -
From: "randie ursal" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Tuesday, August 27, 2002 9:05 PM
Subject: Re: PropertyResourceBundle problems


> i have that same problem, and i solve it through the efforts of some
> people on this
> list.
>
> i just place my property file on WEB-INF/classes of my web
> application...that's it
> everything works fine now. =)...no need to place it on other repositories.
>
> this is my code in reading the property file:
>ResourceBundle oRes = PropertyResourceBundle.getBundle("MyProperty");
>
> Randy Secrist wrote:
>
> >Hello,
> >
> >This is probably a very simple question - but I want to have a servlet
load
> >a PropertyResourceBundle and am having problems getting TC to find the
> >resource...
> >
> >I want to do this:
> >props = (PropertyResourceBundle)
> >PropertyResourceBundle.getBundle("SystemConfig");
> >
> >I have tried moving the properties file into the WEB-INF/classes,
> >COMMON/classes, packaging it with my webapp.jar, and dropping it in
> >COMMON/lib, and WEB-INF/lib...  I even moved it into bootstrap.jar since
> >that is apparently the System classpath TC uses.  Still no luck...
> >
> >Everytime I get a java.util.MissingResourceException
> >
> >What am I doing wrong?
> >
> >Randy
> >
> >
> >--
> >To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> >For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
> >
> >
> >
> >
> >
>
> --
>
> Randie V. Ursal
> Design Engineering Department
> NEC Telecom Software Philippines, Inc.
> office : +63(032) 233-9142 (loc.3119)
> mobile : +63(0917) 467-8244
> email  : [EMAIL PROTECTED]
>
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Re: PropertyResourceBundle problems

2002-08-27 Thread randie ursal

i have that same problem, and i solve it through the efforts of some 
people on this
list.  

i just place my property file on WEB-INF/classes of my web 
application...that's it
everything works fine now. =)...no need to place it on other repositories.

this is my code in reading the property file:
   ResourceBundle oRes = PropertyResourceBundle.getBundle("MyProperty");

Randy Secrist wrote:

>Hello,
>
>This is probably a very simple question - but I want to have a servlet load
>a PropertyResourceBundle and am having problems getting TC to find the
>resource...
>
>I want to do this:
>props = (PropertyResourceBundle)
>PropertyResourceBundle.getBundle("SystemConfig");
>
>I have tried moving the properties file into the WEB-INF/classes,
>COMMON/classes, packaging it with my webapp.jar, and dropping it in
>COMMON/lib, and WEB-INF/lib...  I even moved it into bootstrap.jar since
>that is apparently the System classpath TC uses.  Still no luck...
>
>Everytime I get a java.util.MissingResourceException
>
>What am I doing wrong?
>
>Randy
>
>
>--
>To unsubscribe, e-mail:   
>For additional commands, e-mail: 
>
>
>
>  
>

-- 
  
Randie V. Ursal
Design Engineering Department
NEC Telecom Software Philippines, Inc.
office : +63(032) 233-9142 (loc.3119)
mobile : +63(0917) 467-8244
email  : [EMAIL PROTECTED]



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




PropertyResourceBundle problems

2002-08-27 Thread Randy Secrist

Hello,

This is probably a very simple question - but I want to have a servlet load
a PropertyResourceBundle and am having problems getting TC to find the
resource...

I want to do this:
props = (PropertyResourceBundle)
PropertyResourceBundle.getBundle("SystemConfig");

I have tried moving the properties file into the WEB-INF/classes,
COMMON/classes, packaging it with my webapp.jar, and dropping it in
COMMON/lib, and WEB-INF/lib...  I even moved it into bootstrap.jar since
that is apparently the System classpath TC uses.  Still no luck...

Everytime I get a java.util.MissingResourceException

What am I doing wrong?

Randy


--
To unsubscribe, e-mail:   
For additional commands, e-mail: