filter: How to set browser encoding?

2005-10-12 Thread Mark
Hi everybody,
I've got a request from my client to force an encoding in the
browser, regardless what user have set.

When I set encoding inside my filter to Windows-1257 in the HTML
source code I see only ?s:??? ? ???.

Is there any easy way to enforce browser to set proper encoding?


May be I need to setContent type after I obtain a writer in the
servlet?
Note, all outputs are generated by servlets:

public void doPost( HttpServletRequest req, HttpServletResponse resp
)
  throws IOException, ServletException
{
  // do something
resp.setContentType(text/html);
resp.getWriter().println(output);
}


In MyFilter.doFilter() I do following:
(HttpServletResponse)response).setContentType(text/html;charset=Windows-1257)

I use 5.0.28 with Redhat 9.
Any input is welcome.

Thanks!
Mark.




__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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



RE: Q:how to remove charset from HTTP responce to allow browser use a browser selected charset?

2005-10-12 Thread Mark
Hi Rick,
Yes my data comes from different locales I should say it's a legacy
data. I have no ability co convert it to UTF-8 right now.

response.setContentType(text/html;charset=...); mess up the not
UTF-8 output, I'm getting ???s instead of a valid data.

I think I'll go with request.setCharacterEncoding(encoding);

Crossing my fingers...

Mark.
--- Rick [EMAIL PROTECTED] wrote:

 Hi Mark,
   Can you talk a little about what the data is.. Just form data
 from
 different locales?
 I store all my data in UTF-8 and just instruct the page encoding to
 be the
 same (UTF-8) and I'm able to handle input and display of whatever
 people
 enter. Had a few odd things to overcome to get it working like,
 
 JSP: I had to save the actual JSP file in UTF8 otherwise I couldn't
 get it
 to serve the page with UTF8 properly.. This started after Tomcat
 5.0.16 or
 something like that.  
 
 Servlet: don't think I had to do anything wild.. Just set the
 charset before
 you do anything with the output stream, including just getting a
 handle to
 the stream writer.  Set the contenttype first.
 response.setContentType(text/html;charset=UTF-8);
 
 Depending on what you are reading from and such. You may also want
 to set
 some Java ARGs when starting Tomcat... Like:
 -Djavax.servlet.request.encoding=UTF-8 -Dfile.encoding=UTF-8
 -DjavaEncoding=UTF-8
 
 Not sure if this is relevant, but hope it helps,
 
 Rick
 
 -Original Message-
 From: Mark [mailto:[EMAIL PROTECTED] 
 Posted At: Thursday, October 06, 2005 12:13 PM
 Posted To: Tomcat Dev
 Conversation: Q:how to remove charset from HTTP responce to allow
 browser
 use a browser selected charset?
 Subject: Re: Q:how to remove charset from HTTP responce to allow
 browser use
 a browser selected charset?
 
 
 Hi Mark,
 In my case servlet generates an output, so no JSP for now...
 Can I do it using filters? Or define and store user's prefs with
 encoding
 outside of tomcat and  in the session and use if it's exists in the
 session?
 
 Thanks a lot!
 Mark.
 
 --- Mark Thomas [EMAIL PROTECTED] wrote:
 
  Mark wrote:
   Hello,
   
   In my application users enter data using different languages.
   The problem I'm facing is the browser sets the page encoding
  always
   to ISO-8859-1. (I guess this is default based on server OS)
   
   User can change encoding on the page (Browser settings) and 
   everything looks OK but only for one page. On the next page
  encoding
   is back to ISO-8859-1.
   Is there any way to instruct tomcat not to send the page
  encoding?
  
  If you are using JSPs, no. The spec requires that the charset is
 set.
  
  Mark
  
  
  
 

-
  To unsubscribe, e-mail:
 [EMAIL PROTECTED]
  For additional commands, e-mail:
  [EMAIL PROTECTED]
  
  
 
 
 
   
   
 __
 Yahoo! for Good
 Donate to the Hurricane Katrina relief effort. 
 http://store.yahoo.com/redcross-donate3/ 
 
 

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

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




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

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



where is a text/html;charset= ?

2005-10-12 Thread Mark
Hi everybody,

How can I see the complete output stream for each http request?

I tried:
--
$telnet localhost 8080
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET /
htmlheadtitleHello Test4/title/headbody/body/html
-
Where is a text/html;charset=...? or I'm missing something?

Thanks,
Mark.



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

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



Re: where is a text/html;charset= ?

2005-10-12 Thread Mark
Thanks Jon,

 text/html;charset= is not there yet...

Here what I've got:

HTTP/1.1 200 OK
Set-Cookie: JSESSIONID=95EA4260325D4C1FCBF8196773A4BED3; Path=/
Content-Length: 478
Date: Wed, 12 Oct 2005 20:34:37 GMT
Server: Apache-Coyote/1.1
Connection: close

htmlheadtitleHello Test4/title


Mark.


--- Jon Wingfield [EMAIL PROTECTED] wrote:

 You need to submit a valid HTTP request. Yours doesn't have the
 version 
 at the end of the request line.
 
 Try:
 
 GET / HTTP/1.0
 
 
 (Thats a two linefeeds: one marking the end of the request line and
 one 
 blank line indiating the end of the http headers)
 You should then see the HTTP response, headers and all.
 If you want to submit HTTP/1.1 requests you need to submit some 
 mandatory headers (Host and maybe Date) otherwise you get a 400
 back.
 
 $ telnet
 telnet open localhost 8080
 Trying 127.0.0.1...
 Connected to localhost.
 Escape character is '^]'.
 GET / HTTP/1.1
 
 HTTP/1.1 400 Bad Request
 Transfer-Encoding: chunked
 Date: Wed, 12 Oct 2005 17:26:36 GMT
 Server: Apache-Coyote/1.1
 Connection: close
 
 0
 
 Alternatively you can use plug-ins for Mozilla/Firefox and IE which
 
 allow you to see the raw response:
 
 http://livehttpheaders.mozdev.org/
 http://www.blunck.info/iehttpheaders.html
 
 HTH,
 
 Jon
 
 Mark wrote:
  Hi everybody,
  
  How can I see the complete output stream for each http request?
  
  I tried:
  --
  $telnet localhost 8080
  Trying 127.0.0.1...
  Connected to localhost.
  Escape character is '^]'.
  GET /
  htmlheadtitleHello Test4/title/headbody/body/html
  -
  Where is a text/html;charset=...? or I'm missing something?
  
  Thanks,
  Mark.
  
  
  
  __ 
  Yahoo! Music Unlimited 
  Access over 1 million songs. Try it free.
  http://music.yahoo.com/unlimited/
  
 

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

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





__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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



RE: Tomcat 5.5.12 and user-agent header

2005-10-11 Thread Mark Thomas
Have you looked at the headers between Tomcat and your UA? Is your UA actually
sending the UA header? If it is then it looks like a sitemesh problem from what
you have described. There are a range of tools for looking at headers.
livehttpheaders is good, as is TcpMon which is distributed as part of Axis.

Mark 

 -Original Message-
 From: Richard Mixon [mailto:[EMAIL PROTECTED] 
 Sent: Monday, October 10, 2005 12:00 AM
 To: 'Tomcat Users List'
 Subject: RE: Tomcat 5.5.12 and user-agent header
 
 Leon,
 
 Thank you for the test - but I still get a null user-agent 
 right after the
 login. Here is a snippet of my code:
 
   !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN 
   http://www.w3.org/TR/html4/loose.dtd;
   %@ include file=/common/taglibs.jspf%
   %@ page import=com.ltoj.common.Constants %
   html:html locale=true
   head
   %@ include file=/common/meta.jspf %
   titledecorator:title//title
   script type=text/javascript src=c:url
 value='/scripts/environment.js'//script
   script type=text/javascript src=c:url
 value='/scripts/util.js'//script
   script type=text/javascript src=c:url
 value='/scripts/helptip.js'//script
   script type=text/javascript src=c:url
 value='/scripts/tabs.js'//script
   script type=text/javascript src=c:url
 value='/scripts/CalendarPopup.js'//script
   script type=text/javascript src=c:url
 value='/scripts/chartWizard.js'//script
   link rel=stylesheet type=text/css media=all href=c:url
 value='/styles/default.css'/ / 
   link rel=stylesheet type=text/css media=all href=c:url
 value='/styles/messages.css'/ / 
   link rel=stylesheet type=text/css media=all href=c:url
 value='/styles/tabs.css'/ / 
   decorator:head/
   %
   String _userAgent = request.getHeader(user-agent);
   out.write(USER-AGENT='+_userAgent+'); 
   ...
 
 Here's the sequence:
 
 1) I issue a request to this page.
 
 2) CMA says oh, that's protected and shows my custom login 
 page. I get
 user-agent displayed fine:
  USER-AGENT='Mozilla/5.0 (Windows; U; Windows NT 5.2; 
 en-US; rv:1.7.12)
 Gecko/20050915 Firefox/1.0.7'
 
 3) But on the next page (the original target page of the request),
 user-agent shows as null.
  USER-AGENT='null'
 
 I can refresh the page or go to any other page in my 
 application and the
 user agent is fine again.
 
 The only thing a bit non-standard about this JSP page is that it is a
 SiteMesh decorator page. 
 
 If I run the same test, same pages in Tomcat 5.5.9 I never 
 get user-agent of
 null.
 
 Our application does check the user-agent header a good bit. 
 We use Select
 lists with option groups - but some browsers do not support this so we
 simulate it by indenting the select options ourselves.
 
 Luckily all of this activity happens well after the initial 
 login - so we
 are safe, now that I changed the decorator to make sure 
 user-agent is not
 null before doing anything with it.
 
 But it seems other applications might be affected by this - no?
 
 Thanks again - Richard
 
 
 
 
 
 
 -Original Message-
 From: Leon Rosenberg [mailto:[EMAIL PROTECTED] 
 Sent: Sunday, October 09, 2005 1:45 PM
 To: Tomcat Users List; [EMAIL PROTECTED]
 Subject: Re: Tomcat 5.5.12 and user-agent header
 
 Hmm, I downloaded 5.5.12 and tried the agent-header specific 
 code with it:
 
   public void processLogin(User user, HttpServletRequest req,
 HttpServletResponse res) {
   StringBuffer info = new StringBuffer();
   info.append(login );
   info.append(user.getUserName());
   info.append( [);
   info.append(user.getUserId().getPlainPresentation());
   info.append(] );
   info.append(user.getEmail());
   info.append( );
   
 info.append(UserHelper.getGenderDescription(user.getGender()));
   info.append( );
   
 info.append(UserHelper.getStatusDescription(user.getMembership
 Status()));
   info.append( );
   info.append(req.getRemoteAddr());
   info.append( / );
   info.append(req.getRemoteHost());
   info.append( Agent: );
   info.append(req.getHeader(user-agent));
   log.info(info); 
   }
 
 outcome was:
 
 2005-10-08 15:36:50,453 INFO  - login leon [6] [EMAIL PROTECTED] male premium
 127.0.0.1 / 127.0.0.1 Agent: Mozilla/5.0 (Windows; U; Windows 
 NT 5.0; en-US;
 rv:1.7) Gecko/20040626 Firefox/0.8
 
 which I think was same behaviour as before.
 
 I took tomcat out of the box (5.5.12 tar.gz) and only changed 
 the http port.
 
 regards
 leon
 
 
 On 10/8/05, Richard Mixon [EMAIL PROTECTED] wrote:
  I am just using the standard HTTP connector. This is on my 
 development 
  workstation so I don't normally run JK and Apache, except for final
 testing.
 
  On the developer list I did see one mention of user-agent 
 header, but 
  on closer inspection it appeared to be for a completely 
 different issue.
 
  Thanks - Richard
 
  -Original

RE: Mod_jk + Apache on RHEL3 gives 503 for jsp only

2005-10-11 Thread Mark Eggers
Here's a quick writeup.

This is going to be a long reply, and I hope it will
be useful.

I am using Fedora Core 4 as a model.  I hope it will
be close enough to RHEL 3 to be useful.  You may have
to change paths in order to correspond to your
environment.

First of all, my environment:

Hardware/OS
===
Dell 8200 with 768 MB memory
Dual boot:
Fedora Core 4 2.6.13-1.1526_FC4
Windows 2000 Professional

Software

Java 1.5.0_4 from Sun
Apache 2.0.54 from RPM
Tomcat 5.5.9 from jakarta.apache.org
mod_jk 1.2.14.1 from source

Installation

Java 1.5.0_4 is installed in /usr/jdk1.5.0_04 and soft

linked to /usr/java
JAVA_HOME is set in /etc/profile
$JAVA_HOME/bin is placed in $PATH before /usr/bin

I've left the Apache RPM install alone, which means
the following:

DocumentRoot /var/www
Logs /etc/logs soft linked to /var/log/httpd
modules  /etc/modules soft linked to
/usr/lib/httpd/modules
conf /etc/conf
 /etc/conf.d

I've created a tomcat user with the same group
membership as apache user.  The home directory is
/home/tomcat.

/home/tomcat/jakarta-tomcat-5.5.9 Current Tomcat
installation

Configuration
=

workers.properties
--

I've placed workers.properties in /etc/httpd/conf

#
# basic worker list
#
worker.list=local,status

#
# one to serve the applications
#
worker.local.type=ajp13
worker.local.host=localhost
worker.local.port=8009

#
# one to check the status
#
worker.status.type=status
worker.status.host=localhost
worker.status.port=8009

This is all you really need in order to connect a
local Apache to a local Tomcat.

I cannot think of a good reason to define more
workers.  That isn't to say that there aren't any.

server.xml
-- 
If you put multiple workers going to the same host and
different ports, then you will have to modify
server.xml.  Basically, you will have to add a
connector statement for each unique port that you use
in your workers.properties file.

You have two different ports, so you will need two
connector statements.

Connector port=10009
   enableLookups=false redirectPort=8443
   protocol=AJP/1.3 /
Connector port=8099
   enableLookups=false redirectPort=8643
   protocol=AJP/1.3 /

jk.conf
---
I'm following the examples used by Fedora Core 4 in
configuring other add-on modules for Apache.  You can
place the mod_jk configuration information directly in
/etc/httpd/conf/httpd.conf, but I've chosen to create
a separate file in /etc/httpd/conf.d

The contents of my file are as follows:

#
# following Fedora's add-on philosophy
#
LoadModulejk_module modules/mod_jk.so

JkWorkersFile /etc/httpd/conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevelwarn
JkLogStampFormat  [%a %b %d %H:%M:%S %Y] 
JkShmFile logs/shm-file


#
# jk status
#
JkMount /jk-status/ status

httpd.conf
--

Static File Problem
---
This is where the configuration can become a little
more complex.  It helps to understand how Apache finds
files to serve.

Each host in Apache has a DocumentRoot.  In Redhat
Fedora, the line that defines that reads:

DocumentRoot /var/www/html

That means that when you enter the following URL:

http://localhost/application/

Apache will look for the DirectoryIndex files (usually
index.html) in:

/var/www/html/application/

This is fine until you add an application server into
the mix.  Many people package up the entire
application into one war file.  This means that all
static as well as dynamic content gets loaded into the
application server area.

In your case, that's
/usr/local/tomcat/jakarta-tomcat-5.5.9/webapps

Apache will know absolutely nothing about this
directory, and any files that are not mapped by
JkMount and served by Tomcat will not be found by
Apache

Static File Solutions
-
1. Change DocumentRoot

The most global change is to change DocumentRoot.  In
order for this to work, all files in
/usr/local/tomcat/jakarta-tomcat-5.5.9/webapps must be
readable by the user that runs Apache (typically
apache in a Redhat distribution).

The way to do this is to put the following as your
DocumentRoot statement.

DocumentRoot
/usr/local/tomcat/jakarta-tomcat/webapps

While this works, it means that you will have to place
all web sites in this location, even if they do not
have dynamic content.

In general, I don't like this solution.

2. Add Directory and Alias Statements

Traditionally locating static files in a dynamic web
site has been done by using a combination of Directory
and Alias directives.  The Directory directive grants
appropriate server permissions (who gets to see the
files, etc.) and the Alias directive matches a
directory with a base URL.

For example, here's one way to map application1 living

in

/usr/local/tomcat/jakarta-tomcat/5.5.9/webapps/application1.

#
# This goes in httpd.conf
#
Directory /usr/local/tomcat/webapps/application1/
   Options Indexes 

Re: JSP Newbie seeking guidance

2005-10-10 Thread Mark Eggers
I am not familiar with the book.

If they are recommending using Tomcat's connection
pools and JNDI, then you will need to add the jar file
that contains the MySQL driver to
$CATALINA_HOME/common/lib.

If you are connecting to the database directly from
your web application then you probably need to place
the jar file containing the MySQL driver in
$CATALINA_HOME/webapps/app-name/WEB-INF/lib, where
app-name is the name of your application.

You can pick up the MySQL jdbc driver from:

http://dev.mysql.com/downloads/connector/j/3.1.html

If you are just starting out on jsp/servlet
programming, then running Tomcat standalone is
probably a good first choice.

The later versions of Tomcat (5.5.x) perform pretty
much the same as Apache 2.0.x for static pages.  

Coupling Apache and Tomcat together makes sense when
you start using some of the features that Apache
supports but that Tomcat may not be optimal for.

HTH

/mde/

--- John Geiger [EMAIL PROTECTED] wrote:

 I am avoiding the real issue--OK, I am ready to face
 it:
 
 javax.servlet.ServletException:
 javax.servlet.jsp.JspTagException: In
 lt;drivergt;, invalid driver class name:
 java.lang.ClassNotFoundException:
 com.mysql.jdbc.Driver
 
 This is the error I get running an exercise from the
 Apress book. I can not
 seem to find my way using Google.
 
 I think maybe MySQL is not installed--or I am
 missing an important
 file...somewhere!
 
 Eeek. Thanks.
 




__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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



RE: hot redeploy now work. locked jsf-impl.jar

2005-10-08 Thread Mark Thomas
Take a look at http://issues.apache.org/bugzilla/show_bug.cgi?id=10026. It may
be related.

Mark

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
 Sent: Saturday, October 08, 2005 5:20 PM
 To: tomcat-user@jakarta.apache.org
 Subject: hot redeploy now work. locked jsf-impl.jar 
 
 I deploy xsoft.war in webapps directory.  It creates a 
 diretory xsoft and
 deploy works.
 
 NEXT, I drop xsoft.war in the webapps directory again.  Tomcat starts
 deleting all files from previous deployment but can't delete 
 jsf-impl.jar.
  Because of this, tomcat does not deploy xsoft.war and the 
 xsoft directory
 is left empty except this one file.
 
 This was hard to figure out as tomcat logs say nothing about what
 happened.  They don't tell you that redeploy failed because 
 tomcat did not
 succeed in deleting the first deployment.  It took me forever 
 to figure
 out what was going on.
 
 Anyone know why jsf-impl.jar would be locked.  I try to 
 manually delete it
 and can't until I shutdown tomcat.  Is tomcat not unlocking the file
 correctly after it reads it into the classloader for this app?
 
 thanks for any help on this,  Temporarily I just created an ant script
 that stops tomcat, deletes previous xsoft directory, redeploys app and
 restarts tomcat but this takes forever.
 dean
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 -- 
 No virus found in this incoming message.
 Checked by AVG Anti-Virus.
 Version: 7.0.344 / Virus Database: 267.11.13/124 - Release 
 Date: 07/10/2005
 
 


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



RE: hot redeploy now work. locked jsf-impl.jar

2005-10-08 Thread Mark Thomas
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
 
 I am confused.  It looks like they found a way to make tomcat 
 so if the
 jars had that problem, tomcat could still handle it, but only 
 put this in
 4.x.  It is not in 5.0(ie. the last post in the message).

The functionality has been in 5.5.x for a while. It wasn't back ported to the
5.0.x branch. Development on the 5.0.x branch stopped shortly after the first
stable 5.5.x so it is very unlikely that it ever will. If you are using 5.0.x at
the moment, now might be a good time to move to 5.5.x. You should also note that
there are two anti-locking options, antiJARLocking and antiResourceLocking. Make
sure you read the docs before trying to use them.

Mark


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



RE: SessionListener invoked sometimes and not others

2005-10-08 Thread Mark Thomas
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
 So after a restart of tomcat, I login and it appears the 
 session is still
 valid, so it does not go through my session listener.
 
 I need to be aware of the web application lifecycle and want to grab a
 resource when the webapp starts and release when the web app 
 goes away. 
 How do I do that?

Use a ServletContextListener.

Mark


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



Re: Problem with tomcat configuration

2005-10-06 Thread Mark Eggers
https is port 443.  You need to to uncomment the HTTP
1.1 connector for 8443 and change the port to 443.

Uncomment the following connector in server.xml:

!-- Define a SSL HTTP/1.1 Connector on port 8443 --
!--
 Connector port=8443 maxHttpHeaderSize=8192
maxThreads=150 minSpareThreads=25 
maxSpareThreads=75
enableLookups=false 
disableUploadTimeout=true
acceptCount=100 scheme=https 
secure=true
clientAuth=false sslProtocol=TLS /
--

Change the port to 443.  Read the documentation
concerning the attributes (especially the sslProtocol
and clientAuth).

/mde/

--- vineesh kumar [EMAIL PROTECTED] wrote:

 Hi all,
 I manged to configure https on tomcat 5.5.9 with a
 passord different than
 changeit. It's working.But i tried to configure
 https on port 80 (i am
 running tomcat as root user). but when i point the
 browser to the system
 like https://localhost/ I am getting an error
 indicating that connection
 refused by the https server, but if we pint the
 browser like
 https://localhost:80/ it's working fine.
 but i want it in the former way. How can i do that?
 regards
 vineesh
 




__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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



RE: mysql connection with JSP

2005-10-06 Thread Mark Benussi
jdbc:mysql://hostname:3306/database?user=usernamepassword=password

However on a design front I would never personally look up a database
connection in a JSP. Others may disagree.

-Original Message-
From: Cengiz Yazgan [mailto:[EMAIL PROTECTED] 
Sent: 06 October 2005 11:46
To: 'Tomcat Users List'; 'Tomcat Users List'
Subject: mysql connection with JSP

Hi  everybody

I want to connect a mysql database with jsp code.
Can anybody help me to write a connection string.

Thx.


Cengiz YAZGAN
Sistem Mühendisi/System Engineer
DorukNet
Tel / Phone : +90 212 326 92 00 / 447
Fax : +90 212 227 28 11
E-mail : [EMAIL PROTECTED] 
http://www.doruk.net.tr 
http://www.doruk.net.tr/english.html



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


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



Issuing HTTP requests from inside JSP under Tomcat

2005-10-06 Thread Bandak, Mark
Folks:

I'm relatively new to the world of Tomcat, but ...

Have locally 'made' (make) Apache 2.0.54. Binary Tomcat 4.1.29. Locally built 
mod_jk (1.2.14). Platform is Solaris 9.

Have a vendor supplied JSP application. Runs beautifully under Tomcat 
'standalone'. 

Need to add to an existing server already running Apache on 443. Added 'my' 
Apache, Tomcat connector (mod_jk - ajp13).

Got that all working.

However, the application, in web.xml and 2 'properties' files, has references 
such as: http://localhost/path/update.jsp for example. As stated, under Tomcat 
standalone, this causes no problems.

But I find that with Apache - mod_jk (ajp13) - Tomcat - that these references 
'do not function'. From a Tomcat (vhost) log file ...

Error making connection to: 
http://marketplace.montgomerycollege.edu/marketplace/web/admin/buyer_updater.jsp?STATUS_CHECK=true
TAPP_SERVLET: Redirecting to 
http://marketplace.montgomerycollege.edu/marketplace/web/admin/home.jsp

(TAPP_SERVLET - the 'vendor supplied app' ... and this 'redirect' DOES work 
...???)

So, I've tried: localhost; 127.0.0.1; and numerous other permutations including 
pointing at the ajp13 port (8009).

I see NOTHING in the Apache logs, the above messages are from a logger in 
Tomcat. So, it appears to me that since Tomcat is already 'servicing' this 
application (via ajp13) - that there is some problem with issuing an HTTP 
request from inside the JSP in Tomcat? I have JkLogLevel set to debug, and I 
think I see it 'processing' this request, but then can't quite figure out 
what's happening ... the above error comes after a long period of 'sitting at 
the hourglass' (browser) ... so gather some timeout is coming into play ...

Any thoughts? Suggestions? Need more info? Trying not to send 'too much' info 
...

Many thanks ...

/Mark

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



Re: custom session manager

2005-10-06 Thread Mark
There is one problem with this approach.  Load balancing/clustering. 
If you have a HashMap in one tomcat JVM, how does that information get
propogated to other JVM's possibly on other machines?

Thank you by the way for all the inputs so far

On 10/6/05, Leon Rosenberg [EMAIL PROTECTED] wrote:
 On 10/6/05, Tobias Meyer [EMAIL PROTECTED] wrote:
  The problem is AFAIK, that you cannot access the list of all sessions
  through the servlet-api.
  That feature was in the servlet-api at some time, but was removed, IIRC due
  to security issues.
 
  If you have a list of all sessions, you can easily iterate over them at
  login and manually expire all old sessions for the same user. = Max. one
  active session per user.

 ok, got you, yes that's feasible
 thanx for explanations
 leon

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



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



Q:how to remove charset from HTTP responce to allow browser use a browser selected charset?

2005-10-06 Thread Mark
Hello,

In my application users enter data using different languages.
The problem I'm facing is the browser sets the page encoding always
to ISO-8859-1. (I guess this is default based on server OS)

User can change encoding on the page (Browser settings) and
everything looks OK but only for one page. On the next page encoding
is back to ISO-8859-1.
Is there any way to instruct tomcat not to send the page encoding?

I prefer not set it to specific one by using
meta http-equiv=Content-Type content=text/html; charset=
just want to remove charset from the header, so browser will use the
last selected charset.


I have Tomcat 5.0.24 on redhat 9
Thank you,
Mark.



__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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



Re: isapi_redirector2.dll question

2005-10-06 Thread Mark Thomas

John,

JK2 is deprecated. Are you sure you want to use it? See 
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/connectors.html 
for a list of connectors and current statuses for TC4.


Mark

John MccLain wrote:

I have installed the IIS to Tomcat redirector on my windows XP pro machine
and it works great. I took the same steps to install in on a win2k machine
running IIS5.0, and it fails. Both machines have the same tomcat version
(5.5.11) and both are configured identically. Here is the
workers2.properties file
-
#Look at
#http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/jk2/configwebcom.html
#for parameter description

[shm:]
info=Scoreboard. Required for reconfiguration and status with multiprocess
servers
file=c:/tomcat/temp/jk2.shm
size=1048576

#[channel.socket:localhost:8009]
#info=Ajp13 forwarding over socket
#tomcatId=localhost:8009

# define the worker
[ajp13:localhost:8009]
channel=channel.socket:localhost:8009
tomcatId=localhost:8009


# Map webapps to the Web server uri space
[uri:/Acuity/*]
-
I ahve also put the required registry entries in and added the dll as a
filter into IIS - both done on both machines.
All is fine on my machine, but on the win2k machine (with 256 mb memory),
the log file gives the error:

Error [jk_isapi_plugin.c(496)]HttpExtensionPOroc: worker is NULL


I have rebooted both machines, and the filter DOES have an up arrow listed
for its status in both machines.

My question is - What are the ways a worker is NULL can occur, and how do
I fix this error???

John McClain
Senior Software Engineer
TCS Healthcare
[EMAIL PROTECTED]
(530)886-1700x235
Skepticism is the first step toward truth


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








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



Re: how to disable jk2 and enable jk1 on Tomcat5 with Apache 1.3

2005-10-06 Thread Mark Thomas

alebu wrote:

On Tomcat startup there is info message that indicates that tomcat starts
using jk2.

As I understand, that cames from that line in server.xml:
Connector port=8009 enableLookups=false redirectPort=8443 debug=0
protocol=AJP/1.3 /

How to disable jk2 and prevent tomcat to use jk1.2 ?

 The info messages shows it starting with JK on my machine. I think 
we will need to see a copy of the message and your server.xml


Mark



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



Re: mysql connection with JSP

2005-10-06 Thread Mark Thomas
When starting a new thread (ie sending a message to the list about a 
new topic) please do not reply to an existing message and change the 
subject line. To many of the list archiving services and mail clients 
used by list subscribers this  makes your new message appear as part 
of the old thread. This makes it harder for other users to find 
relevant information when searching the lists.


This is known as thread hijacking and is behaviour that is frowned 
upon on this list. Frequent offenders will be removed from the list. 
It should also be noted that many list subscribers automatically 
ignore any messages that hijack another thread.


The correct procedure is to create a new message with a new subject. 
This will start a new thread.


Mark
tomcat-user-owner


Cengiz Yazgan wrote:

Hi  everybody

I want to connect a mysql database with jsp code.
Can anybody help me to write a connection string.

Thx.


Cengiz YAZGAN
Sistem Mühendisi/System Engineer
DorukNet
Tel / Phone : +90 212 326 92 00 / 447
Fax : +90 212 227 28 11
E-mail : [EMAIL PROTECTED] 
http://www.doruk.net.tr 
http://www.doruk.net.tr/english.html




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








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



Re: Why Tomcat return me a OLD version of my doc.jar ?

2005-10-06 Thread Mark Thomas
When starting a new thread (ie sending a message to the list about a 
new topic) please do not reply to an existing message and change the 
subject line. To many of the list archiving services and mail clients 
used by list subscribers this  makes your new message appear as part 
of the old thread. This makes it harder for other users to find 
relevant information when searching the lists.


This is known as thread hijacking and is behaviour that is frowned 
upon on this list. Frequent offenders will be removed from the list. 
It should also be noted that many list subscribers automatically 
ignore any messages that hijack another thread.


The correct procedure is to create a new message with a new subject. 
This will start a new thread.


Mark
tomcat-user-owner


Amadeo Alonso wrote:

Hi all,
¿Can anyone explain it , please?

I use Tomcat 5.5 as server pages html with an 'Applet' that uses a 
'doc.jar'
I have placed two connector tags  in 'server.xml' file to use ports 
:80 y :8080 in the same way
I Have fixed bugs from mi 'doc.jar' (v1) to a new version with the same 
name 'doc.jar' (v2)


and now, (using IExplorer):

OK: 
_http://expresiongrafica.caminos.upm.es:8080/PAU/PAU-Septiembre2005-C2.html

return de rigth 'doc.jar' (v2)

BUT: 
_http://expresiongrafica.caminos.upm.es:80/PAU/PAU-Septiembre2005-C2.html
   o 
_http://expresiongrafica.caminos.upm.es/PAU/PAU-Septiembre2005-C2.html
return me the OLD VERSION of 'doc.jar' (v1) with the old bugs, as I 
deduct from the 'Java Console'


OK also _http://localhost /PAU/AppletDoc.html   (or 127.0.0.1)
 _http://localhost:80/PAU/AppletDoc.html
 _http://localhost:8080/PAU/AppletDoc.html
 _http://localhost:8080/PAU/AppletDoc.html

BUT  _http://138.100.67.143:8080/PAU/AppletDoc.html OK
_http://138.100.67.143 /PAU/AppletDoc.html (o 
:80) BAD, v1


How can I destroy the old version? where is it? What is it happening?

regards
amadeo.



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








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



Re: exception in session handling

2005-10-06 Thread Mark Thomas

Ronald Klop wrote:

Hello,

Is it normal that the session is invalidated before the valueUnbound 
handlers are called?


The spec is your friend.

spec-quote section=SRV.15.1.7
...For sessions that are invalidated or expire, notifications are sent 
after the session has been invalidated or expired...

/spec-quote

Mark



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



Re: Q:how to remove charset from HTTP responce to allow browser use a browser selected charset?

2005-10-06 Thread Mark Thomas

Mark wrote:

Hello,

In my application users enter data using different languages.
The problem I'm facing is the browser sets the page encoding always
to ISO-8859-1. (I guess this is default based on server OS)

User can change encoding on the page (Browser settings) and
everything looks OK but only for one page. On the next page encoding
is back to ISO-8859-1.
Is there any way to instruct tomcat not to send the page encoding?


If you are using JSPs, no. The spec requires that the charset is set.

Mark



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



Re: Q:how to remove charset from HTTP responce to allow browser use a browser selected charset?

2005-10-06 Thread Mark
Hi Mark,
In my case servlet generates an output, so no JSP for now...
Can I do it using filters? Or define and store user's prefs with
encoding outside of tomcat and  in the session and use if it's exists
in the session?

Thanks a lot!
Mark.

--- Mark Thomas [EMAIL PROTECTED] wrote:

 Mark wrote:
  Hello,
  
  In my application users enter data using different languages.
  The problem I'm facing is the browser sets the page encoding
 always
  to ISO-8859-1. (I guess this is default based on server OS)
  
  User can change encoding on the page (Browser settings) and
  everything looks OK but only for one page. On the next page
 encoding
  is back to ISO-8859-1.
  Is there any way to instruct tomcat not to send the page
 encoding?
 
 If you are using JSPs, no. The spec requires that the charset is
 set.
 
 Mark
 
 
 

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





__ 
Yahoo! for Good 
Donate to the Hurricane Katrina relief effort. 
http://store.yahoo.com/redcross-donate3/ 


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



RE: [OT] How much RAM can java use

2005-10-06 Thread Mark Benussi
This was probably one of the best threads I have 'listened' to in ages. I am
researching setting up my own Tomcat hosting. This is going to be of use.

-Original Message-
From: Leon Rosenberg [mailto:[EMAIL PROTECTED] 
Sent: 06 October 2005 20:48
To: Tomcat Users List
Subject: Re: [OT] How much RAM can java use

Chuck, Ryan,

thanx, you were extremely helpful!

regards
Leon

On 10/6/05, J. Ryan Earl [EMAIL PROTECTED] wrote:
 Leon Rosenberg wrote:

 Debian 3.1, kernel 2.6.x-smp (32 bit)
 or
 Debian 3.1, kernel 2.6.x-smp-emt64 (64 bit)
 
 Hardware: AMD Opteron and Xeon64 (both 64 bit)
 
 SUN jdk1.5 and/or jdk1.4.2
 
 4 GB total RAM for 32-bit linux, with 3/1 memory partitioning
 16GB total RAM for 64-bit linux.
 
 
 I've tested 32/64 bit JVMs extensively and done considerable amount of
 JAVA_OPTS tuning for my company's application.  On a 32-bit machine you
 can't reliably go above a -Xms=1600m without getting OOM errors.  With a
 3/1 split your virtual page table size for the entire JVM process must
 be below 3GB total virtual memory.  That's 3GB allocated, not commited.
 The JVM allocates a lot more memory besides the heap.

 With the 64-bit JVMs, the sky's the limit, however the 64-bit address
 also make your application take up more space relative to a 32-bit JVM.
 A 3.2GB 64-bit heap space isn't going to double the amount of identical
 objects you can create as compared to a 32-bit 1.6GB heap space because
 all pointer references will occupy twice the space.

 -ryan

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



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


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



Re: Embedded Tomcat and SSL?

2005-10-06 Thread Mark
are you using Apace with Tomcat?  I have done embedded Tomcat and SSL,
but it was Apache sitting in front of Tomcat.

On 10/6/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Hi,

 I am using an embedded tomcat instance within my application. I am
 trying to set up a connector using SSL. When I start the server, it
 creates the connector and bind to the port successfully. When I request
 a page from the web browser, I get the following error in my browser:

 The connection to the server has terminated unexpectedly. Some data
 may have been transferred.

 The same scenario works fine with HTTP.

 Here is my code snippet:
 // APPPORT and isSSLEnabled are set correctly to 8443 and true.
 Connector httpConnector =
 this._server.createConnector((java.net.InetAddress)null,
 Integer.parseInt(ApplicationResourcesUtil.getProperty(Constants.RESOURCEKEY_APPPORT)),isSSLEnabled);

 //add new Connector to set of Connectors for embedded server,
 associated with Engine
 this._server.addConnector(httpConnector);
 this._server.start();

 Looking at the tomcat website, they talk about registering keystore.
 What APIs do I use to programmatically specify the keystore file? Is
 there something else that needs to be configured before SSL will work
 in the embedded more?

 Thanks,

 -Andy




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



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



Re: Mod_jk + Apache on RHEL3 gives 503 for jsp only

2005-10-06 Thread Mark Eggers
--- [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:

 I have jakarta-tomcat-5.5.9 installed and working
 properly on the new
 server.  It is perfectly accessible from the legacy
 web server.

By perfectly accessible you mean . . . ?
 
 The main page, home.jsp, loads fine in the servlet
 if no page is given.
 http://webserver/PI/  The home.jsp spawns a 503 if
 is in the URL.
 http://webserver/PI/home.jsp   I can successfully
 get images from the
 page from the tomcat instance.  It does not like the
 .jsp extension.

By successfully getting images, do you mean:

http://webserver/PI/image.png

or

http://tomcatserver:8080/PI/image.png

 I have watched in Ethereal as no traffic goes from
 the apache to the
 tomcat.
 I have tried using the loopback and local network
 address.

Why?  Is this Tomcat instance on the same server?

 
 #INSERT OF TOMCAT CONF PARAMETERS
 # Load mod_jk module
 # LoadModule jk_module modules/mod_jk.so
 LoadModule jk_module /etc/httpd/modules/mod_jk.so
 
 # Declare the module for IfModule directive
 #AddModule mod_jk.c
 
 # Where to find workers.properties
 JkWorkersFile /etc/httpd/conf/workers.properties
 
 # Where to put jk logs
 JkLogFile /var/log/httpd/mod_jk.log
 
 # Set the jk log level [debug/error/info]
 JkLogLevel debug
 
 # Select the log format
 JkLogStampFormat [%a %b %d %H:%M:%S %Y] 
 
 # JkOptions indicate to send SSL KEY SIZE,
 JkOptions +ForwardKeySize +ForwardURICompat
 -ForwardDirectories
 
 # JkRequestLogFormat set the request format
 JkRequestLogFormat %w %V %T
 

I don't see the specification for JkShmFile

 # Send servlet for context /examples to worker named
 worker1
 JkMount /examples/servlet/* worker1

The above should be:

JkMount /servlets-examples/servlet/* worker1

 JkMount /PI/* worker3
 #JkMount /PI/*.jsp worker3

Why are you using worker3 here?

 # Send JSPs for context /examples to worker named
 worker1
 JkMount /examples/*.jsp worker1

The above shoould be /jsp-examples/*.jsp worker1

 JkMount /journals/*.jsp worker1
 
 Worker Properties
 /etc/httpd/conf/workers.properties
 # Define some properties
 workers.apache_log=/var/log/httpd/

workers.tomcat_home=/usr/local/tomcat/jakarta-tomcat-5.5.9
 workers.java_home=/usr/bin/java
 ps=/
 
 #
 worker.list=worker1
 

According to the documentation this should contain a
comma separated list of all the workers.  However, if
you're going to the same Tomcat instance all the time,
you'll only need one worker definition

 # Set properties for worker1 (ajp13)
 worker.worker1.type=ajp13
 worker.worker1.host=172.20.1.19
 worker.worker1.port=8009
 

First of all, there should only be one worker list. 
Second of all, why do you have multiple workers going
to the same host but different ports?  Do you have
multiple Tomcats running on this host?

 #
 worker.list=worker2
 
 # Set properties for worker2 (ajp13)
 worker.worker2.type=ajp13
 worker.worker2.host=172.20.1.19
 worker.worker2.port=10009
 
 #
 worker.list=worker3
 
 # Set properties for worker3 (ajp13)
 worker.worker3.type=ajp13
 worker.worker3.host=127.0.0.1
 worker.worker3.port=8099
 
 #
 worker.list=worker4
 
 # Set properties for worker4 (ajp13)
 worker.worker4.type=ajp13
 worker.worker4.host=172.20.1.19
 worker.worker4.port=8099

Even after all that is done, there are some other
issues when connecting Apache httpd and Tomcat.  If
Apache's DocumentRoot does not correspond to Tomcat's
appBase, then any static files contained in the
application will not be served by Apache without some
more Apache configuration changes.

There are several ways of accomplishing this, using
the Directory directive and Aliases or JkAutoAlias in
Apache's httpd.conf.

/mde/



__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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



Re: Context path changes in context.xml not working

2005-10-05 Thread Mark Eggers
As mentioned several times on the mailing list, path
is no longer read from webapp/META-INF/context.xml.

Try placing the context information in: 

engine-name\hostname\appname.xml

under %CATALINA_HOME%\conf or %CATALINA_BASE%\conf if
you're using multiple Tomcats served from one binary.

If you're using the defaults, then engine-name is
Catalina and hostname is localhost.

HTH

/mde/

--- David Kerber [EMAIL PROTECTED] wrote:

 Running Tomcat 5.5.9 on Windows 2000 server.
 
 I am trying to change the context path of an
 application, and it works 
 fine when I put this into my server.xml:
 
   Context path=/wradev/pelican 
 docBase=e:\TomcatClients\Pelican\webapps\SiteData
 debug=0 
 reloadable=true autoDeploy=true
 unpackWARs=true crossContext=false/
 
 According to the docs, putting this into the
 server.xml is not the 
 preferred way, but when I put it into my 
 webapps/SiteData/META-INF/context.xml, it doesn't
 seem to take effect, 
 even when I stop and restart Tomcat.
 
 Is there something I'm missing here?  Or is it a bug
 which will be fixed 
 in a later release.
 
 Dave
 

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




__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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



Re: Tomcat Manager, Session Statistics

2005-10-05 Thread Mark Thomas

Jean-Pierre Pelletier wrote:

Hi,

1) When I look at sessions statistics for an application,
using https://localhost/manager/html/sessions?path=/myApplication

Why does Tomcat always list the number of sessions to expired
within 10 minutes as equal to the number of active sessions?


Looks like a bug to me.



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



sharing session information across tomcats on different machines

2005-10-05 Thread Mark
Is there any possibility for tomcats on separate machines to share
session information.  I am looking into load balancing a few tomcats
with an apache in front of them.  In other words, the setup will be

internet - Apache(s) - Tomcats

Is it possible for this type of scenario to exist, and sesion
information be shared?


Thank you.

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



Re: custom session manager

2005-10-05 Thread Mark
This is about 90% of what I want.  One of the features I want to put
into my session manager is the ability to only have one open session
per user.  What I would like is to have a createSession method that
takes in user and host.  This way I could be relatively sure that the
user could only have one session at a time.
The way the API looks is I have no way of passing this information
into the createSession method.  Is this true?  Or do I have to extend
some of the low-level tomcat code in order to make this work?

TIA for any help you can provide.

On 9/29/05, Leon Rosenberg [EMAIL PROTECTED] wrote:
 check this out:

 http://www.niallp.pwp.blueyonder.co.uk/TomcatBug36541.html

 The link itself handles a bug, but one of the solutions is to replace
 the std. manager with custom manager with all info you need to
 actually do this. I thin kthis fits your question.

 regards
 leon

 On 9/29/05, Mark [EMAIL PROTECTED] wrote:
  After using tomcat since the 3.x days, I have been very impressed with
  the amount of flexibility and configuration options that I have
  available to me.
 
  One part of the tomcat design that I do not believe is very flexible
  is the ability to set up a custom session manager.  So maybe I am
  missing something, but how would I go about writing this for tomcat?
  I know I am being very vague, but how much work am I potentially
  signing myself up for here if I wanted to create a custom session
  manager?
 
 
  Thank you.
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


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



Re: custom session manager

2005-10-05 Thread Mark
basically, I want to prevent users from logging in and creating a
second session if a valid session for that user already exists.

For instance.

1. Log in to my web app, session is created
2. browse around in my web app
3. close browser, do not logout
4. Start browser up again
5. try and log in
6. Do not allow login, have user 'reconnect' to the old session
created in step 1.

I have written quite a few web based apps, and I know of no way to
kill the session at step 3.

Hope this clears things up.

Thanks again!

On 10/5/05, Leon Rosenberg [EMAIL PROTECTED] wrote:
 I have never seen that the getRemoteUser method you are referring to
 returned something userful, or just something other then null. Taken
 in account different browsers, proxies, internet-cafes... I don't
 think it's possible.
 On the other hand, why do you need that? As a matter of security this
 will not work, because an intruder will simply use a patched browser
 and a proxy. Maybe if you  tell us what you trying to achieve, we can
 provide you a better solution.

 regards
 leon

 On 10/5/05, Mark [EMAIL PROTECTED] wrote:
  This is about 90% of what I want.  One of the features I want to put
  into my session manager is the ability to only have one open session
  per user.  What I would like is to have a createSession method that
  takes in user and host.  This way I could be relatively sure that the
  user could only have one session at a time.
  The way the API looks is I have no way of passing this information
  into the createSession method.  Is this true?  Or do I have to extend
  some of the low-level tomcat code in order to make this work?
 
  TIA for any help you can provide.
 
  On 9/29/05, Leon Rosenberg [EMAIL PROTECTED] wrote:
   check this out:
  
   http://www.niallp.pwp.blueyonder.co.uk/TomcatBug36541.html
  
   The link itself handles a bug, but one of the solutions is to replace
   the std. manager with custom manager with all info you need to
   actually do this. I thin kthis fits your question.
  
   regards
   leon
  
   On 9/29/05, Mark [EMAIL PROTECTED] wrote:
After using tomcat since the 3.x days, I have been very impressed with
the amount of flexibility and configuration options that I have
available to me.
   
One part of the tomcat design that I do not believe is very flexible
is the ability to set up a custom session manager.  So maybe I am
missing something, but how would I go about writing this for tomcat?
I know I am being very vague, but how much work am I potentially
signing myself up for here if I wanted to create a custom session
manager?
   
   
Thank you.
   
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   
   
  
 

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



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



Re: Context path changes in context.xml not working

2005-10-05 Thread Mark Eggers
Did you try it in:

$CATALINA_HOME/conf/engine-name/hostname/appname.xml?

/mde/

--- David Kerber [EMAIL PROTECTED] wrote:

 Nobody has any suggestions about setting up a
 2-level context path 
 *without* putting it in the server.xml (it works
 fine in there)?
 
 Dave




__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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



Re: setting the context path in tomcat5.5.9?

2005-10-04 Thread Mark Thomas
When starting a new thread (ie sending a message to the list about a 
new topic) please do not reply to an existing message and change the 
subject line. To many of the list archiving services and mail clients 
used by list subscribers this  makes your new message appear as part 
of the old thread. This makes it harder for other users to find 
relevant information when searching the lists.


This is known as thread hijacking and is behaviour that is frowned 
upon on this list. Frequent offenders will be removed from the list. 
It should also be noted that many list subscribers automatically 
ignore any messages that hijack another thread.


The correct procedure is to create a new message with a new subject. 
This will start a new thread.


Mark
tomcat-user-owner


Mbah Tenjoh-Okwen wrote:

hello

i would like to know how to set the context path in
tomcat5.5.9 hi

 I  also read something and a build.properties file
and i dont know how to do this too.

please i need help on this cause i cant see my
application file when i give in the uri
http://localhost:8080/myApp






___ 
How much free photo storage do you get? Store your holiday 
snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com


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








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



Re: httpConnector secure=true problem (second attempt)

2005-10-04 Thread Mark Thomas

This is a bug that is fixed in 5.5.10+

Mark

Reynir Hubner wrote:

Hi,

I'm trying to have one connector on tomcat 5.0.x open with secure=true
with
out it being SSL or https. I just want request.isSecure() return true.
This is the setup for the connector :

  Connector port=9020

   maxThreads=150 minSpareThreads=25 maxSpareThreads=75

   enableLookups=false redirectPort=8443 acceptCount=100

   debug=99 connectionTimeout=2

   disableUploadTimeout=true secure=true scheme=http  /

The port is opened with out errors, but does never return anything, and
I see no errors in my log.
Am I missing out on something or is this a bug ?, It works fine with
tomcat 4.1.x.

Any suggestions ?
thanx
[EMAIL PROTECTED]

ps. thanx for the info Mark.


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








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



Re: Certificate authentication

2005-10-04 Thread Mark Thomas

James Rome wrote:

Why don't my methods get called? The start() method gets called, but
nothing else.
Take a look at 
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/catalina/docs/api/org/apache/catalina/authenticator/package-summary.html


Mark



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



Re: Setting up HTTP Basic for a full Web-App

2005-10-04 Thread Mark Thomas

David,

You post is missing some key information before anyone here is going 
to be able to help you.


What happens that you don't expect to happen?
What doesn't happen that you do expect to happen?

Mark

David Johnson wrote:

Anyone have any thoughts on this?

On 9/30/05, David Johnson [EMAIL PROTECTED] wrote:


Hi all.

I think I'm doing something wrong. I'veadded the following to my web
application to use http-basicis there anything else I need to do to ensure
anyone logging in like this has full access to the app?

!-- Define a security constraint on this application --
security-constraint
 web-resource-collection
   web-resource-nameEntire Application/web-resource-name

   url-pattern/*/url-pattern
 /web-resource-collection
 auth-constraint
   !-- This role is not in the default user directory --
   role-namemanager/role-name

 /auth-constraint
/security-constraint

!-- Define the login configuration for this application --
login-config
 auth-methodBASIC/auth-method
 realm-nameMy Application/realm-name

/login-config

!-- Security roles referenced by this web application --
security-role
 description
   The role that is required to log in to the Application
 /description

 role-namemanager/role-name
/security-role



--
-Dave
[EMAIL PROTECTED]






--
-Dave
[EMAIL PROTECTED]






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



Re: WebDAV characters bug?

2005-10-03 Thread Mark Thomas
Looks like a bug to me. Create a bugzilla entry for it and I'll try 
and take a look before the next release.


Mark

Roland Rabben wrote:

I am using Tomcat 5.5.9 (on Windows XP) and WebDAV to upload files to my
server. However it seems to be a bug or limitation in the Tomcat WebDAV
that limits the use of some characters I frequently use.

Unsupported characters are :
; (semicolon)
+ (plus)
# (pound)

I know these are reserved characters, so I have tried to URL encode
them, but Tomcat ignores the URL encoding and writes the URL encoded
filenames to disk. Eg. myfile;01.txt is saved like myfile%B301.txt
on the server. Tomcat is configured to do URL Encoding. If I don't do
URL Encoding it simply cuts the end of the filename from semicolon like
myfile.

This is my Connector configuration in server.xml:
 Connector port=80 
 maxHttpHeaderSize=8192 useBodyEncodingForURI=true

URIEncoding=UTF-8
 maxThreads=150 minSpareThreads=25 maxSpareThreads=75
 enableLookups=false redirectPort=8443 acceptCount=100
 connectionTimeout=2 disableUploadTimeout=true /

I also tested this in Tomcat 5.5.12 with same problems. I have tested
several clients. IE 6.0, DavExplorer and own code.

The reason I think this is a bug is because these characters are
supported by Apache/mod_dav. 
Anyone know of a fix to this problem, or if it is a known bug?


Regards
Roland Rabben
Technical Director
Scala Nordic AS
[EMAIL PROTECTED]

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








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



Re: http connector secure=true

2005-10-03 Thread Mark Thomas
When starting a new thread (ie sending a message to the list about a 
new topic) please do not reply to an existing message and change the 
subject line. To many of the list archiving services and mail clients 
used by list subscribers this  makes your new message appear as part 
of the old thread. This makes it harder for other users to find 
relevant information when searching the lists.


This is known as thread hijacking and is behaviour that is frowned 
upon on this list. Frequent offenders will be removed from the list. 
It should also be noted that many list subscribers automatically 
ignore any messages that hijack another thread.


The correct procedure is to create a new message with a new subject. 
This will start a new thread.


Mark
tomcat-user-owner


Reynir Hubner wrote:

Hi,

I'm trying to have one connector on tomcat open with secure=true with
out it being SSL or https. I just want request.isSecure() return true.
This is the setup for the connector :

  Connector port=9020

   maxThreads=150 minSpareThreads=25 maxSpareThreads=75

   enableLookups=false redirectPort=8443 acceptCount=100

   debug=99 connectionTimeout=2

   disableUploadTimeout=true secure=true scheme=http  /

The port is opened with out errors, but does never return anything, and
I see no errors in my log.
Am I missing out on something or is this a bug ?, It works fine with
tomcat 4.1.x.

Any suggestions ?
thanx
[EMAIL PROTECTED]


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








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



Re: combining form based authentication with https

2005-10-01 Thread Mark Thomas

Peddireddy Srikanth wrote:

Hi all,

I have a basic doubt  If there are any resoursec which will me on this
please point me towards them. I will carry on from there.

My question is how to combine the form based authentication, where we use
jsecuritycheck , jusername etc with https.
As far as I know if we use form based authentication username and
password will be authenticated by the container managed resource
called 'jsecuritycheck. But the data transfer from client browser to
tomcat will be still a plain text. i want to encrypt this and
obviously i need to use https.
So how to combine both  and how tomcat wil help me doping this??


Providing you have an https connector configured, you can use 
something like this in your security-constraint


user-data-constraint
  transport-guaranteeCONFIDENTIAL/transport-guarantee
/user-data-constraint

See the spec for more details.

Mark



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



Re: wrapper.properties is existing?

2005-10-01 Thread Mark Thomas

Matson, Sunny (GE Healthcare) wrote:

Hi All,

   Is there any wrapper.properties file we can write in Tomcat 5.5
which is equivalent to jserv.properties in Jserv. If it is, how should I
write this file and where I need to place it. 


Don't know. What does it do?

Mark



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



Re: Charset configurations for JSP pages

2005-10-01 Thread Mark Thomas

Mieke Banderas wrote:

Mark Thomas said:

Read the spec.

Where in the spec?


JSP.4 Internationalization Issues would seem to be a blinding 
obvious place to start.


Mark



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



Re: Reg form based authentication

2005-10-01 Thread Mark Thomas

sree kanth wrote:

Hi all,
i have been developing on JSP's for the last one year,but still i have never
implemented form based authentication.
Can any one help me in implenting form based authentication?
Thank you all
Sreekanth


Very basic example:
Put login.jsp and error.jsp in the root of your application and add 
the web.xml snippet to your application's web.xml file.


Mark

login.jsp
html
  head
titleLogin/title
  /head
  body
form method=POST action='%= 
response.encodeURL(j_security_check) %' name=loginForm

  input type=text name=j_username size=16 id=username/
  input type=password name=j_password size=16 id=password/
  input type=submit value=Submit /
  input type=reset value=Reset /
/form
  /body
/html

error.jsp
html
  head
titleLogin Error/title
  /head
  body
pLogin failed./p
  /body
/html

web.xml snippet
  login-config
auth-methodFORM/auth-method
realm-nameTest/realm-name
form-login-config
  form-login-page/login.jsp/form-login-page
  form-error-page/error.jsp/form-error-page
/form-login-config
  /login-config



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



Re: Running Servlet in Tomcat

2005-09-29 Thread Mark Thomas

Reading the provided documentation is usually a good place to start.

Singh, VilishKumar wrote:

I have done that.
I have not used any package in my servlet.

You must place all your class files in packages.
http://jakarta.apache.org/tomcat/faq/classnotfound.html


Can u describe the steps precisely to run the first servlet in tomcat

http://jakarta.apache.org/tomcat/tomcat-5.5-doc/appdev/index.html

Mark



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



Re: Webapp deploy on windows

2005-09-29 Thread Mark Thomas

Joakim Ahlén wrote:
I'm not trying to blame anyone for not fixing this issue, (well, maybe 
i'm laying some blame on those who thinks this is _not_ a tomcat 
issue..) however, i am really interested in having this bug fixed, and i 
am prepared to put some effort and time into it myself. To do this, 
though, i need the help of someone who knows more about this problem.


As far as I am aware, the Tomcat code correctly closes all the files 
it opens. However, we are dependent on a number of third party 
libraries that might not be as well behaved. See bug 10026 for an 
example of a typical situation.


If you want to put some effort into this the best thing you could do 
is create the simplest possible test .war file that demonstrates this 
issue so we can take a look at it. If the anti-locking features of TC5 
(which are better than TC4) don't fix it then we can look to see if 
there is anything that can be done to improve things.


However, please remeber that this is fundamentally an OS issue, not a 
Tomcat one, and the fix may well be outside of our control.


Mark



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



Re: Why doesn't my context work?

2005-09-29 Thread Mark Eggers
--- Michael Sullivan [EMAIL PROTECTED] wrote:

[ lots of stuff snipped ]

OK, I finally got around to putting this together on
my Limux (Fedora Core 4) box.

My environment:
2.6.12-1.1456_FC4 running on a Dell 8200 with 768 MB
java 1.5.0_04-b05
apache 2.0.54
mod_jk 1.2.14.1
tomcat 5.5.9

My configurations:

#
# httpd.conf stuff
#
LoadModulejk_module modules/mod_jk.so

JkWorkersFile /etc/httpd/conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevelwarn
JkLogStampFormat  [%a %b %d %H:%M:%S %Y] 
JkShmFile logs/shm-file

LoadModule userdir_module modules/mod_userdir.so
IfModule mod_userdir.c
UserDir enable username
/IfModule

Directory /home/*/webspace
  AllowOverride FileInfo AuthConfig Limit
  Options MultiViews Indexes SymLinksIfOwnerMatch
IncludesNoExec
Limit GET POST OPTIONS
Order allow,deny
Allow from all
/Limit
LimitExcept GET POST OPTIONS
Order deny,allow
Deny from all
/LimitExcept
/Directory

#
# Adding JkMounts for UserDir
#
JkMount /~*/*.jsp local
JkMount /~*/*/*.jsp   local
JkMount /~*/servlet/* local
JkMount /~*/*.do  local

#
# workers.properties stuff - mostly default for now
#
worker.list=local

#
# one to serve the applications
#
worker.local.type=ajp13
worker.local.host=localhost
worker.local.port=8009

#
# server.xml stuff in Tomcat under Host/Host
#
!-- adding listener to test local host directories
--
Listener 
  className=org.apache.catalina.startup.UserConfig
  directoryName=webspace
  userClass=
 org.apache.catalina.startup.PasswdUserDatabase/

NOTES
=
httpd.conf
--
1. Add the appropriate user names in the line:

UserDir enable username

This is a space-separated list of user names. 
Otherwise you can just have:

UserDir enabled

to get them all.

2. Excuse the wrapping in the Options line under the
Directory directive.

workers.properties
--
This is just a bare bones one.  There are lots of
options to explore.

server.xml
--
This is the listener that will add the same directory
to Tomcat that was added to Apache with the userdir
module.

RESULTS
===
You will get a single web application under
/~username.  If you look at Tomcat's manager
application, you will see a /~username application.

I ran the first application from the Head First
Servlets  JSP book (my standard is it working
application) and this setup worked.

One thing to note.  I did not get Tomcat to explode a
war file in /~username.  I had to explode the war
manually in ~username/webspace.

I didn't see a way of adding multiple user
applications by using this listener.  I just did a
quick scan of the UserConfig javadoc.  My guess is
that if you want multiple web applications per user
you will have to set up a virtual host for each user.

Just some thoughts.

HTH

/mde/




__ 
Yahoo! for Good 
Donate to the Hurricane Katrina relief effort. 
http://store.yahoo.com/redcross-donate3/ 


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



Re: Embedded Tomcat and shared objects...

2005-09-28 Thread Mark
I have done something like this.  The Factory and Singleton design
patters work perfectly for this type of thing.  If you create an
abstraction layer, then there should be no problems


On 9/28/05, Leon Rosenberg [EMAIL PROTECTED] wrote:
 still, spring can use the same factory.
 If not, use a container that can use factories :-)

 If nothing works, the hack would be:

 class MyObjectInstanceHolder{
   private static MyObject instance;

   public set/getInstance...
 }

 ?
 regards
 leon

 On 9/28/05, Darryl L. Pierce [EMAIL PROTECTED] wrote:
  Leon Rosenberg wrote:
   Aehm, without looking deeper into context initialization, just a short 
   guess:
   what about making your configuration objects a singleton with
   public static CLASSNAME getInstance()
   or
   provide a factory for them?
 
  Because the class in question is created by Spring's application context.
 
  --
  Darryl L. Pierce [EMAIL PROTECTED]
  Homepage: http://mcpierce.multiply.com/
  Bury me next to my wife. Nothing too fancy... - Ulysses S. Grant
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 

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



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



Re: Possible Security Bug

2005-09-28 Thread Mark Thomas

John Caron wrote:
I have a _possible_ bug involving security in Tomcat 5.0.28. I dont see 
it in the bug database, although it may be described in a way that I 
didnt search for.


I would prefer to send it privately in case its real. If thats not 
feasible, I will post it here. Or is there a way to put it in the 
database but mark it private?


Can anyone advise?


Security bugs should be sent to [EMAIL PROTECTED] (who will send it 
on to the tomcat team). If you send it to me directly I'll take a look 
now.


One other point, when sending a message on a new topic to the list, 
please don't reply to an old message and change the subject line. 
Thread aware mail clients still recognise your new message as part 
of the old thread. The correct process is to create a new message.


Mark
[EMAIL PROTECTED]



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



Re: Virtual hosts and Threads

2005-09-28 Thread Mark Thomas
When starting a new thread (ie sending a message to the list about a 
new topic) please do not reply to an existing message and change the 
subject line. To many of the list archiving services and mail clients 
used by list subscribers this  makes your new message appear as part 
of the old thread. This makes it harder for other users to find 
relevant information when searching the lists.


This is known as thread hijacking and is behaviour that is frowned 
upon on this list. Frequent offenders will be removed from the list.


The correct procedure is to create a new message with a new subject. 
This will start a new thread.


Mark
tomcat-user-owner

Mahesh S Kudva wrote:

Hi All

I have setup virtual hosts for 3 apps with virtual hosts config as 
follows. These virtual hosts are first handled by Apache and mod_jk. My 
apps have scheduler and automated mailing services.


Host name=vhost.domain.com debug=0 appBase=”deploy” 
unpackWARs=true

Aliaswww.vhost.domain.com/Alias
Logger className=org.apache.catalina.logger.FileLogger
directory=${jboss.server.home.dir}/log prefix=vhost_log1. 
suffix=.log timestamp=true/
 Context path= 
docBase=${jboss.server.home.dir}/deploy/application.war debug=0 
reloadable=true/

 /Host

This config is mailing the same mail 7 time. Further I noticed that there 
were 7 service started of the same kind. Querying the developer, he said 
that he had coded the apps to have the mail sent once every week. The 
mails are sent once every week but as said 7 copies of the same mail is 
delivered.


The request for the app results in page not found if I follow the 
following config, even thought there is no error in startup.


Context path=application 
docBase=${jboss.server.home.dir}/deploy/application.war debug=0 
reloadable=true/




Can you guys have any idea on this and help me troubleshoot ???


Regards  Thanks

Mahesh S Kudva


---
Robosoft Technologies - Partners in Product Development


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








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



Re: Vexing Problem with Tomcat connector

2005-09-28 Thread Mark Thomas
When starting a new thread (ie sending a message to the list about a 
new topic) please do not reply to an existing message and change the 
subject line. To many of the list archiving services and mail clients 
used by list subscribers this  makes your new message appear as part 
of the old thread. This makes it harder for other users to find 
relevant information when searching the lists.


This is known as thread hijacking and is behaviour that is frowned 
upon on this list. Frequent offenders will be removed from the list. 
It should also be noted that many list subscribers automatically 
ignore any messages that hijack another thread.


The correct procedure is to create a new message with a new subject. 
This will start a new thread.


Mark
tomcat-user-owner

[EMAIL PROTECTED] wrote:

Hello,

I have a website that I am migrating to a new server.

Server is Redhat ES3 2.4.21-20.0.1.ELsmp.  Server version: Apache/2.0.46

I have jakarta-tomcat-5.5.9 installed and working properly on the new
server.  It is perfectly accessible from the legacy web server.  


On the Website on the new server, access to jsp based pages give a 503
error.

The main page, home.jsp, loads fine in the servlet if no page is given.
http://webserver/PI/  The home.jsp spawns a 503 if is in the URL.
http://webserver/PI/home.jsp   I can successfully get images from the
page from the tomcat instance.  It does not like the .jsp extension.

In the mod_jk log i can see the match made:
[Wed Sep 28 10:29:14 2005] [18841:2816] [debug]
map_uri_to_worker::jk_uri_worker_map.c (461): Attempting to map context
URI '/PI/*'
[Wed Sep 28 10:29:14 2005] [18841:2816] [debug]
map_uri_to_worker::jk_uri_worker_map.c (475): Found a wildchar match
worker3 - /PI/*
  
However, in the apache access log is the 503. 
xxx.89.23.173 - - [28/Sep/2005:10:29:14 -0400] GET /PI/home.jsp

HTTP/1.1 503 412 - Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US;
rv:1.7.12) Gecko/20050915 Firefox/1.0.7
SESSIONID=128F9AD992A16BC3D3EB1ED0AD5549C1

I have watched in Ethereal as no traffic goes from the apache to the
tomcat.
I have tried using the loopback and local network address.
I have tried adding a *.jsp directive to the mod_jk config for the
servlet.

Any help would be appreciated.  I have a dent in my desk from hitting it
with my forehead.

Apache Config:

#INSERT OF TOMCAT CONF PARAMETERS
# Load mod_jk module
# LoadModule jk_module modules/mod_jk.so
LoadModule jk_module /etc/httpd/modules/mod_jk.so

# Declare the module for IfModule directive
#AddModule mod_jk.c

# Where to find workers.properties
JkWorkersFile /etc/httpd/conf/workers.properties

# Where to put jk logs
JkLogFile /var/log/httpd/mod_jk.log

# Set the jk log level [debug/error/info]
JkLogLevel debug

# Select the log format
JkLogStampFormat [%a %b %d %H:%M:%S %Y] 

# JkOptions indicate to send SSL KEY SIZE,
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories

# JkRequestLogFormat set the request format
JkRequestLogFormat %w %V %T

# Send servlet for context /examples to worker named worker1
JkMount /examples/servlet/* worker1
JkMount /PI/* worker3
#JkMount /PI/*.jsp worker3
# Send JSPs for context /examples to worker named worker1
JkMount /examples/*.jsp worker1
JkMount /journals/*.jsp worker1

Worker Properties
/etc/httpd/conf/workers.properties
# Define some properties
workers.apache_log=/var/log/httpd/ 
workers.tomcat_home=/usr/local/tomcat/jakarta-tomcat-5.5.9 
workers.java_home=/usr/bin/java
ps=/ 

#  
worker.list=worker1 


# Set properties for worker1 (ajp13)
worker.worker1.type=ajp13
worker.worker1.host=172.20.1.19
worker.worker1.port=8009

#
worker.list=worker2

# Set properties for worker2 (ajp13)
worker.worker2.type=ajp13
worker.worker2.host=172.20.1.19
worker.worker2.port=10009

#
worker.list=worker3

# Set properties for worker3 (ajp13)
worker.worker3.type=ajp13
worker.worker3.host=127.0.0.1
worker.worker3.port=8099

#
worker.list=worker4

# Set properties for worker4 (ajp13)
worker.worker4.type=ajp13
worker.worker4.host=172.20.1.19
worker.worker4.port=8099


_

Tim Pickard
CrossRef 
Systems Support Analyst and Administrator

40 Salem Street
Lynnfield, MA 01940
tpickard at crossref dot org
781 295 0072 x27
__




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








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



custom session manager

2005-09-28 Thread Mark
After using tomcat since the 3.x days, I have been very impressed with
the amount of flexibility and configuration options that I have
available to me.

One part of the tomcat design that I do not believe is very flexible
is the ability to set up a custom session manager.  So maybe I am
missing something, but how would I go about writing this for tomcat? 
I know I am being very vague, but how much work am I potentially
signing myself up for here if I wanted to create a custom session
manager?


Thank you.

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



Re: Why doesn't my context work?

2005-09-26 Thread Mark Eggers
--- Michael Sullivan [EMAIL PROTECTED] wrote:
 
 Right now I use symlinks
 to my individual
 users' website directories, but now that I've
 discovered Alias I'll
 probably switch completely to using Aliases.

Good.  
 I
 created a test Alias
 point to the ~/webspace/webapps directory in my
 personal account, but I
 can't seem to JkMount it, and I can't figure out
 why.  Here is the
 mod_jk portion of my httpd.conf file:
 
 #mod_jk stuff
 
 LoadModule jk_module
 modules/mod_jk.so
 
 JkMount /*.jsp wrkr

I think your JSP JkMount line will only get
hostname/*.jsp.  It won't match hostname/*/*.jsp. 
I think you'll need another line in there that says:

JkMount /*/*.jsp wrkr

 JkMount /servlet/* wrkr

You will probably have the same issue with the servlet
matching.  Try this instead:

JkMount /*/servlet/* wrkr

Good idea here.

 # Deny direct access to WEB-INF
 LocationMatch .*WEB-INF.*
AllowOverride None
deny from all
 /LocationMatch

Good start.

 Alias /michael /home/michael/webspace/webapps

I would probably change some of the Directory
directives.  Since this lives outside your normal
DocumentRoot, this Directory is not going to inherit
the permissions you gave to DocumentRoot.

Something like the following might work better:

Directory /home/michael/webspace/webapps
  Options Indexes
  Allow Override None
  Order allow,deny
  Allow from all
/Directory

 Directory /home/michael/webspace/webapps
 Options FollowSymLinks
 AllowOverride None
 /Directory

I tend to put the Directory and Aliases before the
JkMount statement, if I do that, then I can do the
following:

Alias /michael /home/michael/webspace/webapps
Directory /home/michael/webspace/webapps
  Options Indexes
  Allow Override None
  Order allow,deny
  Allow from all
/Directory

JkMount /michael/*.jsp wrkr
JkMount /michael/*/*.jsp wrkr
JkMount /michael/*/servlet/* wrkr

Finally, make sure the user Tomcat is running as has
read access to everything in
/home/michael/webspace/webapps.

If there are a lot of applications, you can group all
the Directory directives, followed by all the Alias
directives, followed by all the JkMount statements.

Another way to organize your httpd.conf file is by
application.  In other words, for each application:

Directory
  # directory directives
/Directory
Alias /desired_mapping /directory_napping
JkMount /desired_mapping/*.jsp tomcat-worker
JkMount /desired_mapping/servlet/* tomcat-worker

I'm away from my system right now, but I think either
of these methods should work fine.

The ugly thing about doing it this way is that every
time you add a new user, you'll have to update Apache,
which means you'll have to stop and start the server.

If you could get the user directory idea to work, then
everything would just happen.

HTH

/mde/

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

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



Re: Protecting applications in Tomcat using Directory Server

2005-09-26 Thread Mark Thomas

Surya Mishra wrote:

Thank You Mark,
My Tomcat server won't even start if the directory server is unreachable.
That means other applications that have not protected are also failing.
Second question: There is no attribute in the Realm definition to give a
name to realm (as per the how-to document.

Realm names are defined in web.xml


How do I configure different
realms for different applications?

You can nest realms inside contexts.

What is the default realm name for the

tomcat-users.xml?

It depends. Test your setup with basic auth and find out.

I want the manager application to run using the default

tomcat-users.xml. Another application is to be protected using JNDI realm. A
third one is public meaning nothing is protected in that application.

Set realms at the context level.

Mark



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



Re: Need to contact mailing list admin regarding delivery issues

2005-09-26 Thread Mark Thomas

As per the welcome e-mail you received when you subscribed:

[EMAIL PROTECTED]

David Delbecq wrote:

Hello,

I need to contact the admin of this mailing list regarding delivery
issues with it.
Please cc: your reply to david.delbecq at myrealbox.com to ensure delivery.


Thanks.



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








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



Re: isapi_redirector and danish chars

2005-09-26 Thread Mark Thomas

Michael Salmon wrote:

Hi everybody

 


I have a problem with Isapi_redirector and danish chars. I have a webapp
downloading files with special Danish chars in the filename. Everything
woks fine when Tomcat is doing the hole show, but when I do the same
thing through IIS and isapi_redirector I get and error.

 


Any help would be appreciated.


Some version numbers would be a start...



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



Re: Protecting applications in Tomcat using Directory Server

2005-09-25 Thread Mark Thomas

Surya Mishra wrote:

 I have successfully used JNDI realm to protect my applications on Tomcat.
But if Tomcat is unable to connect to the the directory server, it refuses
access. I want it to use the tomcat-users list as a backup if it fails to
connect to the directory. It seems if the JNDI realm is set up, the
tomcat-users.cml file entries become useless.
Need Help!!!
Thanks
-Surya

You are correct. This type of fall-back from one realm to another is 
not supported. However, JNDI does have an alternateURL attribute which 
is used if connecting to connectionURL fails. It isn't as well 
documented as it should be - something that I'll fix later today - but 
if you search 
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/realm-howto.html for 
alternateURL you should find the info you need.


More generally, I suspect that making your directory more reliable (or 
replicating to a second directory and using the alternateURL) is going 
to be less effort and less error prone that trying to keep to 
completely different lists of users, passwords and role assignments in 
sync.


Mark



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



Re: force reload of individual class files

2005-09-24 Thread Mark Thomas

matador wrote:

Leon Rosenberg [EMAIL PROTECTED] wrote in
news:[EMAIL PROTECTED]: 




You don't need to restart the server to get your changes live, you can
force it to reload the whole application, which, in case of tomcat,
your users wouldn't even notice (as long as ALL your beans in session
are serializable).





thanks much. i do understand it better now, is there any other special 
setup to make sure that tomcat persists sessions across restarts? 
(e.g. context.xml pararms)




Nope. For more info read 
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/manager.html 
particularly 
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/manager.html#Restart%20Persistence


Mark


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



Re: CGI difficulty, binmode(STDIN) not working in FileUpload

2005-09-24 Thread Mark Thomas

Ron Cozad wrote:

I have a form input on a html page that does a file upload.  I am only
getting the first 3k of an upload file.  If the file is less than 3k,
the multipart boundaries are structured properly, otherwise, I never get
the end of the file or the ending boundary.

 


I did binmode(STDIN); but still not getting the whole file.

 


Running Tomcat 4.1.31 and IE browser 6.x.

 


Appreciate any suggestions or theories as to why I am not getting the
whole file.


There is a bug in the CGIServlet (32023) that has been fixed in the 
latest version available from SVN.


http://svn.apache.org/repos/asf/tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java



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



Re: getRequestURL and forwards

2005-09-23 Thread Mark Thomas

[EMAIL PROTECTED] wrote:

Hi,
We have an application that does the following ( we use struts 1.2.4, 
tomcat 5.0.28, jdk 1.4.2)


a) user requests /x/y/action.do?x=1

b) the action executes then JSP forwards (via ActionForward) to 
/x/y/somefile.jsp


c) the resulting JSP page calls request.getRequestURL(). It returns 
/x/y/action.do  (which is what we expect)




We just upgraded Tomcat to 5.5.9 and to jdk 1.5, (struts still the same) 
now the behavior has changed. 



a) user requests /x/y/action.do?x=1

b) the action executes then JSP forwards (via ActionForward) to 
/x/y/somefile.jsp


c) the resulting JSP page calls request.getRequestURL(). It returns 
/x/y/somefile.jsp (instead of action.do)


Our app is broke because of this, any ideas?



Read section SRV.8.4 of the Servlet specification. 5.0.28 was not 
following the spec. 5.5.9 is.


Mark



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



Re: How show CLIENT-CERT Realm

2005-09-21 Thread Mark Thomas

Antony GUILLOTEAU wrote:

I'm able to show the login window of a basic realm with following code :
   response.setHeader(WWW-Authenticate, BASIC realm=\myName\);
   response.sendError(HttpServletResponse.SC_UNAUTHORIZED);

Now I wish to show the window like CLIENT-CERT : when all realm parameters are 
set in the web.xml that 's work fine. But I want to do the same thing 
programmaticly with response.sendError(HttpServletResponse.SC_UNAUTHORIZED).

I think it is done in the tomcat code ... but where ?

Thanks


It is done in o.a.c.authenticator.AuthenticatorBase and the process is 
basically issue a redirect to SSL. You will need to set the clientAuth 
attribute on the connector to true to require all connections to 
present a client certificate. If you want to validate the clienbt 
certificate, have a look at o.a.c.authenticator.SSLAuthenticator


Mark



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



session tracking in a context that contains JSP and servlets

2005-09-21 Thread Mark
I want to create a webapp that will contain both servlets and JSP.  I
will be using a login page to authenticate users.  I will probably use
one of the Tomcat supported authentication modules.

I am wondering if it is possible for tomcat to properly manage session
information when going between servlet and JSP pages.

Thank you.

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



Re: session tracking in a context that contains JSP and servlets

2005-09-21 Thread Mark
I would think that this is possible.  I have been writing servlets for
over a year, but have not written a single line of JSP.

On 9/21/05, David Wall [EMAIL PROTECTED] wrote:
 Mark wrote:

 I want to create a webapp that will contain both servlets and JSP.  I
 will be using a login page to authenticate users.  I will probably use
 one of the Tomcat supported authentication modules.
 
 I am wondering if it is possible for tomcat to properly manage session
 information when going between servlet and JSP pages.
 
 
 Of course.  After all, every JSP is compiled into a servlet.  Naturally,
 if the browser supports session cookies, all is very easy, but if they
 block such cookies, then you'll need to use URL rewriting for every
 reference to an URL within your web app so that the session id can be
 transmitted back.  Use response.encodeURL() and
 response.encodeRedirectURL() as necessary.

 David

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



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



Re: Not able to access the home page of Apache with mod-ssl

2005-09-20 Thread Mark
Could IE be configured so that it is going through a proxy?  

On 9/19/05, Rohit Maheshwari [EMAIL PROTECTED] wrote:
 Hi All,
 I am setting up Apache 2.0.54 with mod_ssl. I have configured virtual
 host as rohit.com.
 When I tried to access the home page of Apache with firefox I am able to
 retrieve it.
 However I am unable to retrieve it on Internet Explorer .
 Request I am sending on browser : https://rohit.com/  ( success on
 firefox but not on I explorer)
 While https://localhost:443/ is working on I Explorer.
 Any pointers why it is happening will be highly appreciated .
 
 Thanks and Regards ,
 Rohit
 BEA Weblogic Support
 
 BEAWorld 2005: coming to a city near you.  Everything you need for SOA and 
 enterprise infrastructure success.
 
 
 Register now at http://www.bea.com/4beaworld
 
 
 Santa Clara 27-29 Sep| London 11-12 Oct| Paris13-14 Oct| Prague18-19 Oct 
 |Tokyo 25-26 Oct| Beijing 7-8 Dec
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


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



Re: Remote Address Valve Lets Everything Through

2005-09-20 Thread Mark Leone

KEREM ERKAN wrote:


Hi Mark,

Is it possible that you may have mistyped allow=xxx.xxx.xxx.xxx as
allow=xxx.xxx.xxx.xxx  in your configuration? If you did not accidentally
delete the () from the right hand side of allow when sending to the list,
that may be your problem.



Thanks for the suggestion. I do have the valve entered correctly. I cut 
and pasted from the style-sheet-rendered version of server.xml- that's 
why both of my posts had errors. Here's the valve as cut out of the 
source page for server.xml, with the IP address masked:


valve className=org.apache.catalina.valves.RemoteAddrValve 
allow=xxx.xxx.xxx.xxx/


-Mark



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



Re: Out of Memory on Jakarta Tomcat 5.0.19, jdk1.5.0_04

2005-09-20 Thread Mark
2 notes.  

When using Java 1.5, StringBuilder class is supposed to be better
according to documentation.  Also, what has worked for me, is that if
any of the strings can be generated ahead of time, do so in a static
block and convert the strings to byte[].  This not only eliminates
redundant Strings from being built, but also speeds up the I/O.



On 9/20/05, Peter Crowther [EMAIL PROTECTED] wrote:
  From: NoKideen [mailto:[EMAIL PROTECTED]
  usually I use String to collect output first and out.print()
  those String
  example :
  String a=;
  a+=Test 1;
  a+=Test 2;
  // very long , and almost 1 page
 
  out.println(a);
 
  can this cause out of memory problem ?
 
 It won't help much - you'll build up String objects very quickly.  See
 http://java.sun.com/j2se/1.4.2/docs/api/java/lang/StringBuffer.html for
 a better approach that won't leave so many string fragments lying
 around, roughly:
 
 StringBuffer a = new StringBuffer();
 a.append(Test 1);
 a.append(Test 2);
 ...
 out.println(a.toString());
 
 However, this will merely cause the GC to run more frequently; it won't
 run you out of memory.  Something else is causing that.
 
 - Peter
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


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



Re: Mod_jk setup problems

2005-09-20 Thread Mark Eggers
Glad I was able to help a little bit.

In my experience (Linux,Solaris,Win/2K), 8080 should
always work if you have the Connector configured.  If
you can't get to http://localhost:8080/jsp-examples/
running, then there is something else amiss.

In your httpd.conf file, I still didn't see something
like the following:

JkShmFile /var/log/memory.shm

This wasn't necessary in 1.2.6 and may not be
necessary in 1.2.14, but according to the
documentation it's used on UNIX platforms.

In workers.properties lbfactor is used to set the
relative weight of a worker when you're doing load
balancing.  Since you're not doing load balancing,
letting it default to 1 should be fine.

You have two JkMounts for docstore.  I'm thinking that
only:

JkMount /docstore/* worker1

is necessary.

If the entire web application (including static files)
lives in $CATALINA_HOME/webapps, then the Apache
process will need access to those directories and
files.

Finally, a long time ago the order of startup was
important.  I think it was Tomcat first, then Apache. 
It's been a while, and right now I'm on the Windows
side of this machine so I can't check.  The order of
startup issue went away with Apache 2.0.x, but it may
still be an issue with your environment (Apache
1.3.x).

I would be interested in seeing your error logs from
mod_jk as well as seeing what catalina.out has in it
when you try to get to a web application via port
8080.

Hope this gives you some avenues to explore.

/mde/

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

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



Re: Charset configurations for JSP pages

2005-09-20 Thread Mark Thomas

T P wrote:

There are bunch of parameters and finding the right combination does not
seem to be trivial. For example there seems to be the following
parameters, for which it is hard to find extensive documentation:

On jsp page %page%-directive:
contentType
pageEncoding


Read the spec.


On web.xml (tomcat configuration)
javaEncoding


For 99.9% of use cases the default of UTF-8 will be fine.


Java system properties
file.encoding


This is a read-only property and for properly written pages has no effect.



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



Re: org.apache.catalina.valves.RemoteHostValve issue

2005-09-20 Thread Mark Thomas

Tony Tomcat wrote:
Actually.. according to the documentation the RemoteHostValve and 
RemoteAddrValve both do the same thing..


They both say...
Concrete implementation of RequestFilterValve that filters based on the 
string representation of the remote client's IP address.


The javadoc is exactly the same except the class name. :-P

The JavaDocs for RemoteHostValve are wrong. It should say ...filters 
based on the remote client's hostname. The JavaDocs for 
RemoteAddrValve are correct.


I don't see anything in the JavaDocs that suggests regular expressions 
should not be used for the allow and deny patterns.


Mark


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



Re: org.apache.catalina.valves.RemoteHostValve issue

2005-09-20 Thread Mark Thomas

Tony Tomcat wrote:
ok. got off my lazy butt and looked at the code. RemoteHostValve uses 
request.getRequest().getRemoteHost() 

so just the javadoc needs updating for RemoteHostValve.java. I'm sure this 
was just a copy of RemoteAddrValve. ;-)


Looks like it. I have just committed a fix to CVS.

Now i just need to figure out how to configure my tomcat to return values 
for getRemoteHost calls. 


http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html
Look for enableLookups

Mark



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



Re: Where to place a common jar file?

2005-09-19 Thread Mark Eggers
From the Tomcat documetation:

http://localhost:8080/tomcat-docs/class-loader-howto.html

* For classes and resources specific to a particular 
web application, place unpacked classes and resources 
under /WEB-INF/classes  of your web application 
archive, or place JAR files containing those classes 
and resources under /WEB-INF/lib of your web
application archive.

* For classes and resources that must be shared across

all web applications, place unpacked classes and 
resources under $CATALINA_BASE/shared/classes, or
place 
JAR files containing those classes and resources under

$CATALINA_BASE/shared/lib.

Further on down the page:

Common - This class loader contains additional classes

that are made visible to both Tomcat internal classes 
and to all web applications. Normally, application 
classes should NOT  be placed here.

/mde/

--- David Smith [EMAIL PROTECTED] wrote:

 Shared jars can be placed in common/lib, but keep in
 mind that all your
 webapps will be locked to the same version of the
 jar.  It's better to
 have a copy in the webapp instead where you'll have
 more version
 independence between wepapps.
 
 --David
 
 
 David Thielen wrote:
 
 Hi;
 
  
 
 If I have a jar file used by multiple servlets,
 should I put it in
 ${catalina}/common/lib or in
 ${catalina}/webapps/${each_app}/WEB-INF/lib?




__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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



Re: Mod_jk setup problems

2005-09-19 Thread Mark Eggers
A couple of things here.  I'll try to insert comment
where appropriate.

--- Don Boling [EMAIL PROTECTED] wrote:

 I can't seem to get anything to successfully pass
 though the mod_jk connector to the webapp.

What version of mod_jk?
 
 My mod_jk.conf , workers.properties are as follows.
 
 $ less mod_jk.conf
 #
 JkWorkersFile
 /usr/local/etc/apache/workers.properties
 JkLogFile  /var/log/jk.log
 JkLogLevel debug

Later versions of mod_jk need JkShmFile on UNIX.

 JkMount /*.jsp worker1
 JkMount /servlet/* worker1
 JkMount /examples/* worker1
 JkMount /docstore worker1
 JkMount /docstore/* worker1

My installs of Tomcat on Linux and Windows do not have
an examples web application.  I have /jsp-examples and
a /servlets-examples contexts.  You might try:

JkMount /jsp-examples/*.jsp worker1
JkMount /servlet-examples/servlet/* worker1

I don't know what your other applications are, but
I'll comment on a general setup in a bit.
 
 # 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.reclycle_timeout=300

You probably don't need worker.worker1.lbfactor since
you're not using load balancing.  Recycle
(worker.worker1.reclycle_timeout) needs to be spelled
correctly.

[Lots of log stuff deleted]

With the exceptin of docstore, I did not see anything
that matched your JkMount statements.  Since there was
no match, no requests were forwarded.

In general, you will probably not have
$CATALINA_HOME/webapps and Apache's DocumentRoot
ovelapping each other.  Since they don't overlap,
Apache will not know anything about static files
(html, css, etc.) that live in $CATALINA_HOME/webapps.

You can use Directory and Alias directives in Apache
to set up access and map the directory into a URI
space that Apache knows about.

With later versions of mod_jk, you can use JkAutoAlias
to map directories for you.  From the documentation at
http://jakarta.apache.org/tomcat/connectors-doc/config/apache.html

JkAutoAlias /opt/tomcat/webapps

Then you can use JkMount to map certain requests
(*.jsp, /*/servlet/*).

JkMount /jsp-examples/*.jsp worker1

The value of JkAutoAlias appears to be prepended to
the JkMount directive to find the physical location.

I've not used JkAutoAlias, but this appears to be a
nice alternative to Directory and Alias directives in
httpd.conf.

In short:

1. Add JkShmFile to httpd.conf
2. Remove lbfactor from workers.properties
3. Change the spelling of recycle
4. Use JkAutoAlias or Directory / Alias directives to
put the appropriate directories within Apache's
document and URI space.

I hope that gets you up and running.

/mde/



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

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



RE: Where to place a common jar file?

2005-09-19 Thread Mark Eggers
I think so.  If you use global naming resources and a
resource link (accessing your jdbc database via jndi),
then you might only need to place the jdbc drivers in
server/lib.

Reading some other online documentation, this appears
to be the preferred method.

/mde/

--- David Thielen [EMAIL PROTECTED] wrote:

 Sorry - you're right on the shared vs common. I put
 the jdbc drivers in
 common/lib as I access them via Tomcat's jndi - so
 Tomcat uses them. Is that
 correct for them
 
 Thanks - dave




__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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



Remote Address Valve Lets Everything Through

2005-09-19 Thread Mark Leone
I'm trying to implement a simple remote address valve, but it doesn't 
seem to work. I put the following element inside the Host element in 
%CATALINA_HOME%\conf\server.xml


valve className=*org.apache.catalina.valves.RemoteAddrValve* 
allow=*xxx**.xxx.xxx.xxx*/ // actual IP address not shown


The only Context elements I have defined are at 
%CATALINA_HOME%\conf\[engine]\[host]\admin.xml and 
%CATALINA_HOME%\conf\[engine]\[host]\manager.xml, and there are no 
valves defined in these. There is only a single Context defined in 
%CATALINA_HOME%\conf\context.xml, and there are no valves in it. There 
are no META-INF folders in any web app, and there are no XML files in 
the appBase folder. There are no defaultCOntext elements defined in 
server.xml. In short, the above valve has to be the only thing defining 
access by IP address for all my web apps.


Yet I can navigate to any web app from IP addresses other than the one 
specified in the valve. The valve has no discernible effect. I also 
tried deny=.* and again there was no restriction applied.


I should mention that I can't actually test this from outside my network 
at the moment, but I'm trying two things that I believe should cause the 
IP address to fail to match the allow pattern:


1. I navigate to my router's WAN address. Thus I should be hitting 
Tomcat with an IP address that is not localhost and is not the one 
defined in the valve.


2. I navigate to 192.168.1.2 (the internal address of the machine 
running Tomcat) from 192.168.1.4 (the internal address of another 
computer). Both of these computers are behind my NATd firewall, and 
192.168.1.4 is not the address in the allow attribute.


Am I missing something about what address gets presented to Tomcat in 
these scenarios, or am I missing something really basic about how this 
valve is supposed to work?


-Mark


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



Re: Remote Address Valve Lets Everything Through

2005-09-19 Thread Mark Leone
The asterisks in the valve below are an artifact of the way I did my cut 
and paste. The actual valve appears as follows in server.xml


valve className=org.apache.catalina.valves.RemoteAddrValve 
allow=xxx..xxx.xxx.xxx/ // actual IP address not shown


-Mark

Mark Leone wrote:

I'm trying to implement a simple remote address valve, but it doesn't 
seem to work. I put the following element inside the Host element in 
%CATALINA_HOME%\conf\server.xml


valve className=*org.apache.catalina.valves.RemoteAddrValve* 
allow=*xxx**.xxx.xxx.xxx*/ // actual IP address not shown


The only Context elements I have defined are at 
%CATALINA_HOME%\conf\[engine]\[host]\admin.xml and 
%CATALINA_HOME%\conf\[engine]\[host]\manager.xml, and there are no 
valves defined in these. There is only a single Context defined in 
%CATALINA_HOME%\conf\context.xml, and there are no valves in it. There 
are no META-INF folders in any web app, and there are no XML files in 
the appBase folder. There are no defaultCOntext elements defined in 
server.xml. In short, the above valve has to be the only thing 
defining access by IP address for all my web apps.


Yet I can navigate to any web app from IP addresses other than the one 
specified in the valve. The valve has no discernible effect. I also 
tried deny=.* and again there was no restriction applied.


I should mention that I can't actually test this from outside my 
network at the moment, but I'm trying two things that I believe should 
cause the IP address to fail to match the allow pattern:


1. I navigate to my router's WAN address. Thus I should be hitting 
Tomcat with an IP address that is not localhost and is not the one 
defined in the valve.


2. I navigate to 192.168.1.2 (the internal address of the machine 
running Tomcat) from 192.168.1.4 (the internal address of another 
computer). Both of these computers are behind my NATd firewall, and 
192.168.1.4 is not the address in the allow attribute.


Am I missing something about what address gets presented to Tomcat in 
these scenarios, or am I missing something really basic about how this 
valve is supposed to work?


-Mark





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



Re: tomcat url connections

2005-09-17 Thread Mark Thomas

Navalpotro Herrero, Luis wrote:

Hello, I have face recently found a tomcat issue that is driving me nuts.
 
I have a Java application that opens a URL connection against tomcat. The

parameteres are URLEncoded to be UTF-8 compatible. One of the values of the
params is xml (which is the one that makes the thing fail).
 
If I use tomcat 4.1.30 or lower version (up to .24 works fine, which are the

one I tested) the code runs fine, but when I change to Tomcat 4.1.31 I find
the code throws a socketException when trying to parse the http headers.
 
I have reading the changes introduced in tomcat 4.1.31 and some are relative

to encoding which makes me think this could be the cause of the problem.
 
Does any one have faced this problem also?
 
 
Thanks for your help,
 
Luis Navalpotro


Create a test case, attach it to a bug report and I'll take a look. 
Can't make any promises on timing though.


The simpler you keep the test case, the greater the chances of me 
looking at it.


Mark



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



Re: Broken links on the Tomcat 5.5 Docs pages

2005-09-17 Thread Mark Thomas

Brian Cook wrote:


The following links relating to realm logging on page 
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/realm-howto.html are broken



http://jakarta.apache.org/tomcat/tomcat-5.5-doc/context.html
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/host.html
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/engine.html


Fixed in CVS. Thanks for the report.

Mark



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



[ANN] Tomcat 3 and Tomcat 4 have moved to subversion

2005-09-17 Thread Mark Thomas

The following CVS modules have been migrated to subversion

jakarta-tomcat
jakarta-tomcat-4.0

These modules are now read only in CVS.

The new SVN locations for the head of these repositories are:
http://svn.apache.org/repos/asf/tomcat/container/branches/tc3.3.x/
http://svn.apache.org/repos/asf/tomcat/container/branches/tc4.1.x/

The new SVN locations for key branches are:
http://svn.apache.org/repos/asf/tomcat/container/branches/tc3.2.x/
http://svn.apache.org/repos/asf/tomcat/container/branches/tc4.0.x/

NB Committers wishing to make changes to these modules will need to 
use https as per http://www.apache.org/dev/version-control.html#https-svn


The next and final stage of the SVN migration will be to move tomcat5, 
catalina, jasper and the connectors. A detailed plan for this 
migration will be published on the dev list.


Mark



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



Re: Why doesn't my context work?

2005-09-16 Thread Mark Eggers
 Here are the contents of
 home.xml:
 
 Context path=/user appBase=/home
 docBase=michael/webspace/webapps
 debug=0 privileged=true
 /Context

From the documentation for Tomcat 5.5.9 at
http://localhost:8080/tomcat-docs/config/context.html:

The Document Base (also known as the Context Root) 
directory for this web application, or the pathname
to the web application archive file (if this web
application is being executed directly from the WAR 
file). You may specify an absolute pathname for this 
directory or WAR file, or a pathname that is relative 
to the appBase directory of the owning Host.

If you've not changed server.xml, then the appBase is
$CATALINA_HOME/webapps.

Rather than using a combination of appBase and docBase

in your context file (and I don't think appBase is
appropriate in a context node - at least in 5.5.9),
you could use an absolute path for docBase:

/home/michael/webspace/webapps/user

This means that the following URL would potentially
work.

www.espersunited.com/user/index.jsp

The next issue is one of permissions.  If you're on a
UNIX machine, make sure that 

/home/michael/webspace/webapps/user

is readable by the owner of the process running
Tomcat.  Otherwise you'll not be able to serve the
files.

Finally, I notice that you're going directly at this
URL:

http://www.espersunited.com/user/index.jsp

Unless your Tomcat is configured to run on port 80,
you will be hitting any web server that is running,
and not your Tomcat server.  By default, Tomcat serves
http on port 8080.

In order to get Tomcat and Apache talking, you'll have
to do a lot more work.  This involves getting mod_jk
(or mod_proxy) built and installed, configuring Apache
httpd.conf, workers.properties, and possibly
server.xml (although the default server.xml already
has the ajp 1.3 connector configured).

I hope that starts you down a more productive path.

/mde/

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

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



Re: Why doesn't my context work?

2005-09-16 Thread Mark Eggers


--- Michael Sullivan [EMAIL PROTECTED] wrote:

 OK.  For clarification I am running
 tomcat-5.0.27-r6.  I want user's
 tomcat files to be read from
 /home/*/webspace/webapps.  My personal
 account is michael so my personal tomcat directory 
 would
 be /home/michael/webspace/webapps .  Just for the
 sake of arguments I
 created a directory called user under
 /home/michael/webspace/webapps and
 moved my jsp files into it.
 My /opt/tomcat5/conf/Catalina/localhost/user.xml
 file looks like this
 now:
 
 Context
 docBase=/home/michael/webspace/webapps/user
 debug=0 privileged=true
 /Context

You don't need privledged=true, so let's remove
that.

 I restarted Tomcat.  I am using mod_jk and when I go
 to
 www.espersunited.com/index.jsp I see the Tomcat
 start page.  However,

Good, you're using mod_jk.  You will need to do some
Apache configuration in order for this to work.

I am going to assume that /home/* lies outside of the
DocumentRoot directory tree.

1. Get Apache to recognize web directories outside of
the DocumentRoot tree.  There are several ways of
doing this.  One such way is given in the actuall
httpd.conf file that comes with the stock Apache.

Basically you need to give a set of Directory
directives that give Apache access to the material in
the home directories.

If you use the userdir_module in Apache, then
~username/directory will become a part of the web
space (if you take the comments out).

If you do this by hand, you'll need to give both
Directory directives and an Alias directive to move it
into the web space that Apache serves.

2. Once you do that, you'll need to add JkMount
statements as well.  I suspect that JkMount statements
will respond to Alias directives since JkMount deals
with web space and not directories.

I don't know if JkMount interacts with the
userdir_module.  In other words, I don't know what
will happen if you put in a JkMount statment that
reads:

JkMount /~*/*.jsp tomcat

It would be interesting to find out if that would end
up mapping to /~username/directory/*.jsp where
username is the user name and directory is the
value of UserDir.

3. Once you do that, it's always nice to make a small
WEB-INF/web.xml, even for plain jsp pages.  Something
like the following should work:

?xml version=1.0 encoding=UTF-8?
!DOCTYPE web-app PUBLIC
-//Sun Microsystems, Inc.//DTD Web Application
2.3//EN
 http://java.sun.com/dtd/web-app_2_3.dtd;
web-app
display-nameBeginning JSP/display-name
descriptionContainer for quick
jsptests/description
welcome-file-list
  welcome-fileindex.jsp/welcome-file
/welcome-file-list
/webapp

Sorry for the wrapping.

In short, you need to do the following three steps.

1. Make sure your Apache server knows about
directories outside of DocumentRoot.  Use Directory
and Alias directives or userdir_module.

2. Use JkMount to map the expected incoming URLs to
the Tomcat server.  Experiment to see if JkMount picks
up on the substitutions done by userdir_module.

3. Make a small WEB-INF/web.xml with the appropriate
structure.  Creating a proper web application is
useful, especially once you start adding servlets to
the mix.

/mde/

 when I go to www.espersunited.com/user/index.jsp I
 get Tomcat 404
 Resource Not Available for /user/index.jsp .  You
 reprinted the
 paragraph from the Tomcat documentation and it made
 the same amount of
 sense to me as it did when I read it in the Tomcat
 docs:  Basically
 none.

Hmm, let me see if I can give my explanation.

If you do not have a leading / in your appBase value,
then the containing Host's docBase value gets stuck
on in front.  In other words:

appBase-value/docBase-value

From the Host container documentation, if the
appBase value does not have a leading /, then it is
taken relative to $CATALINA_BASE.  The resulting path
to the application looks like:

$CATALINA_BASE/appBase-value/docBase-value

If you haven't defined $CATALINA_BASE, it defaults to
the same value as $CATALINA_HOME.  The resulting path
to the application the looks like:

$CATALINA_HOME/appBase-value/docBase-value

--

In combination with the userdir_module from Apache to
get the directories into Apache's web space, you might
also want to take a look at user web applications
section of the Host container document.  The section
is toward the end of:

http://localhost:8080/tomcat-docs/config/host.html

It looks like you could use the userdir_module,
appropriate JkMount directives, and the howto in the
Host container document to construct a pretty
flexible environment where every user could have a web
applications directory.

/mde/



__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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



Re: Scripting variable is not generated

2005-09-14 Thread Mark Thomas
Have a look at http://issues.apache.org/bugzilla/show_bug.cgi?id=21390 
and http://issues.apache.org/bugzilla/show_bug.cgi?id=23425


Mark

Wei Zhao wrote:

I am migrating some code from tomcat 4.* to 5.5.
However, I got some compilation error regarding the
scripting variable from taglib.

This is the definition of the scripting variable in
TEI file:

VariableInfo vSystemName = new VariableInfo(
SystemName,
String,
true,
VariableInfo.AT_END
);

This is how this tag is used in the JSP page:

If( some condition )
{
system:getSystemName/
%=SystemName%
}
else
{
system:getSystemName/
%=SystemName%
}

But a got a Java compilation error saying the second
SystemName cannot be resolved.
I looked into the generated java code and it seems
that only one SystemName is declared which is within
the “if� and not visible in the “else�.  If I
remove the “system:getSystemName� inside if,
“SystemName� is now declared inside “else�. 


This works differently from Tomcat 4.* which always
generate the declaration of the “SystemName� in
above case. And I don’t think it’s consistent with
the spec. The variable is defined as “AT_END�
scope and “declare� is set to true. So it should
always be declared or a lot of existing code will be
broken.

Any thoughts? Did I miss anything?

Thanks

Wei





__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com


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







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



Re: Issue with the admin webapp

2005-09-14 Thread Mark Thomas

Sastry Malladi wrote:
I filed a bug for this 
(http://issues.apache.org/bugzilla/show_bug.cgi?id=35835) and it seems
this is fixed in 5.5.10.  But I don't see a 5.5.10 download and wanted 
clarification on whether 5.5.11-alpha
contains the fix as well. I'm going to check it out anyways when I get a 
chance.


Yes it does include the fix. More generally, any x.y.z+1 release 
contains all the fixes in x.y.z


Mark



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



Re: SSL mutual communication problem with Tomcat5 --- Remote host closed connection during handshake

2005-09-14 Thread Mark Thomas

Xia, Hong wrote:

Hi, Mark,

I have the both server and client .cer imported to cacerts but the problem 
persists

commands to generate the server and client key:
Keytool -genkey -alias server -keyalg RSA -keystore serverstore.jks
Keytool -genkey -alias client -keyalg RSA -keystore clientstore.jks

commands to create client certificate
keytool -export -alias client -file clientcert.cer -keystore clientstore.jks

commands to create server certificate
keytool -export -alias server -file servercert.cer -keystore serverstore.jks

commands to import certificates
keytool -import -alias client -file clientcert.cer -keystore serverstore.jks

under $JAVA_HOME/jre/lib/security/
keytool -import -v -trustcacerts -alias server -file servercert.cer -keystore 
cacerts



You are not signing your certificates. Look at keytool -selfcert

Mark



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



Re: mod_jk performance

2005-09-14 Thread Mark Thomas

KEREM ERKAN wrote:

Tomcat is harder to configure and -sadly- it has a far worse documentation
than Apache (for now).


I look forward to seeing your documentation patches in Bugzilla ;)

Mark


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



Re: How to get user name after login

2005-09-14 Thread Mark Thomas

梁炳場 wrote:

After implementation of JDBCRealm,
how to retrieve the username in Servlet after login?


getRemoteUser()


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



Re: Storing a request

2005-09-13 Thread Mark Thomas
Take a look at how form authenticator does it. See 
http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/authenticator/FormAuthenticator.java?rev=1.24view=markup

and the SavedRequest class in the same package.

Note that the way this restores the request, particularly the body 
content, is *very* Tomcat specific.


Mark

Ajay Arjandas Daryanani wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi everyone,

this is my first mail to this list, forgive me for any mistake I may make...

I'm developing a authorization filter for Tomcat 5; in some cases, if
the user credentials are invalid, I have to save the original request,
redirect the user to an external authentication engine, handle the
response and then proceed with the original request. The problem is, I
can't find a way to clone the request or create a new one.

Any comments are welcome.

Thanks everyone,

Ajay

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFDJqOSUIJoGmiuVrwRAqiHAJ4xBi9L2CwbPUAG2IfuZ04vnw7S1wCg9AJA
Z7/YgABDRBF0JMc0D82DtYs=
=eyYs
-END PGP SIGNATURE-

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








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



Re: SSL mutual communication problem with Tomcat5 --- Remote host closed connection during handshake

2005-09-13 Thread Mark Thomas

Xia, Hong wrote:

Hello,

I am trying to set up Tomcat5 ( as standalone web server ) with https mutal authentication. 
There is the connector config

Connector port=443 maxHttpHeaderSize=8192
   maxThreads=150 minSpareThreads=25 maxSpareThreads=75
   enableLookups=true disableUploadTimeout=true
   acceptCount=100 scheme=https secure=true
   keystoreFile=F:\Apache Software 
Foundation\keystores\serverstore.jks
   keystorePass=changeit
   clientAuth=true  sslProtocol=TLS/

The keys and keystore were created using Keytool

Client certificate client.cer was sent to the client machine which uses IE6 to 
connect the tomcat server. IE6 imported the client certificate into IE6 under 
the Trusted Root Certification Authorites.

When the client IE6 connects to the tomcat web server, the Client Authentication Window appeared without the client certificate. 
Tomcat log gives following error:


*** CertificateRequest
Cert Types: RSA, DSS, 
Cert Authorities:

CN=ppwchongdev.plugpower.com, OU=IS, O=Plug Power, L=Latham, ST=New York, C=US
CN=Client, OU=TRL, O=IBM, L=Yamato-shi, ST=Kanagawa-ken, C=JP
*** ServerHelloDone
http-443-Processor25, WRITE: SSLv3 Handshake, length = 938
http-443-Processor25, received EOFException: error
http-443-Processor25, handling exception: javax.net.ssl.SSLHandshakeException: 
Remote host closed connection during handshake
http-443-Processor25, SEND SSLv3 ALERT:  fatal, description = handshake_failure
http-443-Processor25, WRITE: SSLv3 Alert, length = 2
http-443-Processor25, called closeSocket()
http-443-Processor25, called close()
http-443-Processor25, called closeInternal(true)


Has anyone know why does this error happen? I am suspecting that IE6 has a 
problem with the imported client.cer file but I am not able to pinpoint it.

Your help will be very much appreciated.

Hong


You need to import the client cert as a user cert, not as a trusted 
root certificate.


Mark



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



Re: SSL mutual communication problem with Tomcat5 --- Remote host closed connection during handshake

2005-09-13 Thread Mark Thomas

Xia, Hong wrote:

Thanks for your help Mark.

When I imported the client cert, I pick the 'Automatically select the 
certificate store ...' option and the certificate appeared under the Trusted 
Root.

I tried to place the certificate under Personal and Other People but the certificate did not appear after the import. 


Then you haven't created the certifcate correctly.

Mark



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



Re: SSL mutual communication problem with Tomcat5 --- Remote host closed connection during handshake

2005-09-13 Thread Mark Thomas

Hector Adolfo Alonso wrote:

Hi Xia:
   I think you cannot use an self-signed certificate (as keytool 
generates) for mutual authentication.
User certificate's certificate authority signer shoul be the same that 
signs the server certificate. In this case,
the server certificate is self-signed. On the othe hand, who signs the 
client certificate ? It's self signed too ?
In this case, there is a problem, because both of them are self signed 
-- both of them are signed by

different CAs -- there is a handshake failure.
  INHO, Tomcat's cert shoud be signed by a true CA ... then the browser 
should recognize CA's cert.
  I'm sure there is a more technical and deep explanation, but I hope 
this help.


This is simply wrong. There is *no* requirement that the client and 
server certificates must be signed by the same CA for the handshake to 
work.


Possible causes of the problem are:
- CA cert client not in $JAVA_HOME/jre/lib/security/cacerts on server
- client certificate not created with correct usage types
- wrong key algorithm / signing algorithm selected

First, get HTTPS working with a server certificate. Then get it 
working over HTTPS using BASIC auth and then get it working using 
CLIENT-CERT auth.


Mark




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



Re: Case-insensitive URLs for serving HTML

2005-09-13 Thread Mark Leone

That looks like just what I needed. Thanks.

-Mark

Hassan Schroeder wrote:


[EMAIL PROTECTED] wrote:

I have a webb app in Tomcat that serves only HTML, and I'd like 


 to make the path component of the URL case-insensitive.
 ...
 I guess I'd like to match the URL pattern to a regular expression.

One quick, easy approach: UrlRewriteFilter
http://tuckey.org/urlrewrite/

HTH!




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



Re: web.xml, url-pattern

2005-09-12 Thread Mark Thomas

Trond Hersløv wrote:

But, if I try using wildcards, eg. url-pattern/*foxer/url-pattern it doesent 
work anymore.


Correct. Wildcards are not supported for mapping paths. Read the 
servlet spec for more details.



If I try to map the servlet so that it seems like a jsp-page 
url-pattern/foxer.jsp/url-pattern, it doesn't work at all.


Also correct. There is a server-wide mapping for *.jsp (wild cards are 
supported for extension mapping) in $TOMCAT_HOME/conf/web.xml



In the book I also read that I should be able to access the servlet even if 
it's not mapped up in web.xml. http://www.mymachine.no/servlet/foxer Ofcourse 
this does also not work.


This is using the invoker servlet, which is disabled by default.


Who can explain how to use the url-pattern and maybe tell me where I can find 
some documentation on how to configure web.xml


The servlet spec.



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



Re: isapi_redirector or isapi_redirector2?

2005-09-12 Thread Mark Thomas

Tracy Spratt wrote:

Again, if I am mistaken, please correct me, but this is what I have
recently come to understand.

The isapi_redirect2.dll is part of the JK2 connector, along with the
corresponding conf files.  JK2 was deprecated in 2004 because of
insufficient interest by both developers and users.  


http://jakarta.apache.org/tomcat/connectors-doc/news/20041100.html

I do not know what is the significance of JK2 will have it's successor
within core Apache2.1/2.2 distribution.


This is refering to mod_proxy_ajp

See http://httpd.apache.org/docs/2.1/mod/mod_proxy_ajp.html


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



Re: set different JRE versions on Tomcat 5.x

2005-09-12 Thread Mark Thomas

Olena Mitovska wrote:

How Tomcat 5.0.28 running on IIS (OS windows XP)  can be configured to use 
different JVM ( JRE versions) for J2EE applications running on the server?
There are a bunch of existing applications that were compiled using 1.4 
version, while our new apps use 1.5. We need to be able to set JRE version for every application. There are some version conflicts that prevent us from setting one common JRE for all apps.

This is the production server so we don't have any other Java software like 
Eclipse installed there. I know that Eclipse allows to choose JRE for every 
deployed application, but we don't have it on production machine.


Sorry, this can't be done. Tomcat and all the apps run within a single 
JVM. You would have to have multiple Tomcat instances.


Mark


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



RE: Memory leak in Tomcat

2005-09-12 Thread Mark
Hi,
Can you share how much memory do you have and how much used by tomcat
and what JAVA_OPTs do you have.

Thanks a lot,
Mark.

--- Michael Oliver [EMAIL PROTECTED] wrote:

 Ingrid,
 
 I am not on the tomcat developer committer list so my reply is just
 an FYI
 from my own experience.
 
 I saw unstable performance myself in a very similar deployment of
 Struts
 applications similar to yours.  I too thought there was a memory
 leak and
 there may be, but I don't think it is in the applications
 themselves.  The
 behavior I saw, led me to think it was related to socket allocation
 as after
 a period of time my system began to complain and slow down and
 other socket
 related programs began to complain about timeouts, etc.
 
 I found that my tomcat needed to use virtual memory to avoid out of
 memory
 exceptions.  I added physical memory and the problems all but went
 away,
 however it still occurs just less frequently.
 
 I am using 
 
 j2sdk1.4.2_09
 Tomcat-5.0.28
 
 On Windows XP Pro sp1
  
 
 
 Michael Oliver
 CTO
 Alarius Systems LLC
 6800 E. Lake Mead Blvd, #1096
 Las Vegas, NV 89156
 Phone:(702)643-7425
 Fax:(702)974-0341
 *Note new email changed from [EMAIL PROTECTED]
 
 -Original Message-
 From: Ingrid Morterud Rosvall [mailto:[EMAIL PROTECTED] 
 Sent: Monday, September 12, 2005 1:00 PM
 To: tomcat-user@jakarta.apache.org
 Subject: Memory leak in Tomcat
 
 Hello.
 
 We are running an application on Tomcat 4.1.30, and java 1.4.2.
 
 Our application is using the struts framework with jsp's, and
 cocoon to
 render the xml's. 
 
 There seems to be a major memory leak at startup - the application
 seems to
 constantly be using between 40 - 45 mb of the memory. We also have
 some
 memory leak during runtime, when users log on and starts using the
 application.
 
 So far we have not been able to find anything in our code review
 that will
 explain these memory leaks, and when we monitor the memory used,
 there is no
 obvious reason, nor is there any connection with how the users use
 our
 application and the amount of memory being used. 
 
 We would highly appreciate any help on this topic, and any tips and
 hints
 you can provide us with. 
 
 Ingrid and Tommy
 
 
 --
 I am using the free version of SPAMfighter for private users.
 It has removed 4102 spam emails to date.
 Paying users do not have this message in their emails.
 Try www.SPAMfighter.com for free now!
 
 
 

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

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




__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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



Re: web.xml, url-pattern

2005-09-12 Thread Mark Thomas

Trond Hersløv wrote:

Can you please be so kind and explain what the servlet spec. has to do with 
configuring the deployment descriptor.


The servlet specification defines the format of the deployment 
descriptor and this therefore the definitive reference for what is, 
and is not, allowed.



Could you give me a link to the servlet spec?


Would it have killed you to do a Google or to search the Sun/Java
website?

http://java.sun.com/products/servlet/docs.html
http://java.sun.com/products/servlet/reference/api/index.html




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



Re: How to re-direct the default Tomcat home page

2005-09-11 Thread Mark Shifman

From the tomcat wiki..

How do I override the default home page loaded by Tomcat?
http://wiki.apache.org/jakarta-tomcat/HowTo#head-e82228c43a0ce77f71ebe64fc99ced33c9506ffe

Bruno Georges wrote:


Hi Ben
Someone already reply to this question in the list very recently. In a 
nutshell, name your webapp ROOT and deploy it instead of the default ROOT one.
However this is neither recommended or standard/good practice.
Alternatively you could use apache with mod rewrite or create a servlet filter 
which you deploy in your ROOT webapp, from there you can do some URL 
manipulation.
Search the list and wikis from jboss you will certainly find other options.

Kind Regards
Bruno Georges

Glencore International AG
Tel. +41 41 709 3204
Fax +41 41 709 3000


- Original Message -
From: Ben Wong [EMAIL PROTECTED]
Sent: 11.09.2005 14:49
To: tomcat-user@jakarta.apache.org
Subject: How to re-direct the default Tomcat home page

Sorry, this is a newbie question. I am using Tomcat 5.0.x. on Linux. I'm having 
problems redirecting to my webapps home page from the default Tomcat home page 
($CATALINA_HOME/webapps/ROOT/index.jsp).

Here's mywebapp.xml file that I placed in the 
$CATALINA_HOME/conf/Catalina/localhost dir:

Context path= docBase=/home/mywebapp/mywebapp.war
/Context

As you can see, the path attribute is an empty string, and according to the 
Tomcat documentation, this should be the default web application. But instead, 
the tomcat default home page still appears.

How to config the tomcat so that I can get my home page just by typing 
Http://localhost:8080?

Do I have to explicitly undeploy the default tomcat app?

Any clues?

Thanks.

 






*  
*  LEGAL DISCLAIMER

*  This message contains confidential information for
*  the exclusive use of the person mentioned above.
*


 




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




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



issue with Filter

2005-09-09 Thread Mark
Hi,
I have implemented the filter to add expire date (now + 1 day) on
image.
by dooing

resp.setHeader(Cache-Control, max-age=86400);

For some reason expire date set to system time ( It work yesterday,
but not today very strange!) I didn't restart tomcat 5.0.28
(redaht 9)

How can I check that a filter was executed and the proper value has
been set.

Thanks a lot,
Mark.

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

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



Re: Ant deployment to Tomcat issue - UnknownHostException: C

2005-09-08 Thread Mark Thomas

Usually caused by a URL of the form file://C:...

The fix is to add an extra / to your URL so it looks like:
file:///C:...

Mark

patrick van den Bemt wrote:

Hi there,

* Ant script Deployment from ws1 (with ant1.6.2) onto ws2 (with
tomcat5.0.28) returns build.xml:150: java.net.UnknownHostException:
C.

* Web interface Deployment from ws1 onto ws2 of the same .war file
succeeds (use same http://hostname:8081/manager and username+password)

Build.xml

taskdef name=testdeploy 


classname=org.apache.catalina.ant.DeployTask

classpath refid=tomcat.classpath /

/taskdef 


target name=deploy

depends=dist

description=deploy application to servlet container

testdeploy url=${manager.url}

username=${manager.username}

password=${manager.password}

path=${app.path}

war=file://${build.home}/${app.name}-${app.version}.war/

/target

Build.properties

manager.username = x

manager.password = y

manager.url = http://hostname:8081/managerhttp://hostname:8081/manager
and username+password)

Build.xml

taskdef name=testdeploy 


classname=org.apache.catalina.ant.DeployTask

classpath refid=tomcat.classpath /

/taskdef 


target name=deploy

depends=dist

description=deploy application to servlet container

testdeploy url=${manager.url}

username=${manager.username}

password=${manager.password}

path=${app.path}

war=file://${build.home}/${app.name}-${app.version}.war/

/target

Build.properties

manager.username = x

manager.password = y

manager.url = http://hostname:8081/managerhttp://hostname:8081/manager

If it would have been a network or tomcat related issue it would fail
web deployment as well I guess.

Therefore I assume it is an issue with the ant configuration.

Has anyone some clue on what I might do wrong ? Some help would be
very much appreciated.

Best regards,

Patrick.

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







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



expirationtime on images( ico, gif)

2005-09-07 Thread Mark
Hello,
I'd like to know when the default expiration time set on images.
Here an example:

Http request was generated on Wednesday, September 07, 2005 10:01:41
AM

I've gor the following expire times (I'm using firefox and got the
information from the page info):
for *ico is  Friday, September 09, 2005 11:20:20 PM
for *.gif is Wednesday, September 07, 2005 10:01:41 AM

I have tomcat 5.0.24 on Redhat 9.

Note, I have a filter with following code in doFilter:

HttpServletResponse resp = (HttpServletResponse)response;
resp.setHeader(Cache-Control, max-age= + 86400);


in web.xml I have:
  filter
filter-namecFilter/filter-name
filter-classMyFilter/filter-class
  /filter
  filter-mapping
filter-namecFilter/filter-name
url-pattern/*gif/url-pattern
  /filter-mapping


Also my HTML output I have the following code to prevent caching:

meta http-equiv=pragma content=no-cache
meta http-equiv=Cache-Control content=no-cache, no-store,
must-revalidate, post-check=0, pre-check=0
meta http-equiv=Expires content=Tue, 01-Sep-05 12:00:00 GMT

The question is why *ico files have expiration time in the future,
but  all gif files have the expiration time of http request.

*gif files somewho are not cached and I see it in tomcat access log
files that they was requested and return status for them is 304 (not
changed)

Thanks,
Mark.

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

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



Re: Why does tomcat redirect to welcome files

2005-09-07 Thread Mark Thomas

Jim Kennedy wrote:

Thanks Mark, found some good info.  Another question:

Is is possible to force a forwards for welcome pages with Tomcat.  Is there
an engine setting for that? Or would I be forced to change the Tomcat
source. I notice with other web servers (i.e. IIS) I can specify a default
page which returns HTTP 200 code instead of redirect codes.

Thanks


You'd need to change the source.

Mark


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



Re: how tomcat not run .EXE as CGI

2005-09-06 Thread Mark Thomas
gjl wrote:
 Thanks very much to read my question.
 I have tomcat5.0 for Win32 installed locally on
  Windows 2k, SP4. I'm trying to run a namazu.cgi.exe (a Full-Text Search
 Engine. that's not Perl scripts ,but a binary file) .
 the file is in Tomcat 5.0\webapps\XXX\WEB-INF\cgi ,and I set the web.xml
 file as followservlet
 servlet-namecgi/servlet-name
 
 servlet-classorg.apache.catalina.servlets.CGIServlet/servlet-class
 init-param
   param-nameclientInputTimeout/param-name
   param-value100/param-value
 /init-param
 init-param
   param-namedebug/param-name
   param-value6/param-value
 /init-param
 init-param
   param-namecgiPathPrefix/param-name
   param-valueWEB-INF/cgi/param-value
 /init-param
  load-on-startup5/load-on-startup
 /servlet
 servlet-mapping
 servlet-namecgi/servlet-name
 url-pattern/cgi-bin/*/url-pattern
 /servlet-mapping
 
  However, any reference to one of the .EXE in the
 http://localhost:8080/jsp-examples/cgi-bin/namazu.cgi.exe directory results
 in the browser trying to download the EXE. and I got the message 2005-09-06
 10:07:25 StandardContext[/jsp-examples]cgi: runCGI (stderr):Unrecognized
 character \x90 at \Tomcat
 5.0\webapps\jsp-examples\WEB-INF\cgi\namazu.cgi.exe line 1. in logs.
 how can I set the tomcat to run the .exe?

With 5.0.x:
You can't use the CGI servlet. You would need to write your own
servlet that wraps the .exe using java.lang.Runtime.exec()
http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java?view=markup
should provide some pointers on how to wrap exec() (search the source
for exec and remember that most of the CGIServlet is unnecessary for
what you want to do.

With 5.5.x:
You *might* have some luck setting the new executable init parameter.
I would try  or cmd.


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



RE: What's better, having one large servlet or many small ones?

2005-09-06 Thread Mark Benussi
Many small ones.

-Original Message-
From: Raueber Hotzenplotz [mailto:[EMAIL PROTECTED] 
Sent: 06 September 2005 10:50
To: tomcat-user@jakarta.apache.org
Subject: What's better, having one large servlet or many small ones?

Hello

Should I have one handler with many methods or more handlers with less
methods
(1-2)?

Thanks!



___ 
To help you stay safe and secure online, we've developed the all new Yahoo!
Security Centre. http://uk.security.yahoo.com

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


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



Re: SSL problem

2005-09-05 Thread Mark Thomas

For 5, import the CA cert to $JAVA_HOME/jre/lib/security/cacerts

Do 4 after 5.

If you do it right, you shouldn't see the prompt to trust the CA as it 
is already in your list of trusted certs.


Also, check the server cert you get back is indeed what you expect.

Mark

Peter Betz wrote:

Hi,

I am having a problem here. I am using Jakarta Tomcat V5.5 (part of
jboss-4.0.2) and j2sdk1.4.2_08 on a Redhat Linux server.
I having been trying to register a signed certificate but have thus far
being unsuccessful.
It always comes out as a self-signed certificate. What am I doing wrong?
Details are as follows:

Here is what I have been doing:

~~~
Logged in and performed commands as jboss user because the J2EE and Jakarta
Tomcat environment is run under jboss user.

1. Generate a private key with the following command:
$JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA -keystore
k-factor88.kdb

2. Generate the Certificate Signing Request (CSR)
$JAVA_HOME/bin/keytool -certreq -alias tomcat -keystore k-factor88.kdb -file
k-factor88.csr

3. Generate the Server Certificate
Submit k-factor88.csr to root certification authority and save returned
certificate into k-factor88.cer

4. Import the Server Certificate
$JAVA_HOME/bin/keytool -import -trustcacerts -keystore k-factor88.kdb -alias
root -file k-factor88.cer
Note: Keytool confirms that the certificate has been signed by a
certification authority. I choose to trust it.

5. Import the Trust Certificate
$JAVA_HOME/bin/keytool -import -trustcacerts -keystore k-factor88.kdb -alias
jboss -file UTN.cer
Note: UTN.cer is the certification authority certificate and needs to be
imported.

server.xml

~
 Connector port=8443 address=${jboss.bind.address}
   maxThreads=100 strategy=ms maxHttpHeaderSize=8192
   emptySessionPath=true
   scheme=https secure=true clientAuth=false
   keystoreFile=${jboss.home.dir}/bin/certs/k-factor88.kdb
   keystorePass=changeit sslProtocol = TLS /



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







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



  1   2   3   4   5   6   7   8   9   10   >