Re: Tomcat 6.0 CLASSPATH query

2012-12-09 Thread Pid *
On 8 Dec 2012, at 20:57, vicky007aggar...@yahoo.co.in
vicky007aggar...@yahoo.co.in wrote:

 Thanks Mark

 Sorry for the confusion i created related to my requirements.
 5 Out of 6  requirements you stated below are correct. The last point i.e 
 $CATALINA_BASE is writable. I can manipulate/write files to this location.
 So now do you have anything more to add to your proposed solution as you 
 suggested below

1. Please stop top-posting.
2. Put your resources in CATALINA_BASE/lib


p







 Thanks,
 Vicky



 On Dec 9, 2012, at 2:09 AM, Mark Eggers its_toas...@yahoo.com wrote:

 See at the end for a truly spectacularly bad potential solution. Note that I 
 have not tried this, so your mileage may vary.

 On 12/8/2012 11:51 AM, vicky wrote:
 Thanks Mark for your valuable suggestions.

 But in my project i have a requirement to share one
 resource/properties file  across 10 applications deployed on single
 tomcat instance

 We cannot afford to add the same properties file to all archives as
 its contents keep changing.

 Another restriction which i have is that i cannot place any file
 under $CATALINA_HOME directories , these are read only for us.

 Based on afore said concerns, do you have any better way out ..please
 suggest.

 Appreciated all of your help

 Thanks for ur time Vicky


  From: Mark Eggers
 its_toas...@yahoo.com To: Tomcat Users List
 users@tomcat.apache.org Sent: Sunday, 9 December 2012 12:23 AM
 Subject: Re: Tomcat 6.0 CLASSPATH query

 Comments inline below (a bit fuzzy from the move yet).

 On 12/8/2012 9:58 AM, vicky wrote:

 I have read the Tomcat 6.0 classloader documentation(below link),
 from this what i understood is that the
 classes/jar/resource/properties file get loaded  from the
 following locations

 1.Bootstrap classes of your JVM  ($JAVA_HOME/jre/lib/ext).
 2.System class loader classes  ( Add bootstrap.jar 
 tomcat-juli.jar to CLASSPATH variable) 3.Common class loader
 classes ( refers $CATALINA_BASE/lib   $CATALINA_HOME/lib )  uses
 $CATALINA_BASE/conf/catalina.properties 4. /WEB-INF/classes of
 your web application 5. /WEB-INF/lib/*.jar of your web application

 The thing which is still puzzling me is that how my
 resource/properties files get loaded to Tomcat CLASSPATH when i
 add them to $CATALINA_BASE/bin directory  When i move the same
 files to $CATALINA_BASE/conf directory then it doesn't get added to
 Tomcat CLASSPATH.

 My deployed applications needproperties/resource files , Can
 someone please help me in understand the optimal way of adding
 these files to Tomcat CLASSPATH. Does placing the files under
 CATALINA_BASE/bin is the right approach.Please suggest

 Why in the world are you adding these resource files to Tomcat's
 CLASSPATH? If the resources are application - specific, you don't
 need to do this at all.

 Just add the files to your local application. In Maven, there's a
 special directory for that:

 src/main/resources

 In NetBeans, I normally create a separate package for all of my
 configuration files.

 I think in Eclipse you'll have to make a subdirectory under
 WEB-INF/classes and copy the files there. That's unpleasant. Eclipse
 will include that in the build of the WAR file when you do an
 export.

 Then, just do the following in your code to reference the resource.

 InputStream in =
 this.getClass().getClassLoader().getResourceAsStream(configfile);

 Where configfile is the complete classpath to your resource.

 This is nice. It works in exploded WARs, it works in WAR files, it
 works in JARs.

 No mucking about with CLASSPATH. No polluting other applications or
 Tomcat with spurious application - specific resources. This enables
 you to run several copies of the same web application in the same
 container, all with different configurations.

 Just search for getResourceAsStream() for more explanation.

 In my organisation i cannot add anything to $CATALINA_HOME/lib or
 bin location ,these are read only directories

 http://tomcat.apache.org/tomcat-6.0-doc/class-loader-howto.html
 Thanks for your help Vicky

 Not needed.



  From: Pid * p...@pidster.com To:
 Tomcat Users List users@tomcat.apache.org Sent: Saturday, 8
 December 2012 10:34 PM Subject: Re: Tomcat 6.0 CLASSPATH query

 On 8 Dec 2012, at 03:29, vicky007aggar...@yahoo.co.in
 vicky007aggar...@yahoo.co.in wrote:

 Application is deployed under tomcat webapps directory . It
 tries to refer to application specific properties file from
 tomcat classpath, for that we copied it under tomcat bin
 directory.

 My query is that does this is the right way to add properties
 file to tomcat classpath?

 Did you try putting it in tomcat/lib?


 p





 Thanks for ur help, Vicky



 On Dec 8, 2012, at 2:11 AM, Christopher Schultz
 ch...@christopherschultz.net wrote:

 -BEGIN PGP SIGNED MESSAGE- Hash: SHA256

 Vicky,

 On 12/7/12 11:48 AM, vicky wrote:
 I have a requirement in which i need to add couple of
 properties files 

Re: Tomcat 6.0 CLASSPATH query

2012-12-09 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Pid,

On 12/8/12 12:04 PM, Pid * wrote:
 On 8 Dec 2012, at 03:29, vicky007aggar...@yahoo.co.in 
 vicky007aggar...@yahoo.co.in wrote:
 
 Application is deployed under tomcat webapps directory . It tries
 to refer to application specific properties file from tomcat
 classpath, for that we copied it under tomcat bin directory.
 
 My query is that does this is the right way to add properties
 file to tomcat classpath?
 
 Did you try putting it in tomcat/lib?

Better yet: did you try putting it in WEB-INF/classes? That's where it
*should* be.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iEYEAREIAAYFAlDEwd4ACgkQ9CaO5/Lv0PCWDwCgqOtUlVhyWeZMrWqI99GMVpsj
daoAnR6K97x0tjVOm2q1hKAPzcuSFnrP
=I4EZ
-END PGP SIGNATURE-

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



Re: Tomcat 6.0 CLASSPATH query

2012-12-09 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Pid,

On 12/9/12 4:31 AM, Pid * wrote:
 On 8 Dec 2012, at 20:57, vicky007aggar...@yahoo.co.in 
 vicky007aggar...@yahoo.co.in wrote:
 
 Thanks Mark
 
 Sorry for the confusion i created related to my requirements. 5
 Out of 6  requirements you stated below are correct. The last
 point i.e $CATALINA_BASE is writable. I can manipulate/write
 files to this location. So now do you have anything more to add
 to your proposed solution as you suggested below
 
 1. Please stop top-posting. 2. Put your resources in
 CATALINA_BASE/lib

Another option is to use a VirtualClassLoader and add some random path
(/etc/myawesomewebapps/) to it in all webapps.

Honestly, I think there are better ways to load shared configuration
than trying to share a .properties file on the disk.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iEYEAREIAAYFAlDEwocACgkQ9CaO5/Lv0PDc7gCfUvtH3K16UuRR/PlRzjfeMYin
jbcAoMB15SHyQq/MDRnwr7Ws8CpWoY6h
=E9GV
-END PGP SIGNATURE-

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



Re: PSI-PROBE query

2012-12-09 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Vicky,

On 12/9/12 7:05 AM, vicky wrote:
 I am trying to gather statistical information about the number of 
 requests served by my tomcat (forwarded from Apache MPM worker) 
 for this i am using /PSI-PRobe
 (http://code.google.com/p/psi-probe/) application. I have enclosed
 the PROBE screenshot as well for your reference,

Sorry, this list strips attachments. Please copy/paste the numbers
into a followup post.

 in this Request Time , Processing Time  values  for  http-8080
  connector are keep on increasing even when no one is accessing
 the application.

Are you sure nobody is accessing the application? Do you have an
AccessLogValve (or Filter) enabled?

 I am wondering how can i get the report of number of requests which
 all are served by my tomcat instance, i am not able to relate to
 the numbers which all are getting displayed in the Probe
 Application. Does i am doing something wrong in interpreting the
 Probe Application output

If you want to know which requests are taking a long time, configure
(or re-configure) an AccessLogValve to include the total time for the
request. Then sort your log file by response-time and start at the
longest response to see what's going on.

Psi Probe likely uses JMX (or maybe gets the data directly from Tomcat
in the same way that the JMX beans get their data), so all that same
data is available the JMX. Attach to Tomcat using jconsole, jvisualvm,
etc. and poke around: there's a lot of good information in there.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iEYEAREIAAYFAlDEw2kACgkQ9CaO5/Lv0PCrswCgh1e7HpCS7uLtr9jiq9Qg+q1Y
7EQAn2+z7X/0mEBdzL5nZazdJh/D4SAh
=1U+/
-END PGP SIGNATURE-

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



Re: Word.Applicaiton acvivex components tomcat Windows 7

2012-12-09 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Jan,

On 12/7/12 6:06 PM, Jan Kostelansky wrote:
 I am experiencing problems running vb script under tomcat.
 
 [...]
 
 I created servlet which does precisely the same as simple java
 program.

If it's on the server side, there are a whole bunch of issues you
could be encountering. Please post the Java code you are using to
launch the script on the server.

 If I run servlet in tomcat7 under Win XP - everything is fine
 
 If I run servlet in tomcat7 under Win 7 64 bit - program stops
 when Word.Applicaiton ActiveX component opens docx document.

Do you mean that the thread blocks and you never get a response from
Tomcat? You are probably not managing your streams -- or the
underlying process -- properly.

Or, André's suggestion is right that Microsoft Office has lots of
failure modes when running under a Service.

 This is not tomcat error precisely as it works on XP. I have a
 feeling enhanced Windows7 security causes this issues.

Possibly. Are there any log messages (catalina.log, etc.) or error
events in the Windows event viewer?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iEYEAREIAAYFAlDExJoACgkQ9CaO5/Lv0PBb1gCfXepZI+bWDYSfJbB1Ruv5ugmk
L4sAn3n58QoDhCsfGolXlRSfRa/DYbwa
=Fs9b
-END PGP SIGNATURE-

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



Re: Tomcat 6.0 CLASSPATH query

2012-12-09 Thread Mark Eggers
Reply is inline. Please do not top post. I had to read your response and 
then scroll to the bottom to remember what I wrote.

On 12/8/2012 12:57 PM, vicky007aggar...@yahoo.co.in wrote:

Thanks Mark

Sorry for the confusion i created related to my requirements. 5 Out
of 6  requirements you stated below are correct. The last point i.e
$CATALINA_BASE is writable. I can manipulate/write files to this
location. So now do you have anything more to add to your proposed
solution as you suggested below



Thanks, Vicky



Make a directory under $CATALINA_BASE. Call it Resources. Then add in 
$CATALINA_BASE/bin/setenv.sh something like the following:


CLASSPATH=$CATALINA_BASE/Resouces/your-resource.jar
export CLASSPATH

Again, I've not done this so who knows if it will work.

As Chris and I (and others) have said, these resources really belong in 
WEB-INF/classes. I have described how you can include those in your 
build environment.


I understand that you have 10 web applications and the configuration 
files change frequently. At that point, if you don't want to 
continuously bounce your web applications (or Tomcat), I would look at 
an alternative way for reading resources. I suggested a database and JNDI.


. . . . just my two cents
/mde/



On Dec 9, 2012, at 2:09 AM, Mark Eggers its_toas...@yahoo.com
wrote:


See at the end for a truly spectacularly bad potential solution.
Note that I have not tried this, so your mileage may vary.

On 12/8/2012 11:51 AM, vicky wrote:

Thanks Mark for your valuable suggestions.

But in my project i have a requirement to share one
resource/properties file  across 10 applications deployed on
single tomcat instance

We cannot afford to add the same properties file to all archives
as its contents keep changing.

Another restriction which i have is that i cannot place any file
under $CATALINA_HOME directories , these are read only for us.

Based on afore said concerns, do you have any better way out
..please suggest.

Appreciated all of your help

Thanks for ur time Vicky


 From: Mark Eggers
its_toas...@yahoo.com To: Tomcat Users List
users@tomcat.apache.org Sent: Sunday, 9 December 2012 12:23 AM
Subject: Re: Tomcat 6.0 CLASSPATH query

Comments inline below (a bit fuzzy from the move yet).

On 12/8/2012 9:58 AM, vicky wrote:


I have read the Tomcat 6.0 classloader documentation(below
link), from this what i understood is that the
classes/jar/resource/properties file get loaded  from the
following locations

1.Bootstrap classes of your JVM  ($JAVA_HOME/jre/lib/ext).
2.System class loader classes  ( Add bootstrap.jar 
tomcat-juli.jar to CLASSPATH variable) 3.Common class loader
classes ( refers $CATALINA_BASE/lib   $CATALINA_HOME/lib ) 
uses $CATALINA_BASE/conf/catalina.properties 4.
/WEB-INF/classes of your web application 5. /WEB-INF/lib/*.jar
of your web application

The thing which is still puzzling me is that how my
resource/properties files get loaded to Tomcat CLASSPATH when
i add them to $CATALINA_BASE/bin directory  When i move the
same files to $CATALINA_BASE/conf directory then it doesn't get
added to Tomcat CLASSPATH.

My deployed applications needproperties/resource files , Can
someone please help me in understand the optimal way of adding
these files to Tomcat CLASSPATH. Does placing the files under
CATALINA_BASE/bin is the right approach.Please suggest


Why in the world are you adding these resource files to Tomcat's
CLASSPATH? If the resources are application - specific, you
don't need to do this at all.

Just add the files to your local application. In Maven, there's
a special directory for that:

src/main/resources

In NetBeans, I normally create a separate package for all of my
configuration files.

I think in Eclipse you'll have to make a subdirectory under
WEB-INF/classes and copy the files there. That's unpleasant.
Eclipse will include that in the build of the WAR file when you
do an export.

Then, just do the following in your code to reference the
resource.

InputStream in =
this.getClass().getClassLoader().getResourceAsStream(configfile);




Where configfile is the complete classpath to your resource.


This is nice. It works in exploded WARs, it works in WAR files,
it works in JARs.

No mucking about with CLASSPATH. No polluting other applications
or Tomcat with spurious application - specific resources. This
enables you to run several copies of the same web application in
the same container, all with different configurations.

Just search for getResourceAsStream() for more explanation.


In my organisation i cannot add anything to $CATALINA_HOME/lib
or bin location ,these are read only directories

http://tomcat.apache.org/tomcat-6.0-doc/class-loader-howto.html



Thanks for your help Vicky


Not needed.




 From: Pid * p...@pidster.com
To: Tomcat Users List users@tomcat.apache.org Sent: Saturday,
8 December 2012 10:34 PM Subject: Re: Tomcat 6.0 CLASSPATH
query

On 8 Dec 2012, at 03:29, 

Re: Tomcat 6.0 CLASSPATH query

2012-12-09 Thread Mark Eggers

On 12/9/2012 8:55 AM, Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Pid,

On 12/9/12 4:31 AM, Pid * wrote:

On 8 Dec 2012, at 20:57, vicky007aggar...@yahoo.co.in
vicky007aggar...@yahoo.co.in wrote:


Thanks Mark

Sorry for the confusion i created related to my requirements. 5
Out of 6  requirements you stated below are correct. The last
point i.e $CATALINA_BASE is writable. I can manipulate/write
files to this location. So now do you have anything more to add
to your proposed solution as you suggested below


1. Please stop top-posting. 2. Put your resources in
CATALINA_BASE/lib


Another option is to use a VirtualClassLoader and add some random path
(/etc/myawesomewebapps/) to it in all webapps.



That's only available in Tomcat 7, yes?


Honestly, I think there are better ways to load shared configuration
than trying to share a .properties file on the disk.



+1



- -chris


/mde/

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



Re: PSI-PROBE query

2012-12-09 Thread vicky
Yes Chris, i am pretty sure that nobody is accessing the application.

The moment i start my Tomcat the Request Count  reaches values of 400+ within 
few seconds, this value is getting incremented by 6 everytime (eg: 
6,12,18,24,30)

Whereas my AJP Connector Request Count  is showing the correct numbers 
depending  on the requests which all are redirected from APache.

As of now i have not configured the AccessLogValve , but will try out this 
option definitely

Please suggest 

Thanks
Vicky



 From: Christopher Schultz ch...@christopherschultz.net
To: Tomcat Users List users@tomcat.apache.org 
Sent: Sunday, 9 December 2012 10:29 PM
Subject: Re: PSI-PROBE query
 
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Vicky,

On 12/9/12 7:05 AM, vicky wrote:
 I am trying to gather statistical information about the number of 
 requests served by my tomcat (forwarded from Apache MPM worker) 
 for this i am using /PSI-PRobe
 (http://code.google.com/p/psi-probe/) application. I have enclosed
 the PROBE screenshot as well for your reference,

Sorry, this list strips attachments. Please copy/paste the numbers
into a followup post.

 in this Request Time , Processing Time  values  for  http-8080
  connector are keep on increasing even when no one is accessing
 the application.

Are you sure nobody is accessing the application? Do you have an
AccessLogValve (or Filter) enabled?

 I am wondering how can i get the report of number of requests which
 all are served by my tomcat instance, i am not able to relate to
 the numbers which all are getting displayed in the Probe
 Application. Does i am doing something wrong in interpreting the
 Probe Application output

If you want to know which requests are taking a long time, configure
(or re-configure) an AccessLogValve to include the total time for the
request. Then sort your log file by response-time and start at the
longest response to see what's going on.

Psi Probe likely uses JMX (or maybe gets the data directly from Tomcat
in the same way that the JMX beans get their data), so all that same
data is available the JMX. Attach to Tomcat using jconsole, jvisualvm,
etc. and poke around: there's a lot of good information in there.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iEYEAREIAAYFAlDEw2kACgkQ9CaO5/Lv0PCrswCgh1e7HpCS7uLtr9jiq9Qg+q1Y
7EQAn2+z7X/0mEBdzL5nZazdJh/D4SAh
=1U+/
-END PGP SIGNATURE-

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

Re: Tomcat 6.0 CLASSPATH query

2012-12-09 Thread vicky


Thanks MARK/CHRIS  for all earnest replies, i really owe you guys for your 
replies.

Exporting CLASSPATH wont work ad i believe that Tomcat catalina.sh  will 
ignore it.

Anyway i am able to fetch the resource/properties file  contents  if i place 
in $CATALINA_BASE/bin directory.

Actually i read the documentation but no where its been written that by  adding 
resource files to $CATALINA_BASE/bin , tomcat will make them available in its 
CLASSPATH

This is weird for me to understand, if you have any thoughts on 
this behavior then please share  else we can close this email thread

Thanks,
VIcky



 From: Mark Eggers its_toas...@yahoo.com
To: Tomcat Users List users@tomcat.apache.org 
Sent: Sunday, 9 December 2012 10:43 PM
Subject: Re: Tomcat 6.0 CLASSPATH query
 
Reply is inline. Please do not top post. I had to read your response and 
then scroll to the bottom to remember what I wrote.
On 12/8/2012 12:57 PM, vicky007aggar...@yahoo.co.in wrote:
 Thanks Mark

 Sorry for the confusion i created related to my requirements. 5 Out
 of 6  requirements you stated below are correct. The last point i.e
 $CATALINA_BASE is writable. I can manipulate/write files to this
 location. So now do you have anything more to add to your proposed
 solution as you suggested below



 Thanks, Vicky


Make a directory under $CATALINA_BASE. Call it Resources. Then add in 
$CATALINA_BASE/bin/setenv.sh something like the following:

CLASSPATH=$CATALINA_BASE/Resouces/your-resource.jar
export CLASSPATH

Again, I've not done this so who knows if it will work.

As Chris and I (and others) have said, these resources really belong in 
WEB-INF/classes. I have described how you can include those in your 
build environment.

I understand that you have 10 web applications and the configuration 
files change frequently. At that point, if you don't want to 
continuously bounce your web applications (or Tomcat), I would look at 
an alternative way for reading resources. I suggested a database and JNDI.

. . . . just my two cents
/mde/


 On Dec 9, 2012, at 2:09 AM, Mark Eggers its_toas...@yahoo.com
 wrote:

 See at the end for a truly spectacularly bad potential solution.
 Note that I have not tried this, so your mileage may vary.

 On 12/8/2012 11:51 AM, vicky wrote:
 Thanks Mark for your valuable suggestions.

 But in my project i have a requirement to share one
 resource/properties file  across 10 applications deployed on
 single tomcat instance

 We cannot afford to add the same properties file to all archives
 as its contents keep changing.

 Another restriction which i have is that i cannot place any file
 under $CATALINA_HOME directories , these are read only for us.

 Based on afore said concerns, do you have any better way out
 ..please suggest.

 Appreciated all of your help

 Thanks for ur time Vicky


  From: Mark Eggers
 its_toas...@yahoo.com To: Tomcat Users List
 users@tomcat.apache.org Sent: Sunday, 9 December 2012 12:23 AM
 Subject: Re: Tomcat 6.0 CLASSPATH query

 Comments inline below (a bit fuzzy from the move yet).

 On 12/8/2012 9:58 AM, vicky wrote:

 I have read the Tomcat 6.0 classloader documentation(below
 link), from this what i understood is that the
 classes/jar/resource/properties file get loaded  from the
 following locations

 1.Bootstrap classes of your JVM  ($JAVA_HOME/jre/lib/ext).
 2.System class loader classes  ( Add bootstrap.jar 
 tomcat-juli.jar to CLASSPATH variable) 3.Common class loader
 classes ( refers $CATALINA_BASE/lib   $CATALINA_HOME/lib ) 
 uses $CATALINA_BASE/conf/catalina.properties 4.
 /WEB-INF/classes of your web application 5. /WEB-INF/lib/*.jar
 of your web application

 The thing which is still puzzling me is that how my
 resource/properties files get loaded to Tomcat CLASSPATH when
 i add them to $CATALINA_BASE/bin directory  When i move the
 same files to $CATALINA_BASE/conf directory then it doesn't get
 added to Tomcat CLASSPATH.

 My deployed applications needproperties/resource files , Can
 someone please help me in understand the optimal way of adding
 these files to Tomcat CLASSPATH. Does placing the files under
 CATALINA_BASE/bin is the right approach.Please suggest

 Why in the world are you adding these resource files to Tomcat's
 CLASSPATH? If the resources are application - specific, you
 don't need to do this at all.

 Just add the files to your local application. In Maven, there's
 a special directory for that:

 src/main/resources

 In NetBeans, I normally create a separate package for all of my
 configuration files.

 I think in Eclipse you'll have to make a subdirectory under
 WEB-INF/classes and copy the files there. That's unpleasant.
 Eclipse will include that in the build of the WAR file when you
 do an export.

 Then, just do the following in your code to reference the
 resource.

 InputStream in =
 this.getClass().getClassLoader().getResourceAsStream(configfile);



Where configfile is the complete 

Re: Word.Applicaiton acvivex components tomcat Windows 7

2012-12-09 Thread André Warnier

Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Jan,

On 12/7/12 6:06 PM, Jan Kostelansky wrote:

I am experiencing problems running vb script under tomcat.

[...]

I created servlet which does precisely the same as simple java
program.


If it's on the server side, there are a whole bunch of issues you
could be encountering. Please post the Java code you are using to
launch the script on the server.


If I run servlet in tomcat7 under Win XP - everything is fine

If I run servlet in tomcat7 under Win 7 64 bit - program stops
when Word.Applicaiton ActiveX component opens docx document.


Do you mean that the thread blocks and you never get a response from
Tomcat? You are probably not managing your streams -- or the
underlying process -- properly.

Or, André's suggestion is right that Microsoft Office has lots of
failure modes when running under a Service.


This is not tomcat error precisely as it works on XP. I have a
feeling enhanced Windows7 security causes this issues.


Possibly. Are there any log messages (catalina.log, etc.) or error
events in the Windows event viewer?

From personal experience : it has not much to do with Windows 7 security, rather more 
with the slightly different way in which Windows 7 runs services, as compared to XP.
There will probably not be any error in the logs of Tomcat (apart maybe from an error 
related to the bad end of the process).  The errors will happen in the MS-Office software 
itself, and will typically be of the types listed in the MS article earlier mentioned.



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



RE: Tomcat 6.0 CLASSPATH query

2012-12-09 Thread Caldarale, Charles R
 From: Mark Eggers [mailto:its_toas...@yahoo.com] 
 Subject: Re: Tomcat 6.0 CLASSPATH query

  Another option is to use a VirtualClassLoader and add some random path
  (/etc/myawesomewebapps/) to it in all webapps.

 That's only available in Tomcat 7, yes?

Presumably, Chris was referring to VirtualWebappLoader, which has been 
available in Tomcat for ages.  However, it wasn't properly documented until 
Tomcat 7.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


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



Re: Is it possible to expire jvmRoute cookie

2012-12-09 Thread Konstantin Kolinko
2012/12/7 Christopher Schultz ch...@christopherschultz.net:
 On 12/7/12 4:16 AM, André Warnier wrote:
 Williams, Nick wrote:
 -Original Message- From: Christopher Schultz
 (...)

 Earlier somebody (I'm sorry, I already deleted the email)
 suggested Tomcat returning a 308 or 309 or similar to the load
 balancer to trigger a re-balance if the session is expired. I
 think this is the best idea I've heard yet, solves the problem
 elegantly and simply, and seems (relatively) easy to achieve
 (this coming from someone who has no knowledge of the code used
 by mod_jk/isapi_redirector).


 I must admit that this sounds more elegant (and efficient) than my
 suggested interceptor module.

 Alternatively, if one wanted to avoid touching mod_jk for this,
 maybe tomcat could return a 302 redirect to the starting page of
 this application, if known ? (without jsessionid.jvmroute of
 course).

 That's definitely an idea worth pursuing: an expired session id could
 return 302 *and* strip the jsessionid path parameter *and* send a
 Set-Cookie JSESSIONID; expiration=0 header (which deletes the cookie).
 The client would re-try and the balancer would re-balance.

 Konstantin, what do you think? Obviously, this shouldn't be the
 default operation of Tomcat, but perhaps a setting that could be
 enabled on the session manager?


If anybody want to experiment with such a feature,
it is easy to write your own Filter or Valve that implements this.

Something like
if (request.getSession(false) == null 
request.getRequestedSessionId() != null) {
response.sendRedirect(...);
return;
}

Things to be cautious
1. Different web applications may have different session ids. When a
browser sends us the session id cookie, there is no indication to what
web application it belongs.

2. I would check the value of request.getMethod().

3. I would do nothing if jvmRoute in requested session id belongs to a
different server.
See also  org.apache.catalina.ha.session.JvmRouteBinderValve,
http://tomcat.apache.org/tomcat-7.0-doc/config/cluster-valve.html


Best regards,
Konstantin Kolinko

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



Re: Tomcat 6.0 CLASSPATH query

2012-12-09 Thread Mark Eggers

On 12/9/2012 12:26 PM, Caldarale, Charles R wrote:

From: Mark Eggers [mailto:its_toas...@yahoo.com]
Subject: Re: Tomcat 6.0 CLASSPATH query



Another option is to use a VirtualClassLoader and add some random path
(/etc/myawesomewebapps/) to it in all webapps.



That's only available in Tomcat 7, yes?


Presumably, Chris was referring to VirtualWebappLoader, which has been 
available in Tomcat for ages.  However, it wasn't properly documented until 
Tomcat 7.

  - Chuck


I found the docs for Tomcat 7, and didn't see them for Tomcat 6. I 
should have trawled through the source (still getting settled after the 
move).


I suppose I could look at the source, pattern the docs off of those from 
Tomcat 7, and submit a patch.


. . . . just my two cents
/mde/


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



Re: Tomcat 6.0 CLASSPATH query

2012-12-09 Thread Pid *
On 9 Dec 2012, at 16:58, Christopher Schultz
ch...@christopherschultz.net wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

 Pid,

 On 12/9/12 4:31 AM, Pid * wrote:
 On 8 Dec 2012, at 20:57, vicky007aggar...@yahoo.co.in
 vicky007aggar...@yahoo.co.in wrote:

 Thanks Mark

 Sorry for the confusion i created related to my requirements. 5
 Out of 6  requirements you stated below are correct. The last
 point i.e $CATALINA_BASE is writable. I can manipulate/write
 files to this location. So now do you have anything more to add
 to your proposed solution as you suggested below

 1. Please stop top-posting. 2. Put your resources in
 CATALINA_BASE/lib

 Another option is to use a VirtualClassLoader and add some random path
 (/etc/myawesomewebapps/) to it in all webapps.

 Honestly, I think there are better ways to load shared configuration
 than trying to share a .properties file on the disk.

If the OP is able to edit files in CATALINA_BASE/lib, then editing
catalina.properties and appending a fixed path to common.loader in
each instance would also work.


p


 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
 Comment: GPGTools - http://gpgtools.org
 Comment: Using GnuPG with undefined - http://www.enigmail.net/

 iEYEAREIAAYFAlDEwocACgkQ9CaO5/Lv0PDc7gCfUvtH3K16UuRR/PlRzjfeMYin
 jbcAoMB15SHyQq/MDRnwr7Ws8CpWoY6h
 =E9GV
 -END PGP SIGNATURE-

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


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