Re: filter question

2005-02-23 Thread Peter Davison
Hi Scott.

Your filter should probably set an attribute in the request or perhaps the
session, that your jsp could display, rather than writing to the response's
writer object.  By opening up the writer and writing to it you are effectively
setting the response to the request to be the contents of your call to the
printwriter.println() method.

For example: your doFilter method could have something like:

request.setAttribute(IPAddress, getIPAddress());

You'll have to write the getIPAddress() method. :-)

In your jsp, you could pull the stored value out of the request and display it
in the page:

IP Address: %= request.getAttribute(IPAddress) %


Hope that helps...

Regards,
Pete.

Quoting Scott Purcell [EMAIL PROTECTED]:

 Hello,
 I am having trouble with a filter. Code below.
  
 What I am trying to achieve is as follows: We have a current web-site, with a
 lot of jsp pages, etc. We are moving the code to a load-balanced environment,
 and I would like to put a hidden IP address into each display page. This
 way I can know which environment the page came from when debugging, etc.
  
 I figured I could use a 'filter' and have each page insert the IP into itself
 in a hidden field. I am unable to achieve my goal and could use a hand if
 anyone has experience with this. Is this possible, or will I have to write
 into a header and then edit each jsp page to show the value?
  
  
  
 Here is what I have, but it does not print anything on pages.
  
 web.xml
 filter
filter-nameHelloWorld/filter-name
filter-classchapter18.HelloWorldFilter/filter-class
   /filter
  
   filter-mapping
filter-nameHelloWorld/filter-name
url-pattern/*.jsp/url-pattern
   /filter-mapping
  
 And I have the servlet code from SCWCD book
 package chapter18;
  
 import java.io.*;
 import javax.servlet.*;
  
 
 public class HelloWorldFilter
 implements Filter
 {
  
 public void destroy()
 {
 }
  
 public void doFilter(ServletRequest servletrequest, ServletResponse
 servletresponse, FilterChain filterchain)
 throws ServletException, IOException
 {
 PrintWriter printwriter = servletresponse.getWriter();
 printwriter.println();
 }
  
 public void init(FilterConfig filterconfig)
 {
 filterConfig = filterconfig;
 System.out.println(Chapter 18: HelloWorldFilter initialized);
 }
  
 public HelloWorldFilter()
 {
 }
  
 private FilterConfig filterConfig;
 }
  
  
 Thanks,
 Scott
 


-- 
Peter Davison _/_/_/   _/_/_/   _/_/_/
e: [EMAIL PROTECTED] _/   _/  _/   _/  _/   _/
w: http://rpdavison.ca  _/_/_/   _/_/_/   _/   _/
c: 647 883 6486_/  _/   _/   _/   _/
h: 416 699 2964   _/   _/  _/   _/_/_/



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



Re: emergency - need to get into admin app

2004-04-19 Thread Peter Davison
Hi Stephen.

You need to modify the CATALINA_OPTS environment variable:
To give yourself a Gig of memory, try: 

export CATALINA_OPTS=-Xmx1024m

How you set this variable will depend on your environment/os etc.

Hope that helps.
Pete.

Quoting Stephen Charles Huey [EMAIL PROTECTED]:

 Ok, I took out the security tags and I can get in there.  Is the admin
 app where I set memory allocations in Tomcat???  I'm looking at adding an
 Environment Entry or something, but I don't know what to do with this! 
 Our total Java memory is only like 60 MB and we need at least a gig! 
 Thanks...
 
 
 - Original message -
 From: Parsons Technical Services [EMAIL PROTECTED]
 To: Tomcat Users List [EMAIL PROTECTED]
 Date: Mon, 19 Apr 2004 14:01:14 -0400
 Subject: Re: emergency - need to get into admin app
 
 NOTE: This is an emergency fix only and will leave you wide open.
 
 Edit the admin web.xml to allow no authentication.
 
 DO NOT LEAVE IT THIS WAY.
 
 What do you logs say?
 
 What does the server.xml look like? Please post it.
 
 Doug
 
 - Original Message - 
 From: Stephen Charles Huey [EMAIL PROTECTED]
 To: Tomcat Users List [EMAIL PROTECTED]
 Sent: Monday, April 19, 2004 1:48 PM
 Subject: emergency - need to get into admin app
 
 
  We reloaded the drives on our web server yesterday, but Tomcat keeps
  choking, and we think it's because not enough memory is allocated, and
  we're trying to get into the admin web application, but it keeps saying
  our password isn't correct.  Even though I set a password during the
  install, there was nothing in the tomcat-users.xml file, so I've now made
  it this, but we still can't get in:
  
  ?xml version='1.0' encoding='utf-8'? 
  tomcat-users
  role rolename=admin/
  role rolename=manager/
  role rolename=tomcat/
  role rolename=role1/
  user username=admin password=secret roles=manager,admin/
  user username=tomcat password=tomcat roles=tomcat/
  user username=role1 password=tomcat roles=role1/
  user username=both password=tomcat roles=tomcat,role1/
  /tomcat-users
  
  I've been restarting Tomcat after saving it after each modification. 
  
  My boss is literally breathing down my neck, so please write back ASAP if
  you have a clue, b/c Google isn't helping me out all that much!!!
  
  Thanks,
  Stephen
  
  -
  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]
 
 
 


-- 
Peter Davison
[EMAIL PROTECTED]

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



Re: Tomcat-Eclipse question

2003-12-03 Thread Peter Davison
Sure.

There's a plugin available for eclipse that allows you to run Tomcat within
eclipse.

You can find it here:

http://www.sysdeo.com/eclipse/tomcatPlugin.html

Regards,
Pete.

On Wed, 03 Dec 2003 22:28:05 -0400
Atreya Basu [EMAIL PROTECTED] wrote:

 Hello,
 
 I've got a question about integrating TOmcat and Eclipse together.  Has 
 anyone done it? 
 What I want to do is debug my Servlets as Tomcat is running.  I know the 
 command line to start Tomcat but I can't figure out what the parameters 
 are to start the JVM in debug mode and then attach to it from the 
 Eclipse Debugger.
 
 Anyone with experience or even suggestions?
 
 -- 
 
 Developer
 Greenfield Research Inc.
 atreya(AT)greenfieldresearch(DOT)ca
 (902)422-9426
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-- 
Peter Davison
[EMAIL PROTECTED]
h: 416 699 2964
c: 416 566 8461

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



Re: Un-tarring jakarta-tomcat-4.0.4.tar.gz

2002-09-18 Thread Peter Davison

It may be a problem with the default version of tar installed on Solaris.  I ran
into this problem (at around 4:00am the night/day before a project was due!). 
The version of tar that comes with Solaris has a nasty issue in that it limits
the length of the names of files to a very small number of characters (Can't
remember what that value is, but it's easy to overrun it).  If you try to use it
to untar a gnu-tarred archive that has names longer that the limit you wind up
with these mysterious errors.

Try installing gnu-tar and re-installing the tomcat archive.

You can find gnu-tar at:
http://www.gnu.org/software/tar/tar.html

Regards,
Pete.

On Tue, 17 Sep 2002 19:12:31 +0530
amit_mahajan [EMAIL PROTECTED] wrote:

 Hi,
 
 I need to install Tomcat 4.0.4 on a Sun Solaris 8 machine which has Apache
 1.3.26. 
 
 I have downloaded from the Tomcat site the file jakarta-tomcat-4.0.4.tar.gz
 which I am trying to un-tar on the Solaris machine but I keep getting a
 checksum error each time I try. And though a lot of folders are created, most
 of them are emtpy without the files in them. I am running the following
 commands :
 
 $gunzip  jakarta-tomcat-4.0.4.tar.gz
 $tar -xvf  jakarta-tomcat-4.0.4.tar
 
 However, if I unzip on a Win 2K machine, I am able to get a complete expanded
 directory. Also the size of the downloaded jakarta-tomcat-4.0.4.tar.gz file I
 have is 4.04 MB (4,241,667 bytes) - or 4,134 KB.
 
 Has anyone faced a similar problem or can someone please point out what I may
 be doing wrong.
 
 Thanks,
 Amit
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 


--
Peter Davison
[EMAIL PROTECTED]

What did you bring that book I didn't want to be read to out of about
Down Under up for?

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




Re: war file deployment problem

2002-09-06 Thread Peter Davison

Hi Dave.

I think you're making this more complicated than it needs to be.

Two things:
1. Try putting your war file in the $CATALINA_HOME/webapps directory rather than
 $CATALINA_HOME/webapps/dummy.  If your tomcat installation is set up to unpack
war files (this is the default) it will create the dummy webapp directory for
you and unpack everything into that directory when you restart tomcat.

2. The URL to use to access your webapp will also have to use port 8080.  Unless
you've modified your server.xml file and you're running tomcat as root that is. 
This set up will work with the out of the box tomcat installation.  No need to
modify server.xml at all.

You should then be able to access your app like this:
http://localhost:8080/dummy

See if that simplifies things.

Regards,
Pete  

On Fri, 6 Sep 2002 12:51:26 -0400 (EDT)
Dave Robbins [EMAIL PROTECTED] wrote:

 Hello All,
 kindof a newbie here so be gentle
 I wrote a little dummy app with Forte 4.0 that consists of a jsp page with 
 a link that calls a servlet which does a database lookup and spews out some 
 data. It works fine with the built in copy of Tomcat that comes with Forte.
 I build a war file and try to deploy it on another machine with Tomcat 
 4.0.4 on it. I put my file dummy.war in the $CATALINA_HOME/webapps/dummy 
 dir and use this command from a browser
 
 http://localhost:8080/manager/install?
 path=/dummywar=jar:file:$CATALINA_HOME/webapps/dummy/dummy.war!/
 
 now the command
 
 http://localhost:8080/manager/install
 
 tells me that my app is running, but when I try to access it with
 
 http://localhost/dummy or http://localhost/dummy/index.jsp it says the 
 resource is not available. I kinda thought Tomcat could access the war file 
 in it's bundled state but after reading the docs I got the impression the 
 manager app was gonna expand it, is that true? In my case the file wasn't 
 expanded. After some head scratching I figured I'd manually expand the war 
 file in the $CATALINA_HOME/ROOT dir. After doing that and restarting Tomcat 
 everything works fine with http://localhost/index.jsp.
  
 So, let me ask a few questions
 
 1) What does the manager app do
 does it modify $CATALINA_HOME/conf/server.xml
 should it expand the war file
 
 2)If I'm gonna deploy multiple apps, what's the typical dir structure
 $CATALINA_HOME/ROOT/app1, $CATALINA_HOME/ROOT/app2, etc
 could i deploy an app outside the Tomcat dir structure (ie /home/mydir)
 
 3)Is this the correct flow of things
 Tomcat starts up and reads $CATALINA_HOME/conf/server.xml and now knows 
 about the apps that are installed and what path they're mapped to. when a 
 client tries to access an app, Tomcat goes and looks in the jar file and 
 reads web.xml to discover what all is in the war file. Within the war file 
 any static content goes in the WEB-INF dir, class files go in WEB-
 INF/classes and .jar files goe in WEB-INF/lib
 
 hep me, hep me
 
 Dave
 
 
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 


--
Peter Davison
[EMAIL PROTECTED]

...the increased productivity fostered by a friendly environment and quality
tools is essential to meet ever increasing demands for software.
-- M. D. McIlroy, E. N. Pinson and B. A. Tague

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




Re: NotSerializableException

2002-08-20 Thread Peter Davison

It looks like Tomcat is trying to serialize a session.  Are you storing an
IMAPFolder object in the session?

It kacks because com.sun.mail.imap.IMAPFolder is not serializable.

P.


On Tue, 20 Aug 2002 07:41:48 -0700 (PDT)
Luminous Heart [EMAIL PROTECTED] wrote:

 I am not asking tomcat to serialize my app, nor do I
 have any serialization in this application.  Why am I
 getting this new exception?
 
 2002-08-19 21:06:27 StandardManager[/NoPassApp]
 Exception loading sessions from persistent storage
 java.io.WriteAbortedException: writing aborted;
 java.io.NotSerializableException:
 com.sun.mail.imap.IMAPFolder
 at
 java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1278)
 at
 java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
 at
 java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
 at
 java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
 at
 java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
 at
 java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
 at
 org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1
 268)
 at
 org.apache.catalina.session.StandardSession.readObjectData(StandardSession.ja
 va:810)
 at
 org.apache.catalina.session.StandardManager.load(StandardManager.java:411)
 at
 org.apache.catalina.session.StandardManager.start(StandardManager.java:617)
 at
 org.apache.catalina.core.StandardContext.reload(StandardContext.java:2497)
 at
 org.apache.catalina.loader.WebappContextNotifier.run(WebappLoader.java:1332)
 at java.lang.Thread.run(Thread.java:536)
 Caused by: java.io.NotSerializableException:
 com.sun.mail.imap.IMAPFolder
 at
 java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054)
 at
 java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1330)
 at
 java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1302)
 at
 java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1245)
 at
 java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
 at
 java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
 at
 org.apache.catalina.session.StandardSession.writeObject(StandardSession.java:
 1338)
 at
 org.apache.catalina.session.StandardSession.writeObjectData(StandardSession.j
 ava:827)
 at
 org.apache.catalina.session.StandardManager.unload(StandardManager.java:507)
 at
 org.apache.catalina.session.StandardManager.stop(StandardManager.java:654)
 at
 org.apache.catalina.core.StandardContext.reload(StandardContext.java:2409)
 ... 2 more
 
 
 __
 Do You Yahoo!?
 HotJobs - Search Thousands of New Jobs
 http://www.hotjobs.com
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 


--
Peter Davison
[EMAIL PROTECTED]

When I hear a man applauded by the mob I always feel a pang of pity
for him.  All he has to do to be hissed is to live long enough.
-- H.L. Mencken, Minority Report

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




Re: Setup - Samples not working

2002-08-14 Thread Peter Davison
)
   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.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:2343)
   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:
 1012)
   at
 org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107
 )
   at java.lang.Thread.run(Unknown Source)
 
 --
 François Godbout, chargé de projet
 Département des TI
 Raymond Chabot Grant Thornton
 Téléphone : (514) 878-2691  ext:2176
 
 Messages de confidentialité 
 
 Ce courriel (de même que les fichiers joints) est strictement réservé à
 l'usage de la personne ou de l'entité à qui il est adressé et peut contenir
 de l'information privilégiée et confidentielle. Toute divulgation,
 distribution ou copie de ce courriel est strictement prohibée. Si vous avez
 reçu ce courriel par erreur, veuillez nous en aviser sur-le-champ, détruire
 toutes les copies et le supprimer de votre système informatique. 
 
 Merci. 
 
 Confidentiality Notice 
 
 This communication (including any files transmitted with it) is intended
 solely for the person or entity to whom it is addressed, and may contain
 confidential or privileged information. The disclosure, distribution or
 copying of this message is strictly forbidden. Should you have received this
 communication in error, kindly contact the sender promptly, destroy any
 copies and delete this message from your computer system. 
 
 Thank you.
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 


--
Peter Davison
[EMAIL PROTECTED]

A watched clock never boils.

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




Re: Problems using a tomcat 3.3 .war file with tomcat 4.0.3

2002-05-27 Thread Peter Davison

Sounds like your web.xml file has a problem in it somewhere.  Sometimes the
messages you get from the parser don't necessarily point you to the actual
problem (much like compilers I guess).  Can you post the contents of your
web.xml so that we can have a look?

Pete

On Mon, 27 May 2002 14:05:48 +0200
Steinar Bang [EMAIL PROTECTED] wrote:

 Platform: Intel PIII, RedHat 7.2, apache 2.0.35 from the RPM in URL
   http://ftp.falsehope.com/home/gomez/apache2/,
  tomcat 4.0.3, and mod_jk2 from RPMs in
   http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.0.3
   /rpms/
 
 I am trying to use a .war created for use with tomcat 3.3, with tomcat
 4.0.3.  
 
 Is this supposed to work?  Searches on the web hasn't found me any
 place that talks about this.
 
 What I have done, is to drop the .war file in /var/tomcat4/webapps/.
 
 When starting, tomcat4 writes the following to the
 /var/tomcat4/logs/catalina.log file:
 
 Starting service Tomcat-Standalone
 Apache Tomcat/4.0.3
 PARSE error at line 138 column 12
 org.xml.sax.SAXParseException: The content of element type web-app must
 match(icon?,display-name?,description?,distributable?,context-param*,servlet
 *,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-pag
 e*,taglib*,resource-ref*,security-constraint*,login-config?,security-role*,en
 v-entry*,ejb-ref*).
 
 line 138 of the web.xml file of the .war file I'm using contains the
 /web-app end tag, with the  as the final character on the line,
 in column 10 (ie. there is no column 12 on that line).
 
 All ideas, hints, etc. appreciated!
 
 Thanx!
 
 
 - Steinar
 
 
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 


--
Peter Davison
[EMAIL PROTECTED]

A wide-eyed, innocent UNICORN, poised delicately in a MEADOW filled
with LILACS, LOLLIPOPS  small CHILDREN at the HUSH of twilight??

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




Re: IllegalAccessError when run from Tomcat

2002-04-18 Thread Peter Davison

Has anyone found a solution for this problem yet?

I've scanned the news groups, search the web all to no avail.
This error happens in my servlet when I used JTidy to parse an uploaded file.

Any help would be greatly appreciated.

Thanks.
Pete.

On Fri, 15 Jun 2001 11:20:22 -0400
[EMAIL PROTECTED] wrote:

 When running a servlet from within Tomcat I get the following exception:
 
 java.lang.IllegalAccessError: try to access field
 org.w3c.tidy.ParserImpl._parseHead from class
 org.w3c.tidy.ParserImpl$ParseHTML at
 org.w3c.tidy.ParserImpl$ParseHTML.parse(ParserImpl.java) at
 org.w3c.tidy.ParserImpl.parseDocument(ParserImpl.java) at
 org.w3c.tidy.Tidy.parse(Tidy.java) at
 org.w3c.tidy.Tidy.parseDOM(Tidy.java)...
 
 A method in the inner class $ParseHTML is trying to access a private field
 _parseHead in the containing class, but that is legal as far as I know.
 When I move the body of this servlet to a stand alone application it runs
 fine - no exceptions.  Is there some strange JVM security manager here that
 is different from running as a real application?  Anyone have an idea what
 is going on?


--
Peter Davison
[EMAIL PROTECTED]

Mary Tyler Moore's SEVENTH HUSBAND is wearing my DACRON TANK TOP in a
cheap hotel in HONOLULU!

--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: What does IMHO mean?

2002-04-14 Thread Peter Davison

In My Humble Opinion

P.

On Sun, 14 Apr 2002 09:58:17 -0700
Micael Padraig Og mac Grene [EMAIL PROTECTED] wrote:

 What does IMHO mean?
 
 
 
 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]
 


--
Peter Davison
[EMAIL PROTECTED]

In every job that must be done, there is an element of fun.
Find the fun and snap!  The job's a game.
And every task you undertake, becomes a piece of cake,
a lark, a spree; it's very clear to see.
-- Mary Poppins

--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: CVS

2001-11-20 Thread Peter Davison

Hi Laurent.

I think you are on the right track.  Here's how we used CVS in my last
work environment which worked great - IMHO.

One central CVS server.
Everytime our CM person performed a successful build the project's files would
be tagged with that builds ID.  This way we could always reproduce the build at 
any point in the future.
When we were approaching the end of a projects cycle and the code was pretty
much stable we would branch the project and label the branch with the release
version number.  As bugs were reported back on that release, the bugs would be
fixed on the branch code.  Meanwhile work on the next release would continue
and applied to the trunk (main line) code.  Any bug fixes that were applied to
the branch code would get merged into the main line if it made sense to do so.

When you say each developer would get a version... I assume you mean that
each developer has their own version of the project.  This is how we did it.
Each developer had their own copy of the code (the whole project).  Developers
would update their copy regularly to have the most up to date code on their 
machines.  This way any changes made would most likely work with the rest
of the project.  When a developer is ready to check in changes, they would
first update their code to make sure that they had the most recent codebase, 
re-compile to ensure their changes wouldn't break the build, re-run the 
unit test suite to make sure they hadn't broken any functionality then
commit their changes.  The best way to do this is to check in frequently.
That way when you do have conflicts they are small and can be easily fixed.
CVS in general handles merges very well.  It's only when two people modify the
same lines in the same file that you get conflicts happening.  This happens
very, very rarely.  The process can be completely painless if you check in 
frequently, and don't wait for extended periods of time before checking in.
You always want to be working with the latest source code in the repository.

We were also using Tomcat as our server and yes each developer had a
copy of it.  This worked very well.  For one reason it isolated your testing
environment.  Because you were working on your own machine with your own copy
of Tomcat, when an exception occurred or something unexpected happened you 
knew that it was due to something you did, and wasn't the result of some external 
action.
To make sure that each developer had the
same setup we checked our modified version of Tomcat into CVS as well.
That way all that a developer had to do to set up Tomcat on their machine
was to check it out and start it up.

So each developer would have the complete system needed to do their work and
could run their tests in isolation from other developers.

Our CM person would do nightly builds and install them on a QA server (several servers
actually).  The QA team would use these servers as their test subjects.  They would 
also
have one server per tester so that when bugs were found they would have a good idea of
what action cause the error (since they were the only person interacting with that 
server).
Bugs would be reported quoting the build number that was attached to that build.

Hope this helps.

Regards,
Pete.

On Tue, 20 Nov 2001 15:21:55 +0100
Laurent Michenaud [EMAIL PROTECTED] wrote:

 Ok, but i've got a lot of question about the organisation.
 Here how i would see the cvs server for our case :
 - There would be a cvs server with different branches( stable,
 developpement... )
 - Each developper would get a version, work it on local and then update
 it( i don't have
   any ideas about the times per day of update ).
 - Each developper would have a local tomcat on his machine( not very
 good i think ).
 - Our web server would check the cvs server for the latest stable enough
 sources.
   The tomcat on the web server would be used only for global testing.
 Am i right ?
 
 Do u see others points ?
 We have no experience at all about cvs in our enterprise and it's quite
 worrying.
 
 a+
 
 
 
 
 De : Samuel Rochas [mailto:[EMAIL PROTECTED]]
 Envoyé : mardi 20 novembre 2001 15:26
 À : Tomcat Users List
 Objet : Re: CVS
 
 
 Bonjour, 
 
 Laurent Michenaud wrote:
  
  Would be CVS a good thing for our environnment ?
 CVS, or any other configuration management tool is a must while having a
 team working on a project. You can use some free tools, like the CVS
 with clients like WinCVS. You can use some (mostly quite expensive)
 commercial tools if you like.
 
  Are there any model of organisation that we would use ?
 all what you need is a file system and a network connection between the
 users.
 Take a look at http://www.gnu.org/manual/cvs-1.9/cvs.html and
 http://www.cvshome.org/
 
 Slts
 Samuel Rochas
 -- 
 SWIPe Software Engineering  Project Management GmbH
 
 Solutions with Individual Profile
 
 Web: http://www.swipe.de
 
 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles 

Re: CVS

2001-11-20 Thread Peter Davison


Consider yourself flamed.  :-)

My experience with VSS was that it did not work.  We actually had a person in one of 
our offices who
was responsible for maintaining VSS - this wasn't their only job of course, but it
consumed a great deal of their time.  Our team was working on a separate unrelated 
module of 
the project and were using CVS as the repository.  I don't think that we had to do 
anything
as far as maintainence was concerned, just regular backups to tape (but that should be 
done
regardless).

The other problem we had with VSS was trying to use remote access.  We had another 
project
that we were collaborating on - several thousand files.  It would take hours
to check out the project and this was over a T1.  Through weeks of lobbying we were 
able to 
convince our colleagues to switch to CVS.  Check out times came down a few minutes. 
They have never looked back.

Just my $0.02.

Regards,
Pete.

 I may get flamed for this, but if you're organization is small you may want
 to consider M$'s Sourcesafe.  It's concepts may be a little bit easier to
 adapt to if you have no experience w/ CVS.  CVS is a great and powerful
 tool, but if you have no experience w/ it, you could run into some serious
 migration problems.

--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: Can I configure Tomcat to accept HTTP requests from remote machines?

2001-09-13 Thread Peter Davison

Hi Ray.

localhost is just that - it is accessible only to the local machine.
In order to make your server accessible to other machines you need to specify it's
IP address in the server.xml file.

In the connectors section of server.xml you need to replace 127.0.0.1 with
the IP of your machine.

   !-- Normal HTTP --
Connector className=org.apache.tomcat.service.PoolTcpConnector
Parameter name=handler 
value=org.apache.tomcat.service.http.HttpConnectionHandler/
Parameter name=inet value=127.0.0.1/
Parameter name=port value=8080/
/Connector

Once you've done this a restarted you can access your webserver remotely by 
specifying the actuall IP and port number in use.

Hope that helps.
Pete.


On Thu, 13 Sep 2001 10:16:10 -0400
Raymond Reid [EMAIL PROTECTED] wrote:

RR Can I configure Tomcat to accept http requests from remote IP addresses
RR without running another web server at the same time? I
RR currently have Tomcat 3.2.3 installed on NT 4.0 Service pack 6.  After
RR configuring Tomcat, I can enter http://localhost8080
RR into the location field in my browser and see the welcome page.  But
RR when I try to access the same page from a
RR different computer using the IP address of the machine I have Tomcat
RR running on, the page won't come up.
RR 
RR Do I need to be running Apache with Tomcat to access pages remotely?  If
RR someone could please point me in the right
RR direction, I would really appreciate it.
RR 
RR Thanks,
RR Ray



Re: Multiple servlets using same initParameters

2001-08-14 Thread Peter Davison

How about this:

Set up your init params for one of your servlets.
Make sure that this servlet get's pre-loaded first before the other
servlets.
Have the init() method of that servlet store all the parameters as 
System properties and let the other servlets retrieve the parameters
as System properties instead of init params.  A bit of a hack but it 
works.

P.


On Tue, 14 Aug 2001 17:38:26 -0400
[EMAIL PROTECTED] wrote:

 I have multiple servlets in the same directory and they all get the same
 init-params from web.xml.
 
 Currently, I have 5 servlets and am required to repeat all the init-params
 5 times, one for each servlet.  So if one parameter changes, I have to
 change it five times in web.xml. I'd like to only have them in the web.xml
 file once and all servlets use them.  How is this possible?
 
 One approach I took was to create a servlet that all my other servlets
 subclassed and all it did was grab the init-params.  I couldn't get it to
 work.
 
 Any ideas?
 
 Thanks,
 
 JEB



Re: Servlet File upload Oreily MultipartParser problems

2001-07-07 Thread Peter Davison

I've got it to work on Linux but only using Tomcat stand-alone, not with
apache.

If I understand correctly, you are getting the input stream from the
request directly - req.getInputStream().

My understanding on how the MultipartParser works is that you instantiate 
a MultipartParser giving it the request, then iterate through the parts handling
the ParamParts one way and the FileParts another.  Something like:

MultipartParser mp = new MultipartParser(request, ...)
Part p = null;
while ((p = mp.readNextPart()) != null)
{
if p is a paramPart ...
else if p is a filePart
{
FilePart fp = (FilePart) p;
InputStream is = fp.getInputStream();

}
}

So each FilePart has it's own inputStream.

Not sure what the Ys you are seeing mean, but the above works for me.

Regards,
Pete.
Thus spake Randy Paries [EMAIL PROTECTED] on Sat, 7 Jul 2001 09:11:53 -0500:

RP Hello,
RP 
RP does anyone have the Oreily MultipartParser file upload working with Tomcat
RP and apache on Linux.
RP 
RP I have developed this upload servlet using Jbuilder 4 and Win2000. The
RP servlet works with the Jbuilder debugger(tomcat 3.1) and jrun. But is does
RP work when I push it to my production linux box.
RP 
RP When I execute the form to upload the image on the linux box, the form just
RP hangs.
RP 
RP what is strange is that every time
RP ServletInputStream in = req.getInputStream();
RP is called I get a Y printed on the console.
RP 
RP Do anyone have this working on the linux config?
RP 
RP has anyone seen a similar problem?
RP 
RP Thanks
RP 
RP Randy
RP 



Re: creating a instance of a servlet: takes too long!!

2001-07-06 Thread Peter Davison

There's another reason for this and it has to do with the java.security.SecureRandom 
class.
From what I can tell, tomcat uses this class to generate a seed value for the
session ID.  The first request for a SecureRandom value (eg. new 
SecureRandom().nextLong()) can take many, many seconds to complete.  After the
first usage however, it returns immediately.  I'm not sure what goes on when
SecureRandom initializes but that seems to be where the slow down occurs.

As a work around, you could create a low priority thread that instantiates a
SecureRandom calls nextLong() then exits, and have this thread get launched by
the init() method of a servlet that gets preloaded.  This solution worked for me.

Regards,
Pete.

Thus spake pedro salazar [EMAIL PROTECTED] on Fri, 6 Jul 2001 10:01:37 
+0100:

PS Greetings,
PS 
PS why is that my servlet when the first time is invoked, it takes about 30
PS seconds or more to start when the servlets that came in tomcat are
PS instantaneous? After the servlet container instantiated and initialized my
PS servlet, all the following requests are very fast. Is there any advice for
PS what we should do and don't do in init() method? I just initialize some
PS properties and a connection pool
PS Well is it possible that my servlet container at any time my may shutdown my
PS servlet to release memory, and another time it will be requested to start
PS again and take another time too long to start, correct?
PS 
PS How can I benchmark the time of instantiation of my servlet and the time of
PS my init method?
PS 
PS System configuration:
PS -Tomcat 3.2.1
PS -JDK 1.3
PS -Linux RedHat 6.2 [kernel 2.2.18]
PS -PII400Mhz 256Mbytes
PS 
PS thanks.
PS --
PS psalazar/
PS 
PS 



Re: Tomcat won't start with j2sdk 1.3.1 Linux

2001-06-27 Thread Peter Davison

We've been using Sun's JDK 1.3.1 on Linux for a while now.
Currently we use Tomcat 3.2.1 and xerces version 1.3.0.

It seemed to work fine on RedHat 6.1 but on 7.1 there was a link that missing.
I think I experienced the same seg fault issue that is referred to below.

If this is the problem it can be fixed by doing the following as root:

cd /lib/i686

The required link is libpthread.so.  If it isn't there then create it:

ln -s libpthread.so.0 libpthread.so

Then run:
/sbin/ldconfig

This fixed the problem with regards to running 1.3.1 on RedHat Linux 7.1.

Hope this helps.

P.

On Wed, 27 Jun 2001 11:33:37 -0400
Jeffrey Lam [EMAIL PROTECTED] wrote:

JL Switching to IBM's JDK 1.3 solved my problem of the HttpConnectionHandler not
JL being able to start.  Thank you!
JL 
JL I was using Sun's JDK 1.3.0_02 and my problem arose when I upgraded to Sun's
JL JDK1.3.1
JL 
JL Thanks again!
JL 
JL - Original Message -
JL From: pete [EMAIL PROTECTED]
JL To: [EMAIL PROTECTED]
JL Cc: [EMAIL PROTECTED]
JL Sent: Wednesday, June 27, 2001 0:58
JL Subject: Re: Tomcat won't start with j2sdk 1.3.1  Linux
JL 
JL 
JL  I get this. It sucks.
JL 
JL  The issue, for me at least, stems from the fact that i am running a
JL  Struts project, and i need to override the jaxp.jar classes with xerces
JL  parser classes.
JL 
JL  I previously did this by putting a jar named 0xerces.jar in the lib/
JL  folder of my tomcat install, which worked fine, since those classes
JL  loaded before the ones specified in jaxp.jar.
JL 
JL  This worked great with IBM's JDK1.3.0 - never used Sun's 1.2.2 on Linux.
JL 
JL  However, since 'upgrading' to Sun's JDK1.3.1 with Hotspot, the JVM
JL  segfaults when tomcat starts up, giving the same error you describe.
JL 
JL  I'm not sure why this happens, but maybe 1.3.1 doesn't like having its
JL  classes overridden.
JL 
JL  There are 2 ways around this - invoke the JVM with the '-classic'
JL  switch, thus disabling the JIT, or to remove 0xerces.jar from lib/,
JL  which breaks my Struts projects.
JL 
JL  The third solution is not to use the JDK1.3.1 at all, and stick with the
JL  IBM JDK, which is my current course of action.
JL 
JL  Hope this helps, and i hope you find a better solution than i did.
JL 
JL  -Pete
JL 
JL 
JL 
JL 



Re: sun/tools/javac/Main?

2001-06-27 Thread Peter Davison

You need to include tools.jar in your classpath (tools.jar contains the java
compiler - javac - required to compile JSPs.).  You should find the jar file 
in the lib directory where you installed your JDK.

P.

Thus spake Guoben Li [EMAIL PROTECTED] on Wed, 27 Jun 2001 16:46:06 -0700 (PDT):

GL Hi,
GL 
GL   I have Tomcat 3.2.1 configured with Apache on Sun
GL Solaris 2.7. A home-made servlet I compiled and put in
GL $TOMCAT_HOME/webapps/examples/WEB-INF/classes/ runs as
GL expected.
GL 
GL   When I tried any Tomcat provided JSP example in
GL http://myserver/examples/jsp/index.html, however, I
GL got
GL 
GL Internal Servlet Error:
GL 
GL javax.servlet.ServletException: sun/tools/javac/Main
GL at
GL org.apache.jasper.servlet.JspServlet.service(JspServlet.java:399)
GL ...
GL 
GL Root cause:
GL 
GL java.lang.NoClassDefFoundError: sun/tools/javac/Main
GL at
GL org.apache.jasper.compiler.SunJavaCompiler.compile(SunJavaCompiler.java:128)
GL ...
GL 
GL   Has anybody seen this error and found a solution?
GL There is no directory sun or tools on this server.
GL 
GL Thanks in advance.
GL 
GL Guoben Li
GL myCFO
GL 
GL 
GL __
GL Do You Yahoo!?
GL Get personalized email addresses from Yahoo! Mail
GL http://personal.mail.yahoo.com/



Re: FIRST POST - Servlet installation problem

2001-06-27 Thread Peter Davison

Hi Clifford.

Note the lack of :8080 in the URL you mention.

Try this: 

http://localhost:8080/servlet/myservlet

and see if that works any better.

P.

CH I'm using the url: http://localhost/servlet/myservlet
CH 



Re: JSP files not working after upgrade

2001-06-06 Thread Peter Davison

There is, from what I understand, a known issue surrounding, Redhat 7.1 and
some Java VMs. I know this affects Sun's JVM.   I can't remember where I saw this fix 
(I believe it was
on the javasoft site - probably in the bug list), but what you need to do to 
get Sun's java working on RedHat 7.1 systems is to create a missing link.

If you do the following (as root) it fixes the problem:

cd /lib/i686
ln -s libpthread.so.0 libpthread.so
/sbin/ldconfig

You should be able to use the Sun JVM now.  Whether this solves your particular
 problem or not I don't know.  Maybe it might provide a clue.

Just FYI, I'm using Sun's jdk 1.3.1.

Regards,
Pete.

On Wed, 6 Jun 2001 20:56:16 -0700
Bob Law [EMAIL PROTECTED] wrote:

BL I had tomcat 3.2.1 with IBM jdk118 working on Redhat 6.2.  After
BL upgrading to 7.1 java no longer worked.  Upgrading to IBMJava2-13 works
BL with java and now servlets work, but JSP files, even the ones in the
BL tomcat examples don't.  They abort in the compilation stage with a stack
BL overflow error. Does anybody know what is wrong?
BL  
BL Thanks,
BL  Bob Law
BL  
BL 



Re: Why Use apache

2001-05-02 Thread Peter Davison

In a word: speed.

Tomcat is a java application, which runs in a JVM and because of this it runs
fairly slowly.
Apache is (AFAIK) written in C and runs native, and therefore is a lot 
faster.

P.

On Wed, 2 May 2001 09:48:24 -0500 
Skinner, Dallas M [EMAIL PROTECTED] wrote:

RPD Excuse me if this question is obvious.  If Tomcat can be run in a standalone
RPD mode, why should it be used in conjunction with apache?
RPD 
RPD Thanks
RPD 
RPD Dallas Skinner



Re: Java Update on Linux

2001-04-12 Thread Peter Davison

Is there actually a JDK 1.3.1 version or are you referring to the JDK 1.3.0_02 release?

By the way no, I haven't tried it (regardless of what the version number is.)
We are currently using 1.3.0.

Pete.

On Thu, 12 Apr 2001 08:26:59 -0700
Hunter Hillegas [EMAIL PROTECTED] wrote:

 Anyone tried the JDK1.3.1 that Sun released recently for Linux?
 
 They claim reliability enhancements... Just wondering.
 
 Hunter



Re: Java Update on Linux

2001-04-12 Thread Peter Davison

Never mind.  I found the link. (It pays to read doesn't it) ;-).

P.

On Thu, 12 Apr 2001 13:28:52 -0400
Peter Davison [EMAIL PROTECTED] wrote:

 Is there actually a JDK 1.3.1 version or are you referring to the JDK 1.3.0_02 
release?
 
 By the way no, I haven't tried it (regardless of what the version number is.)
 We are currently using 1.3.0.
 
 Pete.
 
 On Thu, 12 Apr 2001 08:26:59 -0700
 Hunter Hillegas [EMAIL PROTECTED] wrote:
 
  Anyone tried the JDK1.3.1 that Sun released recently for Linux?
  
  They claim reliability enhancements... Just wondering.
  
  Hunter



Re: RV: TOMCAT JSP EXECUTION

2001-03-29 Thread Peter Davison

You need to include "tools.jar" in your classpath.  The java compiler
"sun.tools.javac.Main" is included in that jar file which is part of the 
JDK, not the JRE.

Hope that helps.

Pete Davison

On Thu, 29 Mar 2001 14:00:27 +0200
Sierras [EMAIL PROTECTED] wrote:

  
 -Mensaje original-
 De: Sierras 
 Enviado el: dijous, 29 / mar / 2001 13:50
 Para: '[EMAIL PROTECTED]'
 Asunto: TOMCAT  JSP EXECUTION
 
 
 Hi! I'm a newby in Tomcat. I've recently install TOMCAT 4.0 b1. I' ve
 created a context for my application  and I can't execute any JSP. Not
 also those coming in the examples example. But I can execute servlet's.
 The message that I get is this "java.lang.NoClassDefFoundError:
 sun/tools/javac/Main". Is that normal? Can anybody help me???
  
  
 Thanks in advance.