Re: CRUD Operations using Tomcat

2004-07-20 Thread Graham Leggett
Valter G. Nogueira Jr. wrote:
I am looking for good ways to implements CRUD ops using Tomcat
We use Apache Struts to implement the CRUD approach, along with it's 
DynaActionForms feature.

Regards,
Graham
--


smime.p7s
Description: S/MIME Cryptographic Signature


Re: x-forwarded-for

2004-07-19 Thread Graham Leggett
Boulay Arnaud wrote:
I would like to know how I can catch the real client IP address with Tomcat even if 
there is some proxy
between them.
If you're using unsecured HTTP, the X-Forwarded-For header might help 
you in some cases, but as there is no guarantee that all proxy servers 
add this header it is not practical to rely on it, and in many cases the 
X-Forwarded-For could be just plain wrong.

If you're using secured HTTPS, then the originating IP will be intact 
(no proxies or caches to worry about), but if the client was behind a 
NAT router, you will only see the IP address of the NAT router, not the 
client.

I think that http header x-formwarded-for could embed it but I don't know how !!!
You (as in tomcat) don't embed the header, the proxy server does - you 
just need to read the header if it exists.

Regards,
Graham
--


smime.p7s
Description: S/MIME Cryptographic Signature


Re: can a virtual host have its own privatly used SSL certificate?

2004-07-15 Thread Graham Leggett
Guy Katz wrote:
i am going to put my application in  a shared hosting solution which does
not provide any shared SSL support.
is it possible to buy and put a SSL certificate in the scope of my virtual
host in the hosting company. (i mean is it technically possible -
disregarding the hosting company policy).
Technical short answer: no.
Regards,
Graham
--


smime.p7s
Description: S/MIME Cryptographic Signature


Re: can a virtual host have its own privatly used SSL certificate ?

2004-07-15 Thread Graham Leggett
Guy Katz wrote:
thanks but are you sure?
I'm sure.
i read some more and got the impression that when using apache+tomcat with
ip based virtual hosting this can be achieved.
The problem is that there can only be one certificate per listening port 
that tomcat is listening on, and the certificate can only have one name 
at a time (unless you use wildcard certs, but this is a special case). 
There can be many virtual hosts per listening port, but only one 
certificate, and the certificate can only have one name (at the moment) 
- thus your problem.

:(
Regards,
Graham
--


smime.p7s
Description: S/MIME Cryptographic Signature


Re: can a virtual host have its own privatly used SSL certificate ?

2004-07-15 Thread Graham Leggett
Guy Katz wrote:
you are relating to tomcat.
i think in my situation they have a different listen port for every vhost
internally such that the apache server delivers the http request on
different ports for different vhost.
does this simplify the problem?
This is the way to get around this problem - tell tomcat to listen on 
multiple ports, and run one certificate and one host per port. To make 
sure you stay on port 443, you'll need to have multiple IP addresses per 
box.

Regards,
Graham
--


smime.p7s
Description: S/MIME Cryptographic Signature


Re: can a virtual host have its own privatly used SSL certificate?

2004-07-15 Thread Graham Leggett
Nikola Milutinovic wrote:
SSL is done on IP level. I think (correct me if I'm wrong) that TLS is 
on application level, but I haven't heard of HTTP/TLS.
HTTP/TLS does exist, it just isn't supported by the major servers yet.
Regards,
Graham
--


smime.p7s
Description: S/MIME Cryptographic Signature


Re: can a virtual host have its own privatly used SSL certificate ?

2004-07-15 Thread Graham Leggett
Carl Olivier wrote:
Actually, you can as far as I know.
Technically no - what you're describing is the setup for a dedicated IP 
per host, not virtual host.

You're describing the correct solution, it's just that calling it a 
virtual host is potentially confusing, as the virtual part is no 
longer there in this case.

Regards,
Graham
--


smime.p7s
Description: S/MIME Cryptographic Signature


Tomcat 5, proxy and SSL accelerators

2004-07-07 Thread Graham Leggett
Hi all,
I have a tomcat server running behind an SSL accelerator. I have used 
the proxyName and proxyPort config settings to make sure the real name 
of the server is used by the web application, but I can find no way of 
telling the web app that it is running on a secure server.

Our server sends its URL to another server as part of an information 
exchange, and as this exchange is XML based and not done using a browser 
using relative links or the base tag is not possible.

Our current hack is to reconstruct the URL, replacing http with https, 
but it's really ugly.

Is there an elegant solution to this problem out there?
Regards,
Graham
--


smime.p7s
Description: S/MIME Cryptographic Signature


Tomcat RPMs and database pools - no joy

2004-06-17 Thread Graham Leggett
Hi all,
I have a war that connects to a database pool defined in a Resource 
section within server.xml. This war is run in a tomcat v5.0.19 
environment as binary released by the jakarta project, and works 100%.

I now want to deploy the war inside a jpackage RPM version of tomcat on 
my production server, and use the identical configurations for the 
Resource section and war, but an attempt to start the application fails 
like so:

javax.servlet.ServletException: Error initialising 
za.co.fma.patricia.struts.PatriciaPlugin with configuration file at 
'/usr/share/tomcat5/webapps/patricia/WEB-INF/torque.properties': 
za.co.fma.patricia.PatriciaException: org.apache.torque.TorqueException: 
org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC
driver of class '' for connect URL 'null', cause: No suitable driver

I tried the v5.0.24 RPM, and the same results were evident.
Googling for the above shows lots of questions, but no definitive 
answers. Usually the problem goes away when the person with the problem 
goes over the config. In my case I know my config works, because my test 
environment is 100% functional. I am trying to work out what could be 
different between my test environment and the final tomcat RPM file.

I have checked that the Postgresql driver is placed in common/lib in 
both the test environment and the RPM environment.

In order for tomcat to install at all, I have forced it to ignore the 
following three dependancies, as (to my knowledge) they are are included 
in Sun's JDK v1.4.2 (and jpackage provides no compatibility packages to 
fake these dependancies for JDK v1.4.x):

- [javamail].jar (is there already courtesy of Redhat supplied package, 
but jpackage cannot find it)

- [jdbc-stdext].jar (part of v1.4.2, not present in Jakarta's official 
tomcat release)

- [jndi].jar (part of v1.4.2, not present in Jakarta's official tomcat 
release)

Has anybody got database pools and the tomcat5 RPM to work properly 
together, and was there anything you needed to do over and above the 
normal Resource configuration?

The config for server.xml looks like this:
  !-- Global JNDI resources --
  GlobalNamingResources
Resource name=jdbc/GlobalPatricia auth=Container
  type=javax.sql.DataSource/
ResourceParams name=jdbc/GlobalPatricia
  parameter
namefactory/name
valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
  /parameter
  parameter
namedriverClassName/name
valueorg.postgresql.Driver/value
  /parameter
  parameter
nameurl/name
valuejdbc:postgresql://127.0.0.1:5432/patricia/value
  /parameter
  parameter
nameusername/name
valuexxx/value
  /parameter
  parameter
namepassword/name
valuexxx/value
  /parameter
  parameter
namemaxActive/name
value20/value
  /parameter
  parameter
namemaxIdle/name
value10/value
  /parameter
  parameter
namemaxWait/name
value-1/value
  /parameter
/ResourceParams
  /GlobalNamingResources
The config for warfile.xml looks like this:
Context path=/patricia docBase=patricia 
  Valve className=org.apache.catalina.valves.RemoteAddrValve
allow=127.0.0.1/
  Logger className=org.apache.catalina.logger.FileLogger
 prefix=localhost_patricia_log. suffix=.txt
  timestamp=true/
  ResourceLink name=jdbc/GlobalPatricia global=jdbc/GlobalPatricia 
type=javax.sql.DataSource/

  Realm className=org.apache.catalina.realm.DataSourceRealm debug=0
dataSourceName=jdbc/GlobalPatricia
userTable=person userNameCol=uid userCredCol=user_password
userRoleTable=company_person roleNameCol=serial/
/Context
Can anyone shed some light?
Regards,
Graham
--
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Tomcat 5 Database Connections

2004-06-17 Thread Graham Leggett
Jeff Sexton wrote:
This week I realized that my servlets are getting:
org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of
class ''
for connect URL 'null', cause: null
As a test, try the binary package as provided by Jakarta for tomcat 
(unless of course you are already doing so).

In my case, the binary Jakarta supplied package v5.0.19 works, whereas 
the jpackage RPM of tomcat v5.0.19 does not. Same config.

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


Re: Tomcat 5 Database Connections

2004-06-17 Thread Graham Leggett
Jeff Sexton wrote:
I'm working with the binary for 5.0.24.  Maybe I should try 5.0.19.
I tried the v5.0.24 RPM, and then downgraded it to v5.0.19 to be the 
same as our development version, which is the binary v5.0.19.

One thing I did not mention is that I am doing this on AIX, but that
doesn't seem like a factor (?).  Whatever's going wrong *seems* to
all be in the Tomcat world.
I think it's definitely tomcat - my environment is Postgresql on Redhat 
Enterprise and am getting the same thing.

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


JNDI based Datasource - anybody got a working example?

2003-11-15 Thread Graham Leggett
Hi all,

I am trying to configure tomcat to provide a JNDI Datasource, both so 
that the container can provide Basic Authentication, and for the war 
file to use (via Torque).

I have followed the instructions at 
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html, 
which claim to be untested - these instructions do not work. Any 
attempt at auth results in the following exception:

javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
	at org.apache.naming.NamingContext.lookup(NamingContext.java:811)
	at org.apache.naming.NamingContext.lookup(NamingContext.java:194)
	at org.apache.catalina.realm.DataSourceRealm.open(DataSourceRealm.java:467)
	at 
org.apache.catalina.realm.DataSourceRealm.authenticate(DataSourceRealm.java:315)
	at 
org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthenticator.java:161)

Has anybody successfully managed to get tomcat to do this? If so, can 
you post an example to use?

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


Re: JNDI based Datasource - anybody got a working example?

2003-11-15 Thread Graham Leggett
Christopher Schultz wrote:

I was getting this same error and played around for the better part of 
two days to get this working.

Finally, I can do all of these things:

1. Use the Realm the way I want to
2. Have Torque use the same JNDI DataSource
(Just so you know, this is what I use for my torque JNDI setup:
[EMAIL PROTECTED]@.jndi.path=java:comp/env/@DATASOURCE_REF@ 

)

3. Browse the JNDI tree by hand (from a JSP within my context) and 
actually see the DataSource object in there.

Woo hoo!

I hope that helps.
You are an absolute legend!

One key thing that you mentioned, that is not in any of the docs, is 
that torque needs the JNDI path set absolute. ie 
java:comp/ev/jdbc/myDatabase works, but jdbc/myDatabase on its own does not.

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


Basic auth setup The request sent by the client was syntactically incorrect

2003-11-14 Thread Graham Leggett
Hi all,

I have been trying to follow the bits and pieces of docs that describe 
how to configure a DataSource, and then configure a Basic Authentication 
security constraint, against that DataSource.

When I access the protected URL, instead of getting 401 Auth Required, 
I get 400 The request sent by the client was syntactically incorrect 
instead.

No error messages are logged anywhere.

Anyone know what I am doing wrong?

My web.xml includes this:

  resource-ref
   descriptionPatricia Datasource/description
   res-ref-namejdbc/patricia/res-ref-name
   res-typejavax.sql.DataSource/res-type
   res-authContainer/res-auth
  /resource-ref
  security-constraint
display-namePatricia Security Constraint/display-name
web-resource-collection
  web-resource-nameProtected Area/web-resource-name
  !-- Define the context-relative URL(s) to be protected --
  url-pattern/*.do/url-pattern
  !-- If you list http methods, only those methods are protected --
  http-methodDELETE/http-method
  http-methodGET/http-method
  http-methodPOST/http-method
  http-methodPUT/http-method
/web-resource-collection
auth-constraint
  !-- Anyone with one of the listed roles may access this area --
  role-nameadministrator/role-name
  role-nameunderwriter/role-name
  role-nameaccountant/role-name
  role-namebroker/role-name
/auth-constraint
  /security-constraint
  !-- Default login configuration uses form-based authentication --
  login-config
auth-methodBASIC/auth-method
realm-namePatricia/realm-name
  /login-config
  !-- Security roles referenced by this web application --
  security-role
role-nameadministrator/role-name
  /security-role
  security-role
role-nameunderwriter/role-name
  /security-role
  security-role
role-nameaccountant/role-name
  /security-role
  security-role
role-namebroker/role-name
  /security-role
My context definition in tomcat is this:

Context path=/patricia reloadable=true 
docBase=/home/gatekeeper/minfrin/src/fma/patricia/target/patricia 
workDir=/home/gatekeeper/minfrin/src/fma/patricia/work/org/apache/jsp 
	Logger className=org.apache.catalina.logger.SystemOutLogger 
verbosity=4 timestamp=true/
Resource name=jdbc/patricia auth=Container
  type=javax.sql.DataSource/

ResourceParams name=jdbc/patricia
  parameter
namefactory/name
valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
  /parameter
  parameter
namedriverClassName/name
valueorg.postgresql.Driver/value
  /parameter
  parameter
nameurl/name
valuejdbc:postgresql://127.0.0.1:5432/patricia/value
  /parameter
  parameter
nameusername/name
valueuser_name/value
  /parameter
  parameter
namepassword/name
valuepassword/value
  /parameter
  parameter
namemaxActive/name
value20/value
  /parameter
  parameter
namemaxIdle/name
value10/value
  /parameter
  parameter
namemaxWait/name
value-1/value
  /parameter
/ResourceParams
Realm className=org.apache.catalina.realm.DataSourceRealm debug=99
   dataSourceName=jdbc/patricia
   userTable=person userNameCol=uid userCredCol=user_password
   userRoleTable=company_person roleNameCol=role_name/
/Context
Regards,
Graham
--
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Basic auth setup The request sent by the client was syntactically incorrect

2003-11-14 Thread Graham Leggett
Graham Leggett wrote:

When I access the protected URL, instead of getting 401 Auth Required, 
I get 400 The request sent by the client was syntactically incorrect 
instead.

No error messages are logged anywhere.

  url-pattern/*.do/url-pattern
Turned out the /*.do didn't match - changed it to *.do and the 
authentication popup now happens on all struts requests.

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


Setting cache headers on tomcat served files - How?

2003-01-06 Thread Graham Leggett
Hi all,

I have a web application running within tomcat which serves both JSP 
files and static GIF files. I need to set the cache-control headers on 
the GIF files to specify Cache-Control: no-cache. This is easy to do 
for the JSP files, but I can find no reference on how to do it for 
static files in web.xml.

Is this possible?

I do not want to serve the static files via a different server (eg 
Apache or an Apache/Tomcat hybrid).

Regards,
Graham
--
-
[EMAIL PROTECTED]		There's a moon
	over Bourbon Street
		tonight...


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



Re: tunneling https through http

2002-05-16 Thread Graham Leggett

Rich Catlett wrote:

 Yes, I am trying to access an https site through a proxy.  As I said
 before I'm asking this question because the error I get on the client
 side - Unrecognized SSL handshake says, as far as I can tell,  that an
 https connection is being attempted on an http line.  I have set
 debug=99 on the connection, and I am not getting any helpful information
 on why the connection is failing.

But is the proxy you are talking about a reverse proxy or a forward
proxy? CONNECT only makes sense with a forward proxy, ie set up use
proxy for https in your browser settings. If it works fine direct, but
not through the proxy, then the proxy you are using has a problem.

If you are trying to use it as a reverse proxy it won't work. The
reverse proxy needs to be set up as a receiver of SSL connections, which
are then forwarded independantly to Tomcat.

Regards,
Graham
-- 
-
[EMAIL PROTECTED]There's a moon
over Bourbon Street
tonight...

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




Re: Apache/Tomcat meet Visa

2002-05-11 Thread Graham Leggett

Brian Tol wrote:

 In particular, the bottom half of page 12 refers to Network encryption
 (VPN) may be used betweeen any merchant system and any back-end
 database and on page 14: When transmitting data across networks,
 always use encryption techniques...
 
 If I'm reading this correctly, it sound like traffic between Apache and
 Tomcat need to be encrypted.
 
 I know that ajpv13 can detect SSL requests, but is there any support for
 encrypting traffic between the two systems? Or am I just reading this
 wrong?

As I understand it, the combination of SSL support and mod_proxy in
Apache v2.0 is capable of connecting to a backend server using an SSL
connection.

So, configure Apache v2.0 with SSL, and use mod_proxy to connect to a
Tomcat instance running the HTTP/1.1 connector with SSL support. This
way you get encrypted connections between Apache and Tomcat.

Or - just let Tomcat handle the request directly using HTTP/1.1
connector + SSL.

Regards,
Graham
-- 
-
[EMAIL PROTECTED]There's a moon
over Bourbon Street
tonight...

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




Re: Session Problem - URGENT!!!!

2002-05-10 Thread Graham Leggett

Jack Li wrote:

 -1

-1 means veto, and is only used by people with a veto. So - do you
have a veto, or are you just being a wiseass? ;)

Regards,
Graham
-- 
-
[EMAIL PROTECTED]There's a moon
over Bourbon Street
tonight...


smime.p7s
Description: S/MIME Cryptographic Signature


Tomcat + IBMJava/LinuxPPC - out of memory

2002-04-24 Thread Graham Leggett

Hi all,

I have a Tomcat v4.0.1 installation that currently works 100% using the
Blackdown JDK v1.3.1 for LinuxPPC, however there is no JIT compiler for
this platform. I have given the IBMJava JDK v1.3.1 pSeries a try,
however this JDK bombs out on startup every time with the following
error:

**Out of memory, aborting**

*** panic: JVMST058: Cannot allocate memory in initGcHelpers(3)

I have tried all sorts of combinations of -X values I can think of,
with no difference - has anyone successfully managed to get this
combination to work?

Regards,
Graham
-- 
-
[EMAIL PROTECTED]There's a moon
over Bourbon Street
tonight...


smime.p7s
Description: S/MIME Cryptographic Signature


Tomcat v4.01 refuses to install on WinXP

2002-01-09 Thread Graham Leggett

Hi all,

I have had a long lasting headache trying to get the Installshield
version of Tomcat to install at all under Windows XP.

I have tried both the IBM JDK v1.3, and the Sun JDK (enterprise edition)
v1.3, and neither of these JDKs can be found by the Tomcat
Installshield. In both cases the error message is:

Couldn't find a Java Development Kit installed on this computer. Please
download one from http://java.sun.com;

There is nothing I can find in the release notes to say that XP is
specifically not supported, nor is there an explanation anywhere of
where Tomcat is trying to find the JDK (registry? environment? somewhere
else?), nor is there is an option to say point me at a JDK, which is a
pretty obvious pice of functionality to have.

I've just sold the concept of Tomcat to a bunch of people as being
pretty easy to use - so far it's impossible to use under windows, and
I'm pretty embarrassed about the whole thing. Is there some guiding
light anyone can share?

Regards,
Graham
-- 
-
[EMAIL PROTECTED]There's a moon
over Bourbon Street
tonight...


smime.p7s
Description: S/MIME Cryptographic Signature


Re: Tomcat v4.01 refuses to install on WinXP

2002-01-09 Thread Graham Leggett

[EMAIL PROTECTED] wrote:

 I don't use any installshield version, I use the nullsoft (who doesn't
 know WinAmp?) install version from the jakarta website.

Well... I am just assuming it is installshield but I could be wrong -
the file is called jakarta-tomcat-4.0.1.exe and I downloaded it from the
Jakarta website.

 I have tried both the IBM JDK v1.3, and the Sun JDK (enterprise edition)
 v1.3, and neither of these JDKs can be found by the Tomcat
 Installshield. In both cases the error message is:
 
 Couldn't find a Java Development Kit installed on this computer. Please
 download one from http://java.sun.com;
 
 No problem here on two development machines since 4.0 betas. Have you been
 tested JAVA_HOME and/or CLASSPATH?

All I have been doing is installing a default JDK, then running the
Tomcat install. In our previous testing we found that setting
environment variables was a waste of time - nothing we did made any
difference.

When we did it the hard way (ie install the zip file and fiddle with a
tonne of ugly batch files) everything worked - but our application needs
to be easy to install. Telling clients they need an entire day to
install something is not a solution for us - we need the installer-based
version to work.

Is there is a single person out there who can say that
jakarta-tomcat.4.0.1.exe has worked on Windows XP and a v1.3 JDK of any
kind? If so - what was the exact procedure you used?

Does anyone know what registry key the installer is looking for? Perhaps
we can set up this key manually as a workaround...?

Regards,
Graham
-- 
-
[EMAIL PROTECTED]There's a moon
over Bourbon Street
tonight...


smime.p7s
Description: S/MIME Cryptographic Signature


Tomcat installer cannot find IBM JDK

2001-12-13 Thread Graham Leggett

Hi all,

I just installed the IBM JDK v1.3 on a Windows 98 SE machine, then tried
to install Tomcat v4.0.1 from the .exe installer.

The installer complained that there was no JVM installed - when there
was. No clue was given by the installer as to why it could not find it,
or where it was looking.

Anyone else had a problem like this?

Regards,
Graham
-- 
-
[EMAIL PROTECTED]There's a moon
over Bourbon Street
tonight...


smime.p7s
Description: S/MIME Cryptographic Signature


Tomcat won't start: java.lang.ArrayStoreException

2001-12-09 Thread Graham Leggett

Hi all,

After upgrading my system (but not my Blackdown JDK v1.3.0 nor my Tomcat
v4.0.1) Tomcat suddenly refuses to start. The following exception is
thrown on startup in catalina.out:

  ERROR reading /var/tomcat4/conf/server.xml
  At Line 58 /Server/Service/Connector/
className=org.apache.catalina.connector.http.HttpConnector port=8180
minProcessors=5 maxProcessors=75 enableLookups=true redirectPort=8543
acceptCount=10 debug=0 connectionTimeout=6 

  Catalina.start: java.lang.ArrayStoreException
  java.lang.ArrayStoreException
  at java.lang.reflect.Method.copy(Method.java:280)
  at java.lang.reflect.Method.getParameterTypes(Method.java:90)
  at
org.apache.catalina.util.xml.SetProperties.setProperty(XmlMapper.java)
  at
org.apache.catalina.util.xml.SetProperties.start(XmlMapper.java)
  [snip]

This exact same config worked perfectly on the previous machine
(LinuxPPC YDL v1.2), but on the new machine (LinuxPPC YDL v2.1) there
are problems.

I am completely baffled, as this exception isn't telling me anything.
Can someone who understands the Tomcat code explain what is happening?

Regards,
Graham
--


smime.p7s
Description: S/MIME Cryptographic Signature


escape a URL within a sevlet - how?

2001-11-12 Thread Graham Leggett

Hi all,

I am trying to generate a set of name/value pairs that will be tacked
onto the end of a generated URL like this:

url.html?name1=value1name2=value2

These name value pairs have to be escaped first (problem characters
converted to %HH) before they are added to the URL - I am looking for an
object within either the servlet or jsp classes that will do this for me
(I cannot find such an object in the docs, although I might be looking
through it).

Can anyone point out an object I can use?

Regards,
Graham
-- 
-
[EMAIL PROTECTED]There's a moon
over Bourbon Street
tonight...


smime.p7s
Description: S/MIME Cryptographic Signature


Re: [ANNOUNCEMENT] Apache Tomcat 4.0.1

2001-10-19 Thread Graham Leggett

Peter Mutsaers wrote:

 What in the world do you need RPM's for?!?

RPMS enforce the correct way of doing things, which means that in six
months time when another admin takes over the machine they're not going
to find any surprises.

Regards,
Graham
-- 
-
[EMAIL PROTECTED]There's a moon
over Bourbon Street
tonight...
 S/MIME Cryptographic Signature


Re: Tomcat spawning multiple processes under Linux

2001-09-25 Thread Graham Leggett

Tor Arne Benjaminsen wrote:

 I've tried both 3.2.3 and 4.0, and both spawn a varying number
 of processes, usually between 10 and 25, like this:

They aren't processes, they are threads. Within Linux, threads and
processes are treated in very similar ways which is why you see them
listed like that, but the most important difference between them being
that threads share the same memory space - which to you means that
tomcat can do 25 things at once, rather than take up 25 times as much
RAM as needed for one.

Regards,
Graham
-- 
-
[EMAIL PROTECTED]There's a moon
over Bourbon Street
tonight...
 S/MIME Cryptographic Signature


Re: Using tomcat as a proxy

2001-09-25 Thread Graham Leggett

Donie Kelly wrote:

 We have a HTTP application written in C and we now need to add https
 support. I was thinking that we could use tomcat as a proxy to accept the
 request on one side and forward it over https...
 
 Any ideas on how we could do this? We could use apache using mod_proxy (I
 think) but tomcat is already in use on the target machine so it would be
 better to use it.

Apache + mod_ssl + mod_proxy works great for this.

Regards,
Graham
-- 
-
[EMAIL PROTECTED]There's a moon
over Bourbon Street
tonight...
 S/MIME Cryptographic Signature


Re: jasperLog - what does it do?

2001-09-22 Thread Graham Leggett

Craig R. McClanahan wrote:

 Do you by chance have pieces of Tomcat in your system classpath, or your
 system extensions directory ($JAVA_HOME/jre/lib/ext)?

I discovered that there were pieces of jasper and some other .jar files
in the servlet directory I was given. Going through these jar files and
eliminating most of them solved the problem of the jasperLog - and got
to the point where the app was running...

Some success at last :)

Regards,
Graham
-- 
-
[EMAIL PROTECTED]There's a moon
over Bourbon Street
tonight...
 S/MIME Cryptographic Signature


Directories - best practice

2001-09-22 Thread Graham Leggett

Hi all,

While configuring a to-be-deployed servlet, I have noticed that the
programmer has placed absolute pathnames in a number of places within
the parameters in web.xml, and within the log4j configuration file.

Some experimentation has revealed that the default directory of a given
servlet is the same directory that tomcat was started from - in my case
/var/tomcat4/bin.

What is the correct way of defining directories in config files (like
web.xml), preferably without the need to use absolute paths...?

Regards,
Graham
-- 
-
[EMAIL PROTECTED]There's a moon
over Bourbon Street
tonight...
 S/MIME Cryptographic Signature


load-on-startup and Tomcat v4.0

2001-09-21 Thread Graham Leggett

Hi all,

I have just been trying to get a servlet application transferred from
Tomcat v3.2 to v4.0. It's worked fine before with v3.2, but on starting
v4.0, I get an error like so:

org.xml.sax.SAXParseException: Element servlet does not allow
load-on-startup here.

Unfortunately the error message does state where here is, however I do
have it defined like so:

  servlet
servlet-name/servlet-name
servlet-classXXX/servlet-class
init-param
  param-nameYYY/param-name
  param-valueZZZ/param-value
/init-param
load-on-startup1/load-on-startup
  /servlet

And a second similar container with
load-on-startup2/load-on-startup.

I have been trawling the docs to find out how the load-on-startup is
supposed to work, but can find no details (I set up servers, but I don't
program java :( )...

Can anyone shed some light?

Regards,
Graham 
-- 
-
[EMAIL PROTECTED]There's a moon
over Bourbon Street
tonight...
 S/MIME Cryptographic Signature


Re: load-on-startup and Tomcat v4.0

2001-09-21 Thread Graham Leggett

Craig R. McClanahan wrote:

 As a general note, Tomcat 4 uses a validating XML parser when reading
 web.xml files, to help you ensure that your web apps will be portable to
 any container.  A consequence of this is that you must follow the element
 ordering requirements in the DTD *exactly*.  Tomcat 3.2 did not do a
 validating parse, so it accepted invalid web.xml files.

This is probably the problem - in the root web.xml load-on-startup was
last, and in the stuff supplied to me load-on-startup was first.

Having fixed this though a new problem has arisen:

I'm getting this in the logfile suddenly:

2001-09-21 12:27:21 StandardWrapper[:jsp]: Using Jasper classloader for
servlet jsp
2001-09-21 12:27:21 StandardWrapper[:jsp]: Marking servlet jsp as
unavailable
2001-09-21 12:27:21 StandardContext[]: Servlet  threw load() exception
javax.servlet.ServletException: Class
org.apache.jasper.servlet.JspServlet is not a Servlet
[snip]

2001-09-21 12:56:18 StandardWrapper[/thh:feersum]: Marking servlet
feersum as unavailable
2001-09-21 12:56:18 StandardContext[/thh]: Servlet /thh threw load()
exception
javax.servlet.ServletException: Class
com.bitr8.feersumenjin.control.web.MainServlet is not a Servlet
[snip]

I understood from the docs that Tomcat v4.0 was backwards compatible -
yet it complains that all of the servlets it's supposed to run are not
servlets - does this make sense to anyone? Is there something missing
that I should be configuring?

Regards,
Graham
-- 
-
[EMAIL PROTECTED]There's a moon
over Bourbon Street
tonight...
 S/MIME Cryptographic Signature


jasperLog - what does it do?

2001-09-21 Thread Graham Leggett

Hi all,

While starting up a servlet that uses Jasper, it refuses to load with
the following error:

2001-09-21 16:37:09 StandardContext[/thh]: Servlet /thh threw load()
exception
javax.servlet.ServletException: Servlet.init() for servlet jsp threw
exception
[snip]
- Root Cause -
java.lang.NoSuchFieldError: org.apache.jasper.Constants: field jasperLog
not found
[snip]

I am assuming a parameter needs to be set in the config somewhere, but
I'm at a loss as to where to look. Is there any configuration docs for
Jasper anywhere?

Regards,
Graham
-- 
-
[EMAIL PROTECTED]There's a moon
over Bourbon Street
tonight...
 S/MIME Cryptographic Signature


mod_jk / tomcat webserver 404 weirdness

2001-09-14 Thread Graham Leggett

Hi,

I am having some grief with a new tomcat/mod_jk installation. I've
installed the required context in server.xml, and have used the
auto-generated apache mod_jk config file to taylor httpd.html.

The configured URL works great from the tomcat webserver running on port
8080 by default, but accessing the URL through Apache and mod_jk results
in an error 404 in the Apache logfile. A packet sniff on port 8009
indicates no traffic at all - which suggests to me that the Apache side
is broken, but I don't understand this stuff clearly enough yet to see
through the fog, and the FAQ hasn't yielded any clues. I have put the
following into the relevant virtual host config on Apache:

  Alias /thh /var/tomcat/webapps/thh
  Directory /var/tomcat/webapps/thh
Options Indexes FollowSymLinks
  /Directory
  JkMount /thh/servlet/* ajp13
  JkMount /thh/*.jsp ajp13
  Location /thh/WEB-INF/
AllowOverride None
deny from all
  /Location
  Location /thh/META-INF/
AllowOverride None
deny from all
  /Location

The context in the server.xml file looks like this:

Context path=/thh 
 docBase=webapps/thh 
 crossContext=true
 debug=0 
 reloadable=true 
 trusted=false  
/Context

In the mod_jk.log file there have been some strange messages logged -
but there is no indication of whether these messages are just debug
informational statements, or whether they indicate an error condition of
some kind:

[jk_uri_worker_map.c (335)]: jk_uri_worker_map_t::uri_worker_map_close,
NULL parameter
[jk_uri_worker_map.c (185)]: In
jk_uri_worker_map_t::uri_worker_map_free, NULL parameters

Does this ring any bells with anyone? Just how stable is mod_jk - as an
alternative we've been considering hiding the tomcat webserver behind
Apache mod_proxy instead of using mod_jk - any comments on this
alternative config? 

Regards,
Graham
-- 
-
[EMAIL PROTECTED]There's a moon
over Bourbon Street
tonight...
 S/MIME Cryptographic Signature


Re: mod_jk / tomcat webserver 404 weirdness

2001-09-14 Thread Graham Leggett

Tony Vinayak wrote:

 Doesn't look like the request made it to Tomcat at all.
 
 - What does Apache's error/access log indicate regarding the request?

The access log indicates error 404. The error log indicates:

[Fri Sep 14 05:52:44 2001] [error] [client 213.122.48.138] File does not
exist: /var/tomcat/webapps/thh/feersum/healthbar/bloomsbury/home.html

 - What's the browser URL that you are using to access your servlet?

/thh/feersum/healthbar/bloomsbury/home.html

 - What does the web.xml look like?

The web.xml is the default that came with tomcat (it is attached).

Regards,
Graham
--

 -Original Message-
 From: minfrin [mailto:minfrin]On Behalf Of Graham Leggett
 Sent: Friday, September 14, 2001 7:38 AM
 To: Tomcat User
 Subject: mod_jk / tomcat webserver 404 weirdness
 
 Hi,
 
 I am having some grief with a new tomcat/mod_jk installation. I've
 installed the required context in server.xml, and have used the
 auto-generated apache mod_jk config file to taylor httpd.html.
 
 The configured URL works great from the tomcat webserver running on port
 8080 by default, but accessing the URL through Apache and mod_jk results
 in an error 404 in the Apache logfile. A packet sniff on port 8009
 indicates no traffic at all - which suggests to me that the Apache side
 is broken, but I don't understand this stuff clearly enough yet to see
 through the fog, and the FAQ hasn't yielded any clues. I have put the
 following into the relevant virtual host config on Apache:
 
   Alias /thh /var/tomcat/webapps/thh
   Directory /var/tomcat/webapps/thh
 Options Indexes FollowSymLinks
   /Directory
   JkMount /thh/servlet/* ajp13
   JkMount /thh/*.jsp ajp13
   Location /thh/WEB-INF/
 AllowOverride None
 deny from all
   /Location
   Location /thh/META-INF/
 AllowOverride None
 deny from all
   /Location
 
 The context in the server.xml file looks like this:
 
 Context path=/thh
  docBase=webapps/thh
  crossContext=true
  debug=0
  reloadable=true
  trusted=false 
 /Context
 
 In the mod_jk.log file there have been some strange messages logged -
 but there is no indication of whether these messages are just debug
 informational statements, or whether they indicate an error condition of
 some kind:
 
 [jk_uri_worker_map.c (335)]: jk_uri_worker_map_t::uri_worker_map_close,
 NULL parameter
 [jk_uri_worker_map.c (185)]: In
 jk_uri_worker_map_t::uri_worker_map_free, NULL parameters
 
 Does this ring any bells with anyone? Just how stable is mod_jk - as an
 alternative we've been considering hiding the tomcat webserver behind
 Apache mod_proxy instead of using mod_jk - any comments on this
 alternative config?
 
 Regards,
 Graham
 --
 -
 [EMAIL PROTECTED]There's a moon
 over Bourbon Street
 tonight...

-- 
-
[EMAIL PROTECTED]There's a moon
over Bourbon Street
tonight...

?xml version=1.0 encoding=ISO-8859-1?

!DOCTYPE web-app
PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN
http://java.sun.com/j2ee/dtds/web-app_2_2.dtd;

web-app
servlet
servlet-name
default
/servlet-name
servlet-class
org.apache.tomcat.servlets.DefaultServlet
/servlet-class
load-on-startup
-2147483646
/load-on-startup
/servlet
servlet
servlet-name
invoker
/servlet-name
!--
org.apache.tomcat.servlets.NoInvokerServlet
--
servlet-class
org.apache.tomcat.servlets.InvokerServlet
/servlet-class
/servlet
servlet
servlet-name
jsp
/servlet-name
servlet-class
org.apache.jasper.runtime.JspServlet
/servlet-class

!-- uncomment the following to use Jikes for JSP compilation

init-param
param-namejspCompilerPlugin/param-name
param-valueorg.apache.jasper.compiler.JikesJavaCompiler/param-value
/init-param

--

load-on-startup
-2147483646
/load-on-startup
/servlet
servlet-mapping
servlet-name
invoker
/servlet-name
url-pattern
/servlet/*
/url-pattern
/servlet-mapping
servlet-mapping
servlet-name
jsp
/servlet-name
url-pattern
*.jsp
/url-pattern
/servlet-mapping
session-config
session-timeout
30
/session-timeout
/session-config
mime-mapping
extension
txt
/extension
mime-type
text/plain
/mime-type
/mime-mapping
mime-mapping

Re: mod_jk / tomcat webserver 404 weirdness

2001-09-14 Thread Graham Leggett

Tony Vinayak wrote:

 Since your browser URI is /thh/feersum/healthbar/bloomsbury/home.html, you
 don't have a corresponding JkMount in your httpd.conf file. None of your
 current defs:
 
  JkMount /thh/servlet/* ajp13
  JkMount /thh/*.jsp ajp13
 
 will cause the browser URI to be redirected to Tomcat.
 
 Try with the following:
 
 JkMount /thh/* ajp13

It works now - great! I didn't fully understand the implications of what
my java programmer was doing (they make the stuff, I make it live) - I
didn't realise the significance of the jsp extension and that in our
case it wasn't being used.

Thanks hugely for the help!

Regards,
Graham 
-- 
-
[EMAIL PROTECTED]There's a moon
over Bourbon Street
tonight...
 S/MIME Cryptographic Signature