Re: Terminating Timer Thread Gracefully

2011-07-12 Thread Len Popp
On Tue, Jul 12, 2011 at 10:03, David kerber dcker...@verizon.net wrote:

 On 7/12/2011 9:59 AM, Kris Schneider wrote:

 On Tue, Jul 12, 2011 at 7:59 AM, Caldarale, Charles R
 chuck.caldar...@unisys.com  wrote:

 From: Terence M. Bandoian [mailto:tere...@tmbsw.com]
 Subject: Terminating Timer Thread Gracefully


  Finally, in contextDestroyed, I inserted a call to
 Thread.sleep after canceling the timer and the error
 message disappeared.


 You should be able to do a Thread.join() using the timer's Thread object
 rather than sleeping.


 But Timer doesn't expose its thread. An alternative would be use
 something like Executors.**newSingleThreadScheduledExecut**or() to get a
 ScheduledExecutorService. The executor can be used to schedule a
 Runnable with a fixed rate or delay. When the context is destroyed,
 shutdown the executor and await its termination.


 No need even to do that; just .cancel() the timer.


Except that didn't work, according to Terence, until he added a sleep after
cancelling the timer. Could that be because the timer thread is busy
performing tasks that take some time to run? After cancel() is called the
timer thread terminates gracefully (according to the Java doc) which means
waiting for the currently executing task, if any, to finish.
-- 
Len


Re: [OT] Setting HTTP response headers caching for 1 year doesn't work

2011-01-16 Thread Len Popp
On Sun, Jan 16, 2011 at 08:41, André Warnier a...@ice-sa.com wrote:
 Ran Berenfeld wrote:

 well ...no... first evaluate, then assign. and constants are int by
 default.
 I think C/C++ would have the same problem...

 Maybe.  But then why does the fact of specifying just the first right-hand
 side constant in the calculation as a long, magically change the whole
 result into a long ?

It's not magic. For each * operation, if one operand is int and one is
long, the compiler does a 64-bit multiply and produces a long result.
Now, consider each * in that expression (in order of evaluation) and
ask, What type is each operand?

Some people would explicitly write (1000L * 60L * 60L * 24L * 365L)
to avoid this sort of head-scratching.

 (1000 * 60 * 60 * 24 * 365)  -- int
 (1000L * 60 * 60 * 24 * 365) -- long

 Note: my intention is not to start a rant or a flame on the way Java does
 things.
 I suppose that the Java syntax rules describe this accurately.
 But I find this unintuitive.
 Specially since it appears that in your first formula, the result is
 overflowing at some point in the calculation, without even a warning (?).

Yep, there's no overflow checking for arithmetic on primitive types.
For the sake of efficiency, I presume.


 If someone writes
 Long a = something
 then someone clearly expresses the desire to obtain a Long result.
 And if for some obscure reason that was really not the case, one could
 always write
 Long a = (int) something

 I suppose that there must be some implacable logic in the way it's done now,
 other than the evil intention to fool the unsuspecting programmer, but I
 honestly fail to see it.

There certainly are logical rules behind it. If you want the why, I
guess you'd have to ask Jim Gosling.
--
Len

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



Re: Release COM Objects

2010-11-02 Thread Len Popp
I would use a ServletContextListener. It gets notified when the webapp
is initialized and destroyed.
--
Len



On Tue, Nov 2, 2010 at 14:53, Leo Donahue - PLANDEVX
leodona...@mail.maricopa.gov wrote:
 http://j-integra.intrinsyc.com/support/com/doc/gc/index.html

 #4 com.linar.jintegra.Cleaner.releaseAll();

 Can Tomcat call this method prior to shutting down as a windows service?  If 
 so where would I configure this?




 JSF 1.2 (Sun RI) mojarra-1.2
 Tomcat running as a windows service

 Using CATALINA_BASE:   C:\apache-tomcat-6.0.29
 Using CATALINA_HOME:   C:\apache-tomcat-6.0.29
 Using CATALINA_TMPDIR: C:\apache-tomcat-6.0.29\temp
 Using JRE_HOME:        C:\Program Files\Java\jdk1.6.0_20
 Using CLASSPATH:       C:\apache-tomcat-6.0.29\bin\bootstrap.jar
 Server version: Apache Tomcat/6.0.29
 Server built:   July 19 2010 1458
 Server number:  6.0.0.29
 OS Name:        Windows 2003
 OS Version:     5.2
 Architecture:   x86
 JVM Version:    1.6.0_20-b02
 JVM Vendor:     Sun Microsystems Inc.

 Leo Donahue




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



Re: META - Thread Hijacking

2010-09-01 Thread Len Popp
On Wed, Sep 1, 2010 at 18:06, Christopher Schultz
ch...@christopherschultz.net wrote:
 In the end, it's mostly up to the user's own personal preference which
 way things should go. Those of us whose mail clients respect the
 thread-id in the SMTP headers can see immediately when someone hijacks a
 thread. Those folks have nowhere to hide: the SMTP headers do not lie. :)

I suggest that complaints about hijacked threads should be sent to the
person directly instead of spamming the whole list.
(The complaints seem especially pointless to me because, ironically,
the threads never looked hijacked to me!)
--
Len

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



Re: META - Thread Hijacking

2010-09-01 Thread Len Popp
On Wed, Sep 1, 2010 at 19:08, Konstantin Kolinko knst.koli...@gmail.com wrote:
 Have you ever searched the list archives?

Good idea...
http://tomcat.markmail.org/search/?q=hijack#query:hijack%20list%3Aorg.apache.tomcat.users+page:1+state:facets
More than 700 messages! Really, is there a reason they all need to be
sent to everyone??
--
Len

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



Re: 7.02 on Windows XP: An instance of Tomcat7 is already running

2010-08-31 Thread Len Popp
On Tue, Aug 31, 2010 at 19:49, Steven Woody narkewo...@gmail.com wrote:
 If launch Configure Tomcat:   An instance of Tomcat7 is already running;
 If launch Monitor Tomcat: An instance of Tomcat7w is already running.

Despite the different wording, the meaning is the same: The
Monitor/Configure app is already running. There should be a little
Apache icon in the taskbar notification area.

 In the process list, I can see there are two processes: tomcat7 and tomcat7w.

tomcat7.exe is Tomcat itself, running in a Windows service wrapper.
tomcat7w.exe is the Monitor/Configure app.
--
Len

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



Re: Tomcat Version Numbers

2010-08-20 Thread Len Popp
On Fri, Aug 20, 2010 at 12:26, Christopher Schultz
ch...@christopherschultz.net wrote:
 It's not that I
 don't get it... it's that I have a deep-seated need for the release
 version to be called 7.0.0 for some reason.

Call me cynical, but I naturally assume that a major new version will
have more bugs (no matter how much beta testing was done), and I feel
much safer installing a x.0.1 release. So I find the Tomcat numbering
system more reassuring. :-)
--
Len

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



Re: Is there a better way to disable JSESSIONID in the URLs?

2010-08-19 Thread Len Popp
On Thu, Aug 19, 2010 at 12:01, Christopher Schultz
ch...@christopherschultz.net wrote:
 The servlet specification mandates this behavior. Tomcat simply must
 support it. The spec says nothing of configurability, so Tomcat does not
 provide any. Hence the need to write a filter to achieve your desired
 behavior.

That's not inviolable dogma. Tomcat does have some settings that make
it operate out-of-spec, e.g. non-standard cookie parsing. I don't see
why an option couldn't be added to disable JSESSIONID in URLs, if
enough people would find it useful.
--
Len

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



Re: Is there a better way to disable JSESSIONID in the URLs?

2010-08-17 Thread Len Popp



On 2010-08-17, at 18:15, Caldarale, Charles R chuck.caldar...@unisys.com 
 wrote:
Tomcat won't put the jsessionid in the URL unless cookies are  
disabled.  If they are, then your webapp could refuse to talk to the  
client.


That's not true. Tomcat doesn't know if cookies are available until  
the second request, so the first page you get is full of URLs with  
jsessionids.


Also search engine bots don't seem to use cookies. I saw lots of  
pointless re-re-re-crawling by search bots until I cleaned up the URLs.

--
Len





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



Re: weird bug?

2010-07-13 Thread Len Popp
On Tue, Jul 13, 2010 at 17:42, Caldarale, Charles R
chuck.caldar...@unisys.com wrote:
 You really don't know how to create a new e-mail message, rather than hitting 
 the reply button?  What seriously deficient e-mail client are you using?

  - Chuck

You really don't know that most people don't understand your problem,
because we use email clients that recognize threads properly? All of
the hundreds of don't hijack threads messages I see on this list are
nothing but spam, AFAIC.

Suggestion: In future, when deriding someone for hijacking threads,
do it in a private email instead of annoying everyone else on the
list. Thanks.
--
Len

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



Re: favicon when serving non-html

2010-07-06 Thread Len Popp
The usual way to specify the favicon is by putting it at the root of
the web site, e.g. http://www.example.com/favicon.ico. On the server,
this file is usually found in [Tomcat dir]/webapps/ROOT/favicon.ico -
change that file to whatever icon you want.

There are some other ways to specify the favicon, but I don't know if
they're supported by all browsers.

References:
http://www.w3.org/2005/10/howto-favicon
http://en.wikipedia.org/wiki/Favicon
-- 
Len

On Tue, Jul 6, 2010 at 14:34, Dola Woolfe dolac...@yahoo.com wrote:
 Thanks for the responses.

 When I serve up a pdf file with the code below, it shows it in an embedded 
 acrobat, as desired. However, the icon in the browser (in the tab) is the 
 Tomcat logo.

 I'd like to change it to something else.

 - Original Message 
 From: Pid p...@pidster.com
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Tue, July 6, 2010 1:10:08 PM
 Subject: Re: favicon when serving non-html

 On 06/07/2010 15:10, Dola Woolfe wrote:
 Hi,

 When I serve up, say, a PDF file, how do I control the favicon?

 Here's my code:


    response.reset();
     response.setContentType(IOUtilities.gMIMEType(fn));
     response.setHeader(Content-disposition, inline; filename= + 
 file.getName());
     OutputStream outStream = response.getOutputStream();
     synchronized(response.getOutputStream()){
       outStream.write(IOUtilities.gFile2Bytes(file.getAbsolutePath()));
     }
     response.flushBuffer();

 Thanks in advance

 If you mean How do I specify which icon will be associated with a file
 that I make available for download?

 You can't - the OS will always be able to override it.

 The best you can do is present a recognisable MIME type in the
 setContentType method call.  You're using another class there, so I
 can't see what you're actually setting.  Do you know what is sent?


 p


 P.S. please note the following:

 - It's Tomcat, not Tom Cat.

 - The mailing list is now users@tomcat.apache.org not
 tomcat-u...@jakarta.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: FAQ: Tomcat 6 Java Version Requirements

2010-04-29 Thread Len Popp
On Thu, Apr 29, 2010 at 18:02, Konstantin Kolinko
knst.koli...@gmail.com wrote:
 Requiring to read documentation before running a product is unfair ?
  All the files that you have to read first do contain that
 information.  Maybe we can adjust some wording and some headers to be
 more clear, though.

One good thing about proprietary software is that it lists the system
requirements on the outside of the box, instead of in the bottom of a
locked filing cabinet stuck in a disused lavatory with a sign on the
door saying Beware of the Leopard. :)

On 4/29/2010 5:20 PM, André Warnier wrote:
 Suggestion : in the little table at the top of the which version?
 page, add a column with the minimum Java version required.

+1
-- 
Len

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



Re: [OT] Imperialism and sad demise

2010-04-01 Thread Len Popp
That's terrible! I predict a humungous backlash from lmgtfy users, and
they'll be forced to restore the old service. Probably by tomorrow
morning. :-)
-- 
Len



On Thu, Apr 1, 2010 at 15:25, André Warnier a...@ice-sa.com wrote:
 Well, fellow Tomcatters, it is with deep sadness that I have to report that
 one of the most beloved tools used on this forum seems to have been
 hijacked.
 www.lmgtfy.com now seems to lead to a search page named Topeka, with a logo
 eerily reminiscent of something else, but which leads to a search in... Bing
 !
 Of course one has to give it's due to free enterprise, and I wish the
 original lmgtfy inventors the best of luck, congratulate them on their
 inventive spirit, and thank them for the numerous and humorous answers they
 have made possible on this forum. I won't even ask how much dirty money the
 bastards got for this new linkage, nor show any inkling of my deep jealousy.
 I have to say however that my first try, through lmgtfy, to this new search
 engine, was deeply disappointing, and largely inferior to the results I got
 right after that using the same simple search in Google.
 Just try tomcat +windows7 if you don't believe me.



 -
 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: How to surpress The requested resource XYZ is not available - response

2010-03-15 Thread Len Popp
I don't think you can do that. After Tomcat accepts the HTTP
connection and decides whether to respond, it's too late to pretend
there's no server there. The user's web browser displays a different
error message for no server (something like can't establish a
connection) vs. server timeout (something like the server took too
long to respond) or dropping the connection (the connection was
reset).

So you might as well just customize the 404 error page to say There's
no server here - it'd fool people just as well. :-)  Or just return
an empty error page.
-- 
Len



On Mon, Mar 15, 2010 at 19:26, Song Thuy Nguyen programm...@biaqua.de wrote:
 Hello,



 usually you will get a The requested resource /XYZ is not available 
 response when you call an
 unavailable web service on Apache Tomcat. However, for a special use case I 
 don't want Tomcat to
 answer to  requests for a unknown/unavailable web service. I just want Tomcat 
 to ignore it and keep
 quiet, resulting that the caller will get a timeout and therefore knows that 
 there is no service behind
 this URL. How can I achieve such behaviour?



 Best Regards,





 Song Thuy Nguyen



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



Re: Webapp slow down after idle - 5.5.x

2010-02-22 Thread Len Popp

One thing that comes to mind is virtual
memory swapping. If Tomcat is idle for a long time, all of its memory  
may be swapped out to disk to make room for other programs. Then when  
Tomcat needs to handle a request, it must be swapped back in from disk  
which takes time.


I've observed the hard disk light flickering when this happens but I  
don't know if you want to spend the night camping in the server room  
watching for this.

--
Len


On 2010-02-22, at 13:29, klin...@poczta.fm wrote:


Hello,

My webservice (using axis 1.1)is deployed on tomcat 5.5.28. Tomcat  
runs on AIX and IBM Java 1.5 SR9. The problem is that every first  
request after a longer idle (like a day) is served very slow.  
There's no performance problem with next requests. It looks quite  
similar to first request after tomcat restart yet there's no restart  
here.
It's very difficult to spot the problem since most of the time  
everything runs fine and I have like one chance a day to test some  
new options.


Any ideas about that ?
Thanks in advance, Kate

--
Kup wlasne mieszkanie za 72 tys. zl.
Sprawdz najlepsze oferty  http://link.interia.pl/f25a8


-
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: Can't Disable Apache Tomcat

2010-02-02 Thread Len Popp
What exactly is it that appears in the Task Manager? Is it
tomcat6.exe? Or tomcat6w.exe? Or java.exe?

tomcat6.exe is the Tomcat service.
java.exe appears if you run Tomcat using startup.bat.
tomcat6w.exe is the Monitor Tomcat program. It is not Tomcat, it is
a separate small program for managing the Tomcat service.
-- 
Len



On Tue, Feb 2, 2010 at 15:47, A. Wolf a.lup...@gmail.com wrote:

 Tomcat is set to disabled on my Vista machine.  But it still appears in the
 taskbar and in task manager.  How do I prevent it from loading entirely at
 startup?  I've looked under Admin Tools -- Services, but it's listed as
 Disabled there.

 This is really bothering me.  I'm about ready to uninstall all Apache
 services from my machine, as I rarely use Apache and I don't want it to load
 into RAM at startup.  Any help on removing it from RAM, apart from selecting
 Exit every time I start my machine, would be greatly appreciated.

 Anna

 --
 View this message in context: 
 http://old.nabble.com/Can%27t-Disable-Apache-Tomcat-tp27427141p27427141.html
 Sent from the Tomcat - User mailing list archive at Nabble.com.


 -
 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: error-page problem - nested exceptions

2010-01-22 Thread Len Popp
You could have your error handler check if the exception is a
NestedServletException and its getRootCause() is a
UnAuthorisedAccessException, and display the nested exception's error
message in that case. You might want to use a separate error-page
for NestedServletException.
-- 
Len



On Fri, Jan 22, 2010 at 07:06, rotis23 roti...@yahoo.com wrote:

 Hi All,

 I use web.xml error-page handlers, some with error-code and other with
 exception-type. At the end I have a catchall error-page that handles
 java.lang.Throwable - users never see a stack trace and the world is a good
 place.

 However, I've recently added a Hibernate security layer that throws a
 UnAuthorisedAccessException that gets wrapped in a Spring
 NestedServletException before it hits the error-page handlers.

 Now I understand that it tries to match the top level Exception in the stack
 first then uses the next nested exception after that and so on until an
 error-page is matched. The problem is that my catchall Throwable is matching
 the NestedServletException first before the wrapped
 UnAuthorisedAccessException hits its error-page handler. I need the users to
 see that they don't have the privleges rather than a generic error messge -
 I also need the catchall!

 Has anyone else dealt with this issue? I've been searchign for a couple days
 on this now.

 TIA, rotis23
 --
 View this message in context: 
 http://old.nabble.com/error-page-problem---nested-exceptions-tp27272261p27272261.html
 Sent from the Tomcat - User mailing list archive at Nabble.com.


 -
 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: error-page problem - nested exceptions

2010-01-22 Thread Len Popp
Yes, in the error page you can get the exception as a request
attribute, either javax.servlet.jsp.jspException or
javax.servlet.error.exception (sometimes it's one, sometimes the
other). In my app, I found that this exception has already been
unwrapped - it's the original exception, not a ServletException. I'm
not sure it works the same way with Spring's NestedServletException -
you'll have to try it out.
-- 
Len



On Fri, Jan 22, 2010 at 12:15, rotis23 roti...@yahoo.com wrote:

 Hi Len,

 Thanks for your message.

 I don't have my 'own' error handler - I just use the error-page elements in
 web.xml.

 If I add an error-page for NestedServletException will the exception be
 available to the corresponding jsp [in the request]?

 Has anyone extended tomcats error-page implementation to find nested
 exceptions?

 Cheers, rotis23
 --
 View this message in context: 
 http://old.nabble.com/error-page-problem---nested-exceptions-tp27272261p27276806.html
 Sent from the Tomcat - User mailing list archive at Nabble.com.


 -
 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: Ignore http header if-modified-since

2009-12-18 Thread Len Popp
Add some debugging code to your app to find the point where the
Last-Modified header is added. Call HttpServletResponse.containsHeader
to see if the header has been set.
-- 
Len



On Fri, Dec 18, 2009 at 10:47, Abid Hussain abid.huss...@dilax.com wrote:
 OK, it seems that tomcat is working correctly.

 Still I would like to get the root cause of my problem which is again:
 The last-modified response header is delivered in the locale of the
 server. E.g. if this locale is polish or germen, the header is delivered
 in polish resp. german format which is not correct and causes
 misbehaviour.

 Naturally I just can set the locale to en_US to get the desired header
 format. But this is not the root cause of the problem. The question is:
 How can the format of this header can be set (or overridden) to the
 server's locale?
 I tried the following:
 * Asked Google: Nothing found.
 * Searched for occurences of last-modified in the source code of my
 application: Nothing found.
 * Looked if the methods HttpServletResponse.setHeader() or
 HttpServletResponse.addHeader() are used with the last-modified
 somewhere in my application: Nothing found.
 * Looked if one of the configured filters modify the header: Nothing
 found.
 * Looked if any valves are used: None.

 Anybody got an idea how I can investigate further?

 Regards,

 Abid

 -Ursprüngliche Nachricht-
 Von: André Warnier [mailto:a...@ice-sa.com]
 Gesendet: Freitag, 18. Dezember 2009 13:56
 An: Tomcat Users List
 Betreff: Re: AW: Re: AW: RE: RE: Ignore http header if-modified-since

 Mark Thomas wrote:
  On 18/12/2009 09:36, André Warnier wrote:
  Christopher Schultz wrote:
  -BEGIN PGP SIGNED MESSAGE-
  Hash: SHA1
 
  Abid,
 
  On 12/17/2009 12:08 PM, Abid Hussain wrote:
  I used the startup parameters
  -Duser.language=en
  -Duser.region=US
  This caused Tomcat to deliver the Last-Modified in the
 correct format.
 
  That solved the problem, no 404 anymore, thanks.
  So it seems to be a bug in tomcat...?
  I would say so.
 
  http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1
 
  Tomcat's behavior seems to ignore the specification,
 here. Would you
  care to share your Tomcat version with us?
 
  So far, I haven't seen anything that demonstrates Tomcat is
 generating
  this header. It looks like an app issue to me. My testing
 with trunk,
  6.0.x and 6.0.20 all show the correct format being used.
 
  I think that once this is confirmed, it may be worth raising its
  visibility a bit for the Tomcat developers.
 
  As always before reporting an error, I'd highly recommend
 generating a
  simple as possible test case that demonstrates the issue on a clean
  Tomcat install. I can't repeat this and at the moment it
 looks like an
  application issue. Any bug report that can't be repeated is
 just going
  to get closed as WORKSFORME.
 

 For a confirmation of what Mark says above, I ran some tests.

 This Tomcat 5.5 is a pretty vanilla version, with just the
 standard example apps and not much more, on my Windows workstation.
 Versions are not the latest ones, I know.

 INFO: Starting Servlet Engine: Apache Tomcat/5.5.26 Platform
 : Windows XP, German Java :
 java version 1.6.0_06
 Java(TM) SE Runtime Environment (build 1.6.0_06-b02) Java
 HotSpot(TM) Client VM (build 10.0-b22, mixed mode, sharing)

 Tomcat running as service, stopped and restarted before each
 test below

 A) Platform default
   Tomcat startup parameters as per tomcat5w.exe :
 -Dcatalina.home=C:\Tomcat5.5
 -Dcatalina.base=C:\Tomcat5.5
 -Djava.endorsed.dirs=C:\Tomcat5.5\common\endorsed
 -Djava.io.tmpdir=C:\Tomcat5.5\temp
 -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
 -Djava.util.logging.config.file=C:\Tomcat5.5\conf\logging.properties

 (platform default)

 Request:
 (Request-Line)        GET /RELEASE-NOTES.txt HTTP/1.1
 Host  localhost:8180
 User-Agent    Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB;
 rv:1.9.1.3)
 Gecko/20090824 Firefox/3.5.3
 Accept
 text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
 Accept-Language       en-gb,en;q=0.5
 Accept-Encoding       gzip,deflate
 Accept-Charset        ISO-8859-1,utf-8;q=0.7,*;q=0.7
 Keep-Alive    300
 Connection    keep-alive
 If-Modified-Since     Mon, 28 Jan 2008 20:38:54 GMT
 If-None-Match W/7697-1201552734000
 Cache-Control max-age=0

 Response:
 (Status-Line) HTTP/1.1 304 Not Modified
 Server        Apache-Coyote/1.1
 Etag  W/7697-1201552734000
 Date  Fri, 18 Dec 2009 11:37:58 GMT

 B) Adding explicit DE startup parameters
   Tomcat startup parameters as per tomcat5w.exe :
 -Dcatalina.home=C:\Tomcat5.5
 -Dcatalina.base=C:\Tomcat5.5
 -Djava.endorsed.dirs=C:\Tomcat5.5\common\endorsed
 -Djava.io.tmpdir=C:\Tomcat5.5\temp
 -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
 -Djava.util.logging.config.file=C:\Tomcat5.5\conf\logging.properties
 -Duser.language=de
 -Duser.region=DE

 Request :
 (Request-Line)        GET /RELEASE-NOTES.txt HTTP/1.1
 Host  localhost:8180
 

Re: mod_jk and session stickyness of images requests

2009-12-11 Thread Len Popp
On Fri, Dec 11, 2009 at 12:38, Kockert, Timo
timo.kock...@adesso-mobile.de wrote:
 Just to clarify: I know the EncodeUrlTransformer does the
 encoding for me. The problem seems to be that some
 devices do not send session ID cookies with image
 requests.

Do you know what type of devices they are? Your log file may contain
User-Agent info that tells you whether the failed requests came from
real browsers or search bots or whatever.
-- 
Len

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



Re: Tomcat / windows 2008 IIS 7 x64

2009-11-19 Thread Len Popp
The Setup section of the docs describes basic Tomcat setup.
Info about integrating with IIS is in the Tomcat Connectors docs:
http://tomcat.apache.org/connectors-doc/
There's an IIS how-to in there.
-- 
Len



On Thu, Nov 19, 2009 at 12:54, Sabo, Eric eric.s...@calu.edu wrote:
 Which doc would that be under?  Can you be more specific?

 -Original Message-
 From: Pid [mailto:p...@pidster.com]
 Sent: Thursday, November 19, 2009 11:57 AM
 To: users@tomcat.apache.org
 Subject: Re: Tomcat / windows 2008 IIS 7 x64

 On 19/11/2009 16:38, Sabo, Eric wrote:
 Is there any official documentation on how to setup Tomcat (ASPX/JSP java 
 interpreter) on a Windows 2008 using IIS 7 (x64 platform)  ?

 Start by reading the docs: http://tomcat.apache.org/


 p


 Thanks in advance,
 Eric Sabo
 Senior Windows Systems Engineer
 Information Technology Services  - Operations
 California University of Pennsylvania
 Please note my new email address:    eric.s...@calu.edu



 Notice:  California University of Pennsylvania is changing its domain name 
 from CUP.EDU to CALU.EDU, effective Aug. 14.  Please make a note that all 
 email addresses will change to use this domain name and record appropriate 
 changes in your contact lists.  The CUP.EDU address will continue to work in 
 parallel for a short time and then will be discontinued.

 -
 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: What is the difference between running Tomcat 6 as a Windows Service vs. running from the command line?

2009-10-19 Thread Len Popp
On Mon, Oct 19, 2009 at 12:40, Alan Kennedy alan.kennedy.n...@gmail.com wrote:
 Thanks for the suggestion Markus, it was a good one.

 Unfortunately, it did not solve the problem: the behaviour is exactly
 the same when running under my own account: the bug still occurs.

 Regards,

 Alan.

Besides the user account, other possible differences are which Tomcat
installation is being used, which Java installation is being used, and
various options passed to both Java and Tomcat. Max memory size and
thread stack size are a couple to look at. It's even possible that
you're running completely different versions of both Tomcat and Java
in the two scenarios.

For the Windows service the options are set in the Configure Tomcat
app (tomcat6w.exe). For startup.bat the options are set in various
environment variables and batch files. See the Tomcat docs for more
details because I sure can't remember them all. :-)
-- 
Len

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



Re: Tomcat + APR non-root on linux: Socket bind failed: [98] Address already in use

2009-10-15 Thread Len Popp
On Thu, Oct 15, 2009 at 10:39, Christopher Schultz
ch...@christopherschultz.net wrote:
 That's port 8443, not port 98. Where's your real Connector defined?

98 isn't a port number, it's an error code. It stands for Address
already in use.
-- 
Len

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



Re: Create FileInputStream in servlet from remote file with accentuated character name

2009-09-22 Thread Len Popp


On 2009-09-22, at 11:33, Christopher Schultz ch...@christopherschultz.net 
 wrote:

Somebody needs to write a virus that just converts everything to UTF-8
so we can be done with it.


I hear you can contract out that sort of work these days. :-)
--
Len


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



Re: website offline

2009-08-28 Thread Len Popp
On Fri, Aug 28, 2009 at 08:07, Nikolay Diulgerovndiulge...@imx.fr wrote:
 Can someone involved directly state if this anyway compromised the builds
 provided for download in some timeframe in the past.

http://blogs.apache.org/infra/entry/apache_org_downtime_initial_report
-- 
Len

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



Re: Apache Tomcat hangs

2009-08-23 Thread Len Popp
2009/8/23 Pid p...@pidster.com:
 On 23/08/2009 11:08, fps wrote:

 I got this kind of exception with a jsp defined with session=false (in the
 %@ page... %  section at the top of the file) including another jsp which
 was not including that session=false directive


 Which kind of exception?
 Which version of Tomcat?
 Which version of the JVM?
 OS?
 What do the logs say?

fps was answering, not asking. The entire thread can be seen here:
http://www.nabble.com/Apache-Tomcat-hangs-td23777681.html
-- 
Len

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



Re: Custom 404 page when webapp stopped

2009-08-20 Thread Len Popp
On Thu, Aug 20, 2009 at 10:58, Tim Funkfunk...@apache.org wrote:
 From a high level, whats the difference between a webapp thats stopped and a
 webapp thats undeployed?

When a webapp is undeployed it is deleted from the webapps directory.
When it's stopped it's not deleted and can simply be re-started. In
this case it sounds like the OP is doing some maintenance outside of
the webapp (database updates, maybe) and just needs to stop the webapp
temporarily.

 One could call stopped a special scenario. In the past - a 503 was returned
 to the user. Now its a 404. IIRC ... it changed to 404 as part of a bug
 report but maybe that is the wrong change to make. (Too lazy to look up the
 bug report)

I don't know about that change, but in the past it wasn't possible to
specify a custom error-page for a stopped webapp. (I can't get to my
test server today to see if this is still the case.)

 [Personally - I'd rather stick apache in front let apache trap the condition
 during the outage window and not worry about the rest.]

How would you trap the condition? Apache httpd's ErrorDocument
directive won't work because as long as Tomcat is running you get
Tomcat's error pages.

If you stop Tomcat completely then you can use Apache's ErrorDocument
to show a site down page, but not if you just stop one webapp in
Tomcat.

-- 
Len

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



Re: Clearing the catalina.out file

2009-08-14 Thread Len Popp
On Fri, Aug 14, 2009 at 11:23, Christopher
Schultzch...@christopherschultz.net wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Susan,

 On 8/14/2009 11:06 AM, Susan Richards wrote:
 No, but I will do it with a test server first since no one knows the answer.

 It's not that nobody knows the answer: it's that actually /trying/ to do
 it takes less time than posting to the mailing list, it's kind of silly
 to have done it.

Testing it *properly* would take far longer than asking an expert, if
it happens that some expert already knows the answer.

For example, a simple try it out likely won't tell you what happens
if Tomcat writes a log entry at the same moment when you're clearing
the log file. Do you lose a log entry? Does the log file get cleared?
(Sorry Susan, I don't know the answers myself.)

I don't see what's silly about asking questions. Isn't that what this
mailing list is for?
-- 
Len

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



Re: JSESSIONID cookie permanent?

2009-08-12 Thread Len Popp
It comes up all the time. The solution is typically to use a separate
cookie and *not* tie the persistent data to the browser session, since
the browser session is transient.
--
Len


On Wed, Aug 12, 2009 at 14:54, Mitch Claborn mi...@claborn.net wrote:

 If I can't find a another way that's what I'll have to do.  I would be
 surprised that this need doesn't come up more frequently.

 Mitch

 David Smith wrote:
  Your best bet is to assign your own cookie.  Then on new session
  creation, look for the cookie and repopulate the new session with
  shopping cart data.
 
  --David
 
  Mitch Claborn wrote:
 
  My usage is:  I store the key to the user's shopping cart in the
  session.  I'd like the user to be able to come back a few days from now
  and still find the items they have placed in their shopping cart.  (This
  is mostly for anonymous users who don't sign in until checkout.)
 
  Mitch
 
 
  Martin Gainty wrote:
 
 
  anyone know if there is a use-case for sessionId surviving end-of-session?
 
  Martin Gainty
  __
  Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
  Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene 
  Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede 
  unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese 
  Nachricht dient lediglich dem Austausch von Informationen und entfaltet 
  keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit 
  von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
  Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas 
  le destinataire prévu, nous te demandons avec bonté que pour satisfaire 
  informez l'expéditeur. N'importe quelle diffusion non autorisée ou la 
  copie de ceci est interdite. Ce message sert à l'information seulement et 
  n'aura pas n'importe quel effet légalement obligatoire. Étant donné que 
  les email peuvent facilement être sujets à la manipulation, nous ne 
  pouvons accepter aucune responsabilité pour le contenu fourni.
 
 
 
 
 
 
 
  Date: Wed, 12 Aug 2009 12:43:11 -0500
  From: mi...@claborn.net
  To: users@tomcat.apache.org
  Subject: JSESSIONID cookie permanent?
 
  Is there a way to make the JSESSIONID cookie issued by Tomcat permanent,
  or at least significantly longer life than end of session ?
 
  Mitch
 
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
  For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 
 
  _
  Get back to school stuff for them and cashback for you.
  http://www.bing.com/cashback?form=MSHYCBpubl=WLHMTAGcrea=TEXT_MSHYCB_BackToSchool_Cashback_BTSCashback_1x1
 
 
 
  -
  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: Calling JNI/COM from Tomcat when running as a Windows service

2009-08-10 Thread Len Popp
Could it be a problem finding a DLL? Check the PATH variable in your dev
account and see if it includes any directories with relevant DLLs. Even if
you call LoadLibrary with a DLL's full pathname, other subsidiary DLLs may
not be found if they're not on the search path.
-- 
Len


On Mon, Aug 10, 2009 at 12:03, Steve O'Hara
soh...@pivotal-solutions.co.ukwrote:

 We have built a Crystal Reports extension to our servlet application
 that is called via JAWIN/COM/.NET - I know, it sounds horrible doesn't
 it, but if you've ever worked with the c**p that is Crystal Reports for
 Eclipse, you'll understand why we have to do it this way.

 The JNI library (JAWIN) is loaded with loadlibrary, this communicates to
 a COM object written in C# that communicates with CR via an assembly.

 This all works fine in our Tomcat development environment (IDEA) and
 also works fine if we start Tomcat from the startup.bat file i.e.
 interactively.
 However, when we run Tomcat as a service, the report viewer section of
 our application fails when instantiating the JAWIN object with a Cannot
 load dependent files problem.

 This is obviously a permissions/security issue but despite changing the
 logon user/password of the service to a privileged, local administrator
 account, I can't make it work.

 Has anyone got any suggestions?

 Thanks,
 Steve


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




Re: Tomcat copies context.xml to, conf/Catalina/localhost/app.xml,but neverupdates it?

2009-08-07 Thread Len Popp
On Fri, Aug 7, 2009 at 10:33, M4N - Arjan Tijms arjan.ti...@m4n.nl wrote:

 Either you trust the web application or you don't. If you don't trust the
 web application the maintainer of a Tomcat instance puts his own context.xml
 in conf/Catalina, thereby overriding whatever the web application defines.
 If you do trust the web application, you don't put anything in
 conf/Catalina.


Unfortunately it's not that simple. Take for example the most common case, a
Resource definition for a JDBC database connection. The app writer has to
provide part of the definition (the resource name, e.g. jdbc/myAppDB) and
the sysadmin has to provide another part (the address of the DB server).
When the application vendor is different from the installer/maintainer, the
context.xml has to be customized at install time.

With most software, you get a text file that has to be edited to customize
the configuration data before you run the app. The difference with Tomcat is
that the app is usually packed into a .war file and it's a PITA to edit
context.xml and re-pack the .war. The alternative is to deploy the app
(which will unpack context.xml into conf/Catalina and then crash) and then
edit the site-specific configuration info. Neither way is terribly
convenient.
-- 
Len


Re: Service fails to start

2009-08-05 Thread Len Popp
I think I read about it on this mailing list. :-)
-- 
Len


On Wed, Aug 5, 2009 at 10:54, venu007 nimmagadd...@yahoo.com wrote:


 This worked for me.

 How did you find out about it.



 Len Popp wrote:
 
  This error occurs when it can't find the Microsoft C runtime library.
  Try copying the file msvcr71.dll from the Java bin directory to the
  Tomcat bin directory.
  --
  Len
 
 
 
 

 --
 View this message in context:
 http://www.nabble.com/Service-fails-to-start-tp23769675p24829318.html
 Sent from the Tomcat - User mailing list archive at Nabble.com.


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




Re: JSP when tag question

2009-07-04 Thread Len Popp
On Sat, Jul 4, 2009 at 13:52, Jim Andersonez...@ieee.org wrote:
 Having said that, I'm a bit surprised that there was not
 error message generate by  tomcat about seeing a reference
 to c:choose and c:xxx with no definition available.

I would guess that JSP processor allows unknown tags in case its
output is to be processed by some other software that understands
those tags. JSP can be used to create XML as well as HTML, and it can
be used to create output that isn't a web page.
-- 
Len

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



Re: Tomcat for serving only static files - how to prevent the likes of JSP execution

2009-07-04 Thread Len Popp
The default handling of JSP files is set in conf/web.xml: *.jsp and
*.jspx are handled by JspServlet.

In your special context, you could handle *.jsp and *.jspx files
with a servlet that just returns an error. That should do the trick.
-- 
Len



2009/7/4 Keith67 keithmatthewwat...@gmail.com:

 This might seem like a strange request, but I would like to use Tomcat to
 only serve static files, from a certain context anyway.

 I have an application I would like to allow users to upload files through,
 and then I want to be able to link to them and serve them from the server.

 If I do this, I run the risk of them uploading executable content (e.g. a
 JSP file) and then having it executed on the server, so I would like to stop
 this happening.

 Does anyone know how I could prevent any dynamic processing of files in a
 given Tomcat context.

 I appreciate I could just install Apache and do it that way but I'd rather
 just keep it simple with Tomcat.

 Thanks.
 --
 View this message in context: 
 http://www.nabble.com/Tomcat-for-serving-only-static-files---how-to-prevent-the-likes-of-JSP-execution-tp24338874p24338874.html
 Sent from the Tomcat - User mailing list archive at Nabble.com.


 -
 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: Reading POSTed data

2009-06-16 Thread Len Popp
2009/6/16 Caldarale, Charles R chuck.caldar...@unisys.com:
 From: Kyle Brantley [mailto:k...@averageurl.com]
 Subject: Reading POSTed data
 I cannot figure out how to read this posted data from the servlet.

 Read the servlet spec, not just the javadocs; section 3.1 discusses how POST 
 data should be retrieved (as parameters).

Ah, but section 3.1.1 says that POST data is only available through
getParameter if the content type is application/x-www-form-urlencoded.
In Kyle's case, the POST request contains XML data that he wants to
read and interpret.

Is there any other code that calls getParameter or a related method
before you call getInputStream? Maybe in a filter?
-- 
Len

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



Re: [SECURITY] CVE-2009-0580 Apache Tomcat User enumeration vulnerability with FORM authentication

2009-06-04 Thread Len Popp
It looks to me like the change fixes an NPE when a null or nonsense
password is given. The NPE would allow an attacker to determine if a
username is valid (without having to know the password). Not the most
serious security breach, but login protocols aren't supposed to let
you guess usernames.
-- 
Len



On Thu, Jun 4, 2009 at 12:48, Christopher
Schultzch...@christopherschultz.net wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Mark,

 On 6/3/2009 11:42 AM, Mark Thomas wrote:
 CVE-2009-0580: Tomcat information disclosure vulnerability

 I know I'm likely to get a vague response, but could you provide some
 more info about this issue?

 Due to insufficient error checking in some authentication classes,
 Tomcat allows for the enumeration (brute force testing) of usernames by
 supplying illegally URL encoded passwords.

 [snip]

 j_username=tomcatj_password=%

 I'm not sure how the patch (I read the patch for TC5.5
 DataSourceRealm.java) changes anything at all: it appears to be merely a
 performance optimization.

 No changes are made to the behavior of Tomcat, since the same null is
 returned to the caller if the credentials do not match.

 I don't see any information disclosure vulnerability in the first place,
 and I don't see how your patch would have fixed it.

 ??!

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.9 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

 iEYEARECAAYFAkon+tMACgkQ9CaO5/Lv0PCd5ACfcBAJjcKnjKjDgChIezhr8Oty
 MkQAoKUVc0ynWGvtp0Wf4S42Jeytxwwk
 =iKFX
 -END PGP SIGNATURE-

 -
 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: retrive Arabic data

2009-05-28 Thread Len Popp
On Thu, May 28, 2009 at 15:35, André Warnier a...@ice-sa.com wrote:
 Hi.
 My knowledge of java and Tomcat is limited, so I may be off-base here.
 But I have also has occasional issues with Tomcat and non-US character sets
 on various Windows platforms.
 Just for information, what is the basic Windows language version of the 3
 Windows servers you are using ?
 I mean, is for example the Windows XP system some arabic version, while the
 2003 and 2000 servers are basic English/US-Windows ?

 The reason for my question : when a Java JVM starts under Unix/Linux, it
 takes its language settings from the locale of the process it is starting
 under.
 You can change these settings, by changing the locale of the process, then
 starting the JVM (and Tomcat e.g.).
 For a Windows JVM however, there is no such locale, and I've never quite
 figured out where the JVM takes its language settings (including the default
 charset).  I suppose it is from the Windows environment somewhere though.
 I have a strong suspicion that your problem is in that area.

You shouldn't need to mess with the Java locale. A webapp can handle
text in different languages/alphabets simultaneously, no matter what
the default settings are for the server OS or JVM.

I was able to get character encodings to work correctly on Windows XP
by following the recommendations in the FAQ that Mark pointed out
(http://wiki.apache.org/tomcat/FAQ/CharacterEncoding) and making sure
the database was storing text as UTF-8. But I haven't tried other
versions of Windows.
-- 
Len

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



Re: Service fails to start

2009-05-28 Thread Len Popp
This error occurs when it can't find the Microsoft C runtime library.
Try copying the file msvcr71.dll from the Java bin directory to the
Tomcat bin directory.
-- 
Len



On Thu, May 28, 2009 at 16:39, cum.nex cum...@gmail.com wrote:

 Tomcat installed from apache-tomcat-6.0.18.exe in WXP SP2 + Java from
 jre-6u13-windows-i586-p-s.exe.
 Installation seem fine, but Tomcat service fails to start, giving the
 following log:

 [2009-05-28 22:13:14] [info] Procrun (2.0.4.0) started
 [2009-05-28 22:13:14] [info] Running Service...
 [2009-05-28 22:13:14] [info] Starting service...
 [2009-05-28 22:13:14] [174  javajni.c] [error] Impossible to find the
 specified module
 [2009-05-28 22:13:14] [994  prunsrv.c] [error] Failed creating java
 D:\Programmi\Java\jre6\bin\client\jvm.dll
 [2009-05-28 22:13:14] [1269 prunsrv.c] [error] ServiceStart returned 1
 [2009-05-28 22:13:14] [info] Run service finished.
 [2009-05-28 22:13:14] [info] Procrun finished.

 Thank you
 --
 View this message in context: 
 http://www.nabble.com/Service-fails-to-start-tp23769675p23769675.html
 Sent from the Tomcat - User mailing list archive at Nabble.com.


 -
 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: Compile JSP before the first request arrives

2009-05-27 Thread Len Popp
On Wed, May 27, 2009 at 09:51, Serge Fonville serge.fonvi...@gmail.com wrote:
 Hi

 Some JSP containers (as per section 8.4.2 of the JSP 1.2 specification)
 support the capability of precompiling a JSP page.

 To precompile a JSP page, access the page with a query string of
 ?jsp_precompile

 How is this different from just accessing the page after deploying it?

The difference is that the JSP is not executed, it's just compiled.
This is described in section 11.4.2 of the JSP 2.1 spec (that's the
spec implemented by Tomcat 6).

 And can this also be done for an entire webapp instead of a single page?

No, it's one page at a time.
-- 
Len

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



Re: Servlets that use response.getOutputStream(): do they play nicely with Tomcat's error pages?

2009-04-29 Thread Len Popp
There's no possible way for Tomcat to start from scratch. If some
data has already been sent to the client, it can't be called back to
the server. What's sent is sent.

Typically, the HTTP response is buffered because the JSP handler does
that automatically. So if an error occurs before the response headers
are sent to the client, the error page can be sent instead.

I write my servlets so that they do whatever they need to do, gather
the output data, and then write the output page. If errors occur they
generally happen before any output is written.

Another way this is often handled is to just write an error message in
the middle of the web page if an error occurs. But I guess that won't
work for you because you're writing an Excel file, not a web page.
-- 
Len



On Wed, Apr 29, 2009 at 22:41, Dave Cherkassky dch...@djinnsoft.com wrote:
 PID, thanks for your insight.


 Two comments about that:

 1) I agree with you for includes and forwards, but for errors?  I would have
 thought that the definition of error is that something went wrong, and
 Tomcat should start from scratch and just render the error page.  I didn't
 think of it as really a forward...

 2) So you are suggesting that writing out to the response.getOutputStream()
 as I go is wrong?  Instead, I need to:
 a. buffer my output locally
 b. once I am sure that it can all be created correctly, *then* I write out
 the buffer to the response?

 Am I understanding you correctly?

 Thanks,
 --
 Dave Cherkassky
  VP of Software Development
  DJiNN Software Inc.
  416.504.1354


 Pid wrote:

 Dave Cherkassky wrote:

 A long question:

 First, I have a Servlet that writes to response.getOutputStream(). Here's
 a snippet:
  public class AuditTrailServlet extends HttpServlet {
   public void doGet( HttpServletRequest request, HttpServletResponse
 response )
     response.setContentType( application/vnd.ms-excel );
     response.setHeader( Content-Disposition, attachment; filename=
 + fileName );

     ResultSet rs = ...;
     for ( int row = 0 ; rs.next(); row++ ) {
       // iterate over each row in the ResultSet
       for( int col = 0; fieldNameIt.hasNext(); col++ ) {
         // iterate over each column in the results, write to spreadsheet
                  // custom code.
         // let us assume this block has a bug that occasionally throws
 a NullPointerException,          // but only after a bunch of cells are
 written first.
                  response.getOutputStream().write( /* excel byte[] */ );
                  // more custom code.
       }
     }
     rs.close();
       response.setStatus( HttpServletResponse.SC_OK );
   }
  }

 Second, I have the following in the web.xml file, to tell tomcat to use
 a custom error page:
  error-page
   exception-typejava.lang.Throwable/exception-type
   location/myError.jsp/location
  /error-page

 Last, here's myError.jsp:
  %@ page isErrorPage='true' %
  html
  body
  h1System Error/h1
  p
  You have encountered a system error.
  /p
   %-- custom error processing that can't be done in a static .html page
 --%
   /body
  /html


 So, it all seems standard and straight-forward, right?



 However, instead of seeing a nice custom error page when the NPE
 happens, I get the ugly Tomcat error page, and
 the following in the Tomcat logs:
  java.lang.IllegalStateException: getOutputStream() has already been
 called for this response
  at

 org.apache.catalina.connector.ResponseBase.getWriter(ResponseBase.java:709)
  at

 org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:127)

  at
 org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:128)
  at

 org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:121)
  at

 org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java:137)
  at

 org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspFactoryImpl.java:153)

  at

 org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryImpl.java:148)

  at org.apache.jsp.error_jsp._jspService(error_jsp.java:284)


 Yes, I know -- I *am* using Tomcat 4.1 (rather than the latest and
 greatest) for various legacy and political reasons.


 But my question is this:
 - Is this a known bug?  Or am I doing something wrong with either the
 servlet, the web.xml or with the jsp page?

 I'm not sure it's a bug; logically, if you've sent a chunk of the
 response (and therefore committed the response, sent headers etc)
 *before* an exception happens how is Tomcat then supposed to tell the
 client to stop and then display a different page?

 p



 Thanks,




 -
 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: Services not working under Program Files folder

2009-04-07 Thread Len Popp
I have used the service.bat in various versions of Tomcat with no such error.

The script you posted is different from the service.bats in Tomcat
5.0, 5.5 and 6.0 that I have lying around. Where did you get your
service.bat from?
-- 
Len



On Tue, Apr 7, 2009 at 19:52, mailinglist mailingl...@stopware.com wrote:
 Hi,

 I am trying to create a tomcat service with the service.bat.  The
 service.bat looks for my environment variable to create the service.  If
 my directory name has a space in it (e.g. Program files) it will create
 the service but it will not start.  It keeps saying that the service has
 nothing to do.  But if i change my directory to Programfiles, then it
 would be fine.  I cannot figure out why, it will not work.  I even check
 the services properties to see the path c:\Program Files\.., and
 this seems fine to me.  Does anyone know what I am missing?  I provided
 the service.bat below also:


 @echo off
 if %OS% == Windows_NT setlocal
 set CURRENT_DIR=%cd%
 echo Current Directory = %cd%

 rem
 ---
 rem NT Service Install/Uninstall script
 rem
 rem Options
 rem install                Install the service using Tomcat5 as service
 name.
 rem                        Service is installed using default settings.
 rem remove                 Remove the service from the System.
 rem
 rem name        (optional) If the second argument is present it is
 considered
 rem                        to be new service name
 rem
 rem $Id: service.bat 304097 2005-09-22 13:34:05Z yoavs $
 rem
 ---

 rem
 ---
 rem PassagePoint settings
 rem
 ---
 if exist %PP_HOME%\client.bat goto okPPHome
 rem Try to set PP_Home manually based on the current directory
 (...\tomcat\bin)
 cd ..\..
 set PP_Home=%cd%
 cd %CURRENT_DIR%

 :okPPHome
 echo PP_Home = %PP_HOME%
 set JAVA_HOME=%PP_HOME%\Java
 set PATH=%JAVA_HOME%\bin;%PATH%

 rem Guess PPService_HOME if not defined
 rem Checking service home ...
 if not %PPService_HOME% ==  goto gotHome
 rem CD to the upper dir
 cd ..
 set PPService_HOME=%cd%
 cd %CURRENT_DIR%

 :gotHome
 rem Checking if Tomcat5.exe exists ...
 if exist %PPService_HOME%\bin\tomcat5.exe goto okHome
 echo The tomcat.exe was not found...
 echo The PPService_HOME environment variable is not defined correctly.
 echo This environment variable is needed to run this program
 goto end

 :okHome
 rem Make sure prerequisite environment variables are set
 rem Checking Java home ...
 if not %JAVA_HOME% ==  goto okJava
 echo The JAVA_HOME environment variable is not defined
 echo This environment variable is needed to run this program
 goto end

 :okJava
 if not %PPService_BASE% ==  goto gotBase
 rem Setting service base to service home ...
 set PPService_BASE=%PPService_HOME%

 :gotBase
 rem Setting service executable to tomcat5 ...
 set EXECUTABLE=%PPService_HOME%\bin\tomcat5.exe

 ::--
 :: Start configuring Tomcat service - environment ready
 ::--
 rem Set default Service name
 set SERVICE_NAME=PPServer
 set PR_DISPLAYNAME=PassagePoint Server

 if %1 ==  goto displayUsage
 if %2 ==  goto setServiceName
 set SERVICE_NAME=%2
 set PR_DISPLAYNAME=Apache Tomcat %2

 :setServiceName
 if %1 == install goto doInstall
 if %1 == remove goto doRemove
 if %1 == uninstall goto doRemove
 echo Unknown parameter specified: %1

 :displayUsage
 echo.
 echo Usage: service.bat install/remove [service_name]
 goto end

 :doRemove
 rem Remove the service
 %EXECUTABLE% //DS//%SERVICE_NAME%
 echo The service '%SERVICE_NAME%' has been removed.
 goto end

 :doInstall
 rem Use the environment variables as an example
 rem Each command line option is prefixed with PR_
 set PR_DESCRIPTION=PassagePoint Server (Apache Tomcat5)
 set PR_INSTALL=%EXECUTABLE%
 set PR_LOGPATH=%PPService_BASE%\logs
 set PR_CLASSPATH=%PPService_HOME%\bin\bootstrap.jar

 rem Set the server jvm from JAVA_HOME
 set PR_JVM=%JAVA_HOME%\bin\server\jvm.dll
 if exist %PR_JVM% goto foundJvm
 rem Set the client jvm from JAVA_HOME
 set PR_JVM=%JAVA_HOME%\bin\client\jvm.dll
 if exist %PR_JVM% goto foundJvm
 set PR_JVM=auto

 :foundJvm
 rem Install the service
 echo Installing the service '%SERVICE_NAME%' ...
 echo Using PPService_HOME:   %PPService_HOME%
 echo Using PPService_BASE:   %PPService_BASE%
 echo Using JAVA_HOME:        %JAVA_HOME%
 echo Using JVM:              %PR_JVM%

 %EXECUTABLE% //IS//%SERVICE_NAME% --StartClass
 org.apache.catalina.startup.Bootstrap --StopClass
 org.apache.catalina.startup.Bootstrap --StartParams start --StopParams
 stop
 if not errorlevel 1 goto installed
 echo Failed installing '%SERVICE_NAME%' service
 goto end

 :installed
 rem Clear the environment variables 

[OT] Re: Default Tomcat Page w/o Redirect

2009-03-09 Thread Len Popp
On Mon, Mar 9, 2009 at 05:13, Gregor Schneider rc4...@googlemail.com wrote:
 JSPs in WEB-INF-folder?

 Well, I'm not familiar with Spring, however, *that* concept is
 completely new to me...

Really? That's how I write all my apps! Requests are handled by
servlets, which forward to JSPs to format their output. Since the JSPs
are not intended to be served to clients directly, they must reside
under WEB-INF.

Spring is an application framework that does basically the same thing,
and a typical Spring app has JSPs stored in WEB-INF.
-- 
Len

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



Re: [OT] Re: Default Tomcat Page w/o Redirect

2009-03-09 Thread Len Popp
What I mean is, clients *never* access a .jsp file by URL, e.g.
http://www.example.com/app/foo.jsp;. All URLs seen by the client are
mapped to servlets, not JSP files. All client requests are handled by
servlets, not JSP files. The servlets call various other Java objects
to do their jobs, and at the end of each servlet is a call to
RequestDispatch.forward to invoke the JSP file that formats the
servlet's output.

The reason for doing it this way is to separate app logic from page
layout. I find it difficult to code a substantial app by mixing Java
code into JSP pages, and it's lots easier to modify the format of a
web page if the app logic isn't all tangled up in it.

This is an application of the model-view-controller (MVC) method of programming.
-- 
Len



On Mon, Mar 9, 2009 at 15:04, Gregor Schneider rc4...@googlemail.com wrote:
 Len,

 On Mon, Mar 9, 2009 at 7:47 PM, Len Popp len.p...@gmail.com wrote:

 Really? That's how I write all my apps! Requests are handled by
 servlets, which forward to JSPs to format their output. Since the JSPs
 are not intended to be served to clients directly, they must reside
 under WEB-INF.


 Well, that's really new to me. I'm using JSPs without using Spring,
 and the JSPs I'm writing all reside in an application's appbase (i.e.
 ${webapps}/myapp).
 They are obviously not served directly to the client since Tomcat
 compiles them beforehand so that the client always gets the
 OutputStream of said JSPs.

 I've just checked my books here (ok, might be a bit outdated),
 however, in none of them I found any other recommendation but to put
 the JSPs into ${webapps}/myapp except your beans which go to
 /WEB-INF/classes or /WEB-INF/lib/someJar.jar.

 However, I'm always eager to learn, and if that's not a
 Spring-thingie, I'd appreciated if there's any liturature available on
 the web declaring this as a best practise.

 Rgds

 Gregor
 --
 just because your paranoid, doesn't mean they're not after you...
 gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
 gpgp-key available @ http://pgpkeys.pca.dfn.de:11371

 -
 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: [OT] Re: Default Tomcat Page w/o Redirect

2009-03-09 Thread Len Popp
On Mon, Mar 9, 2009 at 15:58, Gregor Schneider rc4...@googlemail.com wrote:
 Len,

 agreed to the most of what you said, however, I still do not see why
 JSPs have to go (or should go) into WEB-INF.

Just to hide them from the user, because in this case they're not
intended to be accessed directly by the user.

 On Mon, Mar 9, 2009 at 8:23 PM, Len Popp len.p...@gmail.com wrote:
 What I mean is, clients *never* access a .jsp file by URL, e.g.
 http://www.example.com/app/foo.jsp;.

 This is definately wrong. When you call a jsp directly from within a
 Servlet-Container, the file gets compiled to a servlet and the output
 of the servlet is displayed.

You're missing my point. I'm talking about a different way to do
things. There is another way to use JSP files, that does not require
the client to access a URL that ends in .jsp. Look at the
documentation for RequestDispatcher. The idea is, client requests are
handled by servlets, and servlets call JSP files to produce output.
Since the JSP files are only used by the servlets, they do not have
URLs associated with them, so I hide them under WEB-INF.

 I've googled for this issue, and what I find, is, that some frameworks
 recommend putting JSPs into WEB-INF/jsp.
 However, I also found the statement that not all Servlet-Containers
 are supporting it.

 Now I'm wondering (Mr. Servlet-Spec Chuck, you comment on that one):

 Is this directory-structure really part of the specs?

Yes, it is. (Oh, I see Chuck has already answered. :-) )

 I just found this recomendation in context with frameworks like Struts
 or Spring.

 I'm wondering:

 How does Tomcat find a JSP within WEB-INF/jsp? Do I have to specify it
 in the deployment-descriptor?

No, it's invoked by your servlet code via RequestDispatcher.
-- 
Len

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



Re: [OT] Re: Default Tomcat Page w/o Redirect

2009-03-09 Thread Len Popp
On Mon, Mar 9, 2009 at 16:03, Ken Bowen kbo...@als.com wrote:
 I agree with everything in both posts, but I just don't see what the
 /location/ of the jsp files (inside/outside WEB-INF) has to do with it.
 All that controls is whether a user/client can find a way to look inside the
 file.
 One can (as I do) follow the separation of concerns quite strictly (app
 logic in java files; presentation in jsp files), and have those
 jsp files residing in something like webapps/app/pages, while the classes of
 course normally reside in webapps/app/WEB-INF/classes.
 And I'm sure we could find (in the wild out there, not developed by anyone
 here) JSP pages residing under WEB-INF which were
 horribly encrusted with java code and application logic.

 It's more a matter of developer discipline than anything else.

So, I'm a disciplined developer? :-)

Yeah, it's basically because in this setup the JSP pages are part of
the app's implementation, not part of the exposed URL space. So I put
them under WEB-INF with the classes, libs, tags, etc. Practically
speaking the effect of allowing user access to the JSPs would be that
you could enter a bogus URL and get a garbage page (probably a 500
error).
-- 
Len

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



Re: Failed installing 'Tomcat5' service

2009-02-12 Thread Len Popp
Is there another version of Tomcat (5.0 or 6.0) already installed? I
have seen that error when installing two different versions of Tomcat
because both versions try to use the same name for the service, which
is not allowed.
-- 
Len



On Thu, Feb 12, 2009 at 17:15, boraldo bora...@hotbox.ru wrote:

 Please help me with this problem.
 From this message I even can't understand what is going wrong.

 I'm installing Tomcat 5.5.17 as a Service on Windows Vista Home Basic
 --
 View this message in context: 
 http://www.nabble.com/Failed-installing-%27Tomcat5%27-service-tp21986081p21986081.html
 Sent from the Tomcat - User mailing list archive at Nabble.com.


 -
 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: Fresh install problems

2009-01-25 Thread Len Popp
Are you using the 32-bit or 64-bit version of the JRE?
-- 
Len

On Sun, Jan 25, 2009 at 09:47, Shaolin shaolinfin...@gmail.com wrote:
 Ok - So what do I have to do then ? Im really lost, Ive tried every
 possible way I know and nothing works.

 On 25/01/2009, Ken Bowen kbo...@als.com wrote:
 No.

 On Jan 25, 2009, at 9:18 AM, michel wrote:

 OK, here is a stupid question, but isn't he JDK included in Tomcat?


 - Original Message - From: Shaolin shaolinfin...@gmail.com
 To: users@tomcat.apache.org
 Sent: Sunday, January 25, 2009 9:15 AM
 Subject: Fresh install problems


 Hi Guys
 I downloaded Tomcat 6.0.18 and JDK 6 Update 11 - Installed the JDK
 followed by tomcat, specified JRE path (C:\Program
 Files\Java\jdk1.6.0_11\jre). The problem is it doesnt start. Here are
 the log errors:
 [2009-01-25 03:00:28] [info] Procrun (2.0.4.0) started
 [2009-01-25 03:00:28] [info] Running Service...
 [2009-01-25 03:00:28] [info] Starting service...
 [2009-01-25 03:00:28] [174 javajni.c] [error] %1 is not a valid Win32
 application.
 [2009-01-25 03:00:28] [994 prunsrv.c] [error] Failed creating java
 C:\Program Files\Java\jdk1.6.0_11\jre\bin\server\jvm.dll
 [2009-01-25 03:00:28] [1269 prunsrv.c] [error] ServiceStart
 returned 1
 [2009-01-25 03:00:28] [info] Run service finished.
 [2009-01-25 03:00:28] [info] Procrun finished.
 -
 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



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



Re: Fresh install problems

2009-01-25 Thread Len Popp
The problem is that you're running the 32-bit version of the Tomcat
service wrapper (tomcat6.exe) so it can't load the 64-bit JRE.

I think you can use the 64-bit exe's from here:
https://svn.apache.org/repos/asf/tomcat/connectors/trunk/procrun/bin/amd64/
Replace the ones in your Tomcat bin directory with those ones. (Rename
tomcat5.exe - tomcat6.exe, tomcat5w.exe - tomcat6w.exe.)
-- 
Len



On Sun, Jan 25, 2009 at 09:58, Shaolin shaolinfin...@gmail.com wrote:
 64 bit

 On 25/01/2009, Len Popp len.p...@gmail.com wrote:
 Are you using the 32-bit or 64-bit version of the JRE?
 --
 Len

 On Sun, Jan 25, 2009 at 09:47, Shaolin shaolinfin...@gmail.com wrote:
 Ok - So what do I have to do then ? Im really lost, Ive tried every
 possible way I know and nothing works.

 On 25/01/2009, Ken Bowen kbo...@als.com wrote:
 No.

 On Jan 25, 2009, at 9:18 AM, michel wrote:

 OK, here is a stupid question, but isn't he JDK included in Tomcat?


 - Original Message - From: Shaolin shaolinfin...@gmail.com
 To: users@tomcat.apache.org
 Sent: Sunday, January 25, 2009 9:15 AM
 Subject: Fresh install problems


 Hi Guys
 I downloaded Tomcat 6.0.18 and JDK 6 Update 11 - Installed the JDK
 followed by tomcat, specified JRE path (C:\Program
 Files\Java\jdk1.6.0_11\jre). The problem is it doesnt start. Here are
 the log errors:
 [2009-01-25 03:00:28] [info] Procrun (2.0.4.0) started
 [2009-01-25 03:00:28] [info] Running Service...
 [2009-01-25 03:00:28] [info] Starting service...
 [2009-01-25 03:00:28] [174 javajni.c] [error] %1 is not a valid Win32
 application.
 [2009-01-25 03:00:28] [994 prunsrv.c] [error] Failed creating java
 C:\Program Files\Java\jdk1.6.0_11\jre\bin\server\jvm.dll
 [2009-01-25 03:00:28] [1269 prunsrv.c] [error] ServiceStart
 returned 1
 [2009-01-25 03:00:28] [info] Run service finished.
 [2009-01-25 03:00:28] [info] Procrun finished.
 -
 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



 -
 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: SECURITY breach in Tomcat

2009-01-22 Thread Len Popp
This sounds like an attack that has been seen before:
http://markmail.org/message/jrqw75yw3d3xh3p6
That message also has tips on tightening security.
In those cases it seems that the security hole was a weak password for
the manager webapp.
-- 
Len



On Thu, Jan 22, 2009 at 10:16, Toby Kurien tobyis7...@gmail.com wrote:
 Hi,
 I have a webapp for my company that has been running for several
 years. Recently, we got infected by a trojan or virus and this has
 been causing a lot of abnormal behavior. The trojan creates user
 accounts in Windows and also creates web applications like safee.war
 and zhu.war into the webapps folder of Tomcat and also shuts down
 Tomcat. The trojan webapps have jsp and exe files which try to modify,
 copy and delete files in the system and also try to access the
 database. Symantec and Norton have not been able to rectify or detect
 much.
 I am totally at loss on what's going on and how to tighten or rectify
 this. Anyone with any ideas is highly appreciated.

 Thanks,
 -Toby

 -
 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: SECURITY breach in Tomcat

2009-01-22 Thread Len Popp
Yes, you should remove all other webapps (manager, examples, etc.)
You can remove ROOT too, unless you've put files in there that you
need to serve.
-- 
Len



On Thu, Jan 22, 2009 at 14:50, Toby Kurien tobyis7...@gmail.com wrote:
 Yea, I rebuild server from scratch. Fortunately, we have virtual
 machines so we can revert to a factory build by just reverting to a
 snapshot. That is same as moving to a fresh OS without anything
 installed.

 Moving servers mean we moved it physically from one box to another. IP
 and DNS stays the same when we move.
 Btw: Can I take off all the apps from webapps, except ROOT and myApp?
 Hacker or virus is probably exploiting some vulnerability in them. As
 of now, tomcat is running after restarting the whole box, but I am
 afraid if it will shutdown or crash.

 Thanks to all who are contributing.

 On Thu, Jan 22, 2009 at 12:14 PM, Gregor Schneider
 rc4...@googlemail.com wrote:
 Toby,

 On Thu, Jan 22, 2009 at 5:27 PM, Toby Kurien tobyis7...@gmail.com wrote:
 Thanks Gregor. We are looking at setting up in Linux, but that is
 going to take longer to get a LIVE environment up and running. I have
 in the past already setup Tomcat from scratch 2-3 times and the
 infection just keeps coming. Only open port is 80 and network access
 is disabled.


 Did you setup Tomcat only or did you setup the complete server incl.
 the OS (Windows)?

 I know setting up the server from scratch is a PITA, however, I
 believe you don't have any other choice.

 In Windows, the virus usually will reside somewhere outside from Tomcat.

 Therefore, you should set up the OS first (preferably from CD/DVD)
 then a fresh JDK download, then a fresh Tomcat-Download.
 You shoudl also check the integrity of the downloads, FOr Tomcat,
 that's pretty easy (see http://tomcat.apache.org/download-60.cgi,
 Release Integrity), for the JDK, however, I'm not aware of any
 integrity-check.

 In fact, one of my previous builds on another machine
 that was similarly infected, now stops showing signs of it after we
 moved the server. So it seems the DNS (url) is compromised and only
 that machine is hacked/infected into.


 What exactly do you mean by moved the server? Did you assign a different 
 IP?

 Gregor
 --
 just because your paranoid, doesn't mean they're not after you...
 gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
 gpgp-key available @ http://pgpkeys.pca.dfn.de:11371

 -
 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: How to turn off JNDI datasource connection pooling

2009-01-16 Thread Len Popp
On Fri, Jan 16, 2009 at 16:45, Christopher Schultz
ch...@christopherschultz.net wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Keith,

 Keith Thomas wrote:
 As part of the
 deployment I just need a way of defining the datasource in a manner that is
 external to my code and configurable by administrators.

 Use of a DataSource implies the use of a connection pool, which seems
 contrary to your requirements.

 You will need to manage your own database connections.

Why is that? From the Java docs, it seems that DataSource is required
for connections that are managed by JNDI. Isn't the use of JNDI
without pooling a valid use case?
-- 
Len

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



Re: Tomcat returns HTTP status of 200 when HttpServletResponse.sendError() called.

2009-01-12 Thread Len Popp
On Mon, Jan 12, 2009 at 19:58, Nathan Potter n...@opendap.org wrote:

 On Jan 12, 2009, at 3:34 PM, Caldarale, Charles R wrote:

 Don't think so.  Does your code happen to call response.setStatus(200)
 somewhere along the way?

 - Chuck




 Well at first I didn't think so, but now I am wondering

 After adding some more instrumentation I have determined that I am
 inadvertently setting the status to 200.


 I was replicating the problem with this servlet:

 package opendap.experiments;

 import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletRequest;

 public class SendErrorTest extends HttpServlet {

public void doGet(HttpServletRequest request,
  HttpServletResponse response) {
try {
System.out.println(Calling HttpServletResponse.sendError(404));
response.sendError(HttpServletResponse.SC_NOT_FOUND);
System.out.println(HttpServletResponse.sendError(404)
 returned.);

}
catch (Exception e) {
System.out.println(e.getMessage());
}
}
 }


 And a simple document service servlet:

servlet-mapping
servlet-namedocs/servlet-name
url-pattern/docs/*/url-pattern
/servlet-mapping

 With this error-page:

error-page
error-code404/error-code
location/docs/error404.html/location
/error-page


 I added some instrumentation and looked at the logs and saw that when the
 sendError() method is called in the SendErrorTest servlet the call returns
 immediately. And is followed by a the docs servlet receiving a request for
 the error document, which since it is successfully returning a document sets
 the HTTP status to 200.

 Is sendError() using a redirect?

 Is there a way to set the value of the location element in the error-page
 declaration so that tomcat just grabs the file from the context directory?

 The java servlet spec (2.4) says:

 If the sendError method is called on the response, the container consults
 the
 list of error page declarations for the Web application that use the
 status-code
 syntax and attempts a match. If there is a match, the container returns the
 resource
 as indicated by the location entry.

 So what does the container returns the resource as indicated by the
 location entry  mean for tomcat?


 Is there an example of a design pattern you can point me to?

 Thanks,

 Nathan


It sounds like error404.html isn't a plain HTML file, but a page
that's generated by a servlet. Is that right? If so, the servlet
should not set the status to 200 for an error page - it should leave
the error status alone. Maybe you need a different version of the
servlet to handle error pages, or maybe your error pages should just
be static HTML files.
-- 
Len

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



Re: Is it possible to install both TOMCAT5.5 TOMCAT6?

2009-01-02 Thread Len Popp
The problem is that the Tomcat 5.5 and 6.0 installers are both using
the same display name for the service (Apache Tomcat), and Windows
doesn't allow that.

You can install the service correctly using service.bat in Tomcat's
bin directory.
1. Install one version of Tomcat (let's say 5.5). The service should
run correctly.
2. Install the other version of Tomcat (6.0). Ignore the error message
about the service.
3. Open a command window and cd to the Tomcat 6.0 bin directory. Run
service.bat install Tomcat6. This will install the service with a
different display name so it doesn't collide with the Tomcat 5.5
service.

Note: service.bat might be missing if you installed Tomcat using the
.exe installer. (I know some files are missing but I forget if
service.bat is one of them.) If so, download the Tomcat .zip distro
and copy the missing .bat files into your Tomcat's bin directory.
-- 
Len



On Fri, Jan 2, 2009 at 08:41, gen g...@bud.co.jp wrote:
 Hi,



 The error windows shown as,



 Failed to install Tomcat5 service.

 Check your setting and permissions.

 Ignore and continue anyway (not recommended)?



 Thanks



  _

 From: gen [mailto:g...@bud.co.jp]
 Sent: Friday, January 02, 2009 10:34 PM
 To: 'Tomcat Users List'
 Subject: RE: Is it possible to install both TOMCAT5.5  TOMCAT6?



 Hi,



 I download apache-tomcat-5.5.27.exe and just run it.

 And it just gives me the following error window.

 # I already had Tomcat6 installed.







 Thanks



 -Original Message-

 From: Ken Bowen [mailto:kbo...@als.com]

 Sent: Friday, January 02, 2009 10:22 PM

 To: Tomcat Users List

 Subject: Re: Is it possible to install both TOMCAT5.5  TOMCAT6?



 How are you installing?

 If you download the zip files for 5.5 and 6 from http://tomcat.apache.org/

 , and unzip them in separate folders, then

 each can immediately be started directly using startup.bat in the bin

 of the respective installations, and will run properly.

 Dev environments such as Eclipse will support having multiple Tomcats

 installed like this: after telling Eclipse about the

 two installations, one simply chooses which to run from a menu.



 On Jan 2, 2009, at 7:57 AM, gen wrote:



 

  Hi,

 

  I use Win XP professional. SP2.

 

  Thanks

 

  -Original Message-

  From: Ghufran [mailto:ghufra...@vopium.com]

  Sent: Friday, January 02, 2009 9:57 PM

  To: 'Tomcat Users List'

  Subject: RE: Is it possible to install both TOMCAT5.5  TOMCAT6?

 

  What is the OS ?

 

  -Original Message-

  From: gen [mailto:g...@bud.co.jp]

  Sent: Friday, January 02, 2009 5:49 PM

  To: 'Tomcat Users List'

  Subject: RE: Is it possible to install both TOMCAT5.5  TOMCAT6?

 

  Hi,

 

  Thanks for all of your early reply.

 

  To run only one server at a time is OK, but my problem is that I

  fail to

  install 5.5 after I installed 6.

  Do you mean that I have to ignore the error and just installed 5.5?

  # in this case only 6.0 got a service installed.

 

  Regards

 

  -Original Message-

  From: William Bonnet [mailto:will...@wbonnet.net]

  Sent: Friday, January 02, 2009 9:31 PM

  To: Tomcat Users List

  Subject: Re: Is it possible to install both TOMCAT5.5  TOMCAT6?

 

  Hi Gen

 

  You ca as look as they do not use the same port (8080 can be used

  only

  by one server at a time)

 

  regards

  W.

  gen a écrit :

  Hi,

 

  Is it possible to install both TOMCAT5.5  TOMCAT6 in 1 PC?

 

  I had installed Tomcat6. And I need to install TOMCAT 5.5 for

  another

  system. So I like to install my developing environment for both.

  But I

  failed when install 5.5. And I succeed to install 5.5 if I

  un-installed

  6.0

  1st.

 

  Thanks in advance.

 

 

  -

  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

 

 

  -

  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: [OT] Basic int/char conversion question

2009-01-01 Thread Len Popp
On Thu, Jan 1, 2009 at 11:13, André Warnier a...@ice-sa.com wrote:
 Hi.

 This has nothing specific to Tomcat, it's just a problem I'm having as a
 non-java expert in modifying an exiting webapp.
 I hope someone on this list can answer quickly, or send me to the
 appropriate place to find out.  I have tried to find, but get somewhat lost
 in the Java docs.

 Problem :
 an existing webapp reads from a socket connected to an external program.
 The input stream is created as follows :
 fromApp = socket.getInputStream();
 The read is as follows :
 StringBuffer buf = new StringBuffer(2000);
 int ic;
 while((ic = fromApp.read()) != 26  ic != -1) // hex 1A (SUB)
   buf.append((char)ic);

 This is wrong, because it assumes that the input stream is always in an
 8-bit default platform encoding, which it isn't.

 How do I do this correctly, assuming that I do know that the incoming stream
 is an 8-bit stream (like iso-8859-x), and I do know which 8-bit encoding is
 being used (such as iso-8859-1 or iso-8859-2) ?
 I cannot change the InputStream into something else, because there are a
 zillion other places where this webapp tests on the read byte's value,
 numerically.

 I mean, to append correctly to buf what was read in the int, knowing
 that the proper encoding (charset) of fromApp is X, how do I write this
 ?

 Thanks.


Another option: Read the bytes into a ByteBuffer, then convert the
bytes into a string. You can tell the String constructor which charset
to use.
-- 
Len


Re: [OT] Basic int/char conversion question

2009-01-01 Thread Len Popp
On Thu, Jan 1, 2009 at 14:39, André Warnier a...@ice-sa.com wrote:
 I note with satisfaction that I'm not the only one laboring away on this
 day-after, but you're just all going a bit too fast for me and my growing
 but still limited Java knowledge.

No hang-over here. :-)

 In other words, in order to keep my changes and post-festivities headaches
 to a minimum, I would like to keep buf being a StringBuffer. So what I was
 really looking for was the correct alternative to
  buf.append((char) ic);
 which would convert ic from an integer, to the appropriate Unicode
 character, taking into account the knownEncoding which I know.

 Does that not exist ?

(I'll leave the InputStreamReader explanation to Chuck.)

I was guessing that the StringBuffer would soon be converted to a
String (which is the usual case). If not …

I don't see a simple one-line way to convert one byte to a character
in a given charset. It looks like String and CharsetDecoder are the
classes you're supposed to use. If there's an easy way to convert a
single character, someone please point it out.

How about this: Read the bytes as bytes, convert them to a String in
the correct charset, and create a StringBuffer from that. Like so:

  String knownEncoding = ISO-8859-1; // or ISO-8859-2
  InputStreamReader fromApp;
  fromApp =  = new InputStreamReader(socket.getInputStream(),
  int ic = 0;
  ByteBuffer inbuf = ByteBuffer.allocate(2000);
  while((ic = fromApp.read()) != 26  ic != -1) // hex 1A (SUB)
   inbuf.put((char)ic);
  byte[] inbytes = new byte[inbuf.limit()];
  inbuf.get(inbytes);
  String s = new String(inbytes, knownEncoding);
  StringBuffer buf = new StringBuffer(s);

(I haven't tested this so it might not be correct.)
It's not very efficient but it keeps the changes in one place.
-- 
Len


Re: Hot to disable DST option from tomcat cinfiguration.

2008-12-30 Thread Len Popp
You can use a time zone name like GMT+1 to specify a time zone with
no DST rules. See the documentation for java.util.TimeZone for more
info.
-- 
Len



On Tue, Dec 30, 2008 at 07:25, arif8899 akma...@gmail.com wrote:

 i set a variable in tomcat configuration and that is
 -Duser.timezone=Europe/Brussels. i set it into tomcat-configur-java -
 java options textbox.

 This time zone has DST and i get it from the code

 TimeZone.getDefault().useDaylightTime(); it returns true and it is fine.

 now, i want to disable the DST option from this time zone. How can i do
 this?
 i am using servlet to get the information.


 Thanks
 --
 View this message in context: 
 http://www.nabble.com/Hot-to-disable-DST-option-from-tomcat-cinfiguration.-tp21216565p21216565.html
 Sent from the Tomcat - User mailing list archive at Nabble.com.


 -
 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: [OT] JK Connector problem

2008-12-07 Thread Len Popp
On Sun, Dec 7, 2008 at 14:27, André Warnier [EMAIL PROTECTED] wrote:
 I believe the point some people (me) are trying to make is that it is not
 because MS does stupid things, that all software developers have to follow
 suit.  And specially not open source software developers.
 Apache Group is stupid as part of a path, there is simply no other word
 for it.

And others (me, at least) are trying to make the point that spaces
have existed in pathnames since long before Windows, and you have to
deal with them. IMO it's not Microsoft that's doing stupid things,
it's programmers who can't handle space characters in strings.
-- 
Len


Re: [ANN] Apache Tomcat 4.1.39 stable is released

2008-12-03 Thread Len Popp
On Wed, Dec 3, 2008 at 10:30, André Warnier [EMAIL PROTECTED] wrote:
 Remembering numerous exhortations on this list to upgrade, I must say this
 announcement is somewhat surprising to me.  So there are older versions
 which are still maintained/enhanced ?

Yes. See http://tomcat.apache.org/#Apache%20Tomcat%20Versions
-- 
Len


Re: Servlets / JSP can't connect to MySQL in Ubuntu Server

2008-11-20 Thread Len Popp
On Thu, Nov 20, 2008 at 07:37, Krapacs Ambrose [EMAIL PROTECTED] wrote:
 I have to say that I do not think Tomcat is doing the right thing in this
 particular situation. There should be some sort of security exception being
 thrown indicating that the socket connection was being block by tomcat's
 security manager.

Unfortunately, the exception is coming from MySQL, not Tomcat, and
it's a MySQL exception type, not the standard SecurityException.
There's no way for Tomcat to know that this particular exception was
caused by a SecurityManager violation.
-- 
Len

-
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.Exception: Socket bind failed: [730048]

2008-11-20 Thread Len Popp
The command netstat -ao will tell you which process is listening on
port 80, and Task Manager will show which program is running in that
process.
-- 
Len



On Thu, Nov 20, 2008 at 14:47, Toby Kurien [EMAIL PROTECTED] wrote:
 Well, I have had this application for many years and usually
 restarting the whole server fixes anything, but not this time. I
 figure something is holding on to port 80, but I am not able to find
 out or terminate it. I have a bad feeling there might be a security
 breach or something.

 Thanks,
 -Toby

 On Wed, Nov 19, 2008 at 2:59 PM, Caldarale, Charles R
 [EMAIL PROTECTED] wrote:
 From: Toby Kurien [mailto:[EMAIL PROTECTED]
 Subject: java.lang.Exception: Socket bind failed: [730048]

 I have attached a log file of the errors I am
 getting while trying to start Tomcat.

 Nov 19, 2008 12:55:22 PM
 org.apache.coyote.http11.Http11AprProtocol init
 SEVERE: Error initializing endpoint
 java.lang.Exception: Socket bind failed: [730048] Only one usage of
 each socket address (protocol/network address/port) is normally
 permitted.
at
 org.apache.tomcat.util.net.AprEndpoint.init(AprEndpoint.java:576)
at
 org.apache.coyote.http11.Http11AprProtocol.init(Http11AprProtocol.java:116)

 The error indicates something else is already using port 80, thereby 
 preventing Tomcat from accessing it.  Since you also have an AJP connector, 
 you may be running Tomcat behind IIS or some other web server that handles 
 port 80 and forwards requests to AJP on 8009.

 If you don't expect anything else to be using port 80, then something has 
 crept in that's usurping Tomcat.  (Or you may just be trying to run the same 
 Tomcat twice.)

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



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



Re: [ANNOUNCE] Beta candidate for Tomcat connection pool

2008-11-13 Thread Len Popp
A brief list of reasons is given in the link from Filip's post:
https://issues.apache.org/bugzilla/show_bug.cgi?id=46038
The most important reason IMO is that you can't build Tomcat with a
recent JDK. See:
https://issues.apache.org/bugzilla/show_bug.cgi?id=43147
-- 
Len



On Thu, Nov 13, 2008 at 12:12, Christopher Schultz
[EMAIL PROTECTED] wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Filip,

 Filip Hanik - Dev Lists wrote:
 The Apache Tomcat team announces the immediate availability of
 Apache Tomcat JDBC  Connection Pool

 I'm sure this is documented somewhere, but why is Tomcat creating its
 own connection pool instead of continuing to use commons-dbcp? Not
 trying to start a flame war... just curious. No need to repeat arguments
 found elsewhere if you'd just like to provide a link.

 Thanks,
 - -chris

 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.9 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

 iEYEARECAAYFAkkcX/QACgkQ9CaO5/Lv0PAMmQCgjTm8n/n5OhKBOy1IEuyJ4bQP
 Os4AoJr065w4kK22RnhK05rnHfn8Y/K4
 =S1jX
 -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]



-
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_HOME is not found but tomcat is running. possible?

2008-10-17 Thread Len Popp
When it's running as a service, Tomcat gets the location of Java from
the registry, not from JAVA_HOME.
You can change this and other settings using tomcat4w.exe.
-- 
Len



On Fri, Oct 17, 2008 at 09:28, Thangavel Sankaranarayanan
[EMAIL PROTECTED] wrote:
 Hi all ,

 I have a tomcat 4.x version (Perhaps it is a old version ,it is in
 production and we cant upgrade as of now).

 It is running as a window service in Windows2000 server.
 in the service icon i can find the  path to executable:


 C:\Products\Apache Tomcat 4.1\bin\tomcat.exe

 My doubt is ,does tomcat.exe needs JAVA_HOME or JRE_HOME defined to run
 tomcat in this case as we are not starting tomcat using Startup.bat or
 Catalina.bat.

 If so,In my system i couldn't find any environmental varible set for
 JAVA_HOME or JRE_HOME... i can find only CATALINA_OPTS in it.

 It is also not defined in any of the .bat file as well...please help me on
 this.thanks





 Regards,
 Thangavel Sankaranarayanan



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



Re: [OT] Why can NOT run Tomcat on my Laptop

2008-10-11 Thread Len Popp
On Sat, Oct 11, 2008 at 16:45, André Warnier [EMAIL PROTECTED] wrote:
 Caldarale, Charles R wrote:

 From: IceManPat [mailto:[EMAIL PROTECTED]
 Subject: Re: Why can NOT run Tomcat on my Laptop

 C:\set JAVA_HOME =D:\Program Files\Java\jdk1.6.0_07

 The problem is you have a space before the equals sign; that makes the
 environment variable JAVA_HOME  (note the trailing space), rather than
 JAVA_HOME.  Take the space out.

 Despite Martin G's dire warning, spaces in the value of JAVA_HOME are not
 a problem; spaces at the end of the environment variable name are.

 Allowing spaces in directory and file names was a nutty idea which
 has cost more over time than the Iraq war and current financial debacle
 combined.  It should be re-regulated.

And yet, as Charles pointed out, it's not a problem for the genius
Tomcat developers! (Re-read his message - the problem is a space in
the *name* of the env variable, not the directory. All of us Windows
users have no problem with Java being installed in the default
Program Files directory.)
-- 
Len


Re: tomcat 6.0.18 and JDK 6

2008-10-01 Thread Len Popp
That usually happens because it can't find msvcr71.dll (Microsoft C
runtime). Copy that file from Java's bin directory to Tomcat\bin.
-- 
Len

On Wed, Oct 1, 2008 at 10:29, ib solution [EMAIL PROTECTED] wrote:
 hai,

 i would like to use tomcat 6.0.18 and JDK 6 update 7

 the installation not give me an error.

 but when i try to start tomcat service, tomcat does not running.

 i try with http://localhost:8080 the result the page cannot display.

 after that i check log file in tomcat and i get an error message :

 Failed creating java C:\Program Files\Java\jre1.6.0_07\bin\client\jvm.dll


 is anything that i miss to install new version of tomcat ?


 --
 Salam,

 Andy Susanto,S.Kom
 ==
 for better search
 http://www.slashmysearch.com/earn/id/24828
 HP : 081513039998

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



Re: tomcat 6.0.18 and JDK 6

2008-10-01 Thread Len Popp

(Tomcat doesn't use msvcr71.dll directly, it's used by the Java VM.)
How I know about it is:
- from researching the problem on the internet
- by using the depends.exe tool from MS to look at the DLL dependencies
- by recognizing a familiar Microsoft DLL
- from having dealt with similar DLL loading problems in the past

Helpful hint: When a DLL fails to load, it's probably because another  
DLL is missing or misplaced.
--  
Len



On 1-Oct-08, at 11:07, ib solution [EMAIL PROTECTED] wrote:


hai,

thx for your help.

btw how do you know that tomcat need a file msvcr71.dll


--
Regards,

Andy Susanto,S.Kom
==
for better search
http://www.slashmysearch.com/earn/id/24828
HP : 081513039998



On Wed, Oct 1, 2008 at 9:39 PM, Len Popp [EMAIL PROTECTED] wrote:

That usually happens because it can't find msvcr71.dll (Microsoft C
runtime). Copy that file from Java's bin directory to Tomcat\bin.
--
Len

On Wed, Oct 1, 2008 at 10:29, ib solution [EMAIL PROTECTED]  
wrote:

hai,

i would like to use tomcat 6.0.18 and JDK 6 update 7

the installation not give me an error.

but when i try to start tomcat service, tomcat does not running.

i try with http://localhost:8080 the result the page cannot display.

after that i check log file in tomcat and i get an error message :

Failed creating java C:\Program Files\Java\jre1.6.0_07\bin\client 
\jvm.dll



is anything that i miss to install new version of tomcat ?


--
Salam,

Andy Susanto,S.Kom
==
for better search
http://www.slashmysearch.com/earn/id/24828
HP : 081513039998

--- 
--

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]




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



Re: How do you have your dev environment setup?

2008-09-16 Thread Len Popp
I use Eclipse with the Web Standard Tools plug-in. That lets me run
and debug the app in Eclipse. When the app is ready to go I export it
to a .war file and deploy the .war to the server.
-- 
Len



On Tue, Sep 16, 2008 at 17:59, Bai Shen [EMAIL PROTECTED] wrote:
 I've been doing a lot of webapp development on tomcat, but currently my
 process is all manual.  I write the code in Eclipse, and then copy the
 appropriate files over to tomcat.  I'd like to automate and standardize my
 process.

 So would y'all mind explaining how your dev environment is configured?  I'd
 appreciate the insight.  TIA.


-
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: difference in how applications are displaying

2008-09-06 Thread Len Popp
If the same browser is displaying the two pages differently, there
must be a difference in the web pages. Compare the HTML of the pages
as they are received by the browser. Also compare any CSS and
Javascript files referenced by the HTML page.
-- 
Len

On 05/09/2008, Scott, Ewan [EMAIL PROTECTED] wrote:




 Hi



 I  think this may relate to a tomcat setting - but I may be completely
 wrong.



 I have 2 servers which should be running identical looking webapps under
 Apache Tomcat.



 Accessing the test app on server 1 from a client using IE6, within the
 app, next to a range of data input fields, an arrow icon permanently
 exists which, if you click on it, brings  up a lookup table of values.



 Accessing the live app on server 2 from the same IE6 client, next to the
 range of data input fields the  arrow icon only exists once you hover
 the mouse over the relevant area of the browser.



 How can I get the arrow icon to appear permanently as in test?



 Installed on both servers (Windows 2003):

 Java 2 RuntimeEnv SE v1.4.2_15

 Java 2 SDX, SE v1.4.2_15

 Java TM 6 Update 3

 Apache Tomcat 4.1



 Regards

 Ewan Scott








 **
 This email and any files transmitted with it are privileged, confidential
 and subject to copyright. Any unauthorised use or disclosure of any part of
 this email is prohibited. If you are not the intended recipient please
 inform the sender immediately; you should then delete the email and remove
 any copies from your system.
 The views or opinions expressed in this communication may not necessarily be
 those of Scottish Borders Council.
 Please be advised that Scottish Borders Council's incoming and outgoing
 email is subject to regular monitoring and any email may require to be
 disclosed by the Council under the provisions of the Freedom of Information
 (Scotland) Act 2002.

 **



-
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: Exception when trying to configure a pool of connections for use of WS

2008-09-06 Thread Len Popp
Does the error occur in that piece of code or is it during Tomcat
startup? The stack trace looks like the exception is thrown during
startup, if I'm reading it correctly.
-- 
Len

On Sat, Sep 6, 2008 at 06:29, Daniele Development-ML
[EMAIL PROTECTED] wrote:
 Thanks David!
 The code is:

 Class.forName(com.mysql.jdbc.Driver);
 String url = jdbc:mysql://localhost:3306/cellmlrep;

 Connection con = DriverManager.getConnection(url, root, );

 Statement stmt = con.createStatement();

 String query = SELECT * FROM user_accounts u;;
 stmt.executeQuery(query);


 Daniele

 On Fri, Sep 5, 2008 at 6:00 PM, David Smith [EMAIL PROTECTED] wrote:

 And the code you use to get a connection?  Looks like the database pool
 should be fine, you are getting a javax.sql.DataSource object but treating
 it as a java.naming.Context object.

 As an aside and definitely not things affecting the issue you describe
 below:
 1. Do not use the root user in the database service for a web application.
  It's a potential security flaw big enough to fit a jumbo jet into.
 2. Do use strong passwords on the database (especially for the root
 account) with at least three character classes (upper case, lower case,
 punctuation, numbers) and no dictionary words present.
 2. Add a validatonQuery=select 1 attribute to your Resource ... /
 element so connections are tested and regenerated as needed.

 --David


 Daniele Development-ML wrote:

 Hello everybody,

 I am trying to set up the configuration for a pool of connections to a
 MySQL
 DB and I get the following exception when deploying on Tomcat.
 I followed the steps at

 http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html
 .

 The application actually consists of a web service that performs a query
 to
 the DB.

 Any hints or suggestions? Thank you!

 Context file

 ?xml version=1.0 encoding=UTF-8?
 Context path=/DB_WS debug=5 reloadable=true crossContext=true
Resource name=jdbc/MySQL_cellmlrep type=javax.sql.DataSource
 auth=Container
  user=root password=root
 driverClassName=com.mysql.jdbc.Driver
  url=jdbc:mysql://localhost:3306/cellmlrep maxActive=8
 maxIdle=4/
 /Context

 Web.xml

 ?xml version=1.0 encoding=UTF-8?
 web-app version=2.5 xmlns=http://java.sun.com/xml/ns/javaee;
 xmlns:xsi=
 http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=
 http://java.sun.com/xml/ns/javaee
 http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd;
listener


 listener-classcom.sun.xml.ws.transport.http.servlet.WSServletContextListener/listener-class
/listener
servlet
servlet-nameDBAccess/servlet-name


 servlet-classcom.sun.xml.ws.transport.http.servlet.WSServlet/servlet-class
load-on-startup1/load-on-startup
/servlet
servlet
servlet-nameDBAccessService/servlet-name


 servlet-classcom.sun.xml.ws.transport.http.servlet.WSServlet/servlet-class
load-on-startup1/load-on-startup
/servlet
servlet-mapping
servlet-nameDBAccess/servlet-name
url-pattern/DBAccess/url-pattern
/servlet-mapping
servlet-mapping
servlet-nameDBAccessService/servlet-name
url-pattern/DBAccessService/url-pattern
/servlet-mapping
session-config
session-timeout
30
/session-timeout
/session-config
welcome-file-list
welcome-fileindex.jsp/welcome-file
/welcome-file-list
resource-ref
description
The database DataSource for the Acme web application.
/description
res-ref-namejdbc/MySQL_cellmlrep/res-ref-name
res-typejavax.sql.DataSource/res-type
res-authContainer/res-auth
/resource-ref
 /web-app


 Exception

 java.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp.BasicDataSource
 cannot be cast to javax.naming.Context
at

 org.apache.catalina.core.NamingContextListener.createSubcontexts(NamingContextListener.java:1203)
at

 org.apache.catalina.core.NamingContextListener.addResource(NamingContextListener.java:1015)
at

 org.apache.catalina.core.NamingContextListener.createNamingContext(NamingContextListener.java:633)
at

 org.apache.catalina.core.NamingContextListener.lifecycleEvent(NamingContextListener.java:237)
at

 org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at
 org.apache.catalina.core.StandardContext.start(StandardContext.java:4252)
at

 org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at
 org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at
 org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at

 org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:627)
at

 org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)
at
 org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)
at
 

Re: question

2008-09-03 Thread Len Popp
Sun says that their Java 5 does run on Windows 98 SE - see here:
http://java.sun.com/j2se/1.5.0/system-configurations.html

Jojo, can you post the whole error message?
The problem might be that the Microsoft C runtime lib is missing - or maybe not.
-- 
Len



On Wed, Sep 3, 2008 at 17:48, Steve Ochani [EMAIL PROTECTED] wrote:
 On 3 Sep 2008 at 10:36, Jojo Nadir wrote:

 hi how are you,

 I have a probleme in the installation process of tomcat 5.5 under
 Windows 98 (I have an old computer), it always get me a message
 containing the following files with some number like this : jvm.dll
 and 1329 prunsrv.c

 I seriously doubt java 1.5 or higher runs on windows 98 thus tomcat won't run 
 on windows 98.


 -Steve O.




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



Re: ERROR Starting 2nd instance of Tomcat

2008-08-28 Thread Len Popp
Where does that In the config file come from? It's not in a Tomcat
script, is it?
-- 
Len

On Thu, Aug 28, 2008 at 18:54, Eduardo Ponce de León
[EMAIL PROTECTED] wrote:


 I am trying to run a 2nd instace of tomcat. For this, ive duplicated the
 tomcat folder and modified the server.xml files with different ports. I've
 also created a startup script, but when I run the script I am getting this
 error... Can anyone help please!!

 [EMAIL PROTECTED] tomcat5-test]# tomcat5-test start In the config file
 Starting tomcat5-test: [ FAILED ]

 This is what i get in my catalina.out

 -sh: line 0: export: `In the config file': not a valid identifier
 /bin/bash: /usr/bin/tomcat5-test: Permission denied
 -sh: line 0: export: `In the config file': not a valid identifier
 /bin/bash: /usr/bin/tomcat5-test: Permission denied

 This is my startup script... #!/bin/bash # # tomcat5 This shell script takes
 care of starting and stopping Tomcat # # chkconfig: - 80 20 # ### BEGIN INIT
 INFO
 # Provides: tomcat5
 # Required-Start: $network $syslog
 # Required-Stop: $network $syslog
 # Default-Start:
 # Default-Stop:
 # Description: Release implementation for Servlet 2.4 and JSP 2.0
 # Short-Description: start and stop tomcat
 ### END INIT INFO
 # # - originally written by Henri Gomez, Keith Irwin, and Nicolas Mailhot
 # - heavily rewritten by Deepak Bhole and Jason Corley
 # # commented out until the RHEL and FC daemon functions converge
 # Source the function library
 #if [ -r /etc/rc.d/init.d/functions ]; then
 #. /etc/rc.d/init.d/functions
 #fi
 NAME=$(basename $0)
 unset ISBOOT
 if [ ${NAME:0:1} = S -o ${NAME:0:1} = K ]; then
 NAME=${NAME:3}
 ISBOOT=1
 fi
 # For SELinux we need to use 'runuser' not 'su'
 if [ -x /sbin/runuser ]; then
 SU=/sbin/runuser
 else
 SU=su
 fi
 # Get the tomcat config (use this for environment specific settings)
 TOMCAT_CFG=/etc/tomcat5/tomcat5.conf
 if [ -r $TOMCAT_CFG ]; then
 . ${TOMCAT_CFG}
 fi
 # Get instance specific config file
 if [ -r /etc/sysconfig/${NAME} ]; then
 . /etc/sysconfig/${NAME}
 fi
 # Define which connector port to use
 CONNECTOR_PORT=${CONNECTOR_PORT:-8080}
 # Path to the tomcat launch script TOMCAT_SCRIPT=/usr/bin/tomcat5-test
 # Path to the script that will refresh jar symlinks on startup
 TOMCAT_RELINK_SCRIPT=${CATALINA_HOME}/bin/relink
 # Tomcat program name
 TOMCAT_PROG=$NAME
 # Define the tomcat username
 TOMCAT_USER=${TOMCAT_USER:-tomcat}
 # Define the tomcat log file
 TOMCAT_LOG=${TOMCAT_LOG:-/usr/share/tomcat5-test/logs/logscatalina.out}
 RETVAL=0
 # remove when the RHEL and FC daemon functions converge
 # (pulled from /etc/rc.d/init.d/functions)
 function checkpid() {
 local i
 for i in $* ; do
 if [ -d /proc/${i} ]; then
 return 0
 fi
 done
 return 1
 }
 # remove when the RHEL and FC daemon functions converge
 # (pulled from /etc/rc.d/init.d/functions)
 function echo_failure() {
 echo -en \\033[60G file:///\\033[60G 
 echo -n [ 
 echo -n $FAILED
 echo -n  ]
 echo -ne \r
 return 1
 }
 # remove when the RHEL and FC daemon functions converge
 # (pulled from /etc/rc.d/init.d/functions)
 function echo_success() {
 echo -en \\033[60G file:///\\033[60G 
 echo -n [ 
 echo -n $OK
 echo -n  ]
 echo -ne \r
 return 0
 }
 # Look for open ports, as the function name might imply
 function findFreePorts() {
 local isSet1=false
 local isSet2=false
 local isSet3=false
 local lower=8000
 randomPort1=0
 randomPort2=0
 randomPort3=0
 local -a listeners=( $(
 netstat -ntl | \
 awk '/^tcp/ {gsub((.)*:, , $4); print $4}') )
 while [ $isSet1 = false ] || \
 [ $isSet2 = false ] || \
 [ $isSet3 = false ]; do
 let port=${lower}+${RANDOM:0:4}
 if [ -z `expr  ${listeners[*]}  : .*\( $port \).*` ]; then
 if [ $isSet1 = false ]; then
 export randomPort1=$port
 isSet1=true
 elif [ $isSet2 = false ]; then
 export randomPort2=$port
 isSet2=true
 elif [ $isSet3 = false ]; then
 export randomPort3=$port
 isSet3=true
 fi
 fi
 done
 }
 function makeHomeDir() {
 if [ ! -d $CATALINA_HOME ]; then
 echo $CATALINA_HOME does not exist, creating
 if [ ! -d /var/lib/${NAME} ]; then
 mkdir -p /var/lib/${NAME}
 cp -pLR /var/lib/tomcat5-test/* /var/lib/${NAME}
 fi
 mkdir -p $CATALINA_HOME ${CATALINA_HOME}/conf
 /var/cache/${NAME}/temp \
 /var/cache/${NAME}/work /var/log/${NAME}
 for i in temp work; do
 ln -fs /var/cache/${NAME}/${i}
 ${CATALINA_HOME}/${i}
 done
 for i in common server shared webapps; do
 ln -fs /var/lib/${NAME}/${i}
 ${CATALINA_HOME}/${i}
 done
 ln -fs /var/log/${NAME} ${CATALINA_HOME}/logs
 cp -pLR /usr/share/tomcat5-test/*
 ${CATALINA_HOME}/conf/
 cp -pLR /usr/share/tomcat5-test/bin $CATALINA_HOME
 cp -pLR /usr/share/tomcat5-test/*
 ${CATALINA_HOME}/work/
 chown ${TOMCAT_USER}:${TOMCAT_USER} /var/log/${NAME} fi
 }
 function parseOptions() {
 options=
 options=$options $(
 awk '!/^#/  !/^$/ { ORS= ; print
 export , $0, ; }' \
 $TOMCAT_CFG
 )
 if [ -r /etc/sysconfig/${NAME} ]; then
 options=$options $(
 awk '!/^#/  !/^$/ { ORS= ;
 print export , $0, ; }' \
 /etc/sysconfig/${NAME}
 )
 fi
 

Re: Tomcat 5.5 won't use APR

2008-08-27 Thread Len Popp
On Wed, Aug 27, 2008 at 12:03, Gregor Schneider [EMAIL PROTECTED] wrote:
 If I'm not mistaken, Tomcat should state in tomcat.log.INFO that it is
 using APR, right?

Right.

 So according to the above tomcat.log.INFO, is it
 true that in my case Tomcat is not using the APR?

No, it also logs a message when it's *not* using tcnative, like this:

INFO: The Apache Tomcat Native library which allows optimal
performance in production environments was not found on the
java.library.path: [etc.]

I don't see that in your log, so I can't tell if it's using tcnative or not.

On my old Tomcat 5.5 setup (on Windows with the default logging
options) that message appeared in catalina.[date].log and there was no
tomcat.log.INFO.
-- 
Len

-
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: Re: errors in deploying war file to tomcat 5.5

2008-08-24 Thread Len Popp
Shouldn't the .jar file go in WEB-INF/lib? Where is the
commons-fileupload.jar file? commons-io.jar should go in the same
directory.

.war and .jar files are the same as .zip files, so you can unpack them
using any utility that unpacks .zip files. On Windows, the easiest way
is to rename the file with a .zip extension, then you can right-click
on it and Extract All.
-- 
Len

On Sun, Aug 24, 2008 at 03:58, sam wun [EMAIL PROTECTED] wrote:
 Hi,



 I have downloaded commons-io-1.3.1.jar file and put it in the MET-INF\lib\
 folder in Eclipse(3.4).

 Then I highlight the project name , right click it, select Export-War file
 to export the project into a war file.

 Have I missing any step?

 NOw I still getting the same errors.



 BTW, how to see the content of the war file I built from Eclipse?



 Thanks




 - Original Message -
 From: Edoardo Panfili
 Sent: 24/08/08 02:28 am
 To: Tomcat Users List
 Subject: Re: errors in deploying war file to tomcat 5.5

 Edoardo Panfili ha scritto:
  sam wun ha scritto:
  Hi,
 
 
 
  I tried to deploy a war file (built from Eclipse in windows) into
  tomcat 5.5(in linux).
 
  I got the following errors:
 
 
 
  Aug 24, 2008 12:32:46 PM org.apache.catalina.core.ApplicationContext
 log
  INFO: HTMLManager: init: Associated with Deployer
  'Catalina:type=Deployer,host=localhost'
  Aug 24, 2008 12:32:46 PM org.apache.catalina.core.ApplicationContext
 log
  INFO: HTMLManager: init: Global resources are available
  Aug 24, 2008 12:32:46 PM org.apache.catalina.core.ApplicationContext
 log
  INFO: HTMLManager: list: Listing contexts for virtual host 'localhost'
  Aug 24, 2008 12:32:53 PM org.apache.catalina.core.ApplicationContext
 log
  INFO: HTMLManager: list: Listing contexts for virtual host 'localhost'
  Aug 24, 2008 12:33:24 PM org.apache.catalina.core.StandardWrapperValve
  invoke
  SEVERE: Servlet.service() for servlet HTMLManager threw exception
  java.lang.NoClassDefFoundError:
  org/apache/commons/io/output/DeferredFileOutputStream
  at
 
 org.apache.commons.fileupload.DefaultFileItemFactory.createItem(DefaultFileItemFactory.java:103)
 
  at
 
 org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:350)
 
  at
 
 org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:302)
 
  at
 
 org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:157)
 
  at
 javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
  at
 javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
  at
 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
 
  at
 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 
  at
 
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
 
  at
 
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
 
  at
 
 org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
 
  at
 
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
 
  at
 
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
 
  at
 
 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
 
  at
 
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
 
  at
 
 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
 
  at
 
 org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
 
  at
 
 org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
 
  at
 
 org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
 
  at
 
 org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
 
  at java.lang.Thread.run(Unknown Source)
 
  What is the problem and how to fix it?
 
 
 
  Your suggestion is highly appreciated.
 
  Thanks
 
  Sam
 
 
  It seems that you need
  org/apache/commons/io/output/DeferredFileOutputStream.class
  you can find it in commons-io-1.3.2.jar
  put commons-io-1.3.2.jar in WEB-INF/lib
 I'm sorry: 1.3.2 is my version maybe you have another one.

 Edoardo

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



Re: errors in deploying war file to tomcat 5.5

2008-08-23 Thread Len Popp
From the stack trace, it looks like you're missing commons-io.jar, or
it's the wrong version. commons-io.jar is required by
commons-fileupload.jar. Make sure you have the correct versions of
both of those files.
-- 
Len



On Sat, Aug 23, 2008 at 10:53, sam wun [EMAIL PROTECTED] wrote:
 Hi,



 I tried to deploy a war file (built from Eclipse in windows) into tomcat
 5.5(in linux).

 I got the following errors:



 Aug 24, 2008 12:32:46 PM org.apache.catalina.core.ApplicationContext log
 INFO: HTMLManager: init: Associated with Deployer
 'Catalina:type=Deployer,host=localhost'
 Aug 24, 2008 12:32:46 PM org.apache.catalina.core.ApplicationContext log
 INFO: HTMLManager: init: Global resources are available
 Aug 24, 2008 12:32:46 PM org.apache.catalina.core.ApplicationContext log
 INFO: HTMLManager: list: Listing contexts for virtual host 'localhost'
 Aug 24, 2008 12:32:53 PM org.apache.catalina.core.ApplicationContext log
 INFO: HTMLManager: list: Listing contexts for virtual host 'localhost'
 Aug 24, 2008 12:33:24 PM org.apache.catalina.core.StandardWrapperValve
 invoke
 SEVERE: Servlet.service() for servlet HTMLManager threw exception
 java.lang.NoClassDefFoundError:
 org/apache/commons/io/output/DeferredFileOutputStream
 at
 org.apache.commons.fileupload.DefaultFileItemFactory.createItem(DefaultFileItemFactory.java:103)
 at
 org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:350)
 at
 org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:302)
 at
 org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:157)
 at
 javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
 at
 javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
 at
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 at
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
 at
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
 at
 org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
 at
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
 at
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
 at
 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
 at
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
 at
 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
 at
 org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
 at
 org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
 at
 org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
 at
 org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
 at java.lang.Thread.run(Unknown Source)

 What is the problem and how to fix it?



 Your suggestion is highly appreciated.

 Thanks

 Sam


-
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: I WANT Tomcat to die when a given servlet fails to initialize

2008-08-22 Thread Len Popp
There isn't a clean way for webapps to shut down the server because
they're not really supposed to do that. :-)

If you thrown an UnavailableException from a servlet's init method,
that servlet won't run.
If you do app initialization in a ServletContextListener and throw an
exception from the contextInitialized method, the webapp won't run.
But in both these cases the Tomcat server keeps running.
-- 
Len



On Fri, Aug 22, 2008 at 15:08, COHEN, STEVEN M (ATTSI) [EMAIL PROTECTED] 
wrote:
 Yeah, that would work :-).  I guess I was looking for something a bit more,
 well, graceful.

 -Original Message-
 From: Lucas Galfaso [mailto:[EMAIL PROTECTED]
 Sent: Friday, August 22, 2008 1:55 PM
 To: Tomcat Users List
 Subject: Re: I WANT Tomcat to die when a given servlet fails to initialize

 try {
  [...]
 } catch (Exception e) {
  System.exit(0);
 }

 ??

 :-)


 -lg


 On Fri, Aug 22, 2008 at 3:42 PM, COHEN, STEVEN M (ATTSI) [EMAIL PROTECTED]
 wrote:
 This may seem like an odd request and I'm sure it is nonstandard, but
 it nonetheless something I'd like to be able to do.  We have an
 instance of Tomcat running.  It runs one application.  This
 application is NOT an application serving content over the www.  It is
 basically a straight java application running inside of a web server.
 The reason it runs in a Web server is because there is one subsidiary
 use case that uses HTTP Gets to fire actions in the application via a
 servlet.  No other applications are served off this web server.

 The non-web application's main() is the servlet's init().  If this
 servlet cannot initialize there is no point to keeping Tomcat running
 and it would in fact make monitoring easier if it were not running.

 Is there any easy way to achieve this in Tomcat?


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



Re: Remastering tomcat installer ..

2008-08-21 Thread Len Popp
The source code for the latest Tomcat release is in the Subversion
repository here:
http://svn.apache.org/repos/asf/tomcat/tc6.0.x/tags/TOMCAT_6_0_18/
The build script for the release package is here:
http://svn.apache.org/repos/asf/tomcat/tc6.0.x/tags/TOMCAT_6_0_18/dist.xml
The NSIS install script is here:
http://svn.apache.org/repos/asf/tomcat/tc6.0.x/tags/TOMCAT_6_0_18/res/tomcat.nsi
-- 
Len



On Thu, Aug 21, 2008 at 06:41, Albert Kam [EMAIL PROTECTED] wrote:
 Hello,

 Thanks for the quick reply !

 Could you point me the way to do this ?

 Like where can i find the the Installer build files for the latest tomcat
 release, what installer does it use (i assume it's NSIS), and how to build
 it .. I hope for some links.

 Keywords for me to search would be fantastic too :)
 I tried googling around, but im afraid i'm using the wrong keywords =p

 And the license is the Apache v2 license, am i correct ?

 Regards,
 Albert Kam

 On Thu, Aug 21, 2008 at 5:34 PM, Mark Thomas [EMAIL PROTECTED] wrote:

 Albert Kam wrote:
  Hello,
 
  I'm just wondering if it is possible to 'remaster' or rebuild
  tomcat-windows-installer,
  so that i could put my war files or my webapps along with it to produce
  a custom tomcat installer + my own webapps ..
 
  Is this legal and possible ? =)

 Yes on both counts, providing you adhere to the terms of the license.

 Mark



 -
 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 not pursue the past. Do not lose yourself in the future.
 The past no longer is. The future has not yet come.
 Looking deeply at life as it is in the very here and now,
 the practitioner dwells in stability and freedom.
 (Thich Nhat Hanh)


-
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: Custom error page with stacktrace

2008-08-20 Thread Len Popp
In your error page, the variable exception is set to the exception
(if any). You can get the error message and stack trace from the
exception like this:

pException message: %= (exception == null) ?  :
exception.getMessage() %/p
%
String stStack = ;
if (exception != null) {
java.io.StringWriter sw = new java.io.StringWriter();
exception.printStackTrace(new java.io.PrintWriter(sw));
stStack = sw.toString();
}
%
pStack trace:/p
pre
%= stStack %
/pre

(Note: For clarity I omitted some important stuff like sanitizing the
output to prevent people from stuffing nasty HTML/Javascript into the
error messages.)
-- 
Len



On Wed, Aug 20, 2008 at 10:08, Tom van Wietmarschen
[EMAIL PROTECTED] wrote:
 L.S,

 I'm running tomcat to serve out XML to a custom client (not a webbrowser).
 In order to show an error page that this client can actually display I use
 custom error pages in Tomcat. For this I have specified a JSP as an error
 page, this works very well. However, during the test phase of our project
 I'd also like to add the stacktrace to the error document and optionally to
 a logfile. Since the client cannot interpret a normal HTML page, the
 standard 500 error page that comes with Tomcat is unusable. How can I access
 the stacktrace/error message from my own JSP or a servlet so I can output it
 to our own custom XML format and our testers can give proper feedback. I did
 some googling for this but it seems like everyone else is just trying to get
 rid of the stacktrace instead of changing it.

 Sincerely,
   Tom van Wietmarschen
 --

 **Tom van Wietmarschen**
 Software Engineer

 Service2Media B.V.
 Vreelandseweg 7
 1216 CG Hilversum

 Capitool 41   7521 PL Enschede

 Tel  +31 (0)35 626 46 12
 Fax +31 (0)35 626 46 13
 www.service2media.com http://www.service2media.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]



Re: Tomcat can't see a new function

2008-08-20 Thread Len Popp
Is there an older copy of the jar in another directory where it gets
picked up before your new one?
-- 
Len

On Wed, Aug 20, 2008 at 21:33, Daniel L. Gross [EMAIL PROTECTED] wrote:
 I have a strange problem.  I am using Borland to compile my source files and
 create jar files.  For some reason things are not working correctly.  In one
 jar library, I can create new functions, rebuild the library, and when I put
 them up in Tomcat 5.5 WEB-INF, it recognizes them.  However, I have another
 library jar file that use to work, but now I can't seem to add any functions
 to any of the files and have them seen by tomcat.  They work fine in the
 Borland debugger, but I get this error in the log file from Tomcat.  I tried
 creating a simple 10 line program and trying to call a new function in any
 of the files in the jar library file, and it doesn't see them.  However,
 tomcat does recognize the original functions that each file originally had
 in them, and they work fine.  It's only new fuctions that don't work.  Any
 ideas?  This one is a real bugger.  I tried this on two different servers
 with tomcat 5.5 and got the same error shown below.  I have to get this
 resolved because more jar files need to be modified for our servers.

 Thanks, Dan Gross, ATLC

 Aug 20, 2008 3:59:36 AM org.apache.catalina.core.StandardWrapperValve invoke
 SEVERE: Servlet.service() for servlet invoker threw exception
 java.lang.NoSuchMethodError: GIUtilities.GILog.testfunction()V
   at testservlet.doGet(testservlet.java:26)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   at
 org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:420)
   at
 org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:134)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
   at
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   at
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
   at
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
   at
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
   at
 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
   at
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
   at
 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
   at
 org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
   at
 org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
   at
 org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
   at
 org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
   at java.lang.Thread.run(Unknown Source)


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



Re: java version in windows and tomcat server

2008-08-19 Thread Len Popp
No, it will not work. If you compile with a new compiler you need a
new JRE to run it.

You can tell Eclipse to compile the code for an older JRE. The setting
is in Project  Properties  Java Compiler.
-- 
Len



On Tue, Aug 19, 2008 at 09:44, sam wun [EMAIL PROTECTED] wrote:
 Hi,

 when I create a web project in windows Eclipse (3.4), I use jre6.

 But in my tomcat server (linux), it s using jre5.

 Do I have to make the jre version to be the same for both platforms?

 Because if I package it in a war file in windows, the lib  jar files are
 all in jre6 version.

 Then when I deploy this war file to the tomcat server, will it still work?



 Thanks





-
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: where to place context configuration

2008-08-15 Thread Len Popp
Thanks for reminding me about resource-ref. I don't think that putting
app-specific settings in server.xml is ideal - I'd rather have the
per-app config files - but I can see that would get around the issues
I'm complaining about.
-- 
Len

On Fri, Aug 15, 2008 at 10:57, Christopher Schultz
[EMAIL PROTECTED] wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Len,

 Len Popp wrote:
 So, the server admin can configure the DB server etc. by editing the
 file under the conf dir, but every time they deploy a new version of
 the app the settings are auto-wiped?

 No. Ideally, the server admin sets up data sources in server.xml and
 then the webapps use web.xml (or context.xml) and resource-ref. You
 certainly don't want devs overwriting admin settings.

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.9 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

 iEYEARECAAYFAkilmUYACgkQ9CaO5/Lv0PAIBQCfdKyLoxfV7YlNpDAsZN6IJsr9
 LBwAoKQuAQSSf+ToToKYghhWtgP4ZMyF
 =olhN
 -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]



-
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: where to place context configuration

2008-08-14 Thread Len Popp
What you're missing is how Tomcat copies the META-INF/context.xml file
to conf/localhost/Catalina/mywebapp.xml under some circumstances. (Not
surprising that you missed this, since it doesn't seem to be mentioned
in the Tomcat docs.)

One guess is that context.xml is copied into the conf directory if it
doesn't already exist there, but I'm not sure about that.
-- 
Len



On Thu, Aug 14, 2008 at 14:35, Robert Dietrick [EMAIL PROTECTED] wrote:
 You are definitely not alone, Angus.  For the record, I'm using Tomcat 5.5.

 -rob

 On Thu, Aug 14, 2008 at 11:30 AM, Angus Mezick
 [EMAIL PROTECTED] wrote:
 Am I the only one that is REALLY disturbed about that idea of REQUIRING
 two identical files to run an app?  One in the war file and one in the
 conf directory?  If the only in the conf directory takes priority, why
 the one in the war file needed at all?  I am just hoping this isn't in
 tomcat 6.0..  The idea of relying on the server to use the correct
 version of possibly different files in a production server makes me VERY
 nervous.

 --Angus Mezick

 -Original Message-
 From: Robert Dietrick [mailto:[EMAIL PROTECTED]
 Sent: Thursday, August 14, 2008 2:22 PM
 To: Tomcat Users List
 Subject: Re: where to place context configuration

 I would very much prefer to use only the one in
 mywebapp/META-INF/contex.xml, as this is much less invasive (does not
 require changing/adding anything to tomcat's global config
 directories).  But this doesn't seem to work.

 I can leave it as is (and am becoming resigned to the fact that this
 is my only option), but this is sort of a maintenance nightmare since
 the two files need to be kept in sync.  Plus, it just seems idiotic to
 need to declare the context and its resources in two locations.

 Does either of these files need a 'docBase' or 'path' parameter?  It
 doesn't seem to make a difference either way.

 -rob

 On Thu, Aug 14, 2008 at 11:00 AM, Mark Thomas [EMAIL PROTECTED] wrote:
 Robert Dietrick wrote:
 Hi,

 I just noticed that I had a Context definition in both
 $CATALINA_HOME/conf/Catalina/localhost/mywebapp.xml and in
 $CATALINA_HOME/webapps/mywebapp.war/META-INF/context.xml.  In both of
 these context definitions, I define a JNDI database connection pool
 with the same name and identical parameters.  This was working fine,
 but it is confusing, redundant, and runs contrary to the
 recommendations in the official documentation.

 However, if i remove either one of these files, I get the dreaded
 Cannot create JDBC driver of class '' for connect URL 'null' error.
 Can anyone offer any advice?

 Just leave it as is?

 The one in conf will take priority.

 Mark


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


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



-
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: where to place context configuration

2008-08-14 Thread Len Popp
So, the server admin can configure the DB server etc. by editing the
file under the conf dir, but every time they deploy a new version of
the app the settings are auto-wiped?

Setting aside for the moment what you think I deserve...
That's far from ideal in an environment where the developers and the
server admins are not within shouting distance. (Such as where I
work.)
-- 
Len

On Thu, Aug 14, 2008 at 14:57, Caldarale, Charles R
[EMAIL PROTECTED] wrote:
 From: Angus Mezick [mailto:[EMAIL PROTECTED]
 Subject: RE: where to place context configuration

 Am I the only one that is REALLY disturbed about that idea of
 REQUIRING two identical files to run an app?

 Probably, because Tomcat does not require that.  You may place the Context 
 element in either location, but Tomcat *may* copy the one from 
 META-INF/context.xml to conf/Catalina/[host] so it can access it directly.  
 Proper undeployment will remove the copy.  If you're doing a brute force 
 replacement of a .war rather than a real undeployment, you deserve what you 
 get.

 You have the option of placing the webapp's Context element in 
 conf/Catalina/[host]/[appName].xml so that you can override the one packaged 
 in the .war file - often necessary with prepackaged apps that might require 
 special configuration for a particular 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]



-
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: where to place context configuration

2008-08-14 Thread Len Popp
On Thu, Aug 14, 2008 at 15:55, Caldarale, Charles R
[EMAIL PROTECTED] wrote:
 If you just want to replace the webapp, then dropping in a new .war file will 
 not lose the element in conf/Catalina/[host]/[appName].xml file, but things 
 may not be cleaned up properly, especially on Windows systems where the 
 anti-locking mechanisms are employed.

But earlier you said:

 if you're updating the .war without doing an undeployment
 first, you're breaking the rules, and all bets are off.

So that doesn't sound like a reasonable alternative for a server that
anyone cares about.

Is there someone who knows for sure how it was *designed* to work?
-- 
Len

-
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: startup order for deployment

2008-08-13 Thread Len Popp
You cannot control the order in which the webapps start. There are
ways that you can ensure the initialization is complete before your
webapp starts accepting requests, but first ask yourself: Why? Your
webapp must be able to handle the situation of the web service being
down, so is it really a problem if it happens for a few seconds during
server startup?
-- 
Len

On Wed, Aug 13, 2008 at 13:09, Mathias P.W Nilsson [EMAIL PROTECTED] wrote:

 Hi!

 I'm using tomcat as a webserver in my eclipse installation. I have some
 webservice calls from my webapplication and add both my projects to the
 tomcat server. The problem is that I can not determine the order to start
 the applications. Is there a way to first start deploy a war, and do this in
 a certain order?

 Thanks!
 --
 View this message in context: 
 http://www.nabble.com/startup-order-for-deployment-tp18967318p18967318.html
 Sent from the Tomcat - User mailing list archive at Nabble.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]



Re: startup order for deployment

2008-08-13 Thread Len Popp
If you need to call the web service during startup, you could retry
the call as long as you get a service-not-available error. Or you
could find a way to synchronize the two webapps (e.g. using a shared
class if they're always going to be on the same server). Or maybe you
could load  cache the data when it's needed instead of loading it all
at startup.
-- 
Len

On Wed, Aug 13, 2008 at 18:41, Mathias P.W Nilsson [EMAIL PROTECTED] wrote:

 You are absolutly right. It's my wicket application that caches users from a
 webservice on startup. But I guess I'll have to find a better solution.

 // Mathias
 --
 View this message in context: 
 http://www.nabble.com/startup-order-for-deployment-tp18967318p18972567.html
 Sent from the Tomcat - User mailing list archive at Nabble.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]



Re: Possible virus uploaded to Tomcat 5.5.3 - SOLVED

2008-08-10 Thread Len Popp
Thanks for figuring this out and posting the info.

I checked my server log and found that just this morning some computer
in China tried to poke at the manager app on my server. So it seems
that it wasn't an isolated incident, there's someone out there trying
to exploit Tomcat's manager app. Caveat administrator!
-- 
Len

On Sun, Aug 10, 2008 at 14:12, Mark Thomas [EMAIL PROTECTED] wrote:
 Folks,

 Just a short note to let you know that Warren and I have been working this
 off-list and have identified how this attack was launched.

 I'd like to take this opportunity to publicly thank Warren for taking the
 time to work with me on this when he had a lot more important things to do
 than answer my questions.

 The manager application was installed with a user name and password that the
 attackers were able to brute force. Once they had access to the manager
 application they were able to install their own web application that allowed
 them wider access to the box.

 This isn't the first report of a rouge application that we have seen on the
 Tomcat security list. Where we have had sufficient detail to trace how the
 application was installed, it has always been via an existing management
 tool.

 Therefore, I would like to take the opportunity to remind users to ensure
 that any potentially user accessible administration interface is suitably
 secured. The following isn't an exhaustive list but things to consider
 include:
 - don't use and standard user names for administrative users
 - do use strong passwords, especially for administrative users
 - uninstall web applications you don't need (admin, manager, host-manager,
 examples, webdav, etc)
 - use Remote Host/Address filters to limit access to administrative
 applications
 - enable access logging so if something does go wrong you have some
 information to work with
 - regularly review your access logs for evidence of potential attacks
 - run Tomcat as a dedicated user with the minimum privileges possible

 Finally, a small advert. I am presenting a session on Tomcat security at
 ApacheCon in November that will cover the above and a whole lot more.

 Mark


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



Re: Avast Antivirus and apache-tomcat-6.0.18.exe

2008-08-05 Thread Len Popp
2008/8/5 Johnny Kewl [EMAIL PROTECTED]:

 - Original Message - From: Mark Thomas [EMAIL PROTECTED]
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Tuesday, August 05, 2008 11:09 PM
 Subject: Re: Avast Antivirus and apache-tomcat-6.0.18.exe


 Mark Thomas wrote:

 Ангелин Лалев wrote:

 Apparently the address is from Bulgarian mirror, where I am
 automatically redirected when i load the
 http://tomcat.apache.org/download-60.cgi.
 The md5 sum is from there too.

 If the alert is reproducable on binaries from other mirrors that still
 don't mean it's a virus.
 I had false warnings with Avast before.

 Indeed. That is what I am trying to establish.

 I am as sure as I can be that this is a false positive.

 Mark

 Hi Mark, I think so to, I scanned the zips, scanned native binaries...
 conclude either something has snuck onto the MS build machine, or Avast is
 getting it wrong... I believe the later because it doesnt actually identify
 the virus, Win32 gen seems to be a generic warning with no description...
 But all this doesnt really matter... one cant recommend users ignore it,
 Avast is popular... and its just the kind of thing competition will thrive
 on... its negative marketing for TC.
 It will probably go away with a slight mod to the build and I think it has
 to be marked as urgent and the instant the next build is ready, its
 replaced.
 I would actually remove it... just the Win32 service... the zip is fine.
 Regards
 JK

I agree that a false positive from Avast shouldn't be ignored, but I
think the correct solution is for someone @apache.org to contact Avast
and ask them to either explain what the problem is or remove Tomcat
from their virus definitions.

Sometimes the problem is caused by the installer program. There have
been cases where the anti-virus guys mistakenly extract a signature
from the installer program rather than the from the malware itself,
which causes false positives on other programs using the same
installer. Just a guess, but it seems likely here because Tomcat uses
the popular open-source Nullsoft installer.
-- 
Len


Re: Problem with Displaying Result of a MySQL Join in Tomcat

2008-08-03 Thread Len Popp
There might be a simpler solution than migrating to a completely
different OS. :-)

What exactly do you mean by don't get retrieved? Does it throw an
exception? Is there an error message in Tomcat's log?

When you execute the query in MySQL, do you get exactly the same
results as on the old system? In particular, are the column names what
you expect?
-- 
Len



On Sat, Aug 2, 2008 at 20:02, Glyn Thomas [EMAIL PROTECTED] wrote:
 I am in the process of converting a Tomcat front end for a MySQL database
 from

 Windows XP to Windows Vista.



 The XP version used MySQL Version 5.0.22, Tomcat 5.5.20, JRE 1.5.0 release

 12 with Tomcat JDK 4 Compatibility Pack, and J/Connector 5.0.6.



 The Vista version is using MySQL Version 5.0.51a, Tomcat 5.5.26, JRE

 1.6.0_05, and J/Connector 5.1.6.



 I am unable to display any parts of a result set that are retrieved from

 JOINed tables in the Vista version - this works fine in the XP version.  I

 already tried converting the queries to use JOIN syntax instead of WHERE

 syntax, without improvement.



 For example, this query works correctly in the MySQL command line:



 SELECT

 i.ImageID,i.DateDay,i.DateMonth,i.DateYear,i.Location1,i.Location2,i.Scanned

 YN,i.MediaID,c.Description as 'Country', s.SubjectID, s.SubjectTypeID,

 i.CountryID,i.PhotographerID, i.VolumeNumber FROM image_tbl i JOIN

 lu_country_tbl c ON (i.countryid=c.countryid) JOIN xrf_image_subject_tbl si

 ON (si.Imageid=i.imageid) JOIN subject_tbl s ON (si.Subjectid=s.subjectid)

 WHERE (i.imageid=1234);



 In JSP, I retrieve the results of this query into an rsImages variable, and

 then iterate through the rows using:



 c:forEach var=row items=${rsImage.rows}



 Rows that retrieve directly from the image_tbl work correctly e.g.

 ${row.ImageID} will display the image ID.



 However, elements from the joined tables, such as ${row.Country} and

 ${row.SubjectID} don't get retrieved.



 Any ideas?



 Thanks,

 Glyn Thomas







-
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: Problem with Displaying Result of a MySQL Join in Tomcat

2008-08-03 Thread Len Popp
That error looks like a communication problem between Tomcat  MySQL,
but I don't know why it would only happen when accessing certain
columns. Perhaps someone who knows more about JDBC  MySQL can explain
what it means.
-- 
Len



On Sun, Aug 3, 2008 at 13:21, Glyn Thomas [EMAIL PROTECTED] wrote:
 Len,
 Thanks for your comments and interest.

 I hadn't thought to check the Tomcat log because the majority of the query 
 appeared to execute, but there is an error being put into the log, see below. 
  Note, this is with a slight variation on the query that I added in my 
 earlier post, but has the same symptoms.

 Aug 3, 2008 1:10:57 PM org.apache.catalina.core.StandardWrapperValve invoke
 SEVERE: Servlet.service() for servlet jsp threw exception
 java.net.SocketException: Software caused connection abort: recv failed
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(Unknown Source)
at 
 com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:113)
at 
 com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:160)
at 
 com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:188)
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:2428)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2882)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2871)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3414)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1936)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2542)
at 
 com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1734)
at 
 com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1885)
at 
 org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:93)
at 
 org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.doEndTag(QueryTagSupport.java:215)
at org.apache.jsp.index_jsp._jspService(index_jsp.java:371)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at 
 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
at 
 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at 
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at 
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at 
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at 
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at 
 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at 
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at 
 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
at 
 org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at 
 org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at 
 org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at 
 org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Unknown Source)

 I ran the query in  MySQL Command Line Client on both XP and Vista and they 
 return identical results.

 Thanks
 Glyn

 -Original Message-
 From: Len Popp [mailto:[EMAIL PROTECTED]
 Sent: Sunday, August 03, 2008 11:31 AM
 To: Tomcat Users List
 Subject: Re: Problem with Displaying Result of a MySQL Join in Tomcat

 There might be a simpler solution than migrating to a completely
 different OS. :-)

 What exactly do you mean by don't get retrieved? Does it throw an
 exception? Is there an error message in Tomcat's log?

 When you execute the query in MySQL, do you get exactly the same
 results as on the old system? In particular, are the column names what
 you expect?
 --
 Len



 On Sat, Aug 2, 2008 at 20:02, Glyn Thomas [EMAIL PROTECTED] wrote:
 I am in the process of converting a Tomcat front end for a MySQL database
 from

 Windows XP to Windows Vista.



 The XP version used MySQL Version 5.0.22, Tomcat 5.5.20, JRE 1.5.0 release

 12

Re: Tomcat cannot find infrequently used classes

2008-07-23 Thread Len Popp
Is the class name really XYZ or is that just a placeholder? It makes
a difference which class it's looking for - it could be a class from
Tomcat, from your webapp, or from one of the libraries needed by the
webapp.
-- 
Len


On Wed, Jul 23, 2008 at 04:33,  [EMAIL PROTECTED] wrote:
 I have a very large web application, running on three tomcats, which has
 been running for many years.

 There was a change made to the web application overnight, to add the
 following jar files to the webapp/WEB-INF/lib directory:

 avalon-framework-cvs-20020806.jar
 batik.jar
 crimson_1_1_3.jar
 icu4j_2_6.jar
 jacob.jar
 jaxen-full.jar
 saxon_6_5_3.jar
 saxpath.jar

 Today the web application started exhibiting behaviour I have never seen
 before. Some classes, in unrelated areas of the application are getting lost
 by Tomcat. It seems to be classes that are not used often, so my theory is
 that the class (a servlet, or another class used by the servlet or JSP) is
 loaded, and used, then a period of time goes by during which it is not used.
 The next time an attempt to use the same class then Tomcat gives this type
 of response:

 Error:
 javax.servlet.ServletException: Wrapper cannot find servlet class XYZ or a
 class it depends on
 at
 org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:10
 76)
 at
 org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:791)
 at
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
 va:127)
 at
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
 va:174)
 at
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127
 )
 at
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117
 )
 at
 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
 :108)
 at
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
 at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:200)
 at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
 at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:773)
 at
 org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:703)
 at
 org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java
 :895)
 at
 org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
 a:685)
 at java.lang.Thread.run(Thread.java:595)


 Root Stack Trace:
 java.lang.ClassNotFoundException: XYZ
 at
 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
 a:1359)
 at
 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
 a:1205)
 at
 org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:10
 68)
 at
 org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:791)
 at
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
 va:127)
 at
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
 va:174)
 at
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127
 )
 at
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117
 )
 at
 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
 :108)
 at
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
 at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:200)
 at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
 at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:773)
 at
 org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:703)
 at
 org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java
 :895)
 at
 org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
 a:685)
 at java.lang.Thread.run(Thread.java:595)

 -

 Then the next time the page is requested the response is a 404 error.

 The three load-balanced tomcat servers all have the same setup, and by
 getting one of the other servers you would sometimes get the page that was
 reported as missing.

 It seems that Tomcat is unloading the classes, but having read up about
 unloading classes it doesn't seem possible unless the class loader that
 loaded the class is also unloaded. The reloadble option in server.xml is NOT
 set to true.

 Any ideas?

 Robert Purvis
 Principal Technical Specialist


 Systems and Service Delivery
 NHS Connecting for Health
 01392 206691
 [EMAIL PROTECTED]
 www.connectingforhealth.nhs.uk


 ***
 This  message  may  contain  confidential and  privileged  information.
 If you  are not the  intended recipient  you should not  disclose, copy
 or distribute information in this e-mail or take any action in reliance
 on its contents.  To do so is strictly  prohibited and may be unlawful.
 Please  inform  the  sender that  this  message has  

Re: Tomcat cannot find infrequently used classes

2008-07-23 Thread Len Popp
Since the classes are servlets, it may be that Tomcat's work directory
didn't get cleaned up properly when the app was re-deployed or
re-loaded. I've seen similar problems caused that way. Try stopping
Tomcat and deleting the contents of the work directory.
-- 
Len


On Wed, Jul 23, 2008 at 09:47,  [EMAIL PROTECTED] wrote:
 The XYZ is just a placeholder. None of the actual classes are Tomcat
 classes, they are all servlets we have written.

 Rob

 -Original Message-
 From: Len Popp [mailto:[EMAIL PROTECTED]
 Sent: 23 July 2008 14:37
 To: Tomcat Users List; [EMAIL PROTECTED]
 Subject: Re: Tomcat cannot find infrequently used classes

 Is the class name really XYZ or is that just a placeholder? It makes a
 difference which class it's looking for - it could be a class from Tomcat,
 from your webapp, or from one of the libraries needed by the webapp.
 --
 Len


 On Wed, Jul 23, 2008 at 04:33,  [EMAIL PROTECTED] wrote:
 I have a very large web application, running on three tomcats, which has
 been running for many years.

 There was a change made to the web application overnight, to add the
 following jar files to the webapp/WEB-INF/lib directory:

 avalon-framework-cvs-20020806.jar
 batik.jar
 crimson_1_1_3.jar
 icu4j_2_6.jar
 jacob.jar
 jaxen-full.jar
 saxon_6_5_3.jar
 saxpath.jar

 Today the web application started exhibiting behaviour I have never seen
 before. Some classes, in unrelated areas of the application are getting
 lost
 by Tomcat. It seems to be classes that are not used often, so my theory is
 that the class (a servlet, or another class used by the servlet or JSP) is
 loaded, and used, then a period of time goes by during which it is not
 used.
 The next time an attempt to use the same class then Tomcat gives this type
 of response:

 Error:
 javax.servlet.ServletException: Wrapper cannot find servlet class XYZ or a
 class it depends on
 at

 org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:10
 76)
 at

 org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:791)
 at

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

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

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

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

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

 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
 at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:200)
 at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
 at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:773)
 at

 org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:703)
 at

 org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java
 :895)
 at

 org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
 a:685)
 at java.lang.Thread.run(Thread.java:595)


 Root Stack Trace:
 java.lang.ClassNotFoundException: XYZ
 at

 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
 a:1359)
 at

 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
 a:1205)
 at

 org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:10
 68)
 at

 org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:791)
 at

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

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

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

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

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

 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
 at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:200)
 at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
 at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:773)
 at

 org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:703)
 at

 org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java
 :895)
 at

 org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
 a:685)
 at java.lang.Thread.run(Thread.java:595)

 -

 Then the next time the page is requested the response is a 404 error.

 The three load-balanced tomcat servers all have the same setup, and by
 getting one of the other servers you would sometimes get the page that was
 reported as missing.

 It seems that Tomcat is unloading the classes, but having read up about
 unloading classes it doesn't seem possible unless the class loader that
 loaded the class

Re: Tomcat cannot find infrequently used classes

2008-07-23 Thread Len Popp
Or maybe I don't mean the work directory, maybe I mean the webapp
directory that the .war file got unpacked into. (Sorry, I don't have a
Tomcat server in front of me to check.) I can't remember whether it
was the .jsp files unpacked from the .war, or the .java  .class files
compiled from the JSPs - some of those files weren't deleted when I
updated a webapp, and that confused Tomcat.
-- 
Len


On Wed, Jul 23, 2008 at 12:43, Len Popp [EMAIL PROTECTED] wrote:
 Since the classes are servlets, it may be that Tomcat's work directory
 didn't get cleaned up properly when the app was re-deployed or
 re-loaded. I've seen similar problems caused that way. Try stopping
 Tomcat and deleting the contents of the work directory.
 --
 Len


 On Wed, Jul 23, 2008 at 09:47,  [EMAIL PROTECTED] wrote:
 The XYZ is just a placeholder. None of the actual classes are Tomcat
 classes, they are all servlets we have written.

 Rob

 -Original Message-
 From: Len Popp [mailto:[EMAIL PROTECTED]
 Sent: 23 July 2008 14:37
 To: Tomcat Users List; [EMAIL PROTECTED]
 Subject: Re: Tomcat cannot find infrequently used classes

 Is the class name really XYZ or is that just a placeholder? It makes a
 difference which class it's looking for - it could be a class from Tomcat,
 from your webapp, or from one of the libraries needed by the webapp.
 --
 Len


 On Wed, Jul 23, 2008 at 04:33,  [EMAIL PROTECTED] wrote:
 I have a very large web application, running on three tomcats, which has
 been running for many years.

 There was a change made to the web application overnight, to add the
 following jar files to the webapp/WEB-INF/lib directory:

 avalon-framework-cvs-20020806.jar
 batik.jar
 crimson_1_1_3.jar
 icu4j_2_6.jar
 jacob.jar
 jaxen-full.jar
 saxon_6_5_3.jar
 saxpath.jar

 Today the web application started exhibiting behaviour I have never seen
 before. Some classes, in unrelated areas of the application are getting
 lost
 by Tomcat. It seems to be classes that are not used often, so my theory is
 that the class (a servlet, or another class used by the servlet or JSP) is
 loaded, and used, then a period of time goes by during which it is not
 used.
 The next time an attempt to use the same class then Tomcat gives this type
 of response:

 Error:
 javax.servlet.ServletException: Wrapper cannot find servlet class XYZ or a
 class it depends on
 at

 org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:10
 76)
 at

 org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:791)
 at

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

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

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

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

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

 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
 at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:200)
 at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
 at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:773)
 at

 org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:703)
 at

 org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java
 :895)
 at

 org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
 a:685)
 at java.lang.Thread.run(Thread.java:595)


 Root Stack Trace:
 java.lang.ClassNotFoundException: XYZ
 at

 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
 a:1359)
 at

 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
 a:1205)
 at

 org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:10
 68)
 at

 org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:791)
 at

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

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

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

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

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

 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
 at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:200)
 at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
 at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:773)
 at

 org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:703)
 at

 org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java
 :895)
 at

 org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
 a:685

Re: Spam Score

2008-07-22 Thread Len Popp
If you can't re-post the original email successfully, try:
- posting in plain text format, not HTML
- removing URLs
- posting from a different email account, or from a web gateway such
as nabble.com

Perhaps the mailing list admin can give us some hints about what to
avoid when sending email to this list. Or tell us what anti-spam
software is running on mx1.us.apache.org - maybe there is
documentation about how to compose emails so they're not scored as
spam.
-- 
Len


On Tue, Jul 22, 2008 at 14:46, Patrick Markiewicz
[EMAIL PROTECTED] wrote:
 For some reason, my original question is undeliverable, and the tomcat
 mailing list sends me:
 users@tomcat.apache.org on 7/22/2008 2:28 PM
The e-mail system was unable to deliver the message, but did
 not report a specific reason.  Check the address and try again.  If it
 still fails, contact your system administrator.
 XX; host
 mx1.us.apache.org[140.211.11.136] said:552 spam score (5.6) exceeded
 threshold (in reply to end of DATA command)

 XX is a placeholder for my mailserver's actual
 address.

 Are there specific things that are not allowed?  Like having URLs in my
 email?  I'll try reposting that message.

 Patrick

 -Original Message-
 From: Bill Davidson [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, July 22, 2008 2:34 PM
 To: Tomcat Users List
 Subject: Re: Spam Score

 Patrick Markiewicz wrote:
 What is the tomcat mailing list spam score, and why am I unable to
 send
 my email to post a question?


 You just posted a question.

 I don't know what you mean by spam score.


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



-
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: Both www.apache.org and tomcat.apache.org are down

2008-07-17 Thread Len Popp
www.apache.org is not currently working here.
ping www.apache.org gets a response from 192.87.106.226, but Firefox
doesn't get a response from either www.apache.org or 192.87.106.226.

tomcat.apache.org is working.

Maybe there was a DNS change that hasn't propagated everywhere yet?
-- 
Len


On Thu, Jul 17, 2008 at 14:14, Steve Ochani [EMAIL PROTECTED] wrote:
 On 17 Jul 2008 at 14:05, Bajbutovic, Zoran wrote:

 Date sent:  Thu, 17 Jul 2008 14:05:38 -0400
 From:   Bajbutovic, Zoran [EMAIL PROTECTED]
 Subject:Both www.apache.org and tomcat.apache.org are down
 To: Tomcat Users List users@tomcat.apache.org
 Send reply to:  Tomcat Users List users@tomcat.apache.org

 Hi all,

 Both www.apache.org and tomcat.apache.org have been down for some
 time.
 Is anyone there to fix this? This is not particularly encouraging
 for us


 Works fine for me.



 -Steve O.




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



Re: Both www.apache.org and tomcat.apache.org are down

2008-07-17 Thread Len Popp
Huh? If www.apache.org is resolving to the wrong address, then it *is*
a DNS problem. From here I can't tell for certain which is bad, the
DNS result or the IP address. But in my experience, when some people
can reach an internet host by name and others cannot, it's almost
always due to a DNS issue.
-- 
Len


On Thu, Jul 17, 2008 at 14:47, Youssef Mohammed
[EMAIL PROTECTED] wrote:
 if you can't access 192.87.106.226 from firefox, then it has nothing to do
 with DNS.


 On Thu, Jul 17, 2008 at 9:36 PM, Len Popp [EMAIL PROTECTED] wrote:

 www.apache.org is not currently working here.
 ping www.apache.org gets a response from 192.87.106.226, but Firefox
 doesn't get a response from either www.apache.org or 192.87.106.226.

 tomcat.apache.org is working.

 Maybe there was a DNS change that hasn't propagated everywhere yet?
 --
 Len


 On Thu, Jul 17, 2008 at 14:14, Steve Ochani [EMAIL PROTECTED] wrote:
  On 17 Jul 2008 at 14:05, Bajbutovic, Zoran wrote:
 
  Date sent:  Thu, 17 Jul 2008 14:05:38 -0400
  From:   Bajbutovic, Zoran [EMAIL PROTECTED]
  Subject:Both www.apache.org and tomcat.apache.org are
 down
  To: Tomcat Users List users@tomcat.apache.org
  Send reply to:  Tomcat Users List users@tomcat.apache.org
 
  Hi all,
 
  Both www.apache.org and tomcat.apache.org have been down for some
  time.
  Is anyone there to fix this? This is not particularly encouraging
  for us
 
 
  Works fine for me.
 
 
 
  -Steve O.
 
 
 
 
  -
  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]




 --
 Regards, Youssef


-
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: Both www.apache.org and tomcat.apache.org are down

2008-07-17 Thread Len Popp
... and now my DNS has caught up and it's working again.

For those of you who are still stuck with incorrect DNS info, the IP
address for both www.apache.org and tomcat.apache.org is
140.211.11.130.
-- 
Len


On Thu, Jul 17, 2008 at 14:54, Len Popp [EMAIL PROTECTED] wrote:
 Huh? If www.apache.org is resolving to the wrong address, then it *is*
 a DNS problem. From here I can't tell for certain which is bad, the
 DNS result or the IP address. But in my experience, when some people
 can reach an internet host by name and others cannot, it's almost
 always due to a DNS issue.
 --
 Len


 On Thu, Jul 17, 2008 at 14:47, Youssef Mohammed
 [EMAIL PROTECTED] wrote:
 if you can't access 192.87.106.226 from firefox, then it has nothing to do
 with DNS.


 On Thu, Jul 17, 2008 at 9:36 PM, Len Popp [EMAIL PROTECTED] wrote:

 www.apache.org is not currently working here.
 ping www.apache.org gets a response from 192.87.106.226, but Firefox
 doesn't get a response from either www.apache.org or 192.87.106.226.

 tomcat.apache.org is working.

 Maybe there was a DNS change that hasn't propagated everywhere yet?
 --
 Len


 On Thu, Jul 17, 2008 at 14:14, Steve Ochani [EMAIL PROTECTED] wrote:
  On 17 Jul 2008 at 14:05, Bajbutovic, Zoran wrote:
 
  Date sent:  Thu, 17 Jul 2008 14:05:38 -0400
  From:   Bajbutovic, Zoran [EMAIL PROTECTED]
  Subject:Both www.apache.org and tomcat.apache.org are
 down
  To: Tomcat Users List users@tomcat.apache.org
  Send reply to:  Tomcat Users List users@tomcat.apache.org
 
  Hi all,
 
  Both www.apache.org and tomcat.apache.org have been down for some
  time.
  Is anyone there to fix this? This is not particularly encouraging
  for us
 
 
  Works fine for me.
 
 
 
  -Steve O.
 
 
 
 
  -
  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]




 --
 Regards, Youssef



-
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: Possibility of JSVC daemon with APR reacting strangely to TCP health checks

2008-07-14 Thread Len Popp
The obvious question is, are these TCP health checks well-formed HTTP
requests or not?

I guess it's hard to snoop the exact contents of the request since
it's sent via SSL, but maybe you could configure it to send the exact
same health checks to port 80 via plain HTTP. Then you could use
Wireshark to see the exact contents of the requests, and figure out if
the problem is in the requests or in Tomcat.
-- 
Len


On Mon, Jul 14, 2008 at 09:57, Andrew Feller [EMAIL PROTECTED] wrote:
 Is there any reason why Tomcat running under the JSVC daemon using the
 Apache Portable Runtime for SSL would act erratically to TCP health checks?

 We are using a Juniper DX for load balancing that uses TCP health checks to
 port 443 of a Tomcat instance in order to keep the machine in the forwarding
 cluster.  However, whenever the health check comes in, the logs generated by
 Tomcat's AccessLogValve show them to be malformed HTTP requests.  My
 networking colleagues and the Juniper engineer confirm that it is sending
 plain TCP health checks; nothing fancy.  As you can see in the logs below,
 Tomcat states the TCP health check is malformed HTTP request.  Any thoughts?

 Sincerely grateful for any assistance,
 Andrew

 Environment:

OS: RHEL 5 32-bit
Tomcat: 6.0.14
Connectors: Apache Portable Runtime distributed with Tomcat binaries
Connector configuration:

Connector port=443
 protocol=org.apache.coyote.http11.Http11AprProtocol maxThreads=150
SSLEnabled=true scheme=https secure=true clientAuth=false
 sslProtocol=TLS
SSLCertificateFile=/etc/pki/tls/certs/server.crt
SSLCertificateKeyFile=/etc/pki/tls/private/server.key
/

 Excerpt from AccessLogValve output (with health check occurring every 9
 seconds):

 192.168.1.2 [07/Jul/2008:13:32:40 -0500] GET /serviceValidate 200 240 -
 serviceA.example.com 9 ?someparam=1-f5dUkJr3KDo0VewDxeF7-
 serviceA.example.comservice=https%3A%2F%2serviceB.example.com%2Flogin

 192.168.1.2 [07/Jul/2008:13:32:40 -0500]
 H8f7UQt2SP-IeCHR0myAbQ0PyeXhTISx6ldp5RBOkd6GNkwfakOE6VGgFDyUr1wWWcVksPYbJSfD8BqxjFHze8M0jGWn5dqfb3o0-VOovBOlsANm_lvjg7ZUEfz9ZFfo3RPxtt-qqP2hZNlynme7Dr62iBCq5K4DuryO4Dy3ne6uGizIIXkGIAf5OHU-sAMYnDnhi2IgB_IKIPwCqAA_DMwYfFRAuVwZ1X7GwcZZgPMB8DnyhAUyFtyyK1cIqkH7b2HIhqFquoQJP2IhZbq-IfztVAQ4xzfDfXiDimop2AGuGK8aKhYWNhRMuACscC7dKEKyUsJj9pFAzdZy8Rkl4MqqVbYyh-tsKhjgL2xEEofVw7WyADz5dwZvxX6CpewNhXxdksNH39Rg7BvcokYFt5baJ_1hZeAH0ynn7lPTL4VYID4KKFZAf1IlUFd6jNJSMtD7GzidasfIlLO4Ds4b7Bg_leB4rX8biJBYPBB0_Fp8gBQLXyBpaIHHI47wgu-onISD6hGD-sbWumqSUvdikJUsrBCzuFuSWhli4JceBwCdZqR3dRy3dxPNnQy1RsVtdkM1If8D5cdFIhgU4F2c1yVUZkOTYXklQ3NZ53BSnLMYnMKxoRJ7P-1KYBjCZkMz8MynKcEMtUTFtq2AaMOsQ3qOnHjMvmxCiKv0N6tQRyHjrwgP8bfWE8Lk3z8x_qgXc_UsD4-MeBayyhqbwl-m23xXw2IGVJ7B4Ul4JVHIhuP_9fv4AHsgw4noAAAM5UwMR1lWT_Dupw228eFXpuelprJzB4ilwXt3ey8IweBaiD84uB_zwhS3TAgG_ZKQVuOC6YJFbsXIWi59UdBBXncbhoxbXhRfn1DidZjHKvSyWXsuzaYsgaYSmDoWBKfn2Nyzq5dEi2ZwRwwQLyBQoJg8uj-9Q2ksayhmGbK8zWMcFrPwMi3PwgNeru8GMu1EWw3IdNiM4CFEswnmNi_VSK1lr2oZXHKO6zOt58wW5eoFeXyifW42n3qq4xpnOtAdx0NLYIcaVOfhcN8WRAxX_PGDwXrhqLM7HqaNyxl_V_SZ2U-DIsXTK9ds5dRzGD1NzFs6jTXHkmFv5041Aq3OzGjpKjoE-IcjOutD7bNfHXV9DiwGdFuS6ONBZHO-m5GtwjOFpoVDXVZNiQIvKnxaUdFgeqgp1Yww15kHWrV7Z80jrPedydl6htlcSagGblsyzfJVVhBMrYx-3BQtC-JqKdkyQmahClMNlrOrslNGqs3PQ4Ye8AIivjw21RP8qqMJksPx96hyqiy1szTa3eZRMkCANzvj1NWODhfzRZ9by50pLFnYRtOM9XS0IdTB52NIdG4LRttvBnxE3GSGqNTTzkhXIDydZ5PuDF0rgzuhVAhHeKbuc3FgvPcaoBcKDJ4rjFfmtJ79--vKvbn_tVzJVthjuf3mM19HEt5eCwzzYQB0m_j0hltGjx5pu4P985QUvYdbTIFQFxLsHT3174IqeVxNkMcjKZOYFVBT5ToLPx_4cWVv08mgygQ1zbbBm0Peuepm_0ZhpmPG3IJ4y_RAVBZXTWhVSZL4s-EwlpZAknGdL1UVyYUm8SnLgwvQRg5l61WeecYaJPLn_zfJDH8G9valeooxNU9BOnPBtJ3737xcfzLzv7S5wnjbKUhRMWROs_Sf4FCZNVYqe_GjnC-dbT232tioZ9h6WPv7Wt-6ePNH_dFOz90EBDd4Qx7OWxmW-MEtWMC9zmLFLlpgky1UTc3gQZCZjbMvx

 192.168.1.2 [07/Jul/2008:13:32:49 -0500] GET /serviceValidate 200 240 -
 serviceA.example.com 6 ?someparam=-1-f5dUkJr3KDo0VewDxeF7-
 serviceA.example.comservice=https%3A%2F%2FserviceB.example.com%2Flogin

 192.168.1.2 [07/Jul/2008:13:32:49 -0500]
 

Re: Apache/mod_jk serves random files from tomcat

2008-07-10 Thread Len Popp
That log file is from the httpd server, right? What does the Tomcat
log file say? (Turn on AccessLogValve if you haven't already.) Is
Tomcat always getting requests for the correct file, or is mod_jk
requesting the wrong file sometimes?
-- 
Len


On Thu, Jul 10, 2008 at 11:44, Tim Redding [EMAIL PROTECTED] wrote:

 Hi,

 We are experiencing intermittent problems with a particular site that is not
 returning the correct file that is requested.  For instance if we request
 the index.html file we actually get a css file or even an image.  From the
 apache access log you can see that the size of the index.html file grows on
 the second request. This is because a gif was actually returned.

 XXX.XXX.XXX.130 - - [10/Jul/2008:15:10:39 +0100] GET /index.html HTTP/1.1
 200 1068
 XXX.XXX.XXX.130 - - [10/Jul/2008:15:13:10 +0100] GET /index.html HTTP/1.1
 200 9526
 XXX.XXX.XXX.130 - - [10/Jul/2008:15:13:48 +0100] GET /index.html HTTP/1.1
 200 1086

 No error messages are logged in the mode_jk.log file.

 We have Apache/2.2.3 on the front on a Tomcat 6.0.16 server with mod_jk
 (version unknown but fairly recent).  We have all assets in our war file.
 When we hit Tomcat directly on port 8080 it serves the correct file. And to
 fix the problem an apache restart seems to sort things out.

 On this server with have 2 vhosts.  One is a simple nothing fancy static
 site and the other forwards everything to our Tomcat server.  Below I've
 included our mod_jk config and a snippet of our httpd.conf.

 Any ideas or things to try would be most appreciated.


 Tim.



 = mod_jk.conf ==

 # Load mod_jk module
 # Specify the filename of the mod_jk lib
 LoadModule jk_module modules/mod_jk.so

 # Where to find workers.properties
 JkWorkersFile conf/workers.properties

 # Where to put jk logs
 JkLogFile logs/mod_jk.log

 # Set the jk log level [debug/error/info]
 JkLogLevel debug

 # Select the log format
 JkLogStampFormat [%a %b %d %H:%M:%S %Y]

 # JkOptions indicates to send SSK KEY SIZE
 JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories

 # JkRequestLogFormat
 JkRequestLogFormat %w %V %T

 # Add shared memory.
 # This directive is present with 1.2.10 and
 # later versions of mod_jk, and is needed for
 # for load balancing to work properly
 JkShmFile logs/jk.shm

 # original URL pass through
 JkEnvVarORIGINAL_URIw00t

 # Add jkstatus for managing runtime data
 Location /jkstatus/
 JkMount status
 Order deny,allow
 Deny from all
 Allow from 127.0.0.1
 /Location


 === httpd.conf (our additions to the default file) ==

 # mod_jk include
 Include conf/mod_jk.conf

 VirtualHost *:80
DocumentRoot /var/www/html/
ServerName example.co.uk
ErrorLog logs/default-error.log
CustomLog logs/default-access.log common
alias /logs /var/widgets
Location /logs
AuthUserFile /var/widgets/.htpasswd
AuthName Widgets
AuthType Basic
Require valid-user
/Location

Rewriteengine on
RewriteRule ^/$ /index.html [R]
jkmount /* loadbalancer
jkunmount /logs/*.gz loadbalancer
 /VirtualHost

 VirtualHost *:80
DocumentRoot /var/www/html/
ServerName widgets.example.co.uk
ErrorLog /var/widgets/widget-error.log
CustomLog /var/widgets/widgets-access.log common
jkunmount /* loadbalancer
 /VirtualHost


 === worker.properties ==

 worker.list=loadbalancer,status
 worker.node1.port=8009
 worker.node1.host=127.0.0.1
 worker.node1.type=ajp13
 worker.node1.lbfactor=1
 worker.loadbalancer.type=lb
 worker.loadbalancer.balance_workers=node1
 worker.status.type=status
 --
 View this message in context: 
 http://www.nabble.com/Apache-mod_jk-serves-random-files-from-tomcat-tp18385568p18385568.html
 Sent from the Tomcat - User mailing list archive at Nabble.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]



Re: Tomcat seems to have stopped servicing requests behind Apache

2008-07-10 Thread Len Popp
One way to do it safely is to have Tomcat serve all the files. Is
there a reason why you need the Apache web server at all?
-- 
Len


On Thu, Jul 10, 2008 at 15:22, Tim Hunt [EMAIL PROTECTED] wrote:
 Wow, that's a major headache/hassle I wasn't aware of.  Where can I find
 more about the risks and how to potentially do this safely?

 Thanks,
 Tim

 -Original Message-
 From: Mark Thomas [mailto:[EMAIL PROTECTED]
 Sent: Thursday, July 10, 2008 2:55 PM
 To: Tomcat Users List
 Subject: Re: Tomcat seems to have stopped servicing requests behind
 Apache

 Tim Hunt wrote:
 Hmmm.  Does that mean I shouldn't have an .html file (served by
 Apache)
 and a .jsp file (served by Tomcat) in the same directory?

 Yes. Unless you are careful about your configuration. It is possible to
 do
 it safely, but it can cause issues.

 Mark



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



-
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 seems to have stopped servicing requests behind Apache

2008-07-10 Thread Len Popp
On this mailing list, the party line is that Tomcat is as fast as any
other web server. I haven't benchmarked it myself.

There's no big issue here. If the HTML files are part of your webapp,
they're under a Tomcat directory and will be served by Tomcat. If you
want to use a different web server for those files, put them into that
server's directory.

It's only a problem if you try to configure two different servers in
the same directory. Don't do that. You wouldn't put your whole web
site into c:\windows\system32, would you? :-)
-- 
Len

On Thu, Jul 10, 2008 at 16:11, Tim Hunt [EMAIL PROTECTED] wrote:
 Well, we believed apache was more flexible with mods (e.g., we use
 mod_bwshare) and having apache serve static content would be
 faster/higher performance.  But you can tell me if any of that is wrong,
 or out of date.

 Regards,
 Tim

 -Original Message-
 From: Len Popp [mailto:[EMAIL PROTECTED]
 Sent: Thursday, July 10, 2008 4:03 PM
 To: Tomcat Users List
 Subject: Re: Tomcat seems to have stopped servicing requests behind
 Apache

 One way to do it safely is to have Tomcat serve all the files. Is
 there a reason why you need the Apache web server at all?
 --
 Len


 On Thu, Jul 10, 2008 at 15:22, Tim Hunt [EMAIL PROTECTED] wrote:
 Wow, that's a major headache/hassle I wasn't aware of.  Where can I
 find
 more about the risks and how to potentially do this safely?

 Thanks,
 Tim

 -Original Message-
 From: Mark Thomas [mailto:[EMAIL PROTECTED]
 Sent: Thursday, July 10, 2008 2:55 PM
 To: Tomcat Users List
 Subject: Re: Tomcat seems to have stopped servicing requests behind
 Apache

 Tim Hunt wrote:
 Hmmm.  Does that mean I shouldn't have an .html file (served by
 Apache)
 and a .jsp file (served by Tomcat) in the same directory?

 Yes. Unless you are careful about your configuration. It is possible
 to
 do
 it safely, but it can cause issues.

 Mark



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



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



-
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: Configuring DataSources using jsp: reload context.xml?

2008-07-08 Thread Len Popp
On Tue, Jul 8, 2008 at 08:53, Jonas Wagner [EMAIL PROTECTED] wrote:
 Since the application connects to its datasources using the
 DriverManager class, I cannot use connection pooling. That's one of the
 reasons I tried using JNDI for such a long time :-(

I think it's possible to use DBCP connection pooling without JNDI. I
haven't tried it, but there's some sample code here:

http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/doc/ManualPoolingDataSourceExample.java?view=markup
-- 
Len

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



  1   2   3   >