Re: Newbie Request: an Example Ant build.xml File

2001-08-04 Thread Craig R. McClanahan



On Sat, 4 Aug 2001, Daniel Hinojosa wrote:

> The ant documentation is where I learned all my stuff.
> 
> [EMAIL PROTECTED] wrote:
> 
> > Being new to both Ant and Tomcat, I'm wondering if someone could point
> > me to a good example of an Ant build.xml for for building and deploying
> > servlets under Tomcat. Thanks for your help. (I looked for this in the
> > faqs but couldn't find any relevant info.)
> >
> > Chuck
> 
> 

There is also an "Application Developer's Guide" included with Tomcat that
has just such an example build.xml file.  It's available from the "Tomcat
Documentation" link on the home page when you start Tomcat.

The most recent version of this document (it references Tomcat 4 but is
almost completely compatible with Tomcat 3.2 as well) is available online
at:

  http://jakarta.apache.org/tomcat/tomcat-4.0-doc-exp/appdev/

This version of the Guide has been updated to take advantage of the new
features in Ant 1.3, such as automatically constructing compile classpaths
for you.  This is *much* more useful than constantly twiddling with
environment variables.

Craig McClanahan





Re: Newbie Request: an Example Ant build.xml File

2001-08-04 Thread Daniel Hinojosa

The ant documentation is where I learned all my stuff.

[EMAIL PROTECTED] wrote:

> Being new to both Ant and Tomcat, I'm wondering if someone could point
> me to a good example of an Ant build.xml for for building and deploying
> servlets under Tomcat. Thanks for your help. (I looked for this in the
> faqs but couldn't find any relevant info.)
>
> Chuck




Re: tomcat 4 datasources

2001-08-04 Thread Craig R. McClanahan



On Fri, 3 Aug 2001, Matt Barre wrote:

> I know there is a way to configure DataSources using tomcat 4's
> server.xml file. I've tried using the default examples to create my
> own, but so far I haven't had any luck. The docs for this portion of
> the project appear to not have been written yet. Can anyone point me
> toward a resource where I can learn more about them?
> 
> Matt
> 
> 

The example in the "conf/server.xml" file is almost but not quite
right.  It should look like this:



  ...

  
  

  user
  .  


  password
  .  


  driverClassName
  org.hsql.jdbcDriver


  driverName
  jdbc:HypersonicSQL:database 

  

  ...



This example assumes that you're using the Hypersonic database and JDBC
driver (which must be in $CATALINA_HOME/common/lib so that it is visible
to both the Catalina internal classes and your application).

>From your web application's perspective, this registration configures a
data source (i.e. connection pool) that you can reference and use on
Tomcat exactly the way you can use data sources on J2EE servers.  First,
in your web.xml file, you would include something like this:



  ...

  
Employee Database
jdbc/EmployeeAppDb
javax.sql.DataSource
Container
Shareable
  

  ...



Now, in your servlet, you can use a Connection from the pool like this:

  import java.sql.Connection;
  import javax.naming.Context;
  import javax.sql.DataSource;

  ...

  Context initialContext = new InitialContext();
  DataSource dataSource = (DataSource)
   initialContext.lookup("java:comp/env/jdbc/EmployeeAppDb");
  Connection conn = dataSource.getConnection();
  ... use the connection to access the database ...
  conn.close();  // Returns the connection to the pool

NOTE:  In order to use this capability, you also need a "data source"
implementation.  By default, Tomcat 4 expects to use Tyrex 0.9.7, which
you can download from .  Place the Tyrex JAR file
into the "$CATALINA_HOME/common/lib" directory, along with the JDBC
driver.

Craig McClanahan

PS:  If you try this with Tomcat 4.0 beta 6, or any nightly build prior to
20010805, you will find that Tomcat doesn't include all the necessary
classes in the binary distribution, so you'll have to build it from
source.  From nightly build 20010805 on, the required interface classes
*are* included.

PPS:  I haven't tried it yet, but Servlet 2.3 (and J2EE 1.3) introduce a
new  element for web.xml that is simpler to
configure.  It should be possible to replace the  element
above with:

  
Employee Database
jdbc/EmployeeAppDb
javax.sql.DataSource
  






Movimiento Humanista

2001-08-04 Thread José Gabriel Feres N.

Hola amigo(a)
Mi nombre es José Gabriel Feres (Pepe), soy chileno, vivo en Santiago y tome 
tu direccion electronica de un directorio de Internet. Participo desde hace varios 
años en el Movimiento Humanista y quiero hacerte una invitación y solicitar tu 
ayuda.

El Movimiento Humanista desarrolla acciones en contra de la injusticia, la 
explotacion, 
la discriminacion y la violencia instaladas en la sociedad por una minoría opresora 
que crece en sus beneficios a medida que se deteriora la vida de las grandes 
mayorias. No somos una ONG, sino que somos una estructura humana que lucha en 
distintos frentes de accion para cambiar el actual estado de cosas.

Cuestionamos el inhumano estilo de vida de la sociedad actual y damos especial 
importancia a las relaciones interpersonales y a la superación del dolor y el 
sufrimiento personal y social.

Quiero invitarte a que te sumes con nosotros y nos ayudes a desarrollar el Movimiento 
en México.Si te interesas escribeme a [EMAIL PROTECTED]

Un cordial abrazo. Pepe F.


José Gabriel Feres N.
[EMAIL PROTECTED]
Movimiento Humanista
Fono/fax: (562) 2746948
http://www.mdnh.org






Solved (was: RE: big5 problem with Tomcat on RedHat 7.1)

2001-08-04 Thread Aravind Naidu

Solved the problem. For others interested.
By default Tomcat 3.2.1 uses a 8859-1 and 3.2.3 ISO-8859-1 and just
explicitly setting the page directive in the JSP overcame the problem.

<%@ page contentType="text/html; charset=big5" %>

-- Aravind


-Original Message-
From: Aravind Naidu [mailto:[EMAIL PROTECTED]]
Sent: Saturday, 4 August 2001 21:42
To: [EMAIL PROTECTED]
Subject: big5 problem with Tomcat on RedHat 7.1



This may not be Tomcat's problem but I am hoping someone will point me in
the right direction.

I have 2 installations, one Tomcat 3.2.1 on RedHat 6.2 and the other Tomcat
3.2.3 on RedHat 7.1

I have a JSP file with the following tag


The RedHat 6.2 machine delivers Big5 characters properly, while the RedHat
7.1's Tomcat server does not.

Environment is that Tomcat is standalone and the JDK is IBM 1.3

-- Aravind




Re: Will Tomcat 3.3 conf\apps*.xml style work in Tomcat 4?

2001-08-04 Thread Craig R. McClanahan



On Sat, 4 Aug 2001, Randall Parker wrote:

> I see in the Tomcat 3.3b1 that to make deployment configs easier to maintain Tomcat 
>3.3 supports Context 
> xml tags in 
>apps-.xml
>  where  is the name of a war file. 
> 
> This is really nice. One doesn't have to put info about a bunch of different war 
>files into server.xml. 
> 
> So can Tomcat 4.0 do this as well?
> 

No.  XML provides mechanisms to combine multiple config files into a
single file (or you can just do this in a wrapper script around the
standard Tomcat startup script), so it's not really necessary for a server
to support it.

On the other hand, Tomcat 4 does support the concept of a 
to establish default properties for all of the web apps that are not
configured explicitly.  This can often eliminate the requirement for
explicit per-application configuation in the first place.

For example, to make all of your web apps automatically reloadable, you
would stick this inside a  element:

  

Craig McClanahan





Re: Please help: IllegalArgumentException: Response is not a ServletResponseWrapper

2001-08-04 Thread Craig R. McClanahan



On Sat, 4 Aug 2001, Levent Gündogdu wrote:

> Hi everyone,
> 
> I would be so happy if someone could help me with the following problem:
> 
> I have written a Servlet which is able to do background calculations which
> take some time. I don't want the user to wait for the request to complete,
> so I decided to start a thread and output a message to the user so that he
> may continue to work with the
> application until the calculations have been made. So far so good.
> 
> The output of the calculation is somewhat complex. In the first approach the
> thread created a StringBuffer, put everything into that buffer and, after
> completion, that StringBuffer was sent to the user. That worked fine, but:
> 
> I want the thread to be able to include JSPs in order to format the output.
> For including some URI, I need a ServletRequest and ServletResponse object
> which are passed to RequestDispatcher.include(). I decided to implement own
> versions of ServletRequest and ServletResponse, so that I could overwrite
> getWriter() and getOutputStream() in order to put the output into my own
> buffer. But, when calling RequestDispatcher.include(), I get:
> 
> IllegalArgumentException: Response is not a
> javax.servlet.ServletResponseWrapper.
> 
> thrown in ApplicationResponse.calculateParent().
> 
> Why has the ServletReponse to be a ServletResponseWrapper?
> 

Because it's required by the spec.

The deeper issue is that your extra thread is "pretending" (from the
point of view of the JSP pages you're trying to use) to be a servlet
container, but it is only doing part of the job.

> I tried wrapping my ServletResponse with a ServletResponseWrapper but still
> the same exception occurs.
> 
> I thought that defining interfaces (like ServletResponse) is good for
> abstracting things and allowing developers to replace functionality. But in
> this case abstraction gets meaningless.
> 

The abstraction would be fine ... if your calling class did it's part of
the bargain.  But that means you have to act (from the perspective of the
JSP page you're calling) like you are Tomcat.

An additional problem you will run into, even if you solve this one, is
that the request object cannot be shared across threads either.


> Do you have any idea how to solve that?
> 

A completely different strategy would be to have your extra thread do its
computations and store the data to create the results into a session
attribute.  Then, when your user asked for the page to display the
results, the calculations would have already been completed (or, if the
attribute isn't there, you can display a "still working on it ..." page),
the response can be displayed in the usual way.

> Thanks in advance, everyone!
> 
> Bye,
>  Levo.
> 
> BTW: I'm using tomcat 4.0 b5.
> 
> 

Craig McClanahan




Will Tomcat 3.3 conf\apps*.xml style work in Tomcat 4?

2001-08-04 Thread Randall Parker

I see in the Tomcat 3.3b1 that to make deployment configs easier to maintain Tomcat 
3.3 supports Context 
xml tags in 
   apps-.xml
 where  is the name of a war file. 

This is really nice. One doesn't have to put info about a bunch of different war files 
into server.xml. 

So can Tomcat 4.0 do this as well?







Per War settings not in the War for per site config customization?

2001-08-04 Thread Randall Parker

I want to have settings/properties that are for a particular WAR file but that are for 
a particular install (ie a particular server at 
a particular site). 

As I see it per site customization properties file should not go in the WAR itself as 
then the user would have to unpack the 
war and edit the file and then every new WAR version update would require messing 
around with saving and restoring that 
file before and after each update of a war is installed.

So where can one put settings that code in a single a war will be able to get access 
to?

I see in Tomcat 3.3b1 that in the TOMCAT_HOME\conf dir one can use apps-.xml 
files where  is for .war. 
Is this only for doing the Context tag for path and docBase? Or can one put one's own 
tags or attributes in there inside
the Context? If so, then how would one access those settings from a servlet?

Also, is the answer any different for 3.3 vs 4.0?







Re: Using Tomcat with MSAccess

2001-08-04 Thread Randall Parker

You ought to fire up a debugger and debug this. 

Also, you could add some code in your catch to your insert statement that would write 
output to a log file. 

As for MS Access and JDBC: I've had some problems with this where resource leakage 
would eventually cause the JDBC calls to slow to a crawl. I've tried closing every 
resource when done 
with it. That just delayed the ultimate slowdown. I haven't tried recently though so 
maybe JDK 1.3.1 has a fix for it. Still, I would advise using a different RDBMS. There 
are high quality free ones 
but if you don't mind paying I think Sybase ASA (not ASE which is the big one) for 
small to medium size projects is excellent.

On Fri, 3 Aug 2001 22:09:12 -0400, Jeffrey Worst wrote:

>I'm writing an applet using Tomcat to register new members for a library.
>Everything works fine until I get to the part where the new information is
>being inserted into the MSAccess DB.  I have commented below where the error
>occurs.  Any help would be appreciated.






Status? Mod_jk as static module

2001-08-04 Thread Robert Schmid

Back in April someone said that it was inadvisable to compile mod_jk as a 
static module because it was changing too quickly.  In June someone said it 
was possible but didn't illustrate the best method to do so.

Is it stable enough to be compiled as static module now?  What's the best 
way to do it?




Re: TESTING Tomcat and Apache together........

2001-08-04 Thread Kyle Wayne Kelly

Open a static page on your server, and then open a JSP or servlet.

Kyle Wayne Kelly
(504)391-3985
http://www.cs.uno.edu/~kkelly
- Original Message - 
From: "Paul Davies" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, August 04, 2001 10:54 AM
Subject: TESTING Tomcat and Apache together


> Hi, 
> how can I test that Apache and Tomcat are properly
> connected to each other.  As I understand, Apache
> takes care of static pages, and passes dynamic ones to
> tomcat.  How can I test this?
> Cheers,
> Paul
> 
> 
> 
> Do You Yahoo!?
> Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
> or your free @yahoo.ie address at http://mail.yahoo.ie
> 





TESTING Tomcat and Apache together........

2001-08-04 Thread Paul Davies

Hi, 
how can I test that Apache and Tomcat are properly
connected to each other.  As I understand, Apache
takes care of static pages, and passes dynamic ones to
tomcat.  How can I test this?
Cheers,
Paul



Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie



big5 problem with Tomcat on RedHat 7.1

2001-08-04 Thread Aravind Naidu


This may not be Tomcat's problem but I am hoping someone will point me in
the right direction.

I have 2 installations, one Tomcat 3.2.1 on RedHat 6.2 and the other Tomcat
3.2.3 on RedHat 7.1

I have a JSP file with the following tag


The RedHat 6.2 machine delivers Big5 characters properly, while the RedHat
7.1's Tomcat server does not.

Environment is that Tomcat is standalone and the JDK is IBM 1.3

-- Aravind





Netscape 6.1 cookie problems.

2001-08-04 Thread jason

I am running Netscape 6.1 preview release 1 on Redhat 7.0 using Tomcat
3.2
Either the servlet container is not sending cookies or the browser is
not acknowledging them.
This is not a trivial preferences problem ; I receive cookies as
expected when surfing other sources.
I do not experience these problems with Netscape 4.75

Any ideas please?

Jason.



Please help: IllegalArgumentException: Response is not a ServletResponseWrapper

2001-08-04 Thread Levent Gündogdu

Hi everyone,

I would be so happy if someone could help me with the following problem:

I have written a Servlet which is able to do background calculations which
take some time. I don't want the user to wait for the request to complete,
so I decided to start a thread and output a message to the user so that he
may continue to work with the
application until the calculations have been made. So far so good.

The output of the calculation is somewhat complex. In the first approach the
thread created a StringBuffer, put everything into that buffer and, after
completion, that StringBuffer was sent to the user. That worked fine, but:

I want the thread to be able to include JSPs in order to format the output.
For including some URI, I need a ServletRequest and ServletResponse object
which are passed to RequestDispatcher.include(). I decided to implement own
versions of ServletRequest and ServletResponse, so that I could overwrite
getWriter() and getOutputStream() in order to put the output into my own
buffer. But, when calling RequestDispatcher.include(), I get:

IllegalArgumentException: Response is not a
javax.servlet.ServletResponseWrapper.

thrown in ApplicationResponse.calculateParent().

Why has the ServletReponse to be a ServletResponseWrapper?

I tried wrapping my ServletResponse with a ServletResponseWrapper but still
the same exception occurs.

I thought that defining interfaces (like ServletResponse) is good for
abstracting things and allowing developers to replace functionality. But in
this case abstraction gets meaningless.

Do you have any idea how to solve that?

Thanks in advance, everyone!

Bye,
 Levo.

BTW: I'm using tomcat 4.0 b5.


--
Feature-IT Information Technology

eMail: [EMAIL PROTECTED]

http://www.feature-it.de  (Deutsch)
http://www.feature-it.com (English)

Phone: +49 511 95981-0
Fax:   +49 511 95981-40








Re: ref: JRE

2001-08-04 Thread Tim O'Neil

At 01:14 PM 8/2/2001, you wrote:
>Let me elaborate about my requirements. I have created a set-up that uses
>the jre 1.3 but when I start tomcat I get errors about class files not being
>instantiated. If I install tomcat using the jdk then I do not get those
>errors. This lead me to believe that you need the full jdk to install and
>run Tomcat.
>
>Is this correct?


Yeah. You need javac, jsp's are compiled on the fly.