Tomcat 4.1 JSPC not recongnizing change in compile time included file

2004-03-04 Thread Nathan Christiansen
I am running Tomcat 4.1.24.

In nearly all JSP files in my webapp I have the following compile time
include:

%@ include file=main.jsp%

However, changes to main.jsp are not caught by JSPC. And only the
main_jsp.java source is changed. If I delete all the *_jsp.java files
and recompile all of the JSP files, it works perfectly.

Anyone have any suggestions?



I am using ant 1.5.3 with the following task segment in my build file:

jspc destdir=${jspc.src.jsp.dir} 
  webinc=${jspc.base.dir}/fragment.xml 
  package=jsp 
  compiler=jasper41
  classpath
fileset dir=${publish.common.lib.dir}
  include name=ant.jar/
  include name=jasper-compiler.jar/
  include name=jasper-runtime.jar/
  include name=servlet.jar/
/fileset
pathelement path=${build.dir}/
  /classpath
  webapp basedir=${deploy.dir}/
/jspc


I even tried calling JSPC directly using the task fragment described in
the Tomcat 4.1 documentation:

  taskdef classname=org.apache.jasper.JspC name=jasper2  
classpath id=jspc.classpath 
  pathelement location=${java.home}/../lib/tools.jar/ 
  fileset dir=${tomcat.server.lib.dir} 
include name=*.jar/ 
  /fileset 
  fileset dir=${publish.common.lib.dir} 
include name=*.jar/ 
  /fileset 
/classpath 
  /taskdef 

  jasper2 
   validateXml=false 
   package=jsp
   uriroot=${deploy.dir} 
   webXmlFragment=${jspc.base.dir}/fragment.xml 
   outputDir=${jspc.src.jsp.dir} /


-- Nathan Christiansen
   Software Engineer
   Tahitian Noni International
   http://www.tahitiannoni.com



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



RE: Tomcat 4.1 JSPC not recongnizing change in compile time included file

2004-03-04 Thread Nathan Christiansen
Unfortunately I need to use the static include. (It defines methods and
objects that most of my JSP pages use.)

If Jasper 2 can handle detection of static includes at run-time, why
can't JSPC?

From the Tomcat 4.1 documentation:
(http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jasper-howto.html)

Recompile JSP when included page changes - Jasper 2 can now detect when
a page included at compile time from a JSP has changed and then
recompile the parent JSP.


-- Nathan Christiansen


 -Original Message-
 From: Filip Hanik (lists) [mailto:[EMAIL PROTECTED]
 Sent: Thursday, March 04, 2004 9:19 AM
 To: Tomcat Users List
 Subject: RE: Tomcat 4.1 JSPC not recongnizing change in compile time
 included file
 
 that is expected behavior.
 %@ include file=main.jsp%
 is a static include, meaning, just copy and paste the file before
 compilation.
 if you had jsp:include then it should recognize the changes
 
 Filip
 
 -Original Message-
 From: Nathan Christiansen [mailto:[EMAIL PROTECTED]
 Sent: Thursday, March 04, 2004 7:26 AM
 To: [EMAIL PROTECTED]
 Subject: Tomcat 4.1 JSPC not recongnizing change in compile time
 included file
 
 
 I am running Tomcat 4.1.24.
 
 In nearly all JSP files in my webapp I have the following compile time
 include:
 
 %@ include file=main.jsp%
 
 However, changes to main.jsp are not caught by JSPC. And only the
 main_jsp.java source is changed. If I delete all the *_jsp.java files
 and recompile all of the JSP files, it works perfectly.
 
 Anyone have any suggestions?
 
 
 
 I am using ant 1.5.3 with the following task segment in my build file:
 
 jspc destdir=${jspc.src.jsp.dir}
   webinc=${jspc.base.dir}/fragment.xml
   package=jsp
   compiler=jasper41
   classpath
 fileset dir=${publish.common.lib.dir}
   include name=ant.jar/
   include name=jasper-compiler.jar/
   include name=jasper-runtime.jar/
   include name=servlet.jar/
 /fileset
 pathelement path=${build.dir}/
   /classpath
   webapp basedir=${deploy.dir}/
 /jspc
 
 
 I even tried calling JSPC directly using the task fragment described
in
 the Tomcat 4.1 documentation:
 
   taskdef classname=org.apache.jasper.JspC name=jasper2 
 classpath id=jspc.classpath
   pathelement location=${java.home}/../lib/tools.jar/
   fileset dir=${tomcat.server.lib.dir}
 include name=*.jar/
   /fileset
   fileset dir=${publish.common.lib.dir}
 include name=*.jar/
   /fileset
 /classpath
   /taskdef
 
   jasper2
validateXml=false
package=jsp
uriroot=${deploy.dir}
webXmlFragment=${jspc.base.dir}/fragment.xml
outputDir=${jspc.src.jsp.dir} /
 
 
 -- Nathan Christiansen
Software Engineer
Tahitian Noni International
http://www.tahitiannoni.com
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 ---
 Incoming mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.594 / Virus Database: 377 - Release Date: 2/24/2004
 
 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.594 / Virus Database: 377 - Release Date: 2/24/2004
 
 
 -
 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]



How do I reload a Servlet from a JSP page?

2003-12-23 Thread Nathan Christiansen
I am using a JSP page to add and change properties files for my servlet in my 
development and testing environments.

I have Tomcat (4.1.24) set up to reload the servlet on changes to the context (i.e. 
reloadable=true). When I change an existing properties file, Tomcat responds by 
reloading the servlet and therefore loading the changes.

However, when I add a new properties file (in the WEB-INF/classes directory), Tomcat 
never reloads the servlet. Even when I change that new properties file Tomcat doesn't 
reload it until the servlet gets reloaded by some other means.

So my question is:

How do I reload a servlet from a JSP page?



-- Nathan Christiansen
   Tahitian Noni International
   http://www.tahitiannoni.com

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



RE: How do I reload a Servlet from a JSP page?

2003-12-23 Thread Nathan Christiansen
Thank you for your response, but I already have my context set to automatically reload 
servlets on changes to the webapp as this is a testing environment.

I am wondering how I can force a reload from a JSP page like the manager app does.

-- Nathan Christiansen
   Tahitian Noni International
   http://www.tahitiannoni.com


-Original Message-
From: Edson Alves Pereira [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 23, 2003 11:51 AM
To: 'Tomcat Users List'
Subject: RE: How do I reload a Servlet from a JSP page?


Servlets are reloaded when your servlet engine is restarted or you
configure you webapp to always reaload servlets ( this is very slow ).

 --
 De:   Nathan Christiansen[SMTP:[EMAIL PROTECTED]
 Responder:Tomcat Users List
 Enviada:  terça-feira, 23 de dezembro de 2003 14:46
 Para: [EMAIL PROTECTED]
 Assunto:  How do I reload a Servlet from a JSP page?
 
 I am using a JSP page to add and change properties files for my servlet in
 my development and testing environments.
 
 I have Tomcat (4.1.24) set up to reload the servlet on changes to the
 context (i.e. reloadable=true). When I change an existing properties
 file, Tomcat responds by reloading the servlet and therefore loading the
 changes.
 
 However, when I add a new properties file (in the WEB-INF/classes
 directory), Tomcat never reloads the servlet. Even when I change that new
 properties file Tomcat doesn't reload it until the servlet gets reloaded
 by some other means.
 
 So my question is:
 
 How do I reload a servlet from a JSP page?
 
 
 
 -- Nathan Christiansen
Tahitian Noni International
http://www.tahitiannoni.com
 
 -
 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]



RE: HttpsURLConnection, Tomcat 4.1.27, and jsse.jar

2003-10-13 Thread Nathan Christiansen
I assume that you are trying from within your JSP page to connect to another host 
using HTTPS (i.e. programmatic https client connections).

I have had similar problems. 

How I solved my problems was to use the Jakarta Commons HttpClient. It will handle the 
programmatic https client connection for you. All you have to do is work with the 
higher level GET and POST requests with optional parameters.

For my purposes (getting a textual response from the remote host) it works extremely 
well.

Of course, you do have to have the remote host's TLS/SSL public key in a keystore file 
pointed to by: System.setProperty(javax.net.ssl.trustStore, strKeyStoreFilename); 

You will also need to supply the password to the keystore by: 
System.setProperty(javax.net.ssl.trustStorePassword, strKsyStorePassword);


-- Nathan Christiansen
   Tahitian Noni International
   http://www.tahitiannoni.com


-Original Message-
From: Lukas Bradley [mailto:[EMAIL PROTECTED]
Sent: Sunday, October 12, 2003 11:35 PM
To: [EMAIL PROTECTED]
Subject: HttpsURLConnection, Tomcat 4.1.27, and jsse.jar


I'm having a strange problem with Tomcat and
javax.net.ssl.HttpsURLConnection.  I'm using Tomcat 4.1.27, JDK 1.4.1_04,
and the jsse.jar containing the javax.net.ssl and other fine classes.

I've read about certain bugs located here
http://java.sun.com/j2se/1.4.2/docs/guide/security/jsse/JSSERefGuide.html#InstallProbs
under the heading Code Using HttpsURLConnection Class Throws
ClassCastException in JSSE 1.0.x.  That is exactly the problem I am having.

However, my command line tests work fine.  The JDK works fine by itself.
There is no ClassCastException.  That means that the regular command-line
version of the HttpsURLConnection is wonderful.  The JSSE classes are
configured correctly using java.

However, if you attempt to hit the jsp located at
http://www.dollars.com/URLTest.jsp, you'll get an error message with the
aforementioned ClassCastException.  Tomcat and/or Catalina are not finding
the classes, or are having a rough go with the configuration.

Since the JSSE classes now ship with JDK 1.4, I've been having a hard time
understanding why we are getting this error.  The only two ideas I have are
(1) Tomcat is running off an old JDK (which I don't think is the case) or
(2) there is some configuration error.

Attempting to place the System.setProperty() kludge-fix in the JSP, it
still doesn't work.

Does anyone have any insight as to how the Tomcat/Catalina settings could
have the JSSE classes misconfigured?

Also read this:
http://jce.iaik.tugraz.at/mailarchive/iaik-jce/msg02392.html
And this:
http://forum.java.sun.com/thread.jsp?forum=2thread=254821

But, as you will see in the JSP, it doesn't help.  I've also tried
javax.net.ssl in the package property, and it doesn't work.

Do any and all searches for jsse tomcat ClassCastException and you'll see
stuff.  I think you might have to explicitly install the JSSE classes into
the java \lib\ext directory, which still doesn't make sense, because they
should be included in 1.4.1 anyway.

Thanks for any and all help.

Lukas










-
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 4/5 Clustering.

2003-10-10 Thread Nathan Christiansen
Filip,

Thanks for the link to your site on Tomcat clusters.

Are there any preliminary results about cluster size vs. replication traffic and 
limitations?

If I remember right, the limit for load balancing clusters using an older method was 
about 6 servers in your cluster before the session object replication became the 
bottleneck.

It was this reason alone that I stopped using the session object to store session 
info. I store my persistent objects to a MySQL database, using a session cookie as the 
key to the database row.


Are there plans to support Session Object storage in a database (like my method of 
storing persistent objects)?

This would allow massive scalability in the cluster, since the 'dirty' session object 
only needs to be sent to one place instead of to all the Tomcat servers in the cluster.

I realize that this introduces a problem in that every single server in the cluster 
needs to be running the same version of Tomcat in order to have session objects 
serialize and deserialize properly. Or that you will need to use another storage 
format other than simple serialization and deserialization.

-- Nathan Christiansen
   Tahitian Noni International
   http://www.tahitiannoni.com


-Original Message-
From: Filip Hanik [mailto:[EMAIL PROTECTED]
Sent: Friday, October 10, 2003 10:20 AM
To: Tomcat Users List
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: Clustering Tomcat - Loadbalancing and Failover


http://cvs.apache.org/~fhanik/

 how are session states replicated?

once, after the entire request is completed. If the session is not dirty, no
replication will be done

Doesn't use java groups, instead pure UDP/TCP.

Filip


-- Nathan Christiansen
   Tahitian Noni International
   http://www.tahitiannoni.com

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



RE: Tomcat 4/5 Clustering.

2003-10-10 Thread Nathan Christiansen
It has been done for years, PersistentManager does that already. It
is a pretty slow way of replication

Thanks, I'll look at PersistentManager.

Slow? I guess so.

I have eliminated most of the database overhead by using DBCP to
create a connection pool. However...

Using my method of persistence, on my development PIII 500Mhz 256MB
RAM RH Linux 7.1 box under a JMeter simulated 25 user load, I only got
340 pages per minute on some simple JSP pages and 100 ppm on the most
computationally intensive JSP page.

I am curious how well my app will perform on our production boxes.

-- Nathan Christiansen
   Tahitian Noni International
   http://www.tahitiannoni.com


-Original Message-
From: Filip Hanik [mailto:[EMAIL PROTECTED]
Sent: Friday, October 10, 2003 11:22 AM
To: Tomcat Users List
Subject: Re: Tomcat 4/5 Clustering.


Are there any preliminary results about cluster size vs. replication
traffic and limitations?

if you have a GIGA network, you can go pretty wild!

If I remember right, the limit for load balancing clusters using an older
method was about
6 servers in your cluster before the session object replication became the
bottleneck.

all I said was that I have seen it work on 6 servers, however, with any
cluster, using all-to-all replication, I recommend keeping the clusters
smaller. :)

Are there plans to support Session Object storage in a database
(like my method of storing persistent objects)?

It has been done for years, PersistentManager does that already. It is a
pretty slow way of replication

Or that you will need to use another storage format other than simple
serialization and deserialization.

Run the same version, run different and it may/may not work

Filip



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



Is the apache directive SetHandler supported in 4.1.x and above?

2003-10-10 Thread Nathan Christiansen
Is the apache directive SetHandler supported in 4.1.24 and above?

All I can find about SetHandler and Tomcat on the Jakarta site is info about Tomcat 
3.x.

-- Nathan Christiansen
   Tahitian Noni International
   http://www.tahitiannoni.com

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



SOLVED -- RE: Problems with mod_jk and Apache SetHandler

2003-10-10 Thread Nathan Christiansen
I am posting the solution so that someone else can benefit from my work.

The problem was solved by wrapping the FilesMatch... directive in a 
DirectoryMatch... directive as follows:

# Exclude the Tomcat webapps directory from the Mason handler
DirectoryMatch !/var/tomcat4/webapps/
  FilesMatch  \.html*$|\.csv$|\.txt$|^[^\.]*$
SetHandler perl-script
PerlHandler Mason::Site::Redesign
PerlLogHandler Mason::Site::Redesign-loghandler
  /FilesMatch
/DirectoryMatch


It is interesting that Apache is not forwarding the request to Tomcat after the Mason 
handler declines the request.

Is this a bug in Apache or in the mod_jk connector? 

Where do I submit the bug report?

-- Nathan Christiansen
   Tahitian Noni International
   http://www.tahitiannoni.com


-Original Message-
From: Nathan Christiansen 
Sent: Wednesday, October 08, 2003 1:30 PM
To: [EMAIL PROTECTED]
Subject: Problems with mod_jk and Apache SetHandler


The http.conf file includes the following directives for the Mason handler:

  FilesMatch  \.html*$|\.csv$|\.txt$|^[^\.]*$
SetHandler perl-script
PerlHandler Mason::Site::Redesign
PerlLogHandler Mason::Site::Redesign-loghandler
  /FilesMatch


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



RE: NOT SOLVED -- RE: Problems with mod_jk and Apache SetHandler

2003-10-10 Thread Nathan Christiansen
Actually this code prevents Mason from working.

-- Nathan Christiansen
   Tahitian Noni International
   http://www.tahitiannoni.com


-Original Message-
From: Nathan Christiansen 
Sent: Friday, October 10, 2003 1:34 PM
To: Tomcat Users List
Subject: SOLVED -- RE: Problems with mod_jk and Apache SetHandler


I am posting the solution so that someone else can benefit from my work.

The problem was solved by wrapping the FilesMatch... directive in a 
DirectoryMatch... directive as follows:

# Exclude the Tomcat webapps directory from the Mason handler
DirectoryMatch !/var/tomcat4/webapps/
  FilesMatch  \.html*$|\.csv$|\.txt$|^[^\.]*$
SetHandler perl-script
PerlHandler Mason::Site::Redesign
PerlLogHandler Mason::Site::Redesign-loghandler
  /FilesMatch
/DirectoryMatch


It is interesting that Apache is not forwarding the request to Tomcat after the Mason 
handler declines the request.

Is this a bug in Apache or in the mod_jk connector? 

Where do I submit the bug report?

-- Nathan Christiansen
   Tahitian Noni International
   http://www.tahitiannoni.com


-Original Message-
From: Nathan Christiansen 
Sent: Wednesday, October 08, 2003 1:30 PM
To: [EMAIL PROTECTED]
Subject: Problems with mod_jk and Apache SetHandler


The http.conf file includes the following directives for the Mason handler:

  FilesMatch  \.html*$|\.csv$|\.txt$|^[^\.]*$
SetHandler perl-script
PerlHandler Mason::Site::Redesign
PerlLogHandler Mason::Site::Redesign-loghandler
  /FilesMatch


-
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]



RE: REALLY SOLVED THIS TIME -- RE: Problems with mod_jk and Apache SetHandler

2003-10-10 Thread Nathan Christiansen
We finally found a solution:

DirectoryMatch /home/httpd/redesign/
  FilesMatch  \.html*$|\.csv$|\.txt$|^[^\.]*$
SetHandler perl-script
PerlHandler Mason::Site::Redesign
PerlLogHandler Mason::Site::Redesign-loghandler
  /FilesMatch
/DirectoryMatch


-- Nathan Christiansen
   Tahitian Noni International
   http://www.tahitiannoni.com


-Original Message-
From: Nathan Christiansen 
Sent: Friday, October 10, 2003 2:49 PM
To: Tomcat Users List
Subject: RE: NOT SOLVED -- RE: Problems with mod_jk and Apache
SetHandler


Actually this code prevents Mason from working.

-- Nathan Christiansen
   Tahitian Noni International
   http://www.tahitiannoni.com


-Original Message-
From: Nathan Christiansen 
Sent: Friday, October 10, 2003 1:34 PM
To: Tomcat Users List
Subject: SOLVED -- RE: Problems with mod_jk and Apache SetHandler


I am posting the solution so that someone else can benefit from my work.

The problem was solved by wrapping the FilesMatch... directive in a 
DirectoryMatch... directive as follows:

# Exclude the Tomcat webapps directory from the Mason handler
DirectoryMatch !/var/tomcat4/webapps/
  FilesMatch  \.html*$|\.csv$|\.txt$|^[^\.]*$
SetHandler perl-script
PerlHandler Mason::Site::Redesign
PerlLogHandler Mason::Site::Redesign-loghandler
  /FilesMatch
/DirectoryMatch


It is interesting that Apache is not forwarding the request to Tomcat after the Mason 
handler declines the request.

Is this a bug in Apache or in the mod_jk connector? 

Where do I submit the bug report?

-- Nathan Christiansen
   Tahitian Noni International
   http://www.tahitiannoni.com


-Original Message-
From: Nathan Christiansen 
Sent: Wednesday, October 08, 2003 1:30 PM
To: [EMAIL PROTECTED]
Subject: Problems with mod_jk and Apache SetHandler


The http.conf file includes the following directives for the Mason handler:

  FilesMatch  \.html*$|\.csv$|\.txt$|^[^\.]*$
SetHandler perl-script
PerlHandler Mason::Site::Redesign
PerlLogHandler Mason::Site::Redesign-loghandler
  /FilesMatch


-
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]



RE: Loadballacing with Apache 1.3.2x, mod_jk2 on solaris FAQ

2003-10-09 Thread Nathan Christiansen
Although this is for Linux, here is an Article that might help you get started:

http://raibledesigns.com/tomcat/index.html


-- Nathan Christiansen
   Tahitian Noni International
   http://www.tahitiannoni.com


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Thursday, October 09, 2003 9:57 AM
To: [EMAIL PROTECTED]
Subject: Loadballacing with Apache 1.3.2x, mod_jk2 on solaris FAQ 


Hi All,

Can anyone recommend an FAQ or quide for this on mod_jk2?

Many thanks,

Greg Cope
GCS Ltd
Assign to: CIT, Sandwich - ISG
Phone: (44) 01304 642040
Fax: (44) 01304 652118

LEGAL NOTICE
 
Unless expressly stated otherwise, this message is confidential and may be
privileged. It is intended for the addresee(s) only. Access to this e-mail
by anyone else is unauthorised. If you are not an addressee, any disclosure
or copying of the contents of this e-mail or any action taken (or not taken)
in reliance on it is unauthorised and may be unlawful. If you are not an
addressee, please inform the sender immediately.
 
Pfizer Limited is registered in England under No. 526209 with its registered
office at Ramsgate Road, Sandwich, Kent CT13 9NJ

-
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]



RE: Loadballacing with Apache 1.3.2x, mod_jk2 on solaris FAQ

2003-10-09 Thread Nathan Christiansen
This one is for mod_jk2, but it is also for Apache 2:

http://www.pubbitch.org/jboss/mod_jk.html

If you are passing session objects between servers, then I think that the session 
object passing starts to be the bottleneck at only 6 servers in your cluster.

-- Nathan Christiansen
   Tahitian Noni International
   http://www.tahitiannoni.com


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Thursday, October 09, 2003 11:24 AM
To: [EMAIL PROTECTED]
Subject: RE: Loadballacing with Apache 1.3.2x, mod_jk2 on solaris FAQ 


Thanks Nathan,

Already found that - and it's for mod_jk not jk2 and the 2 are slightly
different.

Greg

 -Original Message-
 From: Nathan Christiansen [mailto:[EMAIL PROTECTED]
 Sent: 09 October 2003 17:06
 To: Tomcat Users List
 Subject: RE: Loadballacing with Apache 1.3.2x, mod_jk2 on solaris FAQ 
 
 
 Although this is for Linux, here is an Article that might 
 help you get started:
 
 http://raibledesigns.com/tomcat/index.html
 
 
 -- Nathan Christiansen
Tahitian Noni International
http://www.tahitiannoni.com
 

-
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]



RE: Problems with mod_jk and Apache SetHandler

2003-10-09 Thread Nathan Christiansen
I have an update.  The webap runs fine using the standalone version of Tomcat 
(http://host:8080/cm/servlet/cm/welcome).

Has anyone had a similar problem?


-- Nathan Christiansen
   Tahitian Noni International
   http://www.tahitiannoni.com


-Original Message-
From: Nathan Christiansen 
Sent: Wednesday, October 08, 2003 1:30 PM
To: [EMAIL PROTECTED]
Subject: Problems with mod_jk and Apache SetHandler


Summary:

I have a problem with Tomcat not being called from Apache when Apache has a SetHandler 
configured for a particular virtual host. 

For standalone JSP pages Tomcat is called and the JSP runs fine, but trying to access 
servlets gives me a 404 error.

For instance, I get the error_log file shows: File does not exist: 
/var/tomcat4/webapps/cm/servlet/cm/welcome


Details:

Server OS: RH 7.3
Server Apache: 1.3.27
Tomcat Version: 4.1.24

Most of our new site is being done with Mason (PERL's version of JSP). However, my 
part of the site is based on Tomcat.

All of my code worked fine on my development server, but when I migrated the code to 
our testing server the Mason code handler tried to handle the requests for my servlet. 
(e.g. the error_log showed: File does not exist: 
/home/httpd/redesign/cm/servlet/cm/welcome)

The programmer who was writing the handler re-wrote the handler send an 
Apache::Declined for the /cm top level directory. This made Apache look for the 
servlet in another place. (e.g. the error_log showed: File does not exist: 
/var/tomcat4/webapps/cm/servlet/cm/welcome)

This also made the the standalone JSP file start working.

There must be a simple configuration problem somewhere, but I can't seem to find it.



The http.conf file includes the following directives for the Mason handler:

  FilesMatch  \.html*$|\.csv$|\.txt$|^[^.]*$
SetHandler perl-script
PerlHandler Mason::Site::Redesign
PerlLogHandler Mason::Site::Redesign-loghandler
  /FilesMatch

I added the following to the .conf file (these config lines worked on my dev server):

  Alias /cm/ /var/tomcat4/webapps/cm/

  Directory /var/tomcat4/webapps/cm
  Options FollowSymLinks
  DirectoryIndex index.jsp index.html index.htm
  /Directory

  Location /cm/WEB-INF/*
  AllowOverride None
  Deny from all
  /Location

  Location /cm/META-INF/*
  AllowOverride None
  Deny from all
  /Location

  JkMount /cm/*.html ajp13
  JkMount /cm/*.jsp ajp13
  JkMount /cm/servlet/* ajp13
  JkMount /cm/servlet/cm/* ajp13


What am I doing wrong?

Thanks.

-- Nathan Christiansen
   Tahitian Noni International
   http://www.tahitiannoni.com

-
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]



RE: Web-app setup

2003-10-09 Thread Nathan Christiansen
You probably need to write a deployment descriptor (web.xml file).

I couldn't find a good tutorial quickly, but the book Java Servlet Programming is a 
good resource for beginners.

-- Nathan Christiansen
   Tahitian Noni International
   http://www.tahitiannoni.com


-Original Message-
From: Duane Kehoe [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 09, 2003 2:47 PM
To: Tomcat Users List
Subject: Web-app setup


I am trying to setup a webapp and am having a little difficulty.  My 
application starts on /webapps/myapp/index.jsp with 2 text fields(1 
text, 1 password), this is a login type page, when the submit button is 
clicked on the jsp my class which is packaged into 
com.mycompany.myapp.Login comes back with a 404 status code everytime.  
I have created inside of the WEB-INF directory a 
classes/com/mycompany/myapp/ directory structure and placed both my java 
source and class files into this dir.  As far as I can see everything 
looks right even my error points to the right dir structure however I 
continue to get requested resource not available errors, I think my 
web.xml is the issue however I am very new to tomcat and unable to find 
anything in the docs or mail list archives that help me.  I am currently 
running Apache 2.0.46 with Tomcat 4.1.18 on Linux 2.4.20 kernel.  Any 
help here would be great tia.
-- 

/*Weyco** Group* -/

*/Florsheim, Brass Boot, Nunn Bush, Stacy Adams/*
Duane Kehoe
EC / Programmer / Analyst


Phone # 414.908.1814
Fax # 414.908.1601
Email: [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]



Problems with mod_jk and Apache SetHandler

2003-10-08 Thread Nathan Christiansen
Summary:

I have a problem with Tomcat not being called from Apache when Apache has a SetHandler 
configured for a particular virtual host. 

For standalone JSP pages Tomcat is called and the JSP runs fine, but trying to access 
servlets gives me a 404 error.

For instance, I get the error_log file shows: File does not exist: 
/var/tomcat4/webapps/cm/servlet/cm/welcome


Details:

Server OS: RH 7.3
Server Apache: 1.3.27
Tomcat Version: 4.1.24

Most of our new site is being done with Mason (PERL's version of JSP). However, my 
part of the site is based on Tomcat.

All of my code worked fine on my development server, but when I migrated the code to 
our testing server the Mason code handler tried to handle the requests for my servlet. 
(e.g. the error_log showed: File does not exist: 
/home/httpd/redesign/cm/servlet/cm/welcome)

The programmer who was writing the handler re-wrote the handler send an 
Apache::Declined for the /cm top level directory. This made Apache look for the 
servlet in another place. (e.g. the error_log showed: File does not exist: 
/var/tomcat4/webapps/cm/servlet/cm/welcome)

This also made the the standalone JSP file start working.

There must be a simple configuration problem somewhere, but I can't seem to find it.



The http.conf file includes the following directives for the Mason handler:

  FilesMatch  \.html*$|\.csv$|\.txt$|^[^.]*$
SetHandler perl-script
PerlHandler Mason::Site::Redesign
PerlLogHandler Mason::Site::Redesign-loghandler
  /FilesMatch

I added the following to the .conf file (these config lines worked on my dev server):

  Alias /cm/ /var/tomcat4/webapps/cm/

  Directory /var/tomcat4/webapps/cm
  Options FollowSymLinks
  DirectoryIndex index.jsp index.html index.htm
  /Directory

  Location /cm/WEB-INF/*
  AllowOverride None
  Deny from all
  /Location

  Location /cm/META-INF/*
  AllowOverride None
  Deny from all
  /Location

  JkMount /cm/*.html ajp13
  JkMount /cm/*.jsp ajp13
  JkMount /cm/servlet/* ajp13
  JkMount /cm/servlet/cm/* ajp13


What am I doing wrong?

Thanks.

-- Nathan Christiansen
   Tahitian Noni International
   http://www.tahitiannoni.com

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



RE: include statement in servlets

2003-10-08 Thread Nathan Christiansen
While this is true there are also ways to accomplish similar results:


- calling the service method of another servlet directly. (Not for the beginner nor 
the faint of heart.)

- calling a method of another class that adds data to the response object.

- forwarding the request to another servlet or JSP (this I use extensively).


BTW, there are two ways to include in JSP. Using %@ include ... % includes the JSP 
file at compile time where jsp:include ... % calls the other JSP's service method at 
run-time.


-- Nathan Christiansen
   Tahitian Noni International
   http://www.tahitiannoni.com


-Original Message-
From: Tim Funk [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 08, 2003 4:32 PM
To: Tomcat Users List
Subject: Re: include statement in servlets


No. A servlet is a standard java class so you cannot perform a compile time 
code include.

-Tim

zeallousbigpond.net.au wrote:
 How do you include a normal jsp or html page in a servlet?...
 
 in JSP...to include a page you do:
 
 %@ include file=dfaf.jsp %
 
 is there a similar way for servlets??
 
 Anson



-
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]



RE: Urgent help, please!Best practices using Connection Pool

2003-10-08 Thread Nathan Christiansen
DBCP wraps the connection object. When you call conn.close(); on the connection object 
given to you by the DataSource.getConnection(); method, it just releases it back into 
the pool, it dosen't actually close the connection.

-- Nathan Christiansen
   Tahitian Noni International
   http://www.tahitiannoni.com


-Original Message-
From: Jose Euclides da Silva Junior - DATAPREVRJ
[mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 08, 2003 5:19 PM
To: '[EMAIL PROTECTED]'
Subject: Urgent help, please!Best practices using Connection Pool


Hi,
i am using DBCP 1.0. My question is simple: since DBCP doesnt create a
singleton object ( just a data source object), what should i do whenever my
sql queries are done? Should i close the connection after that? But, if i do
this, will i loose my connection pool facility, so my next connection time
will waste more time...
Thanks in advance,
Euclides.  

-
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]



MySQL DBCP pool exausted error message

2003-09-17 Thread Nathan Christiansen
When I stress test my web app using JMeter, I am suddenly getting a DBCP could not 
obtain an idle db connection, pool exhausted SQLException thrown.

When I test with 25 simulated users every one of my 25 threads gets the exception 
after the first 25 requests.

What am I doing wrong?

My setup:

RH Linux 7.1
Java 1.4.1_01
Tomcat 4.1.24
DBCP 1.0

MySQL 3.23.56


My pertinent DBCP configuration:

removeAbandoned = true
maxActive = 25
maxIdle = 10
maxWait = 1
url ends with ?autoReconnect=true

I double checked that all of my database connections in my code follow the pattern of:

Connection conDBConnection = getConnection();
PreparedStatement psDBStatement = null;
ResultSet rsDBResult = null;
  
try
{
  psDBStatement = conDBConnection.prepareStatement(select query from views where 
viewid = ?);
  psDBStatement.setInt(1, nViewID);
  rsDBResult = psDBStatement.executeQuery();
  
  if (rsDBResult.next())
  {
strReturnValue = rsDBResult.getString(1);
  }
}
catch (SQLException sqle)
{
  sqle.printStackTrace();
  strReturnValue = null;
}
finally
{
  try
  {
if (rsDBResult != null) rsDBResult.close();
if (psDBStatement != null) psDBStatement.close();
if (conDBConnection != null) conDBConnection.close();
  }
  catch (SQLException sqle)
  {
sqle.printStackTrace();
  }
}




-- Nathan Christiansen
   Tahitian Noni International
   http://www.tahitiannoni.com

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



RE: MySQL DBCP pool exausted error message [SOLVED]

2003-09-17 Thread Nathan Christiansen
Sorry. I had a bug in my code.

I had one database call where I was checking parameters and returning without calling 
Connection.close();

-- Nathan Christiansen
   Tahitian Noni International
   http://www.tahitiannoni.com


-Original Message-
From: Nathan Christiansen 
Sent: Wednesday, September 17, 2003 11:20 AM
To: [EMAIL PROTECTED]
Subject: MySQL DBCP pool exausted error message


When I stress test my web app using JMeter, I am suddenly getting a DBCP could not 
obtain an idle db connection, pool exhausted SQLException thrown.

When I test with 25 simulated users every one of my 25 threads gets the exception 
after the first 25 requests.

What am I doing wrong?

My setup:

RH Linux 7.1
Java 1.4.1_01
Tomcat 4.1.24
DBCP 1.0

MySQL 3.23.56


My pertinent DBCP configuration:

removeAbandoned = true
maxActive = 25
maxIdle = 10
maxWait = 1
url ends with ?autoReconnect=true

I double checked that all of my database connections in my code follow the pattern of:

Connection conDBConnection = getConnection();
PreparedStatement psDBStatement = null;
ResultSet rsDBResult = null;
  
try
{
  psDBStatement = conDBConnection.prepareStatement(select query from views where 
viewid = ?);
  psDBStatement.setInt(1, nViewID);
  rsDBResult = psDBStatement.executeQuery();
  
  if (rsDBResult.next())
  {
strReturnValue = rsDBResult.getString(1);
  }
}
catch (SQLException sqle)
{
  sqle.printStackTrace();
  strReturnValue = null;
}
finally
{
  try
  {
if (rsDBResult != null) rsDBResult.close();
if (psDBStatement != null) psDBStatement.close();
if (conDBConnection != null) conDBConnection.close();
  }
  catch (SQLException sqle)
  {
sqle.printStackTrace();
  }
}




-- Nathan Christiansen
   Tahitian Noni International
   http://www.tahitiannoni.com

-
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]



Simplified Chinese to UTF-8

2003-08-15 Thread Nathan Christiansen
I have an annoying problem that I am trying to figure out.

I need to support Simplified Chinese in a webapp that also supports ISO-8859-1.

I figure the best way is to make my web pages encoded in UTF-8.

The database access and display works, but I am having trouble with getting post data 
to come out correctly.

I am running Tomcat 4.1.24 on a RedHat Linux 7.1 box with JDK 1.4.1_01.

I have tried using the following JSP file to test the post input from a Windows 2000 
Server box that allows me to input Simplified Chinese. But every encoding in the JSP 
file gives me garbage back.

Any ideas?

Thanks.

-- Nathan Christiansen
   Tahitian Noni International
   http://www.tahitiannoni.com

 Included JSP File 


[EMAIL PROTECTED] contentType=text/html; charset=UTF-8
%[EMAIL PROTECTED] import=java.io.*
%% String strRawData = request.getParameter(data);
String strGBK = null;
String strEUC_CN = null;
String strGB18030 = null;
String strMS936 = null;
String strCp935 = null;
String strGB2312 = null;

String strMS950 = null;
String strBig5 = null;
String strBig5_HKSCS = null;
String strCp937 = null;
String strCp950 = null;
String strCp964 = null;
String strEUC_TW = null;


if (strRawData != null)
{
  strGBK = new String(strRawData.getBytes(GBK));
  strEUC_CN = new String(strRawData.getBytes(EUC_CN));
  strGB18030 = new String(strRawData.getBytes(GB18030));
  strMS936 = new String(strRawData.getBytes(MS936));
  strCp935 = new String(strRawData.getBytes(Cp935));
  strGB2312 = new String(strRawData.getBytes(GB2312));

  strMS950 = new String(strRawData.getBytes(MS950));
  strBig5 = new String(strRawData.getBytes(Big5));
  strBig5_HKSCS = new String(strRawData.getBytes(Big5_HKSCS));
  strCp937 = new String(strRawData.getBytes(Cp937));
  strCp950 = new String(strRawData.getBytes(Cp950));
  strCp964 = new String(strRawData.getBytes(Cp964));
  strEUC_TW = new String(strRawData.getBytes(EUC_TW));
}

%html
headtitleCharset Test Page/title/head
body
%
if (strRawData != null)
{
%pre
strRawData = %= new String(strRawData.getBytes(UTF8)) %
strGBK = %= new String(strGBK.getBytes(UTF8)) %
strEUC_CN = %= new String(strEUC_CN.getBytes(UTF8)) %
strGB18030 = %= new String(strGB18030.getBytes(UTF8)) %
strMS936 = %= new String(strMS936.getBytes(UTF8)) %
strCp935 = %= new String(strCp935.getBytes(UTF8)) %
strGB2312 = %= new String(strCp935.getBytes(UTF8)) %

strMS950 = %= new String(strMS950.getBytes(UTF8)) %
strBig5 = %= new String(strBig5.getBytes(UTF8)) %
strBig5_HKSCS = %= new String(strBig5_HKSCS.getBytes(UTF8)) %
strCp937 = %= new String(strCp937.getBytes(UTF8)) %
strCp950 = %= new String(strCp950.getBytes(UTF8)) %
strCp964 = %= new String(strCp964.getBytes(UTF8)) %
strEUC_TW = %= new String(strEUC_TW.getBytes(UTF8)) %
/pre%
}
%form action=test.jsp method=POST
input type=text name=data
input type=submit
/form
/body
/html

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



RE: Simplified Chinese to UTF-8

2003-08-15 Thread Nathan Christiansen
Thanks Dan.

I did download the filter code and tried all of the Simplified Chinese encodings 
without luck.

I am unsure which encoding that the IME is sending (since I do not read Chinese myself 
and can't read the help manual).

Looking through the filter code, it would be exactly similar if I added the 
request.setCharacterEncoding() call to the top of the JSP page since I am calling the 
JSP page directly.

Any other suggestions?

-- Nathan Christiansen
   Tahitian Noni International
   http://www.tahitiannoni.com


-Original Message-
From: Dan Tran [mailto:[EMAIL PROTECTED]
Sent: Friday, August 15, 2003 10:54 AM
To: Nathan Christiansen
Subject: Re: Simplified Chinese to UTF-8


You need to implement a filter according the folowing
link

http://www.anassina.com/struts/i18n/i18n.html

-Dan

- Original Message - 
From: Nathan Christiansen [EMAIL PROTECTED]
Newsgroups: Tomcat
Sent: Friday, August 15, 2003 9:33 AM
Subject: Simplified Chinese to UTF-8


 I have an annoying problem that I am trying to figure out.

 I need to support Simplified Chinese in a webapp that also supports
ISO-8859-1.

 I figure the best way is to make my web pages encoded in UTF-8.

 The database access and display works, but I am having trouble with
getting post data to come out correctly.

 I am running Tomcat 4.1.24 on a RedHat Linux 7.1 box with JDK 1.4.1_01.

 I have tried using the following JSP file to test the post input from a
Windows 2000 Server box that allows me to input Simplified Chinese. But
every encoding in the JSP file gives me garbage back.

 Any ideas?

 Thanks.


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



RE: Simplified Chinese to UTF-8 (SOLVED)

2003-08-15 Thread Nathan Christiansen
Sorry Dan,

I used the Filter as is (using UTF-8) and removed the code to try to convert it again 
and it works beautiflly for both Chinese and any type of Japanese I can throw at it.

Thanks again. 

-- Nathan Christiansen
   Tahitian Noni International
   http://www.tahitiannoni.com


-Original Message-
From: Nathan Christiansen 
Sent: Friday, August 15, 2003 12:25 PM
To: [EMAIL PROTECTED]
Subject: RE: Simplified Chinese to UTF-8


Thanks Dan.

I did download the filter code and tried all of the Simplified Chinese encodings 
without luck.

I am unsure which encoding that the IME is sending (since I do not read Chinese myself 
and can't read the help manual).

Looking through the filter code, it would be exactly similar if I added the 
request.setCharacterEncoding() call to the top of the JSP page since I am calling the 
JSP page directly.

Any other suggestions?

-- Nathan Christiansen
   Tahitian Noni International
   http://www.tahitiannoni.com


-Original Message-
From: Dan Tran [mailto:[EMAIL PROTECTED]
Sent: Friday, August 15, 2003 10:54 AM
To: Nathan Christiansen
Subject: Re: Simplified Chinese to UTF-8


You need to implement a filter according the folowing
link

http://www.anassina.com/struts/i18n/i18n.html

-Dan

- Original Message - 
From: Nathan Christiansen [EMAIL PROTECTED]
Newsgroups: Tomcat
Sent: Friday, August 15, 2003 9:33 AM
Subject: Simplified Chinese to UTF-8


 I have an annoying problem that I am trying to figure out.

 I need to support Simplified Chinese in a webapp that also supports
ISO-8859-1.

 I figure the best way is to make my web pages encoded in UTF-8.

 The database access and display works, but I am having trouble with
getting post data to come out correctly.

 I am running Tomcat 4.1.24 on a RedHat Linux 7.1 box with JDK 1.4.1_01.

 I have tried using the following JSP file to test the post input from a
Windows 2000 Server box that allows me to input Simplified Chinese. But
every encoding in the JSP file gives me garbage back.

 Any ideas?

 Thanks.


-
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]



Problem with custom TrustManager for SSL in Tomcat 4.1.24

2003-06-11 Thread Nathan Christiansen
I have coded a custom TrustManger and HostnameVerifier for SSL (actually TLS) 
connections from my servlet code to another server.

The code calls the correct methods to setup the Default TrustManager and 
HostNameVerifier for an HttpsUrlConnection.

I then use the URL.openConnection() method to instansiate the connection.

Running standalone, this code works perfectly, however running under Tomcat on the 
same machine the HttpConnection does not use the custom TustManager that I coded.

Any suggestions?


Code to set up default Trust Manager, etc.:

private static void initSSL()
{
  try
  {
TrustManager[] myTM = new TrustManager [] { new ProxyTrustManager() };
SSLContext ctx = SSLContext.getInstance(TLS);
ctx.init(null, myTM, null);
SSLSocketFactory sslFactory = ctx.getSocketFactory();
HttpsURLConnection.setDefaultSSLSocketFactory(sslFactory);
HttpsURLConnection.setDefaultHostnameVerifier(new ProxyHostNameVerifier());
  }
  catch (Exception ex)
  {
ex.printStackTrace();
  }
}


-- Nathan Christiansen
   Tahitian Noni International
   http://www.tahitiannoni.com

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