Re: tomcat 6 - setting classpath

2009-07-19 Thread Wesley Acheson
We ran into an exact same problem.  Our workarround hack classpath.bat and
classpath.sh works perfectly.

I also considered running down the ClassLoader route.  That also works but
it felt more wrong.

I was just going to ask what the accepted way of doing this was but I think
I've got my answer.

Regards,

Wesley Acheson

On Wed, Jun 17, 2009 at 8:38 PM, Christopher Schultz 
ch...@christopherschultz.net wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Tom,

 On 6/17/2009 7:43 AM, Tom Brown wrote:
  it is only configuration files - no jar changes.

 If your code uses getResourceAsStream(), then the classpath will be
 checked. The webapp's classpath will essentially be
 WEB-INF/classes:WEB-INF/lib:CATALINA_BASE/lib:JAVA_HOME/rt.jar

 So, putting your configuration files in CATALINA_BASE/lib should do it,
 unless you have those same configuration files in WEB-INF/classes (or a
 JAR in WEB-INF/lib) already, which it sounds like you /do/.

 Mikolaj's suggestion of using a custom classloader might be your only
 option, unless you can change your code to load the configuration files
 from a pre-defined location (or, even better, from a location specified
 in web.xml!).

 Note that your first solution was to modify web.xml which would, in
 turn, modify the WAR file. So, how was that one going to work?

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.9 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

 iEYEARECAAYFAko5OBoACgkQ9CaO5/Lv0PA7rQCgv2gBTk/RCpeRXFjSFX1VzJ4G
 WVsAn1cxUNlzZgDaFvvM1cTwz5oTPry3
 =y0/Y
 -END PGP SIGNATURE-

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




tomcat 6 - setting classpath

2009-06-17 Thread Tom Brown

Hi

On tomcat 6.0.18 i need to set the classpath of a webapp, its the only 
webapp running inside this tomcat.


i believe i need to do something like the following in the web.xml

context-param
param-nameclasspath/param-name
param-value/my/webapp/conf/param-value
/context-param

but this seems ignored so can anyone point me to the syntax of what this 
is and where to put it ?


thanks

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: tomcat 6 - setting classpath

2009-06-17 Thread Mikolaj Rydzewski

Tom Brown wrote:
On tomcat 6.0.18 i need to set the classpath of a webapp, its the only 
webapp running inside this tomcat.


i believe i need to do something like the following in the web.xml

context-param
param-nameclasspath/param-name
param-value/my/webapp/conf/param-value
/context-param

but this seems ignored so can anyone point me to the syntax of what 
this is and where to put it ?

Why not use WEB-INF/lib directory?

--
Mikolaj Rydzewski m...@ceti.pl


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: tomcat 6 - setting classpath

2009-06-17 Thread Tom Brown



Why not use WEB-INF/lib directory?


quite a long story BUT that locations contains _default_ setting ie 
those for dev and when it goes into prod i need to override those with 
settings from the config directory - so i need to be able to manipulate 
it on the fly so to speak while still being able to use the same war.


hope that helps explain a little


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: tomcat 6 - setting classpath

2009-06-17 Thread Mikolaj Rydzewski

Tom Brown wrote:

Why not use WEB-INF/lib directory?


quite a long story BUT that locations contains _default_ setting ie 
those for dev and when it goes into prod i need to override those with 
settings from the config directory - so i need to be able to 
manipulate it on the fly so to speak while still being able to use the 
same war.
Is the difference only between configuration files, or between jar files 
also?
I suggest to keep such configuration file outside of webapp - e.g. in 
${tomcat}/lib/classes. So you'll have dev tomcat setup, prod tomcat 
setup and one war file.


--
Mikolaj Rydzewski m...@ceti.pl



smime.p7s
Description: S/MIME Cryptographic Signature


Re: tomcat 6 - setting classpath

2009-06-17 Thread Tom Brown


Is the difference only between configuration files, or between jar 
files also?
I suggest to keep such configuration file outside of webapp - e.g. in 
${tomcat}/lib/classes. So you'll have dev tomcat setup, prod tomcat 
setup and one war file.




it is only configuration files - no jar changes. I am trying to get 
these stripped from the war but thats a difficult process, i know i can 
do it in about 5 seconds but its a 'process' thing and then the war is 
'different'


Is what i am asking not possible?



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: tomcat 6 - setting classpath

2009-06-17 Thread Mikolaj Rydzewski

Tom Brown wrote:
it is only configuration files - no jar changes. I am trying to get 
these stripped from the war but thats a difficult process, i know i 
can do it in about 5 seconds but its a 'process' thing and then the 
war is 'different'


Is what i am asking not possible?
One can nest Loader component inside a Contex one. Your custom Loader 
component could use different class loading mechanism. I have never 
tried it, and I doubt it's worth your time. It's better to process your 
'process' and change the way war file is built ;-)


http://tomcat.apache.org/tomcat-6.0-doc/config/context.html
http://tomcat.apache.org/tomcat-6.0-doc/config/loader.html


--
Mikolaj Rydzewski m...@ceti.pl



smime.p7s
Description: S/MIME Cryptographic Signature


Re: tomcat 6 - setting classpath

2009-06-17 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Tom,

On 6/17/2009 7:43 AM, Tom Brown wrote:
 it is only configuration files - no jar changes.

If your code uses getResourceAsStream(), then the classpath will be
checked. The webapp's classpath will essentially be
WEB-INF/classes:WEB-INF/lib:CATALINA_BASE/lib:JAVA_HOME/rt.jar

So, putting your configuration files in CATALINA_BASE/lib should do it,
unless you have those same configuration files in WEB-INF/classes (or a
JAR in WEB-INF/lib) already, which it sounds like you /do/.

Mikolaj's suggestion of using a custom classloader might be your only
option, unless you can change your code to load the configuration files
from a pre-defined location (or, even better, from a location specified
in web.xml!).

Note that your first solution was to modify web.xml which would, in
turn, modify the WAR file. So, how was that one going to work?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAko5OBoACgkQ9CaO5/Lv0PA7rQCgv2gBTk/RCpeRXFjSFX1VzJ4G
WVsAn1cxUNlzZgDaFvvM1cTwz5oTPry3
=y0/Y
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org