Re: Tell me the steps to configure Tomcat

2004-11-08 Thread inr
Hai,
This is inr. i am using binary version of Tomcat 5.5. and The Operating
system is Windows Xp.

Thanks in Advance
inr


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



How to create a service in TOmcat

2004-11-08 Thread inr
Hai ,
   how to create a service in tomcat and then how to map the
Application Base to that service.

Thanks and regards
inr


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



Re: Doubts with tomcat

2004-11-08 Thread Andrew Miehs
Tomcat starts 5 connector threads, plus the other internal threads that 
it uses for its own house keeping.

Andrew
On 08.11.2004, at 08:29, Michael Echerer wrote:


1) When I start tomcat with above server.xml , it creates 9 process 
with same output on shell. it is I configured tomcat to run with 
minSpareThreads=5 then why it start with 9 threads?
You configured 5 connector threads that not necessarily match OS 
threads (or whatever you saw). Check with Tomcat's manager application 
how many connector threads you really have.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: INFO: connection Timeout reached

2004-11-08 Thread Varley, Roger
 
 I've just upgraded to 4.1.31 and I'm getting 
 org.apache.jk.common.ChannelSocket processConnection INFO: 
 connection Timeout received messages at the console every 
 second or so. Everything seems to be working OK so do I need 
 to do anything about these messages? If this is normal 
 behaviour, is there anyway I can stop Tomcat from logging 
 these messages as it makes it impossible to see any other 
 messages since they scroll off the console too quickly?
 

I realise that this is probably an FAQ but I would be grateful if someone could 
point me in the right direction on this as I don't seem to be getting anywhere. 
Googling has revealed a suggestion that I should be setting the verbosity 
parameter on the Logger in my server.xml to suppress INFO messages, but the 
documentation at 
http://jakarta.apache.org/tomcat/tomcat-4.0-doc/config/logger.html suggests 
that the default out-of-the-box setting should be to display error messages 
only.

Regards
Roger


__
This e-mail and the documents attached are confidential and intended 
solely for the addressee; it may also be privileged. If you receive this 
e-mail in error, please notify the sender immediately and destroy it.
As its integrity cannot be secured on the Internet, the Atos Origin group 
liability cannot be triggered for the message content. Although the 
sender endeavours to maintain a computer virus-free network, the sender 
does not warrant that this transmission is virus-free and will not be 
liable for any damages resulting from any virus transmitted.
__

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



Tomcat 5 in debug Mode

2004-11-08 Thread Akacem Mohammed
Hello 


I tried to remote debug from eclipse 3.0. but I got this error Message from 
eclipse: 

Fail to connect to the VM ( I checked the port which is 8080 an d the host 
whici is 127.0.0.1 ).

How do I start tomcat in debug mode ( I tried startup -debug without success ).

thanks for any help

Mohammed

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



Where to put bean classes

2004-11-08 Thread Majirus Fansi
Hi all,
Should anyone know how to configure tomcat for loading bean in a jsp pages? 
Precisely, where do i put my java classes in tomcat container ?
I thank all of you in advance.
Ragards,
 
Majirus


-
Créez gratuitement votre Yahoo! Mail avec 100 Mo de stockage !
Créez votre Yahoo! Mail

Le nouveau Yahoo! Messenger est arrivé ! Découvrez toutes les nouveautés pour 
dialoguer instantanément avec vos amis.Téléchargez GRATUITEMENT ici !

Re: Is their any tutorial for optimizing tomcat performance?

2004-11-08 Thread Peter Lin
first we need to know what kind of hardware you're using. there are
articles on tomcat's resource page.
http://jakarta.apache.org/tomcat/resources.html

tuning the performance should take into consideration what kind of
load you expect, so if you don't have those written down as
requirements, I would get that information first.

peter


On Mon, 8 Nov 2004 10:19:46 +0530, Amit Gupta
[EMAIL PROTECTED] wrote:
 Hi,
 
 Is their any tutorial for optimizing tomcat performance? I run it on 64 MB 
 RAM and 64 SWAP Space. is it Ok or not?
 
 Amit Gupta
 Email: [EMAIL PROTECTED]
 


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



RE: Accessing resource in WEB-INF outside servlet

2004-11-08 Thread Shapira, Yoav

Hi,
Then you have a screwed up design.  There's no portable way to get the 
ServletContext to fit your needs, and there's no way to make Class#getResource 
read /WEB-INF unless you write a custom ClassLoader.  Change your approach.

Yoav Shapira http://www.yoavshapira.com


-Original Message-
From: Morkeleb [mailto:[EMAIL PROTECTED]
Sent: Sunday, November 07, 2004 10:51 AM
To: [EMAIL PROTECTED]
Subject: Accessing resource in WEB-INF outside servlet

Hi.

I have a file in WEB-INF which I want to access.
However, this is done in a static class which is not a servlet,
so I do not have the servlet context.

Is there a way to access the servlet context non the less?
Is there a way to make getResource find the file anyway?

I know a resource is found when it's in /WEB-INF/classes,
but it is only in /WEB-INF/ and it is not an option to move
it to the classes directory.

Can you help me?
Thanx in Advance,
Lukas Österreicher



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




This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


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



RE: Configuration Management, JSP Recompiles, War Files

2004-11-08 Thread Shapira, Yoav

Hi,
One great way to approach production setups for Tomcat is one webapp per
Tomcat instance.  Restarts are then quick and easy, and no matter what
this one webapp does (OutOfMemoryErrors, malicious code, etc.) it can't
affect others you have running around because they're in a different
JVM.  The ease of setting up Tomcat standalone makes this not just
feasible, but probably recommended over a many webapps per Tomcat
instance setup.

Yoav Shapira http://www.yoavshapira.com


-Original Message-
From: Steven J.Owens [mailto:[EMAIL PROTECTED]
Sent: Saturday, November 06, 2004 3:27 AM
To: Tomcat Users List; [EMAIL PROTECTED]
Subject: Re: Configuration Management, JSP Recompiles, War Files

On Sat, Nov 06, 2004 at 03:20:46AM -0500, Steven J. Owens wrote:
 On Mon, Oct 25, 2004 at 09:15:41AM -0400, Shapira, Yoav wrote:
   If I understand correctly, WAR file is just a glorified JAR
file,
  which in turn is just a glorified tar file.  So unless you're
  unjarring it, editing the config file and rejarring it, you can't
  really muck with the config settings inside it.  How/where do
people
  normally keep the configuration variables for the webapp?
 
  You might want to read up the Servlet Spec's section on
resource-ref
and
  env-entry refs. These provide a way for you to keep one WAR and
edit
  server.xml (or another server-specific, outside-your-WAR
configuration
  file) to modify configuration information.  Your understanding
above is
  incomplete.

  So the standard practice is to put all of your configuration
 variables in server.xml and reboot the server if you need to change
 the configuration?

 Ah, your further comments in RE: discussion on webapp reload in
production indicates that restarting tomcat for changes is indeed
standard practice.  Okay.

 Is there a HOWTO or tutorial anywhere on running an ASP style
setup (er, that's application service provider, not the other ASP)
with multiple apps, using tomcat?  More of a standard practices sort
of thing, though how-to/tutorials for specific aspects would also be
cool.

--
Steven J. Owens
[EMAIL PROTECTED]

I'm going to make broad, sweeping generalizations and strong,
 declarative statements, because otherwise I'll be here all night and
 this document will be four times longer and much less fun to read.
 Take it all with a grain of salt. - http://darksleep.com/notablog


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




This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


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



RE: Configuration Management, JSP Recompiles, War Files

2004-11-08 Thread Peter Crowther
 From: Shapira, Yoav [mailto:[EMAIL PROTECTED] 
 One great way to approach production setups for Tomcat is one 
 webapp per Tomcat instance.

 Restarts are then quick and easy, and no matter what
 this one webapp does (OutOfMemoryErrors, malicious code, 
 etc.) it can't
 affect others you have running around because they're in a different
 JVM.  The ease of setting up Tomcat standalone makes this not just
 feasible, but probably recommended over a many webapps per Tomcat
 instance setup.

This approach works well if:

- the webapps have a memory footprint that is large enough to make the
JVM overhead irrelevant;

- the webapps do not have to be run on the same port.

If you are running hundreds of tiny webapps it might be a bit of
overkill, and if many of those webapps need to be on (for example) port
80 or 8080 then it simply doesn't work.  This said, I agree with Yoav -
it makes management a whole lot easier and reduces interactions between
webapps.  I use it wherever I'm principally running services that don't
need to be exposed via our firewall.

- Peter

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



RE: Logging problem under Tomcat 5.0

2004-11-08 Thread Shapira, Yoav

Hi,

do need it.  In any event, I don't like the log level changing without
knowing why  without explicitly allowing it (tho' by deploying some
jar
or war, I've effectively ok'd it).

Yeah, maybe it's what you put in parentheses above, or maybe it's
something else, but things don't just change by themselves ;)

Any suggestions on an easy way to track down the culprit or prevent
some
random process of jacking up the default log level?

Define default in the above sentence?

BTW -  tomcat/conf/log4j.properties is still reasonable  I've found
nothing unusual in tomcat/conv/server.xml .

Does tomcat/conf/log4j.properties assign a level to org.apache loggers?
If not, it should.  If it worked before without doing this, you were
lucky.  Add something like logger.org.apache = WARN and you'll be all
set.

Yoav



This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


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



RE: change the home directory for ouside access...

2004-11-08 Thread Shapira, Yoav

Hi,

Where do I tell what is the home directory. And if it is possible, how
do I
do it if I want to do it for an axternal access?

The home directory for what?  Tomcat?  The JVM?  The user running
Tomcat?  These are all different.  And for the point of web application
design, they're all equally bad.  Don't rely on them for your
application.  Use a more explicit configuration communication mechanism.

Yoav



This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


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



RE: session tracking

2004-11-08 Thread Shapira, Yoav

Hi,
Didn't anyone tell you to RTFM?  That's a bit surprising... Anyways,
RTFM at
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/context.html on
the cookies context attribute.  Try setting it to false.

Yoav Shapira http://www.yoavshapira.com


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Saturday, November 06, 2004 2:54 PM
To: Tomcat Users List
Subject: session tracking

Hi

I already posted a question about how to disable cookie session
tracking in
Tomcat 5.0, but received no response. I use an open filesystem, no
.war's.
My
scenario is this. My application is loaded into a cross-domain
frameset, so
a
user's session was not persitent across page requests. So I am
rewriting
the
urls and things are fine for the user, but my session listener tells me
a
new
session is still created for every page request. I think disabling
cookie
may
stop this.

Thanks for any help.

Steve

--


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




This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


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



RE: User Authentication Problem LDAP

2004-11-08 Thread Shapira, Yoav

Hi,
Thank you for posting your findings.  These are very helpful to people
searching the archives.

Yoav Shapira http://www.yoavshapira.com


-Original Message-
From: Sandeep N [mailto:[EMAIL PROTECTED]
Sent: Sunday, November 07, 2004 11:45 PM
To: Tomcat Users List
Subject: Re: User Authentication Problem LDAP

Hi All,

I got my problem solved..The culprit was that I hadn't included the
attribute digest with value SHA (SHA because my LDAP directory is
storing the password in this format) in the realm directive in
server.xml. Also, I had to change role-namecn/role-name to
role-name*/role-name in web.xml. Now, the things seems to work
without any hassles.

Regards,
Sandeep


On Tue, 02 Nov 2004 12:19:13 +0100, Olivier Jolly
[EMAIL PROTECTED] wrote:
 I'm not a specialist in this but it smells like you're saying that
the
 role name are listedin the attribute 'cn' and that to access your
site
 the connected user should have the role 'cn' hence if you do not have
a
 user with it's cn=cn (attribute cn = value cn), it won't work.
Maybe
 you could either enter real roles to your users in another attribute
 than cn and adapt your web.xml accordingly or suppress the
 auth-constraint on the role-name

 Hope it helps

 Olivier



 Sandeep N wrote:

 Hi,
 
 I have a problem trying to authenticate users, whose details are
 stored in the LDAP directory through Apache Tomcat. The details of
the
 software I am using are as follows :
 
 LDAP: OpenLDAP V 2.2.17
 Web-Server: Apache-Tomcat V 4.1.30
 OS: Suse - Linux
 
 The LDAP directory structure is somewhat like this -
 dc=my-domain,dc=com
 cn= Manager
cn=person1
cn=person2 and so on
 
 In the server.xml file (under APACHE-TOMCAT-DIR/conf/) I have
included
 he following piece of code  -
 
 Realm className=org.apache.catalina.realm.JNDIRealm debug=99
 connectionName=cn=Manager,dc=my-domain,dc=com
 connectionPassword=secret connectionURL=ldap://localhost:389;
 roleName=cn roleSearch=(uniqueMember={0})
 userPassword=userPassword
 userPattern=cn={0},cn=Manager,dn=my-domain,dn=com /
 
 The folder I have to authenticate is param_test and this resides
 under APACHE-TOMCAT-DIR/webapps.
 
 The web.xml file under the param_test folder contains the
following
 piece of code  -
 ..
 security-constraint
 web-resource-collection
 web-resource-nametest/web-resource-name
 url-pattern/*/url-pattern
 /web-resource-collection
 auth-constraint
 role-namecn/role-name
 /auth-constraint
 /security-constraint
 
 login-config
 auth-methodBASIC/auth-method
 realm-nametest/realm-name
 /login-config
 
 ..
 
 I have even copied the jndi.jar, ldap.jar files to
 APACHE-TOMCAT-DIR/server/lib directory
 
 When I try to access the link, http://localhost:8089/param_test, it
 prompts me for the username and password. When I type in these
 parameters as per the entries in the LDAP directory, the pop-up
 reappears and this goes on continously. If I cancel this pop-up,
HTTP
 error 401 is returned. Any guesses where I have gone wrong?
 
 Thanks in advance.
 
 Regards,
 Sandeep
 

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




This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


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



RE: Tomcat server.xml configuration

2004-11-08 Thread Shapira, Yoav

Hi,

How is server.xml configured on a virtual private server (VPS) web
host.

Where should appBase point for the virtual hosts?

That depends on what exactly you mean.  There are a couple of ways to go
about this.  One is what you posted: an Engine element in server.xml
with numerous Hosts.  For this case each appBase should be the directory
where the user for the host is putting their webapps.

Another way is to use the user webapp feature, which lets you do things
like http://a.b.com/~user1 and http://a.b.com/~user2 served out of user1
and user2's public_html directories respectively.  There are other
configuration options as well: see the Host config reference section
titled User Web Applications at
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/host.html.  For
this case, the appBase doesn't matter much: leave it as Tomcat's default
most likely.

Yoav



This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


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



RE: Where to put bean classes

2004-11-08 Thread Shapira, Yoav

Hi,
You should read a book or tutorial on web application development when you get 
a chance ;)  Tomcat has one called First Webapp or something like that in its 
docs.

Put your beans in a package (e.g. com.mycompany) when developing them.  When 
deploying your webapp, either put the compiled bean class files under 
WEB-INF/classes(/com/mycompany...) or put them in a jar in your WEB-INF/lib 
directory.

Yoav Shapira http://www.yoavshapira.com


-Original Message-
From: Majirus Fansi [mailto:[EMAIL PROTECTED]
Sent: Monday, November 08, 2004 6:53 AM
To: [EMAIL PROTECTED]
Subject: Where to put bean classes

Hi all,
Should anyone know how to configure tomcat for loading bean in a jsp pages?
Precisely, where do i put my java classes in tomcat container ?
I thank all of you in advance.
Ragards,

Majirus


-
Créez gratuitement votre Yahoo! Mail avec 100 Mo de stockage !
Créez votre Yahoo! Mail

Le nouveau Yahoo! Messenger est arrivé ! Découvrez toutes les nouveautés
pour dialoguer instantanément avec vos amis.Téléchargez GRATUITEMENT ici !



This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


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



RE: Accessing resource in WEB-INF outside servlet

2004-11-08 Thread David Evans
Is using JNDI to access a file like this a reasonable approach? I just
started using JNDI to name my database connections via a connection
pool. And when i saw the simplicity of accessing the JNDI context within
my java classes, i got to thinking that i should use it to access many
of my applications configuration variables, such as the location of
various directories for templates and uploads. it seems much cleaner
than passing the request around just to get at the application scope.

Could the original poster stick either the file location in the JNDI
context, so he could easily reference it later, or if the file wasn't
too large, use a custom resource factory to wrap its contents in a bean
and then use the JNDI context to access the file contents.

I haven't tried any of this myself, but was planning to in the next week
or two, when i got some time. Can anyone point out pros and cons of this
approach?

the link to the tomcat/JNDI documentation:
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-resources-howto.html

dave


On Mon, 2004-11-08 at 
08:03, Shapira, Yoav wrote:
 Hi,
 Then you have a screwed up design.  There's no portable way to get the 
 ServletContext to fit your needs, and there's no way to make 
 Class#getResource read /WEB-INF unless you write a custom ClassLoader.  
 Change your approach.
 
 Yoav Shapira http://www.yoavshapira.com
  
 
 -Original Message-
 From: Morkeleb [mailto:[EMAIL PROTECTED]
 Sent: Sunday, November 07, 2004 10:51 AM
 To: [EMAIL PROTECTED]
 Subject: Accessing resource in WEB-INF outside servlet
 
 Hi.
 
 I have a file in WEB-INF which I want to access.
 However, this is done in a static class which is not a servlet,
 so I do not have the servlet context.
 
 Is there a way to access the servlet context non the less?
 Is there a way to make getResource find the file anyway?
 
 I know a resource is found when it's in /WEB-INF/classes,
 but it is only in /WEB-INF/ and it is not an option to move
 it to the classes directory.
 
 Can you help me?
 Thanx in Advance,
 Lukas Österreicher
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 This e-mail, including any attachments, is a confidential business 
 communication, and may contain information that is confidential, proprietary 
 and/or privileged.  This e-mail is intended only for the individual(s) to 
 whom it is addressed, and may not be saved, copied, printed, disclosed or 
 used by anyone else.  If you are not the(an) intended recipient, please 
 immediately delete this e-mail from your computer system and notify the 
 sender.  Thank you.
 
 
 -
 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: Accessing resource in WEB-INF outside servlet

2004-11-08 Thread Shapira, Yoav

Hi,

Is using JNDI to access a file like this a reasonable approach? I just

It's an OK approach.  Not great, but not terrible either.  The reasons
it's not great are:
- It's heavyweight (JNDI resource binding and resolution is typically
several times more resource consuming than a static resource lookup via
either the classpath or the ServletContext).  But if done once to
initialize a variable, this is fairly negligible.
- It's container-dependent: you need something to do the JNDI binding
and lookups.  Running a small console app with this code becomes very
difficult. And unit testing it as-is becomes exceedingly difficult.
- It's awkward to change: you need to modify a container-specific
configuration file to change the entry.  This is both a pro and con,
though, as it means the server admin running your app can modify this
without needing programmer intervention.

So it'll work, but the above merit consideration.

Yoav



This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


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



Re: Connection Timeout

2004-11-08 Thread Andrew Miehs
Does anyone know any way that I can tell tomcat to kill the 'thread' if 
it isn't back in a ready state within 30 seconds? (waiting for new 
requests)

Thanks
Andrew
On 05.11.2004, at 16:20, Phillip Qin wrote:

Byte recv and byte sent?
-Original Message-
From: Andrew Miehs [mailto:[EMAIL PROTECTED]
Sent: November 5, 2004 10:18 AM
To: Tomcat Users List
Subject: Re: Connection Timeout
Hi Phillip,
The request is for example a 10K image.
Regards
Andrew
On 05.11.2004, at 16:11, Phillip Qin wrote:

My guess is the request was serviced by Tomcat, and took that much
time.
What did your request column tell? A huge request, file upload?
-Original Message-
From: Andrew Miehs [mailto:[EMAIL PROTECTED]
Sent: November 5, 2004 4:24 AM
To: Tomcat Users List
Subject: Connection Timeout
Dear List,
In /manager/status, I occasionally see connections where the status is
'S' and the time column is huge!  1 ms.
Does this mean that the request is still being processed by tomcat? or
is this a request waiting to be picked up - ie: chunked?
If so, is there any way I can set a timeout for this, as a time  10
seconds makes very little sense with our application?
Thanks in advance,
Andrew
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Where to put bean classes

2004-11-08 Thread Ben Souther
If you're interested, I've posted a couple of really simple example
webapps.  

SimpleMVC, has beans that are accessed from JSPs.  
http://www.souther.us/simple.

The examples are not tutorials. They are just a quick way to get a
working example on your machine. Yoav Shapira's advice about finding a
good tutorial should be your first step.



On Mon, 2004-11-08 at 08:26, Shapira, Yoav wrote:
 Hi,
 You should read a book or tutorial on web application development when you 
 get a chance ;)  Tomcat has one called First Webapp or something like that 
 in its docs.
 
 Put your beans in a package (e.g. com.mycompany) when developing them.  When 
 deploying your webapp, either put the compiled bean class files under 
 WEB-INF/classes(/com/mycompany...) or put them in a jar in your WEB-INF/lib 
 directory.  
 
 Yoav Shapira http://www.yoavshapira.com
  
 
 -Original Message-
 From: Majirus Fansi [mailto:[EMAIL PROTECTED]
 Sent: Monday, November 08, 2004 6:53 AM
 To: [EMAIL PROTECTED]
 Subject: Where to put bean classes
 
 Hi all,
 Should anyone know how to configure tomcat for loading bean in a jsp pages?
 Precisely, where do i put my java classes in tomcat container ?
 I thank all of you in advance.
 Ragards,
 
 Majirus
 
 
 -
 Crez gratuitement votre Yahoo! Mail avec 100 Mo de stockage !
 Crez votre Yahoo! Mail
 
 Le nouveau Yahoo! Messenger est arriv ! Dcouvrez toutes les nouveauts
 pour dialoguer instantanment avec vos amis.Tlchargez GRATUITEMENT ici !
 
 
 
 This e-mail, including any attachments, is a confidential business 
 communication, and may contain information that is confidential, proprietary 
 and/or privileged.  This e-mail is intended only for the individual(s) to 
 whom it is addressed, and may not be saved, copied, printed, disclosed or 
 used by anyone else.  If you are not the(an) intended recipient, please 
 immediately delete this e-mail from your computer system and notify the 
 sender.  Thank you.
 
 
 -
 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: Accessing resource in WEB-INF outside servlet

2004-11-08 Thread David Evans
Thanks for the reply. So the next question of course is, what is a
better approach? I understand idea of using putting an object in the
ServletContext during application initialization, but that leads to
other problems. 

Well, to be specific, heres the problem i have with that in my
application:

i have static DAO classes, one per database table, that my application
uses to handle persistance of my applications business objects. So i
need the connection information for the database. i have other
application instance specific variables also, directory paths for
templates and upload. So originally i wrote a AppConfig class that had
properties for all these variables, and a factory class that read an xml
file, and created a instance of the AppConfig class and stuck it in the
ServletContext during initialization. But the DAO classes are static
classes, and should be usable by any java program, not just a Servlet.
They currently have a very clean API, for instance:

public static Book getBook(String bookId)
public static void updateBook(Book book)

So in order to preserve that cleanliness, the methods have to get the
connection path themselves, which was why i was so excited by the JNDI
lookup.

So any advice?

dave

On Mon, 2004-11-08 at 08:59, Shapira, Yoav wrote:
 Hi,
 
 Is using JNDI to access a file like this a reasonable approach? I just
 
 It's an OK approach.  Not great, but not terrible either.  The reasons
 it's not great are:
 - It's heavyweight (JNDI resource binding and resolution is typically
 several times more resource consuming than a static resource lookup via
 either the classpath or the ServletContext).  But if done once to
 initialize a variable, this is fairly negligible.
 - It's container-dependent: you need something to do the JNDI binding
 and lookups.  Running a small console app with this code becomes very
 difficult. And unit testing it as-is becomes exceedingly difficult.
 - It's awkward to change: you need to modify a container-specific
 configuration file to change the entry.  This is both a pro and con,
 though, as it means the server admin running your app can modify this
 without needing programmer intervention.  
 
 So it'll work, but the above merit consideration.
 
 Yoav
 
 
 
 This e-mail, including any attachments, is a confidential business 
 communication, and may contain information that is confidential, proprietary 
 and/or privileged.  This e-mail is intended only for the individual(s) to 
 whom it is addressed, and may not be saved, copied, printed, disclosed or 
 used by anyone else.  If you are not the(an) intended recipient, please 
 immediately delete this e-mail from your computer system and notify the 
 sender.  Thank you.
 
 
 -
 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: Accessing resource in WEB-INF outside servlet

2004-11-08 Thread Shapira, Yoav

Hi,

public static Book getBook(String bookId)
public static void updateBook(Book book)

So in order to preserve that cleanliness, the methods have to get the
connection path themselves, which was why i was so excited by the JNDI
lookup.

Having each Bean get its own connection path itself is not clean, but
it's your design, so it's up to you.  You can use the other approach
mentioned (but shunned) by the original poster, which is to put said
configuration information on the classpath.  Then each of your classes
can get getClass().getResource(/myConfigFile.prop) to get the
configuration.  That's much more testable and portable, doesn't depend
on a container, doesn't depend on the Servlet API.

Yoav



This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


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



RE: Accessing resource in WEB-INF outside servlet

2004-11-08 Thread David Evans
Ok, thanks i will look into the getResource configuration method, it
sounds like that would subsitute for the JNDI lookup cleanly. So one
last thing, if you've got the time. You said:
Having each Bean get its own connection path itself is not clean, but
it's your design, so it's up to you. 
so how do you handle this? do you pass in the connection info to every
DAO method, like this:
public static Book getBook(String connection, String bookId)
public static void updateBook(String connection, Book book)

that seems tedious, and since the all of my database
interaction is encapsulated in the DAOs, it seems unclean to 
reference the connection anywhere else. 

again, thanks for your help thus far.

dave

On Mon, 2004-11-08 at 09:21, Shapira, Yoav wrote:
 Hi,
 
 public static Book getBook(String bookId)
 public static void updateBook(Book book)
 
 So in order to preserve that cleanliness, the methods have to get the
 connection path themselves, which was why i was so excited by the JNDI
 lookup.
 
 Having each Bean get its own connection path itself is not clean, but
 it's your design, so it's up to you.  You can use the other approach
 mentioned (but shunned) by the original poster, which is to put said
 configuration information on the classpath.  Then each of your classes
 can get getClass().getResource(/myConfigFile.prop) to get the
 configuration.  That's much more testable and portable, doesn't depend
 on a container, doesn't depend on the Servlet API.
 
 Yoav
 
 
 
 This e-mail, including any attachments, is a confidential business 
 communication, and may contain information that is confidential, proprietary 
 and/or privileged.  This e-mail is intended only for the individual(s) to 
 whom it is addressed, and may not be saved, copied, printed, disclosed or 
 used by anyone else.  If you are not the(an) intended recipient, please 
 immediately delete this e-mail from your computer system and notify the 
 sender.  Thank you.
 
 
 -
 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: Accessing resource in WEB-INF outside servlet

2004-11-08 Thread Shapira, Yoav

Hi,

so how do you handle this? do you pass in the connection info to every
DAO method, like this:
public static Book getBook(String connection, String bookId)
public static void updateBook(String connection, Book book)

that seems tedious, and since the all of my database

You can have the beans get a datasource (from a singleton possibly) and
call its getConnection method.  To encapsulate further, you can just
expose a getConnection method on said singleton.  That way only one
class needs to worry about database configuration.  And you have only
one place to change if you switch from a Class#getResource approach to a
JNDI one or vice versa.

Yoav



This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


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



Renaming WAR problem

2004-11-08 Thread Andrew Watters
I have a WAR which tomcat recognises and unpacks correctly. When I 
rename the WAR tomcat no longer unpacks it. Is this expected behaviour? 
I've had a look in the 2.4 servlet spec and haven't been able to find 
anything on this topic. Is there a work around that will allow me to do 
this?

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


Re: Renaming WAR problem

2004-11-08 Thread Ben Souther
What did you rename it to?



On Mon, 2004-11-08 at 09:46, Andrew Watters wrote:
 I have a WAR which tomcat recognises and unpacks correctly. When I 
 rename the WAR tomcat no longer unpacks it. Is this expected behaviour? 
 I've had a look in the 2.4 servlet spec and haven't been able to find 
 anything on this topic. Is there a work around that will allow me to do 
 this?
 
 Thank you
 Andrew
 
 -
 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: Renaming WAR problem

2004-11-08 Thread Shapira, Yoav

Hi,

I have a WAR which tomcat recognises and unpacks correctly. When I
rename the WAR tomcat no longer unpacks it. Is this expected behaviour?
I've had a look in the 2.4 servlet spec and haven't been able to find
anything on this topic. Is there a work around that will allow me to do
this?

Considering that unpacking of WARs and renaming of web application are
not areas covered by the Servlet Spec, I'm not surprised you didn't find
anything there ;)  It's a container-specific implementation issue.

Yoav



This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


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



Re: Renaming WAR problem

2004-11-08 Thread Andrew Watters
Well, that explains something :) So what is tomcat seeing in the WAR 
that it refuses to unpack it after renaming?

Shapira, Yoav wrote:
Hi,
 

I have a WAR which tomcat recognises and unpacks correctly. When I
rename the WAR tomcat no longer unpacks it. Is this expected behaviour?
I've had a look in the 2.4 servlet spec and haven't been able to find
anything on this topic. Is there a work around that will allow me to do
this?
   

Considering that unpacking of WARs and renaming of web application are
not areas covered by the Servlet Spec, I'm not surprised you didn't find
anything there ;)  It's a container-specific implementation issue.
Yoav

This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: Renaming WAR problem

2004-11-08 Thread Shapira, Yoav

Hi,

Well, that explains something :) So what is tomcat seeing in the WAR
that it refuses to unpack it after renaming?

A directory with that name already existing.  Tomcat won't overwrite
such a directory if it exists.

If your app is Spec-compliant, considering setting unpackWARs=false
for your Host.

Yoav



This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


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



Re: Renaming WAR problem

2004-11-08 Thread Andrew Watters
In this case the webapps directory is entirely empty, I delete the ROOT 
folder as part of the publish procedure and there are no other apps 
configured except for the manager and admin ones.

Shapira, Yoav wrote:
Hi,
 

Well, that explains something :) So what is tomcat seeing in the WAR
that it refuses to unpack it after renaming?
   

A directory with that name already existing.  Tomcat won't overwrite
such a directory if it exists.
If your app is Spec-compliant, considering setting unpackWARs=false
for your Host.
Yoav

This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: Accessing resource in WEB-INF outside servlet

2004-11-08 Thread David Evans
On Mon, 2004-11-08 at 09:35, Shapira, Yoav wrote:
 Hi,
 
 so how do you handle this? do you pass in the connection info to every
 DAO method, like this:
 public static Book getBook(String connection, String bookId)
 public static void updateBook(String connection, Book book)
 
 that seems tedious, and since the all of my database
 
 You can have the beans get a datasource (from a singleton possibly) and
 call its getConnection method.  To encapsulate further, you can just
 expose a getConnection method on said singleton.  That way only one
 class needs to worry about database configuration.  And you have only
 one place to change if you switch from a Class#getResource approach to a
 JNDI one or vice versa.
 
 Yoav
 

So the intialization of this sington datasource provider occurs the
first time the class is called? and from then on out there's only one
instance of the class, owing to its singleton nature? would that look
like this:

public class AppDBConnector {
private static final INSTANCE = new AppDBConector();
private static DataSource ds;

private AppDBConnector() {
// set static ds abov using JNDI lookup or resource bundle
}

public AppDBConnector getInstance() {
return INSTANCE;
}

public Connection getConnection() {
return ds.getConnection();
}
}

Then used in the DAO like this:

Connection conn = AppDBConnector.getInstance().getConnection();





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



RE: Accessing resource in WEB-INF outside servlet

2004-11-08 Thread Shapira, Yoav

Hi,
So the intialization of this sington datasource provider occurs the
first time the class is called? and from then on out there's only one
instance of the class, owing to its singleton nature? would that look
like this:

public class AppDBConnector {
   private static final INSTANCE = new AppDBConector();
   private static DataSource ds;

   private AppDBConnector() {
   // set static ds abov using JNDI lookup or resource
bundle
   }

   public AppDBConnector getInstance() {
   return INSTANCE;
   }

   public Connection getConnection() {
   return ds.getConnection();
   }
}

Close enough.  There's no need for ds to be static.  And some people
prefer to not construct INSTANCE until the first getInstance call.  But
those are smaller details.

Yoav



This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


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



RE: CGI ...yeah, I know (Tomcat 4.1.29)

2004-11-08 Thread Mark Claassen
Thanks for the reply.  We have the debug set to 6 already.  We found that it
almost seems to alternate with the following error.  The script is there,
accessible, and executable by the user tomcat is running as.  We are not
using a security manager.  One puzzling thing is that the following path has
two sets of quotes, but I was thinking that was just an error in the log
message.  We altered the program so that the first line of the program
touches a file so we can see if it ran at all.  It does not, and we get
either the No such file error or the Broken Pipe one.  Perhaps, though,
the quotations are the crux of it all.

In the localhost log we have:
2004-11-08 10:06:13 cgi: findCGI:
currentLoc=/opt/OCIEsys/tomcat/WEB/webapps/ROOT/WEB-INF/cgi
2004-11-08 10:06:13 cgi: findCGI:
currentLoc=/opt/OCIEsys/tomcat/WEB/webapps/ROOT/WEB-INF/cgi
2004-11-08 10:06:13 cgi: findCGI: FOUND cgi at
/opt/OCIEsys/tomcat/WEB/webapps/ROOT/WEB-INF/cgi/MRlogin.pl
2004-11-08 10:06:13 cgi: findCGI calc: name=MRlogin.pl,
path=/opt/OCIEsys/tomcat/WEB/webapps/ROOT/WEB-INF/cgi/MRlogin.pl,
scriptname=/MRcgi/MRlogin.pl, cginame=/MRlogin.pl
2004-11-08 10:06:13 cgi: runCGI(envp= ...
2004-11-08 10:06:13 cgi: runCGI (stderr):Can't open perl script
/opt/OCIEsys/tomcat/WEB/webapps/ROOT/WEB-INF/cgi/MRlogin.pl: No such
file or directory 2004-11-08 10:06:13 cgi: runCGI: 1 lines received on
stderr

 -Original Message-
 From: Phillip Qin [mailto:[EMAIL PROTECTED] 
 Sent: Friday, November 05, 2004 5:20 PM
 To: 'Tomcat Users List'
 Subject: RE: CGI ...yeah, I know (Tomcat 4.1.29)
 
 
 Enable cgiservlet log (I usually set debug to 6) and see 
 what's output in the log (very detail).
 
 -Original Message-
 From: Mark Claassen [mailto:[EMAIL PROTECTED] 
 Sent: November 5, 2004 5:07 PM
 To: 'Tomcat Users List'
 Subject: CGI ...yeah, I know (Tomcat 4.1.29)
 
 
 I know that Tomcat is not an ideal CGI server, but I am 
 having real trouble getting it to work at all.  Most often I 
 get the Exception below, and it doesn't seem to be running 
 our perl program at all.  (We can run the perl program by 
 hand though).  We had a bit of trouble getting it setup in 
 the first place, and we got errors way different from this.  
 I figured that since we were getting this, we must have 
 everything else setup correctly.
 
 Looking at the 4.1.27 source this is:
 1686: commandsStdIn.flush();
   commandsStdIn.close();
 commandsStdIn is the output stream to the process.
 
 Anyone have any ideas on where to start looking?
 
 Thanks,
 Mark
 
 java.io.IOException: Broken pipe
 at java.io.FileOutputStream.writeBytes(Native Method)
 at java.io.FileOutputStream.write(FileOutputStream.java:257)
 at
 java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:69)
 at 
 java.io.BufferedOutputStream.flush(BufferedOutputStream.java:127)
 at 
 java.io.BufferedOutputStream.flush(BufferedOutputStream.java:128)
 at
 org.apache.catalina.servlets.CGIServlet$CGIRunner.run(CGIServl
 et.java:1686)
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 !DSPAM:418bf9fd252211451334454!
 



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



RE: Accessing resource in WEB-INF outside servlet

2004-11-08 Thread David Evans
Thanks again for the help, this approach is very clean, and i'll be
using it.

dave


On Mon, 2004-11-08 at 10:15, Shapira, Yoav wrote:
 Hi,
 So the intialization of this sington datasource provider occurs the
 first time the class is called? and from then on out there's only one
 instance of the class, owing to its singleton nature? would that look
 like this:
 
 public class AppDBConnector {
  private static final INSTANCE = new AppDBConector();
  private static DataSource ds;
 
  private AppDBConnector() {
  // set static ds abov using JNDI lookup or resource
 bundle
  }
 
  public AppDBConnector getInstance() {
  return INSTANCE;
  }
 
  public Connection getConnection() {
  return ds.getConnection();
  }
 }
 
 Close enough.  There's no need for ds to be static.  And some people
 prefer to not construct INSTANCE until the first getInstance call.  But
 those are smaller details.
 
 Yoav
 
 
 
 This e-mail, including any attachments, is a confidential business 
 communication, and may contain information that is confidential, proprietary 
 and/or privileged.  This e-mail is intended only for the individual(s) to 
 whom it is addressed, and may not be saved, copied, printed, disclosed or 
 used by anyone else.  If you are not the(an) intended recipient, please 
 immediately delete this e-mail from your computer system and notify the 
 sender.  Thank you.
 
 
 -
 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: Renaming WAR problem

2004-11-08 Thread Andrew Watters
Apologies, I replied before but it never appeared, trying again...
I renamed it to ROOT.WAR. The webapp used to be named like this and 
previously worked fine. It's now called ROOT-1.0.WAR. The new name is a 
result of moving to maven and it appending the version number.

Ben Souther wrote:
What did you rename it to?

On Mon, 2004-11-08 at 09:46, Andrew Watters wrote:
 

I have a WAR which tomcat recognises and unpacks correctly. When I 
rename the WAR tomcat no longer unpacks it. Is this expected behaviour? 
I've had a look in the 2.4 servlet spec and haven't been able to find 
anything on this topic. Is there a work around that will allow me to do 
this?

Thank you
Andrew
-
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 as W2K3 service

2004-11-08 Thread Derrick Koes
 

Using the resource as a global resource solves the problem.


-Original Message-
From: Derrick Koes 
Sent: Friday, November 05, 2004 7:56 AM
To: '[EMAIL PROTECTED]'
Subject: Tomcat as W2K3 service


Configuration:
W2K3 Server
IIS 6.0
JK2
Tomcat 5.0.24
SQL Server 2000


Starting tomcat (and therefore my web application) as a service produces
an undesireable side effect not seen when starting from command line or
when using the tomcat manager to stop/start my web application.

I have a startup servlet that uses the datasource configured in my
context in its init method.  So, JNDI and therefore my context need to
be available on startup.
JNDI does not appear to be available, or at least my context isn't
available because I can't get my datasource.  Has anyone else seen this
in Tomcat 5.0.x?

Does anyone have a workaround?  My workaround right now is to stop/start
my web application from the tomcat manager
(http://localhost:8080/manager/html).  This isn't the best because when
the machine reboots this step must be done.  I can't rely on the service
starting.

Thanks for the help.

?xml version='1.0' encoding='utf-8'?
Server
  Listener className=org.apache.catalina.mbeans.ServerLifecycleListener/
  Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener/

!-- Using global resources fixes a bug when tomcat is run as a Windows Service. --
  GlobalNamingResources
Environment 
name=hibernate.dialect 
value=net.sf.hibernate.dialect.SQLServerDialect 
override=false
type=java.lang.String
description=Hibernate dialect: net.sf.Hibernate.dialect.[SQLServerDialect|OracleDialect|Oracle9Dialect]/
Resource name=com/skillsoft/mgs/mail/session type=javax.mail.Session/
Resource 
name=com/skillsoft/ilt/jdbc
scope=Shareable 
type=javax.sql.DataSource/
ResourceParams name=com/skillsoft/ilt/jdbc
  parameter
nameurl/name
valuejdbc:microsoft:sqlserver://localhost:1433;SelectMethod=cursor;sendStringParameterAsUnicode=false;databaseName=MDB/value
  /parameter
  parameter
namevalidationQuery/name
valueSELECT iltVersion FROM iltVersion WHERE versionid IN (SELECT param_val FROM master_parameters WHERE param_name=apos;dbVersionapos;)/value
  /parameter
  parameter
namemaxIdle/name
value10/value
  /parameter
  parameter
namemaxActive/name
value10/value
  /parameter
  parameter
namedriverClassName/name
valuecom.microsoft.jdbc.sqlserver.SQLServerDriver/value
  /parameter
  parameter
namemaxWait/name
value5000/value
  /parameter
  parameter
namefactory/name
valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
  /parameter
  parameter
nameusername/name
valuesa/value
  /parameter
  parameter
namepassword/name
value/value
  /parameter
/ResourceParams
ResourceParams name=com/skillsoft/mgs/mail/session
  parameter
namemail.smtp.host/name
!-- This will need to be replaced with a real SMTP server at installation. --
value@TODO/value
  /parameter
  parameter
namemail.smtp.port/name
value25/value
  /parameter
  parameter
namemail.smtp.sendpartial/name
valuetrue/value
  /parameter
/ResourceParams

Environment name=simpleValue type=java.lang.Integer value=30/
Resource auth=Container description=User database that can be updated and saved name=UserDatabase type=org.apache.catalina.UserDatabase/
ResourceParams name=UserDatabase
  parameter
namefactory/name
valueorg.apache.catalina.users.MemoryUserDatabaseFactory/value
  /parameter
  parameter
namepathname/name
valueconf/tomcat-users.xml/value
  /parameter
/ResourceParams
  /GlobalNamingResources

  Service name=Catalina
Connector acceptCount=100 connectionTimeout=2 disableUploadTimeout=true port=8080 redirectPort=8443
/Connector
Connector port=8009 protocol=AJP/1.3 protocolHandlerClassName=org.apache.jk.server.JkCoyoteHandler disableUploadTimeout=true redirectPort=8443
/Connector
Engine defaultHost=localhost jvmRoute=tomcat-server:8009 name=Catalina
  Host appBase=webapps name=localhost
Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_log. suffix=.txt timestamp=true/
Valve className=org.apache.catalina.valves.RequestDumperValve debug=9/
  /Host
  Logger className=org.apache.catalina.logger.FileLogger prefix=catalina_log. suffix=.txt timestamp=true/
  Realm className=org.apache.catalina.realm.UserDatabaseRealm/
/Engine
  /Service
/Server
?xml version='1.0' encoding='utf-8'?

Context 
path=/ilt
docBase=P:/ILT
workDir=D:/ILTWork
crossContext=true 
reloadable=true
debug=0
  
!-- 
The workDir attribute value MUST match the tempDir 

Re: Renaming WAR problem

2004-11-08 Thread Ben Souther
try ROOT.war


On Mon, 2004-11-08 at 10:27, Andrew Watters wrote:
 Apologies, I replied before but it never appeared, trying again...
 
 I renamed it to ROOT.WAR. The webapp used to be named like this and 
 previously worked fine. It's now called ROOT-1.0.WAR. The new name is a 
 result of moving to maven and it appending the version number.
 
 Ben Souther wrote:
 
 What did you rename it to?
 
 
 
 On Mon, 2004-11-08 at 09:46, Andrew Watters wrote:
   
 
 I have a WAR which tomcat recognises and unpacks correctly. When I 
 rename the WAR tomcat no longer unpacks it. Is this expected behaviour? 
 I've had a look in the 2.4 servlet spec and haven't been able to find 
 anything on this topic. Is there a work around that will allow me to do 
 this?
 
 Thank you
 Andrew
 
 -
 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: Renaming WAR problem

2004-11-08 Thread Andrew Watters
I renamed it to ROOT.WAR. The webapp used to be named like this and 
previously worked fine. It's now called ROOT-1.0.WAR. The new name is a 
result of moving to maven and it appending the version number.

Ben Souther wrote:
What did you rename it to?

On Mon, 2004-11-08 at 09:46, Andrew Watters wrote:
 

I have a WAR which tomcat recognises and unpacks correctly. When I 
rename the WAR tomcat no longer unpacks it. Is this expected behaviour? 
I've had a look in the 2.4 servlet spec and haven't been able to find 
anything on this topic. Is there a work around that will allow me to do 
this?

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


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




tomcat 5.0 service boot

2004-11-08 Thread John Byrne
Hi all,
I have tomcat on a windows 2000 server. We received a webapp which we have 
to run on this. This web-app customised some tomcat files. This works fine 
when I run startup.bat, but when I run it as a service (which I have to do) 
it doesn't work. The two main files that were modified were catalina.bat 
and setclasspath.bat. Does anybody know how I would mirror the changes in 
these files in the service that is run?

Cheers
John 

__
  -Interactive Services-   |-www.interactiveservices.com-  
__
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom
they are addressed. If you have received this email in error please
notify the system manager. This message contains confidential
information and is intended only for the individual named.

If you are not the named addressee you should not disseminate,
distribute or copy this e-mail. Please notify the sender immediately
by e-mail if you have received this e-mail by mistake and delete
this e-mail from your system. If you are not the intended recipient
you are notified that disclosing, copying, distributing or taking
any action in reliance on the contents of this information is
strictly prohibited.
__
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Connection pooling under Tomcat 5.0.28 Probleme

2004-11-08 Thread Akacem Mohammed
Hello every body,

I have read in die archive the e-mail exchange  about configuring Datasource in 
Tomcat for connection pooling. ( I also read the Tomcat doc )

the jar file commons-collection- 3.1.jar, commons-dbcp-1.2.1.jar, 
commons-pool-1.2.jar und the database driver ifjdbc.jar are in the commons/lib 
directory.

I got the following Mersage Cannot create JDBC driver of class '' for connect 
URL 'null' ( someone on the list experienced the same thing with the same 
Message )

My Configuration is as follow: ( I try to access an informix database )

web.xml :

  resource-ref
  descriptionDB Connection to informix/description
  res-ref-namejdbc/SteaDB/res-ref-name
  res-typejavax.sql.DataSource/res-type
  res-authContainer/res-auth
  /resource-ref


Server.xml : 

DefaultContext
  Resource name=jdbc/SteaDB auth=Container type=javax.sql.DataSource/

  ResourceParams name=jdbc/SteaDB
parameter
  namefactory/name
  valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
/parameter
   !-- Maximum time to wait for a dB connection to become available
 in ms, in this example 10 seconds. An Exception is thrown if
 this timeout is exceeded.  Set to -1 to wait indefinitely.
 --
parameter
  namemaxWait/name
  value1/value
/parameter

!-- username and password for dB connections  --
parameter
 nameusername/name
 valueusernamer/value
/parameter
parameter
 namepassword/name
 valuedfdfdf/value
/parameter

!-- Class name for the informix treiber --
parameter
   namedriverClassName/name
   valuecom.informix.jdbc.IfxDriver/value
/parameter

parameter
  nameurl/name
  value

jdbc:informix-sqli://s0062033.vt.bb.de:300056/coadb:informixserver=coadbzentral
  /value
/parameter

   parameter
nameremoveAbandoned/name
 valuetrue/value
   /parameter
parameter
  nameremoveAbandonedTimeout/name
  value300/value !-- in second --
/parameter

   parameter
  namelogAbandoned/name
  valuetrue/value
/parameter

  /ResourceParams
/DefaultContext

Thank you for your help

Mohammed


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



Re: Renaming WAR problem

2004-11-08 Thread Andrew Watters
Thanks. Sorry that's just my poor typing. It actually is ROOT.war. If I 
name it back again it unpacks fine! Aaagh, my head hurts now.

Ben Souther wrote:
try ROOT.war
On Mon, 2004-11-08 at 10:27, Andrew Watters wrote:
 

Apologies, I replied before but it never appeared, trying again...
I renamed it to ROOT.WAR. The webapp used to be named like this and 
previously worked fine. It's now called ROOT-1.0.WAR. The new name is a 
result of moving to maven and it appending the version number.

Ben Souther wrote:
   

What did you rename it to?

On Mon, 2004-11-08 at 09:46, Andrew Watters wrote:
 

I have a WAR which tomcat recognises and unpacks correctly. When I 
rename the WAR tomcat no longer unpacks it. Is this expected behaviour? 
I've had a look in the 2.4 servlet spec and haven't been able to find 
anything on this topic. Is there a work around that will allow me to do 
this?

Thank you
Andrew
-
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: tomcat 5.0 service boot

2004-11-08 Thread Shapira, Yoav

Hi,
You need to go into the Windows Registry and look where the Tomcat
service is defined.  (I don't remember the exact key offhand).  There
you can add classpath and other JVM instructions as registry values that
are passed to the service.  On recent Tomcat versions, the service
installer can be used to configure the service as well with these
parameters, so you don't have to edit the registry by hand.

Yoav Shapira http://www.yoavshapira.com


-Original Message-
From: John Byrne [mailto:[EMAIL PROTECTED]
Sent: Monday, November 08, 2004 10:36 AM
To: [EMAIL PROTECTED]
Subject: tomcat 5.0 service boot

Hi all,

I have tomcat on a windows 2000 server. We received a webapp which we
have
to run on this. This web-app customised some tomcat files. This works
fine
when I run startup.bat, but when I run it as a service (which I have to
do)
it doesn't work. The two main files that were modified were
catalina.bat
and setclasspath.bat. Does anybody know how I would mirror the changes
in
these files in the service that is run?

Cheers
John


 __

   -Interactive Services-   |-www.interactiveservices.com-
 __
 This email and any files transmitted with it are confidential and
 intended solely for the use of the individual or entity to whom
 they are addressed. If you have received this email in error please
 notify the system manager. This message contains confidential
 information and is intended only for the individual named.

 If you are not the named addressee you should not disseminate,
 distribute or copy this e-mail. Please notify the sender immediately
 by e-mail if you have received this e-mail by mistake and delete
 this e-mail from your system. If you are not the intended recipient
 you are notified that disclosing, copying, distributing or taking
 any action in reliance on the contents of this information is
 strictly prohibited.
 __

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




This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


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



Re: tomcat 5.0 service boot

2004-11-08 Thread Ben Souther
Hi John,
Not sure if you meant to send this directly to me or not.
I'll assume not and CC the tomcat list.

5.0.29 has a control panel that allows you to edit your java params
Start-Programs-Apache Tomcat-Configure Tomcat

If you didn't install that part, you will need to edit the registry keys
directly.






On Mon, 2004-11-08 at 10:54, John Byrne wrote:
 Sorry, it is jakarta-tomcat-5.0.29. I have attached the modified files. I 
 think the most important parts are:
 
 catalina.bat
 set 
 CATALINA_OPTS=-Xbootclasspath/a:%CATALINA_HOME%\webapps\pro-examples\WEB-INF\lib\cryptix.jar
 
 setclasspath.bat
 set CLASSPATH=%CLASSPATH%;%CATALINA_HOME%\webapps\pro-examples\WEB-INF\lib
 
 At 15:39 08/11/2004, you wrote:
 Can you share the changes with us?
 
 Also include the Tomcat Version that you are using.
 
 
 On Mon, 2004-11-08 at 10:35, John Byrne wrote:
   Hi all,
  
   I have tomcat on a windows 2000 server. We received a webapp which we have
   to run on this. This web-app customised some tomcat files. This works fine
   when I run startup.bat, but when I run it as a service (which I have to 
  do)
   it doesn't work. The two main files that were modified were catalina.bat
   and setclasspath.bat. Does anybody know how I would mirror the changes in
   these files in the service that is run?
  
   Cheers
   John
  
  
__
  
  -Interactive Services-   |-www.interactiveservices.com-
__
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom
they are addressed. If you have received this email in error please
notify the system manager. This message contains confidential
information and is intended only for the individual named.
  
If you are not the named addressee you should not disseminate,
distribute or copy this e-mail. Please notify the sender immediately
by e-mail if you have received this e-mail by mistake and delete
this e-mail from your system. If you are not the intended recipient
you are notified that disclosing, copying, distributing or taking
any action in reliance on the contents of this information is
strictly prohibited.
__
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
 
 
 This e-mail has been scanned for all viruses by Star. The
 service is powered by MessageLabs. For more information on a proactive
 anti-virus service working around the clock, around the globe, visit:
 http://www.star.net.uk
 
 
 
  __
 
-Interactive Services-   |-www.interactiveservices.com-  
  __
  This email and any files transmitted with it are confidential and
  intended solely for the use of the individual or entity to whom
  they are addressed. If you have received this email in error please
  notify the system manager. This message contains confidential
  information and is intended only for the individual named.
 
  If you are not the named addressee you should not disseminate,
  distribute or copy this e-mail. Please notify the sender immediately
  by e-mail if you have received this e-mail by mistake and delete
  this e-mail from your system. If you are not the intended recipient
  you are notified that disclosing, copying, distributing or taking
  any action in reliance on the contents of this information is
  strictly prohibited.
  __
 


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



Re: tomcat 5.0 service boot

2004-11-08 Thread John Byrne
Cheers Ben,
I'll try and play around with that
John
At 16:54 08/11/2004, Ben Souther wrote:
Hi John,
Not sure if you meant to send this directly to me or not.
I'll assume not and CC the tomcat list.
5.0.29 has a control panel that allows you to edit your java params
Start-Programs-Apache Tomcat-Configure Tomcat
If you didn't install that part, you will need to edit the registry keys
directly.


On Mon, 2004-11-08 at 10:54, John Byrne wrote:
 Sorry, it is jakarta-tomcat-5.0.29. I have attached the modified files. I
 think the most important parts are:

 catalina.bat
 set
 
CATALINA_OPTS=-Xbootclasspath/a:%CATALINA_HOME%\webapps\pro-examples\WEB-INF\lib\cryptix.jar

 setclasspath.bat
 set CLASSPATH=%CLASSPATH%;%CATALINA_HOME%\webapps\pro-examples\WEB-INF\lib

 At 15:39 08/11/2004, you wrote:
 Can you share the changes with us?
 
 Also include the Tomcat Version that you are using.
 
 
 On Mon, 2004-11-08 at 10:35, John Byrne wrote:
   Hi all,
  
   I have tomcat on a windows 2000 server. We received a webapp which 
we have
   to run on this. This web-app customised some tomcat files. This 
works fine
   when I run startup.bat, but when I run it as a service (which I 
have to
  do)
   it doesn't work. The two main files that were modified were 
catalina.bat
   and setclasspath.bat. Does anybody know how I would mirror the 
changes in
   these files in the service that is run?
  
   Cheers
   John
  
  
__
  
  -Interactive Services-   |-www.interactiveservices.com-
__
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom
they are addressed. If you have received this email in error please
notify the system manager. This message contains confidential
information and is intended only for the individual named.
  
If you are not the named addressee you should not disseminate,
distribute or copy this e-mail. Please notify the sender immediately
by e-mail if you have received this e-mail by mistake and delete
this e-mail from your system. If you are not the intended recipient
you are notified that disclosing, copying, distributing or taking
any action in reliance on the contents of this information is
strictly prohibited.
__
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
 
 
 This e-mail has been scanned for all viruses by Star. The
 service is powered by MessageLabs. For more information on a proactive
 anti-virus service working around the clock, around the globe, visit:
 http://www.star.net.uk
 


  __

-Interactive Services-   |-www.interactiveservices.com-
  __
  This email and any files transmitted with it are confidential and
  intended solely for the use of the individual or entity to whom
  they are addressed. If you have received this email in error please
  notify the system manager. This message contains confidential
  information and is intended only for the individual named.

  If you are not the named addressee you should not disseminate,
  distribute or copy this e-mail. Please notify the sender immediately
  by e-mail if you have received this e-mail by mistake and delete
  this e-mail from your system. If you are not the intended recipient
  you are notified that disclosing, copying, distributing or taking
  any action in reliance on the contents of this information is
  strictly prohibited.
  __



This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk


__
  -Interactive Services-   |-www.interactiveservices.com-  
__
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom
they are addressed. If you have received this email in error please
notify the system manager. This message contains confidential
information and is intended only for the individual named.

If you are not the named 

Hiding tomcat version numbers

2004-11-08 Thread Mark Claassen
I was told by someone that there was a way to hide the tomcat version
numbers on error pages without coding the change everywhere.  Does anyone
know how do to this?

Confidentiality Notice:  OCIESERVICE
-
The contents of this e-mail message and any attachments are intended 
solely for the addressee(s) named in this message. This communication 
is intended to be and to remain confidential.  If you are not the 
intended recipient of this message, or if this message has been 
addressed to you in error, please immediately alert the sender by 
reply e-mail and then delete this message and its attachments. Do not 
deliver, distribute, copy, disclose the contents or take any action 
in reliance upon the information contained in the communication or 
any attachments. 
-
Mark Claassen
Donnell Systems, Inc.
300 S. St. Louis Blvd. Ste. 203 
South Bend, IN 46617
E-mail: mailto:[EMAIL PROTECTED]
Voice: (574)232-3784
Fax: (574)232-4014
 



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



Tomcat on PDA

2004-11-08 Thread Suleman Butt
Hi ,
 Is there any tomcat release to be installed on a PDA (HP
5500) devise with a specs 400mhz processor and 128mb ram. Actually i
want to execute a semantic web service on a pda device.

Could anybody help me in suggesting the appropriate set of softwares required.

Regards Suleman.

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



RE: Tomcat server.xml configuration

2004-11-08 Thread Dave Kennedy
Hi Yoav,
I need to use the Engine element to host multiple separate domains.
I have read the documentation, but my configuration doesn't work
properly.
Can you share a production Tomcat 4 server.xml file so that I can learn
from it?

Thanks,
Dave

-Original Message-
From: Shapira, Yoav [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 08, 2004 5:25 AM
To: Tomcat Users List; [EMAIL PROTECTED]
Subject: RE: Tomcat server.xml configuration



Hi,

How is server.xml configured on a virtual private server (VPS) web
host.

Where should appBase point for the virtual hosts?

That depends on what exactly you mean.  There are a couple of ways to go
about this.  One is what you posted: an Engine element in server.xml
with numerous Hosts.  For this case each appBase should be the directory
where the user for the host is putting their webapps.

Another way is to use the user webapp feature, which lets you do things
like http://a.b.com/~user1 and http://a.b.com/~user2 served out of user1
and user2's public_html directories respectively.  There are other
configuration options as well: see the Host config reference section
titled User Web Applications at
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/host.html.  For
this case, the appBase doesn't matter much: leave it as Tomcat's default
most likely.

Yoav



This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential,
proprietary and/or privileged.  This e-mail is intended only for the
individual(s) to whom it is addressed, and may not be saved, copied,
printed, disclosed or used by anyone else.  If you are not the(an)
intended recipient, please immediately delete this e-mail from your
computer system and notify the sender.  Thank you.


-
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 server.xml configuration

2004-11-08 Thread Shapira, Yoav

Hi,

Can you share a production Tomcat 4 server.xml file so that I can learn
from it?

No, I can't, for two reasons.  One, I don't use Tomcat 4 in production
any more (and haven't for a long time now).  And two, even if I did it'd
be confidential and belonging to the company for which I configured
Tomcat, so I wouldn't be able to post it on a public forum like this
one.

If you want troubleshooting help, you need to be more specific than just
saying your configuration doesn't work.  A more specific subject would
also attract more attention on the mailing list.

Yoav



This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


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



Re: Tomcat on PDA

2004-11-08 Thread fzlists
I don't think you'll find a native build, but you MIGHT be able to get away 
with emulation... There are one or two x86 emulator for PocketPC, at least one 
of which can run Windows 95... If you can get that far, Tomcat MIGHT run in 
that environment.  Performance would be terrible I'd guess, so it's probably 
not even worth trying.  Your looking for an ARM-native version that works under 
PocketPC, and that doesn't exist to my knowledge, partly because there's no 
ARM-compatible binaries and partly because PocketPC doesn't support most of 
what Tomcat would need (i.e., JDK or full-fledged JRE... there are some Java 
runtimes, but I'm not sure how complete they are).

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Mon, November 8, 2004 1:14 pm, Suleman Butt said:
 Hi ,
  Is there any tomcat release to be installed on a PDA (HP
 5500) devise with a specs 400mhz processor and 128mb ram. Actually i
 want to execute a semantic web service on a pda device.
 
 Could anybody help me in suggesting the appropriate set of softwares
 required.
 
 Regards Suleman.
 
 -
 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 on PDA

2004-11-08 Thread Mike Jackson
The JVMs aren't terribly complete.  The IBM one, for instance, doesn't even
come close to implementing the complete java.net library.  And you have to
be careful with the things that are implemented as they aren't 100% the same
as the standard VM's on other platforms.  I wouldn't expect to be able to
run tomcat, but you should be able to run your own custom built http server
with enough playing around.

--mikej
-=-
mike jackson
[EMAIL PROTECTED]


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
 Sent: Monday, November 08, 2004 10:41 AM
 To: [EMAIL PROTECTED]
 Subject: Re: Tomcat on PDA
 
 
 I don't think you'll find a native build, but you MIGHT be 
 able to get away with emulation... There are one or two x86 
 emulator for PocketPC, at least one of which can run Windows 
 95... If you can get that far, Tomcat MIGHT run in that 
 environment.  Performance would be terrible I'd guess, so 
 it's probably not even worth trying.  Your looking for an 
 ARM-native version that works under PocketPC, and that 
 doesn't exist to my knowledge, partly because there's no 
 ARM-compatible binaries and partly because PocketPC doesn't 
 support most of what Tomcat would need (i.e., JDK or 
 full-fledged JRE... there are some Java runtimes, but I'm not 
 sure how complete they are).
 
 -- 
 Frank W. Zammetti
 Founder and Chief Software Architect
 Omnytex Technologies
 http://www.omnytex.com
 
 On Mon, November 8, 2004 1:14 pm, Suleman Butt said:
  Hi ,
   Is there any tomcat release to be installed on a PDA (HP
  5500) devise with a specs 400mhz processor and 128mb ram. 
 Actually i 
  want to execute a semantic web service on a pda device.
  
  Could anybody help me in suggesting the appropriate set of 
 softwares 
  required.
  
  Regards Suleman.
  
  
 -
  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]



sources for servlet-api.jar

2004-11-08 Thread Charlton_Rose
I am trying to obtain sources for servlet-api.jar, but all my searching 
around on the web, including Sun's site, has failed to turn up what I'm 
looking for.  Do you know where to look?

RE: sources for servlet-api.jar

2004-11-08 Thread Shapira, Yoav

Hi,
The jakarta-servletapi-5 repository on our CVS.  For web access, you can
use http://cvs.apache.org/viewcvs.cgi/jakarta-servletapi-5/, and for
configuration CVS client access, see
http://www.apache.org/dev/contributors.html#cvsbasics.

Yoav Shapira http://www.yoavshapira.com


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Monday, November 08, 2004 2:01 PM
To: [EMAIL PROTECTED]
Subject: sources for servlet-api.jar

I am trying to obtain sources for servlet-api.jar, but all my searching
around on the web, including Sun's site, has failed to turn up what I'm
looking for.  Do you know where to look?



This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


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



RE: FW: Configuring JAAS realm for a web appplication (Catalina c lass loader bug)

2004-11-08 Thread Jacob Kjome
Quoting Reingold Genna [EMAIL PROTECTED]:

 Jake,

 Thanks for our reply.

 I have tried common/lib scenario. As a matter of fact I have started with
 that option. However it produces the same result.


Well, not the same result when you remove the jar from WEB-INF/lib as I
recommended as you seem to have later stated below.

 I have tried to move ejb-client jar out of of web app. But then I run into
 the problem when the application uses a class loaded by common class loader
 and if the class references another class in the WEB_INF/lib jar (a
 different jar) I get NoClassDefError. Effectively the only safe way to
 install my application in that scenario is to copy all application jars into
 common/lib and that is fundamently wrong.


It sounds like you might have to re-think your circular dependencies.  You need
to make a decision which jars should depend on each other and whether the
dependency direction is one way, both ways, or none at all.  You can't get away
from making this decision no matter the appserver.

 What I don't understand is why my set up works in 4.1.29 and doesn't work in
 5.0.28.


I can't explain that.  However, I suspect that you tested 4.1.29 on some other
machine than what you have 5.0.28 installed upon.  I would investigate how the
environment might be different.  Different classpaths,  different ways of
starting the server (batch file -vs- a service), etc  Make sure you try
fresh installs of each version with your app and test both in exactly the same
way.  Then you will be comparing apples to apples and, therefore, getting rid
of extraneous variables that might be clouding the investigation.


Jake




 -Original Message-
 From: Jacob Kjome [mailto:[EMAIL PROTECTED]
 Sent: Monday, 8 November 2004 3:52 PM
 To: Tomcat Users List
 Subject: Re: FW: Configuring JAAS realm for a web appplication (Catalina
 class loader bug)


 Well, the short answer is, move it to common/lib, not
 server/lib.  server/lib is for stuff that *only* Tomcat itself should
 see.  common/lib is for stuff that both the server and applications should
 see (and shared/lib is the converse of server/lib, but different from
 WEB-INF/lib since it is global to all apps in the server).

 Even in the common/lib case, you may run into the same problem, though,
 because if you put the jar in WEB-INF/lib, that will be loaded,
 preferentially by the application because of child first classloading
 behavior that Tomcat implements.  If JASS looks up this class as well, but
 loads it in a different classloader you will run into the same issue.  In
 this case, you'll need to remove the jar from WEB-INF/lib and load it from
 common/lib only.

 I can't say for sure that it isn't bad behavior by Tomcat, but I doubt
 it.  It is just a classloading issue you'll have to deal with.  However,
 this is one reason why many appservers out there don't use child first
 classloading behavior by default, although in the server/lib situation
 you'd get the same result in this case.  The common/lib case would have
 been taken care of in a server implementing normal parent first
 classloading behavior, but then it would be redundant to have the jar in
 WEB-INF/lib in that case anyway.  Bottom line is that classloaders are
 tricky and different situations call for different solutions so I doubt
 there is anything fundamentally wrong with what Tomcat is doing.

 Jake

 At 09:31 AM 11/8/2004 +1100, you wrote:

 Hi,
 My company  isusing Tomcat 4.1.29 and I'm investigating a transition to
 version 5.0.28.
 
 We use JAAS for authentication. The realm is decleared inside the web
 application context. The authentication code makes an EJB call to jBoss
 server (we are using stand alone Tomcat not jBoss bundled version).
 
 In verion 4.1 we have ejb-client code jar in both server/lib and Web
 Application lib directories. I have replicated the same structure in
 version 5 but I get ClassCastException inside my JAAS
 Authentication  module. If I remove the copy of ejb-client jar from Web
 Application it all works fine which suggest to me that the
 ClassCastException related to the fact that the same class id loaded by
 different classloaders. Tomcat doco specifies that Catalina classloader is
 invisible to webapplications ( and that's why we use it in Tomcat 4) but
 it doesn't seem to be the case. The work-around (removing ejb-client code
 from web app) is not a solution because it has a lot of web app specific
 code.
 
 If I don't copy authentication code to server/lib directory and only keep
 it in web app Tomcat doesn't find it. That is the case for both versions -
 4 and 5. To me it suggests a different problem - since JAAS realm declared
 in web app context it should apply to web application only and therefore
 it should be looking into webapp not server/lib directory. But that is a
 different discussion topic altogether.
 
 Thanks in advance
 
 Genna
 
 
 
 
 
 
 
 CAUTION - This message may contain privileged and confidential 

RE: jk_nt_service.exe stop service gives BAD packet signature

2004-11-08 Thread Thuy-Linh Chu


Follow-up on this subject: I was able to figure out part of the problem and
devised a solution for it.

1) There is a bug in jk_nt_exe that sends an invalid header.  I'd patched
the code and the 'BAD packet signature' goes away.  

2) However, the second problem of the NullPointerException still exists.
There may be a bug in Tomcat connectors code.  I did not have time to look
into this.

3) To get around this problem and to get the service to shutdown properly, I
used an undocumented feature that set the shudown_protocol to 'cmd' (instead
of 'ajp13').  However, there are also bugs in implementation of this feature
(perhaps this is why it's not documented as an option).  I fixed the problem
and got the service to shutdown cleanly, similar to when using the
'shutdown.sh' script.  

I'd like to incorporate these changes to the official version of Tomcat.
I'm not set up to be a Tomcat developer and may not have time to do this in
the near future.  So if someone would like to volunteer to incorporate the
changes, I can forward the patched code to you for you to put it in.

Thuy



 -Original Message-
 From: Thuy-Linh Chu [mailto:[EMAIL PROTECTED]
 Sent: Thursday, November 04, 2004 11:10 AM
 To: '[EMAIL PROTECTED]'
 Subject: jk_nt_service.exe stop service gives BAD packet signature
 
 
 I have problems stopping Tomcat as a service in Windows.  I install the
 service using jk_nt_service.exe (version 5.0.25).  When I stop service, I
 got the following error:
 
 Nov 3, 2004 12:16:17 PM org.apache.jk.common.MsgAjp processHeader
 SEVERE: BAD packet signature 13
 00 0d 00 01 00   | .
 Nov 3, 2004 12:16:17 PM
 org.apache.tomcat.util.threads.ThreadPool$ControlRunnable run
 SEVERE: Caught exception (java.lang.NullPointerException) executing
 [EMAIL PROTECTED], terminating thread
 
 Looks like what it means is that the jk_nt_service.exe was sending Tomcat
 a
 incorrect format message.  If this is a bug, I would be very surprised to
 see that it got through all these times.  My guess is are there something
 wrong with my build of the jk_nt_service.exe or my configuration
 somewhere.
 Perhaps bit ordering difference?
 
 Could you help?  Thanks.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

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



What worke on 4.1.27 fails of 4.1.31

2004-11-08 Thread Rob Tanner
I upgraded my development station to tomcat 4.1.31 from 4.1.27 and from
j2sdk1.4.2_02 to j2sdk1.4.2_06.  The following unchanged snippet now throws a
NoSuchMethodError exception:

   env.put(Context.SECURITY_PRINCIPAL, BIND_DN);
   env.put(Context.SECURITY_CREDENTIALS, password);
   env.put(Context.SECURITY_AUTHENTICATION, simple);

   ctx = new InitialDirContext(env);

   session = request.getSession();

   session.setAttribute(sess.context, ctx);
   session.setAttribute(sess.env, env);
   session.setAttribute(sess.uid, uid);
   session.setAttribute(sess.dn, BIND_DN);
   session.setAttribute(sess.valid, true);


The exception is thrown on the first session.setAttribute() statement (line
110 in the java source).  I have included the top of the stack trace below
(lines wrapped for readability):

java.lang.NoSuchMethodError:\
   javax.servlet.http.HttpSessionBindingEvent.init\
   (Ljavax/servlet/http/HttpSession;Ljava/lang/String;Ljava/lang/Object;)V
at org.apache.catalina.session.\
   StandardSession.setAttribute(StandardSession.java:1231)
at org.apache.catalina.session.\
   StandardSessionFacade.setAttribute(StandardSessionFacade.java:144)
at ClassListAdministrator.doGet(ClassListAdministrator.java:110)

Another much more complex servlet that I moved over but that does not require
the use of sessions works fine, so I think the basic installation is okay.
Any idea why that error's coming up on sessions?

Thanks,
Rob


-- 
Rob Tanner
UNIX Services Manager
Linfield College, McMinnville OR


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



RE: What worke on 4.1.27 fails of 4.1.31

2004-11-08 Thread Shapira, Yoav

Hi,
Make sure you only have one version of the servlet API jar in your
classpath.  It should be in $CATALINA_HOME/common/lib -- make sure
there's only one there.  Further, make sure you don't have any servlet
JARs in your WEB-INF/lib directory.

Yoav Shapira http://www.yoavshapira.com


-Original Message-
From: Rob Tanner [mailto:[EMAIL PROTECTED]
Sent: Monday, November 08, 2004 2:36 PM
To: 'Tomcat Users List'
Subject: What worke on 4.1.27 fails of 4.1.31

I upgraded my development station to tomcat 4.1.31 from 4.1.27 and from
j2sdk1.4.2_02 to j2sdk1.4.2_06.  The following unchanged snippet now
throws
a
NoSuchMethodError exception:

   env.put(Context.SECURITY_PRINCIPAL, BIND_DN);
   env.put(Context.SECURITY_CREDENTIALS, password);
   env.put(Context.SECURITY_AUTHENTICATION, simple);

   ctx = new InitialDirContext(env);

   session = request.getSession();

   session.setAttribute(sess.context, ctx);
   session.setAttribute(sess.env, env);
   session.setAttribute(sess.uid, uid);
   session.setAttribute(sess.dn, BIND_DN);
   session.setAttribute(sess.valid, true);


The exception is thrown on the first session.setAttribute() statement
(line
110 in the java source).  I have included the top of the stack trace
below
(lines wrapped for readability):

java.lang.NoSuchMethodError:\
   javax.servlet.http.HttpSessionBindingEvent.init\

(Ljavax/servlet/http/HttpSession;Ljava/lang/String;Ljava/lang/Object;)V
at org.apache.catalina.session.\
   StandardSession.setAttribute(StandardSession.java:1231)
at org.apache.catalina.session.\
   StandardSessionFacade.setAttribute(StandardSessionFacade.java:144)
at ClassListAdministrator.doGet(ClassListAdministrator.java:110)

Another much more complex servlet that I moved over but that does not
require
the use of sessions works fine, so I think the basic installation is
okay.
Any idea why that error's coming up on sessions?

Thanks,
Rob


--
Rob Tanner
UNIX Services Manager
Linfield College, McMinnville OR


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




This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


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



ClassLoader question

2004-11-08 Thread Mark Claassen
What is the difference between the server/lib and shared directories as far
as the class loaders are concerned?

Background:
---
I was having trouble with CGI scripts, so I wanted to creat a new CGIServlet
to run some tests.  To start the process, I copied source of the tomcat
CGIServlet file into my own package structure.  Once I got this working I
would alter that code and try to see why the CGI scripts where not executing
correctly.

Part I Don't Understand:
---
I put my jar file containing the CGIServlet into the server/lib directory
(where the tomcat CGIServlet resides).  This, however, would not start up
and gave me ClassNotFound exceptions.  However, when I moved my jar to the
shared directory, everything seems to work.  

Question:
-
I thought everything had access to things in the server/lib directory.  What
is going on here?

Thanks,
Mark


Confidentiality Notice:  OCIESERVICE
-
The contents of this e-mail message and any attachments are intended 
solely for the addressee(s) named in this message. This communication 
is intended to be and to remain confidential.  If you are not the 
intended recipient of this message, or if this message has been 
addressed to you in error, please immediately alert the sender by 
reply e-mail and then delete this message and its attachments. Do not 
deliver, distribute, copy, disclose the contents or take any action 
in reliance upon the information contained in the communication or 
any attachments. 
-
Mark Claassen
Donnell Systems, Inc.
300 S. St. Louis Blvd. Ste. 203 
South Bend, IN 46617
E-mail: mailto:[EMAIL PROTECTED]
Voice: (574)232-3784
Fax: (574)232-4014
 



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



RE: ClassLoader question

2004-11-08 Thread Shapira, Yoav

Hi,
RTFM:
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/class-loader-howto.html.
It clearly (in bold, capital letters) says server/lib is not visible to
web applications.

Yoav Shapira http://www.yoavshapira.com


-Original Message-
From: Mark Claassen [mailto:[EMAIL PROTECTED]
Sent: Monday, November 08, 2004 2:40 PM
To: 'Tomcat Users List'
Subject: ClassLoader question

What is the difference between the server/lib and shared directories as
far
as the class loaders are concerned?

Background:
---
I was having trouble with CGI scripts, so I wanted to creat a new
CGIServlet
to run some tests.  To start the process, I copied source of the tomcat
CGIServlet file into my own package structure.  Once I got this working
I
would alter that code and try to see why the CGI scripts where not
executing
correctly.

Part I Don't Understand:
---
I put my jar file containing the CGIServlet into the server/lib
directory
(where the tomcat CGIServlet resides).  This, however, would not start
up
and gave me ClassNotFound exceptions.  However, when I moved my jar to
the
shared directory, everything seems to work.

Question:
-
I thought everything had access to things in the server/lib directory.
What
is going on here?

Thanks,
Mark


Confidentiality Notice:  OCIESERVICE
-
The contents of this e-mail message and any attachments are intended
solely for the addressee(s) named in this message. This communication
is intended to be and to remain confidential.  If you are not the
intended recipient of this message, or if this message has been
addressed to you in error, please immediately alert the sender by
reply e-mail and then delete this message and its attachments. Do not
deliver, distribute, copy, disclose the contents or take any action
in reliance upon the information contained in the communication or
any attachments.
-
Mark Claassen
Donnell Systems, Inc.
300 S. St. Louis Blvd. Ste. 203
South Bend, IN 46617
E-mail: mailto:[EMAIL PROTECTED]
Voice: (574)232-3784
Fax: (574)232-4014




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




This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


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



RE: What worke on 4.1.27 fails of 4.1.31

2004-11-08 Thread Rob Tanner
That was it.  Thank you.

--On Monday, November 08, 2004 02:38:08 PM -0500 Shapira, Yoav
[EMAIL PROTECTED] wrote:

 
 Hi,
 Make sure you only have one version of the servlet API jar in your
 classpath.  It should be in $CATALINA_HOME/common/lib -- make sure
 there's only one there.  Further, make sure you don't have any servlet
 JARs in your WEB-INF/lib directory.
 
 Yoav Shapira http://www.yoavshapira.com
  
 
 -Original Message-
 From: Rob Tanner [mailto:[EMAIL PROTECTED]
 Sent: Monday, November 08, 2004 2:36 PM
 To: 'Tomcat Users List'
 Subject: What worke on 4.1.27 fails of 4.1.31
 
 I upgraded my development station to tomcat 4.1.31 from 4.1.27 and from
 j2sdk1.4.2_02 to j2sdk1.4.2_06.  The following unchanged snippet now
 throws
 a
 NoSuchMethodError exception:
 
   env.put(Context.SECURITY_PRINCIPAL, BIND_DN);
   env.put(Context.SECURITY_CREDENTIALS, password);
   env.put(Context.SECURITY_AUTHENTICATION, simple);
 
   ctx = new InitialDirContext(env);
 
   session = request.getSession();
 
   session.setAttribute(sess.context, ctx);
   session.setAttribute(sess.env, env);
   session.setAttribute(sess.uid, uid);
   session.setAttribute(sess.dn, BIND_DN);
   session.setAttribute(sess.valid, true);
 
 
 The exception is thrown on the first session.setAttribute() statement
 (line
 110 in the java source).  I have included the top of the stack trace
 below
 (lines wrapped for readability):
 
 java.lang.NoSuchMethodError:\
   javax.servlet.http.HttpSessionBindingEvent.init\
 
 (Ljavax/servlet/http/HttpSession;Ljava/lang/String;Ljava/lang/Object;)V
 at org.apache.catalina.session.\
   StandardSession.setAttribute(StandardSession.java:1231)
 at org.apache.catalina.session.\
   StandardSessionFacade.setAttribute(StandardSessionFacade.java:144)
 at ClassListAdministrator.doGet(ClassListAdministrator.java:110)
 
 Another much more complex servlet that I moved over but that does not
 require
 the use of sessions works fine, so I think the basic installation is
 okay.
 Any idea why that error's coming up on sessions?
 
 Thanks,
 Rob
 
 
 --
 Rob Tanner
 UNIX Services Manager
 Linfield College, McMinnville OR
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 This e-mail, including any attachments, is a confidential business
 communication, and may contain information that is confidential,
 proprietary and/or privileged.  This e-mail is intended only for the
 individual(s) to whom it is addressed, and may not be saved, copied,
 printed, disclosed or used by anyone else.  If you are not the(an) intended
 recipient, please immediately delete this e-mail from your computer system
 and notify the sender.  Thank you.
 



-- 
Rob Tanner
UNIX Services Manager
Linfield College, McMinnville OR


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



Session invalidation problem

2004-11-08 Thread fzlists
Hello all.  I'm cross-posting this to the Tomcat and Struts lists because I'm 
not sure where is more appropriate to post it.

I have an application that is throwing the following sporadic, but thankfully 
infrequent, exceptions:

stack trace: java.lang.illegalstateexception: setattribute: session already 
invalidated

It is on a call to session.setAttribute().  Here's the weird part... Just 
before that method call I do the following:

if (session == null || session.getAttribute(sessionAlive) == null) {
  request.setAttribute(message, Your session timed out.  Please log on 
again.);
  session.invalidate();
  return mapping.findForward(reload);
}

The idea of course is to tell the user their session timed out.  Now, as I 
understand it, the session==null portion will always be false because session 
is never null, there is always a session associated with the request, even if 
it's empty.  That's the reason I put the sessionAlive attribute in during logon 
and check if THAT is null with each subsequent request to indicate whether the 
session has timed out or not (please keep the comments about this not being 
done in the typical way to a minimum... this is an inherited app I'm dealing 
with).

Any idea why I might still be seeing that exception?  The verbiage of it is a 
little odd and doesn't seem to make sense, especially considering the check 
right before that is indicating the session is fine.  I guess it COULD be 
timing out between that first check and the call to setAttribute(), but I'm 
assuming the container wouldn't invalidate a session that is attached to a live 
request, logically that would make sense, so I've more or less discounted this 
possibility.  I appreciate any thoughts you may have!

Frank W. Zammetti
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

url-pattern with Basic Auth

2004-11-08 Thread Peter Lin
has anyone ever tried to use url-pattern to filter for basic auth
beyond /* all?  If I do this, it forces all requests to my servlet
to authenticate.

servlet
servlet-nameAuthServlet/servlet-name
servlet-classtest.AuthServlet/servlet-class
/servlet

servlet-mapping
servlet-nameAuthServlet/servlet-name
url-pattern/AuthServlet/*/url-pattern
url-pattern/AuthServlet/url-pattern
/servlet-mapping

  security-constraint
web-resource-collection
  web-resource-nameauth/web-resource-name
  url-pattern/*/url-pattern
/web-resource-collection
auth-constraint
   role-nameservice/role-name
/auth-constraint
  /security-constraint

  login-config
auth-methodBASIC/auth-method
realm-nameTestAuth/realm-name
  /login-config

  !-- Security roles referenced by this web application --
  security-role
description
  My test role
/description
role-nameservice/role-name
  /security-role


But what I would like to do is to be able to filter based on a given
request parameter, like this.

servlet
servlet-nameAuthServlet/servlet-name
servlet-classtest.AuthServlet/servlet-class
/servlet

servlet-mapping
servlet-nameAuthServlet/servlet-name
url-pattern/AuthServlet/*/url-pattern
url-pattern/AuthServlet/url-pattern
/servlet-mapping

  security-constraint
web-resource-collection
  web-resource-nameauth/web-resource-name
  url-pattern/AuthServlet?*param1=account1*/url-pattern
/web-resource-collection
auth-constraint
   role-nameservice/role-name
/auth-constraint
  /security-constraint

  login-config
auth-methodBASIC/auth-method
realm-nameTestAuth/realm-name
  /login-config

  !-- Security roles referenced by this web application --
  security-role
description
  My test role
/description
role-nameservice/role-name
  /security-role

I tried it and cross-referenced the servlet spec. It doesn't appear to
say if this is allowed or not. Anyone know?

peter

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



RE: Session invalidation problem

2004-11-08 Thread Phillip Qin
Have you tried session.isNew()?

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: November 8, 2004 2:52 PM
To: [EMAIL PROTECTED]
Subject: Session invalidation problem


Hello all.  I'm cross-posting this to the Tomcat and Struts lists because
I'm not sure where is more appropriate to post it.

I have an application that is throwing the following sporadic, but
thankfully infrequent, exceptions:

stack trace: java.lang.illegalstateexception: setattribute: session already
invalidated

It is on a call to session.setAttribute().  Here's the weird part... Just
before that method call I do the following:

if (session == null || session.getAttribute(sessionAlive) == null) {
  request.setAttribute(message, Your session timed out.  Please log on
again.);
  session.invalidate();
  return mapping.findForward(reload);
}

The idea of course is to tell the user their session timed out.  Now, as I
understand it, the session==null portion will always be false because
session is never null, there is always a session associated with the
request, even if it's empty.  That's the reason I put the sessionAlive
attribute in during logon and check if THAT is null with each subsequent
request to indicate whether the session has timed out or not (please keep
the comments about this not being done in the typical way to a minimum...
this is an inherited app I'm dealing with).

Any idea why I might still be seeing that exception?  The verbiage of it is
a little odd and doesn't seem to make sense, especially considering the
check right before that is indicating the session is fine.  I guess it COULD
be timing out between that first check and the call to setAttribute(), but
I'm assuming the container wouldn't invalidate a session that is attached to
a live request, logically that would make sense, so I've more or less
discounted this possibility.  I appreciate any thoughts you may have!

Frank W. Zammetti


!DSPAM:418fce80320296137119042!


Re: ClassLoader question

2004-11-08 Thread e-Denton Subscriber
shared is the right directory for things to be shared by all your web apps
(shared class loader).
server/lib is for the Catalina class loader.


- Original Message - 
From: Mark Claassen [EMAIL PROTECTED]
To: 'Tomcat Users List' [EMAIL PROTECTED]
Sent: Monday, November 08, 2004 1:40 PM
Subject: ClassLoader question


 What is the difference between the server/lib and shared directories as
far
 as the class loaders are concerned?

 Background:
 ---
 I was having trouble with CGI scripts, so I wanted to creat a new
CGIServlet
 to run some tests.  To start the process, I copied source of the tomcat
 CGIServlet file into my own package structure.  Once I got this working I
 would alter that code and try to see why the CGI scripts where not
executing
 correctly.

 Part I Don't Understand:
 ---
 I put my jar file containing the CGIServlet into the server/lib directory
 (where the tomcat CGIServlet resides).  This, however, would not start up
 and gave me ClassNotFound exceptions.  However, when I moved my jar to the
 shared directory, everything seems to work.

 Question:
 -
 I thought everything had access to things in the server/lib directory.
What
 is going on here?

 Thanks,
 Mark


 Confidentiality Notice:  OCIESERVICE
 -
 The contents of this e-mail message and any attachments are intended
 solely for the addressee(s) named in this message. This communication
 is intended to be and to remain confidential.  If you are not the
 intended recipient of this message, or if this message has been
 addressed to you in error, please immediately alert the sender by
 reply e-mail and then delete this message and its attachments. Do not
 deliver, distribute, copy, disclose the contents or take any action
 in reliance upon the information contained in the communication or
 any attachments.
 -
 Mark Claassen
 Donnell Systems, Inc.
 300 S. St. Louis Blvd. Ste. 203
 South Bend, IN 46617
 E-mail: mailto:[EMAIL PROTECTED]
 Voice: (574)232-3784
 Fax: (574)232-4014




 -
 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 invalidation problem

2004-11-08 Thread fzlists
I hadn't thought of that, but it's an interesting thought... I guess the least 
intrusive way would be to add it to the IF statement... i.e., check if the 
session is null (which should always be false, but I'm anal so what the hell), 
check is sessionAlive is null, and check if session it's new... If any of those 
are true, the session has timed out.  Interesting thought, I think I'll give 
that a shot.  Thanks a lot Phillip!

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Mon, November 8, 2004 2:57 pm, Phillip Qin said:
 Have you tried session.isNew()?
 
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: November 8, 2004 2:52 PM
 To: [EMAIL PROTECTED]
 Subject: Session invalidation problem
 
 
 Hello all.  I'm cross-posting this to the Tomcat and Struts lists because
 I'm not sure where is more appropriate to post it.
 
 I have an application that is throwing the following sporadic, but
 thankfully infrequent, exceptions:
 
 stack trace: java.lang.illegalstateexception: setattribute: session
 already
 invalidated
 
 It is on a call to session.setAttribute().  Here's the weird part... Just
 before that method call I do the following:
 
 if (session == null || session.getAttribute(sessionAlive) == null) {
   request.setAttribute(message, Your session timed out.  Please log on
 again.);
   session.invalidate();
   return mapping.findForward(reload);
 }
 
 The idea of course is to tell the user their session timed out.  Now, as I
 understand it, the session==null portion will always be false because
 session is never null, there is always a session associated with the
 request, even if it's empty.  That's the reason I put the sessionAlive
 attribute in during logon and check if THAT is null with each subsequent
 request to indicate whether the session has timed out or not (please keep
 the comments about this not being done in the typical way to a minimum...
 this is an inherited app I'm dealing with).
 
 Any idea why I might still be seeing that exception?  The verbiage of it
 is
 a little odd and doesn't seem to make sense, especially considering the
 check right before that is indicating the session is fine.  I guess it
 COULD
 be timing out between that first check and the call to setAttribute(), but
 I'm assuming the container wouldn't invalidate a session that is attached
 to
 a live request, logically that would make sense, so I've more or less
 discounted this possibility.  I appreciate any thoughts you may have!
 
 Frank W. Zammetti
 
 
 !DSPAM:418fce80320296137119042!
 

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

RE: url-pattern with Basic Auth

2004-11-08 Thread Mike Curwen
I'd think url-pattern elements (regardless of where they appear) need to
conform to the url-patterns specified in the spec (not sure of section). 

paths: starting with '/' and ending with '/*'
extensions:  '*.foo'
exact: exact matching.

The url-pattern I've left from your original message doesn't match any of
these.


 -Original Message-
 From: Peter Lin [mailto:[EMAIL PROTECTED] 
 Sent: Monday, November 08, 2004 1:57 PM
 To: tomcat-user
 Subject: url-pattern with Basic Auth
 
   url-pattern/AuthServlet?*param1=account1*/url-pattern
 
 I tried it and cross-referenced the servlet spec. It doesn't 
 appear to say if this is allowed or not. Anyone know?
 
 peter
 


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



RE: ClassLoader question

2004-11-08 Thread Mark Claassen
One thing I was going to add to this was that I do have other classes in
this directory that work.  I have a custom access log value, which works
fine, and the only reference to it is in a jar file that is in this
directory.  And, from what I have read, it properly placed be in this
directory.



 -Original Message-
 From: Mark Claassen [mailto:[EMAIL PROTECTED] 
 Sent: Monday, November 08, 2004 3:14 PM
 To: 'Tomcat Users List'
 Subject: RE: ClassLoader question
 
 
 I forgot to mention that I am running 4.1, however the docs 
 are similar and on this point I clearly deserve any sneers 
 that are sent my way.
 
 But,...
 In the default web.xml file there is this:
 !-- IMPORTANT: To use the CGI servlet, you also need to rename the
 --
 !--
 $CATALINA_HOME/server/lib/servlets-cgi.renametojar file
 --
 !--to $CATALINA_HOME/server/lib/servlets-cgi.jar
 --.
 
 When the name is changed, the default CGIServlet works!  Why 
 does the CGIServlet work from the server/lib directory and 
 mine not?  Does it actually check somehow?  My class is 
 currently a carbon copy of tomcat's with no additional class 
 dependencies.  It compiles against the catalina.jar just fine.
 
 
  -Original Message-
  From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
  Sent: Monday, November 08, 2004 2:47 PM
  To: Tomcat Users List
  Subject: RE: ClassLoader question
  
  
  
  Hi,
  RTFM:
  http://jakarta.apache.org/tomcat/tomcat-5.0-doc/class-loader-h
  owto.html.
  It clearly (in bold, capital letters) says server/lib is not 
  visible to web applications.
  
  Yoav Shapira http://www.yoavshapira.com
   
  
  -Original Message-
  From: Mark Claassen [mailto:[EMAIL PROTECTED]
  Sent: Monday, November 08, 2004 2:40 PM
  To: 'Tomcat Users List'
  Subject: ClassLoader question
  
  What is the difference between the server/lib and shared
  directories as
  far
  as the class loaders are concerned?
  
  Background:
  ---
  I was having trouble with CGI scripts, so I wanted to creat a new
  CGIServlet to run some tests.  To start the process, I 
  copied source of
  the tomcat CGIServlet file into my own package structure.
  Once I got
  this working
  I
  would alter that code and try to see why the CGI scripts where not
  executing correctly.
  
  Part I Don't Understand:
  ---
  I put my jar file containing the CGIServlet into the server/lib
  directory
  (where the tomcat CGIServlet resides).  This, however, would
  not start
  up
  and gave me ClassNotFound exceptions.  However, when I moved
  my jar to
  the
  shared directory, everything seems to work.
  
  Question:
  -
  I thought everything had access to things in the server/lib
  directory.
  What is going on here?
  
  Thanks,
  Mark
  
  
  Confidentiality Notice:  OCIESERVICE
  
 -
  The contents of this e-mail message and any attachments 
 are intended
  solely for the addressee(s) named in this message. This 
  communication
  is intended to be and to remain confidential.  If you are not the
  intended recipient of this message, or if this message has been 
  addressed to you in error, please immediately alert the 
  sender by reply
  e-mail and then delete this message and its attachments. Do not
  deliver, distribute, copy, disclose the contents or take any 
  action in
  reliance upon the information contained in the communication or any
  attachments.
  -
  Mark Claassen
  Donnell Systems, Inc.
  300 S. St. Louis Blvd. Ste. 203
  South Bend, IN 46617
  E-mail: mailto:[EMAIL PROTECTED]
  Voice: (574)232-3784
  Fax: (574)232-4014
  
  
  
  
  
 -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: 
 [EMAIL PROTECTED]
  
  
  
  
  This e-mail, including any attachments, is a confidential
  business communication, and may contain information that is 
  confidential, proprietary and/or privileged.  This e-mail is 
  intended only for the individual(s) to whom it is addressed, 
  and may not be saved, copied, printed, disclosed or used by 
  anyone else.  If you are not the(an) intended recipient, 
  please immediately delete this e-mail from your computer 
  system and notify the sender.  Thank you.
  
  
  
 -
  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]



Problems setting up JDBCStore

2004-11-08 Thread Jeremy Nix
I'm having a little difficulty setting up the JDBCStore session
persistence layer.  Has anybody had a similar problem?  Or do you see
anyting wrong in my configuration.  Here's the error that I'm getting:

2004-11-08 15:32:11 JDBCStore[/test]: The database connection is null or
was found to be closed. Trying to re-open it.

My server.xml looks like this:

Server port=8005 shutdown=SHUTDOWN debug=0

  !-- Uncomment these entries to enable JMX MBeans support --
  Listener
className=org.apache.catalina.mbeans.ServerLifecycleListener
debug=0/
  Listener
className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener
debug=0/

!-- Global JNDI resources --
GlobalNamingResources

!-- 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
/Resource
ResourceParams name=UserDatabase
parameter
namefactory/name

valueorg.apache.catalina.users.MemoryUserDatabaseFactory/value
/parameter
parameter
namepathname/name
valueconf/tomcat-users.xml/value
/parameter
/ResourceParams
/GlobalNamingResources
  
!-- Define the Tomcat Stand-Alone Service --
Service name=Catalina

!-- Define a non-SSL Coyote HTTP/1.1 Connector on port
80 --
Connector
className=org.apache.coyote.tomcat5.CoyoteConnector
address=10.0.2.130 port=80 
maxThreads=150
minSpareThreads=25 maxSpareThreads=75
enableLookups=false
redirectPort=443 acceptCount=100
debug=0 scheme=http
connectionTimeout=2
disableUploadTimeout=true /

!-- Define a SSL Coyote HTTP/1.1 Connector on port 443
--
Connector
className=org.apache.coyote.tomcat5.CoyoteConnector
address=10.0.2.130 port=443 
maxThreads=150
minSpareThreads=25 maxSpareThreads=75
enableLookups=false
redirectPort=443 acceptCount=100
debug=0 scheme=https
secure=true connectionTimeout=2
disableUploadTimeout=true
Factory
className=org.apache.coyote.tomcat5.CoyoteServerSocketFactory
clientAuth=false
protocol=TLS

keystoreFile=certs/phoenix.keystore
keystorePass=alpine /
/Connector

!-- Define the top level container in our container
hierarchy --
Engine name=Standalone defaultHost=10.0.2.130
debug=9 jvmRoute=tomcat1

!-- This Realm uses the UserDatabase configured
in the global JNDI
  resources under the key
UserDatabase.  Any edits
  that are performed against this
UserDatabase are immediately
  available for use by the Realm.  --
Realm
className=org.apache.catalina.realm.UserDatabaseRealm
debug=0
resourceName=UserDatabase/

  !-- Global logger unless overridden at lower
levels --
  Logger
className=org.apache.catalina.logger.FileLogger
  directory=logs
prefix=catalina_log. suffix=.txt
  timestamp=true
verbosity=4/

!-- Define the default virtual host --
Host name=10.0.2.130 debug=0
appBase=webapps
unpackWARs=true
autoDeploy=false
Aliastestphoenix.sfsltd.com/Alias

!--Log stdout/stderr of host and
applications--
Logger
className=org.apache.catalina.logger.FileLogger
directory=logs
prefix=phoenix_log. suffix=.txt
timestamp=true
verbosity=4/

!-- Log Access to host site --
Valve
className=org.apache.catalina.valves.AccessLogValve
directory=logs
prefix=phoenix_access_log. 

Server.xml optimization question.

2004-11-08 Thread Mufaddal Khumri
Hi,
I have got the following connector in my server.xml file:
Connector port=9090
   maxThreads=150 minSpareThreads=25 
maxSpareThreads=75
   enableLookups=false redirectPort=8443 
acceptCount=100
   debug=0 connectionTimeout=2
   disableUploadTimeout=true /

I am trying to do some performance tune up and would like to see the 
effects of changing values of the attributes above. Are there any 
comprehensive webpages, documents regarding how to optimize the 
performance of your webapp by tweaking the server.xml parameters 
available somewhere?

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


Re: Accessing resource in WEB-INF outside servlet

2004-11-08 Thread Steven J. Owens
David Evans wrote:
 so how do you handle this? do you pass in the connection info to every
 DAO method, like this:
 public static Book getBook(String connection, String bookId)
 public static void updateBook(String connection, Book book)
 that seems tedious, and since the all of my database

On Mon, Nov 08, 2004 at 09:35:25AM -0500, Shapira, Yoav wrote:
 You can have the beans get a datasource (from a singleton possibly) and
 call its getConnection method.  To encapsulate further, you can just
 expose a getConnection method on said singleton.  That way only one
 class needs to worry about database configuration.  And you have only
 one place to change if you switch from a Class#getResource approach to a
 JNDI one or vice versa.

 That's pretty much the approach I took - I have a singleton
Database class that primarily serves as a single point to get database
connections.  I have separate bean and bean-to-db-mapping classes for
each table.  The bean-to-db-mapping classes grab their connections via
Database.getInstance().getConnection().  The Database singleton loads
a properties file and keeps it as an instance variable, to get the
connection config variables (David, see below for further discussion).

 This worked at the time, and I had bigger problems to worry
about.  The properties file grew into being the source of all of the
application configuration variables.  This works well enough so far,
though it really seems like Properties ought to be a separate
singleton, and that's on my list of things to refactor.

 However, there are other issues that bug me in this setup (mainly
that everybody tells me that deploying and upgrading works much, much
better if you use a WAR file, see my earlier post, Re: Configuration
Management, JSP Compiles, WAR files), so I'm interested in exploring
alternatives.

 The best approach I've come up with so far (based on suggestions
here) is pretty much keeping a singleton config object, except that
the config file is loaded from a file that lives outside the webapp,
passed in via a resource ref defined in server.xml.  One JNDI hit to
load the file, stays in memory after.

 (Oh, and I'm switching to an XML-based config file instead of
properties.  I'm also considering splitting the config up into
multiple files, since a small subset change often, a medium subset
change somewhat often, and the remainder change hardly ever).

Further Discussion

 This approach still leaves the dependency on the properties
singleton AND on the connection singleton hardwired into the mapping
classes.  For David's purposes, sounds like you may want to apply the
buzz-word-du-jour, Inversion of Control or Dependency Injection.

- make an interface, something like ConnectionFactory
- make a singleton that implements ConnectionFactory
- add a constructor to each bean (or to the separate mapper object)
  that takes a ConnectionFactory as a reference.

 So you inject the dependency into the bean, or into the mapper.
At the higher level, you have some setup class that injects the
dependencies into various factory singletons, that then inject them
into the beans or mappers they dispense.

 Let's sort out that bean/mapper question first.  Like I said
above, I have a separate bean and bean-to-db mapper class for each
table.  The mapper class has select, insert, update and delete
methods.  Each takes a bean of the same time as an argument and uses
that to construct the query (WHERE clause for selects, UPDATE clause
for updates, etc).  The select method has two flavors, one that
returns a bean for the first row, another that returns a List of
beans.

 For my reasons on why I set it up that way, see below in the
Even Further Discussion section.

 Any way you slice it, we now come to the question of where the
dependency gets injected - how the ConnectionFactory reference gets to
somewhere the mapping method can find it.  You have a single source of
Connections, and you have a set of DBMappers that are designed to take
those connections.

 Looking at it logically, you only have a few options:

1) instantiate each DBMapper with a Connection reference
2) instantiate each DBMapper with a ConnectionFactory reference
3) create a DBMapperFactory and instantiate with a ConnectionFactory
   reference (probably at some early app-wide setup point), then:
   3a) dispense DBMappers with a Connection reference
   3b) dispense DBMappers with a ConnectionFactory reference
   3c) dispense DBMappers with a DBMapperFactory reference (e.g.:
   getDBMapperFactory().getConnectionFactory().getConnection())
4) move the actual database-interaction methods off to some generic
   database interaction class, and keep the Beans and Mappers pretty
   much ignorant of things like Connection.
5) dependency injection: have an outside class set up all of the
   factories and cross-wire them with references to each other
   as appropriate.
  
 In general, I'd say the design tension is between 

Re: Renaming WAR problem

2004-11-08 Thread Tim Penhey
Andrew Watters wrote:
In this case the webapps directory is entirely empty, I delete the 
ROOT folder as part of the publish procedure and there are no other 
apps configured except for the manager and admin ones.
What about the XML configuration file in 
$TOMCAT_HOME/conf/Catalina/localhost
Does it specify the name of the correct war file?

As Yoav mentioned, look at the Host element in the /conf/server.xml 
file.  Specifically the values for unpackWARs and autoDeploy.

Tim

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


Re: url-pattern with Basic Auth

2004-11-08 Thread Peter Lin
hehe, I did a search of spec 2.2 and 2.3 on url-pattern and didn't
find the definition. I guess I'll have to look at earlier specs for
the definition. either that or I missed it.

peter



On Mon, 8 Nov 2004 14:22:36 -0600, Mike Curwen
[EMAIL PROTECTED] wrote:
 I'd think url-pattern elements (regardless of where they appear) need to
 conform to the url-patterns specified in the spec (not sure of section).
 
 paths: starting with '/' and ending with '/*'
 extensions:  '*.foo'
 exact: exact matching.
 
 The url-pattern I've left from your original message doesn't match any of
 these.
 
 
 
 
  -Original Message-
  From: Peter Lin [mailto:[EMAIL PROTECTED]
  Sent: Monday, November 08, 2004 1:57 PM
  To: tomcat-user
  Subject: url-pattern with Basic Auth
 
url-pattern/AuthServlet?*param1=account1*/url-pattern
 
  I tried it and cross-referenced the servlet spec. It doesn't
  appear to say if this is allowed or not. Anyone know?
 
  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]



RE: CGI ...yeah, I know (Tomcat 4.1.29)

2004-11-08 Thread Mark Thomas
I think you have run into
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24478 

Sorry - this was entirely my fault and has since been fixed. To get around this
you can take the servlets-cgi.jar from an earlier/later release if you don't
want to upgrade your entire server.

Again, please accept my apologies.

Mark

 -Original Message-
 From: Mark Claassen [mailto:[EMAIL PROTECTED] 
 Sent: Monday, November 08, 2004 3:17 PM
 To: 'Tomcat Users List'
 Subject: RE: CGI ...yeah, I know (Tomcat 4.1.29)
 
 Thanks for the reply.  We have the debug set to 6 already.  
 We found that it
 almost seems to alternate with the following error.  The 
 script is there,
 accessible, and executable by the user tomcat is running as.  
 We are not
 using a security manager.  One puzzling thing is that the 
 following path has
 two sets of quotes, but I was thinking that was just an error 
 in the log
 message.  We altered the program so that the first line of the program
 touches a file so we can see if it ran at all.  It does not, 
 and we get
 either the No such file error or the Broken Pipe one.  
 Perhaps, though,
 the quotations are the crux of it all.
 
 In the localhost log we have:
 2004-11-08 10:06:13 cgi: findCGI:
 currentLoc=/opt/OCIEsys/tomcat/WEB/webapps/ROOT/WEB-INF/cgi
 2004-11-08 10:06:13 cgi: findCGI:
 currentLoc=/opt/OCIEsys/tomcat/WEB/webapps/ROOT/WEB-INF/cgi
 2004-11-08 10:06:13 cgi: findCGI: FOUND cgi at
 /opt/OCIEsys/tomcat/WEB/webapps/ROOT/WEB-INF/cgi/MRlogin.pl
 2004-11-08 10:06:13 cgi: findCGI calc: name=MRlogin.pl,
 path=/opt/OCIEsys/tomcat/WEB/webapps/ROOT/WEB-INF/cgi/MRlogin.pl,
 scriptname=/MRcgi/MRlogin.pl, cginame=/MRlogin.pl
 2004-11-08 10:06:13 cgi: runCGI(envp= ...
 2004-11-08 10:06:13 cgi: runCGI (stderr):Can't open perl script
 /opt/OCIEsys/tomcat/WEB/webapps/ROOT/WEB-INF/cgi/MRlogin.pl
: No such
 file or directory 2004-11-08 10:06:13 cgi: runCGI: 1 lines received on
 stderr
 
  -Original Message-
  From: Phillip Qin [mailto:[EMAIL PROTECTED] 
  Sent: Friday, November 05, 2004 5:20 PM
  To: 'Tomcat Users List'
  Subject: RE: CGI ...yeah, I know (Tomcat 4.1.29)
  
  
  Enable cgiservlet log (I usually set debug to 6) and see 
  what's output in the log (very detail).
  
  -Original Message-
  From: Mark Claassen [mailto:[EMAIL PROTECTED] 
  Sent: November 5, 2004 5:07 PM
  To: 'Tomcat Users List'
  Subject: CGI ...yeah, I know (Tomcat 4.1.29)
  
  
  I know that Tomcat is not an ideal CGI server, but I am 
  having real trouble getting it to work at all.  Most often I 
  get the Exception below, and it doesn't seem to be running 
  our perl program at all.  (We can run the perl program by 
  hand though).  We had a bit of trouble getting it setup in 
  the first place, and we got errors way different from this.  
  I figured that since we were getting this, we must have 
  everything else setup correctly.
  
  Looking at the 4.1.27 source this is:
  1686: commandsStdIn.flush();
commandsStdIn.close();
  commandsStdIn is the output stream to the process.
  
  Anyone have any ideas on where to start looking?
  
  Thanks,
  Mark
  
  java.io.IOException: Broken pipe
  at java.io.FileOutputStream.writeBytes(Native Method)
  at java.io.FileOutputStream.write(FileOutputStream.java:257)
  at
  
 java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:69)
  at 
  java.io.BufferedOutputStream.flush(BufferedOutputStream.java:127)
  at 
  java.io.BufferedOutputStream.flush(BufferedOutputStream.java:128)
  at
  org.apache.catalina.servlets.CGIServlet$CGIRunner.run(CGIServl
  et.java:1686)
  
  
  
  
 -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  !DSPAM:418bf9fd252211451334454!
  
 
 
 
 -
 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: url-pattern with Basic Auth

2004-11-08 Thread Shapira, Yoav

Hi,
It's SRV.11.2 in the Spec, and org.apache.tomcat.util.http.mapper.Mapper
in the Tomcat source code.

Yoav Shapira http://www.yoavshapira.com


-Original Message-
From: Peter Lin [mailto:[EMAIL PROTECTED]
Sent: Monday, November 08, 2004 4:27 PM
To: Tomcat Users List
Subject: Re: url-pattern with Basic Auth

hehe, I did a search of spec 2.2 and 2.3 on url-pattern and didn't
find the definition. I guess I'll have to look at earlier specs for
the definition. either that or I missed it.

peter



On Mon, 8 Nov 2004 14:22:36 -0600, Mike Curwen
[EMAIL PROTECTED] wrote:
 I'd think url-pattern elements (regardless of where they appear) need
to
 conform to the url-patterns specified in the spec (not sure of
section).

 paths: starting with '/' and ending with '/*'
 extensions:  '*.foo'
 exact: exact matching.

 The url-pattern I've left from your original message doesn't match
any of
 these.




  -Original Message-
  From: Peter Lin [mailto:[EMAIL PROTECTED]
  Sent: Monday, November 08, 2004 1:57 PM
  To: tomcat-user
  Subject: url-pattern with Basic Auth
 
url-pattern/AuthServlet?*param1=account1*/url-pattern
 
  I tried it and cross-referenced the servlet spec. It doesn't
  appear to say if this is allowed or not. Anyone know?
 
  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]




This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


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



Re: Configuration Management, JSP Recompiles, War Files

2004-11-08 Thread Peter Johnson
Hi Steven,
We run 5 Tomcat servers (still on 4.1.x so not clustered) and use CVS 
with two tags: 'stage' and 'prod'. When a push script is executed the 
server pulls the appropriate version from cvs and then performs an ant 
task to deploy the app, compiling any changed classes. We find that this 
works just fine and haven't really had any issues.

Check that you are using jsp:include ... (include on execute) rather 
than @ include ... (include on compile) as this *may* be causing the 
issue.

Just out of curiousity why are you are deploying individual apps if they 
are so similar? Why don't you just implement a branding infrastructure 
and run a single app with multiple brandings? 

Just a thought ...
PJ
Steven J. Owens wrote:
Hi folks,
I'm interested in hearing how people are dealing with
configuration management issues.
We've been running into some problems with JSP recompiles,
particularly when the changed JSP is an included JSP.  Tomcat seems to
sort of get stuck on the old version, even if we restart tomcat it
doesn't reload.  Manually deleting the foo_jsp.java and foo_jsp.class
files from the tomcat/working/etc directory and *then* restarting
seems to do the trick.
Somebody I talked to suggested that using a WAR file and
redeploying would make tomcat more reliably recompile the JSPs.
I've been meaning to move to using WAR files sooner or later, but
one question has always bugged me - how do you save your
deployment-specific configuration info?  

If I understand correctly, WAR file is just a glorified JAR file,
which in turn is just a glorified tar file.  So unless you're
unjarring it, editing the config file and rejarring it, you can't
really muck with the config settings inside it.  How/where do people
normally keep the configuration variables for the webapp?
We have a single tomcat installation with a dozen
almost-identical webapps, one webapp for each customer.  When we do
our jobs right, each app is in fact identical, except for:
- two colors in the app-wide CSS stylesheet
- the customer's logo image
- the CONTEXT tags in server.xml
- a few details of the web.xml file (webapp name, database resource name)
- a properties file with a couple dozen configuration properties
- a separate database in the mysql server
We extend and refine the application constantly, so we're
changing the code every month or two.  So far we've been using cvs to
manage this.  Each webapp is a cvs checkout ; the specific files
mentioned above exist in template form in the checkout
(e.g. web_template.xml, styles_template.css) that we copy into the
right name for deployment and then edit, so they don't get overwritten
by cvs.
Using cvs worked pretty well for a while, but it's gotten
unwieldly, especially when we run into the JSP recompiling problem,
because then we have to restart the entire server to try to get it to
recompile the jsp.
This reminds me of another question; I'm beginning to wonder if
we wouldn't be wiser to use a dozen separate tomcat installations.  I
know that in theory using the same tomcat installation for multiple
webapps is supposed to be standard, but any time we have to tweak
the server.xml-level configuration of a single webapp, we have to
restart all of them.  How do people normally deal with this?  Is it
at all common to run multiple tomcat servers behind apache for this
sort of purpose?
 


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


RE: session-timeout means tomcat restart

2004-11-08 Thread Steve Kirk
Sorry for not replying sooner, I've been busy for a few days.

Can you say more about the crashing?  Any evidence from the logs?  A bit
difficult to be any more specific without more to go on really :)

 However, I
  have references to them from the controller so that shouldn't be the
  problem... eh?

You mention controller. Are you using TC as-is, or are you using a
framework such as struts or JSF by any chance?

If you suspect that the problem is triggered by a closing session, why not
try shortening the session timeout to a shorter length and see if it crashes
quicker?  In fact, it's worth checking whether the crash is around the time
of the session expiry or not.  If not, then your problem may not be directly
caused by TC at all.?

Do you have any event listeners?  If you have one for
sessionDestroyed/sessionWillPassivate, what does this code do?

 -Original Message-
 From: Eric Wulff [mailto:[EMAIL PROTECTED] 
 Sent: Saturday 06 November 2004 00:51
 To: Steve Kirk
 Cc: Tomcat Users List
 Subject: Re: session-timeout means tomcat restart
 
 
 Well, this is amazingly frustrating.  My TC 5.0.28 running on Linux
 FC2 is completely crashing about every half hr when I have a webapp
 open and don't interact with it.  I no longer have a time-out element
 in my web.xml so that doesn't seem to matter.  TC shutdown and restart
 does not work.  Instead, I'm required to hard boot my machine.  I'm
 hung just trying to access the static welcome page of any app,
 although I do know that init() of the webapp I'm working on is being
 called.
 
 Eric 
 
 
 On Fri, 5 Nov 2004 15:43:28 -0800, Eric Wulff 
 [EMAIL PROTECTED] wrote:
  Linux FC2
  TC 5.0.28
  
  I'm not storing a db object within a session although I am storing
  objs within the session(of course - session.setAttribute).  
 However, I
  have references to them from the controller so that shouldn't be the
  problem... eh?
  
  An interesting thing, I sometimes have to reboot my 
 machine, not just
  restart TC.  Although other apps run fine, I have to reboot 
 my machine
  in order to get TC up again.
  
  I optimized my db connection, I did have it in servlet init().
  Although I knew I had to do this and I'm much better off 
 for it, and I
  appreciate you're noting it, but this didn't eliminate the crashing
  problem.
  
  I also am now taking advantage of a connection pool.  
 However, as you
  figured, that does not solve the crash problem.
  
  Finally, I removed the session-configsession-timeout 
 element from
  myapp web.xml to test if this is the initiator of the problem.  Let
  you know what I find.  Still, even if this is what initiates the
  sequence leading to a crash, it shouldn't so something need be
  fixed/optimized.  Any other ideas?
  
  Eric
  
  
  
  
  On Fri, 5 Nov 2004 13:03:27 -, Steve Kirk
  [EMAIL PROTECTED] wrote:
  
  
  
  
-Original Message-
From: Eric Wulff [mailto:[EMAIL PROTECTED]
Sent: Friday 05 November 2004 07:01
To: Tomcat Users List
Subject: session-timeout means tomcat restart
   
   
Hi, I'm experiencing 2 interesting problems that may be 
 related to my
session timeout.
   
1.  It seems that when my session times out I need to 
 restart tomcat,
often just the application via reload in the manager, 
 in order to gain
access to my db again.  Could this be because I've been 
 accessing the
db via jdbc hard coded in the servlet?  Might using a datasource
connection pool take care of this?
  
   I would say that rather than the problem being JDBC 
 hardcoded in the
   servlet, the problem is more likely to be _how_ that code 
 is written.
  
   if it really is the session timeout that is causing this, 
 it sounds to me
   like you are storing the database objects within a 
 session object (which
   seems a bit unusual).  or at least the last reference to 
 them is stored
   there, so that when the session is destroyed, the 
 database connection is
   lost.  it might be better to store the objects in local 
 variables within
   doPost if your servlet is simple, or if it's more 
 complex, then perhaps
   better places to put them would be the servlet context, 
 or a field of the
   servlet class/instance.  it all depends on your 
 particular situation.
   whichever you choose though, you must make sure that 
 connections are closed
   (or returned to the pool) when you have finished with 
 them.  this generally
   involves careful use of try/catch/finally.
  
   if restarting the webapp fixes the problem, it could be 
 that your database
   objects are initialised in the servlet init() method, 
 which is then called
   again when the webapp restarts.  but if this were the 
 case then I'm not sure
   how session timeout could cause the problem that you describe.
  
   datasource connection pooling is not necessarily the 
 answer.  you can still
   use up all your database resources and/or leave them 
 hanging whether you
   pool them or not!
  
2.  

Re: RE: session-timeout means tomcat restart

2004-11-08 Thread agidden
We had a 'hung, and won't work without a reboot problem' and it
was two things - we had to update some driver for the intel NIC cards in our
server (for RedHat ES) and had to change some settings to get better NIC
throughput.

Hope it helps.

- Original Message -
From: Steve Kirk [EMAIL PROTECTED]
Date: Monday, November 8, 2004 4:19 pm
Subject: RE: session-timeout means tomcat restart

 Sorry for not replying sooner, I've been busy for a few days.
 
 Can you say more about the crashing?  Any evidence from the logs?  
 A bit
 difficult to be any more specific without more to go on really :)
 
  However, I
   have references to them from the controller so that shouldn't 
 be the
   problem... eh?
 
 You mention controller. Are you using TC as-is, or are you using a
 framework such as struts or JSF by any chance?
 
 If you suspect that the problem is triggered by a closing session, 
 why not
 try shortening the session timeout to a shorter length and see if 
 it crashes
 quicker?  In fact, it's worth checking whether the crash is around 
 the time
 of the session expiry or not.  If not, then your problem may not 
 be directly
 caused by TC at all.?
 
 Do you have any event listeners?  If you have one for
 sessionDestroyed/sessionWillPassivate, what does this code do?
 
  -Original Message-
  From: Eric Wulff [EMAIL PROTECTED] 
  Sent: Saturday 06 November 2004 00:51
  To: Steve Kirk
  Cc: Tomcat Users List
  Subject: Re: session-timeout means tomcat restart
  
  
  Well, this is amazingly frustrating.  My TC 5.0.28 running on Linux
  FC2 is completely crashing about every half hr when I have a webapp
  open and don't interact with it.  I no longer have a time-out 
 element in my web.xml so that doesn't seem to matter.  TC 
 shutdown and restart
  does not work.  Instead, I'm required to hard boot my machine.  I'm
  hung just trying to access the static welcome page of any app,
  although I do know that init() of the webapp I'm working on is being
  called.
  
  Eric 
  
  
  On Fri, 5 Nov 2004 15:43:28 -0800, Eric Wulff 
  [EMAIL PROTECTED] wrote:
   Linux FC2
   TC 5.0.28
   
   I'm not storing a db object within a session although I am storing
   objs within the session(of course - session.setAttribute).  
  However, I
   have references to them from the controller so that shouldn't 
 be the
   problem... eh?
   
   An interesting thing, I sometimes have to reboot my 
  machine, not just
   restart TC.  Although other apps run fine, I have to reboot 
  my machine
   in order to get TC up again.
   
   I optimized my db connection, I did have it in servlet init().
   Although I knew I had to do this and I'm much better off 
  for it, and I
   appreciate you're noting it, but this didn't eliminate the 
 crashing  problem.
   
   I also am now taking advantage of a connection pool.  
  However, as you
   figured, that does not solve the crash problem.
   
   Finally, I removed the session-configsession-timeout 
  element from
   myapp web.xml to test if this is the initiator of the problem. 
 Let
   you know what I find.  Still, even if this is what initiates the
   sequence leading to a crash, it shouldn't so something need be
   fixed/optimized.  Any other ideas?
   
   Eric
   
   
   
   
   On Fri, 5 Nov 2004 13:03:27 -, Steve Kirk
   [EMAIL PROTECTED] wrote:
   
   
   
   
 -Original Message-
 From: Eric Wulff [EMAIL PROTECTED]
 Sent: Friday 05 November 2004 07:01
 To: Tomcat Users List
 Subject: session-timeout means tomcat restart


 Hi, I'm experiencing 2 interesting problems that may be 
  related to my
 session timeout.

 1.  It seems that when my session times out I need to 
  restart tomcat,
 often just the application via reload in the manager, 
  in order to gain
 access to my db again.  Could this be because I've been 
  accessing the
 db via jdbc hard coded in the servlet?  Might using a 
 datasourceconnection pool take care of this?
   
I would say that rather than the problem being JDBC 
  hardcoded in the
servlet, the problem is more likely to be _how_ that code 
  is written.
   
if it really is the session timeout that is causing this, 
  it sounds to me
like you are storing the database objects within a 
  session object (which
seems a bit unusual).  or at least the last reference to 
  them is stored
there, so that when the session is destroyed, the 
  database connection is
lost.  it might be better to store the objects in local 
  variables within
doPost if your servlet is simple, or if it's more 
  complex, then perhaps
better places to put them would be the servlet context, 
  or a field of the
servlet class/instance.  it all depends on your 
  particular situation.
whichever you choose though, you must make sure that 
  connections are closed
(or returned to the pool) when you have finished with 
  them.  this generally
involves careful 

question on Creating war file

2004-11-08 Thread Daxin Zuo
I am going to pack the application into a war file. I like to use ant. I
like to ask:

  1) a good document giving instruction. In Tomcat/wabapps/mybase, my app
has: /WEB-INF/classes, WEB-INF/lib
 and I have image folder in Apache/htdocs/images. May I need to move the
images to /WEB-INF?

  2) Where to put the war file. I read a page, telling that user need to
unzip the war file in to webapps. really?

Thanks.


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



Re: Accessing resource in WEB-INF outside servlet

2004-11-08 Thread Dakota Jack
I am not sure where this discussion is coming from or going, but I
have no difficulty with reading resources inside WEB-INF.  First, I
use a Classpath class and the given classloaders something like the
following:

package com.whatever.classpath;

public final class Classpath {
  public static final String HERE = Classpath.
class.
getClassLoader().
   
getResource(com + File.separator +
  
whatever + File.separator +
  
classpath + File.separator +
  
Classpath.class).getFile();
}


Other classes can then use this class and HERE as well as other paths
such as CLASSES, MESSAGES, or whatever, inside WEB-INF.

Is this helpful?

Jack


On Sun, 07 Nov 2004 16:50:37 +0100, Morkeleb [EMAIL PROTECTED] wrote:
 Hi.
 
 I have a file in WEB-INF which I want to access.
 However, this is done in a static class which is not a servlet,
 so I do not have the servlet context.
 
 Is there a way to access the servlet context non the less?
 Is there a way to make getResource find the file anyway?
 
 I know a resource is found when it's in /WEB-INF/classes,
 but it is only in /WEB-INF/ and it is not an option to move
 it to the classes directory.
 
 Can you help me?
 Thanx in Advance,
 Lukas Österreicher
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-- 
You can't wake a person who is pretending to be asleep.

~Native Proverb~

Each man is good in His sight. It is not necessary for eagles to be crows.

~Hunkesni (Sitting Bull), Hunkpapa Sioux~

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



resource defined in web.xml has null attributes but server.xml is ok

2004-11-08 Thread Nishant Deshpande
When I set up a db resource in web.xml and create it, for some reasons
it has null's in its attributes (such as username, url, driverClass,
..).

But when I set up the same resource in server.xml, it works fine.

From the documentation it wasn't clear to me if both need to be set up
the same way. i.e. I use

Resource name=X.../
ResourceParams name=X
parameter . /parameter
/ResourceParams

in server.xml or web.xml, and then create a reference to it using
Resource-ref in web.xml.

Is this the correct way of doing this and if so any ideas on why a
resource defined in web.xml should have null attributes when i get the
object?

Thanks

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



Re: resource defined in web.xml has null attributes but server.xml is ok

2004-11-08 Thread Peter Johnson
Hi,
You need both. You define the resource in the context of the app and 
then link to the resource from the app.

http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html
PJ
Nishant Deshpande wrote:
When I set up a db resource in web.xml and create it, for some reasons
it has null's in its attributes (such as username, url, driverClass,
..).
But when I set up the same resource in server.xml, it works fine.
From the documentation it wasn't clear to me if both need to be set up
the same way. i.e. I use
Resource name=X.../
ResourceParams name=X
parameter . /parameter
/ResourceParams
in server.xml or web.xml, and then create a reference to it using
Resource-ref in web.xml.
Is this the correct way of doing this and if so any ideas on why a
resource defined in web.xml should have null attributes when i get the
object?
Thanks
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 


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


RE: Index.jsp

2004-11-08 Thread Steve Kirk

OK no-one's answered so here's an idea.  Not sure if this is right but maybe
if I get it wrong someone will correct me ;)

I think it's that, despite appearances, you are in fact running a
precompiled servlet class, which is installed by default, rather than a JSP
page via org.apache.jasper.servlet.JspServlet, because of the default
mappings in web.xml. Check webapps/ROOT/WEB-INF/web.xml:

servlet
servlet-nameorg.apache.jsp.index_jsp/servlet-name
servlet-classorg.apache.jsp.index_jsp/servlet-class
/servlet

servlet-mapping
servlet-nameorg.apache.jsp.index_jsp/servlet-name
url-pattern/index.jsp/url-pattern
/servlet-mapping

What I think the above adds up to is that when you access /index.jsp, you
run index_jsp.class directly, which is already installed under the
webapps/ROOT/WEB-INF/classes/org/apache/jsp directory (as well as under
webapps/ROOT/WEB-INF/lib/catalina-root.jar), and the fact that the extension
is jsp is in fact not relevant.  I think the mapping above also overrides
the general mapping in conf/web.xml for JSP mapping/compilation, so that
this jsp won't compile even if you change the page, because TC does not see
it as a JSP.  What I'm not sure about is why the JSP page is included at
all.  Maybe this proves that I've got it completely wrong ;)

 -Original Message-
 From: Luc Vantroys [mailto:[EMAIL PROTECTED] 
 Sent: Saturday 06 November 2004 17:52
 To: Tomcat Users List
 Subject: Index.jsp
 
 
 Hi,
 
 When I modify this file, I don't see the changes in the 
 browser when I start
 Tomcat 5.0.28...
 but when I just launch that file from my hard drive, I see 
 the changes. What
 do I need to do?
 
 Thanks,
 
 Luc.
 
 
 -
 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 fix: Tomcat responce time gets to 10-200 seconds once a day

2004-11-08 Thread Steve Kirk
My favourite answer to any query about a server being painfully slow:  does
the slowdown coincide with a slowdown or outage of your DNS service?  This
can have suprisingly big impact if TC is doing reverse lookups of the IP of
every request.

At the risk of asking the obvious, are you sure that some other heavy
process is not kicking off at that time, either on one of the machines you
mention, or some other machine on the network?

 -Original Message-
 From: Roman Zhovtulya [mailto:[EMAIL PROTECTED] 
 Sent: Friday 05 November 2004 18:35
 To: [EMAIL PROTECTED]
 Subject: How to fix: Tomcat responce time gets to 10-200 
 seconds once a day
 
 
 Dear Sirs,
 I wonder if anyone had anything similar before.
 I'm running some JSP/Java Bean websites under Tomcat (on one PC as a
 stand-alone server, on another in connection with Apache).
 
 The website is a dynamic (3-tier architechture) connects to MySQL
 database to get the content to display any page (around 3-4 
 connections
 per page). 
 
 Normally the performance is really good, but about once a day it gets
 really slow (around 1-5 minutes to display the page). It also recovers
 autocatically to normal response time when you simply wait 
 5-10 minutes.
 
 Any ideas?
 
 I'm running Tomcat 4.05 with Apache on RedHat 8.0 (one PC) as well as
 Tomcat 4.127 on SuSE 9.0 with MySQL 4.015.
 
 I'm closing all db-connections in JSP/JavaBeans, so I don't 
 think it's a
 db-issue.
 
 I'd highly appreciate any help on the topic.
 
 Thank you very much,
 Roman Zhovtulya
 
 
 ---
 Roman Y. Zhovtulya
 Manager
 
 InternetServiceCenter
 Fachbereich Medien und Informationswesen
 FH Offenburg
 
 InternetServiceCenter bietet In-House Beratung,
 professionelle und preiswerte Entwicklung von individueller Software
 Lösungen in Bereich Internet, WWW, Datenbanken, etc
 
 
 Kostenlose vor-Ort Istanalyse und Sparpotenzialanalyse für 
 potenzielle
 Kunden.
 
 Sprechen Sie uns an:
 
 InternetServiceCenter
 Offenburg University of Applied Sciences
 Room B205a
 Badstr. 24, Offenburg
 D-77652 Germany
 
 VoIP ID (Skype): romanlutsk (mehr unter www.skype.com)
 Tel.: +49 781 205 137 / Fax: 290
 www.fh-offenburg.de/isc
 
 --- 
 
 
 -
 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 fix: Tomcat responce time gets to 10-200 seconds once a day

2004-11-08 Thread Peter Johnson
Is that 3-4 connections or 3-4 queries? If it isn't a DNS resolution 
issue or another task running on a server (both as mentioned in another 
response) I would suggest you review you DB connection strategy.

Does the slowdown occur at the same time as a higher than normal volume 
of hits?

Consider getting all of the data and dumping to variables *before* 
formatting. If using multiple connections to the DB try reducing to a 
single connection. If using a single connection try implementing a DB 
connection pool.

Other than those things not much comes to mind at the moment.
PJ
Roman Zhovtulya wrote:
Dear Sirs,
I wonder if anyone had anything similar before.
I'm running some JSP/Java Bean websites under Tomcat (on one PC as a
stand-alone server, on another in connection with Apache).
The website is a dynamic (3-tier architechture) connects to MySQL
database to get the content to display any page (around 3-4 connections
per page). 

Normally the performance is really good, but about once a day it gets
really slow (around 1-5 minutes to display the page). It also recovers
autocatically to normal response time when you simply wait 5-10 minutes.
Any ideas?
I'm running Tomcat 4.05 with Apache on RedHat 8.0 (one PC) as well as
Tomcat 4.127 on SuSE 9.0 with MySQL 4.015.
I'm closing all db-connections in JSP/JavaBeans, so I don't think it's a
db-issue.
I'd highly appreciate any help on the topic.
Thank you very much,
Roman Zhovtulya
---
Roman Y. Zhovtulya
Manager
InternetServiceCenter
Fachbereich Medien und Informationswesen
FH Offenburg
InternetServiceCenter bietet In-House Beratung,
professionelle und preiswerte Entwicklung von individueller Software
Lösungen in Bereich Internet, WWW, Datenbanken, etc

Kostenlose vor-Ort Istanalyse und Sparpotenzialanalyse für potenzielle
Kunden.
Sprechen Sie uns an:
InternetServiceCenter
Offenburg University of Applied Sciences
Room B205a
Badstr. 24, Offenburg
D-77652 Germany
VoIP ID (Skype): romanlutsk (mehr unter www.skype.com)
Tel.: +49 781 205 137 / Fax: 290
www.fh-offenburg.de/isc
--- 

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


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


Tomcat in server mode question

2004-11-08 Thread Mufaddal Khumri
Hi,
I am trying to run Tomcat 5.0.27 in server mode on a Win XP 
Professional machine.

Tomcat is installed as a service on this box. I can start and stop it 
and everything works fine. As soon as I specify the -server option 
Tomcat wont start

I do this by right clicking on the tomcat service icon and selecting 
Configure -- Java: Java options and add the -server option there.

Am I doing this right or am i missing something?
Thanks.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: resource defined in web.xml has null attributes but server.xml is ok

2004-11-08 Thread Nishant Deshpande
So - I cannot *not* define a resource at the server level (i.e. not
touch the server.xml or any  other server configuration file) and only
define it in the app configuration files - i.e. web.xml ?

It seems like thats what you are saying below - just want to be sure I
understand clearly.

Thanks



On Tue, 09 Nov 2004 10:11:27 +1100, Peter Johnson [EMAIL PROTECTED] wrote:
 Hi,
 
 You need both. You define the resource in the context of the app and
 then link to the resource from the app.
 
 http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html
 
 PJ
 
 
 
 Nishant Deshpande wrote:
 
 When I set up a db resource in web.xml and create it, for some reasons
 it has null's in its attributes (such as username, url, driverClass,
 ..).
 
 But when I set up the same resource in server.xml, it works fine.
 
 From the documentation it wasn't clear to me if both need to be set up
 the same way. i.e. I use
 
 Resource name=X.../
 ResourceParams name=X
 parameter . /parameter
 /ResourceParams
 
 in server.xml or web.xml, and then create a reference to it using
 Resource-ref in web.xml.
 
 Is this the correct way of doing this and if so any ideas on why a
 resource defined in web.xml should have null attributes when i get the
 object?
 
 Thanks
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


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



Datasource problems on Tomcat 5.5.4

2004-11-08 Thread Mark Fleischman
Hello,

 

After upgrading from Tomcat 5.0.27 to Tomcat 5.5.4 my JNDI datasources are
not resolving in 5.5.4

 

I tried 2 approaches which both work in Tomcat 5.0.27. I am using the same
configuration on the 5.5.4 version (that is my libraries and context files
have not changed)

 

1)   DBCP with MySql

2)   c3p0 with MySql

 

With DBCP I get:

 

 JDBC driver of class '' for connect URL 'null'

 

With c3p0 I get:

 

 javax.naming.NamingException: Cannot create resource instance

 

 

I am more interested in resolving the c3p0 JNDI datasource setup. So let me
share that setup:

 

Here are the details of what I am running:

 

c3p0-0.8.5pre4

mysql-connector-java-3.0.15-ga-bin

JDK 1.5.0

Tomcat 5.5.4

On Windows

 

Inside of common/lib I have placed the above JDBC related libraries.

 

Here is my context file (which is placed in the conf\Catalina\localhost
directory):

 

 

 Context path=/myapp docBase=myapp.war

debug=5 reloadable=true override=true crossContext=true

   

  Resource name=jdbc/DCCDS auth=Container

type=com.mchange.v2.c3p0.ComboPooledDataSource/ 

 

  ResourceParams name=jdbc/DCCDS 

  parameter 

  namefactory/name 

  valueorg.apache.naming.factory.BeanFactory/value 

  /parameter 

  parameter 

  namedriverClass/name 

  valuecom.mysql.jdbc.Driver/value 

  /parameter 

  parameter 

  namejdbcUrl/name 

 
valuejdbc:mysql://192.168.1.60:3306/dcc_dev?autoReconnect=true;/value 

  /parameter 

  parameter 

  nameuser/name 

  valuemark/value 

  /parameter 

  parameter 

  namepassword/name 

  valuexxx/value 

  /parameter 

  parameter 

  nameminPoolSize/name 

  value5/value 

  /parameter 

  parameter 

  namemaxPoolSize/name 

  value15/value 

  /parameter 

  parameter 

  nameacquireIncrement/name 

  value5/value 

  /parameter 

  /ResourceParams  

   

 

/Context

 

Here the relevant part of the web.xml file:

 

  resource-ref

  descriptionDB Connection On My Sql/description

  res-ref-namejdbc/DCCDS/res-ref-name

  res-typejavax.sql.DataSource/res-type

  res-authContainer/res-auth

  /resource-ref

 

 

When I make the following call in java:

 

envCtx.lookup(jdbc/DCCDS); 

 

I get the exception:

 

javax.naming.NamingException: Cannot create resource instance
 
org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.
java:132)
javax.naming.spi.NamingManager.getObjectInstance(Unknown Source)

 

Any help would be greatly appreciated.

 

Thanks,

Mark

 



RE: Index.jsp

2004-11-08 Thread Ben Souther
Steve's answer is correct.

You can either delete the servlet and servlet-mapping entries in
/webapps/ROOT/WEB-INF/web.xml

or start your own context.

If you're interested, I've got some simple example apps at
http://www.souther.us/simple that you can download and run.
They're all war files that just need to be dropped into the webapps
directory of a running Tomcat instance.  SimpleJSP is a Hello, World
app that you could use to get started playing with JSPs.



On Mon, 2004-11-08 at 18:11, Steve Kirk wrote:
 OK no-one's answered so here's an idea.  Not sure if this is right but maybe
 if I get it wrong someone will correct me ;)
 
 I think it's that, despite appearances, you are in fact running a
 precompiled servlet class, which is installed by default, rather than a JSP
 page via org.apache.jasper.servlet.JspServlet, because of the default
 mappings in web.xml. Check webapps/ROOT/WEB-INF/web.xml:
 
 servlet
 servlet-nameorg.apache.jsp.index_jsp/servlet-name
 servlet-classorg.apache.jsp.index_jsp/servlet-class
 /servlet
 
 servlet-mapping
 servlet-nameorg.apache.jsp.index_jsp/servlet-name
 url-pattern/index.jsp/url-pattern
 /servlet-mapping
 
 What I think the above adds up to is that when you access /index.jsp, you
 run index_jsp.class directly, which is already installed under the
 webapps/ROOT/WEB-INF/classes/org/apache/jsp directory (as well as under
 webapps/ROOT/WEB-INF/lib/catalina-root.jar), and the fact that the extension
 is jsp is in fact not relevant.  I think the mapping above also overrides
 the general mapping in conf/web.xml for JSP mapping/compilation, so that
 this jsp won't compile even if you change the page, because TC does not see
 it as a JSP.  What I'm not sure about is why the JSP page is included at
 all.  Maybe this proves that I've got it completely wrong ;)
 
  -Original Message-
  From: Luc Vantroys [mailto:[EMAIL PROTECTED] 
  Sent: Saturday 06 November 2004 17:52
  To: Tomcat Users List
  Subject: Index.jsp
  
  
  Hi,
  
  When I modify this file, I don't see the changes in the 
  browser when I start
  Tomcat 5.0.28...
  but when I just launch that file from my hard drive, I see 
  the changes. What
  do I need to do?
  
  Thanks,
  
  Luc.
  
  
  -
  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]



jndi realm filter problem

2004-11-08 Thread Xavier Renard
Hi,
I'm using the Debian package of tomcat (4.1.30) with ldap auth with the 
following config:

myapplication.xml
--
Context path=/myapplication docBase=/path/2/build
Realm   className=org.apache.catalina.realm.JNDIRealm debug=99
connectionURL=ldap://localhost:389;
connectionName=uid=tomcatproxy,dc=example,dc=org
connectionPassword=tomcatpwd
roleName=cn
roleBase=ou=groups,dc=example,dc=org
roleSearch=(memberUid={1})
userBase=ou=people,dc=example,dc=org
userSearch=(uid={0})
userSubtree=true/
 /Context
I have tried it with the tar.gz of tomcat-4.1.30 and tomcat-5.0.28 and 
it works perfectly well.
However,with the debian package, my filter (rolesearch) become (?=undefined)

sample from log
--
conn=7 op=5 SRCH base=ou=groups,dc=example,dc=org scope=1 
filter=(?=undefined)

I have to use the debian package so i can't really change that.
However, before submitting a bug report or write a mail to the 
debian-java mailing-list,
i would like to know if someone could point me in the good direction to 
fix this,ie
where to modify this behaviour if possible or override this realm by 
an other,...

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


Re: resource defined in web.xml has null attributes but server.xml is ok

2004-11-08 Thread Peter Johnson
Almost, you must define it in a context usually app specific rather than 
DefaultContext. The bit that makes it almost is that a context (if not 
DefaultContext) can be defined in the server.xml *or* 
conf/service/engine/app.xml e.g. catalina 
home/conf/Catalina/localhost/test.xml

If deploying as a WAR to Tomcat you would have
WEB-INF/web.xml  *and*
META-INF/context.xml   --- app specific context definition
PJ
Nishant Deshpande wrote:
So - I cannot *not* define a resource at the server level (i.e. not
touch the server.xml or any  other server configuration file) and only
define it in the app configuration files - i.e. web.xml ?
It seems like thats what you are saying below - just want to be sure I
understand clearly.
Thanks

On Tue, 09 Nov 2004 10:11:27 +1100, Peter Johnson [EMAIL PROTECTED] wrote:
 

Hi,
You need both. You define the resource in the context of the app and
then link to the resource from the app.
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html
PJ

Nishant Deshpande wrote:
   

When I set up a db resource in web.xml and create it, for some reasons
it has null's in its attributes (such as username, url, driverClass,
..).
But when I set up the same resource in server.xml, it works fine.
 

From the documentation it wasn't clear to me if both need to be set up
   

the same way. i.e. I use
Resource name=X.../
ResourceParams name=X
parameter . /parameter
/ResourceParams
in server.xml or web.xml, and then create a reference to it using
Resource-ref in web.xml.
Is this the correct way of doing this and if so any ideas on why a
resource defined in web.xml should have null attributes when i get the
object?
Thanks
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

 

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

-
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-timeout means tomcat restart

2004-11-08 Thread Eric Wulff
Hi Steve, sorry for lack of details.  In any case, problem solved.  I
am developing a webapp in the MVC style and was referring to the 'C'
of the MVC when mentioning the controller.   I am using TC as-is
however.  There was a bug in a data source validity check upon login
making it so the data source was not getting re-established if need
be.  Then it would just hang on login.  Not sure why I was often
required to hard boot but it's not longer a problem since I corrected
the data source hook.

Eric



On Mon, 8 Nov 2004 22:19:27 -, Steve Kirk
[EMAIL PROTECTED] wrote:
 Sorry for not replying sooner, I've been busy for a few days.
 
 Can you say more about the crashing?  Any evidence from the logs?  A bit
 difficult to be any more specific without more to go on really :)
 
  However, I
   have references to them from the controller so that shouldn't be the
   problem... eh?
 
 You mention controller. Are you using TC as-is, or are you using a
 framework such as struts or JSF by any chance?
 
 If you suspect that the problem is triggered by a closing session, why not
 try shortening the session timeout to a shorter length and see if it crashes
 quicker?  In fact, it's worth checking whether the crash is around the time
 of the session expiry or not.  If not, then your problem may not be directly
 caused by TC at all.?
 
 Do you have any event listeners?  If you have one for
 sessionDestroyed/sessionWillPassivate, what does this code do?
 
 
 
  -Original Message-
  From: Eric Wulff [mailto:[EMAIL PROTECTED]
  Sent: Saturday 06 November 2004 00:51
  To: Steve Kirk
  Cc: Tomcat Users List
  Subject: Re: session-timeout means tomcat restart
 
 
  Well, this is amazingly frustrating.  My TC 5.0.28 running on Linux
  FC2 is completely crashing about every half hr when I have a webapp
  open and don't interact with it.  I no longer have a time-out element
  in my web.xml so that doesn't seem to matter.  TC shutdown and restart
  does not work.  Instead, I'm required to hard boot my machine.  I'm
  hung just trying to access the static welcome page of any app,
  although I do know that init() of the webapp I'm working on is being
  called.
 
  Eric
 
 
  On Fri, 5 Nov 2004 15:43:28 -0800, Eric Wulff
  [EMAIL PROTECTED] wrote:
   Linux FC2
   TC 5.0.28
  
   I'm not storing a db object within a session although I am storing
   objs within the session(of course - session.setAttribute).
  However, I
   have references to them from the controller so that shouldn't be the
   problem... eh?
  
   An interesting thing, I sometimes have to reboot my
  machine, not just
   restart TC.  Although other apps run fine, I have to reboot
  my machine
   in order to get TC up again.
  
   I optimized my db connection, I did have it in servlet init().
   Although I knew I had to do this and I'm much better off
  for it, and I
   appreciate you're noting it, but this didn't eliminate the crashing
   problem.
  
   I also am now taking advantage of a connection pool.
  However, as you
   figured, that does not solve the crash problem.
  
   Finally, I removed the session-configsession-timeout
  element from
   myapp web.xml to test if this is the initiator of the problem.  Let
   you know what I find.  Still, even if this is what initiates the
   sequence leading to a crash, it shouldn't so something need be
   fixed/optimized.  Any other ideas?
  
   Eric
  
  
  
  
   On Fri, 5 Nov 2004 13:03:27 -, Steve Kirk
   [EMAIL PROTECTED] wrote:
   
   
   
   
 -Original Message-
 From: Eric Wulff [mailto:[EMAIL PROTECTED]
 Sent: Friday 05 November 2004 07:01
 To: Tomcat Users List
 Subject: session-timeout means tomcat restart


 Hi, I'm experiencing 2 interesting problems that may be
  related to my
 session timeout.

 1.  It seems that when my session times out I need to
  restart tomcat,
 often just the application via reload in the manager,
  in order to gain
 access to my db again.  Could this be because I've been
  accessing the
 db via jdbc hard coded in the servlet?  Might using a datasource
 connection pool take care of this?
   
I would say that rather than the problem being JDBC
  hardcoded in the
servlet, the problem is more likely to be _how_ that code
  is written.
   
if it really is the session timeout that is causing this,
  it sounds to me
like you are storing the database objects within a
  session object (which
seems a bit unusual).  or at least the last reference to
  them is stored
there, so that when the session is destroyed, the
  database connection is
lost.  it might be better to store the objects in local
  variables within
doPost if your servlet is simple, or if it's more
  complex, then perhaps
better places to put them would be the servlet context,
  or a field of the
servlet class/instance.  it all depends on your
  particular situation.
whichever you choose though, you must 

RE: connection pooling

2004-11-08 Thread Steve Kirk

Worth clarifyig what we are meaning by DBCP.  The DBCP I was referring to
was the specific implementation of connection pooling that is part of
Jakarta Commons: 
http://jakarta.apache.org/commons/dbcp/ 

There are other pooling implementations which are alternatives to Commons
DBCP.

Some DB drivers included pooling support as-is.  Others do not.  For those
that do not, you need to implement pooling by building code around the
standard driver.  You used to have to do this yourself, but now there is
DBCP to take care of this for you.  DBCP is a wrapper used around a
non-pooling DB driver.

So, hence my question, are you intending to use DBCP, or does your Informix
driver include pooling?

From the JNDI/JDBC guides it appears that you have the choice of using DBCP
or not (although there is one aspect of the docs that seem slightly unclear
on that, which I am going start another thread to clear up).  The configs
are similar.  Personally I have only got the DBCP approach to work, hence my
suggestion of using that, for which you need to include the factory
parameter.  What this does is basically tells TC to call DBCP rather than
your database driver when making a connection - DBCP then calls your DB
driver if and when it needs to.

I think I'm right in saying that if you don't explcitly use DBCP, and your
DB driver does not support pooling, you will end up with non-pooled
connections.  The webapp will still work but you will not have the
advantages of pooling.

In case it helps, here are my ResourceParams.  Note that I have both
factory and driverClassName:

ResourceParams name=jdbc/myDb
parameter
namefactory/name

valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
/parameter
parameter
namedriverClassName/name
valuecom.mysql.jdbc.Driver/value
/parameter
parameter
nameusername/name
valueme/value
/parameter
parameter
namepassword/name
valuesecret/value
/parameter
parameter
 nameurl/name
 valuejdbc:mysql://localhost:3306/myDb/value
/parameter
/ResourceParams


 -Original Message-
 From: Eric Wulff [mailto:[EMAIL PROTECTED] 
 Sent: Friday 05 November 2004 18:34
 To: Steve Kirk
 Cc: Tomcat Users List
 Subject: Re: connection pooling
 
 
 Steve, I am trying to use DBCP(hence the subject of the thread) and I
 believe I have a driver that supports it.  Especially considering that
 the connection works when I wrap my data resource in a DefaultContext
 tag inside a stand alone Engine tag(server.xml), instead of inside a
 Context tag(how all instructions I've followed so far suggest).
 
 This means my driver support DBCP, correct?
 
 The only source code I imagine would help is the code I use to gain
 connection...
 
 Context initialContext = new InitialContext();
 Context context = (Context) initialContext.lookup(java:comp/env);
 DataSource dataSource = (DataSource) context.lookup(jdbc/wms);
 connection = dataSource.getConnection();
 
 I have seen no mention of this factory class parameter you speak of. 
 I'm using TC 5.0.28.  I'll try it.
 
 thx much for your help
 Eric
 
 
 On Fri, 5 Nov 2004 13:30:35 -, Steve Kirk
 [EMAIL PROTECTED] wrote:
  Eric - you are correct,  you do not need both 
 resource-ref and Resource
  (although I've found that having both does not cause a problem).
  
  Back to your problem.
  
  The error message indicates that TC cannot find the Resource.
  
  I'm not sure if you are trying to use DBCP or not (in other 
 words, does the
  informix driver support pooling on its own, or do you in 
 fact need DBCP or
  some other implementation wrapped around it)?  You have
  res-typejavax.sql.DataSource/res-type but do not list 
 the factory class
  under your Resource, e.g. :
  parameter
  namefactory/name
  
 valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
  /parameter
  
  I have not seen any Java source code on this thread, maybe 
 you posted it
  before I started reading it.
  
  Thinking slightly laterally I'll pass on something I 
 learned from Yoav
  recently on this list you don't need to use 
 container-managed resources
  to do connection pooling.  In other words you don't need to 
 set any Resource
  or Context to get it to work.
  
  
  
   -Original Message-
   From: Eric Wulff [mailto:[EMAIL PROTECTED]
   Sent: Friday 05 November 2004 05:57
   To: Tomcat Users List; Atishay Kumar
   Subject: Re: connection pooling
  
  
   Thx for your input but, as mentioned in my previous message, I've
   tried this and it does not work.  Also, considering my web.xml I
   shouldn't need this, correct?  I have a resource-ref in 
 my web.xml.
  
   Eric
  

Are all TC-managed DataSources pooled?

2004-11-08 Thread Steve Kirk

The docs under 'JDBC Data Sources' at 
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-resources-howto.html 
say, The J2EE Platform Specification requires J2EE Application Servers to
make available a DataSource implementation (that is, a connection pool for
JDBC connections).  

Now, I'm *not* criticising the docs, I'm seeking clarification.  I'm not
sure whether this is saying that a JDBC DataSource has to be pooled?  Or is
instead saying that J2EE requires pooled JDBC connections, or maybe that
J2EE requires connections via a DataSource?

I didn't think that DataSources had to be pooled, based on what is says
here: 
http://java.sun.com/j2se/1.4.2/docs/api/javax/sql/DataSource.html 

This might sound like nit picking, but the answer to this will help me help
someone else on another thread.  Thanks.




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



RE: question on Creating war file

2004-11-08 Thread Daxin Zuo
Sorry, it is much easier than I thought. I did it.

-Original Message-
From: Daxin Zuo [mailto:[EMAIL PROTECTED]
Sent: Monday, November 08, 2004 2:52 PM
To: Tomcat Users List
Subject: question on Creating war file


I am going to pack the application into a war file. I like to use ant. I
like to ask:

  1) a good document giving instruction. In Tomcat/wabapps/mybase, my app
has: /WEB-INF/classes, WEB-INF/lib
 and I have image folder in Apache/htdocs/images. May I need to move the
images to /WEB-INF?

  2) Where to put the war file. I read a page, telling that user need to
unzip the war file in to webapps. really?

Thanks.


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


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



RE: RE: session-timeout means tomcat restart

2004-11-08 Thread Steve Kirk
sorry but no. what about the other points.

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
 Sent: Monday 08 November 2004 22:37
 To: Tomcat Users List 
 Subject: Re: RE: session-timeout means tomcat restart
 
 
 We had a 'hung, and won't work without a reboot problem' and it
 was two things - we had to update some driver for the intel 
 NIC cards in our
 server (for RedHat ES) and had to change some settings to get 
 better NIC
 throughput.
 
 Hope it helps.
 
 - Original Message -
 From: Steve Kirk [EMAIL PROTECTED]
 Date: Monday, November 8, 2004 4:19 pm
 Subject: RE: session-timeout means tomcat restart
 
  Sorry for not replying sooner, I've been busy for a few days.
  
  Can you say more about the crashing?  Any evidence from the logs?  
  A bit
  difficult to be any more specific without more to go on really :)
  
   However, I
have references to them from the controller so that shouldn't 
  be the
problem... eh?
  
  You mention controller. Are you using TC as-is, or are you using a
  framework such as struts or JSF by any chance?
  
  If you suspect that the problem is triggered by a closing session, 
  why not
  try shortening the session timeout to a shorter length and see if 
  it crashes
  quicker?  In fact, it's worth checking whether the crash is around 
  the time
  of the session expiry or not.  If not, then your problem may not 
  be directly
  caused by TC at all.?
  
  Do you have any event listeners?  If you have one for
  sessionDestroyed/sessionWillPassivate, what does this code do?
  
   -Original Message-
   From: Eric Wulff [EMAIL PROTECTED] 
   Sent: Saturday 06 November 2004 00:51
   To: Steve Kirk
   Cc: Tomcat Users List
   Subject: Re: session-timeout means tomcat restart
   
   
   Well, this is amazingly frustrating.  My TC 5.0.28 
 running on Linux
   FC2 is completely crashing about every half hr when I 
 have a webapp
   open and don't interact with it.  I no longer have a time-out 
  element in my web.xml so that doesn't seem to matter.  TC 
  shutdown and restart
   does not work.  Instead, I'm required to hard boot my 
 machine.  I'm
   hung just trying to access the static welcome page of any app,
   although I do know that init() of the webapp I'm working 
 on is being
   called.
   
   Eric 
   
   
   On Fri, 5 Nov 2004 15:43:28 -0800, Eric Wulff 
   [EMAIL PROTECTED] wrote:
Linux FC2
TC 5.0.28

I'm not storing a db object within a session although I 
 am storing
objs within the session(of course - session.setAttribute).  
   However, I
have references to them from the controller so that shouldn't 
  be the
problem... eh?

An interesting thing, I sometimes have to reboot my 
   machine, not just
restart TC.  Although other apps run fine, I have to reboot 
   my machine
in order to get TC up again.

I optimized my db connection, I did have it in servlet init().
Although I knew I had to do this and I'm much better off 
   for it, and I
appreciate you're noting it, but this didn't eliminate the 
  crashing  problem.

I also am now taking advantage of a connection pool.  
   However, as you
figured, that does not solve the crash problem.

Finally, I removed the session-configsession-timeout 
   element from
myapp web.xml to test if this is the initiator of the problem. 
  Let
you know what I find.  Still, even if this is what initiates the
sequence leading to a crash, it shouldn't so something need be
fixed/optimized.  Any other ideas?

Eric




On Fri, 5 Nov 2004 13:03:27 -, Steve Kirk
[EMAIL PROTECTED] wrote:




  -Original Message-
  From: Eric Wulff [EMAIL PROTECTED]
  Sent: Friday 05 November 2004 07:01
  To: Tomcat Users List
  Subject: session-timeout means tomcat restart
 
 
  Hi, I'm experiencing 2 interesting problems that may be 
   related to my
  session timeout.
 
  1.  It seems that when my session times out I need to 
   restart tomcat,
  often just the application via reload in the manager, 
   in order to gain
  access to my db again.  Could this be because I've been 
   accessing the
  db via jdbc hard coded in the servlet?  Might using a 
  datasourceconnection pool take care of this?

 I would say that rather than the problem being JDBC 
   hardcoded in the
 servlet, the problem is more likely to be _how_ that code 
   is written.

 if it really is the session timeout that is causing this, 
   it sounds to me
 like you are storing the database objects within a 
   session object (which
 seems a bit unusual).  or at least the last reference to 
   them is stored
 there, so that when the session is destroyed, the 
   database connection is
 lost.  it might be better to store the objects in local 
   variables within
 doPost if your 

Re: How to fix: Tomcat responce time gets to 10-200 seconds once a day

2004-11-08 Thread Steven J. Owens
Roman Zhovtulya [mailto:[EMAIL PROTECTED]  asked:
  Normally the performance is really good, but about once a day it gets
  really slow (around 1-5 minutes to display the page). It also recovers
  autocatically to normal response time when you simply wait 
  5-10 minutes.

On Mon, Nov 08, 2004 at 11:16:55PM -, Steve Kirk wrote:
 My favourite answer to any query about a server being painfully slow:  does
 the slowdown coincide with a slowdown or outage of your DNS service?  This
 can have suprisingly big impact if TC is doing reverse lookups of the IP of
 every request.
 
 At the risk of asking the obvious, are you sure that some other heavy
 process is not kicking off at that time, either on one of the machines you
 mention, or some other machine on the network?

 If it's not external load (as SteveK suggests), nor internal load,
it might be resource contention.

1) how many apache processes do you have?  

I had a problem on a redhat box, apparently the default apache install
was 10 processes.  Needless to say, as soon as the traffic went up a
bit, all 10 processes were busy and subsequent requests had to wait
for a free process - and wait, and wait, and wait... 

Does each page load actually load, or does the browser time out while
trying to get a connection?  

If the page takes 5 minutes but actually does load (and if the delay
is not because it's trying to shove a lot of data into the page), then
it's probably *not* a lack of apache processes.  But it's easy enough
to check on, so check on it anyway.

2) If it's not contention for apache processes, it might be some sort
of contention inside tomcat - either a thread locking issue somewhere,
or getting at the database, or some other resource. 

3) It may not be actual load, but more time delays.  For example,
anything in your system that hits an outsid server (message queue,
email) may take a couple of seconds to complete.  All of those secodns
add up.  They may also lead to resource contention.  

One of my earlier servlet projects, the super high reliability
message queue (MQ Series - this was pre-JMS) performed as
advertised... but the super high reliability big iron it was
connecting to was shut down for a couple hours of scheduled
maintenance every sunday morning at 1am (which, of course, I found out
about one sunday morning at 2am).  The message queue's default timeout
was kind of high (25 seconds), so the thread just sat there waiting
for the answer, holding open one of the apache processes all the
while.  Soon enough, all the apache processes were busy waiting for
answers from the tomcat threads, which were waiting for answers from
their message queue requests...

The right way to resolve this sort of problem depends a lot on the
circumstances, so look into that and post here with further questions.

4) Just a wild idea, but check on garbage-collection.  Maybe put a
couple of logging calls in the pages, so you can see the memory usage
in the log:

Runtime.getRuntime().maxMemory()   // maximum memory allocation
Runtime.getRuntime().totalMemory() // memory actually allocated by JVM
Runtime.getRuntime().freeMemory()  // allocated but not in use by objects

The gotcha to watch out for is that the system will quite happily
allocate memory without doing garbage-collection, until it hits
maxMemory().  Then it'll do garbage collection, but it may take a
while.  

You can't really eliminate the delay, but you can move it around
and/or spread it out.  There are command-line arguments to tweak how
garbage collection is done.  At the time I learned this lesson, I
don't think those command-line arguments were available, so I used a
call to System.gc() instead.  But I'd strongly suggest looking into
them before you go mucking with System.gc().

System.gc() isn't guaranteed to do anything.  Whether it does anything
or not depends on your platform, but it's supposed to sort of nudge
the garbage collector and say now might be a good time to clean up.
If you have any sort of consistent spot in your app where a bunch of
objects become superfluous (in the one where I learned this lesson, it
was an object cache that expired objects every minute), putting in a
call to System.gc() might really even out the memory usage.

5) Do some very rough thumbnail profiling; print in
System.currentTimeInMillis() to the log at a number of strategic
points.  Then after a slowdown, look at the log, try to trace a single
request through the process and see where the big delay was, then take
a microscope to that portion of the application.

-- 
Steven J. Owens
[EMAIL PROTECTED]

I'm going to make broad, sweeping generalizations and strong,
 declarative statements, because otherwise I'll be here all night and
 this document will be four times longer and much less fun to read.
 Take it all with a grain of salt. - http://darksleep.com/notablog


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

hide source of a page

2004-11-08 Thread Sunitha Kumar
Hi folks:
Can viewing the source code of a page be blocked in tomcat?
thanks,
-sunitha

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


Re: connection pooling

2004-11-08 Thread Eric Wulff
Well, my informix driver does support connection pooling as-is so I do
not need to use a Jakarta Commons DBCP wrapper in order to take
advantage of database connection pooling.  Thx for clarifying and for
sharing your ResourceParams.  I need to study this issue some more in
general since I only have a surface understanding of what connection
pooling really is and what it's advantages are.  For now, my app is
successfully utilizing connection pooling, as far as I can tell.  My
problem, which initiated this thread, has been solved by putting a
myapp.xml with the necessary context in my
$CATALINA_HOME/conf/Catalina/localhost/ directory.

thx
Eric


On Tue, 9 Nov 2004 00:40:23 -, Steve Kirk
[EMAIL PROTECTED] wrote:
 
 Worth clarifyig what we are meaning by DBCP.  The DBCP I was referring to
 was the specific implementation of connection pooling that is part of
 Jakarta Commons:
 http://jakarta.apache.org/commons/dbcp/
 
 There are other pooling implementations which are alternatives to Commons
 DBCP.
 
 Some DB drivers included pooling support as-is.  Others do not.  For those
 that do not, you need to implement pooling by building code around the
 standard driver.  You used to have to do this yourself, but now there is
 DBCP to take care of this for you.  DBCP is a wrapper used around a
 non-pooling DB driver.
 
 So, hence my question, are you intending to use DBCP, or does your Informix
 driver include pooling?
 
 From the JNDI/JDBC guides it appears that you have the choice of using DBCP
 or not (although there is one aspect of the docs that seem slightly unclear
 on that, which I am going start another thread to clear up).  The configs
 are similar.  Personally I have only got the DBCP approach to work, hence my
 suggestion of using that, for which you need to include the factory
 parameter.  What this does is basically tells TC to call DBCP rather than
 your database driver when making a connection - DBCP then calls your DB
 driver if and when it needs to.
 
 I think I'm right in saying that if you don't explcitly use DBCP, and your
 DB driver does not support pooling, you will end up with non-pooled
 connections.  The webapp will still work but you will not have the
 advantages of pooling.
 
 In case it helps, here are my ResourceParams.  Note that I have both
 factory and driverClassName:
 
 ResourceParams name=jdbc/myDb
 parameter
 namefactory/name
 
 valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
 /parameter
 parameter
 namedriverClassName/name
 valuecom.mysql.jdbc.Driver/value
 /parameter
 parameter
 nameusername/name
 valueme/value
 /parameter
 parameter
 namepassword/name
 valuesecret/value
 /parameter
 parameter
  nameurl/name
  valuejdbc:mysql://localhost:3306/myDb/value
 /parameter
 /ResourceParams
 
 
 
 
  -Original Message-
  From: Eric Wulff [mailto:[EMAIL PROTECTED]
  Sent: Friday 05 November 2004 18:34
  To: Steve Kirk
  Cc: Tomcat Users List
  Subject: Re: connection pooling
 
 
  Steve, I am trying to use DBCP(hence the subject of the thread) and I
  believe I have a driver that supports it.  Especially considering that
  the connection works when I wrap my data resource in a DefaultContext
  tag inside a stand alone Engine tag(server.xml), instead of inside a
  Context tag(how all instructions I've followed so far suggest).
 
  This means my driver support DBCP, correct?
 
  The only source code I imagine would help is the code I use to gain
  connection...
 
  Context initialContext = new InitialContext();
  Context context = (Context) initialContext.lookup(java:comp/env);
  DataSource dataSource = (DataSource) context.lookup(jdbc/wms);
  connection = dataSource.getConnection();
 
  I have seen no mention of this factory class parameter you speak of.
  I'm using TC 5.0.28.  I'll try it.
 
  thx much for your help
  Eric
 
 
  On Fri, 5 Nov 2004 13:30:35 -, Steve Kirk
  [EMAIL PROTECTED] wrote:
   Eric - you are correct,  you do not need both
  resource-ref and Resource
   (although I've found that having both does not cause a problem).
  
   Back to your problem.
  
   The error message indicates that TC cannot find the Resource.
  
   I'm not sure if you are trying to use DBCP or not (in other
  words, does the
   informix driver support pooling on its own, or do you in
  fact need DBCP or
   some other implementation wrapped around it)?  You have
   res-typejavax.sql.DataSource/res-type but do not list
  the factory class
   under your Resource, e.g. :
   parameter
   namefactory/name
  
  valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
   /parameter
  
 

Re: url-pattern with Basic Auth

2004-11-08 Thread Peter Lin
well, looks like parameter are not allowed in the map as I had suspected.

url-patterns that do not begin with either /, *. are treated at
exact matches, which wouldn't work with request parameters, since wild
cards are not allowed. oh well, that's life.

peter


On Mon, 8 Nov 2004 16:33:01 -0500, Shapira, Yoav [EMAIL PROTECTED] wrote:
 
 Hi,
 It's SRV.11.2 in the Spec, and org.apache.tomcat.util.http.mapper.Mapper
 in the Tomcat source code.
 
 Yoav Shapira http://www.yoavshapira.com
 
 
 
 
 -Original Message-
 From: Peter Lin [mailto:[EMAIL PROTECTED]
 Sent: Monday, November 08, 2004 4:27 PM
 To: Tomcat Users List
 Subject: Re: url-pattern with Basic Auth
 
 hehe, I did a search of spec 2.2 and 2.3 on url-pattern and didn't
 find the definition. I guess I'll have to look at earlier specs for
 the definition. either that or I missed it.
 
 peter
 
 
 
 On Mon, 8 Nov 2004 14:22:36 -0600, Mike Curwen
 [EMAIL PROTECTED] wrote:
  I'd think url-pattern elements (regardless of where they appear) need
 to
  conform to the url-patterns specified in the spec (not sure of
 section).
 
  paths: starting with '/' and ending with '/*'
  extensions:  '*.foo'
  exact: exact matching.
 
  The url-pattern I've left from your original message doesn't match
 any of
  these.
 
 
 
 
   -Original Message-
   From: Peter Lin [mailto:[EMAIL PROTECTED]
   Sent: Monday, November 08, 2004 1:57 PM
   To: tomcat-user
   Subject: url-pattern with Basic Auth
  
 url-pattern/AuthServlet?*param1=account1*/url-pattern
  
   I tried it and cross-referenced the servlet spec. It doesn't
   appear to say if this is allowed or not. Anyone know?
  
   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]
 
 
 This e-mail, including any attachments, is a confidential business 
 communication, and may contain information that is confidential, proprietary 
 and/or privileged.  This e-mail is intended only for the individual(s) to 
 whom it is addressed, and may not be saved, copied, printed, disclosed or 
 used by anyone else.  If you are not the(an) intended recipient, please 
 immediately delete this e-mail from your computer system and notify the 
 sender.  Thank you.
 


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



Re: RE: session-timeout means tomcat restart

2004-11-08 Thread Eric Wulff
Other points?

I posted details when I solved this problem, last Friday, but I only
now realized that someone changed the thread, a couple have, and my
post is related to that thread.  Perhaps you didn't see that.

If you're wondering about event listeners, I have not implemented any
as of yet.  If you're still looking for other points then I'll need
you to be specific.

Also, in looking back at this thread I noticed you were the one who
suggested creating a myapp.xml and where to put it.  This was the
suggestion I followed that finally solved my problem.  Many thx for
that!  I still have yet to find a mention of this in TC 5.0 docs.

Eric

btw,  I am required to manually put that myapp.xml at 
CATALINA_HOME/conf/Catalina/localhost/.  I tried creating a META-INF,
located at /myapp/ with a context.xml, but this did not result in a
dynamic copy at CATALINA_HOME/conf/Catalina/localhost/.


On Tue, 9 Nov 2004 00:51:09 -, Steve Kirk
[EMAIL PROTECTED] wrote:
 sorry but no. what about the other points.
 
 
 
  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
  Sent: Monday 08 November 2004 22:37
  To: Tomcat Users List
  Subject: Re: RE: session-timeout means tomcat restart
 
 
  We had a 'hung, and won't work without a reboot problem' and it
  was two things - we had to update some driver for the intel
  NIC cards in our
  server (for RedHat ES) and had to change some settings to get
  better NIC
  throughput.
 
  Hope it helps.
 
  - Original Message -
  From: Steve Kirk [EMAIL PROTECTED]
  Date: Monday, November 8, 2004 4:19 pm
  Subject: RE: session-timeout means tomcat restart
 
   Sorry for not replying sooner, I've been busy for a few days.
  
   Can you say more about the crashing?  Any evidence from the logs?
   A bit
   difficult to be any more specific without more to go on really :)
  
However, I
 have references to them from the controller so that shouldn't
   be the
 problem... eh?
  
   You mention controller. Are you using TC as-is, or are you using a
   framework such as struts or JSF by any chance?
  
   If you suspect that the problem is triggered by a closing session,
   why not
   try shortening the session timeout to a shorter length and see if
   it crashes
   quicker?  In fact, it's worth checking whether the crash is around
   the time
   of the session expiry or not.  If not, then your problem may not
   be directly
   caused by TC at all.?
  
   Do you have any event listeners?  If you have one for
   sessionDestroyed/sessionWillPassivate, what does this code do?
  
-Original Message-
From: Eric Wulff [EMAIL PROTECTED]
Sent: Saturday 06 November 2004 00:51
To: Steve Kirk
Cc: Tomcat Users List
Subject: Re: session-timeout means tomcat restart
   
   
Well, this is amazingly frustrating.  My TC 5.0.28
  running on Linux
FC2 is completely crashing about every half hr when I
  have a webapp
open and don't interact with it.  I no longer have a time-out
   element in my web.xml so that doesn't seem to matter.  TC
   shutdown and restart
does not work.  Instead, I'm required to hard boot my
  machine.  I'm
hung just trying to access the static welcome page of any app,
although I do know that init() of the webapp I'm working
  on is being
called.
   
Eric
   
   
On Fri, 5 Nov 2004 15:43:28 -0800, Eric Wulff
[EMAIL PROTECTED] wrote:
 Linux FC2
 TC 5.0.28

 I'm not storing a db object within a session although I
  am storing
 objs within the session(of course - session.setAttribute).
However, I
 have references to them from the controller so that shouldn't
   be the
 problem... eh?

 An interesting thing, I sometimes have to reboot my
machine, not just
 restart TC.  Although other apps run fine, I have to reboot
my machine
 in order to get TC up again.

 I optimized my db connection, I did have it in servlet init().
 Although I knew I had to do this and I'm much better off
for it, and I
 appreciate you're noting it, but this didn't eliminate the
   crashing  problem.

 I also am now taking advantage of a connection pool.
However, as you
 figured, that does not solve the crash problem.

 Finally, I removed the session-configsession-timeout
element from
 myapp web.xml to test if this is the initiator of the problem.
   Let
 you know what I find.  Still, even if this is what initiates the
 sequence leading to a crash, it shouldn't so something need be
 fixed/optimized.  Any other ideas?

 Eric




 On Fri, 5 Nov 2004 13:03:27 -, Steve Kirk
 [EMAIL PROTECTED] wrote:
 
 
 
 
   -Original Message-
   From: Eric Wulff [EMAIL PROTECTED]
   Sent: Friday 05 November 2004 07:01
   To: Tomcat Users List
   Subject: session-timeout means tomcat restart
  
  
   Hi, I'm 

Re: Configuration Management, JSP Recompiles, War Files

2004-11-08 Thread Steven J. Owens
Peter, Yoav, 

 Thanks for the advice.  Now if I could just ask for a letle
more... :-)

On Mon, Nov 08, 2004 at 01:14:22PM -, Peter Crowther wrote:
  From: Shapira, Yoav [mailto:[EMAIL PROTECTED] 
  One great way to approach production setups for Tomcat is one 
  webapp per Tomcat instance.
 
  Restarts are then quick and easy, and no matter what this one
  webapp does (OutOfMemoryErrors, malicious code, etc.) it can't
  affect others you have running around because they're in a
  different JVM.  The ease of setting up Tomcat standalone makes
  this not just feasible, but probably recommended over a many
  webapps per Tomcat instance setup.

 This does sound like a really good argument for using separate
tomcat instances.  My main qualm is what other server infrastructure I
might need to think about (*do* I need to think of any other server
infrastructure)?
 
 This approach works well if:
 
 - the webapps have a memory footprint that is large enough to make the
 JVM overhead irrelevant;

 Any idea what the memory overhead of JVM  tomcat is?  I'm going
to guess that the answer is not insignificant, but not problematic
for my current load of a dozen webapps on a 2GB machine (and that RAM
can be fairly easily bumped up - it's only money :-)).
 
 - the webapps do not have to be run on the same port.
 
 If you are running hundreds of tiny webapps it might be a bit of
 overkill, and if many of those webapps need to be on (for example) port
 80 or 8080 then it simply doesn't work.  This said, I agree with Yoav -
 it makes management a whole lot easier and reduces interactions between
 webapps.  I use it wherever I'm principally running services that don't
 need to be exposed via our firewall.

 I'm certainly leaning in this direction.  I'm using apache to
front-end the apps.  Can apache/modjk cope with different ports for
different tomcats for different webapps?

 Thinking about it, I have:

 - apache
 -- modjk
 - tomcat
 -- jdbc driver  DBCP pool
 - mysql

 If I'm going to have multiple tomcat processes, the main things I
would think to worry about (besides sheer disk and memory consumption)
are connections between apache and tomcat, and between tomcat and
mysql.  Apache and Mysql are already handling the current load,
nothing should really change about the database tables or the http
requests.

 For modjk, I have no idea what the concerns might be, except to
start with, can modjk even do this, using multiple tomcat servers on
different ports?

 For the jdbc driver and connection pool, the only thing I can
think of is resource consumption of the database connections, mainly
on the mysql server side of the equation.  I should look into how many
database connections mysql is configured to provide, and how using
multiple tomcat instances might affect that.  I'm not sure what the
answers are, but two questions I can think of:

 - The multiple connection pools will definitely mean that there
will be more database connections kept in overall machine memory
(whatever the lower bound is on the DBCP times the number of tomcat
servers) at any one time.  How will this affect mysql?
 
 - The multiple connection pools mean that the collection of
tomcat servers will have a much higher upper bound of open connections
(normal upper bound times number of tomcat servers).  Is there more of
a risk of swamping the mysql server?  Should I configure mysql to
handle more connections, or should I configure the tomcat DBCP pools
to allow fewer connections?

 These are the kinds of topics that I would love to find covered
in a best practices for tomcat hosting guide.  Any recommendations?


-- 
Steven J. Owens
[EMAIL PROTECTED]

I'm going to make broad, sweeping generalizations and strong,
 declarative statements, because otherwise I'll be here all night and
 this document will be four times longer and much less fun to read.
 Take it all with a grain of salt. - http://darksleep.com/notablog


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



  1   2   >