RE: Why is tomcat taking so long to start?

2010-03-25 Thread Mon Cab
Charles 

While this may be an unsupported version of Tomcat, version support is not an 
issue for us here.  I am guessing that Tomcat 5.0 should not be having these 
issues, just because it is no longer supported. 

What are the other problems you alluded to?  




--- On Thu, 3/25/10, Caldarale, Charles R chuck.caldar...@unisys.com wrote:

 From: Caldarale, Charles R chuck.caldar...@unisys.com
 Subject: RE: Why is tomcat taking so long to start?
 To: Tomcat Users List users@tomcat.apache.org
 Date: Thursday, March 25, 2010, 5:56 PM
  From: Pid [mailto:p...@pidster.com]
  Subject: Re: Why is tomcat taking so long to start?
  
  You have some errors there, you're trying to start
 multiple Connectors
  on port 8443, so the second one fails.
 
 To say nothing of several other problems, the most glaring
 of which is using an unsupported version of Tomcat. 
 
  - Chuck
 
 
 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR
 OTHERWISE PROPRIETARY MATERIAL and is thus for use only by
 the intended recipient. If you received this in error,
 please contact the sender and delete the e-mail and its
 attachments from all computers.
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 


  

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat writing the wrong timestamp on compiled JSP's

2009-08-14 Thread Mon Cab

Yes.  That fixed it.  Thankyou Kees.  

For some reason, the issue was with my  WinSCP client.  

When I edited a jsp and then looked at the jsp file timestamp on the remote 
machine with WinSCP it showed the timestamp as my the current time (local and 
remote system times are the same).  However, when I looked up the timestamp of 
the same edited JSP on the remote box it was stamped an hour ealier than the 
current time.  

I reconfigured WinSCP not to preserve the timestamp, and that fixed the issue.  
The wierd thing is that now WinSCP is showing the remote JSP files as being 
timestamped an hour later.  Since the system time on my local machine is 
correct,  I'm a bit confused as to what WinSCP is doing here.  






- Original Message 
From: Kees Jan Koster kjkos...@gmail.com
To: Tomcat Users List users@tomcat.apache.org
Sent: Friday, August 14, 2009 12:40:54 AM
Subject: Re: Tomcat writing the wrong timestamp on compiled JSP's

Dear Mon Cab,

 Given the results below it looks like this is not a daylight savings time 
 issue.  In fact its extremely odd behavior.  Both Tomcat and the OS have the 
 correct time, and yet when Tomcat compiles the JSP, the java and class files 
 in the work directory have a create / modified time-stamp exactly 1 hour 
 ahead of the time that they were created.

I have seen these issues in situations where I was working on an NFS drive when 
the server and my local machine had different ideas about what time it was.

Are you working on a local disk, or a network mounted drive?
--
Kees Jan

http://java-monitor.com/
kjkos...@kjkoster.org
06-51838192

The secret of success lies in the stability of the goal. -- Benjamin Disraeli


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


  

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat writing the wrong timestamp on compiled JSP's

2009-08-14 Thread Mon Cab

Thanks Kees

It looks like this is a known issue with the WinSCP client.  The issue is with 
UTC vs DST, and seems to result from an assumption as to whether the remote 
server adjusts for DST or not.  It results in WinSCP both displaying incorrect 
timestamps for files on the server, as well as writing wrong timestamps when 
uploading.  





- Original Message 
From: Kees Jan Koster kjkos...@gmail.com
To: Tomcat Users List users@tomcat.apache.org
Sent: Friday, August 14, 2009 1:27:00 AM
Subject: Re: Tomcat writing the wrong timestamp on compiled JSP's

Dear Mon Cab,

 Yes.  That fixed it.  Thankyou Kees.

Glad to help.

 For some reason, the issue was with my  WinSCP client.
 
 When I edited a jsp and then looked at the jsp file timestamp on the remote 
 machine with WinSCP it showed the timestamp as my the current time (local and 
 remote system times are the same).  However, when I looked up the timestamp 
 of the same edited JSP on the remote box it was stamped an hour ealier than 
 the current time.
 
 I reconfigured WinSCP not to preserve the timestamp, and that fixed the 
 issue.  The wierd thing is that now WinSCP is showing the remote JSP files as 
 being timestamped an hour later.  Since the system time on my local machine 
 is correct,  I'm a bit confused as to what WinSCP is doing here.

I have yet to meet a developer who truly understands working with time zones 
and who can write code that deals with multiple time zones correctly. I have 
met loads of developers who think they can, though. ;-)

Also, NTP is your friend.
--
Kees Jan

http://java-monitor.com/
kjkos...@kjkoster.org
06-51838192

Human beings make life so interesting. Do you know that in a universe so full 
of wonders,
they have managed to invent boredom. Quite astonishing... -- Terry Pratchett


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


  

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Tomcat writing the wrong timestamp on compiled JSP's

2009-08-13 Thread Mon Cab

When I edit a JSP, tomcat is compiling the JSP (both java and class files)  in 
the work directory with a timestamp exactly 1 hour greater than the current 
time.  

Eg. If I edit a jsp (after emptying the work directory), at 20:00, and then 
load the page from a client, class and java files will appear in the work 
directory with a timestamp of 21:00. 

I thought this might be a issue with the JVM time, however, when I look at the 
tomcat logs Tomcat is gorreclt logging time in the logs, exactly the same as 
the system time.  

Does anyone have any idea why this might be happening?  


  

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat writing the wrong timestamp on compiled JSP's

2009-08-13 Thread Mon Cab

That's what I thought.  

However if I edit and reload a file at 20:00, and check the system time with 
date command I get 20:00 as the system time. 
And yet the compiled Java and Class files are timestamped 21:00







- Original Message 
From: Andre-John Mas aj...@sympatico.ca
To: Tomcat Users List users@tomcat.apache.org
Sent: Thursday, August 13, 2009 8:50:54 PM
Subject: Re: Tomcat writing the wrong timestamp on compiled JSP's

The time stamp on the file is given by your OS. What operating system and 
version are you using? Also, what time zone are you in?

André-John

On 13-Aug-2009, at 23:38, Mon Cab wrote:

 
 When I edit a JSP, tomcat is compiling the JSP (both java and class files)  
 in the work directory with a timestamp exactly 1 hour greater than the 
 current time.
 
 Eg. If I edit a jsp (after emptying the work directory), at 20:00, and then 
 load the page from a client, class and java files will appear in the work 
 directory with a timestamp of 21:00.
 
 I thought this might be a issue with the JVM time, however, when I look at 
 the tomcat logs Tomcat is gorreclt logging time in the logs, exactly the same 
 as the system time.
 
 Does anyone have any idea why this might be happening?
 
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat writing the wrong timestamp on compiled JSP's

2009-08-13 Thread Mon Cab
Sorry forgot to answer your other questions.  I'm using Fedora, and timezone is 
PDT.  Pacific.  





- Original Message 
From: Mon Cab futo...@yahoo.com
To: Tomcat Users List users@tomcat.apache.org
Sent: Thursday, August 13, 2009 8:55:43 PM
Subject: Re: Tomcat writing the wrong timestamp on compiled JSP's


That's what I thought.  

However if I edit and reload a file at 20:00, and check the system time with 
date command I get 20:00 as the system time. 
And yet the compiled Java and Class files are timestamped 21:00







- Original Message 
From: Andre-John Mas aj...@sympatico.ca
To: Tomcat Users List users@tomcat.apache.org
Sent: Thursday, August 13, 2009 8:50:54 PM
Subject: Re: Tomcat writing the wrong timestamp on compiled JSP's

The time stamp on the file is given by your OS. What operating system and 
version are you using? Also, what time zone are you in?

André-John

On 13-Aug-2009, at 23:38, Mon Cab wrote:

 
 When I edit a JSP, tomcat is compiling the JSP (both java and class files)  
 in the work directory with a timestamp exactly 1 hour greater than the 
 current time.
 
 Eg. If I edit a jsp (after emptying the work directory), at 20:00, and then 
 load the page from a client, class and java files will appear in the work 
 directory with a timestamp of 21:00.
 
 I thought this might be a issue with the JVM time, however, when I look at 
 the tomcat logs Tomcat is gorreclt logging time in the logs, exactly the same 
 as the system time.
 
 Does anyone have any idea why this might be happening?
 
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat writing the wrong timestamp on compiled JSP's

2009-08-13 Thread Mon Cab
I'm using Fedora, and timezone is PDT.  Pacific. 





- Original Message 
From: Andre-John Mas aj...@sympatico.ca
To: Tomcat Users List users@tomcat.apache.org
Sent: Thursday, August 13, 2009 9:01:34 PM
Subject: Re: Tomcat writing the wrong timestamp on compiled JSP's


On 13-Aug-2009, at 23:55, Mon Cab wrote:

 
 That's what I thought.
 
 However if I edit and reload a file at 20:00, and check the system time with 
 date command I get 20:00 as the system time.
 And yet the compiled Java and Class files are timestamped 21:00
 

What operating system and version are you using? Also, what time zone are you 
in? There is maybe some environment issue.

André-John
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat writing the wrong timestamp on compiled JSP's

2009-08-13 Thread Mon Cab
Fedora Core release 4 (Stentz)
Java 1.4.2

I ran the code in the article you sent to get the JVM time, and the JVM is 
giving the correct time...  ie. same as the OS gives when I type the date 
command. 





- Original Message 
From: Andre-John Mas aj...@sympatico.ca
To: Tomcat Users List users@tomcat.apache.org
Sent: Thursday, August 13, 2009 9:09:53 PM
Subject: Re: Tomcat writing the wrong timestamp on compiled JSP's


On 13-Aug-2009, at 23:59, Mon Cab wrote:

 Sorry forgot to answer your other questions.  I'm using Fedora, and timezone 
 is PDT.  Pacific.
 

Which Fedora version? Also what version of Java?

I am wondering whether there is a daylight saving issue. Maybe there is 
something in this article of relevance:

http://www.javaworld.com/javaworld/jw-10-2003/jw-1003-time.html

André-John
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat writing the wrong timestamp on compiled JSP's

2009-08-13 Thread Mon Cab

Given the results below it looks like this is not a daylight savings time 
issue.  In fact its extremely odd behavior.  Both Tomcat and the OS have the 
correct time, and yet when Tomcat compiles the JSP, the java and class files in 
the work directory have a create / modified time-stamp exactly 1 hour ahead of 
the time that they were created.  

Again, Tomcat and the OS are both showing the correct time, but when the java 
and class files are created (say at 20:00) they are timestamped 21:00.  

I checked that JVM was giving the correct time by running: 

import java.util.*;
public class DateTest {
  public static void main(String[] args) {
System.out.println(Date =  + new Date());
System.out.println(Calendar =  + Calendar.getInstance());
  }
}

and got the correct time, and I checked that the OS had the correct time using 
command date.  

Anyone have any ideas what might be going on here??






- Original Message 
From: Mon Cab futo...@yahoo.com
To: Tomcat Users List users@tomcat.apache.org
Sent: Thursday, August 13, 2009 9:27:18 PM
Subject: Re: Tomcat writing the wrong timestamp on compiled JSP's

Fedora Core release 4 (Stentz)
Java 1.4.2

I ran the code in the article you sent to get the JVM time, and the JVM is 
giving the correct time...  ie. same as the OS gives when I type the date 
command. 





- Original Message 
From: Andre-John Mas aj...@sympatico.ca
To: Tomcat Users List users@tomcat.apache.org
Sent: Thursday, August 13, 2009 9:09:53 PM
Subject: Re: Tomcat writing the wrong timestamp on compiled JSP's


On 13-Aug-2009, at 23:59, Mon Cab wrote:

 Sorry forgot to answer your other questions.  I'm using Fedora, and timezone 
 is PDT.  Pacific.
 

Which Fedora version? Also what version of Java?

I am wondering whether there is a daylight saving issue. Maybe there is 
something in this article of relevance:

http://www.javaworld.com/javaworld/jw-10-2003/jw-1003-time.html

André-John
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Tomcat Logging Wrong time in tomcat logs

2008-01-28 Thread Mon Cab
Good day

I am not sure why but tomcat seems to have started logging the
incorrect time in logs.  My server is on PDT, and tomcat is logging 8
hours ahead in the logs (GMT).  

Eg when it is 2008-01-28 20:53 tomcat is logging

2008-01-29 04:53:07,199

Any insight into why tomcat is doing this, and / or how I can change
this would be appreciated.  Is this normal?


  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat Logging Wrong time in tomcat logs

2008-01-28 Thread Mon Cab

Note 

This problem does not seem to ba due to the JVM having an incorrect
value for the timezone.  I ran the following code : 


import java.util.Date;
import java.util.TimeZone;

public class TimeTest {

public static void main(String args[]) {

long time = System.currentTimeMillis();
String millis = Long.toString(time);
Date date = new Date(time);
System.out.println(Current time in milliseconds =  + millis +  = 
+ date.toString());
System.out.println(Current time zone:  +
TimeZone.getDefault().getID());


System.out.println(TimeZone.getDefault: +TimeZone.getDefault());

}
}

And got the correct timezone back when I called the class using java.  

Current time in milliseconds = 1201587209213 = Mon Jan 28 22:13:29 PST
2008
Current time zone: America/Los_Angeles
TimeZone.getDefault:
sun.util.calendar.ZoneInfo[id=America/Los_Angeles,offset=
-2880,dstSavings=360,useDaylight=true,transitions=185,lastRule=java.util
.SimpleTimeZone[id=America/Los_Angeles,offset=-2880,dstSavings=360,useDa
ylight=true,startYear=0,startMode=3,startMonth=2,startDay=8,startDayOfWeek=1,sta
rtTime=720,startTimeMode=0,endMode=3,endMonth=10,endDay=1,endDayOfWeek=1,end
Time=720,endTimeMode=0]]



--- Mon Cab [EMAIL PROTECTED] wrote:

 Good day
 
 I am not sure why but tomcat seems to have started logging the
 incorrect time in logs.  My server is on PDT, and tomcat is logging 8
 hours ahead in the logs (GMT).  
 
 Eg when it is 2008-01-28 20:53 tomcat is logging
 
 2008-01-29 04:53:07,199
 
 Any insight into why tomcat is doing this, and / or how I can change
 this would be appreciated.  Is this normal?
 
 
  


 Be a better friend, newshound, and 
 know-it-all with Yahoo! Mobile.  Try it now. 
 http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 
 
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 



  

Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Forwarding based on URI's in Tomcat

2007-08-01 Thread Mon Cab

I am trying to get tomcat to forward requests as follows

www.mysite.com/foo to direct to the foo action  
www.mysite.com/bar to direct to bar action ie. bar.do

Does anyone have any pointers on this?  Sorry for the newbie question. 


   

Looking for a deal? Find great prices on flights and hotels with Yahoo! 
FareChase.
http://farechase.yahoo.com/

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Forwarding based on URI's in Tomcat

2007-08-01 Thread Mon Cab
I would rather do this by configuring Tomcat, than doing it
programatically if posible.  


--- Asensio, Rodrigo [EMAIL PROTECTED] wrote:

 Are those 2 different webapps ?
 If yes, you have to be aware of session data, diff webapps do not
 share
 by default the session data.
 
 But basically to do a client redirect you do this
 
 Response.sendRedirect(otherURl)   this will change the url in the
 client browser
 
 To do a server redirect you can do either
 jsp:forward page=otherURL
 
 Or inside a servlet (or jsp)
 

request.getContext().getRequestDispatcher(otherURL).forward(request,re
 sponse);
 
 
 regards
 
 -Original Message-
 From: Mon Cab [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, August 01, 2007 2:34 PM
 To: Tomcat Usergroup
 Subject: Forwarding based on URI's in Tomcat
 
 
 I am trying to get tomcat to forward requests as follows
 
 www.mysite.com/foo to direct to the foo action www.mysite.com/bar to
 direct to bar action ie. bar.do
 
 Does anyone have any pointers on this?  Sorry for the newbie
 question. 
 
 



 
 Looking for a deal? Find great prices on flights and hotels with
 Yahoo!
 FareChase.
 http://farechase.yahoo.com/
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
 e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 This message (including any attachments) contains confidential
 and/or proprietary information intended only for the addressee.
 Any unauthorized disclosure, copying, distribution or reliance on
 the contents of this information is strictly prohibited and may
 constitute a violation of law.  If you are not the intended
 recipient, please notify the sender immediately by responding to
 this e-mail, and delete the message from your system.  If you
 have any questions about this e-mail please notify the sender
 immediately.
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 



   

Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, 
photos  more. 
http://mobile.yahoo.com/go?refer=1GNXIC

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Forwarding based on URI's in Tomcat

2007-08-01 Thread Mon Cab
I tried the following 

 servlet-mapping
servlet-nameaction/servlet-name
url-pattern*.do/url-pattern
  /servlet-mapping
   servlet-mapping
  servlet-nameaction/servlet-name
  url-pattern/sexy*/url-pattern
  /servlet-mapping

but got a 404 message: 

The requested resource (/mymodule/sexy) is not available.

I also tried:

servlet-mapping
  servlet-nameaction/servlet-name
  url-pattern/mymodule/sexy*/url-pattern
  /servlet-mapping

but I got the same error. 




--- David Delbecq [EMAIL PROTECTED] wrote:

 In your web.xml, you can map /foo  and /bar to struts servlet.
 However,
 i think i remember the struts servlet does not like to be mapped at
 several location. (/foo, /bar and *.do)
 
 You could also write your own servlet, that your map to /foo and /bar
 and which take th request url and does an internal forward to the
 same
 name with an additionnal .do
 
 You could also map / to your struts servlet (instead of *.do) and
 have
 static content served using a servlet mapped to /static. But you will
 have problem with pure JSPs as you will need to manually map them.
 
 
 
 Mon Cab a écrit :
  I am trying to get tomcat to forward requests as follows
 
  www.mysite.com/foo to direct to the foo action  
  www.mysite.com/bar to direct to bar action ie. bar.do
 
  Does anyone have any pointers on this?  Sorry for the newbie
 question. 
 
 
 
 


  Looking for a deal? Find great prices on flights and hotels with
 Yahoo! FareChase.
  http://farechase.yahoo.com/
 
 
 -
  To start a new topic, e-mail: users@tomcat.apache.org
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]

 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 



   

Building a website is a piece of cake. Yahoo! Small Business gives you all the 
tools to get online.
http://smallbusiness.yahoo.com/webhosting 

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Forwarding based on URI's in Tomcat

2007-08-01 Thread Mon Cab
I tried 

 servlet-nameaction/servlet-name
 url-pattern/mymodule/sexy*/url-pattern
 url-pattern/mymodule/sexy/url-pattern
url-pattern/sexy*/url-pattern
 url-pattern/sexy/url-pattern

and none of it seems to work. 



--- Christopher Schultz [EMAIL PROTECTED] wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Mon,
 
 Mon Cab wrote:
url-pattern/sexy*/url-pattern
 
 I believe that the pattern /sexy* does not match when the * matches
 nothing. I think that * acts like + in a regular expression. You
 might want:
 
servlet-nameaction/servlet-name
url-pattern/mymodule/sexy*/url-pattern
url-pattern/mymodule/sexy/url-pattern
 
 That is, map both /sexy* and /sexy to the servlet.
 
 - -chris
 
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.7 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 
 iD8DBQFGsP019CaO5/Lv0PARAmwEAJ9HU8lAnNcIR7RqbeQLvfTdE/4kIACdHp54
 lpCG2nsMLk2h3TITEGMNZmE=
 =xiSJ
 -END PGP SIGNATURE-
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 



   

Be a better Globetrotter. Get better travel answers from someone who knows. 
Yahoo! Answers - Check it out.
http://answers.yahoo.com/dir/?link=listsid=396545469

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



virtual Hosts multiple IP's (one to one mapping)

2007-06-04 Thread Mon Cab


I will hosting several domains on tomcat, and have configured each
domain with it's own IP address through DNS, such that domain1.com, as
well as www.domain1.com resolve to the ip address of the domain1. 
(I.e. multiple hosts for each domain on each IP address).  

I am trying to get tomcat to serve the appropriate website for each
respective domain (by assigning docbases appropriately in server.xml -
requests for www.domain.com, domain.com, anything.domain.com should all
result in the domain.com welcome page displaying.  

Unfortunately I cant seem to get it working using Tomcat as a
standalone webserver.  (I am not forwarding requests through apache.)  


I configures the server as follows (server.xml): 

 

 Service name=Catalina1

!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 --
Connector port=8080
   maxThreads=150 minSpareThreads=25
maxSpareThreads=75
   enableLookups=false redirectPort=8443
acceptCount=100
   debug=0 connectionTimeout=2
   disableUploadTimeout=true
   address=111.111.111.111 /

 Host name=localhost debug=0 appBase=webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false

Context path= docBase=webapp1
debug=5 reloadable=true crossContext=true
...

/service


 Service name=Catalina2

!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 --
Connector port=8080
   maxThreads=150 minSpareThreads=25
maxSpareThreads=75
   enableLookups=false redirectPort=8443
acceptCount=100
   debug=0 connectionTimeout=2
   disableUploadTimeout=true
   address=222.222.222.222 /

 Host name=localhost debug=0 appBase=webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false

Context path= docBase=webapp2
debug=5 reloadable=true crossContext=true
...

/service


With the above configuration, domain1.com is returing the domain2.com
site.  

It seems that the host configuration in service catalina2, is
overriding the definition in catalina1, so tha even though the 
IP request is for www.domain1.com which resolves to IP 111.111.111.111,
the webapp2 docbase is te one which is being served up.  

I dont want to define multiple hosts for each service, as I want to
anything.domain1.com to return doamin1's welcome page.  

Does anyone have a solution for this?  




   

Looking for a deal? Find great prices on flights and hotels with Yahoo! 
FareChase.
http://farechase.yahoo.com/

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: virtual Hosts multiple IP's (one to one mapping)

2007-06-04 Thread Mon Cab

Just found the answer: Hostname Aliases

http://tomcat.apache.org/tomcat-5.0-doc/config/host.html#Host%20Name%20Aliases


--- Mon Cab [EMAIL PROTECTED] wrote:

 
 
 I will hosting several domains on tomcat, and have configured each
 domain with it's own IP address through DNS, such that domain1.com,
 as
 well as www.domain1.com resolve to the ip address of the domain1. 
 (I.e. multiple hosts for each domain on each IP address).  
 
 I am trying to get tomcat to serve the appropriate website for each
 respective domain (by assigning docbases appropriately in server.xml
 -
 requests for www.domain.com, domain.com, anything.domain.com should
 all
 result in the domain.com welcome page displaying.  
 
 Unfortunately I cant seem to get it working using Tomcat as a
 standalone webserver.  (I am not forwarding requests through apache.)
  
 
 
 I configures the server as follows (server.xml): 
 
  
 
  Service name=Catalina1
 
 !-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 --
 Connector port=8080
maxThreads=150 minSpareThreads=25
 maxSpareThreads=75
enableLookups=false redirectPort=8443
 acceptCount=100
debug=0 connectionTimeout=2
disableUploadTimeout=true
address=111.111.111.111 /
 
Host name=localhost debug=0 appBase=webapps
   unpackWARs=true autoDeploy=true
   xmlValidation=false xmlNamespaceAware=false
 
   Context path= docBase=webapp1
   debug=5 reloadable=true crossContext=true
   ...
 
   /service
 
 
  Service name=Catalina2
 
 !-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 --
 Connector port=8080
maxThreads=150 minSpareThreads=25
 maxSpareThreads=75
enableLookups=false redirectPort=8443
 acceptCount=100
debug=0 connectionTimeout=2
disableUploadTimeout=true
address=222.222.222.222 /
 
Host name=localhost debug=0 appBase=webapps
   unpackWARs=true autoDeploy=true
   xmlValidation=false xmlNamespaceAware=false
 
   Context path= docBase=webapp2
   debug=5 reloadable=true crossContext=true
   ...
 
   /service
   
 
 With the above configuration, domain1.com is returing the domain2.com
 site.  
 
 It seems that the host configuration in service catalina2, is
 overriding the definition in catalina1, so tha even though the 
 IP request is for www.domain1.com which resolves to IP
 111.111.111.111,
 the webapp2 docbase is te one which is being served up.  
 
 I dont want to define multiple hosts for each service, as I want to
 anything.domain1.com to return doamin1's welcome page.  
 
 Does anyone have a solution for this?  
 
 
 
 



 Looking for a deal? Find great prices on flights and hotels with
 Yahoo! FareChase.
 http://farechase.yahoo.com/
 



   

Get the free Yahoo! toolbar and rest assured with the added security of spyware 
protection.
http://new.toolbar.yahoo.com/toolbar/features/norton/index.php

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



getting Session from SessionId

2007-02-09 Thread Mon Cab
I am trying to integrate a web application to an external service, and
need to be able to take an incoming sessionId from the external service
server, and to return details from the session to which that sessionId
applies.  

I understand that there was a getSession(String sessionid) method, in
HttpSessionContext which has since been deprecated.

Does anyone know how I would do this, with the Servlet 2.3 APIs?


 

We won't tell. Get more on shows you hate to love 
(and love to hate): Yahoo! TV's Guilty Pleasures list.
http://tv.yahoo.com/collections/265 

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JSP Reload problem (wierd)

2006-12-25 Thread Mon Cab
I tried using Firefox, and got the same result.  I also tried using
shift + reload.  Also, It looks like Tomcat is already configured to
reload the jsp's. (below is from the server.xml file).

 Context path= docBase=myWebapp debug=5 
reloadable=true   crossContext=true

How come no new Login_jsp.class is being written to the work directory?
 (The jsp file tmestamp is definately showing as changed when I telnet
to the server - I thought Tomcat automatically recompiled the classes
when it detected a changed timestamp).

  

--- Rizwan [EMAIL PROTECTED] wrote:

 Hi,
 
 This is usually a problem with IE, it caches your pages for you. This
 might 
 be the reason.
 Try doing the same in some other browser. (Firefox usually doesnt
 cache the 
 pages.)
 
 If u still have the problem in other browsers, you might have to
 enable 
 autoreload in tomcat to recomplie jsps or reload classes whenever
 there is a change to the file.
 
 Hope this helps.
 
 Rizwan.
 
 - Original Message - 
 From: Mon Cab [EMAIL PROTECTED]
 To: Tomcat Usergroup users@tomcat.apache.org
 Sent: Monday, December 25, 2006 12:26 PM
 Subject: JSP Reload problem (wierd)
 
 
 I am using WinSCP to open and edit jsp's on my remote Tomcat server.
  I
  open the file from the server to edit and add a hello world into
 the
  Login jsp.  Then I request the page in IE 6 and it loads the page
 and
  hello world is displayed.  The page loads within a second (is this
  enough time for a jsp to compile ??!).
 
  Then I edit the file in WinSCP again to remove the hello world
 from
  the login jsp, and I click on ctrl + refresh in IE6.  The login
 page
  reloads almost immediately and hello world is still displaying.  I
 hit
  ctrl refresh over and over, and cant get rid of hello world.  I
 check
  Login.jsp on the server ant hello world is definitely not in
 there.
 
 
  I go into the work directory
  tomcat5.0/work/Catalina/localhost/myWebapp and notice that the
  Login_jsp.java file is 3 hours old.  I delete this as well as the
  Login_jsp.class file.  I try reload the page (ctrl +refresh). 
 Hello
  world is still displaying.
 
  I look in the work folder.  No new Login_jsp.java file, and no new
  Login_jsp.class file.
 
  I add aagh into the Login.jsp file.  Hit reload in explorer
 and
  aagh displays.  But there is still no new Login_jsp.java
 file,
  and no new Login_jsp.class file
 
  If I rename the file to Login1.jsp and then click on reload in IE6,
  after the third attempt Tomcat realizes there's no JSP file and
 logs an
  error in catalina.log.  Then if I rename the Login.jsp back to
  Login.jsp, tomcat reloads the file and displays it correctly.
 
  What is going on??  I feel like I'm in the Twilight zone.
 
 
 
 
 
  __
  Do You Yahoo!?
  Tired of spam?  Yahoo! Mail has the best spam protection around
  http://mail.yahoo.com
 
 
 -
  To start a new topic, e-mail: users@tomcat.apache.org
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  
 
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


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

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JSP Reload problem (wierd)

2006-12-25 Thread Mon Cab

Clearing the cache does not make any differnece. 

The jsp does not seem to be being recompiled on the production server
(Fedora 4, Tomcat 5.0.28).  When I edit my Login.jsp, and then request
it in my browser, should there not be a new Login_jsp.class compiled in
the work directory?  I cannot find any such file.  

I am using the same browser to test the identical application running
on my local machine, and when I edit the jsp on my local server
(Windows XP, Tomcat 5.0.28), and reload in IE6, it takes some time to
get the page back (the jsp class is being recompiled).  If I look in
the work directory the clas file has been recompiled (current
timestamp).

This does not seem to be happening on the production server.  


--- Pierre Goupil [EMAIL PROTECTED] wrote:

 Hello !
 
 
 I think it's a cache issue, too. Doesn't suffice to reload the page,
 for
 testing purposes, you should also tell to your browser not to cache
 the
 pages.
 
 In firefox : edit / preferences / private life / cache then set it to
 0 MB
 and erase the currently chached files (don't know the english name of
 this
 last option).
 
 HTH,
 
 Pierre
 
 
 
 2006/12/25, Mon Cab [EMAIL PROTECTED]:
 
  I tried using Firefox, and got the same result.  I also tried using
  shift + reload.  Also, It looks like Tomcat is already configured
 to
  reload the jsp's. (below is from the server.xml file).
 
  Context path= docBase=myWebapp debug=5
  reloadable=true   crossContext=true
 
  How come no new Login_jsp.class is being written to the work
 directory?
  (The jsp file tmestamp is definately showing as changed when I
 telnet
  to the server - I thought Tomcat automatically recompiled the
 classes
  when it detected a changed timestamp).
 
 
 
  --- Rizwan [EMAIL PROTECTED] wrote:
 
   Hi,
  
   This is usually a problem with IE, it caches your pages for you.
 This
   might
   be the reason.
   Try doing the same in some other browser. (Firefox usually doesnt
   cache the
   pages.)
  
   If u still have the problem in other browsers, you might have to
   enable
   autoreload in tomcat to recomplie jsps or reload classes whenever
   there is a change to the file.
  
   Hope this helps.
  
   Rizwan.
  
   - Original Message -
   From: Mon Cab [EMAIL PROTECTED]
   To: Tomcat Usergroup users@tomcat.apache.org
   Sent: Monday, December 25, 2006 12:26 PM
   Subject: JSP Reload problem (wierd)
  
  
   I am using WinSCP to open and edit jsp's on my remote Tomcat
 server.
I
open the file from the server to edit and add a hello world
 into
   the
Login jsp.  Then I request the page in IE 6 and it loads the
 page
   and
hello world is displayed.  The page loads within a second (is
 this
enough time for a jsp to compile ??!).
   
Then I edit the file in WinSCP again to remove the hello
 world
   from
the login jsp, and I click on ctrl + refresh in IE6.  The login
   page
reloads almost immediately and hello world is still displaying.
  I
   hit
ctrl refresh over and over, and cant get rid of hello world.  I
   check
Login.jsp on the server ant hello world is definitely not in
   there.
   
   
I go into the work directory
tomcat5.0/work/Catalina/localhost/myWebapp and notice that the
Login_jsp.java file is 3 hours old.  I delete this as well as
 the
Login_jsp.class file.  I try reload the page (ctrl +refresh).
   Hello
world is still displaying.
   
I look in the work folder.  No new Login_jsp.java file, and no
 new
Login_jsp.class file.
   
I add aagh into the Login.jsp file.  Hit reload in
 explorer
   and
aagh displays.  But there is still no new Login_jsp.java
   file,
and no new Login_jsp.class file
   
If I rename the file to Login1.jsp and then click on reload in
 IE6,
after the third attempt Tomcat realizes there's no JSP file and
   logs an
error in catalina.log.  Then if I rename the Login.jsp back to
Login.jsp, tomcat reloads the file and displays it correctly.
   
What is going on??  I feel like I'm in the Twilight zone.
   
   
   
   
   
__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
   
   
  
 -
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   
  
  
  
 -
   To start a new topic, e-mail: users@tomcat.apache.org
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
 
  __
  Do You Yahoo!?
  Tired of spam?  Yahoo! Mail has the best spam protection around
  http://mail.yahoo.com

RE: JSP Reload problem (wierd)

2006-12-25 Thread Mon Cab
I just added the following to web.xml.  

init-param
param-namecheckInterval/param-name
param-value1/param-value
/init-param
init-param
param-namedevelopment/param-name
param-valuetrue/param-value
/init-param



--- Caldarale, Charles R [EMAIL PROTECTED] wrote:

  From: Mon Cab [mailto:[EMAIL PROTECTED] 
  Subject: Re: JSP Reload problem (wierd)
  
  Also, It looks like Tomcat is already configured to
  reload the jsp's. (below is from the server.xml file).
 
 The config for jsp handling is in conf/web.xml, not server.xml.  Look
 at
 the various attributes for the jsp servlet, and see if they match the
 behavior you're looking for.  In particular, examine the values for
 checkInterval, modificationTestInterval, and development.  (This is
 for
 5.5; 5.0.28 should be similar, but I haven't had a 5.0 level
 installed
 for quite some time to verify.)
 
  - Chuck
 
 
 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE
 PROPRIETARY
 MATERIAL and is thus for use only by the intended recipient. If you
 received this in error, please contact the sender and delete the
 e-mail
 and its attachments from all computers.
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


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

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: JSP Reload problem (wierd)

2006-12-25 Thread Mon Cab

--- Mon Cab [EMAIL PROTECTED] wrote:

 I just added the following to web.xml.  
 
 init-param
 param-namecheckInterval/param-name
 param-value1/param-value
 /init-param
   init-param
 param-namedevelopment/param-name
 param-valuetrue/param-value
 /init-param
 

But, I'm not getting any change in behaviour.  It seems that sometimes
when I edit the jsp and request the page, the jsp recompiles, and
sometimes it doesnt.  

If I rename the Login.jsp to Login1.jsp and request the page three
times, on the third time, tomcat logs a file not found error in the
catalina log.  Then when I rename the jsp back to Login.jsp, and
request the page again in IE6, the jsp recompiles, and I get the
updated response. 



 
 
 --- Caldarale, Charles R [EMAIL PROTECTED] wrote:
 
   From: Mon Cab [mailto:[EMAIL PROTECTED] 
   Subject: Re: JSP Reload problem (wierd)
   
   Also, It looks like Tomcat is already configured to
   reload the jsp's. (below is from the server.xml file).
  
  The config for jsp handling is in conf/web.xml, not server.xml. 
 Look
  at
  the various attributes for the jsp servlet, and see if they match
 the
  behavior you're looking for.  In particular, examine the values for
  checkInterval, modificationTestInterval, and development.  (This is
  for
  5.5; 5.0.28 should be similar, but I haven't had a 5.0 level
  installed
  for quite some time to verify.)
  
   - Chuck
  
  
  THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE
  PROPRIETARY
  MATERIAL and is thus for use only by the intended recipient. If you
  received this in error, please contact the sender and delete the
  e-mail
  and its attachments from all computers.
  
 
 -
  To start a new topic, e-mail: users@tomcat.apache.org
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
 
 __
 Do You Yahoo!?
 Tired of spam?  Yahoo! Mail has the best spam protection around 
 http://mail.yahoo.com 
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


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

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



JSP Reload problem (wierd)

2006-12-24 Thread Mon Cab
I am using WinSCP to open and edit jsp's on my remote Tomcat server.  I
open the file from the server to edit and add a hello world into the
Login jsp.  Then I request the page in IE 6 and it loads the page and
hello world is displayed.  The page loads within a second (is this
enough time for a jsp to compile ??!).

Then I edit the file in WinSCP again to remove the hello world from
the login jsp, and I click on ctrl + refresh in IE6.  The login page
reloads almost immediately and hello world is still displaying.  I hit
ctrl refresh over and over, and cant get rid of hello world.  I check
Login.jsp on the server ant hello world is definitely not in there.  


I go into the work directory 
tomcat5.0/work/Catalina/localhost/myWebapp and notice that the
Login_jsp.java file is 3 hours old.  I delete this as well as the
Login_jsp.class file.  I try reload the page (ctrl +refresh).  Hello
world is still displaying. 

I look in the work folder.  No new Login_jsp.java file, and no new
Login_jsp.class file. 

I add aagh into the Login.jsp file.  Hit reload in explorer and
aagh displays.  But there is still no new Login_jsp.java file,
and no new Login_jsp.class file

If I rename the file to Login1.jsp and then click on reload in IE6,
after the third attempt Tomcat realizes there's no JSP file and logs an
error in catalina.log.  Then if I rename the Login.jsp back to
Login.jsp, tomcat reloads the file and displays it correctly. 

What is going on??  I feel like I'm in the Twilight zone.  





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

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat shutting down when instantiating javax.swing.ImageIcon on Fedora

2006-12-17 Thread Mon Cab

 At the same time, install a newer JRE from Sun - there's no reason
 not
 to use a 1.5 level, which is a noticeable improvement over 1.4.
 
  - Chuck
 


Instaled both Sun's JDK, and the official distribution of Tomcat over
the weekend...  All is working well now.  (No more class def found
exceptions, no more Gtk-WARNING's).  

It seems that both the repackaged 3rd party Tomcat, the GNU JDK, and
the Sun JDK that was preloaded on my server were all broken.  

Thanks for the advice on this.  

- Mon


--- Caldarale, Charles R [EMAIL PROTECTED] wrote:

  From: Mon Cab [mailto:[EMAIL PROTECTED] 
  Subject: RE: Tomcat shutting down when instantiating 
  javax.swing.ImageIcon on Fedora
  
  I have Tomcat 5.0 installed.
 
 Oops, sorry.  I'd really recommend throwing away that 3rd-party
 repackaged version and downloading a real one from:
 http://tomcat.apache.org/download-55.cgi
 
 At the same time, install a newer JRE from Sun - there's no reason
 not
 to use a 1.5 level, which is a noticeable improvement over 1.4.
 
  - Chuck
 
 
 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE
 PROPRIETARY
 MATERIAL and is thus for use only by the intended recipient. If you
 received this in error, please contact the sender and delete the
 e-mail
 and its attachments from all computers.
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


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

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat shutting down when instantiating javax.swing.ImageIcon on Fedora

2006-12-14 Thread Mon Cab

It seemed that there was a jdk installation on the server under
/usr/java/j2sdk1.4.2 

I ran ./java - version from the bin dir and got: 

java version 1.4.2
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28)
Java HotSpot(TM) Client VM (build 1.4.2-b28, mixed mode)

I ran grep to find where JAVA_HOME was being configured and got:

/etc/tomcat5/tomcat5.conf:# you could also override JAVA_HOME here
/etc/tomcat5/tomcat5.conf:JAVA_HOME=/usr/lib/jvm/java

so i changed /etc/tomcat5/tomcat5.conf to 

JAVA_HOME=/usr/java/j2sdk1.4.2

Then, when I started Tomcat, even the Tomcat home page would not
display.  

In the catalina.out log the following message was displayed:

Due to new licensing guidelines mandated by the Apache Software
Foundation Board of Directors, a JMX implementation can no longer
be distributed with the Apache Tomcat binaries. As a result, you 
must download a JMX 1.2 implementation (such as the Sun Reference
Implementation) and copy the JAR containing the API and 
implementation of the JMX specification to: 
${catalina.home}/bin/jmx.jar

It might be worth noting that this version of Tomcat was installed as
part ot a Plesk add on pack (the OS is Fedora).  Does anyone know what
is going on here?  
 
I dont know how to verify whether this real Tomcat, or something else. 



--- Caldarale, Charles R [EMAIL PROTECTED] wrote:

  From: Mon Cab [mailto:[EMAIL PROTECTED] 
  Subject: Tomcat shutting down when instantiating 
  javax.swing.ImageIcon on Fedora
  
  I have been advised to uninstall gnu java and replace it with Sun
 SDK,
  which I am in the process of trying to figure out how to do.  
 
 Until you have a real JRE installed, I think it's probably pointless
 to
 try to do much of anything.
 
  - Chuck
 
 
 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE
 PROPRIETARY
 MATERIAL and is thus for use only by the intended recipient. If you
 received this in error, please contact the sender and delete the
 e-mail
 and its attachments from all computers.
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


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

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat shutting down when instantiating javax.swing.ImageIcon on Fedora

2006-12-14 Thread Mon Cab

My dev environment is Tomcat 5.0 on java 1.4.2. I'd rather stick with
this setup as closely as possible, and get the production version
working before I change anything.  

In the meantime, is it still relavent for me to get the jmx.jar, and if
so would renaming jmxri.jar to jmx.jar do the job?  Also, do I still
need XML parser APIs and Xerces implementation in the common/endorsed,
and if so, where do I get them from?  If you have a link, that would be
amazing.  My eyes are going square from staring at the command prompt.



--- Caldarale, Charles R [EMAIL PROTECTED] wrote:

  From: Mon Cab [mailto:[EMAIL PROTECTED] 
  Subject: RE: Tomcat shutting down when instantiating 
  javax.swing.ImageIcon on Fedora
  
  I have Tomcat 5.0 installed.
 
 Oops, sorry.  I'd really recommend throwing away that 3rd-party
 repackaged version and downloading a real one from:
 http://tomcat.apache.org/download-55.cgi
 
 At the same time, install a newer JRE from Sun - there's no reason
 not
 to use a 1.5 level, which is a noticeable improvement over 1.4.
 
  - Chuck
 
 
 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE
 PROPRIETARY
 MATERIAL and is thus for use only by the intended recipient. If you
 received this in error, please contact the sender and delete the
 e-mail
 and its attachments from all computers.
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 



 

Any questions? Get answers on any topic at www.Answers.yahoo.com.  Try it now.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: java.lang.ClassNotFoundException: com.sun.image.codec.jpeg.JPEGImageEncoder

2006-12-12 Thread Mon Cab
Thanks Leon

I will research how to uninstall gnu and install sun sdk.  (I'm new to
UNIX).  PS.  Do you know of any other issues I should be aware of with
Tomcat running on Fedora (v4)?  



--- Leon Rosenberg [EMAIL PROTECTED] wrote:

 On 12/12/06, Christopher Schultz [EMAIL PROTECTED]
 wrote:
  -BEGIN PGP SIGNED MESSAGE-
  Hash: SHA1
 
  Mon,
 
  Mon Cab wrote:
   Here's the results of java -version
  
   java version 1.4.2
   gij (GNU libgcj) version 4.0.2 20051125 (Red Hat 4.0.2-8)
 
  Well, /there's/ yer problem: you have GNU Java -- not that there's
  anything wrong with that.
 
 christopher:
 There are a lot things wrong with that!
 Lets start with no java programm works with it.
 Probably the half of my tomcat doesn't start/work/whatever messages
 are based on default installation of this (completely broken) jre (I
 think its not even an 'official' jre). If I start anything with gnuj
 i
 get: class not found exception: java.lang.Object.
 
 Mon:
 remove it (its usually linked from /bin/java or /usr/java) and
 install
 suns jdk (download it from sun).
 
 regards
 Leon
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 



 

Cheap talk?
Check out Yahoo! Messenger's low PC-to-Phone call rates.
http://voice.yahoo.com

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Tomcat shutting down when instantiating javax.swing.ImageIcon on Fedora

2006-12-12 Thread Mon Cab

I am running Tomcat, on Fedora 4. Using 

java version 1.4.2
gij (GNU libgcj) version 4.0.2 20051125 (Red Hat 4.0.2-8)
Copyright (C) 2005 Free Software Foundation, Inc.

My application works fine until the following line of code is reached. 


ImageIcon ii = new javax.swing.ImageIcon(myFile.getCanonicalPath());

When this line is reached the tomcat service promptly stops.  No
exceptions in tomcat log or localhost log. Only the following line in
Catalina out.  

(.:8048): Gtk-WARNING **: cannot open display:  

I have been advised to uninstall gnu java and replace it with Sun SDK,
which I am in the process of trying to figure out how to do.  (I am new
to UNIX.)

My question is this: What is going on with the Gtk-WARNING **, and does
anyone know a fix?  This seems not to be a class not found exception,
since it happens even when I add java.awt, and javax.swing packages
into the usr/share/java folder.  

I am figuring that the server could be configured as headless, and that
this may be the cause of the problem, and am in the process of finding
out where the script that configures this is on Fedora.  





 

Want to start your own business?
Learn how on Yahoo! Small Business.
http://smallbusiness.yahoo.com/r-index

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: java.lang.ClassNotFoundException: com.sun.image.codec.jpeg.JPEGImageEncoder

2006-12-11 Thread Mon Cab
Thanks Chris.  I pulled the codec package from this and put it in its
own jar, and added to the tomcat/common/lib dir.  Its working now.  


--- Caldarale, Charles R [EMAIL PROTECTED] wrote:

  From: Mon Cab [mailto:[EMAIL PROTECTED] 
  Subject: java.lang.ClassNotFoundException: 
  com.sun.image.codec.jpeg.JPEGImageEncoder
  
  Caused by: java.lang.ClassNotFoundException: 
  com.sun.image.codec.jpeg.JPEGImageEncoder
 
 This class is normally part of the Sun JRE download in rt.jar.  It
 appears that either your JRE installation is corrupted, or you're
 using
 some unusual JRE that does not include the standard classes.  Try
 downloading and installing a fresh JRE from the Sun web site.
 
  - Chuck
 
 
 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE
 PROPRIETARY
 MATERIAL and is thus for use only by the intended recipient. If you
 received this in error, please contact the sender and delete the
 e-mail
 and its attachments from all computers.
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 



 

Any questions? Get answers on any topic at www.Answers.yahoo.com.  Try it now.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



java.io.IOException: No such file or directory when using serverFile.createNewFile();

2006-12-11 Thread Mon Cab
Hi 

I am trying to store a file in my webapp (Tomcat on Fedora) and am
using 

File serverFile = new File(file_pathname); 
serverFile.createNewFile(); 
FileOutputStream os = new FileOutputStream(serverFile); 
os.write(fileData); 
os.close();

but I am getting a

java.io.IOException: No such file or directory
   at java.io.File.performCreate() (/usr/lib/libgcj.so.6.0.0)
   at java.io.File.createNewFile() (/usr/lib/libgcj.so.6.0.0)
   at datingapp.Photo.store() (Unknown Source)
   at
datingapp.PhotoProfileAction.addPhoto(javax.servlet.http.HttpServletRequest,

org.apache.struts.action.DynaActionForm,
datingapp.utils.DatingappSession) (Unknown Source)
   at
datingapp.PhotoProfileAction.execute(org.apache.struts.action.ActionMapping,
org.apache.struts.action.ActionForm,
javax.servlet.http.HttpServletRequest, 
javax.servlet.http.HttpServletResponse) (Unknown Source)
   at 
org.apache.struts.action.RequestProcessor.processActionPerform(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse, 
org.apache.struts.action.Action, org.apache.struts.action.ActionForm, 
org.apache.struts.action.ActionMapping) (Unknown Source)
   at
org.apache.struts.action.RequestProcessor.process(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse) (Unknown Source)

bla.. bla... 

for the pathname I have used the following (always getting the same
error):

datingapp2/user_images/337247852440.jpg
/datingapp2/user_images/2342051028.jpeg
datingapp2/user_images/337247852440_thumb.jpg
user_images/427613272763.jpeg

where datingapp2 is the folder (in webapps) for datingapp, and
user_images is a folder I have placed directly under datingapp2. 
Permissions to user_images is set at 775.

When I use the following as the pathname

/var/lib/tomcat5/webapps/datingapp2/user_images/

I get a this web page could not be displayed message and can no
longer access any Tomcat web page (defalt EI6 page), which I am 
presuming means that Tomcat has barfed.  

Does anyone know what might be going wrong here?  What should I do to
fix this?  






 

Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: java.lang.ClassNotFoundException: com.sun.image.codec.jpeg.JPEGImageEncoder

2006-12-11 Thread Mon Cab

Chuck

Apologies (nice).  Java version is 1.4.2 on Fedora.  Is that what you
mean?


--- Caldarale, Charles R [EMAIL PROTECTED] wrote:

  From: Mon Cab [mailto:[EMAIL PROTECTED] 
  Subject: RE: java.lang.ClassNotFoundException: 
  com.sun.image.codec.jpeg.JPEGImageEncoder
  
  Thanks Chris.
 
 Chris?  That's my ex-wife...
 
 So what JVM do you have installed?
 
  - Chuck
 
 
 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE
 PROPRIETARY
 MATERIAL and is thus for use only by the intended recipient. If you
 received this in error, please contact the sender and delete the
 e-mail
 and its attachments from all computers.
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 



 

Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: java.lang.ClassNotFoundException: com.sun.image.codec.jpeg.JPEGImageEncoder

2006-12-11 Thread Mon Cab

I believe its Suns JRE.  But I have heard that on UNIX there is no
access to awt ( presumable other image packages), due to UNIX being
headles server.  Does this make any sense?  Would the packages in the
JRE distribution for UNIX?


--- Caldarale, Charles R [EMAIL PROTECTED] wrote:

  From: Mon Cab [mailto:[EMAIL PROTECTED] 
  Subject: RE: java.lang.ClassNotFoundException: 
  com.sun.image.codec.jpeg.JPEGImageEncoder
  
  Apologies (nice).
 
 No worries. There is a Chris Schultz who is a frequent contributor to
 this list.
 
  Java version is 1.4.2 on Fedora.  Is that what you mean?
 
 Partly.  The class in question is definitely in Sun's 1.4.2 JRE; are
 you
 using Sun or some other vendor (e.g., IBM, JRockit, ...)?
 
  - Chuck
 
 
 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE
 PROPRIETARY
 MATERIAL and is thus for use only by the intended recipient. If you
 received this in error, please contact the sender and delete the
 e-mail
 and its attachments from all computers.
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 



 

Want to start your own business?
Learn how on Yahoo! Small Business.
http://smallbusiness.yahoo.com/r-index

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Tomcat Webapp barfing when saving Image

2006-12-11 Thread Mon Cab
Hi 

I am trying to store a file in my webapp (Tomcat on Fedora) and am
using 

File serverFile = new File(file_pathname); 
serverFile.createNewFile(); 
FileOutputStream os = new FileOutputStream(serverFile); 
os.write(fileData); 
os.close();

but I am getting an IE6 page cant be displayed error when I use the
following as the pathname

/var/lib/tomcat5/webapps/datingapp2/user_images/

The image is actually saving to the user_images folder BUT, it seems
that the webapp is no longer accessible after the image is saved.  As
soon as the save image code is executed the log file shws the following
(is this Tomcat restarting!?) 

2006-12-11 22:57:50,489 [main] INFO 
org.apache.coyote.http11.Http11Protocol - Initializing Coyote HTTP/1.1
on http-8080
2006-12-11 22:57:50,686 [main] INFO 
org.apache.coyote.http11.Http11Protocol - Initializing Coyote HTTP/1.1
on http-9080
2006-12-11 22:57:50,686 [main] INFO 
org.apache.catalina.startup.Catalina - Initialization processed in 2203
ms
2006-12-11 22:57:50,930 [main] INFO 
org.apache.catalina.realm.JAASRealm - Set JAAS app name PSA
2006-12-11 22:57:51,109 [main] INFO 
org.apache.catalina.core.StandardService - Starting service Catalina
2006-12-11 22:57:51,123 [main] INFO 
org.apache.catalina.core.StandardEngine - Starting Servlet Engine:
Apache Tomcat/5.0
2006-12-11 22:57:51,261 [main] INFO 
org.apache.catalina.core.StandardHost - XML validation disabled
2006-12-11 22:57:54,503 [main] INFO 
org.apache.struts.tiles.TilesPlugin - Tiles definition factory loaded
for module ''.
2006-12-11 22:57:54,534 [main] INFO 
org.apache.struts.validator.ValidatorPlugIn - Loading validation rules
file from '/WEB-INF/validator-rules.xml'
2006-12-11 22:57:54,535 [main] INFO 
org.apache.struts.validator.ValidatorPlugIn - Loading validation rules
file from '/WEB-INF/validation.xml'
2006-12-11 22:57:55,666 [main] INFO 
org.apache.catalina.core.StandardHost - Create Host deployer for direct
deployment ( non-jmx ) 
2006-12-11 22:57:55,673 [main] INFO 
org.apache.catalina.core.StandardHostDeployer - Processing Context
configuration file URL
file:/etc/tomcat5/Catalina/localhost/balancer.xml
2006-12-11 22:57:56,196 [main] INFO 
org.apache.catalina.core.StandardHostDeployer - Processing Context
configuration file URL file:/etc/tomcat5/Catalina/localhost/admin.xml
2006-12-11 22:57:56,911 [main] INFO 
org.apache.struts.util.PropertyMessageResources - Initializing,
config='org.apache.struts.action.ActionResources', returnNull=true
2006-12-11 22:57:57,051 [main] INFO 
org.apache.struts.util.PropertyMessageResources - Initializing,
config='org.apache.struts.util.LocalStrings', returnNull=true
2006-12-11 22:57:57,914 [main] INFO 
org.apache.struts.util.PropertyMessageResources - Initializing,
config='org.apache.webapp.admin.ApplicationResources', returnNull=true
2006-12-11 22:57:59,449 [main] INFO 
org.apache.catalina.core.StandardHostDeployer - Processing Context
configuration file URL file:/etc/tomcat5/Catalina/localhost/manager.xml
2006-12-11 22:57:59,979 [main] INFO 
org.apache.catalina.core.StandardHostDeployer - Processing Context
configuration file URL
file:/etc/tomcat5/Catalina/localhost/datingapp.xml
2006-12-11 22:58:00,036 [main] ERROR
tomcat.localhost./datingapp.Context - Error starting static Resources
java.lang.IllegalArgumentException: Document base /datingapp does not
exist or is not a readable directory
   at
org.apache.naming.resources.FileDirContext.setDocBase(java.lang.String)
(/usr/lib/libnaming-resources-5.0.30.jar.so)
   at org.apache.catalina.core.StandardContext.resourcesStart()
(/usr/lib/libcatalina-5.0.30.jar.so)
   at org.apache.catalina.core.StandardContext.start()
(/usr/lib/libcatalina-5.0.30.jar.so)
   at
org.apache.catalina.core.ContainerBase.addChildInternal(org.apache.catalina.Container)
(/usr/lib/libcatalina-5.0.30.jar.so)
   at
org.apache.catalina.core.ContainerBase.addChild(org.apache.catalina.Container)
(/usr/lib/libcatalina-5.0.30.jar.so)
   at
org.apache.catalina.core.StandardHost.addChild(org.apache.catalina.Container)
(/usr/lib/libcatalina-5.0.30.jar.so)
   at
org.apache.catalina.core.StandardHostDeployer.addChild(org.apache.catalina.Container)
(/usr/lib/libcatalina-5.0.30.jar.so)
   at java.lang.reflect.Method.invoke(java.lang.Object,
java.lang.Object[]) (/usr/lib/libgcj.so.6.0.0)
   at
org.apache.commons.beanutils.MethodUtils.invokeMethod(java.lang.Object,
java.lang.String, java.lang.Object[], java.lang.Class[])
(/tmp/libjakarta-commons-beanutils-1.7.0.jar.sofxwvo0.so)
   at org.apache.commons.digester.SetNextRule.end()
(/usr/lib/libjakarta-commons-digester-1.6.jar.so)
   at org.apache.commons.digester.Rule.end(java.lang.String,
java.lang.String) (/usr/lib/libjakarta-commons-digester-1.6.jar.so)
   at org.apache.commons.digester.Digester.endElement(java.lang.String,
java.lang.String, java.lang.String)
(/usr/lib/libjakarta-commons-digester-1.6.jar.so)
   at

RE: java.lang.ClassNotFoundException: com.sun.image.codec.jpeg.JPEGImageEncoder

2006-12-11 Thread Mon Cab
Chuck 

Here's the results of java -version

java version 1.4.2
gij (GNU libgcj) version 4.0.2 20051125 (Red Hat 4.0.2-8)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is
NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.

according to http://gcc.gnu.org/java/

GCJ is a portable, optimizing, ahead-of-time compiler for the Java
Programming Language. It can compile Java source code to Java bytecode
(class files) or directly to native machine code, and Java bytecode to
native machine code.

Compiled applications are linked with the GCJ runtime, libgcj, which
provides the core class libraries, a garbage collector, and a bytecode
interpreter. libgcj can dynamically load and interpret class files,
resulting in mixed compiled/interpreted applications. It has been
merged with GNU Classpath and supports most of the 1.4 libraries plus
some 1.5 additions. 

I see no rt.jar under usr/share/java.  

contents include (first 4 are directories):

ant
gcj-endorsed
javamail
mx4j

activation.jar
ant.jar
ant-1.6.2.jar
ant-launcher.jar
ant-launcher-1.6.2.jar
bcel.jar
bcel-5.1.jar
catalina-ant-5.0.30.jar
catalina-ant5.jar
commons-beanutils.jar
commons-beanutils-1.7.0.jar
commons-collections.jar
commons-collections-3.1.jar
commons-dbcp.jar
commons-dbcp-1.2.1.jar
commons-digester.jar
commons-digester-1.6.jar
commons-digester-1.6-rss.jar
commons-digester-rss.jar
commons-el.jar
commons-el-1.0.jar
commons-fileupload.jar
commons-fileupload-1.0.jar
commons-launcher.jar
commons-launcher-0.9.jar
commons-logging.jar
commons-logging-1.0.4.jar
commons-logging-api.jar
commons-logging-api-1.0.4.jar
commons-modeler.jar
commons-modeler-1.1.jar
commons-pool.jar
commons-pool-1.2.jar
commons-validator.jar
commons-validator-1.1.3.jar
com-sun-javadoc-0.7.7.jar
com-sun-tools-doclets-Taglet-0.7.7.jar
cryptix.jar
cryptix-3.2.0.jar
cryptix-asn1.jar
cryptix-asn1-2009.jar
eclipse-ecj.jar
gnu-classpath-tools-gjdoc-0.7.7.jar
gnu-crypto.jar
gnu-crypto-2.0.1.jar
hibernate_jdbc_cache.jar
jaf.jar
jaf-1.0.2.jar

Does this explain why com.sun.image.codec package is not accessible?


--- Caldarale, Charles R [EMAIL PROTECTED] wrote:

  From: Mon Cab [mailto:[EMAIL PROTECTED] 
  Subject: RE: java.lang.ClassNotFoundException: 
  com.sun.image.codec.jpeg.JPEGImageEncoder
  
  I believe its Suns JRE.
 
 Doing java -version from a shell prompt will tell you.
 
  But I have heard that on UNIX there is no access to awt
  ( presumable other image packages), due to UNIX being
  headles server.
 
 Operating in a headless mode restricts some AWT functions, but image
 manipulation is still allowed.  Headless is used when there's no
 graphical rendering mechanism (e.g., an X11 client) directly on
 platform.
 
 The JPEG encode/decode classes are definitely in the standard JRE
 distribution.
 
  - Chuck
 
 
 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE
 PROPRIETARY
 MATERIAL and is thus for use only by the intended recipient. If you
 received this in error, please contact the sender and delete the
 e-mail
 and its attachments from all computers.
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 



 

Yahoo! Music Unlimited
Access over 1 million songs.
http://music.yahoo.com/unlimited

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How to use logging in Tomcat correctly (declare Logger Static or not) ?

2006-11-17 Thread Mon Cab

 
 Good day
 
 I am having a hard time understanding how to use commons logging on
Tomcat.   The struts.apache.org suggest the following usage (presumably
for  business objects) (taken from: 
 http://struts.apache.org/1.x/userGuide/building_controller.html )
 
 
   package com.foo;
 // ...
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 ...
 public class User {
 // ...
 private static Log log =
 LogFactory.getLog(User.class);
 // ...
 public void setBar(Bar bar) {   
 
 log.trace(Setting bar to  + bar);
 this.bar = bar;
 }
 // ...
 }
 
 
 The suggestion seems to be that it is OK to declare my Logger as a
 static variable in the business object.  This is ideal for me
 because,
 I will be accessing the Logger from both instance and static methods,
 and so I do not want to have to declare this as an instance variable.
  
 
 However, I am wondering whether this is OK, given that my business
 objects will be being accessed from different servlet threads.  Can
 anyone tell me whether this is OK?, and if not, what is the correct
 way
 to do this?
 
 My second question is whether the same usage is valid for Action (or
servlet)  classes. I saw the following example, at 

http://www.mobilefish.com/developer/struts/struts_quickguide_log4j.html
 but am not certain as to whether using a static variable would be OK
 here.  Would it?
 
 public class DemoServlet extends Servlet {
 
   private static Log log =
 LogFactory.getLog(com.mobilefish.DemoAction);
 
   public service  etc etc  {}

 }
 
 The commons logging documentation notes the following: 
 
 Note that for application code, declaring the log member as static
 is
 more efficient as one Log object is created per class, and is
 recommended. However this is not safe to do for a class which may be
 deployed via a shared classloader in a servlet or j2ee container or
 similar environment. If the class may end up invoked with different 
 thread-context-classloader values set then the member must not be
 declared static. The use of static should therefore be avoided in
 code within any library type project. 
 
 I'm not clear as to what the above means, from a practical
 perspective
 in the context of a web applicaiton.  What does this mean in simple
 terms?
 
 Taken from:

http://jakarta.apache.org/commons/logging/guide.html#Configuring_Log4J
 
 
 
 
 
  


 The all-new Yahoo! Mail beta
 Fire up a more powerful email and get things done faster. 
 http://new.mail.yahoo.com
 
 



 

Sponsored Link

$420k for $1,399/mo. 
Think You Pay Too Much For Your Mortgage? 
Find Out! www.LowerMyBills.com/lre

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to use logging in Tomcat correctly (declare Logger Static or not) ?

2006-11-17 Thread Mon Cab
Thanks Bill

This helps a lot.  I'm using Log4j, so this is good news.  Also, I wont
be putting any of my classes in $CATALINA_HOME/shared/lib or 
$CATALINA_HOME/common/lib.  

Thanks again.  


--- Bill Barker [EMAIL PROTECTED] wrote:

 
 Mon Cab [EMAIL PROTECTED] wrote in message 
 news:[EMAIL PROTECTED]
 
 
  Good day
 
  I am having a hard time understanding how to use commons logging
 on
  Tomcat.   The struts.apache.org suggest the following usage
 (presumably
  for  business objects) (taken from:
  http://struts.apache.org/1.x/userGuide/building_controller.html )
 
 
  package com.foo;
  // ...
  import org.apache.commons.logging.Log;
  import org.apache.commons.logging.LogFactory;
  ...
  public class User {
  // ...
  private static Log log =
  LogFactory.getLog(User.class);
  // ...
  public void setBar(Bar bar) {
 
  log.trace(Setting bar to  + bar);
  this.bar = bar;
  }
  // ...
  }
 
 
  The suggestion seems to be that it is OK to declare my Logger as a
  static variable in the business object.  This is ideal for me
  because,
  I will be accessing the Logger from both instance and static
 methods,
  and so I do not want to have to declare this as an instance
 variable.
 
 
  However, I am wondering whether this is OK, given that my business
  objects will be being accessed from different servlet threads. 
 Can
  anyone tell me whether this is OK?, and if not, what is the
 correct
  way
  to do this?
 
 
 I think that there may be a race condition with SimpleLog.  But JULI
 and 
 Log4j are thread-safe, so it's fine to use a static instance of Log
 with 
 these.
 
  My second question is whether the same usage is valid for Action
 (or
  servlet)  classes. I saw the following example, at
 
 

http://www.mobilefish.com/developer/struts/struts_quickguide_log4j.html
  but am not certain as to whether using a static variable would be
 OK
  here.  Would it?
 
  public class DemoServlet extends Servlet {
 
private static Log log =
  LogFactory.getLog(com.mobilefish.DemoAction);
 
public service  etc etc  {}
 
  }
 
  The commons logging documentation notes the following:
 
  Note that for application code, declaring the log member as
 static
  is
  more efficient as one Log object is created per class, and is
  recommended. However this is not safe to do for a class which may
 be
  deployed via a shared classloader in a servlet or j2ee container
 or
  similar environment. If the class may end up invoked with
 different
  thread-context-classloader values set then the member must not be
  declared static. The use of static should therefore be avoided
 in
  code within any library type project.
 
  I'm not clear as to what the above means, from a practical
  perspective
  in the context of a web applicaiton.  What does this mean in
 simple
  terms?
 
 
 It means that you have potential gotus if you use a static instance
 in a 
 class that is in a jar in $CATALINA_HOME/shared/lib or 
 $CATALINA_HOME/common/lib.  It's fine to use a static instance if the
 class 
 is living in a jar in WEB-INF/lib.
 
  Taken from:
 
 

http://jakarta.apache.org/commons/logging/guide.html#Configuring_Log4J
 
 
 
 
 
 
 
 


  The all-new Yahoo! Mail beta
  Fire up a more powerful email and get things done faster.
  http://new.mail.yahoo.com
 
 
 
 
 
 
 


  Sponsored Link
 
  $420k for $1,399/mo.
  Think You Pay Too Much For Your Mortgage?
  Find Out! www.LowerMyBills.com/lre
 
 
 -
  To start a new topic, e-mail: users@tomcat.apache.org
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
  
 
 
 
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 



 

Sponsored Link

Mortgage rates near 39yr lows. 
$510k for $1,698/mo. Calculate new payment! 
www.LowerMyBills.com/lre

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]