Re: transport CONFIDENTIAL based on remote ip/host filter?

2012-06-04 Thread Timothy J Schumacher

On 5/31/2012 1:30 PM, Konstantin Kolinko wrote:

2012/5/31 Timothy J Schumachertim.schumac...@colorado.edu:

Hi,

We are using Apache Tomcat 6.0.35

with

# java -version
java version 1.6.0_30
Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
Java HotSpot(TM) Client VM (build 20.5-b03, mixed mode, sharing)

in redhat linux.

I am wondering if there is a way to use transport CONFIDENTIAL for all hosts
that are not localhost?  I am guessing the servlet spec does not allow this,
it seems to be all or none in the web.xml config.  Perhaps there is a way
configure transport NONE in web.xml and then manually configure a
valve/filter in context.xml that would enforce CONFIDENTIAL to all remote
hosts but let localhost pass without redirects to port 443?

Any ideas are appreciated!


Connector ... address=127.0.0.1 secure=true /

It will
1. Listen on localhost only.
2. Be treated by Tomcat as if it were an HTTPS connection.


Hi Konstantine, thanks this works!  I have one more question.  I assume 
that setting secure=true means that the cookie JSESSIONID has Secure 
set.  This causes my browser (an old version of FF) to not send the 
cookie which I assume is due to the fact that the communication is over 
a plain http connection.  Since we have not diligently coded encodeURLs 
everywhere the application loses the session on occasion.  Is there a 
way to tell the component that sets the cookie to not set Secure only 
for this particular connector?


Thanks again!
Tim

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



Re: transport CONFIDENTIAL based on remote ip/host filter?

2012-06-04 Thread Timothy J Schumacher

See inline comments below.


Thanks again for your time!
Tim

On 6/4/2012 2:35 PM, Konstantin Kolinko wrote:

2012/6/4 Timothy J Schumachertim.schumac...@colorado.edu:

On 5/31/2012 1:30 PM, Konstantin Kolinko wrote:

2012/5/31 Timothy J Schumachertim.schumac...@colorado.edu:

Hi,

We are using Apache Tomcat 6.0.35

with

# java -version
java version 1.6.0_30
Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
Java HotSpot(TM) Client VM (build 20.5-b03, mixed mode, sharing)

in redhat linux.

I am wondering if there is a way to use transport CONFIDENTIAL for all
hosts
that are not localhost?  I am guessing the servlet spec does not allow
this,
it seems to be all or none in the web.xml config.  Perhaps there is a way
configure transport NONE in web.xml and then manually configure a
valve/filter in context.xml that would enforce CONFIDENTIAL to all remote
hosts but let localhost pass without redirects to port 443?

Any ideas are appreciated!


Connector ... address=127.0.0.1 secure=true /

It will
1. Listen on localhost only.
2. Be treated by Tomcat as if it were an HTTPS connection.


Hi Konstantine, thanks this works!  I have one more question.  I assume that
setting secure=true means that the cookie JSESSIONID has Secure set.
  This causes my browser (an old version of FF) to not send the cookie which
I assume is due to the fact that the communication is over a plain http
connection.  Since we have not diligently coded encodeURLs everywhere the
application loses the session on occasion.  Is there a way to tell the
component that sets the cookie to not set Secure only for this particular
connector?


Why do you want to avoid HTTPS so much?


We make a piece of IT equipment with tomcat running inside serving an 
application that acts as the administration console for the device.  
There is also a firefox browser running inside the equipment that 
exposes the web application in question on the front panel touchscreen 
of the device.  The device also can be plugged into a network to 
facilitate remote management via the web application.  We run the local 
firefox in kiosk mode, and when the device is powered on, firefox 
prompts the user about security certificate warnings and alerts the user 
when you are about to view encrypted pages and when you are about to 
leave encrypted pages.  On top of that, if the user isn't there to 
accept the warnings/prompts the local browser seems to timeout and 
become unresponsive which requires a restart of firefox.  I have tried 
to get the certificates loaded and setting preferences inside our local 
firefox, but so far have not had success.  We just want the local front 
panel to show the login screen and not prompt/warn the user and I 
suppose the real fix is to learn the proper way to set up the local 
firefox but all attempts at getting this correct have been unsuccessful 
so far.  Since I am more familiar with tomcat and the tomcat 
documentation is easier to follow than the old firefox docs, I thought 
it could be easier to accomplish this by just configuring something that 
makes tomcat treat the local firefox differently.





The recipe that I gave you is usually used in the scenario when Tomcat
is behind a proxy that uses HTTP protocol (instead of AJP one).

That is: a proxy (a.g. Apache HTTPD) does HTTPS, decodes the
connection and forwards request through HTTP.

The secure attribute that I mentioned is similar to proxyHost and
proxyPort connector attributes. It is not there to fool the picture,
but to provide some information to Tomcat that it does not know by
itself.

In that scenario the browser will not have any problems with secure
cookies, because from its side it sees the site through HTTPS.

I think that in your case you can turn off cookies support in browser
and to rely on sessionid being encoded in URLs.  URLs are not a
subject to secure cookies limitation.


I was afraid this could be the answer...  Unfortunately we have not been 
very good about using url encoding in our app and there are lots of jsps 
with lots of links that need to be wrapped with encodeURL calls but that 
is our problem :)  I was just hoping for a big hammer to get it fixed 
in the short term.



I do not remember any option to turn off secure bit in cookies. If
there were one, I think it would be on Context.  If you want to
implement a trick, I think a Valve can affect create session cookie or
set-cookie header, clearing the flag.

I will give the valve idea a try.  That seems promising.


You can look into the code for more details. If you want to try
running Tomcat with a debugger, there are tips in the FAQ, or ask
here.
YMMV.

Best regards,
Konstantin Kolinko

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








-
To unsubscribe, e-mail: 

Re: transport CONFIDENTIAL based on remote ip/host filter?

2012-06-04 Thread Timothy J Schumacher

Comments inline below.

On 6/4/2012 4:18 PM, Konstantin Kolinko wrote:

2012/6/5 Timothy J Schumachertim.schumac...@colorado.edu:

We make a piece of IT equipment with tomcat running inside serving an
application that acts as the administration console for the device.  There
is also a firefox browser running inside the equipment that exposes the web
application in question on the front panel touchscreen of the device.  The
device also can be plugged into a network to facilitate remote management
via the web application.  (...)

Why do you need transport CONFIDENTIAL in your web.xml?  Do you have
some pages that are accessed via HTTP and some that are only HTTPS on
the same Tomcat?  That is when you need HTTP -  HTTPS redirection when
user comes to the protected part.
I think you are right, I do not really need that.  I guess I was really 
just using CONFIDENTIAL to automatically do the redirect to the https 
port for me.  If I want to have http on port 80 still open to remote 
users, what is the best way to automatically respond to all requests on 
http port 80 with a redirect to port 443 without using transport 
CONFIDENTIAL in my web.xml?  This is just a convenience to users who 
forget to put https (like me) when they open up a browser and type in a 
url.  Should I implement a servlet filter that responds to all requests 
on port 80 with the redirect?





If your tomcat serves only administrative console webapp, I think it
could be a more simple configuration:

1) remove transport-guarantee CONFIDENTIAL
2) configure HTTPS connector that is accessible from outside
(either do not specify address - to bind on all of them, or specify
device's public IP)
3) configure HTTP connector with address=127.0.0.1  (no need for
secure=true)

This way the HTTP connector binds on the loopback address only and is
not accessible from outside, regardless of your web.xml.

Yes, this is way better-Thanks!  I guess I wasn't realizing that forcing 
clients to use https implies transport confidential without actually 
configuring transport confidential in the web.xml.



If things are more complicated, you could implement a Filter that does
the same job as transport-guarantee.  The Connector that the client
connects to could be distinguished by ServletRequest.getLocalAddr(),
getLocalPort(), getScheme().

Best regards,
Konstantin Kolinko

-
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



transport CONFIDENTIAL based on remote ip/host filter?

2012-05-31 Thread Timothy J Schumacher

Hi,

We are using Apache Tomcat 6.0.35

with

# java -version
java version 1.6.0_30
Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
Java HotSpot(TM) Client VM (build 20.5-b03, mixed mode, sharing)

in redhat linux.

I am wondering if there is a way to use transport CONFIDENTIAL for all 
hosts that are not localhost?  I am guessing the servlet spec does not 
allow this, it seems to be all or none in the web.xml config.  Perhaps 
there is a way configure transport NONE in web.xml and then manually 
configure a valve/filter in context.xml that would enforce CONFIDENTIAL 
to all remote hosts but let localhost pass without redirects to port 443?


Any ideas are appreciated!

Thanks,
Tim

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



Re: tomcat administration

2010-05-07 Thread Timothy J Schumacher

I would like to give some test application users ability to start  restart
the tomcat server but not the entire admin / manager interface.


Actually this is possible in linux at least, though be very wary... one 
can shell out of java and call things using nohup with run in the 
background (trailing ) or use setsid(), after that the new process is 
not connected to tomcat so it could restart tomcat.  I have done this 
and it works, though it's more academic and I wouldn't recommend writing 
things like that :)


-Tim


testwreq wreq wrote:

I entered the following line user name=ad password=pw
roles=admin,manager / in tomcat-users.xm file. I can login to the admin
http://localhost:8080/admin/ and application manager
http://localhost:8080/manager/html

I would like to give some test application users ability to start  restart
the tomcat server but not the entire admin / manager interface. Is it
possible to configure this?

I am told that when the application (jsp/servelet code) changes, tomcat has
to restart to clear the old cache. Is it true?

My tomcat version is 5.5.23

thanks, vm


On Fri, May 7, 2010 at 9:59 AM, Caldarale, Charles R 
chuck.caldar...@unisys.com wrote:

  

From: testwreq wreq [mailto:testw...@gmail.com]
Subject: tomcat administration

I have a new installation of tomcat on centos. My $CATALINA_HOME is
/usr/share/tomcat5 and tomcat is running.
  

Care to tell us the *exact* version of Tomcat you installed?  And how you
installed it?  (Is it a 3rd-party repackaged version, or a real one from
tomcat.apache.org?)



http://localhost:8080 brings up the tomcat page  one of the option is
Administration.
  

That looks like it comes from a defunct 5.0.x version, which has not been
supported for quite some time now.  Install a current Tomcat from
tomcat.apache.org and try again.



I would like to use this web interface and even give
some of the test webapp users ability to restart tomcat.
  

That's not going to happen, at least not via internal manipulation of
Tomcat.

 - 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





  


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



Re: tomcat administration

2010-05-07 Thread Timothy J Schumacher
Oops, I missed the requirement to keep the admin/manager app up - 
correct, you cannot keep the admin app (or any other app) up while you 
restart tomcat, but you can do a full restart and sit and wait and hope 
your newly created process doesn't crash or hang...


Tim

Pid wrote:

On 07/05/2010 18:20, Timothy J Schumacher wrote:
  

I would like to give some test application users ability to start 
restart
the tomcat server but not the entire admin / manager interface.
  
Actually this is possible in linux at least, though be very wary... 



No, it's clearly not.
You can't keep the admin app up, if the server is down.

  

one
can shell out of java and call things using nohup with run in the
background (trailing ) or use setsid(), after that the new process is
not connected to tomcat so it could restart tomcat.  I have done this
and it works, though it's more academic and I wouldn't recommend writing
things like that :)



You can shoot yourself in the foot too, if you have adequate medical
insurance.


p


  

-Tim


testwreq wreq wrote:


I entered the following line user name=ad password=pw
roles=admin,manager / in tomcat-users.xm file. I can login to the
admin
http://localhost:8080/admin/ and application manager
http://localhost:8080/manager/html

I would like to give some test application users ability to start 
restart
the tomcat server but not the entire admin / manager interface. Is it
possible to configure this?

I am told that when the application (jsp/servelet code) changes,
tomcat has
to restart to clear the old cache. Is it true?

My tomcat version is 5.5.23

thanks, vm


On Fri, May 7, 2010 at 9:59 AM, Caldarale, Charles R 
chuck.caldar...@unisys.com wrote:

 
  

From: testwreq wreq [mailto:testw...@gmail.com]
Subject: tomcat administration

I have a new installation of tomcat on centos. My $CATALINA_HOME is
/usr/share/tomcat5 and tomcat is running.
  
  

Care to tell us the *exact* version of Tomcat you installed?  And how
you
installed it?  (Is it a 3rd-party repackaged version, or a real one from
tomcat.apache.org?)

   


http://localhost:8080 brings up the tomcat page  one of the option is
Administration.
  
  

That looks like it comes from a defunct 5.0.x version, which has not
been
supported for quite some time now.  Install a current Tomcat from
tomcat.apache.org and try again.

   


I would like to use this web interface and even give
some of the test webapp users ability to restart tomcat.
  
  

That's not going to happen, at least not via internal manipulation of
Tomcat.

 - 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




  
  

-
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



Re: Tomcat 6.0.20 always works in GMT timezone even after forcing it to use Asia/Calcutta by multiple methods.

2009-10-15 Thread Timothy J Schumacher

Then how come Tomcat alone can respect the UTC enablement in
/etc/sysconfig/clock?


That is a good question, and not the same as what I observed on my system.  


I guess maybe try removing the timezone line from that file and restart Tomcat 
to see if the clock file is even a player here.  This could just be a wild 
goose chase ;)

-Tim





raghu gs wrote:

Hi Tim

Your suggestion seems interesting to some extent.
One clue i got now is UTC is enabled in /etc/sysconfig/clock file.
Being UTC is enabled is naturally equals to setting GMT as timezone.
Please correct me if i am wrong.

My question is, when i put a normal java code to display the time and
timezone of the system, it just displays the timezone in IST without any
problem.
clock command's output returns the time in IST timezone it self.
Then how come Tomcat alone can respect the UTC enablement in
/etc/sysconfig/clock?

Regards


On Wed, Oct 14, 2009 at 9:37 PM, Timothy J Schumacher 
tim.schumac...@colorado.edu wrote:

  

I'm not sure if it will help with your particular version of java/linux but
I had a similar problem with my java/linux and found that in my case the
file /etc/sysconfig/clock was one of the places the JVM looked for a
timezone.  Setting environment variables and options had no effect, the
thing that worked for me was changing the clock file.  Check
/etc/sysconfig/clock and see what it says, if there is a timezone set in
there try removing it.  It took me quite a while to figure this out, going
to the extreme of writing a play java program and running it with strace and
then I saw that it opened the clock file...
Good luck,
-Tim


raghu gs wrote:



Tomcat is not running under a security manager.
So that policy entry may need to be exists, i understood now.

I have tried stopping our web applications via tomcat-manager and
restarted
important web applications alone.
But still timezone didn't reset to system timezone.

Wouldn't stopping offending web applications enough for the timezone to
use
system configuration?

Is it possible to restrict just timezone over-riding permission from web
application instead of first listing what are all permissions that should
be
granted for a web application?



On Mon, Oct 12, 2009 at 8:32 PM, George Sexton geor...@mhsoftware.com
  

wrote:



  


-Original Message-
From: raghu gs [mailto:iamra...@gmail.com]
Sent: Monday, October 12, 2009 5:18 AM
To: Tomcat Users List
Subject: Re: Tomcat 6.0.20 always works in GMT timezone even after
forcing it to use Asia/Calcutta by multiple methods.

java.util.PropertyPermission user.timezone, write; line not there
in
catalina.policy file.
Should this line not need to be present for granting the pernission?


  

The reference to catalina.policy only applies if you are running under a
security manager. Are you running under a security manager?





What is the code for restricting the timezone overide permission in
catalina.policy file?
Moreover it was misundstanding between our developers,
Nobody said that kernel tomcat mismatch might be the cause of the
problem.
TZData is also up-to-date.

Regards



  

George Sexton
MH Software, Inc.
http://www.mhsoftware.com/
Voice: 303 438 9585


-
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





  


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



Re: Tomcat 6.0.20 always works in GMT timezone even after forcing it to use Asia/Calcutta by multiple methods.

2009-10-15 Thread Timothy J Schumacher
Also, there was some enlightening information about how the JVM decides 
which timezone to use here:


http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6456628

I did not read the java source to verify the description there is 
accurate, but none the less, the description was helpful to me.


Hope this helps,
Tim


Timothy J Schumacher wrote:

Then how come Tomcat alone can respect the UTC enablement in
/etc/sysconfig/clock?


That is a good question, and not the same as what I observed on my 
system. 
I guess maybe try removing the timezone line from that file and 
restart Tomcat to see if the clock file is even a player here.  This 
could just be a wild goose chase ;)


-Tim





raghu gs wrote:

Hi Tim

Your suggestion seems interesting to some extent.
One clue i got now is UTC is enabled in /etc/sysconfig/clock file.
Being UTC is enabled is naturally equals to setting GMT as timezone.
Please correct me if i am wrong.

My question is, when i put a normal java code to display the time and
timezone of the system, it just displays the timezone in IST without any
problem.
clock command's output returns the time in IST timezone it self.
Then how come Tomcat alone can respect the UTC enablement in
/etc/sysconfig/clock?

Regards


On Wed, Oct 14, 2009 at 9:37 PM, Timothy J Schumacher 
tim.schumac...@colorado.edu wrote:

 
I'm not sure if it will help with your particular version of 
java/linux but
I had a similar problem with my java/linux and found that in my case 
the

file /etc/sysconfig/clock was one of the places the JVM looked for a
timezone.  Setting environment variables and options had no effect, the
thing that worked for me was changing the clock file.  Check
/etc/sysconfig/clock and see what it says, if there is a timezone 
set in
there try removing it.  It took me quite a while to figure this out, 
going
to the extreme of writing a play java program and running it with 
strace and

then I saw that it opened the clock file...
Good luck,
-Tim


raghu gs wrote:

   

Tomcat is not running under a security manager.
So that policy entry may need to be exists, i understood now.

I have tried stopping our web applications via tomcat-manager and
restarted
important web applications alone.
But still timezone didn't reset to system timezone.

Wouldn't stopping offending web applications enough for the 
timezone to

use
system configuration?

Is it possible to restrict just timezone over-riding permission 
from web
application instead of first listing what are all permissions that 
should

be
granted for a web application?



On Mon, Oct 12, 2009 at 8:32 PM, George Sexton geor...@mhsoftware.com
 

wrote:



 
   

-Original Message-
From: raghu gs [mailto:iamra...@gmail.com]
Sent: Monday, October 12, 2009 5:18 AM
To: Tomcat Users List
Subject: Re: Tomcat 6.0.20 always works in GMT timezone even after
forcing it to use Asia/Calcutta by multiple methods.

java.util.PropertyPermission user.timezone, write; line not 
there

in
catalina.policy file.
Should this line not need to be present for granting the pernission?


  
The reference to catalina.policy only applies if you are running 
under a

security manager. Are you running under a security manager?



   

What is the code for restricting the timezone overide permission in
catalina.policy file?
Moreover it was misundstanding between our developers,
Nobody said that kernel tomcat mismatch might be the cause of the
problem.
TZData is also up-to-date.

Regards



  

George Sexton
MH Software, Inc.
http://www.mhsoftware.com/
Voice: 303 438 9585


-
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





  


-
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



Re: Tomcat 6.0.20 always works in GMT timezone even after forcing it to use Asia/Calcutta by multiple methods.

2009-10-14 Thread Timothy J Schumacher
I'm not sure if it will help with your particular version of java/linux 
but I had a similar problem with my java/linux and found that in my case 
the file /etc/sysconfig/clock was one of the places the JVM looked for a 
timezone.  Setting environment variables and options had no effect, the 
thing that worked for me was changing the clock file.  Check 
/etc/sysconfig/clock and see what it says, if there is a timezone set in 
there try removing it.  It took me quite a while to figure this out, 
going to the extreme of writing a play java program and running it with 
strace and then I saw that it opened the clock file... 


Good luck,
-Tim

raghu gs wrote:

Tomcat is not running under a security manager.
So that policy entry may need to be exists, i understood now.

I have tried stopping our web applications via tomcat-manager and restarted
important web applications alone.
But still timezone didn't reset to system timezone.

Wouldn't stopping offending web applications enough for the timezone to use
system configuration?

Is it possible to restrict just timezone over-riding permission from web
application instead of first listing what are all permissions that should be
granted for a web application?



On Mon, Oct 12, 2009 at 8:32 PM, George Sexton geor...@mhsoftware.comwrote:

  


-Original Message-
From: raghu gs [mailto:iamra...@gmail.com]
Sent: Monday, October 12, 2009 5:18 AM
To: Tomcat Users List
Subject: Re: Tomcat 6.0.20 always works in GMT timezone even after
forcing it to use Asia/Calcutta by multiple methods.

java.util.PropertyPermission user.timezone, write; line not there
in
catalina.policy file.
Should this line not need to be present for granting the pernission?
  

The reference to catalina.policy only applies if you are running under a
security manager. Are you running under a security manager?



What is the code for restricting the timezone overide permission in
catalina.policy file?
Moreover it was misundstanding between our developers,
Nobody said that kernel tomcat mismatch might be the cause of the
problem.
TZData is also up-to-date.

Regards

  

George Sexton
MH Software, Inc.
http://www.mhsoftware.com/
Voice: 303 438 9585


-
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



How do I modify a UserDatabase Resource from my webapp?

2009-08-18 Thread Timothy J Schumacher

Hi,

I am using Tomcat 5.5.27 and java 1.5 on an old redhat Linux machine.

I have a UserDatabase Resource and a UserDatabaseRealm set up in 
server.xml and logins are working as expected.  I exposed my Resource 
under name=UserDatabase.  In my webapp code I tried invoking an 
operation using an MBean server and I get a ClassNotFound 
org.apache.catalina.mbeans.UserMBean exception.  I am guessing this is 
because that particular class is in the server classloader and not in my 
app's classloader?  Is there a way to accomplish this from a 
non-privileged app? 

Does there exist an example somewhere that I missed of a webapp that 
manages it's own users.xml?


Thanks!
Tim

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



migration to 5.5.27

2009-08-05 Thread Timothy J Schumacher

Hi,

I am currently running tomcat 5.0.12 and want to upgrade to 5.5.27.  I 
also have java 1.4 running on an old version of linux (redhat 7.3) and I 
have installed the compatibility package in my tomcat home directory.  I 
can start and stop the server just fine.


The trouble I am running into is in precompiling my jsp's.  I use ant 
1.6.1 and I edited my build.xml to change the jasper2 task to point to 
the new version of TC. 

Upon running my jspcompile task in ant I get a bunch of errors (I 
suspect these have something to do with log4j?).  It looks like every 
jsp produces one of these:


 [jasper2] java.util.zip.ZipException: error in opening zip file
 [jasper2] at java.util.zip.ZipFile.open(Native Method)
 [jasper2] at java.util.zip.ZipFile.init(ZipFile.java:112)
 [jasper2] at java.util.zip.ZipFile.init(ZipFile.java:128)
 [jasper2] at 
org.apache.tools.ant.AntClassLoader.getResourceURL(AntClassLoader.java:903)
 [jasper2] at 
org.apache.tools.ant.AntClassLoader$ResourceEnumeration.findNextResource(AntClassLoader.java:126)
 [jasper2] at 
org.apache.tools.ant.AntClassLoader$ResourceEnumeration.init(AntClassLoader.java:88)
 [jasper2] at 
org.apache.tools.ant.AntClassLoader.findResources(AntClassLoader.java:869)

 [jasper2] at java.lang.ClassLoader.getResources(ClassLoader.java:812)
 [jasper2] at java.lang.ClassLoader.getResources(ClassLoader.java:808)
 [jasper2] at 
org.apache.commons.logging.LogFactory$4.run(LogFactory.java:1388)
 [jasper2] at java.security.AccessController.doPrivileged(Native 
Method)

...

and with ant -v i get lines that look like this:
Ignoring Exception java.util.zip.ZipException: error in opening zip file 
reading resource org/apache/log4j/Logger.class from 
/home/tschumacher/sandbox/XMan/Build/classes/SynchronizedQueue.class


It looks like ant needs log4j but when I added it to the classpath for 
my jasper task it seemed to make no difference.  I also tried ant -lib 
path-to-log4j jspcompile and I get a warning about not having 
configured a logger but same errors...   


Thanks!
Tim


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



Re: Newline doesn't work

2009-03-18 Thread Timothy J Schumacher

Try

If this is going to be displayed by a browser then try:

String newline = br;

-Tim

Mighty Tornado wrote:

Silly question.
I wrote a servlet that gets init params from the web.xml and stuffs them
into the request which is the displayed by JSP.

But when I try to make it a string with newline characters it still prints
everything in one line - like newline characters turn into regular space
characters.

This is the code:

String newline = System.getProperty(line.separator);

String rName = getServletConfig().getInitParameter(rName);

String kName = getServletConfig().getInitParameter(kName);

result += Family Members + newline;

result += rName + newline;

result += kName + newline;


I tried \n, and '\n' as well.


Thanks.

  


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



Re: access to all sessions

2008-12-10 Thread Timothy J Schumacher

Hi Leon,

How bad of an idea is it to set privileged=true in my context?  Wouldn't 
this give me access to the things I want (and much more that I probably 
don't want access to)?  Our environment is such that maybe this isn't 
totally out of the question, we run TC in a piece of hardware to serve 
content to the attached touchscreen.  There is only ever one webapp 
running, ROOT, and that is really all that will ever be running.


Tim

Leon Rosenberg wrote:

It depends on your definition of easier...
you could provide your own session manager with your own session
implementation, which supports such a mechanism or patch the existing
StandartSession.java. I don't know whether you'd call it easy :-)
Leon



On Thu, Dec 4, 2008 at 8:09 PM, Timothy J Schumacher
[EMAIL PROTECTED] wrote:
  

Hi Leon,

Thanks for the info.  So, if I simply wanted to tell TC to invalidate all
sessions is there something easier I could do?

Tim

Leon Rosenberg wrote:


Hello Tim,

there is no easy and direct way to do it. What you can do is to create
a SessionListener

(http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpSessionListener.html),
register it as listener in the web.xml and store references to the
sessions upon creation somewhere (read map).
But beware, you have to be cautious a) not to create a memory leak by
not letting tomcat to remove outdated sessions and b) synchronize
accesses to your map and sessions without creating dead locks (since
1.4 doesn't have all the fancy concurrency stuff).

regards
Leon

On Thu, Dec 4, 2008 at 7:32 PM, Timothy J Schumacher
[EMAIL PROTECTED] wrote:

  

Hi,

I have TC 5.0.12 and java 1.4.1_04.  Unfortunately, I am stuck using
these
versions for now...

I am trying to figure out how to access/manipulate all the sessions for
my
web app.  I guess I want something similar to the manager application,
but I
don't want to have to run the manager application.  Does anyone know of a
good reference to learn more about how this works?  I looked a little bit
at
the docs but it was not clear to me how to access this data.

Thanks!
Tim



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





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


  

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





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

  


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



multiple copies of jar files

2008-12-09 Thread Timothy J Schumacher

Hi All,

TC 5.0.12
java version 1.4.1_04

I have inherited a project that has multiple copies of some jar files 
under $CATALINA_HOME.  In particular the one I noticed first was


$CATALINA_HOME/server/lib/catalina.jar
$CATALINA_HOME/shared/lib/catalina.jar

I am under the impression that having multiple copies of the same jar 
file is not ever a good thing!


There are some others but I am curious - do these really belong in 
server or shared?   Does anyone know where these are supposed to live?


I also saw from the tomcat website this:

Therefore, from the perspective of a web application, class or resource 
loading looks in the following repositories, in this order:


   * Bootstrap classes of your JVM
   * System class loader classses (described above)
   * //WEB-INF/classes/ of your web application
   * //WEB-INF/lib/*.jar/ of your web application
   * /$CATALINA_HOME/common/classes/
   * /$CATALINA_HOME/common/endorsed/*.jar/
   * /$CATALINA_HOME/common/i18n/*.jar/
   * /$CATALINA_HOME/common/lib/*.jar/
   * /$CATALINA_BASE/shared/classes/
   * /$CATALINA_BASE/shared/lib/*.jar/


If an application wants to use a class from catalina.jar, does that mean 
catalina.jar needs to be deleted from server/lib and placed in 
shared/lib?  Or is that not even possible by design?


Thanks again!
Tim


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



access to all sessions

2008-12-04 Thread Timothy J Schumacher

Hi,

I have TC 5.0.12 and java 1.4.1_04.  Unfortunately, I am stuck using 
these versions for now...


I am trying to figure out how to access/manipulate all the sessions for 
my web app.  I guess I want something similar to the manager 
application, but I don't want to have to run the manager application.  
Does anyone know of a good reference to learn more about how this 
works?  I looked a little bit at the docs but it was not clear to me how 
to access this data.


Thanks!
Tim



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



Re: access to all sessions

2008-12-04 Thread Timothy J Schumacher

Hi Leon,

Thanks for the info.  So, if I simply wanted to tell TC to invalidate 
all sessions is there something easier I could do?


Tim

Leon Rosenberg wrote:

Hello Tim,

there is no easy and direct way to do it. What you can do is to create
a SessionListener
(http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpSessionListener.html),
register it as listener in the web.xml and store references to the
sessions upon creation somewhere (read map).
But beware, you have to be cautious a) not to create a memory leak by
not letting tomcat to remove outdated sessions and b) synchronize
accesses to your map and sessions without creating dead locks (since
1.4 doesn't have all the fancy concurrency stuff).

regards
Leon

On Thu, Dec 4, 2008 at 7:32 PM, Timothy J Schumacher
[EMAIL PROTECTED] wrote:
  

Hi,

I have TC 5.0.12 and java 1.4.1_04.  Unfortunately, I am stuck using these
versions for now...

I am trying to figure out how to access/manipulate all the sessions for my
web app.  I guess I want something similar to the manager application, but I
don't want to have to run the manager application.  Does anyone know of a
good reference to learn more about how this works?  I looked a little bit at
the docs but it was not clear to me how to access this data.

Thanks!
Tim



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





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

  


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