Re: Virtual Hosting and SSL

2005-10-11 Thread David Smith
Try address=192.168.56.32 or whatever IP you want tomcat to bind to. 
The port attribute will do the same thing for defining what port number
to bind to.

--David

Justin Jaynes wrote:

I DID try, but there is no IP address attribute for
connector elements. .. at least not in the
documentation listed on the 5.5 documentation /
configuration setup.

How would I do it?  Can you please indicate the
syntax?

Thanks, Justin

--- Hassan Schroeder [EMAIL PROTECTED] wrote:

  

Justin Jaynes wrote:


I am running tomcat 5.5.12 and need to host two
  

sites,


both with ssl.  
  

Can you set up two connectors (one port 443 and
  

one


port 80) for one specific ip address and another
  

set


of connectors for another ip address? 
  

Yes. :-)

That's exactly what you need to do. Try it, ask if
you run into a
specific problem...

-- 
Hassan Schroeder -
[EMAIL PROTECTED]
Webtuitive Design ===  (+1) 408-938-0567   ===
http://webtuitive.com

  dream.  code.






-
  

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







   
   
__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.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: cannot setup JNDI with MySQL

2005-10-06 Thread David Smith
Hmmm...  I haven't read that tutorial in a while but if that's what it
says, it's wrong.  The Resource and ResourceParams elements should
be placed between Context and /Context tags of your context xml
file.  That would make the resource only available to that one
application as opposed to being available to all webapps in that Tomcat
instance.

--David

John Cherouvim wrote:

 Thanks for your answers.

 I can connect to MySQL using any mysql tool and even with telnet
 localhost 3306 from the command line. I even tried connecting to
 another mysql server running on another pc in my LAN but nothing.

 @andy: yes I have placed mysql-connector-java-3.1.10-bin.jar in
 common\lib and I also tried with different (older) versions. I've been
 leaving only one of them of course each time I tried.

 I finally managed to solve the problem.
 I needed to place:
Resource name=jdbc/TestDB type=javax.sql.DataSource/
ResourceParams name=jdbc/TestDB
  parameter nameurl/name
 valuejdbc:mysql://localhost:3306/dea?autoReconnect=true/value
 /parameter
  parameter namepassword/name valuejohn/value /parameter
  parameter namemaxActive/name value4/value /parameter
  parameter namemaxWait/name value5000/value /parameter
  parameter namedriverClassName/name
 valuecom.mysql.jdbc.Driver/value /parameter
  parameter namemaxIdle/name value2/value /parameter
  parameter nameusername/name valuejohn/value /parameter
/ResourceParams

 somewhere in the GlobalNamingResources element of my server.xml.
 The tutorial at
 http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html
 says:
 Add this in between the |/Context| tag of the examples context and
 the |/Host| tag closing the localhost definition.

 Which I cannot understand where exctly it means. I was always trying
 to place it somewhere inside the Host element which was not working
 for me.

 I solved the problem by adding the DataSource from the administration
 tool of tomcat and then I went to server.xml to see how it did it.

 Regards,
 J.


 Hassan Schroeder wrote:

 John Cherouvim wrote:

  

 I've been trying to setup a mysql connection pool using JNDI as
 shown in
 http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html

 But no luck.
   


  

 *What I get in tomcat\logs\stdout.log is:
 NotifyUtil::java.net.ConnectException: Connection refused: connect
   at java.net.PlainSocketImpl.socketConnect(Native Method)
   


 A Connection refused sounds like your driver config is fine but
 either MySQL isn't running, it's configured with skip-networking,
 or you've got a firewall/iptables/whatever issue.

 Can you connect (`telnet localhost 3306`) from the command line?

  



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



-- 
===
David Smith
Network Operations Supervisor
Department of Entomology
College of Agriculture  Life Sciences
Cornell University
2132 Comstock Hall
Ithaca, NY  14853
Phone: 607.255.9571
Fax: 607.255.0939


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



Re: Context path changes in context.xml not working

2005-10-05 Thread David Smith
Intended behavior.  path attributes are ignored in context xml files.

If you'd like to change the name of the webapp, I'd suggest changing the
name of the .war file to change it's name.  If you aren't working with
.war files, change the name of the webapp folder and then the name of
it's context xml file located in config/Catalina/localhost.  Restart
tomcat and you're done.

--David

David Kerber wrote:

 Running Tomcat 5.5.9 on Windows 2000 server.

 I am trying to change the context path of an application, and it works
 fine when I put this into my server.xml:

  Context path=/wradev/pelican
 docBase=e:\TomcatClients\Pelican\webapps\SiteData debug=0
 reloadable=true autoDeploy=true unpackWARs=true
 crossContext=false/

 According to the docs, putting this into the server.xml is not the
 preferred way, but when I put it into my
 webapps/SiteData/META-INF/context.xml, it doesn't seem to take effect,
 even when I stop and restart Tomcat.

 Is there something I'm missing here?  Or is it a bug which will be
 fixed in a later release.

 Dave

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



-- 
===
David Smith
Network Operations Supervisor
Department of Entomology
College of Agriculture  Life Sciences
Cornell University
2132 Comstock Hall
Ithaca, NY  14853
Phone: 607.255.9571
Fax: 607.255.0939


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



Re: Aliases for JNDI (JDBC) resources?

2005-10-03 Thread David Smith
To be honest, I think touching the server.xml is the only way to do
this.  Declare it as a global resource in server.xml and then declare a
resource link in all the contexts that need access.

--David

Lisa L. Woodring wrote:

I would like to create aliases for a JNDI (specifically, a JDBC)
resource, such that I can use multiple names to connect to the same
database -- and be able to use the same (i.e. only 1) connection pool
for that database.  I haven't been able to find anything on how/if this
is possible.  (I would like to be able to specify it all in context.xml
 not touch server.xml if possible.)  Any suggestions??

In other words, be able to do something to this effect (in context.xml):

Resource name=jdbc/actual_db_name auth=Container
type=javax.sql.DataSource
  driverClassName=org.postgresq.Driver   
  url=jdbc:postgresql://machine/actual_db_name
  maxActive=100 maxIdle=5  ...other parms...  /

alias link=jdbc/alias1 resource=jdbc/actual_db_name /
alias link=jdbc/alias2 resource=jdbc/actual_db_name /

Then use the jdbc/alias1 and jdbc/alias2 names in my code.


Lisa Woodring
Software Engineer, iGLASS Networks




  



-- 
===
David Smith
Network Operations Supervisor
Department of Entomology
College of Agriculture  Life Sciences
Cornell University
2132 Comstock Hall
Ithaca, NY  14853
Phone: 607.255.9571
Fax: 607.255.0939


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



Re: Running Tomcat as Non-Root under Linux listen for port 80

2005-09-27 Thread David Smith
a.k.a. Commons-Daemon (http://jakarta.apache.org/commons/daemon/)

Works beautifully.

--David

Andrés Glez. wrote:

 Use jsvc.

 - Original Message - From: NoKideen [EMAIL PROTECTED]
 To: tomcat-user@jakarta.apache.org
 Sent: Tuesday, September 27, 2005 6:13 PM
 Subject: Running Tomcat as Non-Root under Linux listen for port 80


 is there anybody know how to do this ?
 Running Tomcat as Non-Root under Linux listen for port 80

 I'd try as tomcat , but there is error even if I do
 # chown -R tomcat:root /usr/tomcat/*


 -
 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: HOW DOES TOMCAT JNDI CONNECTION POOLING WORKS

2005-09-23 Thread David Smith
1. Does tomcat really look into the pool?

Yes.  The pool code is really the commons DBCP project code refactored
slightly to avoid collisions with the real DBCP project code.

2. on conn.close(), are we really pushing the connection back into the pool?

Yes.

Sorry I can't help you on the Eclipse debugger question since I don't
use it.  It may be an artifact of the debugger or maybe DBCP's code. 
You might find the DBCP project documentation helpful in answering these
questions though.

--David

rahul wrote:

Hi all,
My questing is derived from the sample code given
at :
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-how
to.html#Database%20Connection%20Pool%20(DBCP)%20Configurations


If you can see the subsection 4(i.e. testcode) of section MySQL DBCP
Example,
to get a connection following code is used:
***
Context ctx = new InitialContext();
if(ctx == null )
throw new Exception(Boom - No Context);
DataSource ds =
(DataSource)ctx.lookup(
java:comp/env/jdbc/TestDB);
if (ds != null) {
Connection conn = ds.getConnection();
***

I guess by doing this a connection is obtained FROM THE POOL providing that
a connection is free in the pool.

I have got two questions regarding this-

Q 1. Does tomcat really looks into the pool to get me a connection? or it
just creates
a newone? I am asking this question because I am seeing(using eclipse
debugger)
two connection opened at the same time even after defining
maxActive=1 maxIdle=1 in my application'c context


Q 2. once your database operation is done you free the connection using

conn.close();

by doing this are we pushing the connection back into pool? if not then how
is
pool maintained?


Any help is appreciated

--RahulJoshi



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

  



-- 
===
David Smith
Network Operations Supervisor
Department of Entomology
College of Agriculture  Life Sciences
Cornell University
2132 Comstock Hall
Ithaca, NY  14853
Phone: 607.255.9571
Fax: 607.255.0939


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



Re: Where to place a common jar file?

2005-09-19 Thread David Smith
Shared jars can be placed in common/lib, but keep in mind that all your
webapps will be locked to the same version of the jar.  It's better to
have a copy in the webapp instead where you'll have more version
independence between wepapps.

--David


David Thielen wrote:

Hi;

 

If I have a jar file used by multiple servlets, should I put it in
${catalina}/common/lib or in ${catalina}/webapps/${each_app}/WEB-INF/lib?

 

I ask because I have seen various warnings that most jar files need to be
placed in each webapp and not in common (like struts).

 

??? - thanks - dave


  



-- 
===
David Smith
Network Operations Supervisor
Department of Entomology
College of Agriculture  Life Sciences
Cornell University
2132 Comstock Hall
Ithaca, NY  14853
Phone: 607.255.9571
Fax: 607.255.0939


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



Re: Trying to connect tomcat5 with postgresql database

2005-09-12 Thread David Smith
 the getConnection
  

line.



Once I add it back in,  the above error appears.  I've followed 
the instructions on the jakarta page, and thought I made the 
correct insertions in both server.xml, and WEB-INF/web.xml. Here 
are the entries
used:
server.xml
Resource auth=Container
  description=PostgresSQL Connection Pool
  name=jdbc/postDB type=javax.sql.DataSource
  driverClassName=org.postgresql.Driver
  url=jdbc:postgresql://localhost:5432/test
/
ResourceParams name=jdbc/postDB
parameter
namedriverClassName/name
valueorg.postgresql.Driver/value
/parameter
parameter
nameurl/name
 

  

valuejdbc:postgresql://localhost:5432/test?autoConnect=true/value
  

/parameter
parameter
nameusername/name
valuepostgres/value
/parameter
parameter
namepassword/name
valuepostgres/value
/parameter
parameter
namemaxIdle/name
value2/value
/parameter
parameter
namemaxActive/name
value10/value
/parameter
/ResourceParams
Here is the web.xml:
  resource-ref
   res-ref-namejdbc/postDB/res-ref-name
   res-typejavax.sql.DataSource/res-type
res-authContainer/res-auth
/resource-ref

Thanks in advance!
-Rick Mattier

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



  

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


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






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

  

--
David Smith
Network Operations Supervisor
Department of Entomology
Cornell University
2132 Comstock Hall
Ithaca, NY 14853
Phone: (607) 255-9571
Fax: (607) 255-0940


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

  



-- 
===
David Smith
Network Operations Supervisor
Department of Entomology
College of Agriculture  Life Sciences
Cornell University
2132 Comstock Hall
Ithaca, NY  14853
Phone: 607.255.9571
Fax: 607.255.0939


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



Re: Trying to connect tomcat5 with postgresql database

2005-09-11 Thread David Smith
-ref-namejdbc/postDB/res-ref-name
   res-typejavax.sql.DataSource/res-type
res-authContainer/res-auth
/resource-ref

Thanks in advance!
-Rick Mattier

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






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


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






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




--
David Smith
Network Operations Supervisor
Department of Entomology
Cornell University
2132 Comstock Hall
Ithaca, NY 14853
Phone: (607) 255-9571
Fax: (607) 255-0940


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



Re: JNDI/Tomcat question from newbie

2005-09-01 Thread David Smith
Personally, I'd just keep a reference to the datasource around maybe as
a class instance variable.  It doesn't constitute a connection in and of
itself -- just a way of getting one from the pool.  Connections on the
other hand should be explicitly closed as soon as they aren't needed
anymore in any method that get's one.

--David

Hyatt, Gordon wrote:

Hello All,

I'm a newbie to database pooling via JNDI and I have a JNDI/Tomcat question 
(more of a best practices/most scalable/fastest performance/least resource 
consumption type of question).

Each time the JNDI resource (pooled database connection) is needed, should a 
complete JNDI lookup be performed or can part of the lookup be cached?  For 
example, should the code be:

code
Context initCtx = new InitialContext ();
Context envCtx = (Context)initCtx.lookup (java:comp/env);
ds = (DataSource)envCtx.lookup (jdbc/data_source_name);

/code

or can the java:comp/env Context be saved as an attribute in the servlet 
context and a (synchronized) code segment like the following be used to obtain 
the DataSource?

code
Context ctx = (Context)ctxFromServletContext.lookup ();
ds = (DataSource)ctx.lookup (jdbc/data_source_name);
/code

Thus far, I haven't read anything about which method is acceptable/preferred 
or if one method yields significant performance benefit.  

Since, according to the docs a Context is not guaranteed to be synchronized 
against concurrent access by multiple threads, I assume that the first code 
segment above should be synchronized, especially if it is in a static method.

Thanks in advance,

Gord 

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

  



-- 
===
David Smith
Network Operations Supervisor
Department of Entomology
College of Agriculture  Life Sciences
Cornell University
2132 Comstock Hall
Ithaca, NY  14853
Phone: 607.255.9571
Fax: 607.255.0939


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



Re: Tomcat 5.5 where is a hard-copy dtd reference?

2005-09-01 Thread David Smith
2.4 doesn't use a DTD -- it uses a schema so order doesn't matter anymore.

--David

Scott Purcell wrote:

Hello,
Is there a quick reference, or somewhere one can go to get a listing of the 
element order for the 2.4 dtd?

I already have a bunch of elements in my web.xml and I want to add a 
listener but I forgot where it goes and I can't seem to google it up today?

Anyone know?

Thanks,
Scott

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

  



-- 
===
David Smith
Network Operations Supervisor
Department of Entomology
College of Agriculture  Life Sciences
Cornell University
2132 Comstock Hall
Ithaca, NY  14853
Phone: 607.255.9571
Fax: 607.255.0939


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



Re: Users Can See root files

2005-08-31 Thread David Smith
The servlet spec (and tomcat is spec compliant) forbids the client
direct access to anything in WEB-INF.  I can think of two possibilities
for what you are seeing:

1) You have Apache or IIS in front of this serving out static content. 
In that case, do what others have suggested and configure Apache or IIS
to block access to files in WEB-INF.

2) You have a servlet offering up material from your webapp and it's
erroneously serving up material in WEB-INF as well.  This wouldn't be
anything provided by tomcat -- it would be one of your servlets if it
exists.

--David

Scott Purcell wrote:

Hello,

I was showing someone my website the other day, and when they started playing 
with the URL, they could see the jsp files, html files, and files under the 
WEB-INF directory.

Is created a welcome-file-list in the web.xml, but I guess if someone plays 
with the url and tries to get a look at the files that does not help.

How does one shut down all access to anything from a url 

Thanks
Scott

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

  



-- 
===
David Smith
Network Operations Supervisor
Department of Entomology
College of Agriculture  Life Sciences
Cornell University
2132 Comstock Hall
Ithaca, NY  14853
Phone: 607.255.9571
Fax: 607.255.0939


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



Re: Getting LOGON_USER from the header

2005-08-29 Thread David Smith
By default, tomcat ignores the REMOTE_USER header from Apache or IIS in 
favor if it's own authentication.  To get tomcat to accept the IIS 
authentication info, add  this attribute to the Connector/ element in 
server.xml:


tomcatAuthentication=false

--David

Robert Jose wrote:


Thanks for the response Gurumoorthy, but I get null for a result.

Rob J.

- Original Message - From: Gurumoorthy 
[EMAIL PROTECTED]

To: Tomcat Users List tomcat-user@jakarta.apache.org
Sent: Monday, August 29, 2005 2:40 PM
Subject: Re: Getting LOGON_USER from the header



request.getRemoteUser()
- Original Message - From: Robert Jose [EMAIL PROTECTED]
To: Tomcat User tomcat-user@jakarta.apache.org
Sent: Monday, August 29, 2005 10:44 PM
Subject: Getting LOGON_USER from the header


Hello
I have configured IIS 5.1 to redirect all jsp files to Tomcat 5.5 
using the isapi redirect dll.  This seems to be working well and 
configured correctly.


Now I am trying to get the LOGON_USER from the header.  I want the 
windows id of the user that is hitting my web page.  I am developing 
an Intranet site and want to do seamless login based on who the user 
logged into their windows machine.  I know I can do this by using the 
command request.ServerVariables(LOGON_USER) in ASP.  I also was 
able to get request.getHeader(LOGON_USER) to work with IIS 5.1 and 
JRun 4 (using the dll they provide).


Does anyone know how I can get this information using Tomcat?  I 
would be greatly appreciative.


Thanks
Rob J.

-
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: Problema de configuracion de memoria de la JVM con Tomcat 5

2005-08-22 Thread David Smith
Have you tried using the tomcat5w.exe application in Tomcat's bin
directory?  It should also be available under the Apache Tomcat program
group in the Start button All Programs listing as Configure Tomcat.

--David

Doojan wrote:

Buenos dias,
tengo un problema con la configuración de la memoria
de la JVM con Tomcat 5.
Alguien sabe como incrementar la memoria de la JVM,
por favor
Estoy en un entorno W2003Server.

He probado poniendo variables de entorno como
JAVA_OPTS o JAVA_ARGS pero nada de eso funciona, sigo
obteniendo mi error OutOfMemoryError cuando cargo
mucho el webserver de Tomcat.

Muchas Gracias a todos!!!

Un saludo


   
__ 
Renovamos el Correo Yahoo! 
Nuevos servicios, más seguridad 
http://correo.yahoo.es

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

  



-- 
===
David Smith
Network Operations Supervisor
Department of Entomology
College of Agriculture  Life Sciences
Cornell University
2132 Comstock Hall
Ithaca, NY  14853
Phone: 607.255.9571
Fax: 607.255.0939


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



Re: Pound reverse proxy with Tomcat

2005-08-22 Thread David Smith
Try inserting proxyPort and proxyName attributes into your connector. 

proxyPort is obvious -- the port number of the publicly available site. 
proxyName is the site DNS name or IP address of the publicly available
site. 

These attributes are used by tomcat to compose links in pages and 300
series redirect URLs.

--David

[EMAIL PROTECTED] wrote:

Hi, does anyone know how to connect a Pound Reverse Proxy with Tomcat?
My scenario is:

A user types https://:443/aplication   in the browser 

then the reverse proxy Pound translate it to http://xxx:8080/aplication

the problem is the return, doesn't work.

thanks in advance







  



-- 
===
David Smith
Network Operations Supervisor
Department of Entomology
College of Agriculture  Life Sciences
Cornell University
2132 Comstock Hall
Ithaca, NY  14853
Phone: 607.255.9571
Fax: 607.255.0939


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



Re: session problems: www.blahblah.com versus blahblah.com

2005-08-16 Thread David Smith
I would imagine the other way to do this is to implement a filter
looking for people trying to reach blahblah.com and returning a 302
redirect to www.blahblah.com.  That would give them all the proper
cookie from the start and could be implemented accross all your webapp
resources at once.

--David

Michael Teter wrote:

I guess I was hoping there was some server-level redirect.

I'm not sure how I would put the meta redirect in all my pages.  My
app is a complicated mess (my fault - my lack of skill).

The issue is that my users are clicking a PayPal Subscribe button,
which sends them off to PayPal.  Part of the hidden information sent
to PayPal when the user clicks that button is the return path.

So if user comes to blahblah.com, clicks the Subscribe button it sends
them to PayPal with a return path of www.blahblah.com (because that's
what I'm telling PayPal to do.)  I'm thinking now I can just look at
the URL they're at now and set my PayPal return path dynamically... If
they're here as blahblah.com, I make sure to tell the PayPal form that
the return path is blahblah.com.  If www, then return to www...

Thanks for your suggestion though.  I can even continue using PayPal's
encrypted buttons - I'll just make two buttons, one for www, and
theother for just blahblah, and display the appropriate button based
on current situation.

Still, I think I was hoping that somewhere in server.xml I could say
all requests for blahblah.com should be mapped to www.blahblah.com.

Thanks all.

On 8/16/05, Peter Rossbach [EMAIL PROTECTED] wrote:
  

Hey Michael,

I look inside the tomcat source and find that we don't set the cookie
hostname attribute.
That means that the calling client/browser must made the hostname
handling. I also
thing the redirect way is currently right direction.

Peter

Paul Singleton schrieb:



Michael Teter wrote:

  

If my users come to blahblah.com, then go away, then return, they
get a new session id (for www.blahblah.com).

But if they come to www.blahblah.com, leave, and return (via link from
external site), they keep the same session.

I finally discovered that the browser (Firefox in this case) ends up
with two different session cookies - one for www.blahblah.com and one
for blahblah.com.


this behaviour seems reasonable to me...

  

What's the right thing to do to solve this?


it doesn't need solving, just accepting :-)

but assuming you want www.blahblah.com and blahblah.com
to behave (session-wise) like one domain, which they aren't,
you could redirect (client-side) from www.blahblah.com
(which IMHO is the redundant/obsolete/legacy domain) to
blahblah.com, which allocates sessions and dishes out cookies.

i.e. www.blahblah.com is a static site which just serves e.g.

html
  head
title%= a.appTitle %: redirection page/title
meta http-equiv=refresh content=0;url=http://blahblah.com; /
  /head
  body onLoad=window.location.replace('http://blahblah.com')
!-- optional if you are not redirected... blurb --
  /body
html

NB I haven't actually *tried* this :-)

Paul Singleton


  



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

  



-- 
===
David Smith
Network Operations Supervisor
Department of Entomology
College of Agriculture  Life Sciences
Cornell University
2132 Comstock Hall
Ithaca, NY  14853
Phone: 607.255.9571
Fax: 607.255.0939


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



Re: Security Questions Regarding Tomcat

2005-08-15 Thread David Smith
But it's also commented out and not active.  It's there as an example of
a proxied port if you happen to be using Apache and mod_rewrite as a
front end to tomcat.

--David

Robert V. Coward/CTR/OSAGWI wrote:

Hmmm. Well take a look at this entry from the server.xml file:

!-- Define a Proxied HTTP/1.1 Connector on port 8082 --
!-- See proxy documentation for more information about using this. 
--
!--
Connector port=8082
   maxThreads=150 minSpareThreads=25 maxSpareThreads=75
   enableLookups=false acceptCount=100 
connectionTimeout=2
   proxyPort=80 disableUploadTimeout=true /
--

I did not add this and from what I can tell this comes with the default 
config. Any info?

Roberto




David Smith [EMAIL PROTECTED] 
08/12/2005 11:40 AM
Please respond to
Tomcat Users List tomcat-user@jakarta.apache.org


To
Tomcat Users List tomcat-user@jakarta.apache.org
cc

Subject
Re: Security Questions Regarding Tomcat






This sounds really fishy.  Tomcat does not by default have any
connectors configured for port 80.  There must be another service or
you've modified your server.xml somehow.

--David

Robert V. Coward/CTR/OSAGWI wrote:

  

Having a similar issue to this with Tomcat 5.
Apparently T5 comes with a port 80 proxy server a special servlet 
container or something. Basically I have ipfilter running and only allow 
access  to port 8080, but if you send a request to 80 tTomcat picks up 


and 
  

does some sort of internal redirect to port 8080. According to a netstat 
-a only port 808 is litening, but when I run nmap against it it show 80 
and 8080. I'd like to have ipfileter take block all connections and 
redirect packets bound for port 80 to 8080. Inother words I want to do 
what the T5 server seems to be doing already. Anyone have any ideas? My 
network admin is giving me much grief about allowing port 8080 access to 
the web.

Thanks





Paul Singleton [EMAIL PROTECTED] 
08/12/2005 10:08 AM
Please respond to
Tomcat Users List tomcat-user@jakarta.apache.org


To
Tomcat Users List tomcat-user@jakarta.apache.org
cc
Alon Belman [EMAIL PROTECTED]
Subject
Re: Security Questions Regarding Tomcat






Harrell, Ralph wrote:





I would like to be able to start TOMCAT as a non-root
user but am unable to as we are running SSL and use
port 443 and non-root users do not have the permission
to use ports under 1000.


  

...not in Linux and some (all?) Unix variants, anyway.

(FWIW I think this root-only-below-1000 rule is an
ill considered security kludge which has probably
caused more trouble than it has circumvented)

You could redirect port 443 to 8443 (and 80 to 8080)
either in an external firewall/router or in iptables
within your server, then start Tomcat as e.g. tomcat
on its usual ports.

Paul Singleton







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



  



-- 
===
David Smith
Network Operations Supervisor
Department of Entomology
College of Agriculture  Life Sciences
Cornell University
2132 Comstock Hall
Ithaca, NY  14853
Phone: 607.255.9571
Fax: 607.255.0939


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



Re: Security Questions Regarding Tomcat

2005-08-15 Thread David Smith
Regardless of what you put up in front of tomcat to act as the proxy
host, you'll most likely need the proxyPort and proxyName attributes in
your connector so tomcat can write urls correctly as needed (like in
sending external redirects).  I do this setup myself on some stuff when
I'm using mod_rewrite to map servlet material into an Apache site.

--David

Robert V. Coward/CTR/OSAGWI wrote:

Got it. I've done that, and i figured out that i can not use ipfilter as a 
reflector. That is it is not very easy to use rdr to map packets from 
192.168.0.20 port 80 - 192.168.0.20 port 8080.
That is precisely what I wanted to do.force NAT to rewrite packets coming 
in on one port to another port and have tomcat answer normally. I got 
confused when I saw the proxying info inside the server.xml file. Looks 
like I'll have to get a real proxy server. Thanks.

Roberto



Hassan Schroeder [EMAIL PROTECTED] 
08/15/2005 10:30 AM
Please respond to
Tomcat Users List tomcat-user@jakarta.apache.org


To
Tomcat Users List tomcat-user@jakarta.apache.org
cc

Subject
Re: Security Questions Regarding Tomcat






Robert V. Coward/CTR/OSAGWI wrote:
  

Understood. But I do not want to use Tomcat proxying services. I just 


want 
  

to host 8080 locally and let my ipfilter firewall block and proxy for 


me.

Then the default Tomcat configuration of listening on port 8080 is
just what you need. I highly recommend making a copy of the original
server.xml and then stripping out the examples before doing anything
else; greatly improves readability. :-)

If you're still uncertain about Tomcat's configuration, i.e., what
port(s) it's listening on, you could run netstat and/or nmap before
and after starting it, and compare the results.

FWIW!
  



-- 
===
David Smith
Network Operations Supervisor
Department of Entomology
College of Agriculture  Life Sciences
Cornell University
2132 Comstock Hall
Ithaca, NY  14853
Phone: 607.255.9571
Fax: 607.255.0939


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



Re: Security Questions Regarding Tomcat

2005-08-12 Thread David Smith
See the Commons-Daemon project on the Jakarta site for starting tomcat
as a non-root answer.

--David

Harrell, Ralph wrote:

I would like to be able to start TOMCAT as a non-root
user but am unable to as we are running SSL and use
port 443 and non-root users do not have the permission
to use ports under 1000.

Ralph B. Harrell
UNC Charlotte
Manager, Oracle Database Administration
[EMAIL PROTECTED]
(704) 687-2951
-Original Message-
From: Alon Belman [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 11, 2005 4:20 PM
To: Tomcat Users List
Subject: Re: Security Questions Regarding Tomcat

copied share to meb/robo

laters!

On 8/11/05, LFM [EMAIL PROTECTED] wrote:
  

Tim,

Thanks for the reply, but I can't get in working:

In conf/server.xml I added server=TEST, as shown:

!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8180 --
Connector className=org.apache.coyote.tomcat4.CoyoteConnector
port=8180 minProcessors=5 maxProcessors=75
enableLookups=true acceptCount=10 debug=0
connectionTimeout=2 useURIValidationHack=false server=TEST/

Stopped, started Tomcat. nc'ed to localhost, but still got the old
server header.

$ nc localhost 8180
GET / HTTP/1.0

HTTP/1.1 302 Moved Temporarily
Location: http://localhost.localdomain:8180/index.jsp
Content-Length: 0
Date: Thu, 11 Aug 2005 20:15:38 GMT
Server: Apache-Coyote/1.1
Connection: close

What I'm I doing wrong?

Thanks!

Leandro



On Thu, 2005-08-11 at 15:56 -0400, Tim Funk wrote:


The Server header can be configured in the Connector declaration.

server='Sun Solaris IIS/6.0'

To limit the HTTP methods this can be done a few ways;
1) Use a servlet filter
2) Use web.xml and security constraints on those method types
3) ???


-Tim


LFM wrote:
  

Hi!

I'm hardening a Web Server running Tomcat for a client, but I'm


having
  

difficulty in finding information on how to accomplish the


following
  

tasks (bored of googling so I decided to ask here):
1. Remove/modify the banner presented by the coyote connector on


the
  

server header of an http reply.
2. Limit the HTTP methods available. (I wan't to disable trace,


put,
  

delete).



  

-
  

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

  

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







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

  



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



Re: Security Questions Regarding Tomcat

2005-08-12 Thread David Smith
This sounds really fishy.  Tomcat does not by default have any
connectors configured for port 80.  There must be another service or
you've modified your server.xml somehow.

--David

Robert V. Coward/CTR/OSAGWI wrote:

Having a similar issue to this with Tomcat 5.
Apparently T5 comes with a port 80 proxy server a special servlet 
container or something. Basically I have ipfilter running and only allow 
access  to port 8080, but if you send a request to 80 tTomcat picks up and 
does some sort of internal redirect to port 8080. According to a netstat 
-a only port 808 is litening, but when I run nmap against it it show 80 
and 8080. I'd like to have ipfileter take block all connections and 
redirect packets bound for port 80 to 8080. Inother words I want to do 
what the T5 server seems to be doing already. Anyone have any ideas? My 
network admin is giving me much grief about allowing port 8080 access to 
the web.

Thanks





Paul Singleton [EMAIL PROTECTED] 
08/12/2005 10:08 AM
Please respond to
Tomcat Users List tomcat-user@jakarta.apache.org


To
Tomcat Users List tomcat-user@jakarta.apache.org
cc
Alon Belman [EMAIL PROTECTED]
Subject
Re: Security Questions Regarding Tomcat






Harrell, Ralph wrote:

  

I would like to be able to start TOMCAT as a non-root
user but am unable to as we are running SSL and use
port 443 and non-root users do not have the permission
to use ports under 1000.



...not in Linux and some (all?) Unix variants, anyway.

(FWIW I think this root-only-below-1000 rule is an
ill considered security kludge which has probably
caused more trouble than it has circumvented)

You could redirect port 443 to 8443 (and 80 to 8080)
either in an external firewall/router or in iptables
within your server, then start Tomcat as e.g. tomcat
on its usual ports.

Paul Singleton


  


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



Re: Security Questions Regarding Tomcat

2005-08-12 Thread David Smith
I don't know -- I can see some value to the root only ports below 1024. 
It prevents non-privileged users from stealing trusted service ports in
a mainframe environment -- not that that's a reality anymore.  The best
way to handle this in a production environment is to use the
commons-daemon project at the Jakarta site.

--David

Paul Singleton wrote:

 Harrell, Ralph wrote:

 I would like to be able to start TOMCAT as a non-root
 user but am unable to as we are running SSL and use
 port 443 and non-root users do not have the permission
 to use ports under 1000.


 ...not in Linux and some (all?) Unix variants, anyway.

 (FWIW I think this root-only-below-1000 rule is an
 ill considered security kludge which has probably
 caused more trouble than it has circumvented)

 You could redirect port 443 to 8443 (and 80 to 8080)
 either in an external firewall/router or in iptables
 within your server, then start Tomcat as e.g. tomcat
 on its usual ports.

 Paul Singleton




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



Re: anonymising Tomcat

2005-08-05 Thread David Smith
Servlet spec 2.4 describes what you're looking for in section SRV 9.9.2
with more info in SRV.13.4 on how to configure it.  Essentially you're
looking for this in web.xml:

error-page
  error-code404/error-code
  location/some/error/page.jsp/location
/error-page

There's also a version for dealing with exceptions:

error-page
  exception-typejava.io.IOException/exception-type
  location/some/error/page.jsp/location
/error-page

Just make sure you use this at the top of you web.xml file to insure you
get spec 2.4 processing:

web-app xmlns=http://java.sun.com/xml/ns/j2ee;
 xmlns:xsi=http://www.w3c.org/2001/XMLSchema-instance;
 xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
 version=2.4

--David

Paul Singleton wrote:

 Peter Crowther wrote:

 From: Paul Singleton [mailto:[EMAIL PROTECTED] 


 Is it possible to configure Tomcat (5.5.9) so that a
 moderately able hacker couldn't figure out what is
 serving up our web apps?


 It's possible to add the 'server' attribute to the connector definition
 for the HTTP connector; server=BogoMAX v0.1 testing should anonymise
 the single most obvious piece of information, but pick your own string
 so that when the hacker searches Google for the string they don't find
 this post.  See
 http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html for
 details.

 It's possible that a more able hacker could also gain information from
 the usual range of specially-crafted invalid TCP packets [so use a
 decent firewall in front of the app server that detects and drops
 these], from traffic analysis of the way in which the app server returns
 data in the case of buffered and unbuffered pages, and likely from other
 techniques that I've not considered.


 OK, thanks for this.  My standalone 5.5.9 setup sends (according to
 LiveHTTPHeaders)

   Server: Apache-Coyote/1.1

 (?) but there's another giveaway: request a non-existent page
 and you get

   HTTP Status 404 - /myapp/nonexistent

   type Status report

   message /myapp/nonexistent

   description The requested resource (/myapp/nonexistent) is
   not available.
   Apache Tomcat/5.5.9

 so I'm searching the docs for a clue about auppressing this
 (nothing in Server Configuration Reference so far).

 But I'm worried that there might be other telltales, e.g.
 buried in the code which responds to bad HTTP requests or
 whatever?

 I'm not paranoid, but some of our customers are :-) and we
 have to be prepared to be reasonably diligent about these
 things.  So I was hoping that someone, somewhere had already
 delved into this?

 Paul Singleton






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



Re: Web application directory structure

2005-07-27 Thread David Smith
You're right in that it should work.  I can only guess the most likely
reason this might fail is your web.xml configuration.  Look for servlet
mappings that might catch the data/test1.html url.  Your log files
should have more information.  Also check to be sure the tomcat service
has read privilege on the file and it's directory.

--David

Joe Becknell wrote:

I'm new to Tomcat and having a problem I thought someone could help me with.
I have an application with servlet installed under webapps. I can run the
servlet without problems. The servlet creates a page that gets sent to the
browser with some links to some (HTML and XML) data files on it. When I
click on one of the links, I get a 404 (resource not available) error, even
though the file exists under my web application location. My setup is
(basically, I'm not at work, so I can't remember it exactly):
 
webapps\testapp\index.html
webapps\testapp\WEB-INF\web.xml
webapps\testapp\WEB-INF\classes\servlet.class
webapps\testapp\WEB-INF\src\servlet.java
webapps\testapp\data\test1.html
 
in my server.xml config file I have:
 
Context path=/testapp docBase=testapp debug=0 reloadable=true
 
although I don't think I need this since my app is located under the webapps
directory. Navigating to:
 
http://localhost:8080/testapp/index.html works fine, but navigating to
 
http://localhost:8080/testapp/data/test1.html gives me the 404 error. I was
under the imression that I could place files anywhere under the application
root (docBase) directory. Am I missing something here. Configuration
oversight?
 
Thanks for any information.
Joe.
 
 

  



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



Re: attributes in servletcontext and servletrequest

2005-07-26 Thread David Smith
A better way to handle this stuff is to just get the servlet context
when you need it and not store it in the request.  If you have access to
the request, you have access to the servlet context.

ie ServletContext servContext = request.getSession().getServletContext() ;

--David

Marten Lehmann wrote:

 Hello,

 within the init() of a filter, I'm storing a reference to the
 servletContext:

 filterConfig.getServletContext().setAttribute(servletContext,
 filterConfig.getServletContext());

 But when I'm trying to access this attribute in the doFilter-method, I
 get a NullPointerException:

 ServletContext servletContext = (ServletContext)
 request.getAttribute(servletContext);

 Why doesn't this work?

 Regards
 Marten

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



-- 
===
David Smith
Network Operations Supervisor
Department of Entomology
College of Agriculture  Life Sciences
Cornell University
2132 Comstock Hall
Ithaca, NY  14853
Phone: 607.255.9571
Fax: 607.255.0939



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



Re: Problem running tomcat with a CMS application

2005-07-26 Thread David Smith
Hi.

I run the same CMS here.  I've seen this happen when the repository
isn't initialized right.  Check the logs to see what happened, post the
version of Magnolia you're working with, and also ask on the magnolia
list at [EMAIL PROTECTED]

--David

Patrick saad wrote:

Hy,

I am trying to run a CMS program called magnolia on my
http://localhost:8080/magnolia/

I made sure that everything is installed properly: tomcat 4.1.31,
mysql. I downloaded the .war file and dropped it in my webapps folder.
I also made sure that my environment variables for CATALINA HOME are
properly set to my tomcat folder.

After running the startup.bat, I try and log on to
http://localhost:8080/magnolia/ but with no success, I get an
unauthorized access:

---
HTTP Status 403 

Access to the specified resource () has been forbidden. by tomcat. 
--
Is there something that I am doing wrong in my installation?
 
I previously had installed another CMS program, but I removed it and
reinstalled tomcat 4.1.31. Is there something that is blocking me from
doing my installation ?
 
Please help!
 
Patrick S.

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

  



-- 
===
David Smith
Network Operations Supervisor
Department of Entomology
College of Agriculture  Life Sciences
Cornell University
2132 Comstock Hall
Ithaca, NY  14853
Phone: 607.255.9571
Fax: 607.255.0939



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



Re: Problem running tomcat with a CMS application

2005-07-26 Thread David Smith
Normally you're right on the money.  In this case Magnolia manages it's
own authorization through a repository.

--David

Allistair Crossley wrote:

from memory you need to ensure you add users and roles to the tomcat-users.xml 
file? it's all in the manual.

  

-Original Message-
From: Patrick saad [mailto:[EMAIL PROTECTED]
Sent: 26 July 2005 15:39
To: tomcat-user@jakarta.apache.org
Subject: Problem running tomcat with a CMS application


Hy,

I am trying to run a CMS program called magnolia on my
http://localhost:8080/magnolia/

I made sure that everything is installed properly: tomcat 4.1.31,
mysql. I downloaded the .war file and dropped it in my webapps folder.
I also made sure that my environment variables for CATALINA HOME are
properly set to my tomcat folder.

After running the startup.bat, I try and log on to
http://localhost:8080/magnolia/ but with no success, I get an
unauthorized access:

---
HTTP Status 403 

Access to the specified resource () has been forbidden. by tomcat. 
--
Is there something that I am doing wrong in my installation?
 
I previously had installed another CMS program, but I removed it and
reinstalled tomcat 4.1.31. Is there something that is blocking me from
doing my installation ?
 
Please help!
 
Patrick S.

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






FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE 
---
QAS Ltd.
Registered in England: No 2582055
Registered in Australia: No 082 851 474
---
/FONT


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

  



-- 
===
David Smith
Network Operations Supervisor
Department of Entomology
College of Agriculture  Life Sciences
Cornell University
2132 Comstock Hall
Ithaca, NY  14853
Phone: 607.255.9571
Fax: 607.255.0939



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



Re: can't start tomcat as user

2005-07-21 Thread David Smith
This problem can be caused by the port = 1024 problem under unix/linux. 
If so, take a look at the commons-daemon project on the jakarta site.


Also be sure your config, log, webapp (optional), work, and temp 
directories are owned by the tomcat user. They should be writeable by 
tomcat at least and I've seen cases in my system where ownership was 
necessary. Don't ask me why -- I have yet to explain it myself.


LastIy, check catalina.out for errors. The logs are invaluable in 
finding problems.


--David


dummy wrote:


Then how to start automatically at boot time ?


-Original Message-
From: Luis Durán [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 21, 2005 9:33 AM

To: Tomcat Users List
Subject: Re: can't start tomcat as user

dummy wrote:
 


Hi,

Got problem starting Tomcat as user tomcat. No problem starting it under
root. Any idea why ?


   


On Linux, only root can open ports below 1024 (included). You must
compile the jsvc program and setup a tomcat user and it will start
tomcat as root and then change the effective user before receiving
requests. I hope this help. (jsvc is in the bin folder, i think is
originally compressed)

 




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



Re: Ports 8005 8009 8080 in default Tomcat 4.x installation.

2005-07-21 Thread David Smith
8005 = default shutdown port.  I believe it used to be the default ajp12
port.  This is bound specifically to 127.0.0.1 and cannot be accessed
from any other system.
8009 = default ajp13 connector port.  Can be disabled if you aren't
using mod_jk to connect with Apache or IIS.
8080 = default http protocol port.  Change this to 80 if you are using
Tomcat with out Apache or IIS in production.

--David

Leon Pu wrote:

Hi all,

After lauching Tomcat with the default ports setting in
conf/server.xml. I use netstat to check the opening ports, but I only
found 8080 port is using.

What's the exact usage of preceding three ports?


Best regards,
Leon

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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

  



-- 
===
David Smith
Network Operations Supervisor
Department of Entomology
College of Agriculture  Life Sciences
Cornell University
2132 Comstock Hall
Ithaca, NY  14853
Phone: 607.255.9571
Fax: 607.255.0939



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



Re: tc4 tc4

2005-07-19 Thread David Smith
Also set the shutdown port at the top of the server.xml to something 
other than 8005 .


--David

Chris Pat wrote:

Hi 
I have tc4 working fine.  Installed tc5.5.9 and set

the port to 9080 and of course a diff dir.  However I
cant connect to it at that port even tough I have his
from the tc5 server.xml

!--  Define a non-SSL HTTP/1.1 Connector on port 8080

 -- 
 Connector port=9080 maxHttpHeaderSize=8192

maxThreads=150 minSpareThreads=25
maxSpareThreads=75 enableLookups=false
redirectPort=8443 acceptCount=100
connectionTimeout=2 disableUploadTimeout=true
/ 


Can someone explain what additional config is
necessary to run both tc4  tc5 on 8080 and 9080 on
the same localhost?  tia.

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.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: tc4 tc4

2005-07-19 Thread David Smith
Take a look at the log file catalina.out and see if there are any errors 
there. An exception is most likely causing it to fail on startup.


Chris Pat wrote:


Hi David
Thanks for the response, however I set it to 8006,
checked to make sure nothing in that file of tc4 was
on that port, bounced tc5 and I still cant get in on
that port.  This is the second un/reinstall reboot
today.  Yes, it is a wintel box w2ksrvsp4.  Any ideas?

--- David Smith [EMAIL PROTECTED] wrote:

 


Also set the shutdown port at the top of the
server.xml to something 
other than 8005 .


--David

Chris Pat wrote:

   

Hi 
I have tc4 working fine.  Installed tc5.5.9 and set

the port to 9080 and of course a diff dir.  However
 


I
   


cant connect to it at that port even tough I have
 


his

from the tc5 server.xml
   


!--  Define a non-SSL HTTP/1.1 Connector on port
 


8080
   

-- 
Connector port=9080 maxHttpHeaderSize=8192

maxThreads=150 minSpareThreads=25
maxSpareThreads=75 enableLookups=false
redirectPort=8443 acceptCount=100
connectionTimeout=2
 


disableUploadTimeout=true
   

/ 


Can someone explain what additional config is
necessary to run both tc4  tc5 on 8080 and 9080 on
the same localhost?  tia.

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam
 

protection around 
   

http://mail.yahoo.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]


   




__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.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: tc4 tc4

2005-07-19 Thread David Smith
As others have suggested, the compat package will fix you up for running 
w/ jdk 1.4. It's right where you downloaded tomcat 5.5 .


--David

Chris Pat wrote:


Hi David
Thanks.  I sheepishly have to be a, temporary,
subscriber to RTFM.  The log complains that it needs
jdk1.5, of course I knew that but was still thinking
that there was a way to run it on jkd1.4.  Is there? 
Or can I give tc5 the location of the jdk1.5 not as an

environment variable and keep tc4 using the environ as
now is?  I also assume that tc5 on jdk1.4 is for
development only?  Sorry for the newbie barrage.

--- David Smith [EMAIL PROTECTED] wrote:

 


Take a look at the log file catalina.out and see if
there are any errors 
there. An exception is most likely causing it to

fail on startup.

Chris Pat wrote:

   


Hi David
Thanks for the response, however I set it to 8006,
checked to make sure nothing in that file of tc4
 


was
   


on that port, bounced tc5 and I still cant get in
 


on
   


that port.  This is the second un/reinstall reboot
today.  Yes, it is a wintel box w2ksrvsp4.  Any
 


ideas?
   


--- David Smith [EMAIL PROTECTED] wrote:



 


Also set the shutdown port at the top of the
server.xml to something 
other than 8005 .


--David

Chris Pat wrote:

  

   

Hi 
I have tc4 working fine.  Installed tc5.5.9 and
 


set
   

the port to 9080 and of course a diff dir. 
 


However
   



 


I
  

   


cant connect to it at that port even tough I have


 


his

from the tc5 server.xml
  

   


!--  Define a non-SSL HTTP/1.1 Connector on port


 


8080
  

   

-- 
Connector port=9080 maxHttpHeaderSize=8192

maxThreads=150 minSpareThreads=25
maxSpareThreads=75 enableLookups=false
redirectPort=8443 acceptCount=100
connectionTimeout=2


 


disableUploadTimeout=true
  

   

/ 


Can someone explain what additional config is
necessary to run both tc4  tc5 on 8080 and 9080
 


on
   


the same localhost?  tia.

 


__
   


Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam


 

protection around 
  

   

http://mail.yahoo.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]


  

   


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam
 

protection around 
   

http://mail.yahoo.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]


   







Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 



-
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: Session Mixup

2005-07-14 Thread David Smith

Any static field storage in your bean object?

--David

Srinivas Gunturu wrote:


Hello All,

I have been fighting this session mix-up problem in our application which is 
very easily reproducible.

Environment:
Tomcat 5.0.9
Struts 1.1

Upon user login, we create a user bean object and store on user session.  When 
6 of us tried to login separately using our own logins, we could see our 
sessions get mixed up and also seeing other user's name in welcome greeting.

I have tried migrating to Tomcat 5.5, tried turning of Tomcat session 
persistence, tried making user object serializable.

Still no luck.  Any idea?

TIA,

Srinivas




-
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: Session Mixup

2005-07-14 Thread David Smith
Ok. One other thought that's burned me once -- servlet instances are 
recycled between requests without resetting any of it's field members. 
The next request gets it exactly as the one before left it.  That means 
you should either avoid field members in favor of method parameters + 
method local variables or be sure to reinitialize them before processing 
a new request.


--David

Srinivas Gunturu wrote:


All 6 of us are logging simultaneously from different machines.

The way, we store the user object in session is inside LoginAction class and 
not inside the jsp.

   session.setAttribute(Constants.USER_KEY, userInfo);




 


[EMAIL PROTECTED] 07/14/05 10:34 AM 
   


Hi,
It never happened to me and it will not happen also unless there is some 
serious bug in ur code.

Are you six people trying to login simultaneously from different machines?
Or trying to login from same system one after another from same system?
If it is the second case, then it copuld be the problem with browser cache. 
Clear cache and check. 
If it is the second case , check what is given for the scope attribute of 
the user bean (assuming you used jsp:usebean or something similar). If 
scope is given as application instead of session (or request) this could 
happen.
regards 
Srikanth
On 7/14/05, Srinivas Gunturu [EMAIL PROTECTED] wrote: 
 


Hello All,

I have been fighting this session mix-up problem in our application which 
is very easily reproducible.


Environment:
Tomcat 5.0.9
Struts 1.1

Upon user login, we create a user bean object and store on user session. 
When 6 of us tried to login separately using our own logins, we could see 
our sessions get mixed up and also seeing other user's name in welcome 
greeting.


I have tried migrating to Tomcat 5.5, tried turning of Tomcat session 
persistence, tried making user object serializable.


Still no luck. Any idea?

TIA,

Srinivas




-
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: Welcome File

2005-07-10 Thread David Smith

Question: Does it return a page if you request the index.jsf page directly?

--David

Behrang Saeedzadeh wrote:


Hi

Thanks for the reply.


I think the servlet mappipng should be ,

servlet-mapping
servlet-nameFaces Servlet/servlet-name
url-pattern/JSF01/url-pattern
 /servlet-mapping



I think this is not true. I remember when I was using Struts, my  
ActionServlet's
mapping was something like *.do or /do/* and putting index.do in the  
welcome file list

was working (I'm not sure, I've to check it once again...)

Thanks,




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



Re: add to classpath

2005-07-10 Thread David Smith
Then I would highly recommend a persistent backend like a Db instead of 
playing with the classpath.  Just my opinion.


--David

Stuart wrote:


Guru,
I need to do this so that I can deliver the application following my
company's standard format.  The tomcat application is just a small part of
what is being delivered and we like to put all configuration information in
a standard place for all apps. [please don't ask for any more explanation
that this just accept the fact that I need to do it] *8-)

BTW: I have just gone ahead and modified the Catalina.sh (I would rather
have some other way but at least it works...).

Thanks,
Stuart

-Original Message-
From: Gurumoorthy [mailto:[EMAIL PROTECTED] 
Sent: Saturday, July 09, 2005 10:29 PM

To: Tomcat Users List
Subject: Re: add to classpath

why are you doing this ? just copy the jars to the lib directory inside 
WEB-INF .. and restart the app ...
or if this spans into multiple application then ... put them in the 
tomcat/common/bin directory ...


Regards
guru
- Original Message - 
From: Stuart [EMAIL PROTECTED]

To: 'Tomcat Users List' tomcat-user@jakarta.apache.org
Sent: Saturday, July 09, 2005 8:19 AM
Subject: add to classpath


 


Hi,
Please scratch that last question.  I still do not know what the problem 
is
but I think I will just go with modifying Catalina.sh.  Actually all I 
need

to do is add to the tomcat classpath so that my web applications can find
things in different locations.

Is there are better way than hacking the .sh file (jakarta-tomcat-5.0.28)?

Thanks,

Stuart



-Original Message-
From: Stuart [mailto:[EMAIL PROTECTED]
Sent: Saturday, July 09, 2005 1:42 PM
To: 'Tomcat Users List'
Subject: Problem using org.apache.catalina.startup.Bootstrap


Hi,

I am trying to start Tomcat using my own script and am getting the 
following

error (Please help!):

/cygdrive/c/j2sdk1.4.2_07/bin/java -classpath
.\;c:\data\stuart\npshome\var\prop

   


erties\lsms;c:\jakarta-tomcat-5.0.28\bin\bootstrap.jar;c:\j2sdk1.4.2_07\lib\
 


tool
s.jar -Dcatalina.base=c:\data\stuart\npshome\var\lsmsweb
-Dcatalina.home=c:\jakarta-tomcat-5.0.28 -Djava.io.tmpdir=

   


-Djava.endorsed.dirs=c:\jakarta-tomcat-5.0.28\bin;c:\jakarta-tomcat-5.0.28\c
 


ommon\lib org.apache.catalina.startup.Bootstrap start


Bootstrap: Class loader creation threw exception
java.lang.ExceptionInInitializerError  at

   


org.apache.catalina.startup.ClassLoaderFactory.clinit(ClassLoaderFactory.j
 


ava:63)  at
org.apache.catalina.startup.Bootstrap.initClassLoaders(Bootstrap.java
:103)at
org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:196)
  at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:402)
Caused by: org.apache.commons.logging.LogConfigurationException:
org.apache.comm
ons.logging.LogConfigurationException: java.lang.NullPointerException
(Caused by
java.lang.NullPointerException) (Caused by
org.apache.commons.logging.LogConfig
urationException: java.lang.NullPointerException (Caused by
java.lang.NullPointerException))at
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactory
Impl.java:543)at
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactory
Impl.java:235)

Regards,
Stuart


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


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

   




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


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

 




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



Re: servlet mapping and url

2005-07-06 Thread David Smith
This trick isn't necessary in Tomcat 5.x and servlet spec 2.4.  Welcome 
files as listed in the web.xml are each appended to the remote user's 
request and the result is processed until it resolves to a servlet or file.


--David

Geiglein, Gary wrote:


If you create a file in the root of the context (any file, could be an
empty file, it just needs to show up in a directory listing) then map
your servlet to the same URL you would use to reference the file, then
add the file to the welcome-file-list and it will work.

Tomcat will not forward to a welcome file unless it shows up in the
directory. But once you map the servlet to the same URL, the servlet
will intercept the request.

-Original Message-
From: Frank W. Zammetti [mailto:[EMAIL PROTECTED] 
Sent: Saturday, July 02, 2005 9:25 AM

To: Tomcat Users List
Subject: Re: servlet mapping and url

Hi,

I don't think there is any restriction to mapping a servlet to a welcome

page:

servlet
servlet-nameMyServlet/servlet-name 
servlet-classcom.company.app.MyServlet/servlet-class

/servlet
servlet-mapping
servlet-nameMyServlet/servlet-name
url-pattern/myServlet/url-pattern
/servlet-mapping
welcome-file-list
welcome-file/myServlet/welcome-file
/welcome-file-list

Also, I'm not as sure, put I think just mapping the servlet to / will do

the trick as well.  Both are easy enough to test though, give it a shot 
and post back your results for the archives.


Frank

s s wrote:
 


i want to invoke a servlet using url like http://localhost:8080 only

i have done it using http://localhost:8080/index.html where index.html
   


is a servlet. Is it possible to load this servlet as a default just like
a default web page. The point is i want a servlet to recieve a request
when url http://localhost:8080 is referenced i.e without the servlet
name.
 



is it possible?





-
Yahoo! Mail Mobile
Take Yahoo! Mail with you! Check email on your mobile phone.
   



 





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



Re: java.util.zip.ZipException: invalid block type

2005-06-30 Thread David Smith
I would say if both you and another developer are getting this error, it 
would mean one of your .jar files is corrupt.  Check them by unzipping 
them into a temp directory or replace them with known working versions.


--David

Ben Anderson wrote:


I'm not deploying wars.  I'm just pointing to a directory.  I've tried
cleaning and redeploying this.  The weird thing is that this is
happening to the other developer on the project as well.

 Host name=localhost debug=0
   appBase=c:\work\build\cocoon
   unpackWARs=true autoDeploy=true

   Valve className=org.apache.catalina.valves.AccessLogValve
  directory=logs prefix=localhost_access_log.
  suffix=.txt pattern=common/

   Logger className=org.apache.catalina.logger.FileLogger
   directory=logs prefix=localhost_log.
   suffix=.txt timestamp=true/


   !-- RealNet application context --
   Context path= docBase=webapp debug=0



On 6/30/05, David Delbecq [EMAIL PROTECTED] wrote:
 


Redeploy your wars i'll say
Le Jeudi 30 Juin 2005 18:43, Ben Anderson a écrit :
   


Hi all,
I'm having trouble starting tomcat.  This happened after I deleted the
temp and work directories.  I recreated the temp directory because it
seemed this was a problem.  Now I'm getting this stack trace:
Apache Tomcat/4.1.31

java.util.zip.ZipException: invalid block type

at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:140)

at java.io.DataInputStream.readFully(DataInputStream.java:266)

at java.util.jar.JarFile.getBytes(JarFile.java:339)

at java.util.jar.JarFile.getManifest(JarFile.java:157)

at
org.apache.catalina.loader.WebappClassLoader.addJar(WebappClassLoader.java:
654)

at
org.apache.catalina.loader.WebappLoader.setRepositories(WebappLoader.java:1
020)

at org.apache.catalina.loader.WebappLoader.start(WebappLoader.java:618)

at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3486)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1141)

at org.apache.catalina.core.StandardHost.start(StandardHost.java:707)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1141)

at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:316)

 at org.apache.catalina.core.StandardService.start(StandardService.java:450)

 at org.apache.catalina.core.StandardServer.start(StandardServer.java:2143)

 at org.apache.catalina.startup.Catalina.start(Catalina.java:463)

 at org.apache.catalina.startup.Catalina.execute(Catalina.java:350)

 at org.apache.catalina.startup.Catalina.process(Catalina.java:129)

 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

 at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:3
9)

 at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp
l.java:25)

 at java.lang.reflect.Method.invoke(Method.java:324)

 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:156)

Exception during startup processing

java.lang.reflect.InvocationTargetException

 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

 at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:3
9)

 at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp
l.java:25)

 at java.lang.reflect.Method.invoke(Method.java:324)

 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:156)

Caused by: java.lang.InternalError: jzentry == 0,
jzfile = 118335776,
total = 2482,
name = tools\tomcat\4.1.31\temp\jar_cache53708.tmp,
i = 34,
message = invalid LOC header (bad signature)

 at java.util.zip.ZipFile$2.nextElement(ZipFile.java:320)

 at java.util.jar.JarFile$1.nextElement(JarFile.java:211)

 at
org.apache.catalina.startup.ContextConfig.tldScanJar(ContextConfig.java:850
)

 at
org.apache.catalina.startup.ContextConfig.tldScan(ContextConfig.java:809)

 at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:587)

 at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java
:181)

 at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSuppo
rt.java:119)

 at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3523)

 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1141)

 at org.apache.catalina.core.StandardHost.start(StandardHost.java:707)

 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1141)

 at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:316)

 at org.apache.catalina.core.StandardService.start(StandardService.java:450)

 at org.apache.catalina.core.StandardServer.start(StandardServer.java:2143)

 at org.apache.catalina.startup.Catalina.start(Catalina.java:463)

 at org.apache.catalina.startup.Catalina.execute(Catalina.java:350)

 at 

Re: Convert URL path from directory/ to directory/index.htm (Spring related)

2005-06-29 Thread David Smith

This is also done in Tomcat via welcome-file element in web.xml. Ex.:

welcome-file-list
welcome-fileindex.htm /welcome-file
/welcome-file-list

In servlet spec 2.4 (Tomcat 5.0,5.5), this can map to either a physical 
file or a servlet mapped to that URL. I think in earlier servlet specs, 
it had to be a physical file. SRV.9.10 of the spec has more info.


--David

Allistair Crossley wrote:


Hi,

You'd normally attempt to do this with URL rewriting at the web server side. I 
read that tomcat does not really offer URL rewriting at this time if used as a 
web server, I could be wrong.

For what it's worth, we place index.jsp documents in folders that the user may 
request that do a erquest forward to index.htm which is then picked up by 
Spring. If using IIS you can also specifying default documents like index.htm 
which the web server will try until it gets a bite from Tomcat

All the best, Allistair.

 


-Original Message-
From: Andy [mailto:[EMAIL PROTECTED]
Sent: 29 June 2005 14:18
To: tomcat-user@jakarta.apache.org
Subject: Convert URL path from directory/ to 
directory/index.htm (Spring

related)



Hi,

Is there anyway to get Tomcat to convert a request such as
myserver.com/directory into myserver.com/directory/index.htm.

The reason for this is that in Spring you have to specify a
wild card to match against the URL path in order to invoke
the DispatcherServlet, if this wild card is *.htm then a
requested without index.htm in it results in a 404 from Tomcat.

i.e. myserver.com/directory
- gives a 404 response
myserver.com/directory/index.htm
- invokes Spring to deal with the request

Perhaps this is an issue I can solve within Spring but
thought I'd try the Tomcat angle first.

This is what I have in my web.xml for Spring -

   servlet
   servlet-nameabc/servlet-name

servlet-classorg.springframework.web.servlet.DispatcherServl
et/servlet-cl
ass
   load-on-startup1/load-on-startup
   /servlet

   servlet-mapping
   servlet-nameabc/servlet-name
   url-pattern*.htm/url-pattern
   /servlet-mapping


Thanks,

Andy.






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


   




FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE 
---

QAS Ltd.
Registered in England: No 2582055
Registered in Australia: No 082 851 474
---
/FONT


-
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: http session lost between struts action

2005-06-27 Thread David Smith

Check these:

1. Your browser is accepting cookies
2. Your links are being generated by taglibs that insure the jsessionid 
is attached if needed.  I say if needed because if tomcat is getting a 
valid session cookie from your browser, the jsessionid won't be added to 
the link.


They don't both have to be done, but chances of eliminating errors are 
best if they are.  Beyond that, I would have to suspect the way you are 
trying to access the session attributes either in setting them or in 
retrieving them.  Could you post code snippets that show how you are 
setting and retrieving attributes?


--David

angelina zh wrote:


Jack,

I dont understand why you keep saying there is nothing worng. The session got 
established at the log in page and kept valid in the security re-diredct pages 
till the welcome page. Then session got lost. Why there is nothing wrong with 
it?

The session id did not get lost, just the http session lost.

Regards,

Angelina

Dakota Jack [EMAIL PROTECTED] wrote:
There is nothing wrong. You don't have a new session in your browser.

On 6/23/05, angelina zh wrote:
 


Hi,

Can anyone please help me on this session lost issue?

Here is the problem I am getting:

-- If I open a IE 6.0 browser and log into the web site we are developing, I 
get into a welcome page with a few of link options. In the login action class, 
we set some attributes into the session. If I click on any of the links, I got 
null pointer exception in next action class when we try to get attributes from 
the session. I tried to use Eclipse to debug, noticed that the session of the 
request after the welcome page became to null.

--If I keep that browser open and go to the log in page again. After I log in, 
I get into the welcome page and if I click any of the links now, the session of 
the request is not null and I can go to any links without any problem. The null 
pointer did not occur in the following action class.

--If I close the browser then open browser again, I get NullPointerException 
again if I repeat those steps.

What might be wrong?

Thanks so much in advance.

Angelina



-
Yahoo! Sports
Rekindle the Rivalries. Sign up for Fantasy Football

   




 




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



Re: http session lost between struts action

2005-06-27 Thread David Smith
You might want to setup the Request Dumper Valve 
(*org.apache.catalina.valves.RequestDumperValve*.) and see if that 
offer's any insight.  I suspect the cookie isn't being returned in 
subsequent requests after the welcome page.  Unfortunately, I don't have 
enough info about your setup to even begin theorizing why that might happen.


--David


angelina zh wrote:


Frank,  Guru

Thank you guys so much for the comments. But I forget to mention that the code 
was originally coded to request.getSession(false). Since it did not work for 
me, I changed to request.getSession(true).

So neither was working for me.

Angelina

Frank W. Zammetti [EMAIL PROTECTED] wrote:
I thought that at first too Guru, I had to go remind myself... looking at
the javadoc for request.getSession(boolean)...

Returns the current HttpSession associated with this request or, if there
is no current session and create is true, returns a new session.

That OR, IF clause is whats important.. it should only create a new
session if none already exists. So, calling getSession(true) is going to
return to you a session either way, whether it's a pre-existing one or a
new one.

I do however agree that calling getSession(true) in this case does not
seem appropriate... Angelina, I would call it with false and check for
null, as Guru says. It probably won't solve the problem, but it will tell
you a little bit more, namely whether the session really exists or not in
a more explicit manner.

 




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



Re: Load oracle.jdbc.driver.OracleDriver class

2005-06-23 Thread David Smith
Put the jar in common/lib and don't mess with the classpath.  Tomcat's 
internal classloaders will take care of finding the jar.


--David

Giacomino Raccuia wrote:


Hi!
I just upgraded from tomcat 4.0.3 to 5.5.9, I put all my librarie in 
shared/lib and set correctly the CLASSPATH, but when I try to load the 
class


oracle.jdbc.driver.OracleDriver

tomcat return this error

ava.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
java.net.URLClassLoader$1.run(URLClassLoader.java:198)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(URLClassLoader.java:186)
java.lang.ClassLoader.loadClass(ClassLoader.java:299)
java.lang.ClassLoader.loadClass(ClassLoader.java:255)
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
java.lang.Class.forName0(Native Method)
java.lang.Class.forName(Class.java:140)
glib.sql.ConnectionPool.init(ConnectionPool.java:41)
org.apache.jsp.test_jsp._jspService(org.apache.jsp.test_jsp:111)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322) 

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291) 


org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
nmda.servlets.MultipartFilter.doFilter(MultipartFilter.java:58)

Do you have any suggestion??
I try this code

try { Class.forName (oracle.jdbc.OracleDriver); } catch (Exception 
ex) {}


and works fine.

Thanks
Mino



On 20/06/2005 16:30, Christoph Kutzinski wrote:


Hi,

I'm trying to install a custom CharsetProvider (UTF7) with my web 
application (i.e. deliver a JAR with a 
META-/services/java.nio.charset.spi.CharsetProvider entry in 
WEB-INF/lib)
However the CharsetProvider isn't recognized when it comes to parsing 
(i.e. calling javax.mail.Part.getContent())

If I place the JAR into JRE/lib/ext it works.

The API of CharsetProvider 
(http://java.sun.com/j2se/1.5.0/docs/api/java/nio/charset/spi/CharsetProvider.html) 
says:
Charset providers may be installed in an instance of the Java 
platform as extensions, that is, jar files placed into any of the 
usual extension directories. Providers may also be made available by 
adding them to the applet or application class path or by some other 
platform-specific means. Charset providers are looked up via the 
current thread's context class loader.


I interpret it this way:
If the JAR is in the classpath (specifically: if it is found by the 
current context class loader) the Charsetprovider should be 
automatically recognized.
I checked that the context classloader immediately before calling 
Part.getContent() is the webapp-classloader, so the JARs in 
WEB-INF/lib should be visible.


So is there any solution to this other than placing the JAR in an 
extension directory?
Could this be a Tomcat bug or is this expected behaviour due to the 
speciality of the webapp classloaders? (I tried to understand the 
implifications of Tomcats classloading at 
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/class-loader-howto.html

but couldn't figure it out by myself)


Thank you,
Christoph

-
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: Startup class in Tomcat 5.x

2005-06-15 Thread David Smith

The servlet spec is your friend: http://www.jcp.org/en/jsr/detail?id=154

Among other things, SRV.10 of the spec describes the use of event 
listeners like javax.servlet.ServletContextListener for handling events 
like when a webapp starts or stops.  Completely portable to all servlet 
2.4 spec compliant containers.


--David

Sethuraman, Prabhu (Cognizant) wrote:


Folks,

Is there a way in which we can write a startup class in Tomcat. Similar to what 
we have in Weblogic? I am aware of the approach of writing a servlet and 
setting load-on-startup to 1. But wanted to confirm if this is really the only 
way out.

Cheers,
Prabhu S


This e-mail and any files transmitted with it are for the sole use of the 
intended recipient(s) and may contain confidential and privileged information.
If you are not the intended recipient, please contact the sender by reply 
e-mail and destroy all copies of the original message.

Any unauthorized review, use, disclosure, dissemination, forwarding, printing 
or copying of this email or any action taken in reliance on this e-mail is 
strictly

prohibited and may be unlawful.

 Visit us at http://www.cognizant.com
 




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



Re: Vexing problem with Tomcat 5.0.28/Pointbase/JNDI/ConnectionPooling

2005-06-12 Thread David Smith

This tells me a lot:   Caused by: java.sql.SQLException: No suitable driver

Make sure the driver .jar file is in common/lib and the driverClassName 
parameter of your ResourceParams element references the correct driver 
class (don't use a DataSource class here). In your case, I think that 
should be 'com.pointbase.jdbc.jdbcUniversalDriver'.  If you move the 
driver file into common/lib, restart Tomcat so it can see the jar file.


--David

Suraj Sashidharan wrote:


Hi all,

  Tomcat 5.0.28 with Pointbase - Trying to obtain a database 
connection from the DataSource.


  I saw a zillion places in the web where they've discussed a 
problem quite similar to the exception shown below BUT, none exactly 
like what I'm experiencing. And by the way, I couldn't even find one 
case where they were trying to connect with Pointbase. I followed 
documentation from all over the web, but I don't see anything that I 
could be missing. To explain, many have complained about null values 
for class and URL in the exception message that you see below, but I 
don't have that problem. What could be wrong?


  I have spent 5 hours trying to fix this.

  (It is not even a case of the JDBC driver not being located as I get 
a different error message when I remove the JDBC driver .jar files 
(pbclient.jar). Pointbase is up and running on port 9092. Funny thing 
is the same error message comes up whether Pointbase is running or not.)


  Please HELP !!

Exception :

org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver 
of class 'com.pointbase.jdbc.jdbcDataSource' for connect URL 
'jdbc:pointbase:server://localhost:9092/dbCompany'
   at 
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:780) 

   at 
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540) 


   at dataaccess.UserDatabaseAccessBean.findByUserId(Unknown Source)
   at security.databaseclient.SecurityBean.login(Unknown Source)
   at security.SecurityControllerServlet.doPost(Unknown Source)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
   at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) 

   at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) 

   at 
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704) 

   at 
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:474) 

   at 
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:409) 

   at 
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312) 


   at framework.MainControllerServlet.processRequest(Unknown Source)
   at framework.MainControllerServlet.doPost(Unknown Source)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
   at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) 

   at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) 

   at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) 

   at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) 

   at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) 

   at 
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198) 

   at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152) 

   at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) 

   at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) 

   at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137) 

   at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) 

   at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118) 

   at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102) 

   at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) 

   at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 

   at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) 

   at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) 

   at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
   at 
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
   at 

Re: shared install under Linux

2005-05-27 Thread David Smith
Sounds like you want to setup multiple TC instances. Try using 
CATALINA_BASE. See this message for more info:


http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg151971.html

--David


Marius Scurtescu wrote:


Mark wrote:


Then in that case, I would make the context writable to all
developers, and also make the context reloadable.  By making the
context reloadable, tomcat will reload any classes/jars that are
placed into/or updated in  the context.

A couple tips would be:

1. If you are building classes into the context/WEB-INF directory, do
not perform a clean operation, as this could throw tomcat off.
2. I would recommend building jar files, and then place a copy of the
jar file into the context.



Thanks Mark. This is what I do know (more or less). I was wondering if 
it is possible to install Tomcat to a common location and then run 
separate instances (separate server.xml files) with totally separate 
web apps.


You can always install the whole Tomcat in separate folders (for each 
user) I guess.


Marius






On 5/26/05, Marius Scurtescu [EMAIL PROTECTED] wrote:


Mark wrote:


Is this for a development environment ?



Yes, for development.


-
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: Are we required to move to Tomcat 5.5 in order to move to JDK 1.5

2005-05-26 Thread David Smith
Small correction -- 5.5 needs the compat package to work on jdk l.4, not 
5.0 needs it to work on jdk 1.5. I've used TC 5.0  jdk 1.5 together no 
problem.


--David

Steve Kirk wrote:


You can run 5.0.28 on jdk1.5 but you need to add a compatibility package
which is available from the tc downloads page.  Basically it adds 3 jars to
fix issues with xml compatibility with the 1.4 vm.

I haven't done it myself (I upgraded both at once) but google some of these
words and you can read all about it.

PS if you do go to 5.5 and have DBCP, be sure to change your context.xml to
the new format required by TC5.5.  I spent nearly 3 days working that out.

 


-Original Message-
From: Raverkar, Sachin (Sachin) [mailto:[EMAIL PROTECTED] 
Sent: Thursday 26 May 2005 08:58

To: tomcat-user@jakarta.apache.org
Subject: Are we required to move to Tomcat 5.5 in order to 
move to JDK 1.5



Hi all, 


We are currently using Tomcat-5.0.28 and JDK 1.4.2_03.
We need to move onto JDK 1.5. We would build our war file 
using JDK 1.5.
Can we continue to use Tomcat-5.0.28 with  JDK 1.5? 
Do you see any problem? Are there any known issues?

Since Tomcat 5.5 is designed to run on J2SE 5.0 [JDK 1.5] and later,
are we required to move to Tomcat 5.5 in order to move to JDK 1.5?

- Sachin

   





-
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: html:errors/ blank page on invalid form

2005-05-25 Thread David Smith
Look for an exception in the logs.  Empty output usually means an 
uncaught exception.


--David

Andy wrote:


Hi All,

I'm unable to output any errors using html:errors/ tag, in Tomcat
5.5.7 I've tried numerous configurations and have now ran out of patience.
As I haven't been using Struts for more than three days I hope somebody
more experienced can point help me out.

When I select Submit, entering data into my form fields so the form is
parsed as valid, the forward works correctly. When I leave the fields
empty, so the form is parsed as invalid, I just get an empty page back -
which must be generated by Struts as it doesn't match any HTML I have.

Here is what I have in various files -




logon.jsp -

%@ page contentType=text/html;charset=UTF-8 language=java %
%@ taglib uri=/tags/struts-bean prefix=bean %
%@ taglib uri=/tags/struts-html prefix=html %
html
head
titlebean:message key=logon.title//title
/head
body
html:errors/
html:form action=/SubmitLogonForm.do
   table
   tr
   tdUsername/td
   tdhtml:text property=username//td
   /tr
   tr
   tdPassword/td
   tdhtml:text property=password//td
   /tr
   tr
   td
   html:submit/
   html:cancel/
   /td
   td/td
   /tr
   /table
/html:form

/body





In LogonAction.java -


   public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
   throws Exception {

   if (isCancelled(request)) {
   log.debug(cancel pressed);
   return mapping.findForward(Constants.FAILURE);
   }

   LogonForm logonForm = (LogonForm)form;
   log.debug(username +logonForm.getUsername());
   log.debug(password +logonForm.getPassword());

   return mapping.findForward(Constants.SUCCESS);
   }





In LogonForm.java (I have getters/setters for HTML fields, and a reset
method,
not shown) -

   public ActionErrors validate(ActionMapping actionMapping,
HttpServletRequest httpServletRequest) {

   log.debug(validate);
   ActionErrors errors = new ActionErrors();

   if
(FormUtils.isNullOrEmpty(httpServletRequest.getParameter(username))) {
   log.debug(logon.form.username.invalid);
   errors.add(ActionErrors.GLOBAL_MESSAGE,new
ActionMessage(logon.form.username.invalid));
   }
   if
(FormUtils.isNullOrEmpty(httpServletRequest.getParameter(password))) {
   log.debug(logon.form.password.invalid);
   errors.add(ActionErrors.GLOBAL_MESSAGE,new
ActionMessage(logon.form.password.invalid));
   }

   return errors.isEmpty() ? null : errors;
   }





Two tags of interest from struts-config.xml -

  !-- Process a user logon --
  action   path=/SubmitLogonForm
type=template.action.LogonAction
name=LogonForm
scope=request
input=/logon.jsp
 forward name=success path=/welcome.jsp /
  /action



   !-- Logon form --
   form-bean name=LogonForm type=template.form.LogonForm/




ApplicationResources.properties - Note this is found and read by Tomcat, I
can
pull values from it using bean:message - the errors.head and prefix are not
displayed however, so clearly no error messages are being generated at all.

index.heading=Index Page Heading
index.logon=Logon
index.register=New User
#
struts.logo.path=/struts-power.gif
struts.logo.alt=Powered by Struts
# form fields
logon.form.username.invalid=Username invalid
logon.form.password.invalid=Password invalid
# page titles
error.title=Error Title
logoff.title=Logoff Title
logon.title=Logon Title
register.title=Register Title
welcome.title=Welcome Title
#
errors.header=Errors
errors.prefix=Error prefix





Well it's 2AM here in London, so here's hoping for an answer when I get up
later
today !

TIA,

Andy.



-
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: Validation Frame work

2005-05-24 Thread David Smith
Because you should never trust the client. They may not be submitting 
from your form.  Javascript is just a nicety to save the user a whole 
request/response cycle just to find out a field is missing or wrong. 
Consider it a security issue.


-- David

raja buddha wrote:


Hi all
In struts why do we need validation frame work  we have java script
to do validations. Is there any extra advantage of using the validation
frame work

raj

_
On the road to retirement? Check out MSN Life Events for advice on how 
to get there! http://lifeevents.msn.com/category.aspx?cid=Retirement



-
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: How to read arguments?

2005-05-24 Thread David Smith
You might want to check the Tomcat source for an example, but I believe 
Tomcat uses getter/setter bean methods to transfer that info to an 
instance of the object after creating it. So for instance, the attribute 
debug would be set by calling newRealmInstance.setDebug(992) ;


--David

Jim Henderson wrote:


Hi mark!

I am the supplier of the Realm!  :)

I don't know how to access the parameters defined for the realm
configuration from within the realm java code.

Thanks for responding.
Jim

-Original Message-
From: Mark Thomas [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 24, 2005 2:23 PM
To: Tomcat Users List
Subject: Re: How to read arguments?


Jim,

I am not sure I understand your question. Could you re-phrase it?

What I can say is that this Realm is not part of the standard Tomcat
distribution. You might be better off talking to whoever supplied you
with this Realm.

Mark

Jim Henderson wrote:
 


Can someone tell me how to access the values of debug, dataSourceName
and dataSourceName from within class EnterpriseCustomUserRealm?  I tried
using a Context but I missed the boat somewhere.



   Realm

   


className=com.metafile.tomcat.enterpriseregistry.EnterpriseCustomUserRealm
 


  debug=992
  dataSourceName=false
  dataSourceName=EnterpriseUserDB
/



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



   




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




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

 




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



Re: Apache vs Tomcat WRT Security

2005-05-19 Thread David Smith
I won't argue with no. 1 since I don't use SSL connectors in Tomcat. 
However, no. 2 can be mitigated with the commons-daemon project among
other tricks and IMHO, not a valid argument against having Tomcat out front.

Just my thoughts on the subject. :-)

-David

Mark wrote:

I was very interested in the discussion concerning Apache vs Tomcat
WRT Performance.  While I cannot argue with the performance numbers, I
do like putting Apache in front of Tomcat for 2 reasons that I have
found so far.

1. SSL.  If I am going to be serving pages whether they be dynamic or
static, I think Apache handles the SSL communications and key storage
better.  In tests that I have run, the crypto that needs to be done to
support SSL is faster in C than Java.  Also, Tomcat stores any key
information in a flat file, where Apache will prompt for a password on
startup.  Now some administrators might like this better, because
Tomcat will then start automatically at boot time, I would not want
any password of mine sitting in the clear in a test file.
2. If you are hosting your site using port 80 on Unix boxes this means
running Tomcat as root.  I can think of very few reasons why Tomcat
needs to be run as root.  Apache has the ability to 'downgrade' user
privileges once Apache is started.

Please do not think that I am bashing Tomcat, juts pointing out some
interesting findings that I have come across over time.  I have been a
supporter and user of tomcat back to the 3.x days and will continue.

Thank you.

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

  



-- 
===
David Smith
Network Operations Supervisor
Department of Entomology
College of Agriculture  Life Sciences
Cornell University
2132 Comstock Hall
Ithaca, NY  14853
Phone: 607.255.9571
Fax: 607.255.0939



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



Re: Upgrading from 5.0.28 to 5.5.9

2005-05-17 Thread David Smith
Yes.

If choose to stay with Java JDK 1.4.x, download and install the
compatibility package.  Just follow the links for downloading Tomcat 5.5
and you should also find the compatibility package in the same
location.  Otherwise, Tomcat 5.5 was built for use with JDK 5 and you
should upgrade your JVM.

--David

Chris wrote:

 I'm upgrading tomcat from 5.0.28 to 5.5.9 and I'm getting a class not
 found error for org.apache.catalina.logger.FileLogger  In 5.0.28, this
 class was in the catalina jar, but it's not in 5.5.9.  Is there
 something else I need to download?  Or some setting I need to change?

 Chris

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


-- 
===
David Smith
Network Operations Supervisor
Department of Entomology
College of Agriculture  Life Sciences
Cornell University
2132 Comstock Hall
Ithaca, NY  14853
Phone: 607.255.9571
Fax: 607.255.0939



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



Re: website hosting

2005-05-16 Thread David Smith
Just to add my two cents to this -- you can use jsvc from the
commons-daemon project to start Tomcat with root long enough to get port
80 and then drop root for normal run.

Running Apache in front of Tomcat adds an extra layer of complexity and
more processing.  Take a look at what you need and if the extra layer is
really worth it before putting up Apache in front of Tomcat.  For a site
that's mostly dynamic and lots of decision making, just use Tomcat w/
jsvc and drop Apache altogether.

--David

Lutz Zetzsche wrote:

Hi Tomislav,

Am Sonntag, 15. Mai 2005 16:10 schrieb t.n.a.:
  

Lutz Zetzsche wrote:


As regards performance, running Apache in front of Tomcat is not
preferable. A standalone Tomcat is faster than a Tomcat behind an
Apache.
  

I'm not speaking from my own experiance, but I've done some reading
some time ago and the best practice I've found is to have apache
serve static content because it's faster and comes with a whole lot
of modules and have Tomcat serve the dynamic content - don't know if
we're talking about the same thing.



Well, what I mean is that Tomcat can serve dynamic content faster if it 
runs standalone so that the requests are directly handled and the pages 
are directly served by Tomcat.

Also, the gap between Tomcat and Apache is closing as regards the 
performance in serving static content.

Here are a few pros and cons for the Apache-Tomcat combination:

   http://jakarta.apache.org/tomcat/faq/connectors.html#integrate

My personal point of view is that I would always try to avoid to run a 
Tomcat behind an Apache, as this can sometimes significantly impair the 
performance when serving dynamic content from Tomcat.


Best wishes

Lutz

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

  



-- 
===
David Smith
Network Operations Supervisor
Department of Entomology
College of Agriculture  Life Sciences
Cornell University
2132 Comstock Hall
Ithaca, NY  14853
Phone: 607.255.9571
Fax: 607.255.0939



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



Re: .asp and tomcat 5.5.9

2005-05-12 Thread David Smith
You could just add this to your web.xml file in the proper place:

servlet-mapping
  servlet-namejsp/servlet-name
  url-pattern*.asp/url-pattern
/servlet-mapping

--David

Trung Nguyen wrote:

Peter,

Thanks again.  What I'm trying to do is write code in Java and name it .asp 
because our client wanted to have .asp instead of .jsp



-Original Message-
From: Peter Crowther [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 12, 2005 9:41 AM
To: Tomcat Users List
Subject: RE: .asp and tomcat 5.5.9


  

From: Trung Nguyen [mailto:[EMAIL PROTECTED] 
Is there a way to configure tomcat 5.5.9 to support .asp extension?



If you mean 'serve static content that has a .asp suffix as MIME type
x/y', yes.  Configure a MIME-type in Tomcat's conf/web.xml (or your
webapp's web.xml) and you're done.

If you mean 'process Microsoft-style Active Server Pages in the same way
that IIS does', no.  The main product I know that could do that on
non-Microsoft platforms is http://www.sun.com/software/chilisoft/ - Mono
does similar for ASP.Net.  It might be barely possible to use Tomcat to
retrieve pages from such a back-end system and forward them to the
client browser, but I suspect it would be a poor engineering solution.

What are you trying to do?

   - Peter

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

  



-- 
===
David Smith
Network Operations Supervisor
Department of Entomology
College of Agriculture  Life Sciences
Cornell University
2132 Comstock Hall
Ithaca, NY  14853
Phone: 607.255.9571
Fax: 607.255.0939



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



Re: Problem in Parsing - Error while doing lookup - HELP

2005-05-11 Thread David Smith
-list?,error-page*,taglib*,resource-env-ref*,resou
rce-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,e
jb-local-ref*). org.xml.sax.SAXParseException: The
content of element type we
b-app must match
(icon?,display-name?,description?,distributable?,context-para
m*,filter*,filter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,m
ime-mapping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-r
ef*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-lo
cal-ref*).org.xml.sax.SAXParseException: The content
of element type web-app
 must match
(icon?,display-name?,description?,distributable?,context-param*,fil
ter*,filter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-ma
pping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,se
curity-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-local-re
f*).
at
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Un
known Source)
at
org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown
Source)
at
org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
Source)
at
org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
Source)
at
org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown
S
ource)
at
org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(
Unknown Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent
Dispatcher.dispatch(Unknown Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un
known Source)
at
org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
at
org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
Source)
at
org.apache.xerces.parsers.XMLParser.parse(Unknown
Source)
at
org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
at
org.apache.commons.digester.Digester.parse(Digester.java:1548)
at
org.apache.catalina.startup.ContextConfig.applicationConfig(ContextCo
nfig.java:282)
at
org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:63
9)
at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfi
g.java:243)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl
eSupport.java:166)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3
582)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
at
org.apache.catalina.core.StandardHost.start(StandardHost.java:754)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:363
)
  
   155,1-8   75%





Regards,
Sanjeev


   
___ 
How much free photo storage do you get? Store your holiday 
snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com

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

  



-- 
===
David Smith
Network Operations Supervisor
Department of Entomology
College of Agriculture  Life Sciences
Cornell University
2132 Comstock Hall
Ithaca, NY  14853
Phone: 607.255.9571
Fax: 607.255.0939



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



Re: Tomcat Administration problem

2005-05-02 Thread David Smith
In addition to the advice below, did you restart Tomcat after updating 
tomcat-users.xml?  Last I knew this file wasn't reparsed after startup.  
Could be wrong on that though.

If you want the authentication to be updateable while tomcat is running, 
use a database realm.  Docs should be available in server.xml.

--David
Anto Paul wrote:
On 5/2/05, Nir Tayeb [EMAIL PROTECTED] wrote:
 

I will try to explain,
When I enter the default web app
($CATALINA_HOME/webapps/ROOT/index.jsp) by typing 127.0.0.1:8080 in
the address-bar.
In the side bar I choose Tomcat manager under Administration and I
am prompted for a username and a password.
Trying to login with manager or admin roles failes.
What can I do?
On 5/1/05, Caldarale, Charles R [EMAIL PROTECTED] wrote:
   

From: Nir Tayeb [mailto:[EMAIL PROTECTED]
Subject: Re: Tomcat Administration problem
I have created a user with a role of manager, and I login with his.
but yet, the server prompt me for a username and password.
   

The manager role is for the manager app; you must have an admin role
to use the admin app.
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 

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

You should have a similar entry to the following in conf\tomcat-users.xml.
user username=manager password= roles=manager/
This declares the user manager has access to manager application
without any password.
   For above configuration to work you need to configure Tomcat to
use the tomcat-users.xml to read user authentication information.
Tomcat is shipped configured to use this setup. If somebody has
changed it to use database or any other authentication realm you will
have to add the manager username,password and role in that realm.
   You can check which configuration Tomcat is using by looking for
the Realm/ element in server.xml. Mine is
Realm className=org.apache.catalina.realm.UserDatabaseRealm
debug=0 resourceName=UserDatabase/
This uses the UserDatabaseRealm which reads the file conf\tomcat-users.xml
Hope this helps 
 


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


Re: Catalina.out eats my harddisk space

2005-04-29 Thread David Smith
Question to the OT: how are you deleting catalina.out?  If you aren't 
shutting down tomcat first, you need to do that.  Otherwise some OS's 
recreate the file to it's former size with empty space where log info 
used to be.

Beyond that the other poster's ideas should also be followed.
--David
Dale, Matt wrote:
Under normal use very little appears in catalina.out. What exactly is filling 
up the file? I would suggest that it is application output or errors and that 
you need to sort that out.
I would also suggest that you use a proper logging package like log4j which 
will allow you to have rotatable log files which are easier to manage.
Ta
Matt
-Original Message-
From: Rajasekar [mailto:[EMAIL PROTECTED]
Sent: 29 April 2005 11:05
To: tomcat-user@jakarta.apache.org
Subject: Catalina.out eats my harddisk space
Hi, 

I am facing a *catalina.out log* file problem in tomcat5. It eats my 
harddisk space like anythink. My harddisk size is 80GB hard disk. Everyday i 
have to remove the catalina.out file. the nextday it fills the harddisk. and 
i cann't run tomcat. What could be the problem. Please help me if anybody 
knew to this issue. 

Regards 

Rajasekar V.R
-
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: Session lost when switching from https to http in Tomcat 5.

2005-04-28 Thread David Smith
Last I knew sessions are not shared between SSL and non-SSL connections 
by design (as opposed to a bug).  Your best bet is probably:

1. Start a session on the non-ssl side
2. Forward the user to the ssl login w/ the session id in the request
3. The ssl login stores the session id and any other important info in a 
shared persistence layer (i.e. database) and forwards back to the 
non-ssl side
4. The non-ssl side checks the persistence layer for it's session id and 
any other info left by the login page.

--David
Anhony wrote:
I am using Tomcat 5.0.28
Users log into my application from https://xxx.com/login.jsp.  When 
submitted, I check for a valid userID/Password, create a session with 
getSession(), and then save the userID/Password in a session variable. 
The validated user is then returned to my main tools page. If the user 
then selects a link to a non secure page, http://..., I get a return 
of null when performing getSession( false) when trying to check that 
the user is valid.

Thanks for the help.
Anthony
- Original Message - From: Anto Paul [EMAIL PROTECTED]
To: Tomcat Users List tomcat-user@jakarta.apache.org
Sent: Thursday, April 28, 2005 10:26 AM
Subject: Re: Session lost when switching from https to http in Tomcat 5.
On 4/28/05, Anhony [EMAIL PROTECTED] wrote:
I have a servlet/JSP application in which users establish their servlet
session using https but conduct the rest of their interactions using 
http.

The session appears not to be preserved between https and http, ie. 
after
switching from back to http the request.getSession(false) call 
returns null.
Can anyone shed light on this for me? Is this expected? Is there a
workaround/configuration/setting in Tomcat 5 I might have missed?

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

Please specify version of Tomcat and URLs which you used which caused 
problems.
It is working fine for me on Tomcat 4.1.12,4.1.30,4.1.31.


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


Re: Where is Jakarta's common email jar file

2005-04-22 Thread David Smith
Cool.  I didn't even know Commons had an email project.
--David
Patrick Thomas wrote:
Lorenzo,
I don't know about a jar file, but you can look at the CVS repository
for the java files. (Look in src/java/ for the package root) They're
packaged, so you could make the jar yourself easily enough. (jar -cvf
new jar name files to jar)
http://cvs.apache.org/viewcvs/jakarta-commons/email/
(linked from http://jakarta.apache.org/commons/email/ )
~Patrick
On 4/22/05, Lorenzo Jiménez [EMAIL PROTECTED] wrote:
 

Hi,
Do anyone knows where to download latest Jakarta's commons email jar. I tried 
in Jakarta commons website, but I cannot find it.
Thanks,
Lorenzo
-
Si usted no es el destinatario indicado en este mensaje o responsable como 
persona
de la entrega del mensaje, no debe copiar o reenviar este mensaje, por favor 
notifique
al correo [EMAIL PROTECTED] Para más referencia sobre términos importantes
relacionados a este correo visite http://www.nacion.com/disclaimer/index_es2.htm
If you are not the addressee indicated in this message (or responsible for 
delivery of the
message to such person), you may not copy or send this message to anyone, 
please notify
to [EMAIL PROTECTED] Click here for important additional terms relating to this 
e-mail.
http://www.nacion.com/disclaimer/index_en2.htm
-
-
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: Where is Jakarta's common email jar file

2005-04-22 Thread David Smith
You sure you don't really want JavaMail from Sun?
http://java.sun.com/products/javamail/index.jsp
You'll also need Java Activation Framework.
--David
Lorenzo Jiménez wrote:
Hi,
Do anyone knows where to download latest Jakarta's commons email jar. I tried 
in Jakarta commons website, but I cannot find it.
Thanks,
Lorenzo



-
Si usted no es el destinatario indicado en este mensaje o responsable como persona 
de la entrega del mensaje, no debe copiar o reenviar este mensaje, por favor notifique 
al correo [EMAIL PROTECTED] Para más referencia sobre términos importantes 
relacionados a este correo visite http://www.nacion.com/disclaimer/index_es2.htm

If you are not the addressee indicated in this message (or responsible for delivery of the 
message to such person), you may not copy or send this message to anyone, please notify
to [EMAIL PROTECTED] Click here for important additional terms relating to this e-mail. 
http://www.nacion.com/disclaimer/index_en2.htm

-

-
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: Tomcat 5.5.9 Connection Pool / JNDI / DBCP

2005-04-20 Thread David Smith
You should be doing this in your code:
Context initContext = null;
try {
 initContext = new InitialContext() ;
} catch ( Exception e1 ) { //... do something with the trapped exception }
try {
 DataSource ds = 
(DataSource)initContext.lookup(java:/comp/env/jdbc/testdatabase);
} catch ( Exception e2) { //... do something -- log it }
// Store a reference to ds someplace where it can be used over and over 
and over.

Note the only thing I really changed is to make the type of initContext 
Context instead of InitialContext.  This is mostly straight from the 
Tomcat 5.5 JNDI docs located here:

http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jndi-resources-howto.html
--David
Lars Nielsen Lind wrote:
Hi.
I have some problems with Tomcat 5.5.9 Connection Pooling / JNDI / DBCP
When running my java component (se below) I receive this NamingException:
/NE: Need to specify class name in environment or system property, or 
as an applet parameter, or in an application resource file:  
java.naming.factory.initial/

If I add this code:
System.setProperty(java.naming.factory.initial,  
org.apache.naming.java.javaURLContextFactory);
System.setProperty(java.naming.factory.pkgs,  org.apache.naming);

to the constructor in the java component, I receive this exception:
/NE: Name java: is not bound in this Context/
What is wrong and what is the solution to the problem?
Thanks
Lars Nielsen Lind

I have copied the PostgreSQL driver, commons-pool.jar, 
commons-collections.jar and commons-dbcp.jar  to the 
$CATALINA_HOME/common/lib folder.

I have done as specified in the JNDI Datasource HOW-TO.
*Server.xml*:
Context path=/ debug=1 
docBase=/opt/jakarta-tomcat-5.5.9/webapps/application/test
   !-- PostgreSQL / JDBC / JNDI - ConnectionPooling --
   Resource name=jdbc/testdatabase auth=Container 
type=javax.sql.DataSource driverClassName=org.postgresql.Driver 
url=jdbc:postgresql://localhost/testdatabase username=dbmanager 
password=123456 maxActive=20 maxIdle=10 maxWait=-1 
removeAbandoned=true removeAbandonedTimeout=60 logAbandoned=true /
/Context

*Application Web.xml*:
resource-ref
   descriptionPostgreSQL DataSource/description
   res-ref-namejdbc/testdatabase/res-ref-name
   res-typejavax.sql.DataSource/res-type
   res-authContainer/res-auth
/resource-ref
*Java component*:
import java.sql.*;
import java.util.*;
import javax.naming.*;
import javax.sql.*;
public class ConnectionPool {
 private Connection conn;
   public ConnectionPool() {}
   public Connection getConnectionFromPool() {
   try {
   InitialContext initContext = null;
 try {
   initContext = new InitialContext();
   } catch (Exception ex) {
   System.out.println(IC:  + ex);
   }
   try {
   DataSource ds = 
(DataSource)initContext.lookup(java:/comp/env/jdbc/testdatabase);
   conn = ds.getConnection();
   } catch (SQLException se) {
   System.out.println(DS:  + se);
   }
   } catch (NamingException ne) {
   System.out.println(NE:  + ne.getMessage());
   }
 return conn;
   }
 
-
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: tomcat 5.5 help

2005-04-13 Thread David Smith
TC 5.5 moved to being built around JDK 5.  It works in JDK 1.4, but 
needs some extra classes that are included in the JDK 5 download.  What 
JDK are you using and if it's v 1.4, did you download and install the TC 
5.5 compatibility package as well?

--David
dummy wrote:
Problem with tomcat 5.5.
Application running on tomcat 5.0 is fine but when run on tomcat 5.5 alot of
problem appeared like noclassfound etc.
Why is it so ?
Anybody have the same problem ?
How to solve ?
 


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


Re: Upgrading from tomcat 3.2.2 to 3.3.2 on Windows

2005-04-13 Thread David Smith
I would say take a look at the release notes here:
http://jakarta.apache.org/tomcat/tomcat-3.3-doc/index.html
--David
Horvath, Ruth (Ruth) ** CTR ** wrote:
Where do I find these ?
Ruth 

-Original Message-
From: Jonathan Eric Miller [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 13, 2005 11:28 AM
To: Tomcat Users List
Subject: Re: Upgrading from tomcat 3.2.2 to 3.3.2 on Windows

Reading the changelog is a good place to start...
Jon
- Original Message -
From: Horvath, Ruth (Ruth) ** CTR ** [EMAIL PROTECTED]
To: tomcat-user@jakarta.apache.org
Sent: Wednesday, April 13, 2005 12:16 PM
Subject: Upgrading from tomcat 3.2.2 to 3.3.2 on Windows

Sorry if this has been discussed before, but I couldn't find this topic
in the archives.
I'm also new to tomcat. I'm not a developer, but a member of our system
verification team.
I've been asked to evaluate what needs to be done to upgrade our current
version of tomcat.
Currently, our application is using tomcat 3.2.2 (I know - we need to
get into the 21st century) The management team is looking to upgrade to
3.3.2 (baby steps - this is for a point release - our next major release
we hope to convince them to at least use 5.0) Anyway, if I upgrade from
3.2.2 to 3.3.2, what is this buying me (improved performance - what) ?
What is the best way to test (or should I just verify I didn't break
anything that was previously working) ?
What is the best way to upgrade (without loosing my customized
xml/properties files) Is it good enough to look at what's currently in
my 3.2.2 bin/conf/lib directories and just copy in the 3.3.2 versions of
those files currently used ?
Also, my current 3.2.2 has jk_nt_service.exe and isapi_redirect.dll in
the bin directory, but I don't see these in the 3.3.2 bin.  Where would
I find these ? These look like they've been modified (according to the
release notes), so I'm guessing I need to find them.
Thank-you for your time and patience,

-
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: DBCP Please Help Get Working Properly

2005-04-11 Thread David Smith
Ok, define 'no results'. In reality, the naming import isn't the only 
thing that changed. Your web.xml file *looks* like 2.3 spec from what I 
can see and you are using JSP 2.x spec syntax in your jsp. If you want 
the JSP 2.x spec features, you need to declare your web.xml file for 
servlet 2.4 spec. This should be up at the top of your web.xml (pasted 
from the specification for servlet 2.4):

?xml version=1.0 encoding=ISO-8859-1?
web-app xmlns=http://java.sun.com/xml/ns/j2ee;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
version=2.4
Then just put all your servlet-mappings, etc., ... after that. The 
taglib declarations need to be inside a jsp-config element for the 2.4 
spec web.xml file too. That's how I'm guessing you have a 2.3 spec 
web.xml file. The full spec can be found at 
http://www.jcp.org/en/jsr/detail?id=154

--David
Scott Purcell wrote:
Hello,
I am trying to use the DBCP features of Tomcat 5.5.7. I created a webapp named 
testDB and put it under $CATALINA_HOME/webapps/testDB. Then I created a 
testDB.xml file under $CATALINA_HOME/conf/Catalina/localhost/testDB.xml.
// here it is
Context path=/testDB docBase=testDB
   debug=5 reloadable=true crossContext=true
 Resource name=jdbc/testDB auth=Container type=javax.sql.DataSource
  maxActive=100 maxIdle=30 maxWait=1
  username=javauser password=javadude 
driverClassName=com.mysql.jdbc.Driver
  url=jdbc:mysql://localhost:3306/fritest?autoReconnect=true/
/Context
I have been following the notes from: 
http://localhost/tomcat-docs/jndi-datasource-examples-howto.html

I made sure I completed the rest of the tasks.
WEB-INF has the two tag locations, and the resource ref.
eg:
   taglib
   taglib-uri/WEB-INF/sql.tld/taglib-uri
   taglib-location/WEB-INF/sql.tld/taglib-location
   /taglib
   taglib
   taglib-uri/WEB-INF/c.tld/taglib-uri
   taglib-location/WEB-INF/c.tld/taglib-location
   /taglib
 resource-ref
 descriptionDB Connection/description
 res-ref-namejdbc/testDB/res-ref-name
 res-typejavax.sql.DataSource/res-type
 res-authContainer/res-auth
 /resource-ref
I finally hit my jsp page which is this:
%@ taglib uri=http://java.sun.com/jsp/jstl/sql; prefix=sql %
%@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c %
sql:query var=rs dataSource=jdbc/testDB
select id, foo, bar from testdata
/sql:query
html
 head
   titleDB Test/title
 /head
 body
 h2Results/h2
 
c:forEach var=row items=${rs.rows}
   Foo ${row.foo}br/
   Bar ${row.bar}br/
/c:forEach

 /body
/html
And I get no results:
Now I am pretty sure I have all configured. Because if I use a fallback (Tomcat 
4.1) code piece I had, I get results using the same settings:
package foo;
import javax.naming.*;
import javax.sql.*;
import java.sql.*;
public class DBTest {
 String foo = Not Connected;
 int bar = -1;
   
 public void init() {
   try{
 Context ctx = new InitialContext();
 if(ctx == null ) 
 throw new Exception(Boom - No Context);

 DataSource ds = 
   (DataSource)ctx.lookup(
  java:comp/env/jdbc/testDB);

 if (ds != null) {
   Connection conn = ds.getConnection();
 
   if(conn != null)  {
   foo = Got Connection +conn.toString();
   Statement stmt = conn.createStatement();
   ResultSet rst = 
   stmt.executeQuery(
 select id, foo, bar from testdata);
   while(rst.next()) {
  System.out.println(next );
  foo=rst.getString(2);
  bar=rst.getInt(3);
   }
   conn.close();
   }
 }
   }catch(Exception e) {
 e.printStackTrace();
   }
}

public String getFoo() { return foo; }
public int getBar() { return bar;}
}
And using the above class works all day.
The only difference I see is that the class using a naming import and the jsp 
does not. Can anyone help.
Thanks,
Scott




-Original Message-
From: David Smith [mailto:[EMAIL PROTECTED]
Sent: Friday, April 08, 2005 1:14 PM
To: Tomcat Users List
Subject: Re: Add Context Path, Tomcat 5.5.7
Hi.
Take a look at this for where to put Context elements:
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/context.html
This is new with Tomcat 5.0 and is continued in Tomcat 5.5
--David
Scott Purcell wrote:
 

Hello,
I am following the information here to add DBCP to my application.
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jndi-datasource-examples-howto.html
I am reading to add the Context path=/DBTest ... from the above docs. The 
instructions say to .
Configure the JNDI DataSource in Tomcat by adding a declaration for your 
resource to $CATALINA_HOME/conf/server.xml.
Add this in between the /Context tag of the examples context and the /Host 
tag closing the localhost definition.

So cool, I opened up the server.xml, but do not see any existing context or 
host tags in it. Here is my

Re: war file producing jsp problems

2005-04-11 Thread David Smith
How are you declaring your web.xml file. If you are declaring with the 
servlet 2.3 DTD, you won't be able to use the ${} operators available in 
the JSP 2 spec. Use the 2.4 schema instead.

?xml version=1.0 encoding=ISO-8859-1?
web-app xmlns=http://java.sun.com/xml/ns/j2ee;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
version=2.4
--David
[EMAIL PROTECTED] wrote:
Hi There,
i've build an app with jsp pages which use a bean and calls java  classes.  
This works fine  dandy, outside of a war file.

However, i've  placed the app within a war file under webapps, removed  the 
original directories etc  and restarted tomcat.

Now when i load my jsp page, the tag libs dont seem to work, ie i have the  
following code in my jsp page:

%@ taglib prefix=c uri=_http://java.sun.com/jsp/jstl/core_ 
(http://java.sun.com/jsp/jstl/core)   %
jsp:useBean id=nc class=hall.CheckStandAlone scope=page  /
jsp:setProperty name=nc property=phone  value=${param['phone']} /

using a war file it logs:
INFO Check - number:${param['phone']}
instead of logging:
INFO Check - number:01215554455
So, basically the same code works ok outisde of the war container, but  fails 
within the  war container.  Inside the war container the jsp  page does not 
seem to be able to interpret the ${param['phone']} to an actual  value.

Any suggestions on what is wrong here?  I am using Tomcat version  5.5.7, 
java version 1.5


 


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


Re: DBCP Please Help Get Working Properly

2005-04-11 Thread David Smith
Well yes it does make a lot of sense, but is more a question answered by 
design patterns.  It's a little beyond the scope of Tomcat docs to 
address issues like separation of roles.  Both Struts and Spring 
projects address issues like this with the Model-View-Controller (MVC) 
pattern and there are innumerable books on the subject as well.  
Specific to data access methods, Hibernate also addresses this issue.

As far as step by step docs, you are best off picking a framework, 
getting a good book on it and go from there.

Hope this helps.
--David
Scott Purcell wrote:
Thank David for the below information.
This makes some sense, and I will try and make the changes. But this of course 
leads to a follow-up question. Why isn't there any decent documentation to get 
the DBCP running in Tomcat. I am talking about a simple example, that explains 
container versions, jsp versions, possibly better ways to use then putting the 
connection into a JSP page. Connecting in a JSP page is just plain dirty, I 
would like to connect in some class where I can call connections from. Does 
this make sense?
As I mentioned, I followed the example that comes with the documentation for my 
5.5 Tomcat that displays when you go to localhost.
So, is there any good documentation that shows how to do this, step by step?
Thanks,
Scott


-Original Message-
From: David Smith [mailto:[EMAIL PROTECTED]
Sent: Monday, April 11, 2005 8:18 AM
To: Tomcat Users List
Subject: Re: DBCP Please Help Get Working Properly
Ok, define 'no results'. In reality, the naming import isn't the only 
thing that changed. Your web.xml file *looks* like 2.3 spec from what I 
can see and you are using JSP 2.x spec syntax in your jsp. If you want 
the JSP 2.x spec features, you need to declare your web.xml file for 
servlet 2.4 spec. This should be up at the top of your web.xml (pasted 
from the specification for servlet 2.4):

?xml version=1.0 encoding=ISO-8859-1?
web-app xmlns=http://java.sun.com/xml/ns/j2ee;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
version=2.4
Then just put all your servlet-mappings, etc., ... after that. The 
taglib declarations need to be inside a jsp-config element for the 2.4 
spec web.xml file too. That's how I'm guessing you have a 2.3 spec 
web.xml file. The full spec can be found at 
http://www.jcp.org/en/jsr/detail?id=154

--David
Scott Purcell wrote:
 

Hello,
I am trying to use the DBCP features of Tomcat 5.5.7. I created a webapp named 
testDB and put it under $CATALINA_HOME/webapps/testDB. Then I created a 
testDB.xml file under $CATALINA_HOME/conf/Catalina/localhost/testDB.xml.
// here it is
Context path=/testDB docBase=testDB
  debug=5 reloadable=true crossContext=true
Resource name=jdbc/testDB auth=Container type=javax.sql.DataSource
 maxActive=100 maxIdle=30 maxWait=1
 username=javauser password=javadude 
driverClassName=com.mysql.jdbc.Driver
 url=jdbc:mysql://localhost:3306/fritest?autoReconnect=true/
/Context
I have been following the notes from: 
http://localhost/tomcat-docs/jndi-datasource-examples-howto.html

I made sure I completed the rest of the tasks.
WEB-INF has the two tag locations, and the resource ref.
eg:
  taglib
  taglib-uri/WEB-INF/sql.tld/taglib-uri
  taglib-location/WEB-INF/sql.tld/taglib-location
  /taglib
  taglib
  taglib-uri/WEB-INF/c.tld/taglib-uri
  taglib-location/WEB-INF/c.tld/taglib-location
  /taglib
resource-ref
descriptionDB Connection/description
res-ref-namejdbc/testDB/res-ref-name
res-typejavax.sql.DataSource/res-type
res-authContainer/res-auth
/resource-ref
I finally hit my jsp page which is this:
%@ taglib uri=http://java.sun.com/jsp/jstl/sql; prefix=sql %
%@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c %
sql:query var=rs dataSource=jdbc/testDB
select id, foo, bar from testdata
/sql:query
html
head
  titleDB Test/title
/head
body
h2Results/h2
c:forEach var=row items=${rs.rows}
  Foo ${row.foo}br/
  Bar ${row.bar}br/
/c:forEach
/body
/html
And I get no results:
Now I am pretty sure I have all configured. Because if I use a fallback (Tomcat 
4.1) code piece I had, I get results using the same settings:
package foo;
import javax.naming.*;
import javax.sql.*;
import java.sql.*;
public class DBTest {
String foo = Not Connected;
int bar = -1;
  
public void init() {
  try{
Context ctx = new InitialContext();
if(ctx == null ) 
throw new Exception(Boom - No Context);

DataSource ds = 
  (DataSource)ctx.lookup(
 java:comp/env/jdbc/testDB);

if (ds != null) {
  Connection conn = ds.getConnection();

  if(conn != null)  {
  foo = Got Connection +conn.toString();
  Statement stmt = conn.createStatement();
  ResultSet rst = 
  stmt.executeQuery(
select id, foo, bar from testdata);
  while

Re: remove comments from jsp via tomcat

2005-04-08 Thread David Smith
You could place standard java comments inside of %   % pairs.
--David
Steven Pannell wrote:
Hi,
Is there anyway to configure tomcat to strip out the comment tags from the
jsp files before streaming them as html to the client browsers???
with some other application servers this is possible.
thx.
Steve.
-
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: Add Context Path, Tomcat 5.5.7

2005-04-08 Thread David Smith
Hi.
Take a look at this for where to put Context elements:
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/context.html
This is new with Tomcat 5.0 and is continued in Tomcat 5.5
--David
Scott Purcell wrote:
Hello,
I am following the information here to add DBCP to my application.
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jndi-datasource-examples-howto.html
I am reading to add the Context path=/DBTest ... from the above docs. The 
instructions say to .
Configure the JNDI DataSource in Tomcat by adding a declaration for your 
resource to $CATALINA_HOME/conf/server.xml.
Add this in between the /Context tag of the examples context and the /Host 
tag closing the localhost definition.

So cool, I opened up the server.xml, but do not see any existing context or 
host tags in it. Here is my server.xml file. Does anyone know where I put the 
Context for the DBCP stuff? Thanks,
'!-- Example Server Configuration File --
!-- Note that component elements are nested corresponding to their
parent-child relationships with each other --
!-- A Server is a singleton element that represents the entire JVM,
which may contain one or more Service instances.  The Server
listens for a shutdown command on the indicated port.
Note:  A Server is not itself a Container, so you may not
define subcomponents such as Valves or Loggers at this level.
--
Server port=8005 shutdown=SHUTDOWN
 !-- Comment these entries out to disable JMX MBeans support used for the 
  administration web application --
 Listener className=org.apache.catalina.mbeans.ServerLifecycleListener /
 Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener /
 Listener className=org.apache.catalina.storeconfig.StoreConfigLifecycleListener/

 !-- Global JNDI resources --
 GlobalNamingResources
   !-- Test entry for demonstration purposes --
   Environment name=simpleValue type=java.lang.Integer value=30/
   !-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users --
   Resource name=UserDatabase auth=Container
 type=org.apache.catalina.UserDatabase
  description=User database that can be updated and saved
  factory=org.apache.catalina.users.MemoryUserDatabaseFactory
 pathname=conf/tomcat-users.xml /
 /GlobalNamingResources
 !-- A Service is a collection of one or more Connectors that share
  a single Container (and therefore the web applications visible
  within that Container).  Normally, that Container is an Engine,
  but this is not required.
  Note:  A Service is not itself a Container, so you may not
  define subcomponents such as Valves or Loggers at this level.
  --
 !-- Define the Tomcat Stand-Alone Service --
 Service name=Catalina
   !-- A Connector represents an endpoint by which requests are received
and responses are returned.  Each Connector passes requests on to the
associated Container (normally an Engine) for processing.
By default, a non-SSL HTTP/1.1 Connector is established on port 8080.
You can also enable an SSL HTTP/1.1 Connector on port 8443 by
following the instructions below and uncommenting the second Connector
entry.  SSL support requires the following steps (see the SSL Config
HOWTO in the Tomcat 5 documentation bundle for more detailed
instructions):
* If your JDK version 1.3 or prior, download and install JSSE 1.0.2 or
  later, and put the JAR files into $JAVA_HOME/jre/lib/ext.
* Execute:
%JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA (Windows)
$JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA  (Unix)
  with a password value of changeit for both the certificate and
  the keystore itself.
By default, DNS lookups are enabled when a web application calls
request.getRemoteHost().  This can have an adverse impact on
performance, so you can disable it by setting the
enableLookups attribute to false.  When DNS lookups are disabled,
request.getRemoteHost() will return the String version of the
IP address of the remote client.
   --
   !-- Define a non-SSL HTTP/1.1 Connector on port 8080 --
   Connector
port=80   maxThreads=150 minSpareThreads=25 
maxSpareThreads=75
  enableLookups=false redirectPort=8443 acceptCount=100
  connectionTimeout=2 disableUploadTimeout=true /
   !-- Note : To disable connection timeouts, set connectionTimeout value
to 0 --
!-- Note : To use gzip compression you could set the following properties :
 compression=on 
 compressionMinSize=2048 
 noCompressionUserAgents=gozilla, traviata 
 compressableMimeType=text/html,text/xml
--

   !-- Define a SSL HTTP/1.1 Connector on port 8443 --
   !--
   Connector port=8443 
  maxThreads=150 minSpareThreads=25 maxSpareThreads=75
  enableLookups=false 

Re: Using Tomcat 5.5.x with Mysql

2005-04-07 Thread David Smith
Could you post the code used in doing the lookup?  What I see here 
appears to imply you are using jdbc: as the jndi name to look up.  As 
posted earlier, your jndi should look more like 
java:comp/env/jdbc/TestDB in the code where you do the lookup.

--David
Marchioni Francesco wrote:
Hi all,
I'm trying to configure a Connection Pool with Tomcat 5.5.x and MySql 4.1.
Unfortunately I cannot lookup from JNDI context the Datasource.
JNDI lookup failed : javax.naming.NameNotFoundException: Name jdbc: is not
bound in this Context
javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:769)
at org.apache.naming.NamingContext.lookup(NamingContext.java:152)
at
org.apache.naming.SelectorContext.lookup(SelectorContext.java:136)
at javax.naming.InitialContext.lookup(Unknown Source)
at fad.bean.BaseManager.init(BaseManager.java:34)
at fad.bean.UserManager.init(UserManager.java:13)
at fad.bean.UserManager.getInstance(UserManager.java:23)
at fad.bean.LinkManager.getUserLinks(LinkManager.java:48)
at
fad.listener.SessionListener.buildSession(SessionListener.java:74)
at
fad.listener.SessionListener.sessionCreated(SessionListener.java:31)
at
org.apache.catalina.session.StandardSession.tellNew(StandardSession.java:371
)
at
org.apache.catalina.session.StandardSession.setId(StandardSession.java:343)
at
org.apache.catalina.session.ManagerBase.createSession(ManagerBase.java:748)
at
org.apache.catalina.session.StandardManager.createSession(StandardManager.ja
va:290)
at
org.apache.catalina.connector.Request.doGetSession(Request.java:2199)
at
org.apache.catalina.connector.Request.getSession(Request.java:2017)
at
org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:82
2)
at
org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:83
3)
at
org.apache.jasper.runtime.PageContextImpl._initialize(PageContextImpl.java:1
48)
at
org.apache.jasper.runtime.PageContextImpl.initialize(PageContextImpl.java:12
3)
at
org.apache.jasper.runtime.JspFactoryImpl.internalGetPageContext(JspFactoryIm
pl.java:104)
at org.apache.jasper.runtime.JspFactoryImpl.getPageContext(
The configuration is the same published on Tomcat docs
server.xml:
Context path=/DBTest docBase=DBTest
   debug=5 reloadable=true crossContext=true
 Resource name=jdbc/TestDB auth=Container type=javax.sql.DataSource
  maxActive=100 maxIdle=30 maxWait=1
  username=admin password=admin
driverClassName=com.mysql.jdbc.Driver
  url=jdbc:mysql://localhost:3306/fad?autoReconnect=true/
/Context
web.xml:
web-app xmlns=http://java.sun.com/xml/ns/j2ee;
   xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
   xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
   version=2.4
 descriptionMySQL Test App/description
 resource-ref
 descriptionDB Connection/description
 res-ref-namejdbc/TestDB/res-ref-name
 res-typejavax.sql.DataSource/res-type
 res-authContainer/res-auth
 /resource-ref
/web-app
Does anybody know if Tomcat can create a Connection pool with MySQL4.1 ?
Personally I've tried with JBoss4.1 and it works.why not with tomcat
5.5.x ?
Thanks
Francesco

-
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: R: Using Tomcat 5.5.x with Mysql

2005-04-07 Thread David Smith
Ok.  Your code should look more like:
   Context ctx = new InitialContext();
	 
   if(ctx == null ) 
	  throw new Exception(Boom - No Context);
	
	  ds = (DataSource)ctx.lookup(java:com/env/jdbc/TestDB);


jdbc/TestDB is correct for the resource definition and then the 
java:com/env/ gets tacked on the front when Tomcat puts it in it's JNDI 
namespace.

--David
Marchioni Francesco wrote:
Here it is:
   Context ctx = new InitialContext();
	 
   if(ctx == null ) 
	  throw new Exception(Boom - No Context);
	
	  ds = (DataSource)ctx.lookup(jdbc/TestDB);

Francesco
-Messaggio originale-
Da: David Smith [mailto:[EMAIL PROTECTED]
Inviato: giovedì 7 aprile 2005 14.47
A: Tomcat Users List
Oggetto: Re: Using Tomcat 5.5.x with Mysql
Could you post the code used in doing the lookup?  What I see here 
appears to imply you are using jdbc: as the jndi name to look up.  As 
posted earlier, your jndi should look more like 
java:comp/env/jdbc/TestDB in the code where you do the lookup.

--David
Marchioni Francesco wrote:
 

Hi all,
I'm trying to configure a Connection Pool with Tomcat 5.5.x and MySql 4.1.
Unfortunately I cannot lookup from JNDI context the Datasource.
JNDI lookup failed : javax.naming.NameNotFoundException: Name jdbc: is not
bound in this Context
javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
	at org.apache.naming.NamingContext.lookup(NamingContext.java:769)
	at org.apache.naming.NamingContext.lookup(NamingContext.java:152)
	at
org.apache.naming.SelectorContext.lookup(SelectorContext.java:136)
	at javax.naming.InitialContext.lookup(Unknown Source)
	at fad.bean.BaseManager.init(BaseManager.java:34)
	at fad.bean.UserManager.init(UserManager.java:13)
	at fad.bean.UserManager.getInstance(UserManager.java:23)
	at fad.bean.LinkManager.getUserLinks(LinkManager.java:48)
	at
fad.listener.SessionListener.buildSession(SessionListener.java:74)
	at
fad.listener.SessionListener.sessionCreated(SessionListener.java:31)
	at
org.apache.catalina.session.StandardSession.tellNew(StandardSession.java:37
   

1
 

)
	at
org.apache.catalina.session.StandardSession.setId(StandardSession.java:343)
	at
org.apache.catalina.session.ManagerBase.createSession(ManagerBase.java:748)
	at
org.apache.catalina.session.StandardManager.createSession(StandardManager.j
   

a
 

va:290)
	at
org.apache.catalina.connector.Request.doGetSession(Request.java:2199)
	at
org.apache.catalina.connector.Request.getSession(Request.java:2017)
	at
org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:8
   

2
 

2)
	at
org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:8
   

3
 

3)
	at
org.apache.jasper.runtime.PageContextImpl._initialize(PageContextImpl.java:
   

1
 

48)
	at
org.apache.jasper.runtime.PageContextImpl.initialize(PageContextImpl.java:1
   

2
 

3)
	at
org.apache.jasper.runtime.JspFactoryImpl.internalGetPageContext(JspFactoryI
   

m
 

pl.java:104)
at org.apache.jasper.runtime.JspFactoryImpl.getPageContext(
The configuration is the same published on Tomcat docs
server.xml:
Context path=/DBTest docBase=DBTest
  debug=5 reloadable=true crossContext=true
Resource name=jdbc/TestDB auth=Container type=javax.sql.DataSource
 maxActive=100 maxIdle=30 maxWait=1
 username=admin password=admin
driverClassName=com.mysql.jdbc.Driver
 url=jdbc:mysql://localhost:3306/fad?autoReconnect=true/
/Context
web.xml:
web-app xmlns=http://java.sun.com/xml/ns/j2ee;
  xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
  xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
  version=2.4
descriptionMySQL Test App/description
resource-ref
descriptionDB Connection/description
res-ref-namejdbc/TestDB/res-ref-name
res-typejavax.sql.DataSource/res-type
res-authContainer/res-auth
/resource-ref
/web-app
Does anybody know if Tomcat can create a Connection pool with MySQL4.1 ?
Personally I've tried with JBoss4.1 and it works.why not with tomcat
5.5.x ?
Thanks
Francesco

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

   


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


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


Re: non-root on 80

2005-04-05 Thread David Smith
Just configure your Tomcat to use port 80 in the Connector element of 
your server.xml and then use jsvc to start it.

--David
NetSQL wrote:
I read that it has a stop method... but how do I get it to run at port 
80 ?

.V
David Smith wrote:
Look at jsvc in the commons-daemon project on jakarta.apache.org/commons
--David
NetSQL wrote:
apache drops to non root after bind to 80.
How can this be done w/ tc 5.5?
.V
-
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: non-root on 80

2005-04-04 Thread David Smith
Look at jsvc in the commons-daemon project on jakarta.apache.org/commons
--David
NetSQL wrote:
apache drops to non root after bind to 80.
How can this be done w/ tc 5.5?
.V
-
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: Facing problem with implementation of DBCP

2005-03-28 Thread David Smith
This is usually because of a mis-match in settings in one or more of 
your context.xml definition, your web.xml, and your JNDI lookup code.   
Check to be sure they are named consistently and properly configured.  
Also check your logs for any exceptions related to this.

For further help, please post your configs, code, and any logged exceptions.
--David
ajay kumar wrote:
Hi All,
   Iam facing problem with DBCP implementation
from last one week.I followed all the instructions
which are mentioned in the documentation section,but i
could not implement it.
When i run the Program which is involving
DBCP, is showing the following error: 
   java.sql.SQLException: Cannot load JDBC driver
class 'null' .
   Normal JDBC Programs are working fine.I placed
all the three jar files and Jdbc Driver(Mysql
Connector) in $CATALINA_HOME/common/lib
folder.(commons-collections.jar,commons-dbcp.jar,
commons-pool.jar and
mysql-connector-java-3.1.7-bin.jar)
 
The configuration which iam using is:
 
 Linux Operating System (Redhat v 8.0)
 Mysql(v 3.23)
 Mysql Connector(3.1.7)
 Tomcat 4.1.24
 J2sdk 1.4.1

I will be very glad to you,if you can assist me
in resolving this issue.
 

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


Re: No bug with Delegate !

2005-03-25 Thread David Smith
If you want to use the .jar in WEB-INF/lib, you'll also have to 
implement your own DBCP pool for the app.  That can be done in a 
ServletContextListener in servlet spec 2.4.  When the container 
instantiates the pool, it's always going to use the jar in common/lib 
(or possibly shared/lib) because it's instantiated at the container 
level.  At that level there is no awareness of you apps classloader.

--David
Lionel Farbos wrote:
Hi,
Sorry but my preceding analysis was false : I have a problem but NOT with the 
delegate.
So, I reexplain the case :
1- I have 
$CATALINA_HOME/common/lib/mysql-connector-java-2.0.14-bin.jar
$CATALINA_HOME/common/lib/naming-factory-dbcp.jar
2- I have a war with
WEB-INF/lib/mysql-connector-java-3.0.15-ga-bin.jar
WEB-INF/lib/naming-factory-dbcp.jar

in my test, I do :
Class driver = Class.forName(org.gjt.mm.mysql.Driver);
URL ressource = 
driver.getClassLoader().getResource(org/gjt/mm/mysql/Driver.class);
out.println( ClassForname==+ressource );
If, in my Context element, I put a Loader with delegate=false (the default), it prints : 
ClassForname==jar:file:/usr/local/tomcat/webapps/myContext/WEB-INF/lib/mysql-connector-java-3.0.15-ga-bin.jar!/org/gjt/mm/mysql/Driver.class

If I put delegate=true, it prints :
ClassForname==jar:file:/usr/local/tomcat/common/lib/mysql-connector-java-2.0.14-bin.jar!/org/gjt/mm/mysql/Driver.class
So delegate works as it is expected.
My problem is that, in my first test, I did :
Context ctx = new InitialContext();
DataSource dataSource = (DataSource)ctx.lookup(java:/comp/env/jdbc/myDB);
URL ressource = 
dataSource.getClass().getClassLoader().getResource(org/gjt/mm/mysql/Driver.class);
out.println( JndiForname==+ressource );
and, in this case, I always have :
ClassForname==jar:file:/usr/local/tomcat/common/lib/mysql-connector-java-2.0.14-bin.jar!/org/gjt/mm/mysql/Driver.class
So, for now, I don't find the solution to use the Driver inside the war :-(
But this is another problem...
Sorry Remy for the bad bug report.
On Wed, 23 Mar 2005 17:26:34 +0100
Lionel Farbos [EMAIL PROTECTED] wrote:
 

Hi Simon,
I wanted to use this flag because, in my $CATALINA_HOME/common/lib,
I have mysql-connector-java-2.0.14-bin.jar
but, 
in some wars, I have 
WEB-INF/lib/mysql-connector-java-3.0.15-ga-bin.jar
WEB-INF/lib/naming-factory-dbcp.jar
and in other wars, I don't have any Driver Mysql

So, I'd want the war_WEB-INF/lib/Mysql_jar to be taken BEFORE the 
common/lib/Mysql_jar one when it is possible
and
the common/lib/Mysql_jar to be taken in other cases.
So I tried to put 
Loader className=org.apache.catalina.loader.WebappLoader delegate=false /
or 
Loader className=org.apache.catalina.loader.WebappLoader delegate=true /
in my Context.xml
But it is always the common/lib/jar one which is taken :-((

I don't know if it is a bug or a bad config from me 
If a Tomcat Developer can say to me what I am wrong ...
Note : To confirm the Driver version, I print :
dataSource.getClass().getClassLoader().getResource(org/gjt/mm/mysql/Driver.class);
Cheers
On Sat, 19 Mar 2005 17:44:40 +1300
Simon Kitching [EMAIL PROTECTED] wrote:
   

Hi,
I see here that there is an option for the webapp-specific classloader
to use parent-first classloading instead of the (default) child-first
classloading.
Can someone suggest why this might be useful? Clearly someone thought
so, but I can't see any point in it. It is in catalina since version 1.1
(committer: Remy Maucherat).
See delegate option in this page:
 http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/loader.html
Using this option makes life exceedingly complicated for some libs like
commons-beanutils and commons-logging, so I would like to know under
what conditions someone might enable this feature.
Regards,
Simon
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 

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

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

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


Re: replacing ROOT

2005-03-23 Thread David Smith
Comments in xml can start anywhere on or above the line you want 
commented out and end anywhere after.  New lines are treated as 
whitespace and have no meaning when parsed.

!--
 Context ../Context
--
is just as valid as
!-- Context/Context --
Comments can't be nested, but that's a whole different ball of wax.
--David
Rajesh Bagade wrote:
Comment for context should start from same line where context line starts.
It should be as follows
!-- Context path= docBase=ROOT debug=0/ --
--Rajesh Bagade
-Original Message-
From: Andreas Andersson [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 23, 2005 5:33 PM
To: Tomcat Users List
Subject: Re: replacing ROOT
Rajesh Bagade wrote:
 

In server.xml just comment original root context entry, and write your new
context.
   

The weird think is that that context is already commented and has been
so since I installed tomcat. It looks like this.
!-- Tomcat Root Context --
!--
  Context path= docBase=ROOT debug=0/
--
When are the xml-files from /webapps read?
--
Andreas Andersson
IT Dept.
Travelstart Nordic
[EMAIL PROTECTED]
http://www.travelstart.se
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.7.4 - Release Date: 3/18/2005
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.7.4 - Release Date: 3/18/2005
--
iota technologies limited, pune, india
-
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: different versions of libraries

2005-03-23 Thread David Smith
WEB-INF/lib of the app you need it in.  That's the simple answer.  For a 
complete answer, read:

http://jakarta.apache.org/tomcat/tomcat-5.0-doc/class-loader-howto.html
and the servlet spec
--David
Andreas Andersson wrote:
Hi!
I need to use a really new version of xalan/xerces in one of my 
applications. Where should I put the .jars to make application specific?

Is it even possible?

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


Re: tomcat 5.0.25 question

2005-03-23 Thread David Smith
I have it working here on Tomcat 5.0.x, JDK 5, WinXP -- no problems to 
note so far and I installed it from a binary download.

The only gotcha that I know about is you can't build for JDK 5 and then 
use it on JDK 1.4.x

--David
Lionel Farbos wrote:
I don't know where you can find more details ...
but Tomcat 5.0.x is built for jdk1.4
So, I don't think you can use jdk1.5 with it...
On Wed, 23 Mar 2005 09:32:28 -0800
Eric Moreo [EMAIL PROTECTED] wrote:
 

Hello,
Last year I downloaded the Tomcat 5.0.25 binary for Solaris and
installed it with java sdk 1.4.2.  I now want to upgrade to the java sdk
1.5 but I don't want to upgrade Tomcat yet.  I am trying to determine if
this upgrade will affect my version of Tomcat.  One piece of information
that I cannot find on the Tomcat website is information about how the
Tomcat binaries were built.  Specifically, was it compiled using the
java compiler from sdk 1.4, 1.5 or some other version of the sdk?  If my
version of Tomcat was built with javac from the java sdk 1.5 then I know
my upgrade should go smoothly.  If anyone knows where I can find the
details of how the Tomcat binaries were built it would be greatly
appreciated.
Thanks,
Eric Moreo
Web Developer
Art Center College of Design
x2392
[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: com.sybase.jdbc2.jdbc.SybDriver error

2005-03-09 Thread David Smith
Move jconn2.jar to C:\Tomcat\common\lib and restart.  Tomcat ignores the 
classpath in favor of it's classloaders and eliminates a huge load of 
headaches with it.

--David
[EMAIL PROTECTED] wrote:
Hi there,  
i'm sure this issue has been raised before, i get the following error when  
running one of my jsp pages:

java.lang.ClassNotFoundException: com.sybase.jdbc2.jdbc.SybDriver
Now i now this class resides in C:\Tomcat\jConnect-5_5\classes\jconn2.jar  
which is in my classpath. When i execute my test class outside of tomcat, my  
script works fine.

why the difference, and what should i do to fix my problem?
CLASSPATH=C:\Tomcat\jConnect-5_5\classes\jconn2.jar;C:\Tomcat\jConnect-5_5\cla
sses\jTDS2.jar;C:\Tomcat\jakarta-regexp-1.3\jakarta-regexp-1.3.jar;\c:\Java;c:
\java\hall;c:\sybtools\ASEP\Monclass.zip;c:\sybtools\ASEP\3pclass.zip;
 

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


Re: Tomcat 5.5.8 Postgresql 7.4.6 No suitable driver exception

2005-03-04 Thread David Smith
One of the only things I don't see here -- and it's a big one -- no 
postgresql jdbc driver in common/lib.  Tomcat doesn't come with it by 
default.  You have to download the latest and install it before this 
will work.

--David
Ole Ersoy wrote:
Hi everybody,
I'm attempting to get the JNDI Datasource How To
example for Postgresql to work.
Here is the URL for the example:
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jndi-datasource-examples-howto.html
After completing the listed steps the test.jsp error
page reports:
java.sql.SQLException: No suitable driver
Here are all my configuration steps, including the
files:
- On Fedora Core 3 - adduser postgres
- passwd postgres (set to postgres)
- chown postgres /var/lib/pqsql/data
- /usr/bin/initdb -D /var/lib/pgsql/data
- /usr/bin/postmaster -D /var/lib/pgsql/data logfile
21 
- createdb test postgres
- psql test
create table testdata (id int not null primary key,
foo varchar(25), bar int);
insert into testdata values(1, 'hello', 12345);
- Update server.xml with this under the /Host tag:
Resource name=jdbc/postgres auth=Container
 type=javax.sql.DataSource
driverClassName=org.postgresql.Driver
 url=jdbc:postgresql://127.0.0.1:5432/mydb
 username=postgres password=postgres
maxActive=20 maxIdle=10 maxWait=-1/
/Context
cd /usr/local/jakarta-tomcat-5.5.7/common/lib
- wget
http://cvs.apache.org/builds/jakarta-taglibs/nightly/jakarta-taglibs-20050303.tar.gz
- tar xzf jakarta-taglibs-20050303.tar.gz
- mkdir /var/www/webapps/dbtest
- vi /var/www/webapps/dbtest/test.jsp (I put the
example code here)
Here it is just in case:

%@ taglib uri=http://java.sun.com/jsp/jstl/sql;
prefix=sql %
%@ taglib uri=http://java.sun.com/jsp/jstl/core;
prefix=c %
sql:query var=rs dataSource=jdbc/TestDB
select id, foo, bar from testdata
/sql:query
html
 head
   titleDB Test/title
 /head
 body
 h2Results/h2
 
c:forEach var=row items=${rs.rows}
   Foo ${row.foo}br/
   Bar ${row.bar}br/
/c:forEach

 /body
/html
- mkdir /var/www/webapps/dbtest/WEB-INF/
- vi /var/www/webapps/dbtest/WEB-INF/web.xml
I have the following in web.xml
web-app xmlns=http://java.sun.com/xml/ns/j2ee;
  
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
  
xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
   version=2.4
 descriptionPostgre Test App/description
 resource-ref
 descriptionDB Connection/description
 res-ref-namejdbc/test/res-ref-name
 res-typejavax.sql.DataSource/res-type
 res-authContainer/res-auth
 /resource-ref
/web-app

I now copy the necessary tag libraries over to the
application directory:
- mkdir /var/www/webapps/dbtest/WEB-INF/lib
- cp
/usr/local/jakarta-tomcat-5.5.7/common/lib/jakarta-taglibs/standard/lib/jstl.jar
standard.jar /var/www/webapps/dbtest/WEB-INF/lib
- cp
/usr/local/jakarta-tomcat-5.5.7/common/lib/jakarta-taglibs/standard/tld/*
/var/www/webapps/dbtest/WEB-INF
- catalina.sh run
- http://localhost:8080/dbtest/test.jsp
- And the console gives the following:
[EMAIL PROTECTED] local]# catalina.sh run
Using CATALINA_BASE:   /usr/local/jakarta-tomcat-5.5.7
Using CATALINA_HOME:   /usr/local/jakarta-tomcat-5.5.7
Using CATALINA_TMPDIR:
/usr/local/jakarta-tomcat-5.5.7/temp
Using JRE_HOME:   /usr/java/jdk1.5.0
Mar 3, 2005 10:22:45 PM
org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Mar 3, 2005 10:22:45 PM
org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1106 ms
Mar 3, 2005 10:22:45 PM
org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Mar 3, 2005 10:22:45 PM
org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.7
Mar 3, 2005 10:22:45 PM
org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Mar 3, 2005 10:22:46 PM
org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Mar 3, 2005 10:22:46 PM
org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on /0.0.0.0:8009
Mar 3, 2005 10:22:46 PM org.apache.jk.server.JkMain
start
INFO: Jk running ID=0 time=0/142  config=null
Mar 3, 2005 10:22:47 PM
org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath
resource
Mar 3, 2005 10:22:47 PM
org.apache.catalina.startup.Catalina start
INFO: Server startup in 1701 ms
Mar 3, 2005 10:23:29 PM
org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw
exception
javax.servlet.jsp.JspException: Unable to get
connection, DataSource invalid:
java.sql.SQLException: No suitable driver
   at
org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.getConnection(Unknown
Source)
   at
org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.doStartTag(Unknown
Source)
   at
org.apache.jsp.test_jsp._jspx_meth_sql_query_0(org.apache.jsp.test_jsp:101)
   at
org.apache.jsp.test_jsp._jspService(org.apache.jsp.test_jsp:58)
 

Re: Equivalent of Resin run-at servlet configuration

2005-03-03 Thread David Smith
I think the Cocoon project has such a facility.  I'm not sure how 
complicated it would be to pull out that functionality, but their work 
might be worth looking at for this.

--David
Parsons Technical Services wrote:
With all the questions and suggestions flying around, a question to 
the other programmers: If one was to write a class for the purpose of 
running classes at set times, what pitfalls would one need to watch for?

I have a class that loads on startup and runs a continuous loop that 
is timed (sleeps, wakes up, does something, sleeps again). It runs 
fine, but I know that it could be better.

Any guidance or suggestions would be appreciated. And maybe we could 
create an add-on and post it for use in apps that need such a device.

Thanks
Doug
- Original Message - From: Nikola Milutinovic 
[EMAIL PROTECTED]
To: Tomcat Users List tomcat-user@jakarta.apache.org
Sent: Thursday, March 03, 2005 6:55 AM
Subject: Re: Equivalent of Resin run-at servlet configuration


Subramanya Sastry wrote:
Hello,
I am developing a Java web application, and one of the requirements 
is to run a particular servlet periodically, or even at specified 
times.  Resin provides this ability via its run-at configuration 
element for servlets in web.xml

Example Resin configuration:
  servlet
 servlet-namedownload/servlet-name
 servlet-classDownloadNewsServlet/servlet-class
 run-at period='360m'/
  /servlet
However, I haven't found an equivalent configuration for Tomcat.  I 
searched
the web and was unsuccessful.  So, any pointers as to how I could 
achieve this
for Tomcat would be appreciated.

There is none and shouldn't be any. I understand the need to run 
periodical tasks, but J2EE specification, prior to 1.4 has no such 
provisions. Further, Servlet/JSP specification has no such provision, 
even in J2EE 1.4. You'd be best advised to setup a cron-job to 
perform this periodic activity. There are several good HTTP client 
packages out there, Jakarta-Commons HTTPclient, to name one, that 
will help you in building the client side of your cron-job.

Nix.
-
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: newbie having problems with MySQL JDBC/JNDI Datasource example

2005-03-02 Thread David Smith
In your context definition, you have Resource name=TestDB..
In your web.xml, you have res-ref-namejdbc/TestDB/res-ref-name
These two need to match.  If one is jdbc/TestDB, so must the other.
--David
Darryl Wagoner wrote:
Greetings,
Not sure if this made it the first time.  I didn't see it show up on 
the list

I am trying to get the example in the MySQL JDBC/JNDI HOWTO to work 
and I am missing something.

I get this error:  My webapp directory is /DBTest.
What am I missing?
thanks
-darryl
--- Error Page ---
*type* Exception report
*message*
*description* _The server encountered an internal error () that 
prevented it from fulfilling this request._

*exception*
javax.servlet.ServletException: Unable to get connection, DataSource 
invalid: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot 
create JDBC driver of class '' for connect URL 'null'
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:845) 

org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:778) 

org.apache.jsp.testDB_jsp._jspService(org.apache.jsp.testDB_jsp:81)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325) 

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) 

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
*root cause*
javax.servlet.jsp.JspException: Unable to get connection, DataSource 
invalid: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot 
create JDBC driver of class '' for connect URL 'null'
org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.getConnection(QueryTagSupport.java:276) 

org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.doStartTag(QueryTagSupport.java:159) 

org.apache.jsp.testDB_jsp._jspx_meth_sql_query_0(org.apache.jsp.testDB_jsp:100) 

org.apache.jsp.testDB_jsp._jspService(org.apache.jsp.testDB_jsp:58)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325) 

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) 

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
--- Server.xml ---
?xml version='1.0' encoding='utf-8'?
!-- $Id$ --
Server
 Listener 
className=org.apache.catalina.mbeans.ServerLifecycleListener/
 Listener 
className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListen
er/
 GlobalNamingResources
   Environment name=simpleValue type=java.lang.Integer value=30/
   Resource auth=Container description=User database that can be 
updated an
d saved
   name=UserDatabase type=org.apache.catalina.UserDatabase
   pathname=conf/tomcat-users.xml 
factory=org.apache.catalina.users.MemoryUs
erDatabaseFactory/

 /GlobalNamingResources
 Service name=Catalina
   Connector port=8080 redirectPort=8443 maxSpareThreads=75 
maxThreads=150 minSpareThreads=25
   /Connector
   Connector port=8081 proxyName=dax.shecora.com proxyPort=80
   redirectPort=8443 maxSpareThreads=75 maxThreads=150 
minSpareThreads=25
   /Connector
   Connector port=8009 protocol=AJP/1.3
   protocolHandlerClassName=org.apache.jk.server.JkCoyoteHandler 
redirectPort=8443
   /Connector

   Engine defaultHost=localhost name=Catalina
 Host appBase=webapps name=localhost
 Context path=/DBTest docBase=DBTest debug=5
 reloadable=true crossContext=true
 Resource name=TestDB type=javax.sql.DataSource 
password=javadude
 driverClassName=com.mysql.jdbc.Driver maxIdle=2 
maxWait=5000 username=javauser
 url=jdbc:mysql://localhost:3306/javatest?autoReconnect=true
 maxActive=4/
 /Context

--- web.xml ---
?xml version=1.0 encoding=ISO-8859-1?
!DOCTYPE web-app
   PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN
   http://java.sun.com/dtd/web-app_2_3.dtd;
web-app xmlns=http://java.sun.com/xml/ns/j2ee; 
xmlns:xsi=http://www.w3.org/20
01/XMLSchema-instance
   xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/
ns/j2ee/web-app_2_4.xsd
   version=2.4
 descriptionMySQL Test App/description
 resource-ref
 descriptionDB Connection/description
 res-ref-namejdbc/TestDB/res-ref-name
 res-typejavax.sql.DataSource/res-type
 res-authContainer/res-auth
 /resource-ref
/web-app


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


Re: newbie having problems with MySQL JDBC/JNDI Datasource example

2005-03-02 Thread David Smith
No problem.  Amazing what an extra set of eyes will catch, isn't it?
Enjoy!
David
Darryl Wagoner wrote:
David,
I have been looking at this off and on for weeks and could not see the 
problem.  I changed the context to
be jdbc/TestDB and it worked.

Thank you very much
David Smith wrote:
In your context definition, you have Resource name=TestDB..
In your web.xml, you have res-ref-namejdbc/TestDB/res-ref-name
These two need to match.  If one is jdbc/TestDB, so must the other.
--David

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


Re: Need access to classes outside Tomcat for JSPs

2005-03-01 Thread David Smith
Why do you want your classes outside of Tomcat?  Copy the classes to 
your project when you build and eliminate the dependency.  Or better 
yet, use a build environment like Ant to do the copying for you.  As a 
bonus, it'll catch errors before you get to production and the webapp 
will be more portable.

--David
Dan wrote:
Classpath problem.  Really frustrating.
I'm trying to duplicate a setup on system A to system B and can't get 
it working.  My problem is when I access the JSP page, Tomcat 
complains of a ClassNotFound exception.  This happens with all of my 
custom classes.  If I create a simple JSP page with no custom classes 
the JSP compiles fine.

When I manually execute the class via java com.xxx.MyClass it 
responds appropriately (my environment's CLASSPATH includes the custom 
library paths).

My custom classes live outside of the Tomcat directory (see below) 
because I use these classes in other non-web based applications, so 
they need to be available system wide.

I have melted my brain today trying to figure out why system A works 
with this configuration but system B gives me the ClassNotFound 
exception.   I have even copied my entire Tomcat directory from system 
A to system B with no change.  I thought perhaps I was starting the 
service with additional parameters but I don't see any in the registry 
settings.

Does anyone have an educated guess as to why I can't get this thing to 
work the way it's working on the other system and/or how I can get 
this working with my custom classes OUTSIDE of Tomcat.


Win2K SP4
Tomcat v5.0.27 as NT Service
e:\java\tomcat
e:\java\sdk (JDK 1.4.2)
e:\java\library\custom\  (custom libraries)
e:\java\library\basic   (libraries from other sources)

-
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: error-page directive

2005-03-01 Thread David Smith
The order matters.  It's a requirement that comes from validating the 
web.xml against a DTD -- not anything that Tomcat itself requires.  In 
the servlet 2.4 spec, they moved to valdating against a schema so order 
no longer matters.

--David
Ian van der Neut wrote:
On Tue, 1 Mar 2005 10:41:36 +0100, Ian van der Neut [EMAIL PROTECTED] wrote:
 

On Tue, 01 Mar 2005 10:32:42 +0100, Trond G. Ziarkowski
[EMAIL PROTECTED] wrote:
   

Hi,
Have you tried to move your the error-page directive to between the
welcome-file-list and taglib directives. Seem to remember this
happening to me some time ago as well.
 

That seems to get rid of the message, but it doesn't seem to honour
the directive, because I still get tomcats default exception
stacktrace page.
   

The fact that it is not honoured seems to be because of a problem in
the apperror.jsp file. Moving the error-page directive before the
taglib directive solves the problem indeed.
Just curious, does order matter in web.xml? If so, where is this
documented? Or is this just a bug?
Thank you very much,
Ian.
-
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: Need access to classes outside Tomcat for JSPs

2005-03-01 Thread David Smith
Well, not to be rude, but your design choice is IMHO, poor.  Build 
tools are available and designed to handle version control -- which is 
what I read as the reason for your reluctance to include the classes 
directly in the webapp.  Every few months, I see someone come on the 
list asking what you are asking and the advice is always the same: Don't 
do it that way.

Good luck in your efforts.  Just don't expect a lot of help on this.
--David
Dan wrote:
Do people read anymore?
As previously stated in the original post, these classes need to be 
available to other non-web, non TomCat applications.  I do not want to 
have to maintain two different repositories.  Also as previously 
stated I have the desired configuration running on another box but I 
cannot duplicate the setup on this box.

If your only advice is to move them into TomCat, then please don't 
even bother replying.

At 08:21 AM 3/1/2005, David wrote:
Why do you want your classes outside of Tomcat?  Copy the classes to 
your project when you build and eliminate the dependency.  Or better 
yet, use a build environment like Ant to do the copying for you.  As 
a bonus, it'll catch errors before you get to production and the 
webapp will be more portable.

--David
Dan wrote:
Classpath problem.  Really frustrating.
I'm trying to duplicate a setup on system A to system B and can't 
get it working.  My problem is when I access the JSP page, Tomcat 
complains of a ClassNotFound exception.  This happens with all of my 
custom classes.  If I create a simple JSP page with no custom 
classes the JSP compiles fine.

When I manually execute the class via java com.xxx.MyClass it 
responds appropriately (my environment's CLASSPATH includes the 
custom library paths).

My custom classes live outside of the Tomcat directory (see below) 
because I use these classes in other non-web based applications, so 
they need to be available system wide.

I have melted my brain today trying to figure out why system A works 
with this configuration but system B gives me the ClassNotFound 
exception.   I have even copied my entire Tomcat directory from 
system A to system B with no change.  I thought perhaps I was 
starting the service with additional parameters but I don't see any 
in the registry settings.

Does anyone have an educated guess as to why I can't get this thing 
to work the way it's working on the other system and/or how I can 
get this working with my custom classes OUTSIDE of Tomcat.


Win2K SP4
Tomcat v5.0.27 as NT Service
e:\java\tomcat
e:\java\sdk (JDK 1.4.2)
e:\java\library\custom\  (custom libraries)
e:\java\library\basic   (libraries from other sources)


-
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: error-page directive

2005-03-01 Thread David Smith
For good docs, I've found the servlet spec an excellent place to start.  
As a foot note though, Tomcat seems switches between servlet spec 2.3 
and 2.4 depending on how the web-app node is defined in web.xml.  If you 
declare it against the 2.3 DTD, the 2.3 spec is used.  If you use the 
2.4 schema, 2.4 spec is adhered to.  See the spec for how each is 
declared in web.xml.

Servlet spec 2.3: http://www.jcp.org/en/jsr/detail?id=53
Servlet spec 2.4: http://www.jcp.org/en/jsr/detail?id=154
--David
Graba, Jan wrote:
Hi, again.
I don't really think it makes any difference to this application, but I'm using 
J2SE, not J2EE. Though I am, of course, using a
web.xml file for my web application, nothing in this file need reference the 
error page. At least, that was the case with version
2.3 of the servlet API under Tomcat 4.1, since the error page worked 
faultlessly under that. Is 2.4 more restrictive? Is an
error-page tag now mandatory? Is this change documented? Since I currently have 
only servlet and servlet-mapping tags in my
web.xml, can I simply place the tag where I wish?
Sorry for the proliferation of fairly trivial questions.
Thanks in anticipation.
Cheers.
Jan
-Original Message-
From: David Smith [mailto:[EMAIL PROTECTED] 
Sent: 01 March 2005 13:27
To: Tomcat Users List
Subject: Re: error-page directive

The order matters.  It's a requirement that comes from validating the 
web.xml against a DTD -- not anything that Tomcat itself requires.  In 
the servlet 2.4 spec, they moved to valdating against a schema so order 
no longer matters.

--David
Ian van der Neut wrote:
 

On Tue, 1 Mar 2005 10:41:36 +0100, Ian van der Neut [EMAIL PROTECTED] 
wrote:

   

On Tue, 01 Mar 2005 10:32:42 +0100, Trond G. Ziarkowski 
[EMAIL PROTECTED] wrote:
  

 

Hi,
Have you tried to move your the error-page directive to between the 
welcome-file-list and taglib directives. Seem to remember this 
happening to me some time ago as well.


   

That seems to get rid of the message, but it doesn't seem to honour 
the directive, because I still get tomcats default exception 
stacktrace page.
  

 

The fact that it is not honoured seems to be because of a problem in 
the apperror.jsp file. Moving the error-page directive before the 
taglib directive solves the problem indeed.

Just curious, does order matter in web.xml? If so, where is this 
documented? Or is this just a bug?

Thank you very much,
Ian.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

   

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

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


Re: JavaMail API ?

2005-03-01 Thread David Smith
No mistake that I know about.  JAF and JavaMail are both separate 
downloads from Sun's site and have been all along.  Licensing issues 
probably prevent them from being included in the Tomcat dist.

--David
Nikola Milutinovic wrote:
Nikola Milutinovic wrote:
Hi all.
I'm running Tomcat 5.5.7 on Windows XP and Sun JDK 1.5.0_01 I notice 
that JavaMail API is missing from BOTH Tomcat and JRE. There is no 
javax.mail.* hierarchy in ${JAVA_HOME}/lib/rt.jar

It is also missing JAF (Java Activation Framework).
I mean, no problem, I CAN get a hold of those JARs, but really, what's 
the story? A simple mistake on Sun's or TC team's part?

Nix.
-
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: Starting up Tomcat when the Linux starts up

2005-02-25 Thread David Smith
There should be an example tomcat5.sh with your distribution of jsvc.  
If not, download the most recent release from the Commons Daemon project 
at jakarta.apache.org and get a copy from there.  Customize it with the 
options you use and you should be good to go.

Splitting out put between console and log:  check your linux man pages 
for the tee command.  It's designed to split output between standard out 
and a file.

--David
Behrang Saeedzadeh wrote:
Thanks for the response.
BTW - I'm new to Linux :-) and don't know much about it...
On Thu, 24 Feb 2005 15:13:09 -0500, David Smith [EMAIL PROTECTED] wrote:
 

Depends on your flavor of linux.  Mandrake (I've heard RH is similar)
   

I'm using Ubuntu which is a Debian based distro.
 

stores the init script in /etc/init.d with a sym link in
/etc/rc[runlevel-here].d.  
   

I know that, for example, init scripts of MySQL and Samba are stored
in /etc/init.d. I actually installed MySQL and Samba using apt and it
took care of the rest of the progess...
 

For example, if your script is tomcat5, then
   

Do I have to create this script by myself? Should the contents of it
be the same as the command that I write to run Tomcat using JSVC?
 

tomcat5 would be stored /etc/init.d w/ a sym link to it from
/etc/rc5.d.  5 being the runlevel where X is started and run.  The name
of the sym link is S[some-priority-number]tomcat5.  Take a look at your
linux docs and other services for more info.  Low numbers are started
first, high numbers last.
   

Can you help me a bit more?
 

Tomcat's console output is usually redirected to logs/catalina.out.
   

How can I both print it to the terminal and logs/catalina.out like in 
Windows?
Best Regards,
Behrang.
 

--David
Behrang Saeedzadeh wrote:
   

Hi
How can I startup Tomcat when Linux starts up? I've successfully
compiled JSVC and have started Tomcat 5.5.7 using it for several
times...
BTW - Why I can't see the console output of Tomcat in Linux like
Windows (i.e. warnings, infos, messages, ...)?
Best Regards,
 

-
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: Very Straneg problem with MySQL-Connector

2005-02-24 Thread David Smith
Hi.
The issue is mysql validates user, host, and password on login -- sort 
of a three factor authentication.  Go into mysql and take a look at the 
result of these commands to see what users are defined:

use mysql ;
select user, host, password from user ;
IMHO, don't use root from a webapp.  Create a specific user for your 
webapp that only has the necessary rights.  Here's an example, read the 
docs at http://www.mysql.com for more info:

grant select, delete, insert, update on databaseNameHere.* to 
'webappUsernameHere'@'monkinetwork' identified by 'passwordHere' ;

Then update your web application's resource definition with the new 
username and password.

--David
monkiboy wrote:
Hi everybody!
I have a weird problem to use the MySQL-connector under Linux (Debian). I heard it can come from Tomcat.
I have no problem in windows XP, all is working fine ! 
But under Linux when I try to connect to mysql throught mysql-connector wrote in a Servlet I have this message :

Message: Invalid authorization specification message from server: Access denied for user 'root'@'monkinetwork' (using password: YES) 
SQLState: 28000 
ErrorCode: 1045 

I am Using : Tomcat 5.0.28
MySQL-Connector version is : mysql-connector-java-3.0.15-ga-bin.jar 

JDK Version : 1_5_0_01. Servlet-Examples and JSP works fine! So I don't think the problem come from JDK. 

MySQL version : MySQL-SERVER-4.1.9-2 : All is working under console mode ! 

Here's My Servlet TESt1.java: 

Code: 

import java.io.*; 
import javax.servlet.*; 
import javax.servlet.http.*; 
import java.sql.*; 
import java.sql.DriverManager; 

public class TEST1 extends HttpServlet { 
public void doGet(HttpServletRequest request, HttpServletResponse response) 
throws ServletException, IOException  { 
   
   response.setContentType(text/html); 
   PrintWriter out = response.getWriter(); 
   
  String url = jdbc:mysql://localhost:3306/HeroDB; 
  String user = root; 
  String password = password; 

try{ 
   Class.forName(com.mysql.jdbc.Driver); 
   out.println(br DRIVERS JDBC : OK!); 
   Connection connection = DriverManager.getConnection(url,user,password); 

   out.println(br Database connection : OK!); 
 
   } 
catch (ClassNotFoundException e) 
 { 
out.println(Error with JDBC Drivers !); 
 } 
catch(SQLException ex) { 
   
   
   out.println(br ERROR MESSAGE br); 
  while (ex != null) { 
  
   out.println(brMessage:  + ex.getMessage ()); 
  
   out.println(brSQLState:   + ex.getSQLState ()); 
  
   out.println(brErrorCode:   + ex.getErrorCode ()); 
  
   ex = ex.getNextException(); 
 out.println(); 
  } 
} 

} 
} 


AND THE HTML PAGE in order to access to the Servlet :
Code: 

HTML 
HEAD 
TITLEDataBase Test/TITLE 
/HEAD 
BODY BGCOLOR=#FDF5E6 
H2 ALIGN=CENTERDataBase TEST/H2 

FORM ACTION=http://localhost:8080/TEST1; 
CENTER 
INPUT TYPE=SUBMIT VALUE = CONNEXION TEST 
/CENTER 
/FORM 

/BODY 
/HTML 

Theses codes works very well under windows, but under linux system here what 
I've got :
DRIVERS JDBC : OK!
ERROR MESSAGE
Message: Invalid authorization specification message from server: Access denied for user 'root'@'monkinetwork' (using password: YES) 
SQLState: 28000 
ErrorCode: 1045 

Well, the web.xml file is well configured.
Anyway : I already tried with class: org.gjt.mm.mysql.driver, but I have the same message error ! 

By the way, it's very strange that I can play with MySQL under the terminal but not throught tomcat. 
Any suggestions please , because it's giving me a very hard time ! ?
Thank you !
++ 
monkiboy

 

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


Re: How to send hidden variables to next page

2005-02-24 Thread David Smith
This is getting into territory where you'd be better off doing some 
googling or buying a good javascript cookbook.  I havn't bought any  of 
those books recently although I've had good experience with subjects 
from Wrox Publishing and O'Reilly Associates in the past.  Visit 
Amazon.  They even support a rating scheme where people can voice their 
opinion.

On the Delete issue, you could do a server-side rewrite of a link that 
invokes an action to delete a row as in:
a 
href=http://localhost:8080/mywebapp/deleteRow.do?recordNum=10;Delete 
Me/a

That's just a basic GET form request.
Again, find a good book, do some reading.
--David
U K Laxmi wrote:
Thanks David for the solution. To be frank, i really
don't know how to code it. Will you give a sample code
snippet? I'm using apache2, tomcat 5.5.7 on Win 2K
machine.
One more problem. I've a form and also submit button.
I've number of text fields in it. On entering some
data and focus losts from that field, i call a
javascript function, i set number of hidden values and
call a JSP using location.href of Javascript. But
hidden values are not getting passed to jsp.I'm
getting null. Why? How to overcome this? Pls help.
One more requirement what i've is: 
i'VE A FORM WITH FORM ELEMENTS IN IT AND A 'aDD'
BUTTON. After filling theform, if the user clicks on
'Add' button, the contents gets added aas row into a
HTML table located below that form. That way user can
add n number of rows to the bottom table. In the
table, i need a 'Delete' button. After selecting any
row, if the user clicks on 'Delete' button, it should
get deleted from the table. I guess it can be
possible. But it's a big challenge to me as i know
only ABCD of HTML  Javascript.

If anybody can direct me to a good HTML/Javascritp
forum also fine. If i get a solution directly, it's
wonderful.
Thanks a lot. Sorry again if it's not the right place
to post this.
--- David Smith [EMAIL PROTECTED] wrote:
 

The best advice I can offer -- have a javascript
that does the submit 
for you on the event the drop-down changes state. 
Then let a servlet 
handle storing your form data in the session and
passing updated data to 
the next page.  Outside of something like that, I
think you'll need to 
incorporate a submit button.

--David
U K Laxmi wrote:
   

Thanks for the answers Shakeel.
My problem is, i've a page that doesn't have submit
button. I need to send the hidden variables in that
HTML page to next HTML page. Here the hidden value
 

is
   

set based on the type of option selected from
 

'select'
   

drpo down box in HTML. To put it in session, i need
 

to
   

identify the selected option and assign it to java
varialbe. I don't think it's possible to assign a
javascript variable to java variable. Pls help to
solve this problem.
--- Shakeel Ahmad [EMAIL PROTECTED]
 

wrote:
   


 

Wel this might help...
// You write following two lines in first JSP
   

page.
   

String name = Java;// This might be your hidden
field.
session.setAttribute(HiddenName, name);
//Then you get the name on next page as follows.
String userName =
(String)session.getAttribute(HiddenName);
The name attribute will be available throught
   

the
   

session life, unless we
remove it explicitly or restart Tomcat.
We can use it on any page once it is placed
properly.
Best Regards,
S H A K E E L   A H M A D
   

http://members.fortunecity.com/javaclub/shakeel.htm
 

Voice: 00923002723316
Senior Software Engineer.
NorthStar Technologies. www.globalnorthstar.com
EE(Computer Engineering), UET Lahore, Pakistan.
SCJP,SCWCD  SCBCD Sun Microsystems, Inc.
Brain Bench Certified Java Programmer.
-Original Message-
From: U K Laxmi [mailto:[EMAIL PROTECTED]
Sent: 23 February, 2005 10:37 AM
To: Tomcat Users List
Subject: RE: How to send hidden variables to next
page
Yes. I'm using JSP. Can you pls tell me the syntax
or
guidelines as how to do it.
Thank you.
--- Shakeel Ahmad [EMAIL PROTECTED]
wrote:
  

   

If you are developing a JSP/Servlet then you can


 

do
  

   

this by keeping those
variables in session.
Best Regards,
S H A K E E L   A H M A D


 

http://members.fortunecity.com/javaclub/shakeel.htm
 

  

   

Voice: 00923002723316
Senior Software Engineer.
NorthStar Technologies. www.globalnorthstar.com
EE(Computer Engineering), UET Lahore, Pakistan.
SCJP,SCWCD  SCBCD Sun Microsystems, Inc.
Brain Bench Certified Java Programmer.
-Original Message-
From: U K Laxmi [mailto:[EMAIL PROTECTED]
Sent: 23 February, 2005 10:31 AM
To: Tomcat Users List
Subject: How to send hidden variables to next
 

page
   

Sorry if it's not the right place to post this
question. Excuse me.
I've some hidden variables in a web page. I want


 

to
  

   

send them to next page without using submit


 

button.
  

   

I
don't know how to do it. More over i don't know


 

how
  

   

to
access those

Re: Starting up Tomcat when the Linux starts up

2005-02-24 Thread David Smith
Depends on your flavor of linux.  Mandrake (I've heard RH is similar) 
stores the init script in /etc/init.d with a sym link in 
/etc/rc[runlevel-here].d.  For example, if your script is tomcat5, then 
tomcat5 would be stored /etc/init.d w/ a sym link to it from 
/etc/rc5.d.  5 being the runlevel where X is started and run.  The name 
of the sym link is S[some-priority-number]tomcat5.  Take a look at your 
linux docs and other services for more info.  Low numbers are started 
first, high numbers last.

Tomcat's console output is usually redirected to logs/catalina.out.
--David
Behrang Saeedzadeh wrote:
Hi
How can I startup Tomcat when Linux starts up? I've successfully
compiled JSVC and have started Tomcat 5.5.7 using it for several
times...
BTW - Why I can't see the console output of Tomcat in Linux like
Windows (i.e. warnings, infos, messages, ...)?
Best Regards,
 

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


Re: How to send hidden variables to next page

2005-02-23 Thread David Smith
The best advice I can offer -- have a javascript that does the submit 
for you on the event the drop-down changes state.  Then let a servlet 
handle storing your form data in the session and passing updated data to 
the next page.  Outside of something like that, I think you'll need to 
incorporate a submit button.

--David
U K Laxmi wrote:
Thanks for the answers Shakeel.
My problem is, i've a page that doesn't have submit
button. I need to send the hidden variables in that
HTML page to next HTML page. Here the hidden value is
set based on the type of option selected from 'select'
drpo down box in HTML. To put it in session, i need to
identify the selected option and assign it to java
varialbe. I don't think it's possible to assign a
javascript variable to java variable. Pls help to
solve this problem.
--- Shakeel Ahmad [EMAIL PROTECTED] wrote:
 

Wel this might help...
// You write following two lines in first JSP page.
String name = Java;// This might be your hidden
field.
session.setAttribute(HiddenName, name);
//Then you get the name on next page as follows.
String userName =
(String)session.getAttribute(HiddenName);
The name attribute will be available throught the
session life, unless we
remove it explicitly or restart Tomcat.
We can use it on any page once it is placed
properly.
Best Regards,
S H A K E E L   A H M A D
http://members.fortunecity.com/javaclub/shakeel.htm
Voice: 00923002723316
Senior Software Engineer.
NorthStar Technologies. www.globalnorthstar.com
EE(Computer Engineering), UET Lahore, Pakistan.
SCJP,SCWCD  SCBCD Sun Microsystems, Inc.
Brain Bench Certified Java Programmer.
-Original Message-
From: U K Laxmi [mailto:[EMAIL PROTECTED]
Sent: 23 February, 2005 10:37 AM
To: Tomcat Users List
Subject: RE: How to send hidden variables to next
page
Yes. I'm using JSP. Can you pls tell me the syntax
or
guidelines as how to do it.
Thank you.
--- Shakeel Ahmad [EMAIL PROTECTED]
wrote:
   

If you are developing a JSP/Servlet then you can
 

do
   

this by keeping those
variables in session.
Best Regards,
S H A K E E L   A H M A D
 

http://members.fortunecity.com/javaclub/shakeel.htm
   

Voice: 00923002723316
Senior Software Engineer.
NorthStar Technologies. www.globalnorthstar.com
EE(Computer Engineering), UET Lahore, Pakistan.
SCJP,SCWCD  SCBCD Sun Microsystems, Inc.
Brain Bench Certified Java Programmer.
-Original Message-
From: U K Laxmi [mailto:[EMAIL PROTECTED]
Sent: 23 February, 2005 10:31 AM
To: Tomcat Users List
Subject: How to send hidden variables to next page
Sorry if it's not the right place to post this
question. Excuse me.
I've some hidden variables in a web page. I want
 

to
   

send them to next page without using submit
 

button.
   

I
don't know how to do it. More over i don't know
 

how
   

to
access those variables in the next page. Is there
any
option available to do this html or tomcat or
apache?
Thanks!!
--- Matt [EMAIL PROTECTED] wrote:
 

Ah-ha, somehow I changed a line in the
uriworkermap.properties file from
this (some pointless experiment out of past
frustrated delirium):
/jsp-examples/*=ajp13w
...to this:
/jsp-examples/*.jsp
...so changing it back (which is how it was
out-of-the-box after
jk_1.2.8.exe was run) to:
/jsp-examples/*=ajp13w
...fixes it, and I can now access both
   

directories
   

fine (inside and
outside of $CATALINA_HOME/webapps)!!!  YAY!!!
I now get the expected results for:
http://localhost/jsp-examples/ (the webapps/
examples page)
...and for:
http://localhost:8080/jsp-examples/ (the
   

webapps/
   

examples page)
...and for:
http://localhost:8080 (Tomcat home page)
...and for:
http://localhost (IIS home page)
...and for:
http://localhost/JSP/MYwebapps/MYjsp-examples
(the C:\Inetpub\wwwroot\JSP\MYwebapps\ examples
page)
...and the .JSP pages work as expected in both
places!
Now I can add docabses to my heart's content -
*relieved sigh*
SO...the easy answer is a simple, single CONTEXT
addition, but making sure
to overlap the end of the docbase path with
   

the
   

path:
Context path=/JSP
docbase=C:/Inetpub/wwwroot/JSP debug=0
reloadable=true crossContext=false /
As an aside, I got rid of the ...path=
docbase=... CONTEXT, so I
have no idea why you're using that line in your
server.xml file, Wendy?
THANKS, Wendy!!!
-Matt
On Tue, 22 Feb 2005, Matt wrote:
   

OK, we've at least gotten to the point where I
 

can
 

now run the examples
   

from my own directory outside of
 

$CATALINA_HOME/webapps, and by ONLY
   

editing server.xml and uriworkermap.properties
 

slightly, and NOTHING
   

ELSE, which is not only nice, but also what I
 

expected all along!
   

(THANK YOU!THANK YOU!THANK YOU!)*
*HOWEVER, now that I made the changes you
 

recommended, the webapps area
   

now is NOT FOUND when using plain URL's.  I
 

get
   

a
 

(Tomcat-based) directory
   

listing when using the 

Re: JasperException while running JSP

2005-02-18 Thread David Smith
This is really just a guess, but could it be your class isn't in a 
package?  Try this:

1. Create the folder structure com/mycompany/mywebproject under 
WEB-INF/classes substituting in your company name and web project name 
where indicated.

2. place this line near the beginning of your java class source file: 
package com.mycompany.mywebproject ;  Again, replace your company name 
and web site project name where indicated.

3. Recompile and place the resulting .class file in the 
WEB-INF/classes/com/mycompany/mywebproject folder created in 1.

4. Restart your webapp and try it.
--David
U K Laxmi wrote:
I have integrated tomcat 5.5 with apache 2
successfully and i could able to run sample JSPs. Now
i created a jsp page which will inititate a Java
program called TestSQLLoad.java. TestSQLLoad.java
talks to Ms Access database and gets me reuired fields
from databasae and it will be displayed on browser
thro' JSP page test-db.jsp. I'm using Netscape 7.2
browser. When i run test-db.jsp after running tomcat 
apache, it gives JasperException. It's saying -
TestSQLLoad cannot be resolved or is not a type.
I created jar file with TestSQLLoad.java 
TestSQLLoad.class and put it in
TOMCAT_ROOT/webapps/web/WEB-INF/classes directory as
well as TOMCAT_ROOT/common/lib directories. Thinking
that class loader is unable to find the class, i put
the above directories in my class path as well. Where
i'm going wrong? What's happenning. Pls help.
Here is the exception that's displayed on the browser.
org.apache.jasper.JasperException: Unable to compile
class for JSP
An error occurred at line: 7 in the jsp file:
/JSP/test-db.jsp
Generated servlet error:
TestSQLLoad cannot be resolved or is not a type
An error occurred at line: 7 in the jsp file:
/JSP/test-db.jsp
Generated servlet error:
TestSQLLoad cannot be resolved or is not a type

org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:397)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:296)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
		
__ 
Do you Yahoo!? 
Meet the all-new My Yahoo! - Try it today! 
http://my.yahoo.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: Serving up a Flash file

2005-02-18 Thread David Smith
Just think out of the box a little on this one.  Your .swf file can be 
literally anywhere on the web and on any web server as long as it's 
accessible.  Then just write your code as:

HTML
   BODY bgcolor=#ff
   OBJECT width=300  height=200  align=center
   PARAM name=movie   
value=http://www.some.webserver.com/someDir/test.swf;
   EMBED src=http://www.some.webserver.com/someDir/test.swf; 
type=application/x-shockwave-flash width=300 height=200
   /EMBED
   /OBJECT
   /BODY
/HTML

You could also use relative urls such as /someDir/test.swf, 
./someDir/test.swf or test.swf if you want as long as your .swf file 
is available on the same server as your .html or jsp.

As far as avoiding having serveral copies of the same file, that's 
really a matter of how you handle the dev project.  You could place them 
all in a directory on a server separate from your webapp and just link 
to them.  This option is a favorite of people who put their Tomcat 
service behind Apache and have Apache serve static content. 

Or (and I like this one better) have a one directory repository for all 
of the shared .swf files and use an ant compile task to copy them so 
they are included in building the .war file.  when you change one of the 
files, just re-run the ant builds and deploy your new .war files.  At 
your level, this might be one to keep in mind but not try until you have 
some other successes first.

--David
Paul Erion wrote:
Shey Rab Pawo [EMAIL PROTECTED] wrote:
Your conclusion is not correct.  What Mr. Bainbridge told you is true,
but that does not restrict where you can store the files on the server.
Ok, now I'm confused ...
  [Bainbridge]: What you need to do is generate the Flash file in
  in a directory that Jboss/Tomcat serves files from like
  webapps\yourwebappname\flash_files or similar or
  similar and then the value= in your embed needs to be
  relative to the location of the JSP that includes the tag.
My interpretation of the first part of the above is that the generated
Flash files need to reside in the web app's directory structure. 
However, you're saying that that's not the case -- they can reside
wherever on the server.  So, is it the second part of Mr. Bainbridge's
statement that provides the clue for accessing these files?  That as
long as the Flash file's path is specified relative to the location of
the JSP (which includes the embed tag), then I'm good to go.

Paul
-
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: deployment with a different context than war name - tomcat 5.5.7

2005-02-18 Thread David Smith
I would suspect your stuck on this one.  I think I remember a thread 
here back in the fall that essentially said the path attribute to 
Context/ is ignored in TC 5.5.7.  Any of the developers care to 
confirm that??

--David
Chad Woolley wrote:
Hi,
Can anyone point me to a working example of of using a context xml
fragment file to deploy an war at a different context than the war
name?  In other words, I don't want to define it in the global config
file.
I've read all the docs I can find on this, and it still doesn't work. 
I'm using the manager app to deploy, and it always says invalid
context.

Thanks,
Chad Woolley
-
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: log4j best practices

2005-02-17 Thread David Smith
I believe the classes have to be compiled with debug info included.  If 
using ant, javac would be done with the debug=true attribute.

See further info on ant's javac task here:
http://ant.apache.org/manual/CoreTasks/javac.html
--David
Brian McGovern wrote:
Im not able to get the class name and line number spittin out in the logs for 
classes where i call the logger.  But for jakarta, and struts classes I am.  
What am i doing wrong.
In Class Named DBConnection:
--private static final Logger zLogger = 
Logger.getLogger(DBConnection.class.getName());
log4j.properties file snippet:
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n
The corresponding log:
ERROR [http-8080-Processor25] (?:?) - 
org.apache.commons.dbcp.SQLNestedException: Cannot create 
PoolableConnectionFactory ([Microsoft][SQLServer 2000 Driver
Where did i go wrong?
-Original Message-
From: Brian McGovern [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 16, 2005 4:57 PM
To: Tomcat Users List
Subject: RE: log4j best practices
Oh man. they were in winnt system32 the whole time.  UGH. You were right.  
Thanks Jake!
-Original Message-
From: Jacob Kjome [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 16, 2005 4:28 PM
To: Tomcat Users List
Subject: RE: log4j best practices
Since you define your log files relatively, they will end up relative to the
directory where the JVM was started from.  I you use Tomcat scripts, then it
will be in CATALINA_HOME/bin.  If you use the Tomcat service, then the files
will end up in c:\winnt\System32 (unless you changed the base directory from
which the service starts the JVM.
I suggest you use...
log4j.appender.stdout.File=${catalina.home}/logs/catalina.out
Tomcat creates the catalina.home system property at startup.  You can use 
it
to reference Tomcat's home directory and then put the file anywhere you want
relative to that.
Jake
Quoting Brian McGovern [EMAIL PROTECTED]:
 

Thats the same approach im using. I have a commons-logging.properties and a
log4j.properties file in my WEB-INF\classes directory.  But I only get the
same loggin as before in stdout.log  Im using Win2k as OS.  Where do my
defined log files go?  Im confused.  Everything compiles.
I have this line in my classes:

private static final Logger zLogger = Logger.getLogger(MYCLASSNAME.CLASS);
Logging like this:

zLogger.debug(New Session Was Created);
commons-logging.properties file has 1 line.

org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger
log4j.properties file is here:

log4j.rootLogger=DEBUG, stdout, nycbbuilder_log
log4j.appender.stdout=org.apache.log4j.RollingFileAppender
log4j.appender.stdout.File=catalina.out
log4j.appender.stdout.MaxFileSize=100KB
log4j.appender.stdout.MaxBackupIndex=2
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n
log4j.appender.nycbbuilder_log=org.apache.log4j.RollingFileAppender
log4j.appender.nycbbuilder_log.File=nycbbuilder.log
log4j.appender.nycbbuilder_log.MaxFileSize=100KB
log4j.appender.nycbbuilder_log.MaxBackupIndex=2
log4j.appender.nycbbuilder_log.layout=org.apache.log4j.PatternLayout
log4j.appender.nycbbuilder_log.layout.ConversionPattern=%d{ABSOLUTE} - %p %c
- %m%n

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 16, 2005 1:52 PM
To: Tomcat Users List
Subject: Re: log4j best practices
I just implemented this over the weekend.
Still not totally sure what I am doing, but I do have all my classes
outputting to a log file I have specified.  I went with a simple approach
creating a reference to a Logger object in each class (I have an external
properties file supplying all the config options). My problem is
everything ends up in one giant file and it is hard to interpret.
I am now thinking about having each class create and configure a logger
object and write to its own file. One log per class.
The good thing is it is log4j is easy to set up and start logging with.
Here is the tutorial I got started with:
http://www.developer.com/open/article.php/10930_3097221_1
HTH
Luke
   

Hi everyone
Im looking for some tips on implementing a logging system in tomcat.  Ive
got log4j installed and am about to write code but im just looking for
some tips before i get started.  My idea is to write a central logger
class for my app that imports the log4j package and supplys static methods
to my app but I don't know if thats a bad idea?
thanks
-B
 

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

Re: Several configuration issues with Tomcat 5.5.7/Apache2 compiling JSPs - Fixed

2005-02-16 Thread David Smith
Great!  Glad to see it working.  I would still find the time to refactor 
your code and remove the dependencies on specific directories though.  
The new classloader is so much nicer than the old classpath system.

--David
Sam Halicke wrote:
It ended up being the CLASSPATH environment variable, which i suspected all
along.
Since our underlying code (some of it poorly written AFAIK, based on Tomcat
3 and the older JSP spec) relies on classes/jars being at a certain path in
the directory tree, copying the classes over to the WEB-INF directories is
not enough. You won't get ClassDefNotFound errors, but you will get NPEs.
The exact reason for this, I don't know, (I have only a passing
understanding of Java and the JSP spec) but I did find a workaround. It lies
in the /bin/catalina.sh script, in which the CLASSPATH environment variable
is overridden. I simply added the paths to my necessary .jar files in a
separate script run at login, exporting them to another env variable
(CLASSPATH2). I then edited $tomcat_home/bin/catalina.sh to look like this:
...snip...
# Add on extra jar files to CLASSPATH
if [ -n $JSSE_HOME ]; then
CLASSPATH=$CLASSPATH:$JSSE_HOME/lib/jcert.jar:$JSSE_HOME/lib/jnet.jar:
$JSSE_HOME/lib/jsse.jar
fi
CLASSPATH=$CLASSPATH:$CATALINA_HOME/bin/bootstrap.jar:$CATALINA_HOME/b
in/commons-logging-api.jar:$CLASSPATH2
...snip...
And voila, everything works fine. It's a good tip if you're migrating from
the Stone Age of Tomcat 3, as you don't have to re-code anything. If anyone
knows of an easier, more modular way to do this, please drop me a line.
Thanks for all your advice.
Cheers
orig message follows
Forget classpath -- it's ignored in Tomcat 5.5 and as I remember, was
being phased out in Tomcat 3 (wow -- have I been reading these mail
lists for that long??).
If you put your classes and jars in the right places, they will be
found.  In your case, the classes are being found, but some underlying
code in biz.shipflex.Configuration is throwing an NPE.
--David
Sam Halicke wrote:
 

Hi all, first time posting to the list.
I'm having several problems migrating JSPs and class/jar files to Tomcat
5.5.7 from Tomcat 3. I understand this is a big move, but I'm trying to
avoid any rewrite of the JSPs themselves. Documentation for tomcat 5.5.x is
rather sparse and terribly cryptic.
Each webapp is using its own local classes (which I have copied into the
local WEB-INF directory in /classes /lib etc.), as well as some common
classes/jars which have been copied into the /tomcat/common/ directory
   

tree.
 

Should I be using the /tomcat/shared/ tree? This does not seem to matter as
jasper will consistently throw me errors from compiling the JSPs.
Here is the root cause of one such error:
HTTP 500 - Internal Server Error
ROOT CAUSE
java.lang.NullPointerException
biz.shipflex.Configuration.getConfiguration(Configuration.java:51)
org.apache.jsp.ShipFlex.Website.MainPage_jsp._jspService(org.apache.jsp.Shi
   

p
 

Flex.Website.MainPage_jsp:52)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:
   

3
 

25)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
My basic setup is as follows:
Apache 2.x  /usr/local/apache
Tomcat 5.5.7/usr/local/tomcat
[EMAIL PROTECTED] tomcat]# echo $CLASSPATH
/usr/local/tomcat/webapps/Common/Classes/:/usr/local/tomcat/webapps/Shippin
   

g
 

/Classes/:/usr/local/tomcat/webapps/scripts/Classes/:/usr/java/jdk1.5.0_01/
   

l
 

ib/
I have a feeling its something with my CLASSPATH, again, this is a touchy
migration.
I'll gladly copy any portions of web.xml and/or server.xml, etc to an
additional message if needed. Any help or suggestions on things/files to
look at would be most appreciated.
TIA

Sam Halicke
Systems Administrator
IMSure Network, Inc.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

   

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

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


Re: [OT]connecting to MySql database

2005-02-16 Thread David Smith
Technically speaking, this is off-topic and marked as such.
Take a look at this for more info:
http://struts.apache.org/faqs/database.html
On the surface, I see a missing type attribute on the data-source 
element and you should probably be using com.mysql.jdbc.Driver for the 
driver class property if you have a recent version of the mysql jar file.

--David
Yaroslav Alpizar Zhuravliov wrote:
Hi again...I´m new here...
I´ve these piece of code and can´t find the error in
the struts-config.xml:
- !--   Data
Source Configuration 
 -- 
- data-sources
- data-source
 set-property property=description value=SCIWARE
Data Source Configuration to mySQL / 
 set-property property=driverClass
value=org.gjt.mm.mysql.Driver / 
 set-property property=maxWait value=1 / 
 set-property property=maxIdle value=30 / 
 set-property property=maxActive value=100 / 
 set-property property=url
value=jdbc:mysql://localhost:3096/sciware?autoReconnect=true
/ 
 set-property property=user value=sciware / 
 set-property property=password value=aest / 
 /data-source
 /data-sources

I checked the form-beans and the action-mapping and
seems to be all right...
Any idea will appreciated...thanks
=
Yaroslav J. Alpízar Zhuravlev
System Administrator
Departament de Quimica
UIB Universitat de les Illes Balears
...go out there and see how deep the rabbit hole is...
 Morpheus
		
__ 
Do you Yahoo!? 
Yahoo! Mail - now with 250MB free storage. Learn more.
http://info.mail.yahoo.com/mail_250

-
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: stdout - console instead of catalina.out

2005-02-16 Thread David Smith
The startup shell script is responsible for redirecting output to 
catalina.out.  remove ' catalina.out' and you should be good to go.  
You could also pipe your output to the 'tee' utility.  See the man pages 
for details.

--David
Eric Wulff wrote:
I just started logging via log4j and although my question stems from
that, I believe it is more of a Tomcat question.  How can I re-direct
log messages to print to a Linux command window
instead of printing to the file catalina.out, i.e. how do I tell
Tomcat that standard out is the console from which I started Tomcat
in?  I believe the standard output stream is directed to catalina.out
by default.  I have yet to find the answer in the Tomcat docs.
running tomcat 5.0.28 on Linux Fedora Core 2
thx
Eric
-
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: Several configuration issues with Tomcat 5.5.7/Apache2 compiling JSPs

2005-02-15 Thread David Smith
Forget classpath -- it's ignored in Tomcat 5.5 and as I remember, was 
being phased out in Tomcat 3 (wow -- have I been reading these mail 
lists for that long??). 

If you put your classes and jars in the right places, they will be 
found.  In your case, the classes are being found, but some underlying 
code in biz.shipflex.Configuration is throwing an NPE. 

--David
Sam Halicke wrote:
Hi all, first time posting to the list.
I'm having several problems migrating JSPs and class/jar files to Tomcat
5.5.7 from Tomcat 3. I understand this is a big move, but I'm trying to
avoid any rewrite of the JSPs themselves. Documentation for tomcat 5.5.x is
rather sparse and terribly cryptic.
Each webapp is using its own local classes (which I have copied into the
local WEB-INF directory in /classes /lib etc.), as well as some common
classes/jars which have been copied into the /tomcat/common/ directory tree.
Should I be using the /tomcat/shared/ tree? This does not seem to matter as
jasper will consistently throw me errors from compiling the JSPs.
Here is the root cause of one such error:
HTTP 500 - Internal Server Error
ROOT CAUSE
java.lang.NullPointerException
biz.shipflex.Configuration.getConfiguration(Configuration.java:51)
org.apache.jsp.ShipFlex.Website.MainPage_jsp._jspService(org.apache.jsp.Ship
Flex.Website.MainPage_jsp:52)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
25)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
My basic setup is as follows:
Apache 2.x  /usr/local/apache
Tomcat 5.5.7/usr/local/tomcat
[EMAIL PROTECTED] tomcat]# echo $CLASSPATH
/usr/local/tomcat/webapps/Common/Classes/:/usr/local/tomcat/webapps/Shipping
/Classes/:/usr/local/tomcat/webapps/scripts/Classes/:/usr/java/jdk1.5.0_01/l
ib/
I have a feeling its something with my CLASSPATH, again, this is a touchy
migration.
I'll gladly copy any portions of web.xml and/or server.xml, etc to an
additional message if needed. Any help or suggestions on things/files to
look at would be most appreciated.
TIA

Sam Halicke
Systems Administrator
IMSure Network, Inc.
-
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: The requested resource (/myApp/servlet/TestingServlet) is not available.

2005-02-14 Thread David Smith
Admittedly, as another poster noted, a tour through the docs 
(specifically the Servlet spec) would help you tremendously in figuring 
this out yourself.  To answer your question -- your url should be 
http://localhost:8080/myApp/TestingServlet.  For your own sanity, read 
the spec though.  It provides some really good info.

Here's a url to the spec version you have defined in your web.xml:
http://www.jcp.org/aboutJava/communityprocess/final/jsr053/
--David
Marco Mastrocinque wrote:
Hi All,
I'm new to Tomcat and Servlets, I'm having a problem with one of my
first Servlets:
This is my program:
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
public class TestingServlet extends HttpServlet {
 public void doGet(HttpServletRequest request, 
   HttpServletResponse response) 
   throws ServletException, IOException {
   
   PrintWriter out = response.getWriter();
   out.println(HTML);
   out.println(HEAD);
   out.println(TITLEServlet Testing/TITLE);
   out.println(/HEAD);
   out.println(BODY);
   out.println(Welcome to the Servlet Testing Center);
   out.println(/BODY);
   out.println(/HTML);
 }
}

This is my web.xml file:
?xml version=1.0 encoding=ISO-8859-1?
!DOCTYPE web-app
   PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN
   http://java.sun.com/dtd/web-app_2_3.dtd;
wep-app
servlet
servlet-nameTesting/servlet-name
servlet-classTestingServlet/servlet-class
/servlet
/wep-app
I'm using Tomcat version 5.0.28. 

I create the Directory structure under Tomcat, underneath the webapps
subdirectory:
myApp
|
 WEB-INF
|
 classes
I compile the file TestingServlet.java using
javac -classpath C:\tomcat\common\lib\servlet-api.jar TestingServlet.jar
Place the file TestingServelt.jar in the classes subdirectory.
Place the file web.xml file in the WEB-INF subdirectory.
I start Tomcat. The manager application says it there, and it seems to be
okay.
I type in the address bar of IE the following
http://locahost:8080/myApp/servlet/TestingServlet
I get the following message, from Tomcat
The requested resource (/myApp/servlet/TestingServlet) is not available.
I know it should be pretty simple, but sometimes the simplest things are the
hardest to correct!
Any suggestions most appreciated.
Thanks Marco Mastrocinque



-
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: Enabling CGI

2005-02-11 Thread David Smith
Hi Steve.
Having just done this myself to help someone else, yes.  There's a 
comment block in the global web.xml file (find it at 
$CATALINA_HOME/conf/web.xml) that really helps in explaining things.

--David
Kelly, Steve wrote:
Hi Richard,
So that's my cgi programs. So if my cgi programs are in
tomcat.base.dir/webapps/mywebapp/misc/stuff/cgi then I set the parameter
to /misc/stuff/cgi ?
Steve 

-Original Message-
From: Richard Russell [mailto:[EMAIL PROTECTED] 
Sent: 11 February 2005 11:10
To: Tomcat Users List
Subject: Re: Enabling CGI

The CGI programs themselves.
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/cgi-howto.html says:
cgiPathPrefix - The CGI search path will start at the web application
root directory + File.separator + this prefix. The default cgiPathPrefix
is /WEB-INF/cgi
Does that help?
Richard Russell
Deutsche Bank AG London
Global Markets Customer Solutions
Office: +44 20 7545 8060
Mobile: +44 79 0661 2237

Kelly, Steve [EMAIL PROTECTED]
02/11/2005 11:05 AM
Please respond to Tomcat Users List
   To: tomcat-user@jakarta.apache.org
   cc: 
   Subject:Enabling CGI

I'm trying to enable CGI within one of my tomcat webapps. I've followed
the doc but I don't understand what I need to set the parameter
cgiPathPrefix to. What is it looking for in this search path ? 

Thx,
Steve.

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


  1   2   3   4   >