Re: Issue in sending Request/response http headers containing Japanesecharateres

2009-03-19 Thread André Warnier
And as we recently mentioned the incompleteness of the current HTTP 
specification - at least in matters charsets - it may be worth 
remembering that it was 20 years ago, in March 1989, that a then 
little-known computer guy at CERN named Tim Berners-Lee wrote the paper 
Information Management: A proposal, which invented HTTP and hence the WWW.
And it took still a while after that for Unicode and UTF-8 to settle, so 
we can hardly blame him for having bypassed that aspect.

So hats off, and a respectful minute of appreciation.
If he hadn't, what would we all be busy with right now ?

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



Re: JNDI: Name java:comp is not bound in this Context

2009-03-19 Thread Mikolaj Rydzewski

David Smith wrote:

Try java:/comp instead.  If that doesn't help, then we'll need more info:

- OS:
- where you got tomcat from  (tomcat.apache.org or third party repackage)
- Details of your setup like what's in tomcat's common/lib folder?
- Config (relevant parts of server.xml, the webapp's context.xml and
WEB-INF/web.xml)
- The code used to access JNDI if available:
  

Hi David,

What does help is to perform JNDI lookup not during deployment, but with 
first logging attempt.
So I rather think, that Tomcat (I know, I use old version, but I have 
to) fills JNDI information after webapp deployment. Can anybody confirm 
that? But anyway, why does log4j initialization takes place before JNDI 
context is ready?


My setup is quite complicated, there're several webapps, Josso SSO (it 
requires its jars to be present in tomcat's common/lib), etc. It happens 
on Ubuntu Linux, Tomcat extracted from tarball from tomcat.apache.org.


My JNDI lookup code is correct (because it works, but not during 
deployment). Anyway, here's appender code:


public class DataSourceAppender extends AsyncAppender {
  
   private DataSource dataSource;

   private String jndi;

   public String getJndi() {
   return jndi;
   }

   public void setJndi(String jndi) {
   this.jndi = jndi;
   }

   @Override
   public void append(LoggingEvent event) {
  String statement = getLayout().format(event);
  Connection c = getConnection();
  // perform logging, etc
   }

   @Override
   public void activateOptions() {
   super.activateOptions();
   // don't know why, but I cannot perform lookup here. JNDI 
context is not available yet

//lookupDataSource();
   }

   @Override
   protected Connection getConnection() {
   Connection c = null;
  
   try {

   if (dataSource == null) {
   lookupDataSource();
   }
   if (dataSource != null) {
   c = dataSource.getConnection();
   }
   }
   catch (Exception e) {
   System.err.println(Cannot retrieve connection from 
datasource);

   e.printStackTrace(System.err);
   }
  
   return c;

   }

   private synchronized void lookupDataSource() {
   if (dataSource == null) {
   try {
   InitialContext ctx = new InitialContext();
   dataSource = (DataSource) ctx.lookup(jndi);
   }
   catch (Exception e) {
   System.err.println(Cannot retrieve DataSource from JNDI 
 + jndi);

   e.printStackTrace(System.err);
   }
   }
  
   }


}

And this is the way I configure this appender:

appender name=JDBC class=mypackage.DataSourceAppender
   param name=jndi value=java:comp/env/jdbc/sir/
  
   layout class=org.apache.log4j.PatternLayout

   param name=ConversionPattern value=insert into error_log /
   /layout
  
   filter class=org.apache.log4j.varia.LevelRangeFilter

 param name=LevelMin value=INFO /
   /filter
/appender



--
Mikolaj Rydzewski m...@ceti.pl


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



Applets with IE - difference between Tomcat and plain HTML?

2009-03-19 Thread herbert

Hi,

I've an applet, that should run out of an apache-tomcat-6.0.18 and that
should be seen with Internet Explorer 7.0 and with FireFox 3.

The applet does work in a plain HTML-Page with IE and with FF.

HTML
  HEAD
TITLEApplet Test/TITLE
  /HEAD
  BODY
applet code=Applet.class archive=applet1.jar width=90% 
height=90%
/  
  /BODY
/HTML

(Applet-Code lies within the JAR-File in the same directory with the
HTML-file.)

If I open this HTML-file with the Internet Explorer 7, the applet does work!

My next step was trying this applet delivered by Tomcat 6.0.18.
I've edited the file SOMEWHERE\apache-tomcat-6.0.18\webapps\ROOT\index.html
and added the following line to the HTML-source:

applet code=Applet.class codebase=. archive=applet1.jar width=90%
height=90% /

Second I've put the JAR-File applet1.jar in the directory
SOMEWHERE\apache-tomcat-6.0.18\webapps\ROOT

If I now open the page http://localhost:8080/ with my Firefox 3-Browser, I
see the Tomcat-Root-Page containing my correctly rendered applet.

If I open the page http://localhost:8080/ with my IE-7-Browser, the applet
won't be rendered. 

The security-settings in the IE are:

- Java-Plugin-installed and activated
- popupblocker deactivated
- http://localhost is a trusted site
- security for trusted sites is set to very low
- scripting of java-applets activated
- use Java-Sun JRE for applet

To sum it up, I've set the security as low, as it can get, but still the
applet won't start.

So where's my error? What's the difference between displaying the
mere-HTML-file vs. the Tomcat-startpage?

Any help is very appreciated!

Greetings, 
Herbert


-- 
View this message in context: 
http://www.nabble.com/Applets-with-IE---difference-between-Tomcat-and-plain-HTML--tp22596302p22596302.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



tomcat - perl cgi

2009-03-19 Thread Karthik Nanjangude
Hi

Declared  in  webapps/ PERL_TOOLS_SITE / WEB-INF/web.xml

for CGI Perl  execution as given below,

servlet
servlet-namecgi/servlet-name
servlet-classorg.apache.catalina.servlets.CGIServlet/servlet-class
init-param
param-namedebug/param-name
param-value0/param-value
/init-param
init-param
param-namecgiPathPrefix/param-name
param-valueWEB-INF/cgi/param-value
/init-param
load-on-startup1/load-on-startup
/servlet


!-- The mapping for the CGI Gateway servlet --

servlet-mapping
servlet-namecgi/servlet-name
url-pattern/cgi-bin/*/url-pattern
/servlet-mapping
/web-app



http://localhost:8080/PERL_TOOLS_SITE/cgi/hello.cgi

Unsuccessful   :  HTTP Status 404 - /PERL_TOOLS_SITE/cgi/hello.cgi

http://localhost:8080/PERL_TOOLS_SITE/cgi-bin/hello.cgi

Successful : How ?

Although the  servlet-namecgi/servlet-name  is mapped in web.xml

Thanks  Regards
karthik




Re: tomcat - perl cgi

2009-03-19 Thread Thangavel Sankaranarayanan


Hi,


servlet
servlet-namecgi/servlet-name   (3-)
servlet-classorg.apache.catalina.servlets.CGIServlet/servlet-class
(4-)
/servlet

servlet-mapping
servlet-namecgi/servlet-name(2-)
url-pattern/cgi-bin/*/url-pattern   (1-)
/servlet-mapping

The Http servlet request's context path (/cgi-bin) is checked first in
servlet mapping(1) and if one found , tomcat obtains the name of the
servlet(2).
Using the name of the servlet (3) it find the name of the class to
execute(4)

http://localhost:8080/PERL_TOOLS_SITE/cgi/hello.cgi

Unsuccessful   :  HTTP Status 404 - /PERL_TOOLS_SITE/cgi/hello.cgi

 no mapping available for cgi in servlet-mapping element

http://localhost:8080/PERL_TOOLS_SITE/cgi-bin/hello.cgi

Successful : How ?

 maping available inside servlet-mppaing element

Thanks,
Thanga



   
 Karthik   
 Nanjangude
 karthik.nanjangu  To 
 d...@xius-bcgi.com Tomcat Users List   
   users@tomcat.apache.org   
 19/03/09 02:57 PM  cc 
   
   Subject 
 Please respond to tomcat - perl cgi   
   Tomcat Users   
   List   
 us...@tomcat.apa 
 che.org  
   
   




Hi

Declared  in  webapps/ PERL_TOOLS_SITE / WEB-INF/web.xml

for CGI Perl  execution as given below,

servlet
servlet-namecgi/servlet-name
servlet-classorg.apache.catalina.servlets.CGIServlet/servlet-class
init-param
param-namedebug/param-name
param-value0/param-value
/init-param
init-param
param-namecgiPathPrefix/param-name
param-valueWEB-INF/cgi/param-value
/init-param
load-on-startup1/load-on-startup
/servlet


!-- The mapping for the CGI Gateway servlet --

servlet-mapping
servlet-namecgi/servlet-name
url-pattern/cgi-bin/*/url-pattern
/servlet-mapping
/web-app



http://localhost:8080/PERL_TOOLS_SITE/cgi/hello.cgi

Unsuccessful   :  HTTP Status 404 - /PERL_TOOLS_SITE/cgi/hello.cgi

http://localhost:8080/PERL_TOOLS_SITE/cgi-bin/hello.cgi

Successful : How ?

Although the  servlet-namecgi/servlet-name  is mapped in web.xml

Thanks  Regards
karthik





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



How to configure Apache/Tomcat6.0 to not send a chunked response?

2009-03-19 Thread Rajat Gupta05


Thanks
Rajat


 CAUTION - Disclaimer *
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely 
for the use of the addressee(s). If you are not the intended recipient, please 
notify the sender by e-mail and delete the original message. Further, you are 
not 
to copy, disclose, or distribute this e-mail or its contents to any other 
person and 
any such actions are unlawful. This e-mail may contain viruses. Infosys has 
taken 
every reasonable precaution to minimize this risk, but is not liable for any 
damage 
you may sustain as a result of any virus in this e-mail. You should carry out 
your 
own virus checks before opening the e-mail or attachment. Infosys reserves the 
right to monitor and review the content of all messages sent to or from this 
e-mail 
address. Messages sent to or from this e-mail address may be stored on the 
Infosys e-mail system.
***INFOSYS End of Disclaimer INFOSYS***


Re: error page configuration

2009-03-19 Thread Gregor Schneider
This is not a Tomcat-related question but a question relating to
Servlets in general.

http://edocs.bea.com/wls/docs61/webapp/web_xml.html#1017571

Rgds

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

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



Re: Tomcat for dummies, subtopic Acronyms

2009-03-19 Thread Gregor Schneider
André,

On Wed, Mar 18, 2009 at 7:37 PM, André Warnier a...@ice-sa.com wrote:

 Nope, just that after people keep throwing mysterious acronyms at me, and
 several of them start to use the same ones, I get curious.

Since I believe one of those people was me, I hope throwing stuff at
you didn't hurt too much :)

Cheers

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

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



APR does not understand this error code: proxy: read response failed

2009-03-19 Thread Jakob Ericsson
Hi,

We are experiencing issues with AJP-communication between the httpd
and Tomcat 6. This is communication between httpd and tomcat on
localhost.

Most of the requests work great in our performance tests but quite
randomly we see this error in httpd error.log:
...
[Wed Mar 18 21:47:09 2009] [error] (70014)End of file found:
ajp_ilink_receive() can't receive header
[Wed Mar 18 21:47:09 2009] [error] ajp_read_header: ajp_ilink_receive failed
[Wed Mar 18 21:47:09 2009] [error] (120006)APR does not understand
this error code: proxy: read response failed from 127.0.0.1:40010
(localhost)
...

This result in a 500 (or sometimes 503) response code to the user.
As you can see in our log (larger log excerpt further down in mail),
it occurs quite randomly. There are no traces of error in our Tomcat
logs.


Any idea what kind of error this is?

Can we tune; httpd, tomcat or Windows to get rid of this problem?



Our setup

Sun JVM 1.6.0.12 (64-bit)
Windows 2003 Server 64-bit (no firewall)
Apache 2.2.11 (64-bit)
Tomcat 6.0.18 (Native tomcat lib installed)


Interesting stuff in httpd.conf

ServerRoot D:/Apache/Apache2.2
PidFile logs/httpd.pid
Timeout 3600

KeepAlive On
MaxKeepAliveRequests 600
KeepAliveTimeout 15

IfModule mpm_winnt.c
ThreadsPerChild 1000
MaxRequestsPerChild  0
/IfModule

Listen 80

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so

...

ProxyRequests Off

ProxyPass /server-status !
ProxyPass /s/ !
ProxyPass /favicon.ico !
ProxyPass / ajp://localhost:40010/ min=20 smax=30 ttl=120 max=199 timeout=60




Log from our latest performance test

[Wed Mar 18 18:42:09 2009] [error] (70014)End of file found:
ajp_ilink_receive() can't receive header
[Wed Mar 18 18:42:09 2009] [error] ajp_read_header: ajp_ilink_receive failed
[Wed Mar 18 18:42:09 2009] [error] (120006)APR does not understand
this error code: proxy: read response failed from 127.0.0.1:40010
(localhost)
[Wed Mar 18 18:55:55 2009] [error] (70014)End of file found:
ajp_ilink_receive() can't receive header
[Wed Mar 18 18:55:55 2009] [error] ajp_read_header: ajp_ilink_receive failed
[Wed Mar 18 18:55:55 2009] [error] (120006)APR does not understand
this error code: proxy: read response failed from 127.0.0.1:40010
(localhost)
[Wed Mar 18 19:08:09 2009] [error] (70014)End of file found:
ajp_ilink_receive() can't receive header
[Wed Mar 18 19:08:09 2009] [error] ajp_read_header: ajp_ilink_receive failed
[Wed Mar 18 19:08:09 2009] [error] (120006)APR does not understand
this error code: proxy: read response failed from 127.0.0.1:40010
(localhost)
[Wed Mar 18 19:29:50 2009] [error] (70014)End of file found:
ajp_ilink_receive() can't receive header
[Wed Mar 18 19:29:50 2009] [error] ajp_read_header: ajp_ilink_receive failed
[Wed Mar 18 19:29:50 2009] [error] (120006)APR does not understand
this error code: proxy: read response failed from 127.0.0.1:40010
(localhost)
[Wed Mar 18 20:00:26 2009] [error] (70014)End of file found:
ajp_ilink_receive() can't receive header
[Wed Mar 18 20:00:26 2009] [error] ajp_read_header: ajp_ilink_receive failed
[Wed Mar 18 20:00:26 2009] [error] (120006)APR does not understand
this error code: proxy: read response failed from 127.0.0.1:40010
(localhost)
[Wed Mar 18 20:47:46 2009] [error] (70014)End of file found:
ajp_ilink_receive() can't receive header
[Wed Mar 18 20:47:46 2009] [error] ajp_read_header: ajp_ilink_receive failed
[Wed Mar 18 20:47:46 2009] [error] (120006)APR does not understand
this error code: proxy: read response failed from 127.0.0.1:40010
(localhost)
[Wed Mar 18 21:07:13 2009] [error] (70014)End of file found:
ajp_ilink_receive() can't receive header
[Wed Mar 18 21:07:13 2009] [error] ajp_read_header: ajp_ilink_receive failed
[Wed Mar 18 21:07:13 2009] [error] (120006)APR does not understand
this error code: proxy: read response failed from 127.0.0.1:40010
(localhost)
[Wed Mar 18 21:42:03 2009] [error] (70014)End of file found:
ajp_ilink_receive() can't receive header
[Wed Mar 18 21:42:03 2009] [error] ajp_read_header: ajp_ilink_receive failed
[Wed Mar 18 21:42:03 2009] [error] (120006)APR does not understand
this error code: proxy: read response failed from 127.0.0.1:40010
(localhost)
[Wed Mar 18 21:47:09 2009] [error] (70014)End of file found:
ajp_ilink_receive() can't receive header
[Wed Mar 18 21:47:09 2009] [error] ajp_read_header: ajp_ilink_receive failed
[Wed Mar 18 21:47:09 2009] [error] (120006)APR does not understand
this error code: proxy: read response failed from 127.0.0.1:40010
(localhost)
[Wed Mar 18 21:50:00 2009] [error] (70014)End of file found:
ajp_ilink_receive() can't receive header
[Wed Mar 18 21:50:00 2009] [error] ajp_read_header: ajp_ilink_receive failed
[Wed Mar 18 21:50:00 2009] [error] (120006)APR does not understand
this error code: proxy: read response failed from 127.0.0.1:40010
(localhost)
[Wed Mar 18 22:03:33 2009] 

Re: error page configuration

2009-03-19 Thread Ken Bowen

You may also want to try asking on the Tiles User list:
us...@tiles.apache.org

On Mar 19, 2009, at 7:54 AM, Gregor Schneider wrote:


This is not a Tomcat-related question but a question relating to
Servlets in general.

http://edocs.bea.com/wls/docs61/webapp/web_xml.html#1017571

Rgds

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

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




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



setAlias() for connector object.

2009-03-19 Thread Bhuvanesh Pattanashetti
Hi all,
I m creating the connector object using certain port and SSL cert, But i had
a problem relating connector to particular alias in the keystore.
As i checked in the tomcat 6.0 APIs there is no setKeyAlias() or setAlias()
method.
Please suggest if any body has any idea?

thank you,
Bhuvan P


mod_jk through a firewall (yes, I RTFM)

2009-03-19 Thread Jeff Fulmer
I'm having difficulty with failover testing. When a tomcat server goes
away due to networking issues, the site become effectively unusable.
Here's the architecture:

   = apache1tomcat1
LB  FW
   = apache2tomcat2

If I stop the tomcat server tomcat2, there's no problem. It properly
closes the sockets and mod_jk/apache/linux knows the server went away. But
if I shutdown the network on tomcat2 (or yank the cable), mod_jk continues
to send packets to it. My socket table is filled with connections to
tomcat2:8009 in SYN_SENT. Apache continues to send every other request to
tomcat2. Since I use session stickiness, this only effects half the users
but still.

Here's my workers.properties file:

ps=/

# Define list of workers that will be used
# for mapping requests
# When load-balancing is used, real workers should not be listed here.
worker.list=balancer,status

# Definte default worker settings
worker.default.port=8009
worker.default.type=ajp13
worker.default.lbfactor=1
worker.default.socket_timeout=120
worker.default.reply_timeout=5000
worker.default.socket_keepalive=True
worker.default.ping_mode=P
worker.default.ping_timeout=5000
worker.default.connect_timeout=5000
worker.default.prepost_timeout=5000
worker.default.connection_pool_timeout=180

#--WORKER1---
worker.worker1.reference=worker.default
worker.worker1.host=10.248.11.15

#--WORKER2---
worker.worker2.reference=worker.default
worker.worker2.host=10.248.11.16

#--BALANCER--
worker.balancer.type=lb
worker.balancer.balance_workers=worker1,worker2
worker.balancer.sticky_session=true
worker.balancer.method=R
worker.balancer.lock=P
worker.balancer.sticky_session=1

# Status worker for managing load balancer
worker.status.type=status

And here's my apache configuration:

IfModule mod_jk.c
  JkWorkersFile/etc/httpd/conf/workers.properties
  JkShmFile/var/log/httpd/mod_jk.shm
  JkLogFile/var/log/httpd/mod_jk.log
  JkOptions +DisableReuse
  JkMount  /rp/*  balancer
  JkMount  /rpbalancer
/IfModule

Any thoughts?

TIA,
Jeff


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



How to make Tomcat serve/listen to one more port?

2009-03-19 Thread Je suis la poubelle
 (I've searched through the archive back to November 2008 but it seems
like this question hasn't been asked, so I take the risk to ask it :) )

 My short question is:  How to make Tomcat serve HTTP to one more port
(in Windows Server 2003)?

 Tomcat listens to 8080 (or 80) for HTTP.  Is it possible to make it
listen to one more port, eg 12345, to serve HTTP?  And by this, I mean it's
suppose to serve a totally different web site at this new port.

 If someone's going to ask me why: the reason behind is that VMWare
Server 2 is using Tomcat to serve its web application.  I need to create my
own portal page to give my users more informations about the server (because
VMWare's website is purely functional).  Right now, my own solution is
install IIS6 (as I'm using Windows Server 2003) and make it serve the page.
But I think it's quite a waste of resource to run an additional IIS6; wonder
why I can't make Tomcat to serve that page.

 Yes, I had asked this question in VMWare's forum, but nobody knows the
answer.  So I think it's better asked in this Tomcat mailing-list.


RE: How to make Tomcat serve/listen to one more port?

2009-03-19 Thread Caldarale, Charles R
 From: Je suis la poubelle [mailto:laps...@gmail.com] 
 Subject: How to make Tomcat serve/listen to one more port?
 
 Is it possible o make it listen to one more port, 
 eg 12345, to serve HTTP?

Just configure another connector for whatever ports you want.

 it's suppose to serve a totally different web site at this new port.

You'll want to utilize multiple Host elements:
http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html

Set an Alias for each Host to the string value of the appropriate IP 
address to catch requests coming in using that rather than the DNS name of each 
host.

 But I think it's quite a waste of resource to run an 
 additional IIS6;

Absolutely.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

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



RE: JNDI: Name java:comp is not bound in this Context

2009-03-19 Thread Caldarale, Charles R
 From: Mikolaj Rydzewski [mailto:m...@ceti.pl] 
 Subject: Re: JNDI: Name java:comp is not bound in this Context
 
 So I rather think, that Tomcat fills JNDI information 
 after webapp deployment.

Not really after, just during.  I'm still looking through the code, but the 
logger for the webapp is initialized very early in the process, which makes 
sense.

 But anyway, why does log4j initialization takes place 
 before JNDI context is ready?

The JNDI context is specific to the webapp; if errors occur during its 
population, having the webapp's logger around to record them would be 
beneficial.  One or the other has to come first, and the spec gives no guidance 
with respect to loggers, so it appears Tomcat chose to initialize the webapp's 
logger first.  Seems quite reasonable to me.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

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



How I can make a setup for Apache-Tomcat communication

2009-03-19 Thread singh.rakesh47

Hi,

I want to make a alias of my domain in tomact through the Apache, can
any guys provide the process to  make  alias in Apache 
Thanx
-- 
View this message in context: 
http://www.nabble.com/How-I-can-make-a-setup-for-Apache-Tomcat-communication-tp22600376p22600376.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



Re: JNDI: Name java:comp is not bound in this Context

2009-03-19 Thread Mikolaj Rydzewski

Caldarale, Charles R wrote:
From: Mikolaj Rydzewski [mailto:m...@ceti.pl] 
Subject: Re: JNDI: Name java:comp is not bound in this Context


So I rather think, that Tomcat fills JNDI information 
after webapp deployment.



Not really after, just during.  I'm still looking through the code, but the 
logger for the webapp is initialized very early in the process, which makes 
sense.

  
But anyway, why does log4j initialization takes place 
before JNDI context is ready?



The JNDI context is specific to the webapp; if errors occur during its 
population, having the webapp's logger around to record them would be 
beneficial.  One or the other has to come first, and the spec gives no guidance 
with respect to loggers, so it appears Tomcat chose to initialize the webapp's 
logger first.  Seems quite reasonable to me.
  

Thanks Chuck for your input.

Do Tomcat has to do anything with logger initialization? As you can see 
in stacktrace, I use commons-logging, log4j and common idiom:


private final static Log log = LogFactory.getLog(MyClass.class);

If I'm not wrong, log4j initialization should take place during 
initialization of static 'log' field. And that happens when JVM loads 
specific (my) class. And that can happen, for the first time, during 
context listeners loading. So it should happen after JNDI context 
population. Am I right?


I'm not arguing with you, just trying to understand the cause of my 
problem ;-)


--
Mikolaj Rydzewski m...@ceti.pl



smime.p7s
Description: S/MIME Cryptographic Signature


Re: How I can make a setup for Apache-Tomcat communication

2009-03-19 Thread André Warnier

singh.rakesh47 wrote:

Hi,

I want to make a alias of my domain in tomact through the Apache, can
any guys provide the process to  make  alias in Apache 


Sit down, have a beer (or a coffee), rephrase your question in terms 
such that every one can understand what you want;

You may want to give an example also.

Then re-send it, this time telling us which version of Apache and 
Tomcat, on what platform.


Thanks in advance for taking the time.


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



python proxy.cgi

2009-03-19 Thread Paulo Cesar Rocha
Hi,
I changed tomcat web.xml  and copied the proxy.cgi python script from the OL
example directory to the /webapps//cgi-bin/ directory (I'm using Vista,
Tomcat5.5 and Geoserver). When I type the url
http://localhost:8080/cgi-bin/proxy.cgi in IE it lists openlayers proxy
instead of openlayers hompage:
  #!c:\python25\python.exe -u This is a blind proxy that we use to get
around browser restrictions that prevent the Javascript from loading pages
not on the same server as the Javascript. This has several problems: it's
less efficient, it might break some sites, and it's a security risk because
people can use this proxy to browse the web and possibly do bad stuff with
it. It only loads pages via http and https, but it can load any content
type. It supports GET and POST requests. import urllib2 import cgi import
sys, os # Designed to prevent Open Proxy type stuff. allowedHosts = ['
www.openlayers.org', 'openlayers.org', 'labs.metacarta.com', '
world.freemap.in', 'prototype.openmnnd.org', 'geo.openplans.org', '
sigma.openplans.org', 'localhost:8080'] method =
os.environ[REQUEST_METHOD] if method == POST: qs =
os.environ[QUERY_STRING] d = cgi.parse_qs(qs) if d.has_key(url): url =
d[url][0] else: url = http://www.openlayers.org; else: fs =
cgi.FieldStorage() url = fs.getvalue('url', http://www.openlayers.org;)
try: host = url.split(/)[2] if allowedHosts and not host in allowedHosts:
print Status: 502 Bad Gateway print Content-Type: text/plain print print
This proxy does not allow you to access that location (%s). % (host,)
print print os.environ elif url.startswith(http://;) or
url.startswith(https://;): if method == POST: length =
int(os.environ[CONTENT_LENGTH]) headers = {Content-Type:
os.environ[CONTENT_TYPE]} body = sys.stdin.read(length) r =
urllib2.Request(url, body, headers) y = urllib2.urlopen(r) else: y =
urllib2.urlopen(url) # print content type header i = y.info() if
i.has_key(Content-Type): print Content-Type: %s % (i[Content-Type])
else: print Content-Type: text/plain print print y.read() y.close() else:
print Content-Type: text/plain print print Illegal request. except
Exception, E: print Status: 500 Unexpected Error print Content-Type:
text/plain print print Some unexpected error occurred. Error text was:, E


My python working (in that path) with other python scripts. Look at the DOS
display :

Microsoft Windows [versão 6.0.6001]
Copyright (c) 2006 Microsoft Corporation. Todos os direitos reservados.
C:\Users\PauloCesarcd \tomcat\webapps\cgi-bin
C:\tomcat\webapps\cgi-binproxy.cgi
Traceback (most recent call last):
  File C:\tomcat\webapps\cgi-bin\proxy.cgi, line 23, in module

method = os.environ[REQUEST_METHOD]

  File C:\Python25\lib\os.py, line 432, in __getitem__
return self.data[key.upper()]
KeyError: 'REQUEST_METHOD'
C:\tomcat\webapps\cgi-bin

to complementary my information following the web.xml:
servlet
servlet-namecgi/servlet-name

servlet-classorg.apache.catalina.servlets.CGIServlet/servlet-class
init-param
  param-namedebug/param-name
  param-value0/param-value
/init-param
  init-param
  param-nameexecutable/param-name
  param-valueC:\Python25\python.exe/param-value
  /init-param
init-param
  param-namecgiPathPrefix/param-name
  param-valuecgi-bin/param-value
/init-param
 load-on-startup5/load-on-startup
/servlet
 !-- The mapping for the CGI Gateway servlet --
servlet-mapping
servlet-namecgi/servlet-name
url-pattern/cgi-bin/*/url-pattern
/servlet-mapping
what's wrong?
Tia.


RE: JNDI: Name java:comp is not bound in this Context

2009-03-19 Thread Caldarale, Charles R
 From: Mikolaj Rydzewski [mailto:m...@ceti.pl] 
 Subject: Re: JNDI: Name java:comp is not bound in this Context
 
 If I'm not wrong, log4j initialization should take place during 
 initialization of static 'log' field.

That may be true, but there's no guarantee that your classes will be loaded in 
any specific order, nor that resources will be registered prior to 
classloading; the spec only indicates the resources will be available prior to 
any calls to the initialization methods of listeners and servlets.

From your stack trace, you can see that the logger is being set up very early 
in the game:

org.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java:289)
org.apache.commons.logging.impl.Log4JLogger.init(Log4JLogger.java:109)
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
java.lang.reflect.Constructor.newInstance(Constructor.java:494)
org.apache.commons.logging.impl.LogFactoryImpl.createLogFromClass(LogFactoryImpl.java:1116)
org.apache.commons.logging.impl.LogFactoryImpl.discoverLogImplementation(LogFactoryImpl.java:914)
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:604)
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:336)
org.apache.commons.logging.LogFactory.getLog(LogFactory.java:704)
org.apache.catalina.core.ContainerBase.getLogger(ContainerBase.java:381)
org.apache.catalina.core.StandardContext.start(StandardContext.java:4119)

This is well before the resources are established, and of course before any of 
your listeners or servlets are initialized.

You can look at the start() method of 
org/apache/catalina/core/StandardContext.java for details about the 
initialization sequence.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

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



Re: error page configuration

2009-03-19 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Dinesh,

On 3/19/2009 12:20 AM, Dinesh Gupta wrote:
 In my application, using tiles
 at the run time from the database we pick the the jsp file.
 But some times exception occurred.So that if any include page got exception I 
 want to go to the error page.
 
 In my case blank page comes or some time header displayed  body part is 
 blank.


It's possible that, by the time the error occurs, the response has
already been committed, so the error page can't be shown.

Try increasing the buffer size on a sample page (in JSP, you do this in
the %...@page ... % declaration to see if that helps.

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

iEYEARECAAYFAknCXnIACgkQ9CaO5/Lv0PDoxACff15terejF+u8umP1KEPHoUVg
YD8An3dHk2AnlUds/6sRylO2RhwQHa+Q
=7qHg
-END PGP SIGNATURE-

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



Re: JNDI: Name java:comp is not bound in this Context

2009-03-19 Thread Mikolaj Rydzewski

Caldarale, Charles R wrote:

That may be true, but there's no guarantee that your classes will be loaded in 
any specific order, nor that resources will be registered prior to 
classloading; the spec only indicates the resources will be available prior to 
any calls to the initialization methods of listeners and servlets.
  

Thank you, that explains everything.

--
Mikolaj Rydzewski m...@ceti.pl



smime.p7s
Description: S/MIME Cryptographic Signature


URI resolving to tomcat/bin

2009-03-19 Thread Agent96

Hi,

I have a URI that points to a relative location: URI myUri = new
URI(resources/myFile.xml);

When I deply my application to Tomcat the location is relative to
tomcat/bin. so it would be tomcat/bin/resource/myFile.xml.

I was hoping for [TOMCAT_HOME]/Webapps/myWebApp/classes/resources/myFile.xml
or something like that.

Is this a Tomcat fix or a Java fix..
-- 
View this message in context: 
http://www.nabble.com/URI-resolving-to-tomcat-bin-tp22601353p22601353.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



Re: Issue in sending Request/response http headers containing Japanese charateres

2009-03-19 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

André,

As Chuck points out, I really meant to encode using UTF-8. The result is
always an US-ASCII string, as per the java.net.URLEncode documentation
(really the URL Spec).

On 3/18/2009 6:51 PM, André Warnier wrote:
 If the string contained any Japanese characters, what would happen is :
 - the string would first be converted to ASCII.  Since ASCII does not
 support Japanese characters, you would get a string with plenty of ???
 characters (unless java.net.URLEncoder triggers an exception for that).
 - then this string would be URL-encoded, converting the embedded ???
 into their percent-encoded representation.
 ...and there is thus no chance at all that the server would ever be able
 to retrieve the original Japanese characters.

Right. Since I had this backward, what should really happen is:

UTF-8 is used to encode the Japanese characters into a series of bytes
which are then %-escaped and sent as a valid US-ASCII string.

 Then, the server application would presumably obtain the content of this
 header via a request.getHeader(X-header-name), and receive a Unicode
 string containing foobar%45%67%65%43%45%45%78%69
 It would then decode it using java.net.URLEncoder.decode(text, UTF-8),
 in order to obtain back the original string.
 And it would work fine.

Exactly. Hopefully, the OP will read the entire thread instead of just
taking my bad advice :)

 But in a totally non-portable way (meaning just between that client and
 that application), and with just too many conditional tenses to make
 this comfortable.

Agreed. This is why I recommended using HTTP POST for such data (I know,
I know... don't get you started on POST!).

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

iEYEARECAAYFAknCYfgACgkQ9CaO5/Lv0PBh7wCeI0GcB2TWE5174j3pT1sFX2gF
1BMAnA7fqXRXceapcUQQ+IQfk9oaDwl2
=4ByH
-END PGP SIGNATURE-

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



RE: URI resolving to tomcat/bin

2009-03-19 Thread Caldarale, Charles R
 From: Agent96 [mailto:matt.nel...@metadatatechnology.com] 
 Subject: URI resolving to tomcat/bin


 [TOMCAT_HOME]/Webapps/myWebApp/classes/resources/myFile.xml

Classes are normally stored in myWebApp/WEB-INF/classes, but the above is 
acceptable, just unusual (assuming you fix the spelling of webapps).
 
 Is this a Tomcat fix or a Java fix..

Neither; fix your webapp.  You should be using:

   ServletContext.getResourceAsStream(/classes/resources/myFile.xml);

There's no guarantee the container will provide any access to the file system, 
other than the temporary work area defined by the servlet spec.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

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



How to get list of IP addresses and ports Tomcat is listening on, in a web-app

2009-03-19 Thread Leonard Smith
To all,

I am writing a webapp which runs under tomcat 6.0.18 and I am new to
java. My webapp is configured to load on startup and in the init
method/function I want to get the list of IP addresses and ports that
can be used to connect to my web-app. I cannot use the
HttpServletRequest or ServletRequest because this assumes a connection
has come in and I want this information before any request can come
in.

Is there a way from my web-app, to get a list of IP addresses and
ports that tomcat is listening on? Other java programmers I know
mentioned using JMX, etc but that assumes I know the JMX port, which
could change.

  java.net.InetAddress inetAddress = java.net.InetAddress.getLocalHost();
seems to get me the IP address, but I have not found a way to get the port.

thanks
Len

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



Re: How to get list of IP addresses and ports Tomcat is listening on, in a web-app

2009-03-19 Thread Mikolaj Rydzewski

Leonard Smith wrote:

Is there a way from my web-app, to get a list of IP addresses and
ports that tomcat is listening on? Other java programmers I know
mentioned using JMX, etc but that assumes I know the JMX port, which
could change.
  
You will use JMX  beans in the same JVM, so you do not need any ports to 
connect to remote JVM/JMX.


You can try http://www.ceti.pl/~miki/komputery/jmx/ and see what can be 
done with Catalina bean.


--
Mikolaj Rydzewski m...@ceti.pl



smime.p7s
Description: S/MIME Cryptographic Signature


Re: JNDI: Name java:comp is not bound in this Context

2009-03-19 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Mikolaj,

On 3/19/2009 11:04 AM, Mikolaj Rydzewski wrote:
 Caldarale, Charles R wrote:
 That may be true, but there's no guarantee that your classes will be
 loaded in any specific order, nor that resources will be registered
 prior to classloading; the spec only indicates the resources will be
 available prior to any calls to the initialization methods of
 listeners and servlets.
   
 Thank you, that explains everything.

Since you have written your own appender, maybe you could change it to
fail gracefully (say, log messages to the console) when the JNDI
DataSource is not available, retain a copy of a certain number of log
messages (say, 100), and then write them all to the DataSource once it
becomes available.

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

iEYEARECAAYFAknCZ7QACgkQ9CaO5/Lv0PAUNQCeJ6f2yNukMIVOeQ5VhjUTvS3K
s6cAnRHu4ikdqUYrhoPS3LqwIatIH5Un
=AcCN
-END PGP SIGNATURE-

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



Re: Applets with IE - difference between Tomcat and plain HTML?

2009-03-19 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Herbert,

On 3/19/2009 5:22 AM, herbert wrote:
 I've an applet, that should run out of an apache-tomcat-6.0.18 and that
 should be seen with Internet Explorer 7.0 and with FireFox 3.
 
 The applet does work in a plain HTML-Page with IE and with FF.

Do you mean that when you serve the HTML and JAR files through Tomcat it
works, but...

 If I open this HTML-file with the Internet Explorer 7, the applet does work!

...when you open the file directly from your desktop, it doesn't work?

What about ff directly from the desktop?

I suspect that Microsoft simply will not allow things like Java to run
locally. I think that's a retarded policy, but what do I know?

 If I now open the page http://localhost:8080/ with my Firefox 3-Browser, I
 see the Tomcat-Root-Page containing my correctly rendered applet.
 
 If I open the page http://localhost:8080/ with my IE-7-Browser, the applet
 won't be rendered. 

Maybe I'm just not reading this right: when does it work? When does it
not work? Does it ever work in MSIE? Under what conditions? Do Java
applets work on other websites when you use MSIE?

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

iEYEARECAAYFAknCaVQACgkQ9CaO5/Lv0PCfrgCglZGWGWSqgmpF0xT+kBPmPXAB
jEQAn0BboZutXFrKoHUyxC8kT3UTeIrZ
=+dtG
-END PGP SIGNATURE-

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



Re: URI resolving to tomcat/bin

2009-03-19 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Agent96,

On 3/19/2009 11:17 AM, Caldarale, Charles R wrote:
 ServletContext.getResourceAsStream(/classes/resources/myFile.xml);

I think Chuck meant:

ServletContext.getResourceAsStream(/WEB-INF/classes/resources/myFile.xml);

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

iEYEARECAAYFAknCaecACgkQ9CaO5/Lv0PAkUACgqqMT8uLr1fcbpgYCwEAd0h7q
IpIAoJMJ66j1v6o9J9AEbNq6fo4RkDkb
=nCAs
-END PGP SIGNATURE-

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



RE: tomcat database connection pool

2009-03-19 Thread Carol Cheung



Caldarale, Charles R wrote:
 
 From: Carol Cheung [mailto:cache...@consumercontact.com] 
 Subject: tomcat database connection pool
 
 In tomcat 5.5, the database connection pool associated with 
 my application does not seem to shutdown when I undeploy 
 the application.
 
 You don't say if the DBCP is managed by the container (Tomcat) or by your
 webapp.  If it's the former, the pool will persist for the life of Tomcat
 (but see the link below).  If the latter, your best bet is to implement a
 ServletContextListener that will explicitly shut down the pool when the
 contextDestroyed() method is called.  The servlet spec even uses this
 situation as an example.
 
 An easier link to follow for the previously reference discussion thread is
 this:
 http://marc.info/?l=tomcat-userm=123529838331464w=2
 
 And the critical messages of the thread:
 http://marc.info/?l=tomcat-userm=123532841602124w=2
 http://marc.info/?l=tomcat-userm=123532986503723w=2
 
  - Chuck
 
 

Thank you all for your help. My dbcp is managed in my webapp. I implemented
ServletContextListener with pool shutdown in contextDestroyed. It worked.

Sincerely,
Carol Cheung

-- 
View this message in context: 
http://www.nabble.com/tomcat-database-connection-pool-tp22503977p22602405.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



RE: URI resolving to tomcat/bin

2009-03-19 Thread Caldarale, Charles R
 From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
 Subject: Re: URI resolving to tomcat/bin
 
  ServletContext.getResourceAsStream(/classes/resources/myFile.xml);
 
 I think Chuck meant:
 
 ServletContext.getResourceAsStream(/WEB-INF/classes/resources
 /myFile.xml);

No, Chuck didn't, since the OP's file is not under WEB-INF; read the original 
post.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

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



RE: Applets with IE - difference between Tomcat and plain HTML?

2009-03-19 Thread Caldarale, Charles R
 From: herbert [mailto:i...@gmx.de] 
 Subject: Applets with IE - difference between Tomcat and plain HTML?

 If I open the page http://localhost:8080/ with my 
 IE-7-Browser, the applet won't be rendered. 

IE8 was officially released about 20 minutes ago; you might want try the test 
with that.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

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



RE: URI resolving to tomcat/bin

2009-03-19 Thread Agent96

Thanks...I just came to the same conclusion too.

URI uri = MyClass.class.getResource(/resources/xsd/Message.xsd).toURI()
which resolves to myWebApp/WEB-INF/classes/resources/xsd/Message.xsd

Matt



Caldarale, Charles R wrote:
 
 From: Agent96 [mailto:matt.nel...@metadatatechnology.com] 
 Subject: URI resolving to tomcat/bin
 
 
 [TOMCAT_HOME]/Webapps/myWebApp/classes/resources/myFile.xml
 
 Classes are normally stored in myWebApp/WEB-INF/classes, but the above is
 acceptable, just unusual (assuming you fix the spelling of webapps).
  
 Is this a Tomcat fix or a Java fix..
 
 Neither; fix your webapp.  You should be using:
 
ServletContext.getResourceAsStream(/classes/resources/myFile.xml);
 
 There's no guarantee the container will provide any access to the file
 system, other than the temporary work area defined by the servlet spec.
 
  - Chuck
 
 
 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
 MATERIAL and is thus for use only by the intended recipient. If you
 received this in error, please contact the sender and delete the e-mail
 and its attachments from all computers.
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/URI-resolving-to-tomcat-bin-tp22601353p22603089.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



Re: How to get list of IP addresses and ports Tomcat is listening on, in a web-app

2009-03-19 Thread André Warnier

Leonard Smith wrote:

To all,

I am writing a webapp which runs under tomcat 6.0.18 and I am new to
java. My webapp is configured to load on startup and in the init
method/function I want to get the list of IP addresses and ports that
can be used to connect to my web-app. I cannot use the
HttpServletRequest or ServletRequest because this assumes a connection
has come in and I want this information before any request can come
in.

Is there a way from my web-app, to get a list of IP addresses and
ports that tomcat is listening on? 


You may want to have a look here, for a starter :
http://java.sun.com/docs/books/tutorial/networking/nifs/index.html



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



Re: URI resolving to tomcat/bin

2009-03-19 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chuck,

On 3/19/2009 12:15 PM, Caldarale, Charles R wrote:
 From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
 Subject: Re: URI resolving to tomcat/bin

 ServletContext.getResourceAsStream(/classes/resources/myFile.xml);

 I think Chuck meant:

 ServletContext.getResourceAsStream(/WEB-INF/classes/resources
 /myFile.xml);
 
 No, Chuck didn't, since the OP's file is not under WEB-INF; read the original 
 post.

Oh, right. That /is/ weird.

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

iEYEARECAAYFAknCc7UACgkQ9CaO5/Lv0PAbcACguGhmNx8uFWly82P1eZ3SlUuJ
0/sAoIzFUQ8ZQVudIlIfzHU8erzIvL1L
=ZAZs
-END PGP SIGNATURE-

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



no request on access log

2009-03-19 Thread Kaushal Shriyan
Hi,

I am using tomcat5 on gentoo OS and Sun JDK 1.5.0.12, i dont see any request
coming to access log.

Host name=testa.example.comappBase=webapps/foldera
unpackWARs=true autoDeploy=true 
Valve className=org.apache.catalina.valves.AccessLogValve
 directory=logs  prefix=testa.example_access_log.
suffix=.txt
 pattern=combined resolveHosts=false/
Context path=usage docBase=usage debug=0 priviledged=true/
/Host

  Host name=testb.example.comappBase=webapps/folderb
unpackWARs=true autoDeploy=true 
Valve className=org.apache.catalina.valves.AccessLogValve
 directory=logs  prefix=testb.example_access_log.
suffix=.txt
 pattern=combined resolveHosts=false/
Context path=usage docBase=usage debug=0 priviledged=true/
/Host

is that access configuration in server.xml correct ?

Please suggest

Thanks and Regards

Kaushal


RE: no request on access log

2009-03-19 Thread Peter Crowther
 From: Kaushal Shriyan [mailto:kaushalshri...@gmail.com]
 Host name=testa.example.com
[...]
 Host name=testb.example.com
[...]

So are you testing these by browsing to http://testa.example.com, and have you 
mapped that in your DNS or hosts file to be your Tomcat server?  If not, these 
won't work.

Do you need two Host elements?  Are you actually serving two different sites 
from one Tomcat?

What Tomcat revision are you running?  There were two different major versions 
of Tomcat 5.  Version numbers are 5.x.y - what are the values of x and y?  If 
you tell us that, we can give you more help.

- Peter

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



Re: How to make Tomcat serve/listen to one more port?

2009-03-19 Thread Je suis la poubelle
 Thanks for your reply.

 I'm still struggling to understand the syntax of configuring another
connector. wondering if copy-n-paste the connector section in server.xml
and change the port value is enough too much things to read need
some filter to filter out unnecessary thing and just give me the essential
thing to understand for the current problem

 Did you mean/imply that even if I manage to connect Tomcat to the
port I wanted, but if I don't use virtual hosts, both connectors would just
serve the same webpages?


On Thu, Mar 19, 2009 at 2:24 PM, Caldarale, Charles R 
chuck.caldar...@unisys.com wrote:

  From: Je suis la poubelle [mailto:laps...@gmail.com]
  Subject: How to make Tomcat serve/listen to one more port?
 
  Is it possible o make it listen to one more port,
  eg 12345, to serve HTTP?

 Just configure another connector for whatever ports you want.

  it's suppose to serve a totally different web site at this new port.

 You'll want to utilize multiple Host elements:
 http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html

 Set an Alias for each Host to the string value of the appropriate IP
 address to catch requests coming in using that rather than the DNS name of
 each host.



RE: How to make Tomcat serve/listen to one more port?

2009-03-19 Thread Caldarale, Charles R
 From: Je suis la poubelle [mailto:laps...@gmail.com] 
 Subject: Re: How to make Tomcat serve/listen to one more port?
 
 wondering if copy-n-paste the connector section
 in server.xml and change the port value is enough

That's usually all that's needed for the Connector portion.

 Did you mean/imply that even if I manage to connect 
 Tomcat to the port I wanted, but if I don't use virtual
 hosts, both connectors would just serve the same webpages?

Correct; the Host element is equivalent to a web site, the Connectors just 
feed the Hosts, based on the name and Alias.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

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



Re: no request on access log

2009-03-19 Thread Kaushal Shriyan
On Thu, Mar 19, 2009 at 10:32 PM, Peter Crowther 
peter.crowt...@melandra.com wrote:

  From: Kaushal Shriyan [mailto:kaushalshri...@gmail.com]
  Host name=testa.example.com
 [...]
  Host name=testb.example.com
 [...]

 So are you testing these by browsing to http://testa.example.com, and have
 you mapped that in your DNS or hosts file to be your Tomcat server?  If not,
 these won't work.

 Do you need two Host elements?  Are you actually serving two different
 sites from one Tomcat?

 What Tomcat revision are you running?  There were two different major
 versions of Tomcat 5.  Version numbers are 5.x.y - what are the values of
 x and y?  If you tell us that, we can give you more help.

- Peter

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

 Hi Peter

I am using Tomcat 5.5.27. Actually i have number of WAR under webapps. I am
running it on the same host where tomcat server is running.

I want access log for two of my WAR under webapps folder meaning separate
access log for two of my WAR. In my earlier email, I believe it would be
wrong as you have said.

Please suggest.

Thanks and Regards

Kaushal


RE: How to make Tomcat serve/listen to one more port?

2009-03-19 Thread Caldarale, Charles R
 From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
 Subject: RE: How to make Tomcat serve/listen to one more port?
 
 Correct; the Host element is equivalent to a web site, the 
 Connectors just feed the Hosts, based on the name and Alias.

Note that you don't really need multiple Connector elements to support 
multiple Hosts; one Connector will suffice, and it will route requests to 
the appropriate Host based on the URL.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

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



Re: no request on access log

2009-03-19 Thread Kaushal Shriyan
On Thu, Mar 19, 2009 at 10:53 PM, Kaushal Shriyan
kaushalshri...@gmail.comwrote:

 On Thu, Mar 19, 2009 at 10:32 PM, Peter Crowther 
 peter.crowt...@melandra.com wrote:

  From: Kaushal Shriyan [mailto:kaushalshri...@gmail.com]
  Host name=testa.example.com
 [...]
  Host name=testb.example.com
 [...]

 So are you testing these by browsing to http://testa.example.com, and
 have you mapped that in your DNS or hosts file to be your Tomcat server?  If
 not, these won't work.


ok



 Do you need two Host elements?  Are you actually serving two different
 sites from one Tomcat?


I have multiple WAR under webapps in a single instance of tomcat. I need two
different access logs for this purpose.

does it make sense ?



 What Tomcat revision are you running?  There were two different major
 versions of Tomcat 5.  Version numbers are 5.x.y - what are the values of
 x and y?  If you tell us that, we can give you more help.

- Peter

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

 Hi Peter

 I am using Tomcat 5.5.27. Actually i have number of WAR under webapps. I am
 running it on the same host where tomcat server is running.

 I want access log for two of my WAR under webapps folder meaning separate
 access log for two of my WAR. In my earlier email, I believe it would be
 wrong as you have said.


 Please suggest.

 Thanks and Regards

 Kaushal


Thanks and Regards

Kaushal


Question on Executor and maxThreads reported by Manager

2009-03-19 Thread Matt Brown
In my conf/server.xml, I have an executor and two connectors set up something 
like this:

Executor name=tomcatThreadPool namePrefix=catalina-exec- maxThreads=200 
minSpareThreads=50/

Connector port=8686 protocol=HTTP/1.1 connectionTimeout=2
maxThreads=250 executor=tomcatThreadPool
redirectPort=8643
compression=on 
compressableMimeType=text/html,text/xml,text/plain,text/javascript,text/css,image/png,image/jpeg,image/gif
/

Connector port=8643 protocol=HTTP/1.1 SSLEnabled=true
maxThreads=250 executor=tomcatThreadPool
scheme=https secure=true
clientAuth=false sslProtocol=TLS
compression=on 
compressableMimeType=text/html,text/xml,text/plain,text/javascript,text/css,image/png,image/jpeg,image/gif
/

My intention is to have the two connectors share a thread pool with a maximum 
thread count of 200, and minSpareThreads of 50.

When I check the server info in Tomcat Manager, the max thread count for each 
connector is reported as 250 (the value of maxThreads in each Connector 
element, which I expect to be ignored because 'executor' is present) and not 
200.

When using a shared thread pool, should I expect the Manager to report the 
incorrect amount of max threads per connector, or is something wrong with my 
configuration? Will the Manager report on the size/limits of the shared thread 
pool?


Thanks
Matt


Need Help With Clustered Tomcat Sessions

2009-03-19 Thread Alston, Brian (US SSA)
Hello All

I am having trouble with my Tomcat cluster that I hope you can help with. 
First my setup:

Apache Load Balancer: Windows Server 2003 - Apache 2.2.11 - 192.168.1.100
Tomcat Server 1: Windows Server 2003 - Tomcat 6.0.18 - 192.168.1.110
Tomcat Server 2: Windows Server 2003 - Tomcat 6.0.18 - 192.168.1.120

When I go to the Apache load balancer (http://192.168.1.100) the page comes up 
fine. When I go to the Java examples (http://192.168.1.100/examples/) and click 
on Servlets Examples and then on Sessions - Execute the page also comes up 
fine. It is here when I start to have problems.

First, let me explain how I know I have problems. Here is another setup I 
have:

Apache Load Balancer: RedHat Enterprise Linux 5 - Apache 2.2.3 - 
192.168.2.100
Tomcat Server 1: Windows Server 2003 - Tomcat 6.0.18 - 192.168.2.110
Tomcat Server 2: Windows Server 2003 - Tomcat 6.0.18 - 192.168.2.120

When I go to my Linux load-balanced cluster and enter Name/Value Session 
Attributes into the Sessions Servlet Examples, they accumulate and I 
maintain the exact same Session ID. For example:

Session ID: CCAE9F2E90A5311166E7B67CE003A727.tomcat1
The following data is in your session:
color-sky = blue
color-grass = green
color-firetruck = red
color-cloud = white

No matter what I enter, I get an additional Name/Value Session Attribute pair 
and the exact same Session ID.

Now, back to my Windows Server 2003 load-balanced cluster. Whenever I enter any 
Name/Value Session Attribute pairs, the new name/value pair always replaces 
the old, and I end up with an entirely new Session ID to boot:

Session ID: .tomcat1
Session ID: .tomcat2
Session ID: .tomcat1
Session ID: .tomcat2
Session ID: .tomcat1
Session ID: .tomcat1
.
.
.


I am hoping that there is a simple fix for this because I have no clue. My 
Apache httpd.conf file and Tomcat server.xml files are exactly the same between 
the Linux load-balanced cluster and the Windows Server 2003 load-balanced 
cluster, so I assume that cannot be the cause.

Any help will be greatly appreciated. Thanks for reading and have a good day.
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: mod_jk through a firewall (yes, I RTFM)

2009-03-19 Thread Rainer Jung

On 19.03.2009 14:02, Jeff Fulmer wrote:

I'm having difficulty with failover testing. When a tomcat server goes
away due to networking issues, the site become effectively unusable.
Here's the architecture:

=  apache1tomcat1
LB  FW
=  apache2tomcat2

If I stop the tomcat server tomcat2, there's no problem. It properly
closes the sockets and mod_jk/apache/linux knows the server went away. But
if I shutdown the network on tomcat2 (or yank the cable), mod_jk continues
to send packets to it. My socket table is filled with connections to
tomcat2:8009 in SYN_SENT. Apache continues to send every other request to
tomcat2. Since I use session stickiness, this only effects half the users
but still.


This should be handled by the socket_timeout, which you set to 2 
minutes. How does it behave, if you reduce your socket timeout say to 10 
seconds?


Peferrably you would use a recent JK. There you can tune the 
socket_connect_timeout individually to something really small (soince 
1.2.27).


Maybe you just want to test the latest 1.2.28 snapshot, We are very 
close to the final 1.2.28 release (planned for tomorrow). The most 
recent snapshot is available at


http://people.apache.org/~rjung/mod_jk-dev/source/jk-1.2.28-dev/tomcat-connectors-1.2.28-dev-756058-src.tar.gz

You can further tune error detection behaviour for 1.2.28 by setting 
error_escalation_time to something small, you can even try 0.



Here's my workers.properties file:

ps=/


ps dos not have any meaning here. Simply delete it.


# Define list of workers that will be used
# for mapping requests
# When load-balancing is used, real workers should not be listed here.
worker.list=balancer,status

# Definte default worker settings


Using a template, so yes, you RTFM :)


worker.default.port=8009
worker.default.type=ajp13
worker.default.lbfactor=1
worker.default.socket_timeout=120
worker.default.reply_timeout=5000


5 seconds as a reply timeout is pretty ambitious. Without 
max_reply_timeouts this means, that even a single request that takes 
longer as 5 seconds to process will put the respective worker into an 
error state.



worker.default.socket_keepalive=True
worker.default.ping_mode=P
worker.default.ping_timeout=5000
worker.default.connect_timeout=5000
worker.default.prepost_timeout=5000


ping_mode P does only do the prepost ping, so no need to set 
connect_timeout (which is for another type of ping). You should also 
drop the prepost_timeout, because you already have the mor egeneral 
ping_timeout, and with your multiple definitions you and others might 
woner, which of those settings are actually active.



worker.default.connection_pool_timeout=180


Remember to sync this with Tomcats connectionTimeout in the AJP 
connector (but there its milliseconds and not seconds).



#--WORKER1---
worker.worker1.reference=worker.default
worker.worker1.host=10.248.11.15

#--WORKER2---
worker.worker2.reference=worker.default
worker.worker2.host=10.248.11.16

#--BALANCER--
worker.balancer.type=lb
worker.balancer.balance_workers=worker1,worker2
worker.balancer.sticky_session=true
worker.balancer.method=R
worker.balancer.lock=P


Locking should be fine with the default (optimistic). no more need for 
pessimistic locking.



worker.balancer.sticky_session=1


t, T, true, True and 1 all are the same. You set thius attribute twice, 
once above True and then here 1.



# Status worker for managing load balancer
worker.status.type=status

And here's my apache configuration:

IfModule mod_jk.c
   JkWorkersFile/etc/httpd/conf/workers.properties
   JkShmFile/var/log/httpd/mod_jk.shm
   JkLogFile/var/log/httpd/mod_jk.log


JkLogLevel info


   JkOptions +DisableReuse


You really want to use that? Better think about setting
connection_pool_minsize to 0 and activating the JkWatchdogInterval.


   JkMount  /rp/*  balancer
   JkMount  /rpbalancer


No mount for the status worker?


/IfModule

Any thoughts?

TIA,
Jeff


Regards,

Rainer

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



RE: Question on Executor and maxThreads reported by Manager

2009-03-19 Thread Caldarale, Charles R
 From: Matt Brown [mailto:matt.br...@citrixonline.com] 
 Subject: Question on Executor and maxThreads reported by Manager
 
 When I check the server info in Tomcat Manager, the max 
 thread count for each connector is reported as 250 (the value 
 of maxThreads in each Connector element, which I expect to 
 be ignored because 'executor' is present) and not 200.

Just because it's reported doesn't mean it's not being ignored.  (Were there 
enough negatives in that sentence?)

 When using a shared thread pool, should I expect the Manager 
 to report the incorrect amount of max threads per connector, 
 or is something wrong with my configuration?

I don't see anything wrong with your config.  The manager is just reporting 
what's there, and is blissfully unaware that you're actually using an 
Executor, so the maxThreads setting is meaningless.

 Will the Manager report on the size/limits of the shared 
 thread pool?

I don't think anyone has ever tried to update the manager webapp to do that 
(patches are welcome).

You can see the Executor and its threads with JConsole.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

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



Re: JNDI: Name java:comp is not bound in this Context

2009-03-19 Thread Mikolaj Rydzewski

Christopher Schultz wrote:

Since you have written your own appender, maybe you could change it to
fail gracefully (say, log messages to the console) when the JNDI
DataSource is not available, retain a copy of a certain number of log
messages (say, 100), and then write them all to the DataSource once it
becomes available.
  
Well, I know root of the problem now. So workaround implementation is 
not a problem.


--
Mikolaj Rydzewski m...@ceti.pl


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



RE: Question on Executor and maxThreads reported by Manager

2009-03-19 Thread Matt Brown
Thanks Charles. 

I was using the Manager to confirm if my settings for the thread pool 
(particularily minSpareThreads) were working right - I'll have to confirm with 
jconsole.

We have a monitoring app that pings /manager/status?XML=true to get mem usage, 
thread activity/count/stats, etc., so it sounds like our stats for max threads 
might not reflect the true settings?

Thanks again


-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
Sent: Thursday, March 19, 2009 2:07 PM
To: Tomcat Users List
Subject: RE: Question on Executor and maxThreads reported by Manager

 From: Matt Brown [mailto:matt.br...@citrixonline.com]
 Subject: Question on Executor and maxThreads reported by Manager
 
 When I check the server info in Tomcat Manager, the max thread count 
 for each connector is reported as 250 (the value of maxThreads in each 
 Connector element, which I expect to be ignored because 'executor' 
 is present) and not 200.

Just because it's reported doesn't mean it's not being ignored.  (Were there 
enough negatives in that sentence?)

 When using a shared thread pool, should I expect the Manager to report 
 the incorrect amount of max threads per connector, or is something 
 wrong with my configuration?

I don't see anything wrong with your config.  The manager is just reporting 
what's there, and is blissfully unaware that you're actually using an 
Executor, so the maxThreads setting is meaningless.

 Will the Manager report on the size/limits of the shared thread pool?

I don't think anyone has ever tried to update the manager webapp to do that 
(patches are welcome).

You can see the Executor and its threads with JConsole.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

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


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



RE: Load server.xml without restarting Tomcat 5.5.26 Server

2009-03-19 Thread Caldarale, Charles R
 From: meamit221 [mailto:amit.n...@aceicon.com] 
 Subject: RE: Load server.xml without restarting Tomcat 5.5.26 Server
 
 However, can you assist me with some hints that can help me 
 to do so (with Tomcat APIs)?

Since you're running 5.5, you can use the admin webapp to dynamically add 
Host elements.  However, this webapp does not persist any config changes, nor 
was it carried forward to newer Tomcat levels.  Consequently, you might want to 
develop your own webapp that does just the specific tasks you're interested in, 
so it will be usable on newer Tomcat versions (although the APIs may be 
somewhat different).

You could use the admin source and the API docs as reference:
http://archive.apache.org/dist/tomcat/tomcat-5/v5.5.26/src/
http://tomcat.apache.org/tomcat-5.5-doc/catalina/docs/api/index.html

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

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



RE: Question on Executor and maxThreads reported by Manager

2009-03-19 Thread Caldarale, Charles R
 From: Matt Brown [mailto:matt.br...@citrixonline.com] 
 Subject: RE: Question on Executor and maxThreads reported by Manager
 
 We have a monitoring app that pings /manager/status?XML=true 
 to get mem usage, thread activity/count/stats, etc., so it 
 sounds like our stats for max threads might not reflect the 
 true settings?

Correct, they won't be applicable when using an Executor.  Looks like 
LambdaProbe gets it wrong as well.  You could use JMX to retrieve the correct 
information, just like JConsole does.

You might want to look into MoSKito:
http://moskito.anotheria.net/

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

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



RE: Need Help With Clustered Tomcat Sessions

2009-03-19 Thread Jorge Medina

Are you maintaining session stickyness? 

Did you configure Tomcat to replicate the sessions?


-Original Message-
From: Alston, Brian (US SSA) [mailto:brian.als...@baesystems.com] 
Sent: Thursday, March 19, 2009 1:40 PM
To: users@tomcat.apache.org
Subject: Need Help With Clustered Tomcat Sessions

Hello All

I am having trouble with my Tomcat cluster that I hope you can help
with. First my setup:

Apache Load Balancer: Windows Server 2003 - Apache 2.2.11 -
192.168.1.100
Tomcat Server 1: Windows Server 2003 - Tomcat 6.0.18 - 192.168.1.110
Tomcat Server 2: Windows Server 2003 - Tomcat 6.0.18 - 192.168.1.120

When I go to the Apache load balancer (http://192.168.1.100) the page
comes up fine. When I go to the Java examples
(http://192.168.1.100/examples/) and click on Servlets Examples and
then on Sessions - Execute the page also comes up fine. It is here
when I start to have problems.

First, let me explain how I know I have problems. Here is another
setup I have:

Apache Load Balancer: RedHat Enterprise Linux 5 - Apache 2.2.3 -
192.168.2.100
Tomcat Server 1: Windows Server 2003 - Tomcat 6.0.18 - 192.168.2.110
Tomcat Server 2: Windows Server 2003 - Tomcat 6.0.18 - 192.168.2.120

When I go to my Linux load-balanced cluster and enter Name/Value
Session Attributes into the Sessions Servlet Examples, they
accumulate and I maintain the exact same Session ID. For example:

Session ID: CCAE9F2E90A5311166E7B67CE003A727.tomcat1
The following data is in your session:
color-sky = blue
color-grass = green
color-firetruck = red
color-cloud = white

No matter what I enter, I get an additional Name/Value Session
Attribute pair and the exact same Session ID.

Now, back to my Windows Server 2003 load-balanced cluster. Whenever I
enter any Name/Value Session Attribute pairs, the new name/value pair
always replaces the old, and I end up with an entirely new Session ID
to boot:

Session ID: .tomcat1
Session ID: .tomcat2
Session ID: .tomcat1
Session ID: .tomcat2
Session ID: .tomcat1
Session ID: .tomcat1
.
.
.


I am hoping that there is a simple fix for this because I have no clue.
My Apache httpd.conf file and Tomcat server.xml files are exactly the
same between the Linux load-balanced cluster and the Windows Server 2003
load-balanced cluster, so I assume that cannot be the cause.

Any help will be greatly appreciated. Thanks for reading and have a good
day.
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


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



RE: Need Help With Clustered Tomcat Sessions

2009-03-19 Thread Alston, Brian (US SSA)


Yes I am.

The frustrating thing is I have 2 Tomcat servers and 2 Apache load 
balancers. One load balancer is Linux and one load balancer is Windows Server 
2003 (I never have them both on at the same time). I can turn off my Windows 
load balancer, turn on my Linux load balancer, and the sessions work perfectly. 
It is some kind of issue with the Windows load balancer but I just cannot 
figure it out. My Apache load balancing configurations are the same between the 
Linux and Windows servers; the only difference is that the Linux load balancer 
works and the Windows one does not work, so you can see why I want to pull my 
hair out. I would simply stick with the Linux load balancer but they want me to 
use the Windows one, so I'm stuck.



From: Jorge Medina [jmed...@e-dialog.com]
Sent: Thursday, March 19, 2009 3:13 PM
To: Tomcat Users List
Subject: RE: Need Help With Clustered Tomcat Sessions

Are you maintaining session stickyness?

Did you configure Tomcat to replicate the sessions?


-Original Message-
From: Alston, Brian (US SSA) [mailto:brian.als...@baesystems.com]
Sent: Thursday, March 19, 2009 1:40 PM
To: users@tomcat.apache.org
Subject: Need Help With Clustered Tomcat Sessions

Hello All

I am having trouble with my Tomcat cluster that I hope you can help
with. First my setup:

Apache Load Balancer: Windows Server 2003 - Apache 2.2.11 -
192.168.1.100
Tomcat Server 1: Windows Server 2003 - Tomcat 6.0.18 - 192.168.1.110
Tomcat Server 2: Windows Server 2003 - Tomcat 6.0.18 - 192.168.1.120

When I go to the Apache load balancer (http://192.168.1.100) the page
comes up fine. When I go to the Java examples
(http://192.168.1.100/examples/) and click on Servlets Examples and
then on Sessions - Execute the page also comes up fine. It is here
when I start to have problems.

First, let me explain how I know I have problems. Here is another
setup I have:

Apache Load Balancer: RedHat Enterprise Linux 5 - Apache 2.2.3 -
192.168.2.100
Tomcat Server 1: Windows Server 2003 - Tomcat 6.0.18 - 192.168.2.110
Tomcat Server 2: Windows Server 2003 - Tomcat 6.0.18 - 192.168.2.120

When I go to my Linux load-balanced cluster and enter Name/Value
Session Attributes into the Sessions Servlet Examples, they
accumulate and I maintain the exact same Session ID. For example:

Session ID: CCAE9F2E90A5311166E7B67CE003A727.tomcat1
The following data is in your session:
color-sky = blue
color-grass = green
color-firetruck = red
color-cloud = white

No matter what I enter, I get an additional Name/Value Session
Attribute pair and the exact same Session ID.

Now, back to my Windows Server 2003 load-balanced cluster. Whenever I
enter any Name/Value Session Attribute pairs, the new name/value pair
always replaces the old, and I end up with an entirely new Session ID
to boot:

Session ID: .tomcat1
Session ID: .tomcat2
Session ID: .tomcat1
Session ID: .tomcat2
Session ID: .tomcat1
Session ID: .tomcat1
.
.
.


I am hoping that there is a simple fix for this because I have no clue.
My Apache httpd.conf file and Tomcat server.xml files are exactly the
same between the Linux load-balanced cluster and the Windows Server 2003
load-balanced cluster, so I assume that cannot be the cause.

Any help will be greatly appreciated. Thanks for reading and have a good
day.
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


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


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



Re: mod_jk through a firewall (yes, I RTFM)

2009-03-19 Thread Jeff Fulmer
 On 19.03.2009 14:02, Jeff Fulmer wrote:

 If I stop the tomcat server tomcat2, there's no problem. It properly
 closes the sockets and mod_jk/apache/linux knows the server went away.
 But if I shutdown the network on tomcat2 (or yank the cable), mod_jk
 continues to send packets to it. My socket table is filled with
 connections to tomcat2:8009 in SYN_SENT. Apache continues to send every
 other request to tomcat2. Since I use session stickiness, this only
 effects half the users but still.

 This should be handled by the socket_timeout, which you set to 2 minutes.
 How does it behave, if you reduce your socket timeout say to 10 seconds?

MAJOR IMPROVEMENT. Here's my revised workers.properties file:

worker.list=balancer,status

# Definte default worker settings
worker.default.port=8009
worker.default.type=ajp13
worker.default.lbfactor=1
worker.default.socket_timeout=10
worker.default.reply_timeout=5000
worker.default.socket_keepalive=True
worker.default.ping_mode=P
worker.default.ping_timeout=5000
worker.default.connection_pool_timeout=600
worker.default.connection_pool_minsize=0

#--WORKER1---
worker.worker1.reference=worker.default
worker.worker1.host=10.248.11.15

#--WORKER2---
worker.worker2.reference=worker.default
worker.worker2.host=10.248.11.16

#--BALANCER--
worker.balancer.type=lb
worker.balancer.balance_workers=worker1,worker2
# Load balancing method can be [R]equest, [S]ession, [T]raffic, or [B]usyness
worker.balancer.method=R
# How runtime data are sync-ed. [O]ptimistic or [P]essimistic
worker.balancer.lock=O
worker.balancer.sticky_session=True
worker.balancer.max_reply_timeouts=5

# Status worker for managing load balancer
worker.status.type=status


And in my virtual host I have this:

IfModule mod_jk.c
  JkOptions +JkWatchdogInterval
  JkMount  /rp/*  balancer
  JkMount  /rpbalancer
  JkMount  /env/* balancer
  JkMount  /env   balancer
  JkMount  /jkmanager/*  status
/IfModule

BTW: /jkmanager/* is at the server level, but I included it here for
Rainer...

Here's my remaining problem. After I shut down the network on tomcat2, I
have a few 30 second request transactions but each ensuing transaction is
pretty zippy. If I leave my browser sit idly for about a minute, I have
two 30 second transactions and each ensuing transaction is zippy. I
suspect I have two back-to-back 30 second transactions because the load
balancer sends me to apache1 then apache2 and each tries to reconnect to
the downed tomcat. After that fails, they keep me on the active tomcat.

Maybe this one be a problem once the system is taking live transactions
but it would be nice if I could increase the intervals that apache uses to
reconnect to the downed tomcat.

Any thoughts?

Jeff




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



APR based Tomcat Native library

2009-03-19 Thread Tuan Quan
Dear all,
I installed Tomcat 6.0.16,  service is running but the catalina log shows:
INFO: The APR based Apache Tomcat Native library which allows optimal 
performance in production environments was not found on the java.library.path: 
C:\Tomcat6.0\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\jdk1.6.0_12\bin;D:\ora10\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program
 Files (x86)\Dell\SysMgt\RAC5;C:\Program Files (x86)\Dell\SysMgt\oma\bin


APR dll, tcnative-1.dll  file is in C:\Tomcat6.0\bin

What did I do wrong or missing? I'd like to load the APR.

thanks.
Tuan.

RE: APR based Tomcat Native library

2009-03-19 Thread Caldarale, Charles R
 From: Tuan Quan [mailto:tuan_q...@yahoo.com] 
 Subject: APR based Tomcat Native library
 
 C:\Program Files (x86)\Dell\SysMgt\oma\bin

Looks like you're running on a 64-bit version of Windows; are you using a 
64-bit JVM?  The .dll mode must match that of the JVM you're using.  You can 
find the 64-bit version of tcnative-1.dll here:
http://www.apache.org/dist/tomcat/tomcat-connectors/native/1.1.16/binaries/win64/x64/

If you're using a 32-bit JVM and installed the 64-bit dll by mistake, you can 
get the correct one here:
http://www.apache.org/dist/tomcat/tomcat-connectors/native/1.1.16/binaries/win32/

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

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



configuration about tomcat for work with mysql/J connector

2009-03-19 Thread Tomas Rodriguez

Hi all
I'm new in Tomcat and java, I installed already Tomcat 6.0 for windows 2000, 
I have to mysql server and the connector/j for work together mysql and 
Tomcat.
I declare a variable for connector mysql/j in panel 
control/system/advance(enviroment variable) , this variable have the mysql 
connector path,
I test the tomcat doing http://localhost:8080 and every is ok, but my 
problem is.


How Can I know that my connector java work with mysql without any problem?, 
what file I'll need change in the directory tomcat .
please somebody can help me, I wanna learn tomcat for developer a project 
very important to me.


thanks
have  a great day.
sincerely
TOMAS 



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



Re: form parameters

2009-03-19 Thread Joseph Millet
Maybe I'm missing something but from the little knowledge I have, I'd
think an HTML form is posted encoded in the form enclosing HTML
document charset specified in the sent Server headers. So that you
settle a page encoded in iso-8859-2, you wouldn't expect a form
present in that page to post unicode data, would you ?

On Tue, Mar 17, 2009 at 2:31 PM, Christopher Schultz
ch...@christopherschultz.net wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Pid,

 On 3/17/2009 6:52 AM, Pid wrote:
 Does the Servlet Spec define the default value of the request encoding,
 or is this a Tomcat feature?

 The servlet spec (section 3.9 Request data encoding) specifies
 ISO-8859-1 as the default encoding for POST data when no charset has
 been specified. Although the servlet spec provides a default, I believe
 it is really inheriting this default from the HTTP spec.

 If the latter, it would be a reasonable
 candidate for a Connector parameter, perhaps.

 The Connector currently has both useBodyEncodingForURI and URIEncoding
 attributes for interpreting the URI, but nothing for the encoding of the
 body. Since this can easily be done using filters (whereas there is no
 way to fiddle with the URI encoding), I doubt it will be added to the
 Connector.

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

 iEYEARECAAYFAkm/phgACgkQ9CaO5/Lv0PDITQCdGmVpl/GdHee3zAwGkbcUTQiq
 pL8AoJWxoH/iAjDlD5SQlirwn0XG5ZwZ
 =mwQW
 -END PGP SIGNATURE-

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



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



Re: configuration about tomcat for work with mysql/J connector

2009-03-19 Thread Rusty Wright

http://lmgtfy.com/?q=tomcat+mysql+tutorial

E.g.,

http://www.roseindia.net/mysql/mysqldatabase.shtml


Tomas Rodriguez wrote:

Hi all
I'm new in Tomcat and java, I installed already Tomcat 6.0 for windows 
2000, I have to mysql server and the connector/j for work together mysql 
and Tomcat.
I declare a variable for connector mysql/j in panel 
control/system/advance(enviroment variable) , this variable have the 
mysql connector path,
I test the tomcat doing http://localhost:8080 and every is ok, but my 
problem is.


How Can I know that my connector java work with mysql without any 
problem?, what file I'll need change in the directory tomcat .
please somebody can help me, I wanna learn tomcat for developer a 
project very important to me.


thanks
have  a great day.
sincerely
TOMAS

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



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



Session listeners and clustering problem

2009-03-19 Thread David Rees
Hi,

I'm trying to implement a session listener so that I can check the
status of a session.  Essentially, I need to maintain a Map of all the
sessions.  I would add sessions to this map based on business logic.

The problem I have is that the behavior of the listeners is different
when clustering is enabled compared to when it's not enabled.

Without clustering on, an instance of HttpSessionActivationListener in
each session has it's didActivate or willPassivate functions called
when Tomcat is shutting down or starting up.

With clustering on, I get no such notifications. Or any other
notifications when a node starts up and loads it's sessions from the
cluster.  But I do notice through a HttpSessionListener, every single
session gets destroyed when shutting down a node.

So when clustering is enabled, there is no way for me to rebuild a
list of sessions that are being managed.

This is on Tomcat 5.5.27.

Anyone else hit this problem?  Anyone else have any ideas on how to
work around it?

Thanks

Dave

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



Re: form parameters

2009-03-19 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Joseph,

On 3/19/2009 7:49 PM, Joseph Millet wrote:
 Maybe I'm missing something but from the little knowledge I have, I'd
 think an HTML form is posted encoded in the form enclosing HTML
 document charset specified in the sent Server headers.

It doesn't really matter what the client decides to do (they can submit
in a different charset for all I care) as long as it indicates in the
request headers what the charset is.

The problem is that many clients do /not/ indicate the charset in the
request, even though the spec requires them to do so. If the above
assertion generally holds (POST charset matches the form's enclosing
document's charset) you can't bet on it.

 So that you settle a page encoded in iso-8859-2, you wouldn't expect
 a form present in that page to post unicode data, would you ?

As I said, it's only a coincidence that the client sends the POST data
in a matching charset. The only surprise is that the client sends
something other than ISO-8859-1 (the default as per the spec) but does
not tell the server what it is. :(

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

iEYEARECAAYFAknDCl0ACgkQ9CaO5/Lv0PDLPwCffJMY3m0yySjboyKFHt1ENFdG
EzgAnjr9/6KXxhQFaBKc1xE/HSbCez7R
=87hJ
-END PGP SIGNATURE-

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



Re: Question on Executor and maxThreads reported by Manager

2009-03-19 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Matt,

On 3/19/2009 1:37 PM, Matt Brown wrote:
 compression=on compressableMimeType=..., 
 image/png,image/jpeg,image/gif

Are you sure you want to waste your CPU time compressing files that are
already compressed?

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

iEYEARECAAYFAknDCukACgkQ9CaO5/Lv0PA/nwCfVzUS9FGGbGsLBGF2kO1Bec56
skYAoIsMDDwHOCQWxZWi/KVTzjW8S/SI
=gLAQ
-END PGP SIGNATURE-

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



help building a proxy

2009-03-19 Thread Richard Langly
Hey all,


I'm searching for a way to make a proxy server to:

- receive a request from a web-browser.

- allows me to grab the URL and build a web page.

- then forward the request to the destination.

- and then allows me to store and access the response when the
destination returns the page from this same proxy server.


If Tomcat would allow me to do this, can I get a short desc of what I need
to do?


Thanks,