Session Creation with IE

2005-02-15 Thread Mark O'Driscoll
Using 5.0.28 on WIndows 2K.

We have three ways of getting at our webapp from the client side:

IE Favourites
Email link (usually Outlook express)
Desktop shortcuts.

All clients are running IE6.

If the client goes into the app via the browser favourite all is fine.

If the first client window is brought up via the email link or desktop short
cut and then an IE favourite is used to access another page, a new session
is created at the server end.

Anyone seen anything like this. It seems that either tomcat thinks the
second access is from a different client or it is indeed from a new client
and IE/Win2K is doing something strange.




-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.8.8 - Release Date: 14/02/2005


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



Stopping creation of sessions

2004-12-03 Thread Mark O'Driscoll
My application uses FOP to create pdf documents on the fly.

The xsl description for docn creation includes a directive to load an
external object, eg a jpeg file. The spec looks like this

fo:external-graphic [EMAIL PROTECTED] scaling=uniform
vertical-align=middle width={$width} /

So for each image in the doc to be created the FOP code contacts the Tomcat
server to load the image and a new session is created.



My question is: Is there anyway to specify on a URL or a client that will
not create a session or even reuse an existing session? This is really
screwing up my

session management code.



TIA


Mark


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



Working directory for tomcat service on W2K

2004-11-25 Thread Mark O'Driscoll
Is there any way to change this, when tomcat runs as a service, from
c:\winnt\system32?

TIA

Mark


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



New session created from same client/different host

2004-11-24 Thread Mark O'Driscoll
If my client (IE6) connects to a single tomcat(5.0.28 Windows2k) using
different hostnames (e.g. http://localhost:8080/myapp/test.jsp AND
http://127.0.0.1:8080/myapp/test.jsp ) a new session is created for each
alias. Is there any way to stop these new sessions being created?

TIA

Mark


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



Sessions on restart

2004-11-18 Thread Mark O'Driscoll



Hi,

Using 5.0.28 on Windows2000.

I have a session listener that 
implements

HttpSessionListener,ServletContextListener,HttpSessionActivationListener,HttpSessionBindingListener

and it works fine in that I am notified of the 
context start, sessions being added  destroyed.

I am using this to keep a list of the sessions that 
are currently active.

Now when tomcat restarts, the sessions persist OK 
but I have no way of knowing the list of active sessions. 

I am sure that in the 4.0.x days, sessionCreated 
was called on restart for all the persisted sessions. That doesn't seem to be 
happening with 5.0.28. 

The question is:

How do I maintain a list of sctive sessions across 
restarts of Tomcat.

TIA

- Mark (back after a LONG time)


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

Re: Sessions on restart

2004-11-18 Thread Mark O'Driscoll
Well, as you can see my listener implements this interface but the
activation/ passivation methods are never called :-( I have flagged the
class as a listener in m web.xml. Is there anything else I have to do?

TIA

Mark

- Original Message -
From: Shapira, Yoav [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Thursday, November 18, 2004 3:14 PM
Subject: RE: Sessions on restart



Hi,

Now when tomcat restarts, the sessions persist OK but I have no way of
knowing the list of active sessions.

There will be an activation event for each session restored from disk.
If your listener implemented HttpSessionActivationListener, you'd get
this event.  By monitoring session creation, activation, passivation,
and destruction, you will be able to maintain the list of active
sessions.

I am sure that in the 4.0.x days, sessionCreated was called on restart
for all the persisted sessions. That doesn't seem to be happening with
5.0.28.

This behavior was a bug if it indeed existed.

Yoav Shapira http://www.yoavshapira.com




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: Sessions on restart

2004-11-18 Thread Mark O'Driscoll
That worked fine. Thanks to you both

Mark
- Original Message -
From: Jon Wingfield [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Thursday, November 18, 2004 3:35 PM
Subject: Re: Sessions on restart


 Yep. Read the docs more carefully ;)
 The activation/passivation methods are called on objects that implement
 the listener AND are attributes of the session to be activated/passivated.

 Tomcat works as Yoav described.

 HTH,

 Jon

 Mark O'Driscoll wrote:

  Well, as you can see my listener implements this interface but the
  activation/ passivation methods are never called :-( I have flagged the
  class as a listener in m web.xml. Is there anything else I have to do?
 
  TIA
 
  Mark
 
  - Original Message -
  From: Shapira, Yoav [EMAIL PROTECTED]
  To: Tomcat Users List [EMAIL PROTECTED]
  Sent: Thursday, November 18, 2004 3:14 PM
  Subject: RE: Sessions on restart
 
 
 
  Hi,
 
 
 Now when tomcat restarts, the sessions persist OK but I have no way of
 knowing the list of active sessions.
 
 
  There will be an activation event for each session restored from disk.
  If your listener implemented HttpSessionActivationListener, you'd get
  this event.  By monitoring session creation, activation, passivation,
  and destruction, you will be able to maintain the list of active
  sessions.
 
 
 I am sure that in the 4.0.x days, sessionCreated was called on restart
 
  for all the persisted sessions. That doesn't seem to be happening with
  5.0.28.
 
  This behavior was a bug if it indeed existed.
 
  Yoav Shapira http://www.yoavshapira.com
 
 
 
 
  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]




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



Re: Starting TOMCAT without opening new DOS promt

2002-09-25 Thread Mark O'Driscoll

Use Linux! (Sorry, couldn't resist that one)

You can run it as a service? (net start ...)

- Original Message -
From: RAJESH KANNAN [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, September 25, 2002 3:31 PM
Subject: Starting TOMCAT without opening new DOS promt


 Hi all,

 We would like to start the TOMCAT server without opening a new DOS prompt.
 How should we do this?

 Thanks in anticipation.

 With Regards
 K.RajeshKannan



 _
 MSN Photos is the easiest way to share and print your photos:
 http://photos.msn.com/support/worldwide.aspx


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





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




SIGINT kills tomcat

2002-09-09 Thread Mark O'Driscoll

On Solaris 8, under bourne shell, tomcat 4.0.3.


Run tomcat/bin/startup.sh
 prints out env. variables
starts tomcat
Script exits and returns to the shell prompt.
All is fine. Tomcat now seems to be running as a background process

If I type ^C (SIGINT) at the command prompt (or at a subsequent tail -f,
say, running at the same terminal window as I started tomcat from), the
signal is propagated to the tomcat jvm instance and it exits!

This outrageous behaviour only happens with the bourne shell; bash and csh
are OK.

Any idea on how to stop keyboard generated signals getting propagated to the
background tomcat java process?

- Mark


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




Programmatically remove an application?

2002-08-22 Thread Mark O'Driscoll

Is there a way to programmatically remove or stop the installation of a web
application?

i.e. call a function that does the same as
http:/:8080/manager?remove=/app

TIA


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




Stopping application installation?

2002-08-21 Thread Mark O'Driscoll

I want to stop the installation of an application under certain conditions.

I have a servlet that is loaded on startup and I check some things in its
init() method. I want to be able to disable the application at this point.
Throwing a ServletException in the init() doesn't seem to work.

Question is: How does one stop the installation of an application?

Tomcat 4.0.3 standalone with jdk1.4 on Solaris8.

TIA

- Mark


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




Precompilation

2002-08-19 Thread Mark O'Driscoll

Hi,

I currently recompile all my jsp's using jspc and update the entries in
web.xml as created by jspc.

This is fine but not quite what I want. One of the problems is that my
default welcome page is index.jsp which, of course, is
no longer there when the file is precompiled. I have got around this by
having a index.html that redirects after 0 secs to index.jsp.

Any solution to this?

I would like to be precompile so that all jsp go into
localhost/work/applicationfred$jsp.{java,class} as tomcat does. Any easy
way to do this?


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




Re: servlet-jdbc-SQL server

2002-08-19 Thread Mark O'Driscoll

MySQL has a last_insert_id() function which you can use on a connection

- Original Message -
From: Mike Jackson [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Monday, August 19, 2002 4:38 PM
Subject: RE: servlet-jdbc-SQL server


 With oracle there's a way to specify that a insert does a return, it's
 something like insert into tablea ( a ) values ( 'a' ) returning id.
 I know this isn't oracle that you're asking about, but you might try
 using that syntax on ms sql and see what happens.  Or it might help to
 find it in their documentation (there's a guide oracle vs ms sql in the
 documentation).

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

  -Original Message-
  From: Matt Brennan [mailto:[EMAIL PROTECTED]]
  Sent: Monday, August 19, 2002 8:36 AM
  To: [EMAIL PROTECTED]
  Subject: servlet-jdbc-SQL server
 
 
  Just taking some stumbling first steps talking to SQL server from a
  servlet using the Microsoft JDBC driver. Servlet container is tomcat
  4.0.4. Quick question if I may:
 
  I need to insert a row into an SQL Server table and have the servlet
  generate a page that includes an automatically generated IDENTITY from
  the newly created row. How after the insert can I find the generated ID
  without conducting a subsequent query (which would have no guarantee of
  returning uniquely the newly inserted record)?
 
// 'con' is a connection to MS-SQLserver with SelectMethod=cursor
Statement state = con.createStatement(
  ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
 
// Generate an empty result set
ResultSet content  = state.executeQuery(sqlQuery);
 
content.moveToInsertRow();
// Column 1 is id int IDENTITY NOT NULL PRIMARY KEY
// Column 2 is name VARCHAR(20)
content.updateString (2, something);
content.insertRow();
 
// If I then query the inserted row, to find the newly generated
// IDENTITY value I get MIN_INT instead of '1' (the default first
// identity generated by SQL server if no seed is given)
int id = content.getInt (1);
 
  Is this some peculiarity of the servlet interface to the driver, to the
  driver itself or just my bad undestanding of the insert process? Is it
  possible to configure the Statement so that the Insert row in the Result
  Set gets updated when the insert takes place and the 'id' gets
generated?
 
  Please excuse the fact that this query starts to look more like a JDBC
  query than a tomcat query - not quite sure where the problem lies -
  tomcat+driver? driver? my understanding (most likely!). I am hoping that
  other servlet developers have crossed this bridge before.
 
 matt
 
 
 
  --
  To unsubscribe, e-mail:
  mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
 
 


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




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




re: tomcat stops randomly. why??

2002-08-14 Thread Mark O'Driscoll

I have a similar but different problem.

Running 4.0.3 on solaris 8 standalone with jdk 1.4

Occasionally, tomcat dies with no error message in any log file. It is as if
someone has kill -9'ed the jvm.

Has anyone seen anything like this?

People here are getting very wary of tomcat. I need some resolution to this.




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




Re: forward to TOP-Frame

2002-08-14 Thread Mark O'Driscoll

Is this a game? You are trying to manipulate client side functionality
without using the only client side programming feature (javascript) you
have.

Trying to develop any system with a browser front end without using
javascript is a futile exercise.

Tell whoever mandated the ban on javascript that he is a muppet and should
seek alternative employment in McDonalds. You can tell him I said so!


- Original Message -
From: Harry Knörrer [EMAIL PROTECTED]
To: 'Tomcat Users List' [EMAIL PROTECTED]
Sent: Wednesday, August 14, 2002 10:49 AM
Subject: AW: forward to TOP-Frame


 And javascript isn't allowed

  -Ursprüngliche Nachricht-
  Von: Harry Knörrer [mailto:[EMAIL PROTECTED]]
  Gesendet: Mittwoch, 14. August 2002 11:45
  An: 'Tomcat Users List'
  Betreff: AW: forward to TOP-Frame
 
 
  This is a problem cause the forward should happen when the session is
  invalid.
  I check this in my controller.jsp
 
   -Ursprüngliche Nachricht-
   Von: Barney Hamish [mailto:[EMAIL PROTECTED]]
   Gesendet: Mittwoch, 14. August 2002 11:29
   An: 'Tomcat Users List'
   Betreff: RE: forward to TOP-Frame
  
  
   You can't solve this with forward. You need to do this client
   side with
   either javascript or by changing whatever link the user
   clicks on to to
   include a target.
   Hamish
  
   -Original Message-
   From: Harry Knörrer [mailto:[EMAIL PROTECTED]]
   Sent: Wednesday, August 14, 2002 11:27 AM
   To: Tomcat-Liste (E-Mail)
   Subject: jsp:forward to TOP-Frame
  
  
   Hello!
  
   I want to forward the request to a page but it should be shown in my
   top-frame.
  
   e.g href=logindialogController.jsp?formcommand=logout
   target = _top
  
   How can i solve this with jsp:forward
  
   or any other solution?
  
  
  
   Thanks
   Harry Knoerrer
  
   --
   To unsubscribe, e-mail:
  mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
 



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




How to keep track of sessions

2002-08-14 Thread Mark O'Driscoll

I am trying to keep track of the current sessions that are active in my web
application.

I have a HttpSessionListener that is correctly called on
sessionCreated/sessionDeleted. I keep a reference to each session in the
servletContext as a Vector.

If tomcat is restarted then the sessions are persisted fine. However my
vector of sessions is lost so I have no record of sessions that were created
during a previous tomcat run.

Any idea how I could find or keep the list of previously created sessions?

Is there any way I can find a list of the current sessions without keeping a
list (that would be my preference)

TIA

- Mark


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




Re: How to keep track of sessions

2002-08-14 Thread Mark O'Driscoll

I am using the sessions to keep track of who is logged on, for how long and
what they have done. Obviously there are other non servlet ways to do this
but as tomcat gives the opportunity to track sessions, I thought I'd use it.
Session persistence highlights a 'hole' in the sessionListener interface.

BTW: I'm surprised you think sessions should not be persisted. I think it's
cool!

Thanks for the help.
- Original Message -
From: Shapira, Yoav [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Wednesday, August 14, 2002 2:17 PM
Subject: RE: How to keep track of sessions


Howdy,


 Sessions are not meant to be persisted across server restarts.


Obviously other people have other opinions about that.

Which is why I still suggested a solution I've used in the past ;)

Even though I disagree with the approach of persisting someone else's
proprietary internal objects, I assume that whoever asked the question
has a reasonable and well-thought out cause, so I try to help.

I'm still unclear as to why one would want to save the session object
itself, as opposed to only the parts of interest from it.  Does it have
to do with load-balancing, wanting to somehow augment / superimpose on
the built-in mechanism?

Yoav Shapira
Millennium ChemInformatics







 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:
mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
mailto:[EMAIL PROTECTED]


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




Re: filter

2002-08-14 Thread Mark O'Driscoll

filter-classcom.test.FilterTest/filter-name
^^^ //
should be /filter-class
Failing that, i'd have to see the error but my guess is that you have the
order of things in your web.xml wrong.

filter tags should appear after context-param and before listener
tags. See your dtd for more details. I use
http://java.sun.com/web-app_2_3.dtd

- Original Message -
From: Felipe Schnack [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, August 14, 2002 2:21 PM
Subject: filter


   I'm using Tomcat 4.0.4
   I'm trying to declare a filter in web.xml file, but it refuses to
 work. Here is what I wrote:
   filter
 filter-nametestFilter/filter-name
 filter-classcom.test.FilterTest/filter-name
   /filter
   When I start Tomcat it says my XML is invalid. What I'm doing wrong?

 --

 Felipe Schnack
 Analista de Sistemas
 [EMAIL PROTECTED]
 Cel.: (51)91287530
 Linux Counter #281893

 Faculdade Ritter dos Reis
 www.ritterdosreis.br
 [EMAIL PROTECTED]
 Fone/Fax.: (51)32303328


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




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




Re: How to keep track of sessions

2002-08-14 Thread Mark O'Driscoll

This is all very interesting but.

The sessions are currently persisted or serialized on tomcat exit, fine.

I have a collection of session object references.

If I save the references they will be invalid when tomcat starts up.
If I save (serialize) the objects then I am duplicating what tomcat does.

In either case, it's an arse.

Am I missing something...

- Mark
- Original Message -
From: Shapira, Yoav [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Wednesday, August 14, 2002 3:05 PM
Subject: RE: How to keep track of sessions


Hi,
I like this thread as a theoretical discussion, so let's pursue it a bit
more ;)

Depending on the kind of information you want to
display it gets at sime point annoying to to copy
everthing from the session to a store and to remove
it from the store when the session ends.
  - More code = more possible error, less perfomance
  - More memory = less performance

More code, yes.  But I think the SessionInfo-type objects would be
trivial.  The manager would be very easy to write as well.  As they are
simple and completely under your control, you could make the processing
and persistence operations very fast.

Having tried that approach on long-running servers with many users and
delayed session expiration (120min), leading to many SessionInfo objects
that had to be persisted on context shutdown and restored on context
startup, I can safely say that performance was not a problem for us.
Even for thousands of SessionInfo object, the persistence operations
were only a few seconds.  And that's on a fairly small server box, JDK
1.2.2 without much tuning.  (Although it was a custom SAXParser and not
Castor, as I suggested before.  Would've been nice to compare them ;)).

Even if you do it, the problem of the original poster
is the same. Now he has a Vector of SessionInfo

I agree.  You have to worry about persistence either way.  However,
persisting your own objects is typically a lot easier than persisting
third party objects such as tomcat's session implementation.

The part that I think makes his use-case very interesting and
non-trivial is the requirement to record (and thus persist) the user's
click-stream.  I'm not sure off the top of my head how that fits into
the SessionInfo object, except maybe as a list of URLs the user visited?
We did not have this requirement in the aforementioned system, and so I
can't speak to it...

I'd be interested to hear from the original poster when a solution is
implemented and tested...

Yoav Shapira
Millennium ChemInformatics








 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:
mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
mailto:[EMAIL PROTECTED]


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




Re: Trouble re-deploying a war file through manager

2002-07-25 Thread Mark O'Driscoll

I do something similar but different:

1: remove existing application
2: remove the war AND the unpacked war
3: install the new war from somewhere other than /webapps
4: All works OK
- Original Message -
From: Erik Mattsson [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, July 25, 2002 10:03 AM
Subject: Trouble re-deploying a war file through manager


 Besides the other question about Ant and tomcat, Im having problems with
 the deploying through the manager.


 First I undeploy the servlet through
 http://192.168.0.150:8180/manager/remove?path=/iwipwebservice

 Then I upload the new iwipwebservice.war file to the webapps dir, and
delete
 the unpacked directory webapps/iwipwebservice/. (to provoke it to unpack
the new war file)

 Then I try to deploy the servlet using

http://192.168.0.150:8180/manager/install?path=/iwipwebservicewar=jar:file:
/usr/local/tomcat/webapps/iwipwebservice.war!/

 But I get the following error message:
 FAIL - Encountered exception java.lang.IllegalStateException: zip file
closed


 Reading the localhost_log.2002-07-26.txt  i find out the following java
Exception:

 2002-07-26 12:12:22 Manager: install: Installing web application at
'/iwipwebservice' from
 'jar:file:/usr/local/tomcat/webapps/iwipwebservice.war!/'
 2002-07-26 12:12:22 StandardHost[localhost]: Installing web application at
context path /iwipwebservice from URL
 jar:file:/usr/local/tomcat/webapps/i
 wipwebservice.war!/
 2002-07-26 12:12:22 ManagerServlet.install[/iwipwebservice]
 java.lang.IllegalStateException: zip file closed
 at java.util.zip.ZipFile.entries(ZipFile.java:284)
 at java.util.jar.JarFile.entries(JarFile.java:192)
 at
org.apache.catalina.core.StandardHost.expand(StandardHost.java:969)
 at
org.apache.catalina.core.StandardHost.install(StandardHost.java:695)
 at
org.apache.catalina.servlets.ManagerServlet.install(ManagerServlet.java:376)
 at
org.apache.catalina.servlets.ManagerServlet.doGet(ManagerServlet.java:277)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
 at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
 at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:243)
 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
 at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:190)
 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
 at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase
.java:531)
 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
 at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
 at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
 at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:170)
 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
 at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170
)
 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
 at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
 at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:174)
 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
 at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 at
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:
1027)
 at
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125
)
 at java.lang.Thread.run(Thread.java:484)

 2002-07-26 12:13:29 Manager: install: Installing web application at
'/iwipwebservice' from
 

Re: Is there any way to stop exceptions getting logged to log file?

2002-07-24 Thread Mark O'Driscoll

You're right. It is too late!


  I don't want to get involved in a programming practice debate BUT..
 

 Too late ... :-)

  The performance hit from exceptions occur because exceptions are thrown,
not
  in how they are handled. You cannot programatically avoid exceptions
with
  xhaustive checking that would itself hinder performance. Specifically
  potential SQL errors are punexceptionally/pun difficult to cater
for.
  (dropped connections, network problems, constraint violations)
.Exceptions
  are only thrown when something goes wrong. The point I was trying to
make
  was that exceptions are not only a sign of system failure, but one of
usage
  failure too.
 

 Because SQLException is a checked exception, you can't throw it directly
 from a servlet anyway, so your database accesses are already encapsulated
 in try/catch blocks.  You've already paid all the cost of checking
 already -- you actually have to deliberately rethrow it (wrapped in a
 ServletException) to allow your filter to see it.  Why go to all that
 extra work?

  Anyway, what I was trying to do was to implement a transaction  logging
  filter that determined if a particular database write operation had
worked.
  The code is simple and checks if a servlet/jsp has thrown an exception
to
  check for success/failure. If the servlet/jsp completes without throwing
an
  exception, I commit the transaction, otherwise I roll it back.
 

 This is not the way you should program database applications!  It is very
 very dangerous to depend on external logic to commit or roll back
 transactions for you.  If an exception happens, it should be logged and
 dealt with when it happens.
Disagree. That is just micro managing exceptions. Transactions are the
example of where a wrapper try/catch block around a series of SQL statements
is a much better way to do it than try/catching each one.

Also subsequent non database actions can cause a rollback.


 Database access logic should always catch its own exceptions, and
 commit or roll back the transaction appropriately.  In a web app, it is
 considered irresponsible programming for a servlet to leave an open
 database transaction after it returns from the service() method, for
 whatever reason that might happen.  To say nothing of returning the
 connection to the connection pool you got it from.
That is exactly what the filter will do for you. The transaction wrapup in
the filter will ALWAYS be called = less scope for errors.

  Is there some recognised way to pass servet/jsp error conditions to
filters?
  This would prevent me relying on exceptions (altho' exceptions would
have to
  be catered for too). I suppose I could use the request.getAttribte()?
 
  Are exceptions that are trapped in a filter 'seen' and handled by
Tomcat?
 

 Your problem is that Tomcat sees the exception thrown by the servlet
 before it is passed back to the filter.  That's where the logging is
 happening.  And that's not going to change (in the standard Tomcat
 release -- you're perfectly free to modify your own copy), because
 handling exceptions is not what filters are for.
Oh no it doesn't. Otherwise filters could not work. If you put doChain() in
a try catch block, you catch the exception that the jsp/servlet threw.

  TIA
 
  - Mark
 

 Craig


   I'll second what Craig has said and add that if your program
normally
   throws lots of exceptions, then you should look at some of your design
   decisions. Exceptions are wonderful when used for Exceptional
behavior,
   but not for normal runs. They are also REALLY slow. Exceptions can
kill
   your performance, and if you are getting them regularly, you should
catch
   the ones you can safely ignore as early as possible and toss them
away
  as
   appropriate, or even better, not throw them at all.
  
   Regards,
  
   Will Hartung
   ([EMAIL PROTECTED])
  
  
  
  
   --
   To unsubscribe, e-mail:
  mailto:[EMAIL PROTECTED]
   For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
  
  
 
 
  --
  To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
mailto:[EMAIL PROTECTED]
 
 


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




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




Is there any way to stop exceptions getting logged to log file?

2002-07-23 Thread Mark O'Driscoll

I am using a filter to trap exceptions thrown by jsps/servlets. In normal
program operation, lots of these exceptions get thrown.
In order to stop 'localhost_log.-MM-DD.txt' getting clogged, I'd like to
stop exceptions that are handled by the servlet engine from being logged.
Or at least ust havethe exception mentioned rather than the full stack
trace.


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




How do I determine the error code

2002-07-17 Thread Mark O'Driscoll

Using the error-pageerror-code directive in my web.xml, I am redirecting
errors  exceptions to one error page. I know I can query the exception but
how do I query the error that may have caused the page to be invoked.

e.g.

if I call response.sendError(234), how do I tell in CheckError.jsp that the
error that cased the page to be invoked was 234 (and any other information).
I don't want to have to put in a separate directive for each possible error.




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




Re: How do I determine the error code

2002-07-17 Thread Mark O'Driscoll

Great. Just what I wanted!

Now is there anyway to specify a single error-pageerror-code set that
works for all error codes. I can't just say

error-pagelocation/error.jsp/location/error-page

and hope that error.jsp gets caled for all error-code  exception errors


- Original Message -
From: Tim Funk [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Wednesday, July 17, 2002 3:17 PM
Subject: Re: How do I determine the error code


 Section 9.8 of Java Servlet Specification Version 2.3:

 A web application may specify that when errors occur, other resources in
 the application are used. These resources are specified in the
 deployment descriptor. If the location of the error handler is a servlet
 or a JSP, the following request attributes can be set:
 - javax.servlet.error.status_code
 - javax.servlet.error.exception_type
 - javax.servlet.error.message
 - javax.servlet.error.exception
 - javax.servlet.error.request_uri

 -Tim

 Mark O'Driscoll wrote:
  Using the error-pageerror-code directive in my web.xml, I am
redirecting
  errors  exceptions to one error page. I know I can query the exception
but
  how do I query the error that may have caused the page to be invoked.
 
  e.g.
 
  if I call response.sendError(234), how do I tell in CheckError.jsp that
the
  error that cased the page to be invoked was 234 (and any other
information).
  I don't want to have to put in a separate directive for each possible
error.
 
 
 
 
  --
  To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
mailto:[EMAIL PROTECTED]
 
 
 



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




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




Re: Default Servlet Parameters

2002-07-08 Thread Mark O'Driscoll

I have a supplementary question to this.

Is there any accepted way to pass parameters to servlets/jsps that may be
edited?

I can see that init-param  context-param do what I want but I need to
allow a user to change values of some parameters, save them and the new
values would be used subsequently. I don't want to have my code re-writing
web.xml or server.xml.

I guess I could have a context parameter pointing to an OS file that would
contain parameter sets in XML or java property sets. Any other approaches?

Oh, that's another question. Any common software out there that can easily
parse an XML property file or can I use some of the tomcat libraries?

- Original Message -
From: Shapira, Yoav [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Monday, July 08, 2002 2:33 PM
Subject: RE: Default Servlet Parameters


Howdy,
You shouldn't be giving other parameters to tomcat's own DefaultServlet.


Your own servlets have no limitations on the number of name of
variables: you can have as many init-param tags in your servlet tags
as you want.

If you want some params common to all the servlets in your web-app, use
context-param instead, outside your servlet tags.

Yoav Shapira
Millennium ChemInformatics


-Original Message-
From: Manchan [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 02, 2002 4:44 PM
To: [EMAIL PROTECTED]
Subject: Default Servlet Parameters

*** THE QUESTION ***

I'd like to load global init parameters for my
servlets on Tomcat, in the manner which Jserv
accomplishes with its |zone.properties| file using the
line |servlets.default.initArgs=myParameter=myValue|.

*** MY GUESS TO QUESTION ***

I presume the Tomcat analogue to the above is adding
init-param tags to $TOMCAT/conf/web.xml, e.g.

servlet
   servlet-namedefault/
   servlet-classorg.path.to.DefaultServlet/
   init-param
  param-namemyParameter/
  param-valuemyValue/
   /init-param
/servlet

*** UNFORTUNATELY ***

In DefaultServlet.java, it statically loads only five
init-parameters, namely debug, input, listings,
output, readonly.  I would need to alter Tomcat
code to accept |myParameter|.  There must be a better way.

__
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com

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


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




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




Re: LoadOnStartup woes

2002-07-08 Thread Mark O'Driscoll

99 means that it is the last of the loadonstartups to run, you hope.

Get your servlet to create its own thread rather than sleeping the current
one and all should be OK
- Original Message -
From: Cato, Christopher [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, July 08, 2002 3:14 PM
Subject: LoadOnStartup woes


 I have a servlet that checks and distributes email. I need it to run on
 startup. So I configure tomcat to run it on startup. The servlet starts a
 thread, does it's thing and then sleeps again. Now, I marked the servlet
to
 run as number 99 (effectively last i hope) in the LoadOnStartup entry.

 Problem is, tomcat never gets to start the http listener as the thread in
my
 servlet obviously puts it all to sleep before tomcat reaches that part.
How
 can I avoid this and still have the servlet do its thing?

 /Christopher

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




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




Re: Property Editor

2002-07-05 Thread Mark O'Driscoll

Sorry, I didn't make myself clear. I have read the bean stuff and can see
how to set property descriptors. My question is how do
I register all this stuff with Tomcat? .or maybe I haven't understood it
at all!
- Original Message -
From: Craig R. McClanahan [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Thursday, July 04, 2002 6:59 PM
Subject: Re: Property Editor




 On Thu, 4 Jul 2002, Mark O'Driscoll wrote:

  Date: Thu, 4 Jul 2002 18:07:35 +0100
  From: Mark O'Driscoll [EMAIL PROTECTED]
  Reply-To: Tomcat Users List [EMAIL PROTECTED]
  To: Tomcat Users List [EMAIL PROTECTED]
  Subject: Property Editor
 
  I need to use jsp:setProperty with a value of a non supported
type? I
  need to register a Property Editor to do this.
 

 How about the JavaDocs for java.beans.PropertyEditorManager?  I would also
 suggest reading the JavaBeans specification for more background:

   http://java.sun.com/products/javabeans/

  Any ideas where I might find some info. on configuring specific data
types
  to work with the bean mechanisms for tomcat?
 
  TIA
 
  - Mark
 

 Craig


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




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




Re: Installation successfull but still problems!

2002-07-04 Thread Mark O'Driscoll

Jasper can't find the entry point for the java compiler. In java1.4 it's in
$JAVA_HOME/lib/tools.jar.

Have you JAVA_HOME set up? (needed by catalina.sh/bat)

- Original Message -
From: Gunter D'Hondt [EMAIL PROTECTED]
To: 'Tomcat Users List' [EMAIL PROTECTED]
Sent: Thursday, July 04, 2002 11:01 AM
Subject: Installation successfull but still problems!


 I've installed Tomcat 4.0 as described in the running.txt file and
 http://localhost:8080/ gives me the welcome page back. And if I try the
 Servlet Examples it works good but the JSP Examples (for example:
 http://localhost:8080/examples/jsp/num/numguess.jsp) always gives me the
 error below. What can I do to fix this?

 The error I get in my browser:

 type Exception report
 message Internal Server Error
 description The server encountered an internal error (Internal Server
Error)
 that prevented it from fulfilling this request.
 exception
 javax.servlet.ServletException: sun/tools/javac/Main
 at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:481)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
 FilterChain.java:247)
 at

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
 ain.java:193)
 at

org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
 va:243)
 at

org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
 66)
 at

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 at

org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
 va:190)
 at

org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
 66)
 at

org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase
 .java:475)
 at

org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
 64)
 at

org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:2
 46)
 at

org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
 64)
 at

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 at
 org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
 at

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

org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
 66)
 at

org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
 java:170)
 at

org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
 64)
 at

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

org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
 64)
 at
 org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
 at

org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
 64)
 at

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 at

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

org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
 66)
 at

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 at

org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:
 1027)
 at

org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125
 )
 at java.lang.Thread.run(Unknown Source)

 root cause
 java.lang.NoClassDefFoundError: sun/tools/javac/Main
 at

org.apache.jasper.compiler.SunJavaCompiler.compile(SunJavaCompiler.java:136)
 at org.apache.jasper.compiler.Compiler.compile(Compiler.java:272)
 at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:548)
 at

org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspSe
 rvlet.java:176)
 at

org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
 va:188)
 at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
 at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
 FilterChain.java:247)
 at

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
 ain.java:193)
 at

org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
 va:243)
 at

org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
 66)
 at

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

Property Editor

2002-07-04 Thread Mark O'Driscoll

I need to use jsp:setProperty with a value of a non supported type? I
need to register a Property Editor to do this.

Any ideas where I might find some info. on configuring specific data types
to work with the bean mechanisms for tomcat?

TIA

- Mark


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




Redirecting one jsp to another

2002-07-03 Thread Mark O'Driscoll

Can I easily redirect a single JSP to another?

Like:

servlet-mapping
servlet-name/one.jsp/servlet-name
url-pattern/two.jsp/url-pattern
/servlet-mapping

I know this doesn't work ... but what, if any, is the alternative.

I really want to call lots of jsps the same name.

e.g.
Warning.jsp, Info.jsp, Error.jsp all end up at Message.jsp where I can
determine the name and take appropriate action.

TIA

Mark


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