How to perform a forced reload of Tomcat ?

2003-06-28 Thread Antony
Hi,
I am using Tomcat 4.1.18 , j2sdk 1.4.1, win2k. It is a remote server
physical access is very limited. I am using it as the development server.
Two developers are using the same server. The problem is if by mistake the
enter key or the refresh key is kept preseed or if a database lock is
engaged Tomcat will  stop responding. Actullay Tomcat is running. The
browser reports web site found waiting for  reply. But no page
displayed.If I try to reload the page through Tomcat manager app it also
hangs. No response from Tomcat. In such situations how to force a reload by
killing all the threads ?. I have a setting of minProcessors=2
maxProcessors=20 in the server.xml.

Antony.

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



How to catch the error of jsp:useBean tag.

2003-06-28 Thread Antony
Hi,
How to catch the error if it is caused by jsp:useBean tag ?. I am
getting an error on the tag. The error message prints
org.apache.jasper.JasperException: name of class. No Error details. How to
deal with such errors ?

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



Tomcat Web Application Manager + static variables

2003-06-28 Thread Marcin
Hello,
 
 I have a question about Tomcat Web Application Manager.
Suppose I have static member in a simple class
 
public class xxx {
 public static yyy zzz = new yyy();
}
 
 I load my web application and everything is fine. But
when I reload my whole application using Tomcat
Web Application Manager zzz contains the same instance
of yyy as before reloading. Is it a bug of TWAM?
 
Best regards
 
 Martin Sielski

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



Re: Tomcat Web Application Manager + static variables

2003-06-28 Thread Tim Funk
Search for Singleton in the archives.

Do you mean the /manager/ webapp? It doesn't hold on to instances of 
anything. (AFAIK)

For singletons to work correctly -  make sure the classese live under 
WEB-INF/[lib|classes]. Each webapp has hits own classloader. On a reload, the 
old classloader is dumped and a new one is made. But the archives have many 
converstations about Singletons sounds similar to your issue.

-Tim

Marcin wrote:
Hello,
 
 I have a question about Tomcat Web Application Manager.
Suppose I have static member in a simple class
 
public class xxx {
 public static yyy zzz = new yyy();
}
 
 I load my web application and everything is fine. But
when I reload my whole application using Tomcat
Web Application Manager zzz contains the same instance
of yyy as before reloading. Is it a bug of TWAM?
 
Best regards
 
 Martin Sielski
 


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


Re: Client Certificates Authentication in Tomcat v4.1.24

2003-06-28 Thread Dean Thompson
Hi Bill  Everyone else,

 For JSSE, you need to have the signer in cacerts at the moment for
 Tomcat to include it in the list of signers it wants.  PureTLS allows
 you to configure the list (without being root), but other problems
 mean that you can only use it in TC 5 HEAD at the moment.

 Of course, the Tomcat support for CLIENT-CERT is pretty minimal at the
 moment.  Only the (deprecated) MemoryRealm supports it (unless you
 write your own Realm).
Thanks for the information regarding the cacerts file and JSSE.  After 
checking the configuration, I discovered that I was missing the cacerts 
file and have installed it into the proper directory under the 
$JAVA_HOME/lib/security directory hierarchy.

Unfortunately, this didn't change anything, as IE is still popping up a 
blank box for me to select my certificate.  Does the CA certificate 
have to belong to any particular alias for JSSE to work.  I have tried 
installing it as -trustcacerts and a normal import into the alias 
root and tomcat without any success.

You don't need to do anything special to get the root CA into the 
keystore do you ?, I am simply taking the CA certificate as a .pem along 
with the key, converting them to .der and then doing an import.

Do you happen to have any more ideas as to what is happening here or how 
I might be able to resolve it ?, I am quite happy to send a copy of the 
commands I am using off the list so that you can see the process that I 
am going through.

Thanks in advance.

Dean Thompson

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


Re: Tomcat on Linux HOWTO

2003-06-28 Thread Chong Yu Meng
Michael Cardon wrote:

I have compiled a HOWTO using Linux 8.0, Tomcat 4.1.24, and mod_jk2.

I hope this will help some people.

I would also like to hear from anyone with any suggestion on how I could
improve the setup I've done. I'm always learning
Thanks.

http://www.cardon.biz/docs/tomcat/

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


 

Hi Michael !

I can't seem to get to your site. I'm always getting a time-out.

Regards,
pascal chong




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


Re: Tomcat Web Application Manager + static variables

2003-06-28 Thread Marcin
Hi,

 Do you mean the /manager/ webapp?

Yes

 It doesn't hold on to instances of
 anything. (AFAIK)

GC didn't release that resource.

 Each webapp has hits own classloader. On a reload, the
 old classloader is dumped and a new one is made. But the archives have
many
 converstations about Singletons sounds similar to your issue.

Yes, thanks a lot. I found appropriate thread.

Best regards

Marcin Sielski


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



Re: Deploying a WAR

2003-06-28 Thread Dirk Strauss
Hi, Christian

WAR-Files just contain Webapps (ok, almost :P). They don't need to be 
started like you tried.

IMHO you have a war file called orange.war which contains all possible 
files you need AND A WEB-INF directory? Then you can simply start it by 
typing the name of the war file at the end of the url.

Assume you have a url like http://vredungmand.dk/programming/orange/. In 
the orange directory you have copied the war file? Then this is your url:

http://vredungmand.dk/programming/orange/orange

This should invoke Tomcat to unpack the war file, create within the 
orange directory a new directory orange and unpack any files from the 
war file into this directory. TC should present your welcome page you 
have defined in web.xml in orange/WEB-INF/ after that.

Oh yes, I almost forgot: in TC's server.xml your Host declaration 
should contain the parameter unpackWARs=true. And within the Host 
section you shouldn't have a Context declaration for that directory/webapp.

Best regards

Dirk

Christian Hvid wrote:
Hi.

I am trying to deploy a WAR using the Tomcat Manager but I keep getting 
FAIL - Invalid application URL ... was specified. regardless of what I 
type in WAR URL:

http://vredungmand.dk/programming/orange/orange.war
http://vredungmand.dk:80/programming/orange/orange.war
jar:http://vredungmand.dk:/programming/orange/orange.war!
file:/users/chvid/orange/orange.war
jar:file:/users/chvid/orange/orange.war!
etc. etc.

What am I doing wrong?

I am using MacOSX and Tomcat 4.1.12 but I can't get it to work on my 
Windows box either.

-- Christian

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



smime.p7s
Description: S/MIME Cryptographic Signature


invalid direct reference to form login page...

2003-06-28 Thread Brian Kuhn
Hi all,

I've set up Tomcat (4.1.24) to do form based authentication.  Everything 
works great, except I've had to deal with a lot of users that type in the 
url I've given them, get redirected to the login page, and bookmark the 
login page before logging in.  Later, when they use the bookmark, they get 
sent to the login page, but get a Invalid direct reference to form login 
page... message once they log in.

I understand why this happens, but don't know what to do about it.  Is there 
a way to specify a default page to go to when the login page is requested 
directly?

Thanks,
 Brian Kuhn
 Telscape Communications



Brian Kuhn
[EMAIL PROTECTED]

_
The new MSN 8: smart spam protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail

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


RE: invalid direct reference to form login page...

2003-06-28 Thread Stefan Radzom
Your problem has just recently been discussed on this list. Ben Jessel
proposed a workaround which I attached below. Hopefully, this might work for
you.

Stefan


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
 Sent: Friday, June 27, 2003 1:42 PM
 To: [EMAIL PROTECTED]
 Subject: Possible workaround for invalid direct reference to 
 login page
 
 
 Java Authentication with tomcat relies on realms. If you 
 access a page 
 protected by that realm you get directed to the login page.
 However, it is possible to go directly to the login page ( 
 this can happen 
 when users bookmark the login page inadvertantly ).
 
 This happens in two scenarios:
 
 1) The user is already logged in.
 2) The user is not logged in.
 
 If you authenticate yourself once you have gone directly to the login 
 page, you get a invalid direct reference error. Fair 
 enough, the login 
 page is trying to redirect to itself. Now, I tried to 
 workaround this by 
 checking if the session is null, and if it is, redirecting to some 
 protected page, eg. protected/index.jsp. No luck. It seems 
 that a session 
 is implicitly created, and a new session id gets created.
 
 So I've tried a cookie strategy:
 
 %
 if ( request.getCookies()==null ) {
 response.sendRedirect(//jsp/protected/index.jsp);
 }
 if ( request.getRemoteUser()!=null )
 {
 response.sendRedirect(/x/jsp/protected/index.jsp);
 }
 %
 
 i.e, we wont have a cookie if we've gone directly to the 
 login page. But 
 we will have if we've tried to access a protected page and 
 then we've been 
 forwarded to a login page, tomcat will give us a cookie.
 
 Now if we're already logged in ( which we check with 
 getRemoteUser() , 
 then we just forward to user to an index page. 
 
 This seems o.k. However my index page actually includes my 
 login page! I'm 
 planning to get around this with some logic that only 
 includes the login 
 page excerpt if we are not logged in..
 
 Ben
 


 -Original Message-
 From: Brian Kuhn [mailto:[EMAIL PROTECTED] 
 Sent: Sunday, June 29, 2003 1:16 AM
 To: [EMAIL PROTECTED]
 Subject: invalid direct reference to form login page...
 
 
 Hi all,
 
 I've set up Tomcat (4.1.24) to do form based authentication.  
 Everything 
 works great, except I've had to deal with a lot of users that 
 type in the 
 url I've given them, get redirected to the login page, and 
 bookmark the 
 login page before logging in.  Later, when they use the 
 bookmark, they get 
 sent to the login page, but get a Invalid direct reference 
 to form login 
 page... message once they log in.
 
 I understand why this happens, but don't know what to do 
 about it.  Is there 
 a way to specify a default page to go to when the login page 
 is requested 
 directly?
 
 Thanks,
   Brian Kuhn
   Telscape Communications
 
 
 
 
 
 Brian Kuhn
 [EMAIL PROTECTED]
 
 
 _
 The new MSN 8: smart spam protection and 2 months FREE*  
 http://join.msn.com/?page=features/junkmail
 
 
 -
 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]



Tomcat Installation/Configuration using Ant

2003-06-28 Thread Sushil Sureka
Hello,

I am trying to write an Ant Script that would allow me to install Tomcat using an Ant 
script. The reason I am planning to do this is because it will allow me to control the 
set up of different program through Ant and automatically configure them.

Now When I looked at the tomcat installer program, it has number of options in terms 
of what packages you wanted to install. I am wondering is it documented somehere (or 
can I find out from somewhere) on what this install options(Tomcat, JSP Development 
Shell Extension, Tomcat Documenation, Example Web Application) maps to in terms of 
directories so that I can control this from my Ant scripts.

Also, I am assuming the port info, login info the installer asks get put into 
server.xml file. Is that correct.

Any help in this regard would be appreciated

thanks
Sushil

Re: multiuser setup: please help

2003-06-28 Thread Neil Zanella

On Fri, 27 Jun 2003, John Turner wrote:

 
 I don't use this feature, but a couple of things come to mind:
 
 - does the user account that Tomcat uses have read permissions to those 
 directories?

I am not sure what user accound Tomcat uses, probably the root account 
since I installed it as root (it came with Sun One Studio JDK), but in
any case the answer is YES because:

$ ls -ld ~joedoe
drwx--x--x   57 joedoe  joedoe  16384 Jun 28 20:14 /home/joedoe
$ ls -ld ~joedoe/public_html
drwxrwxr-x5 joedoe  joedoe  4096 Jun 28 20:13 /home/joedoe/public_html
$ ls -ld ~joedoe/public_html/index.html
-rw-rw-r--1 joedoe  joedoe  218 Jun 28 20:12 
/home/joedoe/public_html/index.html

and I can view the file with mozilla while connecting to plain Apache on
the standard HTTP port 80, however...

 - NOTHING under WEB-INF is ever directly accessible, both WEB-INF and META- 
 INF are protected resources as far as tomcat is concerned.  I'm not sure 
 what you're expecting with the URLs you posted.

Yes, this is correct, things unsed WEB-INF JSP 2.2 standard directory 
should not be directly accessible according to the documentation, but
the directory it rests in should be...

 The test to see if it is working is to put index.html in 
 ~johndoe/public_html and then try to access it by 
 http://localhost:8080/~johndoe or http://localhost:8080/~johndoe/index.html 

THIS IS THE PROBLEM. I cannot see anything when I access:

http://localhost:8080/~johndoe/index.html

but I can access:

http://localhost/~johndoe/index.html

and have restarted tomcat successfully after editing
the $CATALINA_HOME/conf/server.xml file so that it
has the following lines:

 Host

!-- snip --

Listener className=org.apache.catalina.startup.UserConfig
  directoryName=public_html
  userClass=org.apache.catalina.startup.PasswdUserDatabase/

  /Host

Any ideas of why it is not working. I have followed the directions
haven't I. Could it be I need a newer version of Tomcat than the
one distributed with Sun One Studio (which is 4.0.1)? But Tomcat
does not complain about the XML, so it should be recognizing it?

Thank you for your help,

Neil

 
 After that, anything else you have to do would have to follow the standard 
 app deployment rules, such as having servlets defined in web.xml or using 
 the invoker, defining welcome pages in web.xml, etc.
 
 HTH
 
 John
  On Fri, 27 Jun 2003 00:24:40 -0230 (NDT), Neil Zanella 
 [EMAIL PROTECTED] wrote:
 
 
  Thank you for your suggestion. I am using Tomcat 4.0.1 and I realize
  that the same applies to Tomcat 4.0:
 
  http://jakarta.apache.org/tomcat/tomcat-4.0- 
  doc/config/defaultcontext.html
 
  I have read the User Web Applications section and done as described:
 
  I added the XML entity and attributes given by:
 
  Listener className=org.apache.catalina.startup.UserConfig
  directoryName=public_html
  userClass=org.apache.catalina.startup.PasswdUserDatabase/
 
  inside the Host entity in the server.xml file. I added these at the very
  end of the entity. I also created user readable files:
 
  ~johndoe/public_html/contextroot/WEB-INF/web.xml
  ~johndoe/public_html/contextroot/WEB-INF/classes
  ~johndoe/public_html/contextroot/WEB-INF/classes/JohnDoe.class
 
  and also tried
 
  ~johndoe/public_html/webapps/contextroot/WEB-INF/web.xml
  ~johndoe/public_html/webapps/contextroot/WEB-INF/classes
  ~johndoe/public_html/webapps/contextroot/WEB-INF/classes/JohnDoe.class
 
  as well as:
 
  ~johndoe/public_html/WEB-INF/web.xml
  ~johndoe/public_html/WEB-INF/classes
  ~johndoe/public_html/WEB-INF/classes/JohnDoe.class
 
  but I get a 404 HTTP response (file not found) each
  time I point my browser to:
 
  http://localhost:8080/~johndoe/contextroot/webappjohndoe
  http://localhost:8080/~johndoe/webappjohndoe
 
  Furthermore, each time I have a directory called 
  ~johndoe/public_html/WEB-INF and restart the server,
  I get a 404 when I access:
 
  http://localhost:8080/~johndoe
 
  whereas in the other cases I get a directory listing.
 
  The documentation states:
 
  Each user web application will be deployed with characteristics 
  established by any DefaultContext element you have configured
  for this Host.
 
  Does this have anything to do with it? I am puzzled by why
  my servlet is not displaying.
 
  Once again, thank you for your help!!!
 
  Neil
 
  On Thu, 26 Jun 2003, John Turner wrote:
 
 
  http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/host.html
 
  The section marked User Web Applications should be what you want.
 
  John
 
  On Thu, 26 Jun 2003 09:17:33 -0230 (NDT), Neil Zanella 
  [EMAIL PROTECTED] wrote:
 
  
   Hello,
  
   I have successfully setup Tomcat but now I want the following:
  
   Suppose some Linux based system has a dynamic and constantly changing
   number of users ranging in the thousands. I would like to set up
   tomcat so that:
  
   Each user gets a context root in a directory such as:
   

Re: multiuser setup: please help

2003-06-28 Thread Neil Zanella

Thanks John! All I had to do was upgrade my Tomcat installation from
the 4.0.1 version which comes with Java Sun One Studio (and is still
being distributed at the Java site, huh!) to Tomcat 4.1.24, which at
least is a stable release!

I don't know why Java is still distributing 
j2sdk-1_4_1_02-s1studio_ce-4u1-bin-linux.bin
with Tomcat 4.0.1. They should make a new
release with the updated Tomcat version
(or not distribute Tomcat at all and
encourage users to download the
latest)!

Neil

On Sat, 28 Jun 2003, Neil Zanella wrote:

  The test to see if it is working is to put index.html in 
  ~johndoe/public_html and then try to access it by 
  http://localhost:8080/~johndoe or http://localhost:8080/~johndoe/index.html 
 
 THIS IS THE PROBLEM. I cannot see anything when I access:
 
 http://localhost:8080/~johndoe/index.html
 
 Any ideas of why it is not working. I have followed the directions
 haven't I. Could it be I need a newer version of Tomcat than the
 one distributed with Sun One Studio (which is 4.0.1)? But Tomcat
 does not complain about the XML, so it should be recognizing it?
  
   I added the XML entity and attributes given by:
  
   Listener className=org.apache.catalina.startup.UserConfig
   directoryName=public_html
   userClass=org.apache.catalina.startup.PasswdUserDatabase/


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