RE: Tomcat within Eclipse

2008-08-11 Thread Praful Sinha
You can configure users through Tomcat 6.0\conf folder there tomcat have one
tomcat-users.xml file to create user group or profile. Also you can use the
administrator tool to manage uses in Tomcat.

Thanks and Regards,
Praful Sinha.

-Original Message-
From: Sam Wun [mailto:[EMAIL PROTECTED] 
Sent: Monday, August 11, 2008 11:20 AM
To: Tomcat Users List
Subject: Re: Tomcat within Eclipse

Can you tell me how to setup a *userdatabase* for this case?

Thank you for your reply.

On Mon, Aug 11, 2008 at 5:14 PM, Jens Kapitza
[EMAIL PROTECTED] wrote:
 Sam Wun schrieb:

 Hi,

 Can anyone tell me how to resolve the followoing exception?
 and how do I know whether tomcat service is really running.

 11/08/2008 14:47:47 org.apache.catalina.core.AprLifecycleListener init
 INFO: The APR based Apache Tomcat Native library which allows optimal
 performance in production environments was not found on the
 java.library.path: C:\Program


Files\Java\jre1.6.0_07\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\
Windows;C:/Program
 Files/Java/jre6/bin/client;C:/Program


Files/Java/jre6/bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;
d:\ant171\bin;D:\apache-maven-2.0.9\bin;C:\Program
 Files\Nmap
 11/08/2008 14:47:47 org.apache.coyote.http11.Http11Protocol init
 INFO: Initializing Coyote HTTP/1.1 on http-8080
 11/08/2008 14:47:47 org.apache.catalina.startup.Catalina load
 INFO: Initialization processed in 502 ms
 11/08/2008 14:47:47 org.apache.naming.NamingContext lookup
 WARNING: Unexpected exception resolving reference
 java.io.IOException: Cannot rename original file to C:\Program
 Files\Apache Software Foundation\Tomcat 6.0\conf\tomcat-users.xml.old


 is this location writeable?

 SEVERE: Catalina.start:
 LifecycleException:  No UserDatabase component found under key
 UserDatabase


 chain error ???

at

org.apache.catalina.realm.UserDatabaseRealm.start(UserDatabaseRealm.java:261
)
at
 org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1037)
at
 org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at
 org.apache.catalina.core.StandardService.start(StandardService.java:516)
at
 org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
 11/08/2008 14:47:47 org.apache.catalina.startup.Catalina start
 INFO: Server startup in 104 ms


 tomcat is running but with no userdatabase (?)

 11/08/2008 14:49:20 org.apache.catalina.core.StandardServer await
 WARNING: StandardServer.await: Invalid command 'GET / HTTP/1.1' received


 i think tomcat can't do anything with no userdatabase so all commands are
 invalid (?)


 Jens Kapitza

 -
 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: Possible virus uploaded to Tomcat 5.5.3 - SOLVED

2008-08-11 Thread Mark Thomas

Sameer Acharya wrote:

Just a couple of questions on this.

1. I read your mail exchange and it seems that the OP has mentioned no Manager 
app was installed, but your analysis indicates that the rogue app was uploaded 
through manager app ?.
There were quite a few e-mails exchanged off list, mainly because they 
contain specific details like IP addresses, ports, config files etc.



2. Normally firewalls keep a log of port activity so was this activity not 
detected by the firewall ?
That depends on a) the firewall and b) how different this traffic looks 
from normal traffic. In this case the firewall didn't generate an alert.


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]



Re: Strange startorder of webapps

2008-08-11 Thread Mark Thomas

Tobias Kaefer wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi!

I have a strange problem with Tomcat 6.0.16 and the start order of my
webapps. I just switched form 32bit-Windows XP to 64bit-Linux on my
development system. On the Windows system everything works as expected:
ROOT webapp is the first webapp to be loaded. Afterwords my webapp is
loaded.


There is no expected startup order. Neither the Servlet spec nor Tomcat 
define one. You can't rely on the apps starting in any particular order.


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]



RE: how to make context path case insensitive

2008-08-11 Thread Peter Crowther
 From: persistence k [mailto:[EMAIL PROTECTED]
 Can anybody tell me how to make context path of a web application case
 insensitve.
 I need a case insenstive context path for my web application.

Do you need a case insensitive context path, or do you need users to be able to 
type in either case initially and to be directed to the same webapp?  If it's 
the latter, you could deploy your webapp at one variant of the context path 
(say the lowercase one) and deploy a small webapp at the other that simply 
redirects to the lowercase version.

If you genuinely need a case insensitive context path, can you give us some 
more details about what you're trying to do?  Also, what OS, and what version 
of Tomcat?

- Peter

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



Re: how to make context path case insensitive

2008-08-11 Thread persistence k
 thanks for your reply.

I'm using FC5 linux, tomcat 5.028 for my web app.

Currently my webapp context path is in upper case, and as per the
requirement we need to make the context path case insensitive
just as  www.google.com and WWW.GOOgle.COM point to same application. Case
sensitivity shouldn't be a matter for my context path.

Yes, i  do need users to be able to type in either case initially and to be
directed to the same webapp  but instead of deploying multiple  variants of
the same application, can you suggest me how to create a case insensitive
context path for my web app.


Regards,
-Persistence





On Mon, Aug 11, 2008 at 3:39 PM, Peter Crowther [EMAIL PROTECTED]
 wrote:

  From: persistence k [mailto:[EMAIL PROTECTED]
  Can anybody tell me how to make context path of a web application case
  insensitve.
  I need a case insenstive context path for my web application.

 Do you need a case insensitive context path, or do you need users to be
 able to type in either case initially and to be directed to the same webapp?
  If it's the latter, you could deploy your webapp at one variant of the
 context path (say the lowercase one) and deploy a small webapp at the other
 that simply redirects to the lowercase version.

 If you genuinely need a case insensitive context path, can you give us some
 more details about what you're trying to do?  Also, what OS, and what
 version of Tomcat?

- Peter

 -
 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: DefaultServlet doesn't set charset

2008-08-11 Thread Markus Schönhaber
Markus Schönhaber wrote:

 Mark Thomas wrote:

 That said I wouldn't be against a patch that introduced a 
 useFileEncodingInCharset parameter (although a shorter name would be better 
 ;)
 
 Great! I'll dig into DefaultServlet's source and see what I can come up
 with.

OK, I think I have, by and large, understood how the DefaultServlet
works and added code to append the charset info (if wanted and
applicable) to the Content-Type response header.
What I ended up with is the same as if I had simply searched the code
for all places where Content-Type is set and add my code there. Seems
reassuring to me.

I'll do some more testing and then attach the patch to
https://issues.apache.org/bugzilla/show_bug.cgi?id=41773
Are there any (non-obvious) testcases that you think deserve special
attention?

Regards
  mks

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



Will tomcat handles Syn

2008-08-11 Thread Thangavel Sankaranarayanan

Hi ,

 Does Synchronization is taken care by Tomcat itself when i call a static
method from a thread...(should i use synchronized keyword or will it be
taken care by Tomcat Container).

is the below couple of statements right and applicable to tomcat???
And J2EE application are multithread,so its container responsibilities to
handle all these stuff for user.
Even if you use 'synchronized' keyowrd in J2EE application than you are
trying to make your container life tuff which you shd not be the case.
Conatiner will do better handling of common resource,so we shd not use
'synchronized' keyword.



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]



Re: how to make context path case insensitive

2008-08-11 Thread Jens Kapitza

persistence k schrieb:

 thanks for your reply.

I'm using FC5 linux, tomcat 5.028 for my web app.

Currently my webapp context path is in upper case, and as per the
requirement we need to make the context path case insensitive
just as  www.google.com and WWW.GOOgle.COM point to same application. Case
sensitivity shouldn't be a matter for my context path.

Yes, i  do need users to be able to type in either case initially and to be
directed to the same webapp  but instead of deploying multiple  variants of
the same application, can you suggest me how to create a case insensitive
context path for my web app.

  

is tomcat behind apache2 webserver?  you could use url rewriting with regEx.


Regards,
-Persistence

  



-
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: Strange startorder of webapps

2008-08-11 Thread Tobias Kaefer

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

| There is no expected startup order. Neither the Servlet spec nor Tomcat
| define one. You can't rely on the apps starting in any particular order.
Yes, you're right. And I'll expected that behaviour.
I missed to sync one file with the version-controll-system and that
broke my configuration. Somethimes you do not see the wood for the trees.

Nevertheless thanks for your reply
Tobias

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

- --
Mit freundlichen Gruessen / with kind regards

Tobias S. Käfer

Tobias S. Kaefer * Portal-Development
ABAS Software AG, Suedendstrasse 42, 76135 Karlsruhe, GERMANY
Fon: +49 721 967 23 0, Fax: +49 721 967 23 100
Managing board / Vorstand: Werner Strub (CEO, Vorsitzender), Peter Walser
Chairman supervisory board / Aufsichtsratsvorsitzender: Thomas Frank
Company Register / Handelsregister: HRB 107644 Amtsgericht Mannheim
please visit our homepage / Bitte besuchen Sie unsere Homepage:
http://www.abas.de
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIoCALdJJ1JNEzpd0RAuJoAJ9lLtLlnLTaKVSAsBDoP7w2VDrP6wCfSwP1
T5tds/8jwzzIJA1M5aMUdZA=
=N9Eq
-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]



Re: how to make context path case insensitive

2008-08-11 Thread Pierre Goupil
Hello,

If what you need is to redirect any request to
http://www.yoursite.com/yOuRwEbapP (yourwebapp being case insensitive) to
http://www.yoursite.com/yourwebapp (yourwebapp being case sensitive and
being the context path to which you have deployed your app to), what you
need is a servlet filter. Note that what is called the context path is
only the yourwebapp part, the www.yoursite.com is not a part of it,
strictly speaking.

http://www.ibm.com/developerworks/java/library/j-tomcat2/
http://www.ibm.com/developerworks/java/library/j-tomcat/


Quoting this source, basically a filter enables Web application developers
to create flexible application components that could be inserted and chained
into the application server's request flow -- before and after the actual
request was processed. It allows you to monitor  modify every single
request coming to your Tomcat and then, to modify (forward) the requested
URL, for instance.

Yours,

Pierre Goupil


On Mon, Aug 11, 2008 at 12:27 PM, persistence k [EMAIL PROTECTED]wrote:

  thanks for your reply.

 I'm using FC5 linux, tomcat 5.028 for my web app.

 Currently my webapp context path is in upper case, and as per the
 requirement we need to make the context path case insensitive
 just as  www.google.com and WWW.GOOgle.COM point to same application. Case
 sensitivity shouldn't be a matter for my context path.

 Yes, i  do need users to be able to type in either case initially and to be
 directed to the same webapp  but instead of deploying multiple  variants of
 the same application, can you suggest me how to create a case insensitive
 context path for my web app.


 Regards,
 -Persistence





 On Mon, Aug 11, 2008 at 3:39 PM, Peter Crowther 
 [EMAIL PROTECTED]
  wrote:

   From: persistence k [mailto:[EMAIL PROTECTED]
   Can anybody tell me how to make context path of a web application case
   insensitve.
   I need a case insenstive context path for my web application.
 
  Do you need a case insensitive context path, or do you need users to be
  able to type in either case initially and to be directed to the same
 webapp?
   If it's the latter, you could deploy your webapp at one variant of the
  context path (say the lowercase one) and deploy a small webapp at the
 other
  that simply redirects to the lowercase version.
 
  If you genuinely need a case insensitive context path, can you give us
 some
  more details about what you're trying to do?  Also, what OS, and what
  version of Tomcat?
 
 - Peter
 
  -
  To start a new topic, e-mail: users@tomcat.apache.org
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 



Problem with in Synchronized methods in Tomcat 4.x

2008-08-11 Thread Thangavel Sankaranarayanan

Hi ,

I have problem with Synchronized methods in Tomcat 4.x...

Problem Details:
When a user clicks the submit button:
(Assume for 1st user the thread created by tomcat =thread1)...thread1
starts executing a Synchronized method.

After number of session in my application has reached in some point of
time. the synchronized method is not executed and  the system hangs
waiting to execute that method.

I could'nt make a thread dump as my tomcat is started as  a window
service.What can i do at this point of time??

Can any one tell a generic solution when a synchronized method is not
executed(I hope some other thread has not released the object and hence
it hangs)
Can this be attributed as a problem with tomcat(or)JDK 1.4 No clues
to proceed further..
:(


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]



RE: Problem with in Synchronized methods in Tomcat 4.x

2008-08-11 Thread Peter Crowther
 From: Thangavel Sankaranarayanan [mailto:[EMAIL PROTECTED]
 After number of session in my application has reached in some point of
 time. the synchronized method is not executed and  the
 system hangs
 waiting to execute that method.

 I could'nt make a thread dump as my tomcat is started as  a window
 service.What can i do at this point of time??

Find some way of getting that thread dump - nobody will be able to help you 
more until we can see it.  If necessary, start Tomcat from a command prompt to 
get it.

I strongly suspect you have a logic error or race condition in your code so 
that another of your threads is stuck inside the synchronised block.

- Peter

-
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: Will tomcat handles Syn

2008-08-11 Thread Peter Crowther
As far as I know...

 From: Thangavel Sankaranarayanan [mailto:[EMAIL PROTECTED]
 Does Synchronization is taken care by Tomcat itself when i
 call a static method from a thread

No.

 should i use synchronized keyword

Depends.  If your application will fail under some circumstances if the call is 
not synchronised, then you should synchronise it.  You are the only person who 
knows the detail of your application; nobody on this list can answer this 
question for you.

 And J2EE application are multithread,so its container
 responsibilities to handle all these stuff for user.

No.  The container can do some things, but it does not inspect your code for 
calls to static methods and synchronise them.

 Even if you use 'synchronized' keyowrd in J2EE application
 than you are
 trying to make your container life tuff which you shd not
 be the case.

Depends.  Large synchronised areas may lead to lock contention and hence slow 
down your application.  In the extreme case, they could lead to deadlock.  It's 
up to you to design your application appropriately, mainly by avoiding shared 
state as far as possible.  It's not the container's job to get you out of the 
mess if you code your own solution.

 Conatiner will do better handling of common resource,so we shd not use
 'synchronized' keyword.

Yes, where the container is aware of the common resource and knows how to pool 
it.  No, where it's your own code implementing the common resource.

- Peter

-
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 in Synchronized methods in Tomcat 4.x

2008-08-11 Thread Thangavel Sankaranarayanan
Thanks peter,

I am admin of the system .I connect to the system through RDC.In that case
is there any way for me to start the service as command prompt.If so ...the
process should be running even if i log off the system...
is ter any way ??
If so,Please help me on the steps to be carried out.

Regards,
Thangavel Sankaranarayanan



   
 Peter Crowther
 [EMAIL PROTECTED] 
 elandra.com   To 
   'Tomcat Users List'   
 08/11/2008 05:14  users@tomcat.apache.org   
 PM cc 
   
   Subject 
 Please respond to RE: Problem with in Synchronized
   Tomcat Users   methods in Tomcat 4.x   
   List   
 [EMAIL PROTECTED] 
 che.org  
   
   
   




 From: Thangavel Sankaranarayanan [mailto:[EMAIL PROTECTED]
 After number of session in my application has reached in some point of
 time. the synchronized method is not executed and  the
 system hangs
 waiting to execute that method.

 I could'nt make a thread dump as my tomcat is started as  a window
 service.What can i do at this point of time??

Find some way of getting that thread dump - nobody will be able to help you
more until we can see it.  If necessary, start Tomcat from a command prompt
to get it.

I strongly suspect you have a logic error or race condition in your code so
that another of your threads is stuck inside the synchronised block.

- Peter

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



Tomcat failover

2008-08-11 Thread Ofer Kalisky
Hi,

I have a Tomcat that has a thread that reads entries from a DB and handles 
them. In each cycle, it reads all the entries (to a certain limit). I would 
like to set up a configuration that has a failover Tomcat, that when the first 
one crashes the second starts to read from the same DB (or a replicated, 
doesn't matter) and handle entries.
I wouldn't want the second Tomcat to read from the DB, because it would harm 
the operation of the first when the first is up. I would like it to start 
working only when the first is down...

How can I know in the second Tomcat that the first have crashed? can mod_jk 
help?

Thanks.

RE: Problem with in Synchronized methods in Tomcat 4.x

2008-08-11 Thread Thangavel Sankaranarayanan
Sorry..I am not the admin of the system.Si i could'nt start tomcat as a dos
service.
Regards,
Thangavel Sankaranarayanan




   
 Thangavel 
 Sankaranarayanan/ 
 India/[EMAIL PROTECTED]
To 
   Tomcat Users List 
 08/11/2008 05:39  users@tomcat.apache.org   
 PM cc 
   
   Subject 
 Please respond to RE: Problem with in Synchronized
   Tomcat Users   methods in Tomcat 4.x   
   List   
 [EMAIL PROTECTED] 
 che.org  
   
   
   




Thanks peter,

I am admin of the system .I connect to the system through RDC.In that case
is there any way for me to start the service as command prompt.If so ...the
process should be running even if i log off the system...
is ter any way ??
If so,Please help me on the steps to be carried out.

Regards,
Thangavel Sankaranarayanan




 Peter Crowther
 [EMAIL PROTECTED]
 elandra.com   To
   'Tomcat Users List'
 08/11/2008 05:14  users@tomcat.apache.org
 PM cc

   Subject
 Please respond to RE: Problem with in Synchronized
   Tomcat Users   methods in Tomcat 4.x
   List
 [EMAIL PROTECTED]
 che.org







 From: Thangavel Sankaranarayanan [mailto:[EMAIL PROTECTED]
 After number of session in my application has reached in some point of
 time. the synchronized method is not executed and  the
 system hangs
 waiting to execute that method.

 I could'nt make a thread dump as my tomcat is started as  a window
 service.What can i do at this point of time??

Find some way of getting that thread dump - nobody will be able to help you
more until we can see it.  If necessary, start Tomcat from a command prompt
to get it.

I strongly suspect you have a logic error or race condition in your code so
that another of your threads is stuck inside the synchronised block.

- Peter

-
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 within Eclipse

2008-08-11 Thread Sam Wun
Hi,

I have the server.xml path defined in Eclipse (3.4):
C:\Program Files\Apache Software Foundation\Tomcat 6.0
Where is the startup.bat file? I can't find this batch file.

Thanks


On Mon, Aug 11, 2008 at 3:27 PM, Johnny Kewl [EMAIL PROTECTED] wrote:

 - Original Message - From: Sam Wun [EMAIL PROTECTED]
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Monday, August 11, 2008 6:57 AM
 Subject: Tomcat within Eclipse


 Hi,

 Can anyone tell me how to resolve the followoing exception?
 and how do I know whether tomcat service is really running.

 11/08/2008 14:47:47 org.apache.catalina.core.AprLifecycleListener init
 INFO: The APR based Apache Tomcat Native library which allows optimal
 performance in production environments was not found on the
 java.library.path: C:\Program

 Files\Java\jre1.6.0_07\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program
 Files/Java/jre6/bin/client;C:/Program

 Files/Java/jre6/bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;d:\ant171\bin;D:\apache-maven-2.0.9\bin;C:\Program
 Files\Nmap
 11/08/2008 14:47:47 org.apache.coyote.http11.Http11Protocol init
 INFO: Initializing Coyote HTTP/1.1 on http-8080
 11/08/2008 14:47:47 org.apache.catalina.startup.Catalina load
 INFO: Initialization processed in 502 ms
 11/08/2008 14:47:47 org.apache.naming.NamingContext lookup
 WARNING: Unexpected exception resolving reference
 java.io.IOException: Cannot rename original file to C:\Program
 Files\Apache Software Foundation\Tomcat 6.0\conf\tomcat-users.xml.old
 at
 org.apache.catalina.users.MemoryUserDatabase.save(MemoryUserDatabase.java:582)
 at
 org.apache.catalina.users.MemoryUserDatabaseFactory.getObjectInstance(MemoryUserDatabaseFactory.java:104)
 at
 org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:140)
 at javax.naming.spi.NamingManager.getObjectInstance(Unknown Source)
 at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
 at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
 at
 org.apache.naming.NamingContextBindingsEnumeration.nextElementInternal(NamingContextBindingsEnumeration.java:113)
 at
 org.apache.naming.NamingContextBindingsEnumeration.next(NamingContextBindingsEnumeration.java:71)
 at
 org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:137)
 at
 org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:109)
 at
 org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.lifecycleEvent(GlobalResourcesLifecycleListener.java:81)
 at
 org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
 at org.apache.catalina.core.StandardServer.start(StandardServer.java:703)
 at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
 11/08/2008 14:47:47
 org.apache.catalina.mbeans.GlobalResourcesLifecycleListener
 createMBeans
 SEVERE: Exception processing Global JNDI Resources
 javax.naming.NamingException: Cannot rename original file to
 C:\Program Files\Apache Software Foundation\Tomcat
 6.0\conf\tomcat-users.xml.old
 at org.apache.naming.NamingContext.lookup(NamingContext.java:805)
 at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
 at
 org.apache.naming.NamingContextBindingsEnumeration.nextElementInternal(NamingContextBindingsEnumeration.java:113)
 at
 org.apache.naming.NamingContextBindingsEnumeration.next(NamingContextBindingsEnumeration.java:71)
 at
 org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:137)
 at
 org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:109)
 at
 org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.lifecycleEvent(GlobalResourcesLifecycleListener.java:81)
 at
 org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
 at org.apache.catalina.core.StandardServer.start(StandardServer.java:703)
 at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
 11/08/2008 14:47:47 org.apache.catalina.core.StandardService start
 INFO: Starting service Catalina
 11/08/2008 14:47:47 

Html tagging

2008-08-11 Thread Zico
Hi,

I am Zico. I have been working on http://dspace.bracu.ac.bd/dspace
Now, i want to remove the last /dspace part from my url.

Here, i want to add that, i have been using Fedora-7, apache tomcat,
java-1.5.

At least i need to redirect my current page. It means, user will know about
the *actual* url address, which is http://dspace.bracu.ac.bd ; then will
enter this address, but it will redirect them automatically into
http://dspace.bracu.ac.bd/dspace

For this, i tried with html tagging in my index.html page of apache-tomcat.
It`s location: */usr/src/apache-tomcat/webapps/ROOT/index.html*

The tag i used:

head
...
meta http-equiv=REFRESH content=0; url=http://dspace.bracu.ac.bd/dspace


...

/head

But, it didn`t work for me.

Can you please help me?


-- 
Best,
Z


RE: Html tagging

2008-08-11 Thread Stefan Oestreicher
why don't you just deploy your application in the ROOT context?
Anyway, it most likely doesn't work because you have a typo there, it should
be:

meta http-equiv=REFRESH content=0;
url=http://dspace.bracu.ac.bd/dspace;

instead of

meta http-equiv=REFRESH content=0;
url=http://dspace.bracu.ac.bd/dspace
 
HTH,
 
Stefan Oestreicher
 
 -Original Message-
 From: Zico [mailto:[EMAIL PROTECTED] 
 Sent: Monday, August 11, 2008 3:34 PM
 To: users@tomcat.apache.org
 Subject: Html tagging
 
 Hi,
 
 I am Zico. I have been working on 
 http://dspace.bracu.ac.bd/dspace Now, i want to remove the 
 last /dspace part from my url.
 
 Here, i want to add that, i have been using Fedora-7, apache 
 tomcat, java-1.5.
 
 At least i need to redirect my current page. It means, user 
 will know about the *actual* url address, which is 
 http://dspace.bracu.ac.bd ; then will enter this address, but 
 it will redirect them automatically into 
 http://dspace.bracu.ac.bd/dspace
 
 For this, i tried with html tagging in my index.html page of 
 apache-tomcat.
 It`s location: */usr/src/apache-tomcat/webapps/ROOT/index.html*
 
 The tag i used:
 
 head
 ...
 meta http-equiv=REFRESH content=0; 
 url=http://dspace.bracu.ac.bd/dspace
 
 
 ...
 
 /head
 
 But, it didn`t work for me.
 
 Can you please help me?
 
 
 --
 Best,
 Z
 


-
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: Html tagging

2008-08-11 Thread Zico
On Mon, Aug 11, 2008 at 7:40 PM, Stefan Oestreicher 
[EMAIL PROTECTED] wrote:

 why don't you just deploy your application in the ROOT context?


Thanks, but i cannot your point here. What do you want to mean here?

-- 
Best,
Z


Re: Tomcat within Eclipse

2008-08-11 Thread Johnny Kewl


Oh no... I think for some reason the bin scripts are missing in TC 6

Listen SAM... just for now... go get

apache-tomcat-5.5.25.zip
and
apache-tomcat-5.5.25.exe

Here

http://archive.apache.org/dist/tomcat/tomcat-5/v5.5.25/bin/apache-tomcat-5.5.25.zip
http://archive.apache.org/dist/tomcat/tomcat-5/v5.5.25/bin/apache-tomcat-5.5.25.exe

Install the EXE if you on XP

I know you not going to have issues there with TC...
And its very likely that any older plugins in Eclipse will be happy with 
it...


TC6 is still quite new... get that going then later play with TC 6...

Then... if you still having problems... tell me what plugin you using in 
eclipse, and I'll get the thing and try it...


I think you stumbling into little problems that are screwing you

And I got to tell you that if an IDE needs to actually know where TC's 
server.xml file is... its crap.
Forget about the UserDatabase error you getting... you getting it because 
the IDE and TC are not playing nicely.


You should be doing little more than just telling the IDE where TC is...

BUT if that plugin is old... it will not do TC 6
I think you getting smacked around and its unfortunate because it 
actually is the easiest thing in the world to do...


If you dont care what IDE you use then also look at NetBeans...
Thats just a run setup thing and you done!... its good as well... it has a 
wizard to setup tomcat.


Good luck


- Original Message - 
From: Sam Wun [EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Monday, August 11, 2008 3:05 PM
Subject: Re: Tomcat within Eclipse



Hi,

I have the server.xml path defined in Eclipse (3.4):
C:\Program Files\Apache Software Foundation\Tomcat 6.0
Where is the startup.bat file? I can't find this batch file.

Thanks


On Mon, Aug 11, 2008 at 3:27 PM, Johnny Kewl [EMAIL PROTECTED] wrote:


- Original Message - From: Sam Wun [EMAIL PROTECTED]
To: Tomcat Users List users@tomcat.apache.org
Sent: Monday, August 11, 2008 6:57 AM
Subject: Tomcat within Eclipse



Hi,

Can anyone tell me how to resolve the followoing exception?
and how do I know whether tomcat service is really running.

11/08/2008 14:47:47 org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal
performance in production environments was not found on the
java.library.path: C:\Program

Files\Java\jre1.6.0_07\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program
Files/Java/jre6/bin/client;C:/Program

Files/Java/jre6/bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;d:\ant171\bin;D:\apache-maven-2.0.9\bin;C:\Program
Files\Nmap
11/08/2008 14:47:47 org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
11/08/2008 14:47:47 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 502 ms
11/08/2008 14:47:47 org.apache.naming.NamingContext lookup
WARNING: Unexpected exception resolving reference
java.io.IOException: Cannot rename original file to C:\Program
Files\Apache Software Foundation\Tomcat 6.0\conf\tomcat-users.xml.old
at
org.apache.catalina.users.MemoryUserDatabase.save(MemoryUserDatabase.java:582)
at
org.apache.catalina.users.MemoryUserDatabaseFactory.getObjectInstance(MemoryUserDatabaseFactory.java:104)
at
org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:140)
at javax.naming.spi.NamingManager.getObjectInstance(Unknown Source)
at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
at
org.apache.naming.NamingContextBindingsEnumeration.nextElementInternal(NamingContextBindingsEnumeration.java:113)
at
org.apache.naming.NamingContextBindingsEnumeration.next(NamingContextBindingsEnumeration.java:71)
at
org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:137)
at
org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:109)
at
org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.lifecycleEvent(GlobalResourcesLifecycleListener.java:81)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at 
org.apache.catalina.core.StandardServer.start(StandardServer.java:703)

at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
11/08/2008 14:47:47
org.apache.catalina.mbeans.GlobalResourcesLifecycleListener
createMBeans
SEVERE: Exception processing Global JNDI Resources
javax.naming.NamingException: Cannot rename original file 

Re: DefaultServlet doesn't set charset

2008-08-11 Thread Christopher Schultz

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Markus,

Markus Schönhaber wrote:
| OK, I think I have, by and large, understood how the DefaultServlet
| works and added code to append the charset info (if wanted and
| applicable) to the Content-Type response header.
| What I ended up with is the same as if I had simply searched the code
| for all places where Content-Type is set and add my code there. Seems
| reassuring to me.

Have you rigged the servlet to add a static charset defined in, say,
web.xml or something like that? Is there any logic to guess the actual
charset? Are you actually setting the character set of the response's
Writer? I'd love to take a look at your patch.

I would definitely add some tests to verify correct behavior when the
charset is set to something that is not sane (like ).

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

iEYEARECAAYFAkigRtQACgkQ9CaO5/Lv0PCOMwCgvxUa1bbV4GhEQXgRB0i0WPAq
SVcAnRfhzT+Ej5qUgUAatnJtfkaS/fG5
=b0I8
-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]



RE: Html tagging

2008-08-11 Thread Stefan Oestreicher
 -Original Message-
 From: Zico [mailto:[EMAIL PROTECTED] 
 Sent: Monday, August 11, 2008 3:44 PM
 To: Tomcat Users List
 Cc: [EMAIL PROTECTED]
 Subject: Re: Html tagging
 
 On Mon, Aug 11, 2008 at 7:40 PM, Stefan Oestreicher  
 [EMAIL PROTECTED] wrote:
 
  why don't you just deploy your application in the ROOT context?
 
 
 Thanks, but i cannot your point here. What do you want to mean here?

It depends on how you're deploying your application.

Instead of placing an index.html file inside the ROOT folder you can put
your whole application in that folder, then it will be served as the ROOT
context.

If you're using a *.war with auto deployment just name it ROOT.war before
placing it into the webapps folder. Or, if you're using a *.war file outside
the webapps folder with a context descriptor pointing at that *.war, just
name that context descriptor ROOT.xml.

If it's unclear what I'm talking about, you probably should read
http://tomcat.apache.org/tomcat-6.0-doc/appdev/deployment.html.

HTH,

Stefan


-
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: Would like to monitor memory use offline

2008-08-11 Thread Christopher Schultz

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Richard,

Richard S. Huntrods wrote:
| Richard,
|
| Richard S. Huntrods wrote:
| |public static Vector listLookup(String table) {
| | //Connection connection = null; // connection is managed by a
| | connection pool
|
| So, is 'connection' a local or not?
| It's part of my code (I use my own connection pool class) but not to the
| DBMS code. Only if you can't get a connection from the pool
| (connection==null) do you create a local one for this method.
|
| If the connection from the pool is OK, you use it then release it back
| to the pool. If it's local (because you could not get one from the pool)
| then you close it in the finally block.

I think you are misunderstanding me: I'm asking if you are using a
shared java.sql.Connection reference among all threads running your db
code. If you are, then you've got a big problem, which could explain
some of the memory leaks you are seeing. If you have a class-level
reference like this:

public class MyDBMSMethods
{
~  private Connection connection;

~  public List getMyRecords()
~  {
~ connection = getConnectionFromPool();

~ ...
~  }
}

... then you should expect lots of problems. From your posted code, it
looks like this is what you are doing.

All connection references should be strictly local to each method. Each
method should get its own connection from the connection pool, use it,
and return it to the pool (unless you accept the connection as a
parameter to the method, in which case, you should use it).

| You need to have statement.close() and resultSet.close() in here (in the
| finally block), not up above. Also, most database connection pools
| require that you call connection.close() to return the connection to the
| pool. Are you ever calling connection.close()?
|
| Um, sorry to disagree, but that is not really correct and also does not
| touch my problem.

Not closing your resources in a finally block it surely /not/ correct,
and you /can/ leak resources in this way. Which part of my statement is
not correct?

| I am already closing the resultSet and statement in the normal
| execution part of my code. At no time during the execution of this code
| in these tests was an exception thrown in this method

It doesn't matter. If you do not close your resources in a finally
block, they are not guaranteed to be closed. It might not be your
current problem, but it could be your future problem.

| so *I was now
| correctly closing the statement and resultSet. YET IN SPITE OF THIS the
| versions of the connector after 3.1.10 FAIL to release the Field objects.
|
| The other reason NOT to put close() in the fianlly block is that the
| close() methods can throw and exception.

That's why you wrap the call to close() in its own try/catch block.

| It is very bad programming
| practice to put exception throwing code' in a finally block. Sure, you
| could use another try-catch structure for the close() statements, but
| really - you should have already closed the stuff in the normal
| execution (as I did).

If you say so. My code doesn't leak DB resources, and it is written in
this way.

| I did state one thing in error - the finally block (of course) ALWAYS
| gets called, so you only want code in that block that must be done after
| all else has happened, but you also don't really want to be repeating
| code that should go elsewhere (like the close()).
|
|
| Also, which connection pool do you use?
|
| My own.

Is there a compelling reason not to use one of the freely-available,
well-supported connection pools available? Tomcat even has one already
built into it.

| Yea - the problem may be in the connection pool that I wrote, but I
| still find it odd that closing the resultSet() and statement() has no
| effect using connectors from 3.1.10 and on. Connector 3.0.17b and prior
| work just fine and release the objects.

If that's the case, I would stick with the Connector/J version that works.

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

iEYEARECAAYFAkigSLgACgkQ9CaO5/Lv0PCatgCgkjmgLpyS0ZgGHjr1mHnIWCXO
4kIAnjZHj+16aoc2DY8ScKJmBqP8Y4rx
=rQ35
-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]



Re: request for enlightenment on request.getHeaders()

2008-08-11 Thread Christopher Schultz

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

André,

André Warnier wrote:
| A-prioris :
| - Some HTTP headers may occur several times in an HTTP request.
| - According to the HTTP 1.1 RFC, HTTP headers names are
| case-insensitive, and Accept-charset:, ACCEPT-CHARSET:,
| Accept-Charset: are thus equivalent.
|
| 1) The ServletHttpRequest.getHeaderNames() method returns an Enumeration
| (of request header name strings).
|
| Does getHeaderNames() always fold equivalent HTTP headers of the same
| name into one single entry, or can it happen that the Enumeration
| contains the same name several times ?

Neither the servlet API nor the servlet specification say either way.
Whenever this happens, you should treat it as (obviously!) ambiguous and
therefore container-dependent. I can imagine implementations could go
either way: collapse all header values together for the same header name
(because request.getHeaders() needs to return them all at once) or leave
them separate because it is less work than collapsing them. I would
imagine that the performance of each strategy is heavily dependent upon
the specifics on the web application in question, so it's hard for
implementors to decide which strategy to use.

Another caveat: since the decision is left to the servlet container
implementors, different versions of the same container could implement
different strategies.

The good thing about this ambiguity, since you are writing your own
implementation, is that you get to choose the behavior, and so you can
choose whatever is easiest for you to implement.

| What when there are two request headers with essentially the same name,
| but varying in the case of the header name in the original request ?
| Like
| Accept-charset:
| Accept-Charset:
| Does .getHeaderNames() then return one single entry for both of the
| above, or two ? and if only one, which of the above spellings would it
| return ?

Again, since the spec does not specify the behavior, all you have to do
is meet the (minimum) requirements laid out by the specification.

| 2) (may overlap the above) Does Tomcat fold the header names internally
| to upper- or lower-case ?

You'll have to check the code yourself ;)

| 3) the ServletHttpRequest.getHeader(string name) also returns an
| Enumeration (of header string values).

No, it returns a String. I think you meant getHeaders(String name). I'm
moving forward with that assumption.

| Do .getHeaders(abc), and .getHeaders(ABC) always return the same
| Enumeration?

In the sense that they will contain the same values, yes. I wouldn't bet
that request.getHeaders(abc) == request.getHeaders(ABC) because the
objects are likely to be created on the fly. I /would/ bet that
request.getHeaders(abc).equals(request.getHeader(ABC)), though.

| In other words, is it guaranteed that with one call, the Enumeration
| returned contains all values of all HTTP headers having that name,
| independently of the original header's case and independently of how the
| parameter name is passed ?

Exactly. The servlet API for getHeaders() states: The header name is
case insensitive.

| 3) Is the above implementation-dependent (e.g. Tomcat vs Websphere), or
| is it an essential part of the servlet specification, which can be
| relied upon to work under any servlet container?

The only things upon which you can rely are those explicitly stated in
the servlet specification (or the servlet API docs, which is actually a
subset of the servlet specification).

I would highly recommend acquiring a copy of the servlet specification
and reading through the relevant parts. It's quite readable, actually.
Make sure you get the latest version applicable to your container (TC
4.1 = 2.3, TC 5/5.5 = 2.4, TC 6 = 2.5).

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

iEYEARECAAYFAkigTLgACgkQ9CaO5/Lv0PBqTgCbBnEUH95XFq81f59zmbCIJ8rl
uWQAniKEeQIQHdQOHzkw46ASi5caXmd8
=+l00
-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]



Re: Re-opening the browser

2008-08-11 Thread Christopher Schultz

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Tokajac,

Tokajac wrote:
| But when i submit the (activated) username and password, i got the
| --
| HTTP Status 408 - The time allowed for the login process has been
exceeded.
| If you wish to continue you must either click back twice and re-click the
| link you requested or close and re-open your browser

This is probably because you went directly to the form login page, and
you are using Tomcat's built-in container-managed authentication and
authorization.

Instead of sending the user directly to the login-page, try sending them
to a protected URL (like /myApp/someProtectedPage). This will cause
Tomcat to display the login page itself (which is actually required),
and then the login should work.

| What's wrong here? Is it something about sessions/cookies? How should i
| solve this?

Technically, the 408 is probably because of the timing of your testing.
If you waited like 1 hour between requests, you'd get a different error
like unexpected login at this time or a 404 because j_security_check
isn't a valid URL unless the container is expecting it. It's a bit odd,
but the servlet specification does not allow for drive-by logins, and
so Tomcat does not implement them.

| P.S.
| If i open another browser manually after clicking the link, and submit
| activated username and pass -everything is fine.

Hmm. That's a bit odd. You might want to disable cookies in your browser
during testing, because they can confuse things sometimes by linking a
minutes-old session with a new login you are attempting.

Try the protected-page trick above and let us know how things go.

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

iEYEARECAAYFAkigTggACgkQ9CaO5/Lv0PBnWgCeNZNGk7mhHhKX1YfalXTZ+o72
1vgAn0CkTdvSrwCifc6FLqZEvFLr7w8W
=bnas
-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]



Re: how to make context path case insensitive

2008-08-11 Thread Christopher Schultz

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Persistence,

persistence k wrote:
| Currently my webapp context path is in upper case, and as per the
| requirement we need to make the context path case insensitive
| just as  www.google.com and WWW.GOOgle.COM point to same application. Case
| sensitivity shouldn't be a matter for my context path.
|
| Yes, i  do need users to be able to type in either case initially and
to be
| directed to the same webapp  but instead of deploying multiple
variants of
| the same application, can you suggest me how to create a case insensitive
| context path for my web app.

Without deploying trivial (redirector) applications for all combinations
of case, you'd have to hack the Tomcat source code. Since URLs are
defined to be case-sensitive (except for the hostname in HTTP/S URLs, of
course), there was no reason for Tomcat to allow for this capability.

If you are running Apache httpd in front of Tomcat, you could probably
do this with some use of mod_rewrite.

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

iEYEARECAAYFAkigT1MACgkQ9CaO5/Lv0PD37QCfaRNRRxAp6r7nuVqdes39y49X
faEAoJUNxIaoBqZGdAjMS+q5mUSmt8vC
=M6vU
-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]



Re: how to make context path case insensitive

2008-08-11 Thread Christopher Schultz

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Pierre,

Pierre Goupil wrote:
| If what you need is to redirect any request to
| http://www.yoursite.com/yOuRwEbapP (yourwebapp being case insensitive) to
| http://www.yoursite.com/yourwebapp (yourwebapp being case sensitive and
| being the context path to which you have deployed your app to), what you
| need is a servlet filter. Note that what is called the context path is
| only the yourwebapp part, the www.yoursite.com is not a part of it,
| strictly speaking.

Oh, that's a MUCH better idea than mine (to deploy all combinations of
case as redirector apps). The trick is that you must deploy this filter
into the ROOT application specifically.

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

iEYEARECAAYFAkigT6EACgkQ9CaO5/Lv0PDAIwCeKkoAnrLhvx38Ju8ee6Jz8A4H
EVgAnAoUV9pZ50yB/sA/yMffgYd20Cu6
=me8E
-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]



concurrent JkMount entries? Order relevant?

2008-08-11 Thread Stephanie Wullbieter
Hi, what to do when I want generally mount a context and it's subdirectories 
with mod_jk to one worker/router, but a special subdirectory of it to a 
different worker/router?

Does this work in mod_jk.conf?

JkMount /app/web/indexer   worker42
JkMount /app/web/indexer/* worker42

JkMount /app   routerInt4
JkMount /app/* routerInt4


Do I have to write the special contextes first, so that only when they do not 
match, the general mount option is used?

Thank You very mutch.

-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

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



Re: how to make context path case insensitive

2008-08-11 Thread André Warnier

Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Pierre,

Pierre Goupil wrote:
| If what you need is to redirect any request to
| http://www.yoursite.com/yOuRwEbapP (yourwebapp being case insensitive) to
| http://www.yoursite.com/yourwebapp (yourwebapp being case sensitive and
| being the context path to which you have deployed your app to), what you
| need is a servlet filter. Note that what is called the context path is
| only the yourwebapp part, the www.yoursite.com is not a part of it,
| strictly speaking.

Oh, that's a MUCH better idea than mine (to deploy all combinations of
case as redirector apps). The trick is that you must deploy this filter
into the ROOT application specifically.

Do you mean that all requests go first through the ROOT app, no matter 
what ? and that thus a servlet filter placed in the ROOT app would see 
*all* requests ?  I beleived that requests were being dispatched based 
on the url-mapping's of the servlets, and if they did not match any, 
then to the default servlet.


If the above is explained somewhere, can you point me to it ?
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]



Newbie question about log config with JSF

2008-08-11 Thread Brian Parkinson
Hello - hoping someone can help with a (dumb?) easy log config question.

I am using Tomcat 6.0.16 with JSF 1.2.9 (Mojarra) - everything is
working pretty cool, but I am getting one SEVERE exception being thrown
from JSF, which appears in the logs:

SEVERE: JSF1054: (Phase ID: RENDER_RESPONSE 6, View ID:
/secure/ecobee4.jsp) Exception thrown during phase execution:
javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImp
[EMAIL PROTECTED]

Unfortunately, I have no stack trace information in the logs for this,
which I need to help track this down.

So, I tried changing the log levels for the file and console loggers to
FINEST:

1catalina.org.apache.juli.FileHandler.level = FINEST
java.util.logging.ConsoleHandler.level = FINEST

but this didn't do the trick.

The stderr_20080811.log and stdout_20080811.log files are empty.

If anyone can point out the changes needed to log the full stack trace,
it would be heartily welcomed - I'm a little stumped.

Many thanks.

Brian Parkinson
Avaning Inc.

--- x8 snip

conf: cat logging.properties
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version
2.0
# (the License); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an AS IS BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied.
# See the License for the specific language governing permissions and
# limitations under the License.

handlers = 1catalina.org.apache.juli.FileHandler,
2localhost.org.apache.juli.FileHandler,
3manager.org.apache.juli.FileHandler, 4admin.org.a
pache.juli.FileHandler, 5host-manager.org.apache.juli.FileHandler,
java.util.logging.ConsoleHandler

.handlers = 1catalina.org.apache.juli.FileHandler,
java.util.logging.ConsoleHandler


# Handler specific properties.
# Describes specific configuration info for Handlers.


1catalina.org.apache.juli.FileHandler.level = FINEST
1catalina.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
1catalina.org.apache.juli.FileHandler.prefix = catalina.

2localhost.org.apache.juli.FileHandler.level = FINE
2localhost.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
2localhost.org.apache.juli.FileHandler.prefix = localhost.

3manager.org.apache.juli.FileHandler.level = FINE
3manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
3manager.org.apache.juli.FileHandler.prefix = manager.

4admin.org.apache.juli.FileHandler.level = FINE
4admin.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
4admin.org.apache.juli.FileHandler.prefix = admin.

5host-manager.org.apache.juli.FileHandler.level = FINE
5host-manager.org.apache.juli.FileHandler.directory =
${catalina.base}/logs
5host-manager.org.apache.juli.FileHandler.prefix = host-manager.

java.util.logging.ConsoleHandler.level = FINEST
java.util.logging.ConsoleHandler.formatter =
java.util.logging.SimpleFormatter



# Facility specific properties.
# Provides extra control for each logger.


org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level =
INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers =
2localhost.org.apache.juli.FileHandler

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager]
.level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager]
.handlers = 3manager.org.apache.juli.FileHandler

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/admin].l
evel = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/admin].h
andlers = 4admin.org.apache.juli.FileHandler

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-man
ager].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-man
ager].handlers = 5host-manager.org.apache.juli.FileHandler

# For example, set the com.xyz.foo logger to only log SEVERE
# messages:
#org.apache.catalina.startup.ContextConfig.level = FINE
#org.apache.catalina.startup.HostConfig.level = FINE
#org.apache.catalina.session.ManagerBase.level = FINE
#org.apache.catalina.core.AprLifecycleListener.level=FINE
conf:

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



RE: how to make context path case insensitive

2008-08-11 Thread Caldarale, Charles R
 From: André Warnier [mailto:[EMAIL PROTECTED]
 Subject: Re: how to make context path case insensitive

 Do you mean that all requests go first through the ROOT app, no matter
 what ? and that thus a servlet filter placed in the ROOT app would see
 *all* requests ?

No, just requests that do not match known context paths.  If a request uses the 
properly-cased path, it will be delivered directly to that context, and that 
context's servlet mapping will apply.  The filter in ROOT kicks in when no 
other context matches.

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



Possible hack tool kit on tomcat 6.0.16

2008-08-11 Thread Mehrotra, Anurag
I just came across 2 war files within tomcat6.0/webapps folder:

fexcep.war and safe2.war. Both applications were deployed.

I was watching the thread Possible virus uploaded to Tomcat 5.5.3 very
closely so the presence of these files alerted me.

Like the original thread nobody has access to the server except through vpn
and port 80/443 (Apache httpd is handing all traffic with mod_jk)

Versions: apache http 2.0.59
   mod_ssl 2.0.59
   Openssl 0.9.7
   mod_jk 1.2.26
   tomcat 6.0.16

OS  Windows 2003

I am attaching one of the war files here: fexcep.war

I have verified that my server.xml and web.xml were not tampered with
(original date/timestamp as when I installed mod_jk).

Could there be some kind of backdoor entry happening in the code.

Thanks,

 fexcep.war 

Anurag  301-296-3838

The information contained in this message may be privileged and confidential
and protected from disclosure.  If the reader of this message is not the
intended recipient, or an employee or agent responsible for delivering this
message to the intended recipient, you are hereby notified that any
dissemination, distribution or copying of this communication is strictly
prohibited. If you have received this communication in error, please notify
us immediately by replying to the message and deleting it from your
computer.


-
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: Strange startorder of webapps

2008-08-11 Thread Mark H. Wood
In particular, Unix code to walk a directory may return file names in
any order.  You don't often see this behavior because 'ls' typically
sorts its output unless you ask it not to.  OTOH I believe that
Windows keeps its directories sorted and will always produce file
names in lexical order.

-- 
Mark H. Wood, Lead System Programmer   [EMAIL PROTECTED]
Typically when a software vendor says that a product is intuitive he
means the exact opposite.



pgpwKSCP0nZKD.pgp
Description: PGP signature


Re: DefaultServlet doesn't set charset

2008-08-11 Thread Markus Schönhaber
Christopher Schultz wrote:

 Have you rigged the servlet to add a static charset defined in, say,
 web.xml or something like that?

In a way, yes. DefaultServlet already uses the value of the fileEncoding
init-param, if set, as encoding when reading static content from disk.
So, if fileEncoding is explicitly set in web.xml, I also use it's value
for the charset info in the response header.

 Is there any logic to guess the actual
 charset?

Depends on what charset you mean.
- The charset of a file on disk? Then no, I haven't touched the code for
reading files from disk - and I don't intend to.
- The charset added to the Content-Type response header? Then yes. If
fileEncoding (see above) is not set, the value from
java.nio.charset.Charset.defaultCharset().name()
is used.
BTW: this is OK for Tomcat 6. But if anyone was interested to port this
to an older version of Tomcat which is supposed to be able to run
pre-1.5 JVMs, he should keep in mind that this has to be changed. For
example into something like
(new OutputStreamWriter(new ByteArrayOutputStream())).getEncoding()

 Are you actually setting the character set of the response's
 Writer?

No. But a good point!
As I understand it, DefaultServlet always tries to use the
ServletOutputStream. Only if response.getOuptuStream() fails with an ISE
and the media type is text/* or *xml, it tries to use the Response
object's PrintWriter. So, if the latter is the case and something other
than the platform default encoding should be used, it might be sensible
to set the encoding for the writer.
I have to think about this some more - especially about a real world
example that triggers this.

 I'd love to take a look at your patch.

No problem. You can get it here:
http://www.ddt-consult.de/sendCharset.patch

 I would definitely add some tests to verify correct behavior when the
 charset is set to something that is not sane (like ).

Hm, yes, one could add a sanity check. But I'd expect people who set
fileEncoding explicitly to not only know what they're doing but to also
check if what they did actually works.

Thanks for your input, Chris.

Regards
  mks

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



Re: how to make context path case insensitive

2008-08-11 Thread Christopher Schultz

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

André,

André Warnier wrote:
| Christopher Schultz wrote:
|
| Oh, that's a MUCH better idea than mine (to deploy all combinations of
| case as redirector apps). The trick is that you must deploy this filter
| into the ROOT application specifically.
|
| Do you mean that all requests go first through the ROOT app, no matter
| what?

No. Requests that do not match any /other/ context are mapped to the
ROOT context. That's what allows this seeming magic to work.

| I beleived that requests were being dispatched based
| on the url-mapping's of the servlets, and if they did not match any,
| then to the default servlet.

You are confusing selection of the context (which chooses a webapp from
all those deployed) with selection of the servlet to run (which chooses
a servlet to run from those configured in the context of the webapp that
was chosen).

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

iEYEARECAAYFAkigcfsACgkQ9CaO5/Lv0PA6hgCfclnjGbswFUpGSPRQmWbchZVj
G7YAoLIvriysnfFeSdc9H5DRlMI2pE2H
=kInv
-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]



Re: concurrent JkMount entries? Order relevant?

2008-08-11 Thread Christopher Schultz

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Stephanie,

Stephanie Wullbieter wrote:
| Hi, what to do when I want generally mount a context and it's
| subdirectories with mod_jk to one worker/router, but a special
| subdirectory of it to a different worker/router?
|
| Does this work in mod_jk.conf?
|
| JkMount /app/web/indexer   worker42
| JkMount /app/web/indexer/* worker42
|
| JkMount /app   routerInt4
| JkMount /app/* routerInt4

This is pure speculation, but I would put your generic stuff first and
then add more-specific rules afterward.

This should be easy to test empirically.

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

iEYEARECAAYFAkigeRkACgkQ9CaO5/Lv0PBxnwCfcurgQhh16luTUem26aMxbfY4
EckAoKUS6LgQLCGHeHj2RkvGM8Lvrl96
=Grma
-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]



Re: Possible hack tool kit on tomcat 6.0.16

2008-08-11 Thread Mark Thomas

Mehrotra, Anurag wrote:

Could there be some kind of backdoor entry happening in the code.


Unlikely. This is the sixth report like this I have seen. So far, we have 
got to the bottom of two and in both cases the manager app was the route in.


Whilst a Tomcat flaw is possible (and check out CVE-2008-2938 in case it 
applies to you - I just added it to http://tomcat.apache.org/security-6.html)


These events should be causing everyone to:
a) review their security settings carefully
b) make sure they have a plan as to how to react if a vulnerability looks 
like it is going to affect them.


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]



Re: Re-opening the browser

2008-08-11 Thread Mark Thomas

Christopher Schultz wrote:

Tokajac,

Tokajac wrote:
| But when i submit the (activated) username and password, i got the
| 
--

| HTTP Status 408 - The time allowed for the login process has been
exceeded.
| If you wish to continue you must either click back twice and re-click the
| link you requested or close and re-open your browser

This is probably because you went directly to the form login page, and
you are using Tomcat's built-in container-managed authentication and
authorization.

Instead of sending the user directly to the login-page, try sending them
to a protected URL (like /myApp/someProtectedPage). This will cause
Tomcat to display the login page itself (which is actually required),
and then the login should work.

| What's wrong here? Is it something about sessions/cookies? How should i
| solve this?

Technically, the 408 is probably because of the timing of your testing.
If you waited like 1 hour between requests, you'd get a different error
like unexpected login at this time or a 404 because j_security_check
isn't a valid URL unless the container is expecting it. It's a bit odd,
but the servlet specification does not allow for drive-by logins, and
so Tomcat does not implement them.


If you go directly to the login page Tomcat can't tell the difference 
between that situation and when you go to a protected page, are redirected 
to the login page and then take so long to log in the session times out 
(the page you need to be sent back to is stored in the session). The error 
message assumes that the session has timed out.


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]



Re: Re-opening the browser

2008-08-11 Thread Christopher Schultz

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Mark,

Mark Thomas wrote:
| If you go directly to the login page Tomcat can't tell the difference
| between that situation and when you go to a protected page, are
| redirected to the login page and then take so long to log in the session
| times out (the page you need to be sent back to is stored in the
| session). The error message assumes that the session has timed out.

Okay, so the Tomcat response is (expectedly) consistent. Thanks for
stepping-in.

Just out of curiosity, why does Tomcat not support drive-by logins? Is
it merely because the spec leaves the behavior in that case ambiguous
(there's no obvious target page to go to)? Many of securityfilter's
users use it merely because it allows drive-by logins. We're happy to
have them (!), but this seems like a reasonable feature to have in the
core of Tomcat.

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

iEYEARECAAYFAkigofcACgkQ9CaO5/Lv0PABBACeJDKRQss25b9pd7l5zbpSHO+2
fdUAn2rZ6uCUfWZ+5CEshnCzamREcXBQ
=GDVs
-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]



Load order for Global Resources

2008-08-11 Thread Dave Bender
Is the order that Tomcat 6.0.x loads/instantiates Custom Resources
definable?  If so, how? If not, is there a way to ensure that one custom
resource is loaded prior to another one? 
 
Tomcat 4.x seemed to have the behavior that custom resources were created in
the order they appear in the server.xml file.  I'm migrating an application
that appears to have a dependency on that order of loading.  It runs fine in
Tomcat 4.0 (and Sun Web server 6.x), but it's failing to load in Tomcat 6.0.
It throws an error where one custom resource object refers to another that's
available via JNDI but that item hasn't been loaded yet.
 
Dave
 
 
 


Re: Re-opening the browser

2008-08-11 Thread Mark Thomas

Christopher Schultz wrote:

Mark,

Mark Thomas wrote:
| If you go directly to the login page Tomcat can't tell the difference
| between that situation and when you go to a protected page, are
| redirected to the login page and then take so long to log in the session
| times out (the page you need to be sent back to is stored in the
| session). The error message assumes that the session has timed out.

Okay, so the Tomcat response is (expectedly) consistent. Thanks for
stepping-in.

Just out of curiosity, why does Tomcat not support drive-by logins? Is
it merely because the spec leaves the behavior in that case ambiguous
(there's no obvious target page to go to)?
Essentially, yes. Also, there is no spec compliant way to define where to 
go if login is successful. If this was added then to be consistent the 
default target page would probably need to be defined in the Form Auth 
valve in a context.xml.



Many of securityfilter's
users use it merely because it allows drive-by logins. We're happy to
have them (!), but this seems like a reasonable feature to have in the
core of Tomcat.
Given there is a demand for this, adding it as an option to the Form Auth 
valve seems reasonable to me. As ever, patches are always welcome on 
Bugzilla and this looks like a simple one although care will need to be 
taken on the error handling.


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]



Re: Load order for Global Resources

2008-08-11 Thread Mark Thomas

Dave Bender wrote:

Is the order that Tomcat 6.0.x loads/instantiates Custom Resources
definable?

I am afraid not.


If so, how? If not, is there a way to ensure that one custom
resource is loaded prior to another one?

Not that I am aware of.

I think the order is going to be be defined by the order in which the xml 
parser returns them.


Is there any way you can modify the code the the resource with the 
dependency to work around this?


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]



Clustering failing over with Tomcat 6.0.16

2008-08-11 Thread Gupta, Sharad
Hi,
 
I have a cluster of Tomcat 6.0.16 using DeltaManager. Session
replication works fine, failover works fine for the first time. That is,
the first time I failover from, lets say, nodeA to nodeB, my session is
carried over  the user continues with the existing logged in session
without being asked to log back in. 
 
But the problem happens when nodeA comes backup  nodeB needs to be
shutdown. The session information is somehow, not carried over as my app
asks me to relogin at that point in time. Is this a desired behaviour
with DeltaManager?
 
Thanks
 
 
 
 
 


RE: Load order for Global Resources

2008-08-11 Thread Dave Bender
Thanks.  Some replies:

 I think the order is going to be be defined by the order in which the xml
parser returns them.
Has there been any change to the parser from version 4.x to version 6.x?  If
so, maybe that'll explain the problem.  If not, in theory, we should be
getting the same order of loading...in which case something else might be in
play.


 Is there any way you can modify the code the the resource with the
dependency to work around this?
My mind is starting to go there.  But the first task is to migrate this to
the current version of Tomcat and I'd like to avoid any coding changes
unless it is clear they need to be made.  This issue is still a mystery.  



Dave



 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Mark Thomas
Sent: Monday, August 11, 2008 3:57 PM
To: Tomcat Users List
Subject: Re: Load order for Global Resources

Dave Bender wrote:
 Is the order that Tomcat 6.0.x loads/instantiates Custom Resources 
 definable?
I am afraid not.

 If so, how? If not, is there a way to ensure that one custom resource 
 is loaded prior to another one?
Not that I am aware of.

I think the order is going to be be defined by the order in which the xml
parser returns them.

Is there any way you can modify the code the the resource with the
dependency to work around this?

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]



redirecting stdout stderr to .exe on windows

2008-08-11 Thread De Vries, Richard
Hello everyone, long time reader, first time writer here 

 

I have the need to redirect stdout and stderr from a Tomcat 5.5 instance
on a windows server to an executable. When I go into the Apache Tomcat
Properties management console - logging - I can change stdout and
stderr from auto to any given file; but it does not seem to work with
executables.

 

For instance, I changed stdout from auto to |
c:\progra~1\logger\logger.exe, but this yields a no-go :-(. Checking
the task manager I also don't see logger.exe running.

 

Does anyone have any suggestions? Thanks!

 

 - R.



Re: Load order for Global Resources

2008-08-11 Thread Mark Thomas

Dave Bender wrote:

Thanks.  Some replies:


I think the order is going to be be defined by the order in which the xml

parser returns them.
Has there been any change to the parser from version 4.x to version 6.x?  If
so, maybe that'll explain the problem.  If not, in theory, we should be
getting the same order of loading...in which case something else might be in
play.


Xerces 2.9.1 in 4.1.37, the JDK (Xerces based?) in 6.0.x

See 
http://svn.apache.org/viewvc/tomcat/container/tags/tc4.1.x/TOMCAT_4_1_37/build.properties.default?view=markup 
for which version of Xerces was used. Similar urls can be used for any TC4 
release.


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]



Re: Tomcat within Eclipse

2008-08-11 Thread Steve Ochani
Date sent:  Mon, 11 Aug 2008 15:50:56 +0200
From:   Johnny Kewl [EMAIL PROTECTED]
Subject:Re: Tomcat within Eclipse
To: Tomcat Users List users@tomcat.apache.org
Send reply to:  Tomcat Users List users@tomcat.apache.org

 
 Oh no... I think for some reason the bin scripts are missing in TC
 6
 

I'm using the zip version of 6.0.18 on my dev. machine and it comes with 
startup.sh/.bat and 
shutdown.sh/.bat, they are located in the bin directory.



 Listen SAM... just for now... go get
 
 apache-tomcat-5.5.25.zip
 and
 apache-tomcat-5.5.25.exe
 
 Here
 
 http://archive.apache.org/dist/tomcat/tomcat-5/v5.5.25/bin/apache-tomc
 at-5.5.25.zip
 http://archive.apache.org/dist/tomcat/tomcat-5/v5.5.25/bin/apache-tomc
 at-5.5.25.exe
 
 Install the EXE if you on XP
 
 I know you not going to have issues there with TC...
 And its very likely that any older plugins in Eclipse will be happy
 with it...
 
 TC6 is still quite new... get that going then later play with TC 6...
 
 Then... if you still having problems... tell me what plugin you using
 in eclipse, and I'll get the thing and try it...
 
 I think you stumbling into little problems that are screwing you
 
 And I got to tell you that if an IDE needs to actually know where TC's
 server.xml file is... its crap. Forget about the UserDatabase error
 you getting... you getting it because the IDE and TC are not playing
 nicely.
 
 You should be doing little more than just telling the IDE where TC
 is...
 
 BUT if that plugin is old... it will not do TC 6
 I think you getting smacked around and its unfortunate because it
 actually is the easiest thing in the world to do...
 
 If you dont care what IDE you use then also look at NetBeans...
 Thats just a run setup thing and you done!... its good as well... it
 has a wizard to setup tomcat.
 
 Good luck
 
 
 - Original Message - 
 From: Sam Wun [EMAIL PROTECTED]
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Monday, August 11, 2008 3:05 PM
 Subject: Re: Tomcat within Eclipse
 
 
  Hi,
 
  I have the server.xml path defined in Eclipse (3.4):
  C:\Program Files\Apache Software Foundation\Tomcat 6.0
  Where is the startup.bat file? I can't find this batch file.
 
  Thanks
 
 
  On Mon, Aug 11, 2008 at 3:27 PM, Johnny Kewl [EMAIL PROTECTED]
  wrote:
 
  - Original Message - From: Sam Wun [EMAIL PROTECTED]
  To: Tomcat Users List users@tomcat.apache.org Sent: Monday,
  August 11, 2008 6:57 AM Subject: Tomcat within Eclipse
 
 
  Hi,
 
  Can anyone tell me how to resolve the followoing exception?
  and how do I know whether tomcat service is really running.
 
  11/08/2008 14:47:47 org.apache.catalina.core.AprLifecycleListener
  init INFO: The APR based Apache Tomcat Native library which allows
  optimal performance in production environments was not found on
  the java.library.path: C:\Program
 
  Files\Java\jre1.6.0_07\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\sy
  stem32;C:\Windows;C:/Program Files/Java/jre6/bin/client;C:/Program
 
  Files/Java/jre6/bin;C:\Windows\system32;C:\Windows;C:\Windows\Syst
  em32\Wbem;d:\ant171\bin;D:\apache-maven-2.0.9\bin;C:\Program
  Files\Nmap 11/08/2008 14:47:47
  org.apache.coyote.http11.Http11Protocol init INFO: Initializing
  Coyote HTTP/1.1 on http-8080 11/08/2008 14:47:47
  org.apache.catalina.startup.Catalina load INFO: Initialization
  processed in 502 ms 11/08/2008 14:47:47
  org.apache.naming.NamingContext lookup WARNING: Unexpected
  exception resolving reference java.io.IOException: Cannot rename
  original file to C:\Program Files\Apache Software
  Foundation\Tomcat 6.0\conf\tomcat-users.xml.old at
  org.apache.catalina.users.MemoryUserDatabase.save(MemoryUserDataba
  se.java:582) at
  org.apache.catalina.users.MemoryUserDatabaseFactory.getObjectInsta
  nce(MemoryUserDatabaseFactory.java:104) at
  org.apache.naming.factory.ResourceFactory.getObjectInstance(Resour
  ceFactory.java:140) at
  javax.naming.spi.NamingManager.getObjectInstance(Unknown Source)
  at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
  at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
  at
  org.apache.naming.NamingContextBindingsEnumeration.nextElementInte
  rnal(NamingContextBindingsEnumeration.java:113) at
  org.apache.naming.NamingContextBindingsEnumeration.next(NamingCont
  extBindingsEnumeration.java:71) at
  org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.create
  MBeans(GlobalResourcesLifecycleListener.java:137) at
  org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.create
  MBeans(GlobalResourcesLifecycleListener.java:109) at
  org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.lifecy
  cleEvent(GlobalResourcesLifecycleListener.java:81) at
  org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifec
  ycleSupport.java:117) at
  org.apache.catalina.core.StandardServer.start(StandardServer.java:
  703) at
  

Re: Would like to monitor memory use offline

2008-08-11 Thread Richard S. Huntrods

Richard,

Richard S. Huntrods wrote:
| Richard,
|
| Richard S. Huntrods wrote:
| |public static Vector listLookup(String table) {
| | //Connection connection = null; // connection is managed 
by a

| | connection pool
|
| So, is 'connection' a local or not?
| It's part of my code (I use my own connection pool class) but not to 
the

| DBMS code. Only if you can't get a connection from the pool
| (connection==null) do you create a local one for this method.
|
| If the connection from the pool is OK, you use it then release it back
| to the pool. If it's local (because you could not get one from the 
pool)

| then you close it in the finally block.

I think you are misunderstanding me: I'm asking if you are using a
shared java.sql.Connection reference among all threads running your db
code. If you are, then you've got a big problem, which could explain
some of the memory leaks you are seeing. If you have a class-level
reference like this:

public class MyDBMSMethods
{
~  private Connection connection;

~  public List getMyRecords()
~  {
~ connection = getConnectionFromPool();

~ ...
~  }
}

... then you should expect lots of problems. From your posted code, it
looks like this is what you are doing.

All connection references should be strictly local to each method. Each
method should get its own connection from the connection pool, use it,
and return it to the pool (unless you accept the connection as a
parameter to the method, in which case, you should use it).


Everything is local except the pooled connections, so I would say this 
is the problem. This code was originally written before tomcat had good 
connection pools, and so I had to write my own. The pool is basically a 
vector of connections.


At a more fundamental level, I still don't think the new connector is 
working correctly (and I've read many of the forum discussions about 
this...). If I close the resultset AND the statement, then the connector 
should release all the objects created by those two. The connection is, 
after all, just a pipe between the database and the java code. The 
connector should not (IMO) be hanging on to statement or resultset 
objects just because the connection is still in existance.





| You need to have statement.close() and resultSet.close() in here 
(in the

| finally block), not up above. Also, most database connection pools
| require that you call connection.close() to return the connection 
to the

| pool. Are you ever calling connection.close()?
|
| Um, sorry to disagree, but that is not really correct and also does not
| touch my problem.

Not closing your resources in a finally block it surely /not/ correct,
and you /can/ leak resources in this way. Which part of my statement is
not correct?

Yea - looked further and I have seen try/catch blocks in finally code.

Still - this is most clearly NOT my problem as I can verify my code is 
working normally (i.e. no exceptions happening) and thus properly 
closing both the resultset and the statement.


For fun I put try-catch blocks with additional resultset and statemtent 
calls to close in the finally block and it made no difference to the 
memory leak.




| I am already closing the resultSet and statement in the normal
| execution part of my code. At no time during the execution of this 
code

| in these tests was an exception thrown in this method

It doesn't matter. If you do not close your resources in a finally
block, they are not guaranteed to be closed. It might not be your
current problem, but it could be your future problem.
I will not disagree with this. That's why the finally is there in the 
first place.




| so *I was now
| correctly closing the statement and resultSet. YET IN SPITE OF THIS the
| versions of the connector after 3.1.10 FAIL to release the Field 
objects.

|
| The other reason NOT to put close() in the fianlly block is that the
| close() methods can throw and exception.

That's why you wrap the call to close() in its own try/catch block.

| It is very bad programming
| practice to put exception throwing code' in a finally block. Sure, you
| could use another try-catch structure for the close() statements, but
| really - you should have already closed the stuff in the normal
| execution (as I did).

If you say so. My code doesn't leak DB resources, and it is written in
this way.

| I did state one thing in error - the finally block (of course) ALWAYS
| gets called, so you only want code in that block that must be done 
after

| all else has happened, but you also don't really want to be repeating
| code that should go elsewhere (like the close()).
|
|
| Also, which connection pool do you use?
|
| My own.

Is there a compelling reason not to use one of the freely-available,
well-supported connection pools available? Tomcat even has one already
built into it.

Yea - the code was developed a long while ago. There's also a single 
version that can run under Tomcat or as offline processes and I don't 
want to 

Tomcat v4.1 - Resource not found 500 Error - Help!

2008-08-11 Thread cfrankland

Hi,

I am a bit new to Tomcat, but have a really quick question. I am trying to
deploy a new single class file to an existing Tomcat 4.1 web application,
however, I am using Rational Application Developer 7.0 to create and compile
the class. When I deploy the new class to the Tomcat 4.1 web application,
the page crashes with a 500 error Resource not found.

What could be causing this error? When I put the old class back in
everything works ok. I have even tried using identical code, so I know it
isn't a coding issue. Could it be the JRE being used to compile the class is
the wrong type?

Any help would be much appreciated!

Thanks :) 
-- 
View this message in context: 
http://www.nabble.com/Tomcat-v4.1---Resource-not-found-500-Error---Help%21-tp18936624p18936624.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]



Tomcat 5.5 4.1 Security Release

2008-08-11 Thread David Rees
I posted a couple messages to the user/dev lists last week asking the
same question, but still haven't seen any mention of a plan to release
a new 5.5.x or 4.1.x to fix the security issues posted at the
beginning of the month.

Is there a plan to push a new release for either 5.5.x or 4.1.x or
should end users assume that we're on our own regarding these two
versions and we should either patch/build them ourselves or upgrade to
6.0.x which does appear to be maintained?

It appears that both branches already have all the required security
patches applied to them so I don't see what the hold up is here. Are
there other changes applied to the branches which need to be tested?
I'm more than happy to help with testing where I can.

Thanks,

-Dave

-
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: concurrent JkMount entries? Order relevant?

2008-08-11 Thread Bill Barker
Stephanie Wullbieter [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Hi, what to do when I want generally mount a context and it's 
 subdirectories with mod_jk to one worker/router, but a special 
 subdirectory of it to a different worker/router?

 Does this work in mod_jk.conf?

 JkMount /app/web/indexer   worker42
 JkMount /app/web/indexer/* worker42

 JkMount /app   routerInt4
 JkMount /app/* routerInt4


 Do I have to write the special contextes first, so that only when they do 
 not match, the general mount option is used?

 Thank You very mutch.



The order in mod_jk.conf doesn't matter.  mod_jk will choose the most 
specific match reguardless of the order in the file.
So the short answer is:  yes the above should work.
 -- 
 Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
 Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

 -
 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: Clustering failing over with Tomcat 6.0.16

2008-08-11 Thread Filip Hanik - Dev Lists

nope, it should work both ways

Gupta, Sharad wrote:

Hi,
 
I have a cluster of Tomcat 6.0.16 using DeltaManager. Session

replication works fine, failover works fine for the first time. That is,
the first time I failover from, lets say, nodeA to nodeB, my session is
carried over  the user continues with the existing logged in session
without being asked to log back in. 
 
But the problem happens when nodeA comes backup  nodeB needs to be

shutdown. The session information is somehow, not carried over as my app
asks me to relogin at that point in time. Is this a desired behaviour
with DeltaManager?
 
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]