Re: Multi processor issue

2006-12-21 Thread Christopher Schultz
Gael,

Marziou, Gael wrote:
>> I don't think this is a bug in TC's implementation. This is a 
>> relatively subtle mistake that seems both easy enough to make 
>> and easy to fix.
> 
> Maybe Tomcat should enforce this like for instance when we get an
> exception trying to write into a response that was already committed.
> It would have saved weeks of effort on our side.

Can you suggest a fix? I'm not sure how this kind of thing could be
safely veto'd... for instance, it might actually be appropriate for a
RequestDispatcher to be re-used in some context (say, repeating a
request twice) or even to do so with different threads, as long as the
access is done strictly serially.

> We did implement this 2 years ago, so details have vanished but it was
> mainly based on our spec interpretation and also I admit on premature
> optimization.

No problem. I'm pretty sure we're all guilty of that some of the time.

> In several places, the spec defines different behaviors of
> RequestDispatcher when it was obtained using getNamedDispatcher(String)
> and noticeably for handling parameters.
> So, our interpretation was that a RequestDispatcher obtained using
> getNamedDispatcher() was different than one obtained using
> getRequestDispatcher(): it has a different behavior and a wider scope.

Agreed... the "spirit" of the "named dispatcher" as opposed to a
standard dispatcher obtained for a certain URI seems to be that it could
be used universally.

> This was the reason behind our implementation and also the fact that our
> previous container (before migrating to Tomcat) seemed to work this way
> (as far as I remember).

Perhaps TC should consider returning an object of a different type when
using getNamedDispatcher -- one that does not keep any request-related
information at all.

>> I'd really like to hear if simply eliminating the caching of 
>> this object fixes your problem. Does it?
> 
> So far so good, the new code has been running fine for 2 hours while it
> was failing usually within 30 minutes.

Fantastic! I'm glad we were able to help, even if it did take a while.

-chris



signature.asc
Description: OpenPGP digital signature


RE: Re-executing a servlet request

2006-12-21 Thread Caldarale, Charles R
> From: David Smith [mailto:[EMAIL PROTECTED] 
> Subject: Re: Re-executing a servlet request
> 
> 2. With sessions -- the original params are stored in the
> session and page 1 uses them in the absence of form params
> -- ie when completing the process.

Have to be careful with storing data in sessions.  If the client has
multiple browser windows or tabs open to the same webapp, they will
likely be sharing the session object.

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



Re: Re-executing a servlet request

2006-12-21 Thread David Smith
So you want to effectively save the parameters from the original request 
to page 1 and then use them when you come back to page 1.  I can see two 
options:


1. Sessionless -- each page propogates the original params as hidden 
fields until you return to page 1 where it makes use of them.
2. With sessions -- the original params are stored in the session and 
page 1 uses them in the absence of form params -- ie when completing the 
process.


--David

David Kerber wrote:

Ok, I'll try:

My app is started with a .jsp.  On it the user enters a location ID.  
When they click the submit button, it sends the request to a servlet 
(call it page 1)  which brings up information from a database about 
that location, and gives them the option to make changes to the 
information for the location, stepping through 3 more pages, all from 
servlets.  After the last page is done, I want to return to the first 
servlet page (page 1) with the same request parameters as it was 
originally requested with, so that the site information is 
re-requested from the database, and they will then see the same site, 
but with the data changed to reflect what they just entered.


All of this works right now, except that I haven't figured out how to 
return to servlet page 1 with the same request parameters it had the 
first time, *as if* it had been requested from the jsp, but without 
them needing to re-enter the location ID and clicking on the submit 
button again.  How can I do that?


Thanks for any suggestions!
Dave


Hassan Schroeder wrote:


On 12/21/06, David Kerber <[EMAIL PROTECTED]> wrote:


Nobody has a suggestion about this?



Sure. I suggest you rephrase what you're actually trying to accomplish,
because the original made utterly no sense to me :-)

FWIW,





-
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: Helping setting appropriate prefix when using ServletContext.getResourceAsStream()

2006-12-21 Thread Caldarale, Charles R
> From: James Dekker [mailto:[EMAIL PROTECTED] 
> Subject: Helping setting appropriate prefix when using 
> ServletContext.getResourceAsStream()

Where to begin...

> // String prefix = getServletContext().getRealPath("/");

You apparently already figured out the above was a bad idea, as is any
direct I/O request from inside a webapp.  When your webapp is deployed
as a .war, it has no access to the structure inside the .war file other
than via the classloader (which includes the getResourceAsStream() API).
Consequently, much of the rest of your code in the servlet is
inappropriate.

As far as where to place log4j.properties, the Tomcat doc states:

"You would place a similar log4j.properties file in your web
application's WEB-INF/classes folder, and log4j1.2.8.jar into
WEB-INF/lib. Then specify your package level logging."

See:
http://tomcat.apache.org/tomcat-5.5-doc/logging.html
for more info.

> 
>   MySampleAppServlet
>   /app
> 

Note that the above will allow only the URI
http[s]://host[:port]/myapp/app to reach your servlet.  If you want all
requests for the myapp context to be processed by your servlet, change
the url-pattern to just "/" (without the quotes).

>WEB-INF\log4j.properties

>WEB-INF\attributes-config.xml

Use forward slashes in the config files, even on Windows.

> Dec 21, 2006 4:53:16 PM
> org.apache.catalina.loader.WebappClassLoader.validateJarFile
> INFO: 
> validateJarFile(C:\DevTools\tomcat\jakarta-tomcat-5.5.9\webapps\
> affiliates\WEB-INF\lib\servlet-api.jar)
> - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending
> class: javax/servlet/Servlet.class

Don't put servlet-api.jar into any of your webapps, since Tomcat already
supplies it in common/lib.  No class should ever appear in more than one
place in any given branch of the classloader tree:

  Bootstrap
  |
   System
  |
   Common
  /  \
 Catalina   Shared
 /   \
Webapp1  Webapp2 ... 

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



Re: Re-executing a servlet request

2006-12-21 Thread David Kerber

Ok, I'll try:

My app is started with a .jsp.  On it the user enters a location ID.  
When they click the submit button, it sends the request to a servlet 
(call it page 1)  which brings up information from a database about that 
location, and gives them the option to make changes to the information 
for the location, stepping through 3 more pages, all from servlets.  
After the last page is done, I want to return to the first servlet page 
(page 1) with the same request parameters as it was originally requested 
with, so that the site information is re-requested from the database, 
and they will then see the same site, but with the data changed to 
reflect what they just entered.


All of this works right now, except that I haven't figured out how to 
return to servlet page 1 with the same request parameters it had the 
first time, *as if* it had been requested from the jsp, but without them 
needing to re-enter the location ID and clicking on the submit button 
again.  How can I do that?


Thanks for any suggestions!
Dave


Hassan Schroeder wrote:


On 12/21/06, David Kerber <[EMAIL PROTECTED]> wrote:


Nobody has a suggestion about this?



Sure. I suggest you rephrase what you're actually trying to accomplish,
because the original made utterly no sense to me :-)

FWIW,





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



Helping setting appropriate prefix when using ServletContext.getResourceAsStream()

2006-12-21 Thread James Dekker

Hello there,

I am using JDK 1.5 & Tomcat 5.5.9 on WinXP...

Set up my init servlet which is supposed to load my log4j.properties
file from myapp/WEB-INF/log4j.properties.

Here's my init servlet's source listing:
--

package com.acme.logging;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

import org.apache.log4j.PropertyConfigurator;

public class Log4jInitServlet extends HttpServlet {
public void init() throws ServletException  {
   // String prefix = getServletContext().getRealPath("/");
Properties  p  = new Properties();
String prefix = "./";
String file = getInitParameter("log4j-init-file");
File propFile = new File(prefix+file);
System.out.println("propFile path is: " + propFile);
try {
InputStream is = 
getServletContext().getResourceAsStream("propFile");

if(!propFile.exists()){
System.out.println("log4j.properties not found, " +
propFile.getAbsolutePath());
}
p.load(is);
is.close();
} catch(IOException e) {
e.printStackTrace();
}
   PropertyConfigurator.configureAndWatch(propFile.getAbsolutePath(),1);
   }
}

Here's my web.xml file:

--
http://java.sun.com/dtd/web-app_2_3.dtd";>



   MySampleApp
   
   MySampleApp
   

   
 MySampleAppServlet
 com.acme.MySampleAppServlet
   

   
 MySampleAppServlet
 /app
   

   
  log4j-init
  com.acme.logging.Log4jInitServlet
  
  log4j-init-file
  WEB-INF\log4j.properties
  
  1


  
  xml-config-init
  com.acme.config.XmlConfigInitServlet
  
  xml-config-file
  WEB-INF\attributes-config.xml
  
  2
  


--

Now, when I deploy my app and run Tomcat this is what it says in the Console:

--
Dec 21, 2006 4:53:14 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Dec 21, 2006 4:53:14 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 847 ms
Dec 21, 2006 4:53:14 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Dec 21, 2006 4:53:14 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.9
Dec 21, 2006 4:53:14 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Dec 21, 2006 4:53:15 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive affiliates.war
Dec 21, 2006 4:53:16 PM org.apache.catalina.loader.WebappClassLoader
validateJarFile
INFO: 
validateJarFile(C:\DevTools\tomcat\jakarta-tomcat-5.5.9\webapps\affiliates\WEB-INF\lib\servlet-api.jar)
- jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending
class: javax/servlet/Servlet.class
log4j:WARN No appenders could be found for logger
(org.apache.catalina.session.ManagerBase).
log4j:WARN Please initialize the log4j system properly.
propFile path is: .\WEB-INF\log4j.properties
log4j.properties not found,
C:\DevTools\tomcat\jakarta-tomcat-5.5.9\bin\.\WEB-INF\log4j.properties
Dec 21, 2006 4:53:18 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 3778 ms

--

How should I set the prefix in my Log4jInitServlet to point to:

%CATALINA_HOME%/webapps/mywebapp/

Thank you so much!

-JD

-
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-executing a servlet request

2006-12-21 Thread Hassan Schroeder

On 12/21/06, David Kerber <[EMAIL PROTECTED]> wrote:

Nobody has a suggestion about this?


Sure. I suggest you rephrase what you're actually trying to accomplish,
because the original made utterly no sense to me :-)

FWIW,
--
Hassan Schroeder  [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: Re-executing a servlet request

2006-12-21 Thread David Kerber

Nobody has a suggestion about this?


David Kerber wrote:

I have a web app that starts with a .jsp, and then goes through a 
series of servlets to process some data.  If possible, I'd like to set 
it up so that after the last processing page is done, it goes back and 
re-executes the first servlet (the one that they go to from the .jsp), 
which is a data display.  Can that be done?  It seems like it should 
be possible, since I can save the request object as that first servlet 
receives it, but I can't seem to find the right call to get it to 
execute.  I don't want to make them go all the way back to the .jsp if 
I can avoid it.


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]







-
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 caching issue

2006-12-21 Thread markx3

Tomcat caching issue


Hello,

I have a server running Windows 2003 server SP1.  8 GB of RAM.  Sun Java
J2SE 5.0 update 7 and Tomcat 5.5.20.

Tomcat is used as our web server to review archived email.  The email is
stored in folders on the server and the archival system uses MS SQL 2000 SP4
on the backend.

The problem is when we use Tomcat as our web server to review the email, and
we click on several emails, after awhile regardless of the different email
we click on, we get the same data displayed in our web browser.  This really
appears to be a caching issue with Tomcat, because every time we restart the
tomcat service, the problem goes away for a few days and then it happens
again.  

To try to fix the issue we gave Tomcat more memory in the Tomcat Properties
/ Java tab.  We set initial memory pool to 128 MB of RAM and maximum memory
pool to 512 MB of RAM.  We also tried setting the IE 6.0 and 7.0 browsers to
check for newer versions of the page every time I visit the webpage.  Both
of these attempts didn’t resolve the issue.

Since I’m not a web developer I don’t know what to tell you about the
website tomcat is hosting.  Except for that it was a .war file that tomcat
extracts once we place in into the tomcat5.5\webapps directory.  If you need
specifics on what this website is, please let me know and I can get that
info for you.  But looking through it there are all the usual files like
.jsp, .htm, etc.

Also there isn’t a proxy server on the network.  When users connect to the
website tomcat is hosting, the browser on the local machine is making a
direct connection since it’s on the same subnet.

Please let me know what suggestions we can use to try to resolve this issue. 

-- 
View this message in context: 
http://www.nabble.com/Tomcat-caching-issue-tf2868059.html#a8016083
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]



dedicated servlet threads

2006-12-21 Thread Alec Swan

Hi all,

I have two servlets: Worker and Status. Worker servlet gets hit very
frequently and consumes all available Tomcat threads (configured via
maxThreads). Thus, whenever I try to access the Status thread I have to wait
a long time. Is there a way to either dedicate some threads to Status
servlet or set Status servlet priority higher than Worker servlet so that I
can access it faster? Note that both servlets need to work in the same
Tomcat instance.

Thanks.

Alec


RE: Desperate: Tomcat 5.5. j_security_check

2006-12-21 Thread Caldarale, Charles R
> From: Martin Gainty [mailto:[EMAIL PROTECTED] 
> Subject: Re: Desperate: Tomcat 5.5. j_security_check
> 
> http://developers.sun.com/sunstudio/articles/options.html
> yes I would recompile with -xtarget=generic to stay 32bit generic or
> to specifically target 64 bit recompile the whole lot to 
> 64bit with -xtarget=generic64 (for 64bit generic)

Martin, you're muddying the waters yet again.  The article noted above
refers to recompiling C and C++ code, not Java classes, which is what
the OP was specifically asking about.  Please read the questions before
answering with irrelevancies.

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



Re: Desperate: Tomcat 5.5. j_security_check

2006-12-21 Thread Martin Gainty
Hi Greg
http://developers.sun.com/sunstudio/articles/options.html
yes I would recompile with -xtarget=generic to stay 32bit generic or
to specifically target 64 bit recompile the whole lot to 64bit with 
-xtarget=generic64 (for 64bit generic)
Anyone else?
Martin--
--- 
This e-mail message (including attachments, if any) is intended for the use of 
the individual or entity to which it is addressed and may contain information 
that is privileged, proprietary , confidential and exempt from disclosure. If 
you are not the intended recipient, you are notified that any dissemination, 
distribution or copying of this communication is strictly prohibited.
--- 
Le présent message électronique (y compris les pièces qui y sont annexées, le 
cas échéant) s'adresse au destinataire indiqué et peut contenir des 
renseignements de caractère privé ou confidentiel. Si vous n'êtes pas le 
destinataire de ce document, nous vous signalons qu'il est strictement interdit 
de le diffuser, de le distribuer ou de le reproduire.
- Original Message - 
From: "Gregor Schneider" <[EMAIL PROTECTED]>
To: 
Sent: Thursday, December 21, 2006 3:28 PM
Subject: Desperate: Tomcat 5.5. j_security_check


> Hi list,
> 
> we're really, really  deperate here.
> 
> We have developed a web-app on Debian Edge with Tomcat 5.5.17 using
> Form-based Authentication with a JDBC-realm. Database is a MySQL
> 4.1.11
> 
> However, when we try to authenticate, the content passed from
> j_security_check -> mysql-driver -> MySQL always contains an empty
> string for the username, although the user has been read from the FORM
> and j_security_check even writes the j_user_name to the log.
> 
> The logs show the following (log4j enabled in Tomcat):
> 
> DEBUG http-8080-Processor2 
> org.apache.catalina.authenticator.AuthenticatorBase -
> Security checking request GET /RRWizardCLUE/RRWizardCLUE
> DEBUG http-8080-Processor2 org.apache.catalina.authenticator.AuthenticatorBase
> - Security checking request GET /RRWizardCLUE/RRWizardCLUE
> DEBUG http-8080-Processor2 org.apache.catalina.authenticator.AuthenticatorBase
> -  Calling hasUserDataPermission()
> DEBUG http-8080-Processor2 org.apache.catalina.authenticator.AuthenticatorBase
> -  Calling hasUserDataPermission()
> DEBUG http-8080-Processor2 org.apache.catalina.authenticator.AuthenticatorBase
> -  Calling authenticate()
> DEBUG http-8080-Processor2 org.apache.catalina.authenticator.AuthenticatorBase
> -  Calling authenticate()
> DEBUG http-8080-Processor2 org.apache.catalina.authenticator.FormAuthenticator
> - Save request in session '2872D911DD1F4534F9875C5C8994EA8B'
> DEBUG http-8080-Processor2 org.apache.catalina.authenticator.FormAuthenticator
> - Save request in session '2872D911DD1F4534F9875C5C8994EA8B'
> DEBUG http-8080-Processor2 org.apache.catalina.authenticator.AuthenticatorBase
> -  Failed authenticate() test
> DEBUG http-8080-Processor2 org.apache.catalina.authenticator.AuthenticatorBase
> -  Failed authenticate() test
> DEBUG http-8080-Processor2 org.apache.catalina.authenticator.AuthenticatorBase
> - Security checking request POST /RRWizardCLUE/j_security_check
> DEBUG http-8080-Processor2 org.apache.catalina.authenticator.AuthenticatorBase
> - Security checking request POST /RRWizardCLUE/j_security_check
> DEBUG http-8080-Processor2 org.apache.catalina.authenticator.FormAuthenticator
> - Authenticating username 'genre'
> DEBUG http-8080-Processor2 org.apache.catalina.authenticator.FormAuthenticator
> - Authenticating username 'genre'
> DEBUG http-8080-Processor2 org.apache.catalina.authenticator.AuthenticatorBase
> -  Failed authenticate() test ??/RRWizardCLUE/j_security_check
> DEBUG http-8080-Processor2 org.apache.catalina.authenticator.AuthenticatorBase
> -  Failed authenticate() test ??/RRWizardCLUE/j_security_check
> 
> 
> Now when I look at the MySQL-logs, I can see that an empty string has
> been passed:
> 
> 061221 21:14:32 100 Execute [1] SELECT user_pass FROM users
> WHERE user_name = ''
> 100 Query   commit
> 
> As you can see, the user "genre" has been found by j_security_check
> (which is demonstrated by the log), however, j_security_check (or the
> MySQL-JDBC-driver) somehow "swallows" the user and delivers an empty
> string to the MySQL-query.
> 
> The definition of our JDBC-REALM is fine, and we've triple- and
> quadruple-checked that the tables are there, rights are set, however,
> for your information I'll post it here anyways:
> 
>connectionPassword=""
>userCredCol="user_pass"
>userTable="users"
>driverName="org.gjt.mm.mysql.Driver"
>connectionURL="jdbc:mysql://localhost/authyela"
>connectionName="someuser"
>digest="MD5"
>userNameCol="user_name"
>userRoleTable=

RE: Desperate: Tomcat 5.5. j_security_check

2006-12-21 Thread Caldarale, Charles R
> From: Gregor Schneider [mailto:[EMAIL PROTECTED] 
> Subject: Desperate: Tomcat 5.5. j_security_check
> 
> This whole setup worked on Debian Sarge with a single processor on a
> 32bit-machine, but it does not work on Debian Edge Dual CPU Dual Core
> Opteron 64bit.

No, you do not have to recompile Java code for different JVMs.  You
would have to recompile any native code, such as APR, if you're using
that.

Possible things to try:

1) Run on a single CPU and see if the problem is reduced.  This may
indicate that something in the authentication path is storing data at
the wrong scoping level.

2) Try a 32-bit JVM on the same platform.  The 64-bit JVMs do not have
as wide exposure as the 32-bit ones, and there's an off chance that this
one is generating incorrect code somewhere.

3) Both of the above.

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



Logging Problem with unpackWARs="false"

2006-12-21 Thread James Dekker

Hello there,

Am using JDK 1.5 and Tomcat 5.5.9...

I have two init servlets for the following purposes:

1. One is for logging

2. The other is for loading (and parsing) XML based configuration
files using Commons Digester.

When I go to %CATALINA_HOME%/conf/server.xml and inside the 
tag, when I set the unpackWars attribute to false, I see a bunch of
null values inside where my logging is supposed to be set!

If I set it to true, everything works well!

e.g. when I set unpackWars = false, redeploy my app, and then start
Tomcat this is what I get:

Dec 21, 2006 1:20:47 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Dec 21, 2006 1:20:47 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 875 ms
Dec 21, 2006 1:20:48 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Dec 21, 2006 1:20:48 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.9
Dec 21, 2006 1:20:48 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Dec 21, 2006 1:20:48 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive mysampleapp.war
log4j.properties not found,
C:\DevTools\tomcat\jakarta-tomcat-5.5.9\bin\nullWEB-INF\log4j.properties
attributes-config.xml not found,
C:\DevTools\tomcat\jakarta-tomcat-5.5.9\bin\nullWEB-INF\attributes-config.xml

My %CATALINA_HOME% is c:\DevTool\tomcat\jakarta-tomcat-5.5.9\

and when I deploy my application, its supposed to auto load these
particular files inside %CATALINA_HOME%\myapp\WEB-INF, but since I
didn't want to unpack my war files, it puts that weird nullWEB-INF
inside the particular path!?

Does this mean that I can't have my servlets load init params unless
my war files is always unpacked?

Here's some code for your review:

http://java.sun.com/dtd/web-app_2_3.dtd";>



   MySampleApp
   
   MySampleApp
   

   
 MySampleAppServlet
 com.acme.MySampleAppServlet
   

   
 MySampleAppServlet
 /app
   


  log4j-init
  com.acme.logging.Log4jInitServlet
  
  log4j-init-file
  WEB-INF\log4j.properties
  
  1


  
  xml-config-init
  com.acme.config.XmlConfigInitServlet
  
  xml-config-file
  WEB-INF\attributes-config.xml
  
  2
  



package com.acme.logging;

import java.io.File;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

import org.apache.log4j.PropertyConfigurator;

public class Log4jInitServlet extends HttpServlet {
public void init() throws ServletException {
   String prefix = getServletContext().getRealPath("/");
   String file = getInitParameter("log4j-init-file");
   File propFile = new File(prefix+file);
   if(!propFile.exists()){
   System.out.println("log4j.properties not found, " +
propFile.getAbsolutePath());
   }
   PropertyConfigurator.configureAndWatch(propFile.getAbsolutePath(),1);
   }
}

package com.acme.config;

import java.io.File;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

import org.apache.log4j.Logger;

import com.acme.AttributeBeanXmlConfigHelper;

public class XmlConfigInitServlet extends HttpServlet {

public void init() throws ServletException {
String prefix = getServletContext().getRealPath("/");
String file = getInitParameter("xml-config-file");
File xmlConfigFile = new File(prefix + file);
if (!xmlConfigFile.exists()) {
System.out.println("attributes-config.xml not found, "
+ xmlConfigFile.getAbsolutePath());
}
try {

// Configure Digester from XML ruleset
AttributeBeanXmlConfigHelper.parse(xmlConfigFile);

Logger.getLogger(this.getClass()).warn("Finished parsing the 
config file.");

} catch (Exception ex) {
ex.printStackTrace();
}
}
}

Has anyone experienced the same kind of thing?

Happy holidays,

JD

-
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: Desperate: Tomcat 5.5. j_security_check

2006-12-21 Thread Gregor Schneider

oliver,

sorry, j_user_name was just a typo in my post.

sure, the parameter is j_username, and as you can see in the logs,
it's read properly from the form by j_security_check.

f.y.i., this is the form, which actually is working on our dev-machine
but not in our production-environment:



  
  
  User ID
  
  Password
  
  

  




btw., we tarred the whole tomcat-dir from the machine where the
installation is running and moved it 1:1 onto the production-machine,
to no avail.

meanwhile i believe it's a either bug in j_security_check or the
mysql-connector (although we've checked version 3 and 5).

tomorrow we'll try to find a copy of the j-mysql-connector version 4
since we're also running mysql 4.1.11, but i don't think that this
will help.

we will also set up a memory-realm to verify that basically the
installation is working (i bet my bottom penny that it will do with a
memory-realm), then it comes down to the database (my suspicion is,
that the jdbc-driver might have problem with the 64bit-environment).

if any of you guys has an idea of how to debug j_security_check (i.e.
the package and class, where it's implemented), i'd appreciate any
information: i would then try to include some more log-information
there which hopefully might help to track the error down.

cheers

greg
--
what's puzzlin' you, is the nature of my game
gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
gpgp-key available @ http://pgpkeys.pca.dfn.de:11371

-
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: Need help with JK2 connector/workers2.properties

2006-12-21 Thread Simon Renshaw
Yes, it is running on 2003. I also created the web extension and it is allowed.

-Original Message-
From: Uhlig, Stefan [mailto:[EMAIL PROTECTED] 
Sent: 21 décembre, 2006 16:05
To: Tomcat Users List
Subject: AW: Need help with JK2 connector/workers2.properties

Do you run a Windows 2003 Server? I had problems with this. In this case, you 
have to add a "Web Service Extension" on IIS, which is pointing to Redirector 
dll, and you have to give status "allowed" in the checkbox.

Stefan

-Ursprüngliche Nachricht-
Von: Simon Renshaw [mailto:[EMAIL PROTECTED] 
Gesendet: Donnerstag, 21. Dezember 2006 19:12
An: Tomcat Users List; Martin Gainty
Betreff: RE: Need help with JK2 connector/workers2.properties

This?




I use 9191 because 8080 is already in use on the server. Do I need to change it 
to something else?

-Original Message-
From: Martin Gainty [mailto:[EMAIL PROTECTED] 
Sent: 20 décembre, 2006 16:57
To: Tomcat Users List
Subject: Re: Need help with JK2 connector/workers2.properties

could you display the port number specification for your default connector in 
$CATALINA_BASE/conf/server.xml you will see 

To: "Tomcat Users List" 
Sent: Wednesday, December 20, 2006 2:31 PM
Subject: RE: Need help with JK2 connector/workers2.properties


I tried to get it to work with JK1.2 but I got the same page not found error.

There was no workers.properties and uriworkermap.properties files in Tomcat 
5.5.20 so I had to make my own. This might be the problem.

I put the following in workers.preperties (from Tomcat's site):

  # Define 1 real worker using ajp13
  worker.list=worker1
  # Set properties for worker1 (ajp13)
  worker.worker1.type=ajp13
  worker.worker1.host=localhost
  worker.worker1.port=8009
  worker.worker1.lbfactor=50
  worker.worker1.cachesize=10
  worker.worker1.cache_timeout=600
  worker.worker1.socket_keepalive=1
  worker.worker1.recycle_timeout=300

And in uriworkermap.properties (from a guess):

/jsp-examples/*=worker1 

/servlets-examples/*=worker1

/luntbuild/*=worker1

Is that correct?

I created the jakarta virtual directory and added the filter to the website.

Going to http://192.168.64.20:9191/jsp-examples/ works fine but I get a 404 if 
I try to go to http://192.168.64.20/jsp-examples/.

What am I missing?

Thanks!
Simon


-Original Message-
From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] 
Sent: 19 décembre, 2006 14:20
To: Tomcat Users List
Subject: RE: Need help with JK2 connector/workers2.properties

> From: Simon Renshaw [mailto:[EMAIL PROTECTED] 
> Subject: Need help with JK2 connector/workers2.properties
> 
> I followed the instructions found at
> http://tjworld.net/help/kb/0001_iis6-Tomcat5-JK2.html to install the
> connector.

The mod_jk2 package has been deprecated for well over a year - no
development, no support.  Suggest reading the real Tomcat documentation:
http://tomcat.apache.org/connectors-doc/

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


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



AW: Need help with JK2 connector/workers2.properties

2006-12-21 Thread Uhlig, Stefan
Do you run a Windows 2003 Server? I had problems with this. In this case, you 
have to add a "Web Service Extension" on IIS, which is pointing to Redirector 
dll, and you have to give status "allowed" in the checkbox.

Stefan

-Ursprüngliche Nachricht-
Von: Simon Renshaw [mailto:[EMAIL PROTECTED] 
Gesendet: Donnerstag, 21. Dezember 2006 19:12
An: Tomcat Users List; Martin Gainty
Betreff: RE: Need help with JK2 connector/workers2.properties

This?




I use 9191 because 8080 is already in use on the server. Do I need to change it 
to something else?

-Original Message-
From: Martin Gainty [mailto:[EMAIL PROTECTED] 
Sent: 20 décembre, 2006 16:57
To: Tomcat Users List
Subject: Re: Need help with JK2 connector/workers2.properties

could you display the port number specification for your default connector in 
$CATALINA_BASE/conf/server.xml you will see 

To: "Tomcat Users List" 
Sent: Wednesday, December 20, 2006 2:31 PM
Subject: RE: Need help with JK2 connector/workers2.properties


I tried to get it to work with JK1.2 but I got the same page not found error.

There was no workers.properties and uriworkermap.properties files in Tomcat 
5.5.20 so I had to make my own. This might be the problem.

I put the following in workers.preperties (from Tomcat's site):

  # Define 1 real worker using ajp13
  worker.list=worker1
  # Set properties for worker1 (ajp13)
  worker.worker1.type=ajp13
  worker.worker1.host=localhost
  worker.worker1.port=8009
  worker.worker1.lbfactor=50
  worker.worker1.cachesize=10
  worker.worker1.cache_timeout=600
  worker.worker1.socket_keepalive=1
  worker.worker1.recycle_timeout=300

And in uriworkermap.properties (from a guess):

/jsp-examples/*=worker1 

/servlets-examples/*=worker1

/luntbuild/*=worker1

Is that correct?

I created the jakarta virtual directory and added the filter to the website.

Going to http://192.168.64.20:9191/jsp-examples/ works fine but I get a 404 if 
I try to go to http://192.168.64.20/jsp-examples/.

What am I missing?

Thanks!
Simon


-Original Message-
From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] 
Sent: 19 décembre, 2006 14:20
To: Tomcat Users List
Subject: RE: Need help with JK2 connector/workers2.properties

> From: Simon Renshaw [mailto:[EMAIL PROTECTED] 
> Subject: Need help with JK2 connector/workers2.properties
> 
> I followed the instructions found at
> http://tjworld.net/help/kb/0001_iis6-Tomcat5-JK2.html to install the
> connector.

The mod_jk2 package has been deprecated for well over a year - no
development, no support.  Suggest reading the real Tomcat documentation:
http://tomcat.apache.org/connectors-doc/

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


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



dedicated servlet connections

2006-12-21 Thread Alec Swan

Hi all,

I have two servlets: Worker and Status. Worker servlet gets hit very
frequently and consumes all available Tomcat threads (configured via
maxThreads). Thus, whenever I try to access the Status thread I have to wait
a long time. Is there a way to either dedicate some threads to Status
servlet or set Status servlet priority higher than Worker servlet so that I
can access it faster? Note that both servlets need to work in the same
Tomcat instance.

Thanks.

Alec


Re: Desperate: Tomcat 5.5. j_security_check

2006-12-21 Thread olivier nouguier

j_username  should give you something better ;-)

On 12/21/06, Gregor Schneider <[EMAIL PROTECTED]> wrote:


Hi list,

we're really, really  deperate here.

We have developed a web-app on Debian Edge with Tomcat 5.5.17 using
Form-based Authentication with a JDBC-realm. Database is a MySQL
4.1.11

However, when we try to authenticate, the content passed from
j_security_check -> mysql-driver -> MySQL always contains an empty
string for the username, although the user has been read from the FORM
and j_security_check even writes the j_user_name to the log.

The logs show the following (log4j enabled in Tomcat):

DEBUG http-8080-Processor2
org.apache.catalina.authenticator.AuthenticatorBase -
Security checking request GET /RRWizardCLUE/RRWizardCLUE
DEBUG http-8080-Processor2
org.apache.catalina.authenticator.AuthenticatorBase
- Security checking request GET /RRWizardCLUE/RRWizardCLUE
DEBUG http-8080-Processor2
org.apache.catalina.authenticator.AuthenticatorBase
-  Calling hasUserDataPermission()
DEBUG http-8080-Processor2
org.apache.catalina.authenticator.AuthenticatorBase
-  Calling hasUserDataPermission()
DEBUG http-8080-Processor2
org.apache.catalina.authenticator.AuthenticatorBase
-  Calling authenticate()
DEBUG http-8080-Processor2
org.apache.catalina.authenticator.AuthenticatorBase
-  Calling authenticate()
DEBUG http-8080-Processor2
org.apache.catalina.authenticator.FormAuthenticator
- Save request in session '2872D911DD1F4534F9875C5C8994EA8B'
DEBUG http-8080-Processor2
org.apache.catalina.authenticator.FormAuthenticator
- Save request in session '2872D911DD1F4534F9875C5C8994EA8B'
DEBUG http-8080-Processor2
org.apache.catalina.authenticator.AuthenticatorBase
-  Failed authenticate() test
DEBUG http-8080-Processor2
org.apache.catalina.authenticator.AuthenticatorBase
-  Failed authenticate() test
DEBUG http-8080-Processor2
org.apache.catalina.authenticator.AuthenticatorBase
- Security checking request POST /RRWizardCLUE/j_security_check
DEBUG http-8080-Processor2
org.apache.catalina.authenticator.AuthenticatorBase
- Security checking request POST /RRWizardCLUE/j_security_check
DEBUG http-8080-Processor2
org.apache.catalina.authenticator.FormAuthenticator
- Authenticating username 'genre'
DEBUG http-8080-Processor2
org.apache.catalina.authenticator.FormAuthenticator
- Authenticating username 'genre'
DEBUG http-8080-Processor2
org.apache.catalina.authenticator.AuthenticatorBase
-  Failed authenticate() test ??/RRWizardCLUE/j_security_check
DEBUG http-8080-Processor2
org.apache.catalina.authenticator.AuthenticatorBase
-  Failed authenticate() test ??/RRWizardCLUE/j_security_check


Now when I look at the MySQL-logs, I can see that an empty string has
been passed:

061221 21:14:32 100 Execute [1] SELECT user_pass FROM users
WHERE user_name = ''
 100 Query   commit

As you can see, the user "genre" has been found by j_security_check
(which is demonstrated by the log), however, j_security_check (or the
MySQL-JDBC-driver) somehow "swallows" the user and delivers an empty
string to the MySQL-query.

The definition of our JDBC-REALM is fine, and we've triple- and
quadruple-checked that the tables are there, rights are set, however,
for your information I'll post it here anyways:



This whole setup worked on Debian Sarge with a single processor on a
32bit-machine, but it does not work on Debian Edge Dual CPU Dual Core
Opteron 64bit.
The JDK installed is 1.5.0-09-b01 (64bit JDK).

As far as I know, it doesn't matter wether a Java-program (i.e. the
MySQL-Connector or Tomcat) is running on 32bit-JDK or on 64bit-JDK
since the bytecode of the classes remains the same, right? Or do we
have to recompile the whole bunch on 64bit???

Please, please, please, throw all your suggestions, assumptions at me,
we're absolutely out of any ideas.

Thanks

Greg






--
what's puzzlin' you, is the nature of my game
gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
gpgp-key available @ http://pgpkeys.pca.dfn.de:11371

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





--
"Souviens-toi qu'au moment de ta naissance tout le monde était dans la joie
et toi dans les pleurs.
Vis de manière qu'au moment de ta mort, tout le monde soit dans les pleurs
et toi dans la joie."


Desperate: Tomcat 5.5. j_security_check

2006-12-21 Thread Gregor Schneider

Hi list,

we're really, really  deperate here.

We have developed a web-app on Debian Edge with Tomcat 5.5.17 using
Form-based Authentication with a JDBC-realm. Database is a MySQL
4.1.11

However, when we try to authenticate, the content passed from
j_security_check -> mysql-driver -> MySQL always contains an empty
string for the username, although the user has been read from the FORM
and j_security_check even writes the j_user_name to the log.

The logs show the following (log4j enabled in Tomcat):

DEBUG http-8080-Processor2 org.apache.catalina.authenticator.AuthenticatorBase -
Security checking request GET /RRWizardCLUE/RRWizardCLUE
DEBUG http-8080-Processor2 org.apache.catalina.authenticator.AuthenticatorBase
- Security checking request GET /RRWizardCLUE/RRWizardCLUE
DEBUG http-8080-Processor2 org.apache.catalina.authenticator.AuthenticatorBase
-  Calling hasUserDataPermission()
DEBUG http-8080-Processor2 org.apache.catalina.authenticator.AuthenticatorBase
-  Calling hasUserDataPermission()
DEBUG http-8080-Processor2 org.apache.catalina.authenticator.AuthenticatorBase
-  Calling authenticate()
DEBUG http-8080-Processor2 org.apache.catalina.authenticator.AuthenticatorBase
-  Calling authenticate()
DEBUG http-8080-Processor2 org.apache.catalina.authenticator.FormAuthenticator
- Save request in session '2872D911DD1F4534F9875C5C8994EA8B'
DEBUG http-8080-Processor2 org.apache.catalina.authenticator.FormAuthenticator
- Save request in session '2872D911DD1F4534F9875C5C8994EA8B'
DEBUG http-8080-Processor2 org.apache.catalina.authenticator.AuthenticatorBase
-  Failed authenticate() test
DEBUG http-8080-Processor2 org.apache.catalina.authenticator.AuthenticatorBase
-  Failed authenticate() test
DEBUG http-8080-Processor2 org.apache.catalina.authenticator.AuthenticatorBase
- Security checking request POST /RRWizardCLUE/j_security_check
DEBUG http-8080-Processor2 org.apache.catalina.authenticator.AuthenticatorBase
- Security checking request POST /RRWizardCLUE/j_security_check
DEBUG http-8080-Processor2 org.apache.catalina.authenticator.FormAuthenticator
- Authenticating username 'genre'
DEBUG http-8080-Processor2 org.apache.catalina.authenticator.FormAuthenticator
- Authenticating username 'genre'
DEBUG http-8080-Processor2 org.apache.catalina.authenticator.AuthenticatorBase
-  Failed authenticate() test ??/RRWizardCLUE/j_security_check
DEBUG http-8080-Processor2 org.apache.catalina.authenticator.AuthenticatorBase
-  Failed authenticate() test ??/RRWizardCLUE/j_security_check


Now when I look at the MySQL-logs, I can see that an empty string has
been passed:

061221 21:14:32 100 Execute [1] SELECT user_pass FROM users
WHERE user_name = ''
100 Query   commit

As you can see, the user "genre" has been found by j_security_check
(which is demonstrated by the log), however, j_security_check (or the
MySQL-JDBC-driver) somehow "swallows" the user and delivers an empty
string to the MySQL-query.

The definition of our JDBC-REALM is fine, and we've triple- and
quadruple-checked that the tables are there, rights are set, however,
for your information I'll post it here anyways:

   

This whole setup worked on Debian Sarge with a single processor on a
32bit-machine, but it does not work on Debian Edge Dual CPU Dual Core
Opteron 64bit.
The JDK installed is 1.5.0-09-b01 (64bit JDK).

As far as I know, it doesn't matter wether a Java-program (i.e. the
MySQL-Connector or Tomcat) is running on 32bit-JDK or on 64bit-JDK
since the bytecode of the classes remains the same, right? Or do we
have to recompile the whole bunch on 64bit???

Please, please, please, throw all your suggestions, assumptions at me,
we're absolutely out of any ideas.

Thanks

Greg






--
what's puzzlin' you, is the nature of my game
gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
gpgp-key available @ http://pgpkeys.pca.dfn.de:11371

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



Can you "turn off" certain log files?

2006-12-21 Thread Joe Siebenmann

Hi All,

I've looked at "logging.html" and conf/logging.properties and
I still can't figure out if it's possible to "turn off" certain
log files that get produced.

I've tried changing:

#1catalina.org.apache.juli.FileHandler.level = FINE
1catalina.org.apache.juli.FileHandler.level = SEVERE

But it doesn't affect anything.

The problem is that I'm getting 0-length log files for
stderr_ and sometimes jakarta_service_
and I'd like to be able to "turn those off" and only have the
.log files for stdout_

Or "turn up, or down" the "level" so much that they don't appear..

Is this even possible?

I'd rather not have the logs directory get "filled-up" with
empty log files.


Thanks,


Joe S.






___
Join Excite! - http://www.excite.com
The most personalized portal on the Web!



-
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: Need help with JK2 connector/workers2.properties

2006-12-21 Thread Simon Renshaw
This?




I use 9191 because 8080 is already in use on the server. Do I need to change it 
to something else?

-Original Message-
From: Martin Gainty [mailto:[EMAIL PROTECTED] 
Sent: 20 décembre, 2006 16:57
To: Tomcat Users List
Subject: Re: Need help with JK2 connector/workers2.properties

could you display the port number specification for your default connector in 
$CATALINA_BASE/conf/server.xml you will see 

To: "Tomcat Users List" 
Sent: Wednesday, December 20, 2006 2:31 PM
Subject: RE: Need help with JK2 connector/workers2.properties


I tried to get it to work with JK1.2 but I got the same page not found error.

There was no workers.properties and uriworkermap.properties files in Tomcat 
5.5.20 so I had to make my own. This might be the problem.

I put the following in workers.preperties (from Tomcat's site):

  # Define 1 real worker using ajp13
  worker.list=worker1
  # Set properties for worker1 (ajp13)
  worker.worker1.type=ajp13
  worker.worker1.host=localhost
  worker.worker1.port=8009
  worker.worker1.lbfactor=50
  worker.worker1.cachesize=10
  worker.worker1.cache_timeout=600
  worker.worker1.socket_keepalive=1
  worker.worker1.recycle_timeout=300

And in uriworkermap.properties (from a guess):

/jsp-examples/*=worker1 

/servlets-examples/*=worker1

/luntbuild/*=worker1

Is that correct?

I created the jakarta virtual directory and added the filter to the website.

Going to http://192.168.64.20:9191/jsp-examples/ works fine but I get a 404 if 
I try to go to http://192.168.64.20/jsp-examples/.

What am I missing?

Thanks!
Simon


-Original Message-
From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] 
Sent: 19 décembre, 2006 14:20
To: Tomcat Users List
Subject: RE: Need help with JK2 connector/workers2.properties

> From: Simon Renshaw [mailto:[EMAIL PROTECTED] 
> Subject: Need help with JK2 connector/workers2.properties
> 
> I followed the instructions found at
> http://tjworld.net/help/kb/0001_iis6-Tomcat5-JK2.html to install the
> connector.

The mod_jk2 package has been deprecated for well over a year - no
development, no support.  Suggest reading the real Tomcat documentation:
http://tomcat.apache.org/connectors-doc/

 - 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: Multi processor issue

2006-12-21 Thread Marziou, Gael
> I don't think this is a bug in TC's implementation. This is a 
> relatively subtle mistake that seems both easy enough to make 
> and easy to fix.

Maybe Tomcat should enforce this like for instance when we get an
exception trying to write into a response that was already committed.
It would have saved weeks of effort on our side.

> Gael, what was the reasoning behind caching that 
> RequestDispatcher? Was it simply because you would have been 
> calling the same method with the same parameters repeatedly, 
> and figured that you'd get some performance edge by saving 
> the resulting object? Were you observing any performance 
> degradation at any point? Or was this a case of premature 
> optimization? ;)

We did implement this 2 years ago, so details have vanished but it was
mainly based on our spec interpretation and also I admit on premature
optimization.

In several places, the spec defines different behaviors of
RequestDispatcher when it was obtained using getNamedDispatcher(String)
and noticeably for handling parameters.
So, our interpretation was that a RequestDispatcher obtained using
getNamedDispatcher() was different than one obtained using
getRequestDispatcher(): it has a different behavior and a wider scope.
This was the reason behind our implementation and also the fact that our
previous container (before migrating to Tomcat) seemed to work this way
(as far as I remember).

> I'd really like to hear if simply eliminating the caching of 
> this object fixes your problem. Does it?

So far so good, the new code has been running fine for 2 hours while it
was failing usually within 30 minutes.

Gael

-
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: Multi processor issue

2006-12-21 Thread Christopher Schultz
Chuck,

Caldarale, Charles R wrote:
> "Parameters specified in the query string used to create the
> RequestDispatcher take precedence over other parameters of the same name
> passed to the included servlet. The parameters associated with a
> RequestDispatcher are scoped to apply only for the duration of the
> include or forward call."

That part right there pretty much closes the book on this one for me: if
you pass (URL) parameters into the methods that return RequestDispatcher
objects, then you get a customized RequestDispatcher. There's no reason
to think that "no parameters" is any different than "some parameters".

I don't think this is a bug in TC's implementation. This is a relatively
subtle mistake that seems both easy enough to make and easy to fix.

Gael, what was the reasoning behind caching that RequestDispatcher? Was
it simply because you would have been calling the same method with the
same parameters repeatedly, and figured that you'd get some performance
edge by saving the resulting object? Were you observing any performance
degradation at any point? Or was this a case of premature optimization? ;)

I'd really like to hear if simply eliminating the caching of this object
fixes your problem. Does it?

-chris




signature.asc
Description: OpenPGP digital signature


Printable (free, overview) LAMP docs / books?

2006-12-21 Thread Tony Nelson
Not quite on topic, but as I get started with Tomcat I'm looking for
printable L.A.M.P. docs or a free (e)book to read while I'm away over
Christmas.  I'm looking for an integrated *overview with examples or cases
of setup, administration, and programming, but I'm not looking for a
specific HOWTO.  Suggestions?  (Yes, I know what L.A.M.P. stands for.)
-- 

TonyN.:'The Great Writ 
  '  is no more. 

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



url redirect

2006-12-21 Thread Michael Holstein

Hello list,

This should be simple, but I can't seem to find a coherent example with 
a variety of search terms .. so here goes.


If I say : http://host, I want it to become https://host.domain.com

I have a coyote connector which handles the 80->443 part, so if you do :

http://host.domain.com it becomes https://host.domain.com and works just 
fine.


However, if you're within the domain search order, and you type :

http://host .. it gets redirected to https://host, and you get an SSL 
name mismatch error.


In apache this is just a matter of doing a rewrite rule .. how does one 
go about doing this in Tomcat? (an example, or a link to one, would be 
much appreciated).


Thanks,

Michael Holstein
Cleveland State University

-
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: Multi processor issue

2006-12-21 Thread Caldarale, Charles R
> From: Mark Thomas [mailto:[EMAIL PROTECTED] 
> Subject: Re: Multi processor issue
> 
> I have re-read the sections of the spec you quoted several times and I
> don't see anything that suggests to me that the RequestDispatcher has
> only request level scope that would suggest the OPs use is invalid.
> Could you elaborate?

As I said yesterday, the statements in the spec are hints and by no
means definitive.  They are certainly subject to interpretation.  The
quoted items are from the spec, my comments follow each.

SRV.8.1.1 Query Strings in Request Dispatcher Paths:
"The ServletContext and ServletRequest methods that create
RequestDispatcher objects using path information allow the optional
attachment of query string information to the path."

"Parameters specified in the query string used to create the
RequestDispatcher take precedence over other parameters of the same name
passed to the included servlet. The parameters associated with a
RequestDispatcher are scoped to apply only for the duration of the
include or forward call."

Since query information is normally unique to a request, I think the
above could be construed that the RequestDispatcher is cognizant of the
query string.  If so, each RequestDispatcher would be associated with a
specific request.

SRV.8.4.1 Query String:
"The request dispatching mechanism is responsible for aggregating query
string parameters when forwarding or including requests."

Again, I think the above can be viewed as tying a RequestDispatcher
object to a specific request.

SRV.15.2.8 ServletContext, getRequestDispatcher(String):
"The resource can be dynamic or static."

Since dynamic resources can come and go and their existence can be
dependent on specific requests, there is an implication that a
RequestDispatcher is associated with the request it has been created
for.

"Send lawyers, guns, and money."  (That's not in the spec, but perhaps
should be.)

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



RE: OutOfMemoryError when jasper (or webappclassloader) tries to readjar files

2006-12-21 Thread Caldarale, Charles R
> From: Renaud Bruyeron [mailto:[EMAIL PROTECTED] 
> Subject: OutOfMemoryError when jasper (or webappclassloader) 
> tries to readjar files
> 
> This is an example of the top of the stacktraces we 
> experience *after a while* (i.e. after a couple of
> days of operation, sometimes more):
> java.lang.OutOfMemoryError
>at java.util.zip.ZipFile.open(Native Method)

The process may be running out of virtual space, but you may also have
exceeded the limit on open file descriptors, which can sometimes
generate an OOM exception.  Do you know how much virtual memory (not
RAM) the process has acquired prior to this error occurring?  Likewise,
can you determine the number of files open for this process?  Do either
of these grow over time?

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



pass object from host to servlet

2006-12-21 Thread Stephan Schöffel

hi,

i have my host make different checks during startup (in 
HostConfig.start()). i want to display the results in my own manager app 
which (as HTMLManagerServlet) extends ManagerServlet. is there a way to 
pass objects from the host to the managerservlet?


--stephan

-
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: Multi processor issue

2006-12-21 Thread Marziou, Gael
> Mark Thomas said:
> 
> I have re-read the sections of the spec you quoted several 
> times and I don't see anything that suggests to me that the 
> RequestDispatcher has only request level scope that would 
> suggest the OPs use is invalid.

That's the key point, also I am under the impression that the
ApplicationDispatcher could be re-factored to be thread safe by avoiding
having request scope fields and using only local variables in forward()
method.

Gael

-
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: Multi processor issue

2006-12-21 Thread Mark Thomas
Caldarale, Charles R wrote:
>> From: Mark Thomas [mailto:[EMAIL PROTECTED] 
>> Subject: Re: Multi processor issue
>>
>> What about RequestDispatcher ServletContext.getNamedDispatcher(String)
>>
>> Since this method is at the Context level, any RequestDispatcher
>> obtained effectively has context wide scope. It is this method that
>> the OP is using and, given the non-threadsafe nature of
>> o.a.c.core.ApplicationDispatcher, this looks like a Tomcat bug to me.
>> I haven't had a chance to see how hard it might be to fix yet.
> 
> I think some Servlet spec clarification would be really helpful here.
> Unless the spec intends for there to be different flavors of
> RequestDispatcher, the apparent context-level scope seems to conflict
> with the request-specific comments I noted earlier.

I have re-read the sections of the spec you quoted several times and I
don't see anything that suggests to me that the RequestDispatcher has
only request level scope that would suggest the OPs use is invalid.
Could you elaborate?

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]



Apache Tomcat Aliasing problem!

2006-12-21 Thread [EMAIL PROTECTED]
Hello!

When i do aliasing in apache it works, but when i integrate it with
tomcat it stops working, what's the problem?

Plz help me with it.

Regards!


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



OutOfMemoryError when jasper (or webappclassloader) tries to read jar files

2006-12-21 Thread Renaud Bruyeron


We are running into OOM errors that we think are related to this:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4705373

Our setup:
JDK 1.5.0_08b3 on Debian Linux (2.4.21SMP)
tomcat 5.5.17

We have 3 webapps in the tomcat instance with fairly similar WEB-INF/lib 
content

(struts + spring + hibernate, etc) - roughly 25-30MB worth of .jar files.

We have JAVA_OPTS="-server -XX:MaxPermSize=128M 
-XX:+HeapDumpOnOutOfMemoryError -Xms$1024m -Xmx1024m" and we are running 
on dual-xeon, 4GB main memory hardware.
RAM is never exhausted, we have on average 3GB of free swap, and we 
never actually consume all of the non-swap RAM.


This is an example of the top of the stacktraces we experience *after a 
while* (i.e. after a couple of days of operation, sometimes more):

java.lang.OutOfMemoryError
  at java.util.zip.ZipFile.open(Native Method)
  at java.util.zip.ZipFile.(ZipFile.java:203)
  at java.util.jar.JarFile.(JarFile.java:132)
  at java.util.jar.JarFile.(JarFile.java:70)
  at sun.net.www.protocol.jar.URLJarFile.(URLJarFile.java:56)
  at 
sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:41)
  at 
sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:68)
  at 
sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:102) 

  at 
org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:175) 

  at 
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:423)

  at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:492)
  at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1552)
  at org.apache.jasper.compiler.Parser.parse(Parser.java:126)
  at 
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:211) 

  at 
org.apache.jasper.compiler.ParserController.parse(ParserController.java:116) 

  at 
org.apache.jasper.compiler.Parser.processIncludeDirective(Parser.java:335)
  at 
org.apache.jasper.compiler.Parser.parseIncludeDirective(Parser.java:372)

  at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:484)
  at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1552)
  at org.apache.jasper.compiler.Parser.parse(Parser.java:126)
  at 
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:211) 

  at 
org.apache.jasper.compiler.ParserController.parse(ParserController.java:116) 

  at 
org.apache.jasper.compiler.Parser.processIncludeDirective(Parser.java:335)
  at 
org.apache.jasper.compiler.Parser.parseIncludeDirective(Parser.java:372)

  at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:484)
  at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1552)
  at org.apache.jasper.compiler.Parser.parse(Parser.java:126)
  at 
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:211) 

  at 
org.apache.jasper.compiler.ParserController.parse(ParserController.java:100) 

  at 
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:155)

  at org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
  at org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
  at org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
  at 
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563) 

  at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303) 

  at 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)

  at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
...

Has anyone else seen this?
The answer is yes, as per 
http://mail-archives.apache.org/mod_mbox/tomcat-users/200508.mbox/[EMAIL PROTECTED] 

Note that the user above had a different stacktrace involving the webapp 
classloader accessing resources inside jars: we *DO* experience this 
kind of stacktrace as well (for example when using javamail APIs, which 
tries to open a META-INF/mailcap file), and I think it is the same 
underlying problem.


What is the best approach to this problem?
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6280693 suggests that 
the underlying JDK bug has been fixed, however this is a JDK6 fix only 
at this point.
The original bug 
(http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4705373) suggests 
that using

ZipInputStream instead of ZipFile would also help.
Please note that our applications do not use the java.util.zip package: 
all the exceptions are thrown while inside tomcat (either the 
WebappClassLoader or inside jasper).


If anyone has some info on this problem, please let me know

- Renaud

-
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[2]: Multiple designing.

2006-12-21 Thread Dima Retov

I ask that as we had similar idea to make shared hosting for tomcat.

The main problem for us was unloading code (context, sites).

It is complex to stop thread that do not wish to properly stop.

You can protect shutdown port with Security Manager that you must
implement for such project.

Abuser may create memory leaks by placing references to big objects.

As I understand you can't force to unload code.

.NET has "Application Domain" that is able to do that. It is used in
IIS. Java does not have such things.

--

 is not real problem. You can check how such things are
implemented in tomcat's admin page. It is JSP app that is able to add
recourses and adjust server.xml file.

-- 
Best regards,
 Dimamailto:[EMAIL PROTECTED]



Thursday, December 21, 2006, 10:47:39 AM, you wrote:

WP> Dima Retov ??:
>> WP> We are starting to design a ISP level JSP virutal hosting system which
>> WP> could serve JSP and Servlets.
>> 
>> Would you use have 1 tomcat per server?
>> 
>> If yes, Would you protect it from abusing code? e.g. Anyone would be
>> able to upload code with infinite loops to server.
>> 

WP> Thanks for your response.

WP> I have installed only one tomcat server in a machine. If this is the
WP> thing you have mentioned by "1 tomcat per server", i think i have to
WP> protect the tomcat server from abusing code.

WP> But i don't know so much about tomcat configuration, the only things i
WP> have done to protect the security of the tomcat server is

WP> 1. use iptables blocked the internal ports
WP> 8009, etc ..
WP> 2. use -security option during start the tomcat server.

WP> To be more safely, what should i do with the server, or maybe you could
WP> point out some articles i have to read.

WP> Thanks again.

WP> Wang.



WP> -
WP> To start a new topic, e-mail: users@tomcat.apache.org
WP> To unsubscribe, e-mail: [EMAIL PROTECTED]
WP> 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: Multiple designing.

2006-12-21 Thread Wang Penghui

Dima Retov 写道:

WP> We are starting to design a ISP level JSP virutal hosting system which
WP> could serve JSP and Servlets.

Would you use have 1 tomcat per server?

If yes, Would you protect it from abusing code? e.g. Anyone would be
able to upload code with infinite loops to server.



Thanks for your response.

I have installed only one tomcat server in a machine. If this is the 
thing you have mentioned by "1 tomcat per server", i think i have to 
protect the tomcat server from abusing code.


But i don't know so much about tomcat configuration, the only things i 
have done to protect the security of the tomcat server is


1. use iptables blocked the internal ports
8009, etc ..
2. use -security option during start the tomcat server.

To be more safely, what should i do with the server, or maybe you could 
point out some articles i have to read.


Thanks again.

Wang.



-
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: Multiple designing.

2006-12-21 Thread Dima Retov
WP> We are starting to design a ISP level JSP virutal hosting system which
WP> could serve JSP and Servlets.

Would you use have 1 tomcat per server?

If yes, Would you protect it from abusing code? e.g. Anyone would be
able to upload code with infinite loops to server.

-- 
Best regards,
 Dimamailto:[EMAIL PROTECTED]

Thursday, December 21, 2006, 6:08:32 AM, you wrote:

WP> Hello,

WP> We are starting to design a ISP level JSP virutal hosting system which
WP> could serve JSP and Servlets.

WP> Here are some thing i decide to to:

WP> Apache 2.0.52(RHEL 4 default installation)
WP> Tomcat 5.5.20 (http://tomcat.apache.org)
WP> Tomcat connector 1.2.18(http://tomcat.apache.org)

WP> Add the follow lines in httpd.conf

WP> JkWorkersFile /usr/local/tomcat/conf/jk/workers.properties
WP> JkLogFile /etc/httpd/logs/mod_jk.log
WP> JkLogLevelinfo
WP> JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
WP> 
WP> AllowOverride None
WP> deny from all
WP> 
WP> 
WP> AllowOverride None
WP> deny from all
WP> 

WP> Then here is a example  in httpd.conf

WP> 
WP> SuexecUserGroup wangph clients
WP> ServerAdmin [EMAIL PROTECTED]
WP> ServerName wangph.example.com
WP> DocumentRoot "/home/wangph/wwwroot"
WP> ScriptAlias /cgi-bin/ /home/wangph/wwwroot/cgi-bin/
WP> ScriptAlias /perl/ /home/wangph/wwwroot/cgi-bin/
WP> ErrorLog logs/error_log
WP> JkMount /*.jsp ajp13
WP> JkMount /servlet/* ajp13
WP> 

WP> And here is a example  in server.xml

WP>  autoDeploy="true"
WP> configClass="org.apache.catalina.startup.ContextConfig"
WP> contextClass="org.apache.catalina.core.StandardContext" debug="0"
WP> deployXML="true"
WP> errorReportValveClass="org.apache.catalina.valves.ErrorReportValve"
WP> liveDeploy="true"
WP> mapperClass="org.apache.catalina.core.StandardHostMapper"
WP> name="wangph.example.com" unpackWARs="true">
WP> >
WP> 

WP> I leave appBase blank. And point the docBase to the apache virtual
WP> documentroot.


WP> If i add a new virtual host, simply add one  in httpd.conf
WP> and one  in server.xml.

WP> Is there any problem?

WP> Thanks very much

WP> Wang Penghui


WP> -
WP> To start a new topic, e-mail: users@tomcat.apache.org
WP> To unsubscribe, e-mail: [EMAIL PROTECTED]
WP> 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]