Re: mod_jk does not recognize extension

2009-06-17 Thread Tsirkin Evgeny
Actually i guess
Rule extensions were added in mod_jk 1.2.17.
Is probably enough .Just make it  underlined or bold.
Evgeny

On Wed, Jun 17, 2009 at 1:09 AM, Christopher Schultz 
ch...@christopherschultz.net wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Rainer,

 On 6/16/2009 1:05 PM, Rainer Jung wrote:
  Would you mind to provide some sentences or corrections for specific
  docs pages?

 How about adding:

 
 Rule extensions were added in mod_jk 1.2.17. If you would like to use
 rule (mount?) extensions, you must use a version of mod_jk 1.2.27 or
 higher.
 

 to http://tomcat.apache.org/connectors-doc/reference/uriworkermap.html
 right after the Rule Extensions heading, before the Syntax section?

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

 iEYEARECAAYFAko4GAUACgkQ9CaO5/Lv0PC7DwCeM616BD4LOAdhdV6+LENiIArA
 9iwAoLxnrlLYVOASbt2Bo1wkQd+M4bw5
 =81NS
 -END PGP SIGNATURE-

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




Re: mod_jk does not recognize extension

2009-06-17 Thread Rainer Jung
On 17.06.2009 00:09, Christopher Schultz wrote:
 Rainer,
 
 On 6/16/2009 1:05 PM, Rainer Jung wrote:
 Would you mind to provide some sentences or corrections for specific
 docs pages?
 
 How about adding:
 
 
 Rule extensions were added in mod_jk 1.2.17. If you would like to use
 rule (mount?) extensions, you must use a version of mod_jk 1.2.27 or
 higher.
 
 
 to http://tomcat.apache.org/connectors-doc/reference/uriworkermap.html
 right after the Rule Extensions heading, before the Syntax section?
 
 -chris

Thanks, added as r785498 in a slightly different wording. Will be part
of 1.2.29.

Regards,

Rainer

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



Re: SSL Configuration Problem, can not open https://localhost:8443

2009-06-17 Thread yuting lv
 From  Caldarale, Charles R chuck.caldar...@unisys.com
 Subject   RE: SSL Configuration Problem, can not open 
 https://localhost:8443
 Having multiple Tomcats installed on the same disk is not a problem.  I have 
 four different
 versions installed on my laptop, some with, some without tcnative-1.dll.

Thanks Caldarale,
I found another tcnative-1.dll file under C:\windows\system32 directory too,
maybe that is the problem, because I rename that file and keep
tcnative-1.dll good in another netbeans tomcat on my disk, then start
https://localhost:8443 also OK.



-- 
Best regards!
yuting_lv

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



Re: Reading POSTed data

2009-06-17 Thread André Warnier

Kyle Brantley (and many others) wrote:
...
Sorry to interrupt, but actually guys I believe that the problem is due 
to the way the data is POSTed, which in this case is - I believe - invalid.

See http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4
The data of a POST can be sent according to one of two encodings :
application/x-www-form-urlencoded
OR
multipart/form-data
This data is neither.
The way the data is sent in this case may be appropriate for a PUT, but 
not for a POST.

This may be why the usual servlet methods are getting confused.

To Kyle :

Create a simple form ..  in html, with two text input fields (and a 
submit button).

To the form tag, add an explicit enctype attribute :

form action=here_your_webapp_URL 
enctype=application/x-www-form-urlencoded


and submit the form to your webapp.
See what goes out with wireshark.

Then change the enctype in the form to multipart/form-data, submit 
again, and look in wireshark.


These are the two ways you can submit data.





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



Re: Reading POSTed data

2009-06-17 Thread André Warnier

André Warnier wrote:



Addendum :

from Servlet Spec 2.5 :

SRV.3.1.1 When Parameters Are Available
The following are the conditions that must be met before post form data 
will be populated to the parameter set:

1. The request is an HTTP or HTTPS request.
2. The HTTP method is POST.
3. The content type is application/x-www-form-urlencoded.
4. The servlet has made an initial call of any of the getParameter 
family of methods on the request object.
If the conditions are not met and the post form data is not included in 
the parameter set, the post data must still be available to the servlet 
via the request object’s input stream. If the conditions are met, post 
form data will no longer be available for reading directly from the 
request object’s input stream.


Just thought I'd save Chuck a cut-and-paste..

Now, to be totally forthcoming, I must say that I did not find some 
definite clearcut spec anywhere (like RFC2616 or the servlet spec) that 
POST data *must* be one of the two encodings mentioned earlier, 
exclusive of all others.  Interestingly, the servlet spec's wording even 
sounds like it would leave open the encoding, when it is /not/ 
application/x-www-form-urlencoded.
But it does talk about POST form data and parameter set, which in my 
view explicitly refers to this :

http://www.w3.org/TR/html401/interact/forms.html#form-data-set
This last in turn clearly specifies that POST data should be at least in 
pairs of parameter name / parameter value.


Which this XML data anyway is not.
CQFD.



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



Tomcat shutdown problem due to running threads.

2009-06-17 Thread CBy
O'Reilly's Tomcat The Definitive Guide advises me to invoke the 
setDaemon(true) method on any Thread object a web application creates to 
keep them from hanging the JVM when Tomcat shuts down. My web service, 
however, uses a thread pool that is created via 
java.util.concurrent.Executors.newFixedThreadPool(NTHREADS) and I don't 
know how to make them daemon threads in this case.


My new plan was to register a shutdown hook with the JVM in my web 
service and to invoke shutdown() or shutdownNow() on the ExecutorService 
in it (the method above returns an ExecutorService). Unfortunately, this 
does not seem to work.


Is there another way to be notified when Tomcat shuts down, so I can 
shutdown the thread pool accordingly?


Thanks in advance,

Carsten

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



Re: Tomcat shutdown problem due to running threads.

2009-06-17 Thread André Warnier

CBy wrote:
O'Reilly's Tomcat The Definitive Guide advises me to invoke the 
setDaemon(true) method on any Thread object a web application creates to 
keep them from hanging the JVM when Tomcat shuts down. My web service, 
however, uses a thread pool that is created via 
java.util.concurrent.Executors.newFixedThreadPool(NTHREADS) and I don't 
know how to make them daemon threads in this case.


My new plan was to register a shutdown hook with the JVM in my web 
service and to invoke shutdown() or shutdownNow() on the ExecutorService 
in it (the method above returns an ExecutorService). Unfortunately, this 
does not seem to work.


Is there another way to be notified when Tomcat shuts down, so I can 
shutdown the thread pool accordingly?



From a non-expert (but the expterts are mostly asleep right now) :
maybe this ?
http://tomcat.apache.org/tomcat-6.0-doc/config/listeners.html

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



Problem with the Error Pages customization

2009-06-17 Thread Zeeshan Ahmad
Hello,

 

I am facing Problem with the Error Pages customization on Tomcat, can
someone assist me, thanks.

 

Best Regards,

Zeeshan Ahmad.

 

P Save a tree...pls don't print this e-mail unless necessary 

 



RE: Problem with the Error Pages customization

2009-06-17 Thread Ghufran
Hi Zeeshan

 

Try to use the error page tag in web.xml

 

See http://wiki.metawerx.net/wiki/Web.xml.ErrorPage for details

 

Regards

Ghufran

 

-Original Message-
From: Zeeshan Ahmad [mailto:zah...@i2cinc.com] 
Sent: Wednesday, June 17, 2009 1:48 PM
To: 'Tomcat Users List'
Subject: Problem with the Error Pages customization

 

Hello,

 

 

 

I am facing Problem with the Error Pages customization on Tomcat, can

someone assist me, thanks.

 

 

 

Best Regards,

 

Zeeshan Ahmad.

 

 

 

P Save a tree...pls don't print this e-mail unless necessary 

 

 

 

No virus found in this incoming message.

Checked by AVG - www.avg.com 

Version: 8.5.359 / Virus Database: 270.12.75/2182 - Release Date: 06/16/09
21:23:00



RE: Beginner with apache

2009-06-17 Thread Hracek, Petr
Output of command find is:
apache:~ # find /opt/secm/servlet -print
/opt/secm/servlet
/opt/secm/servlet/WEB-INF
/opt/secm/servlet/WEB-INF/classes
/opt/secm/servlet/WEB-INF/classes/SecMServlet.class
/opt/secm/servlet/WEB-INF/web.xml
apache:~ #

Full URL is: https://10.6.81.5/SecM/servlet/SecMServlet

HTML Code of return page is:
htmlheadtitleApache Tomcat/5.0 - Error report/titlestyle!--H1 
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
 H2 
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;}
 H3 
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;}
 BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} 
B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P 
{font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A
 {color : black;}A.name {color : black;}HR {color : #525D76;}--/style 
/headbodyh1HTTP Status 404 - /SecM/servlet/SecMServlet/h1HR size=1 
noshade=noshadepbtype/b Status report/ppbmessage/b 
u/SecM/servlet/SecMServlet/u/ppbdescription/b uThe requested 
resource (/SecM/servlet/SecMServlet) is not available./u/pHR size=1 
noshade=noshadeh3Apache Tomcat/5.0/h3/body/html

Rewrite Log is:
10.6.254.22 - - [17/Jun/2009:12:07:35 +0200] 
[10.6.81.5/sid#801685c0][rid#80202038/initial] (2) init rewrite engine with 
requested uri /SecM/servlet/SecMServlet
10.6.254.22 - - [17/Jun/2009:12:07:35 +0200] 
[10.6.81.5/sid#801685c0][rid#80202038/initial] (3) applying pattern '/servlet/' 
to uri '/SecM/servlet/SecMServlet'
10.6.254.22 - - [17/Jun/2009:12:07:35 +0200] 
[10.6.81.5/sid#801685c0][rid#80202038/initial] (1) pass through 
/SecM/servlet/SecMServlet

Output of mod_jk.log is:
[Wed Jun 17 12:12:33.584 2009] [20225:3081386784] [debug] 
map_uri_to_worker_ext::jk_uri_worker_map.c (1036): Attempting to map URI 
'/SecM/servlet/SecMServlet' from 7 maps
[Wed Jun 17 12:12:33.584 2009] [20225:3081386784] [debug] 
find_match::jk_uri_worker_map.c (850): Attempting to map context URI 
'/RepGen/servlet/*=ajp13' source 'JkMount'
[Wed Jun 17 12:12:33.584 2009] [20225:3081386784] [debug] 
find_match::jk_uri_worker_map.c (850): Attempting to map context URI 
'/SNMP/servlet/*=ajp13' source 'JkMount'
[Wed Jun 17 12:12:33.584 2009] [20225:3081386784] [debug] 
find_match::jk_uri_worker_map.c (850): Attempting to map context URI 
'/SecM/servlet/*=ajp13' source 'JkMount'
[Wed Jun 17 12:12:33.584 2009] [20225:3081386784] [debug] 
find_match::jk_uri_worker_map.c (863): Found a wildchar match 
'/SecM/servlet/*=ajp13'
[Wed Jun 17 12:12:33.585 2009] [20225:3081386784] [debug] jk_handler::mod_jk.c 
(2459): Into handler jakarta-servlet worker=ajp13 r-proxyreq=0
[Wed Jun 17 12:12:33.585 2009] [20225:3081386784] [debug] 
wc_get_worker_for_name::jk_worker.c (116): found a worker ajp13
[Wed Jun 17 12:12:33.585 2009] [20225:3081386784] [debug] 
wc_maintain::jk_worker.c (339): Maintaining worker ajp13
[Wed Jun 17 12:12:33.585 2009] [20225:3081386784] [debug] 
wc_get_name_for_type::jk_worker.c (293): Found worker type 'ajp13'
[Wed Jun 17 12:12:33.585 2009] [20225:3081386784] [debug] 
init_ws_service::mod_jk.c (977): Service protocol=HTTP/1.1 method=GET ssl=true 
host=(null) addr=10.6.254.22 name=10.6.81.5 port=443 auth=(null) user=(null) 
laddr=10.6.81.5 raddr=10.6.254.22 uri=/SecM/servlet/SecMServlet
[Wed Jun 17 12:12:33.585 2009] [20225:3081386784] [debug] 
ajp_get_endpoint::jk_ajp_common.c (2977): acquired connection pool slot=0 after 
0 retries
[Wed Jun 17 12:12:33.585 2009] [20225:3081386784] [debug] 
ajp_marshal_into_msgb::jk_ajp_common.c (605): ajp marshaling done
[Wed Jun 17 12:12:33.585 2009] [20225:3081386784] [debug] 
ajp_service::jk_ajp_common.c (2283): processing ajp13 with 2 retries
[Wed Jun 17 12:12:33.585 2009] [20225:3081386784] [debug] 
ajp_send_request::jk_ajp_common.c (1501): (ajp13) all endpoints are 
disconnected.
[Wed Jun 17 12:12:33.585 2009] [20225:3081386784] [debug] 
jk_open_socket::jk_connect.c (452): socket TCP_NODELAY set to On
[Wed Jun 17 12:12:33.585 2009] [20225:3081386784] [debug] 
jk_open_socket::jk_connect.c (576): trying to connect socket 17 to 
127.0.0.1:8009
[Wed Jun 17 12:12:33.585 2009] [20225:3081386784] [debug] 
jk_open_socket::jk_connect.c (602): socket 17 connected to 127.0.0.1:8009
[Wed Jun 17 12:12:33.585 2009] [20225:3081386784] [debug] 
ajp_connect_to_endpoint::jk_ajp_common.c (931): Connected socket 17 to 
(127.0.0.1:8009)
[Wed Jun 17 12:12:33.585 2009] [20225:3081386784] [debug] 
ajp_connection_tcp_send_message::jk_ajp_common.c (1070): sending to ajp13 pos=4 
len=696 max=8192
[Wed Jun 17 12:12:33.585 2009] [20225:3081386784] [debug] 
ajp_connection_tcp_send_message::jk_ajp_common.c (1070): 12 34 02 B4 02 
02 00 08 48 54 54 50 2F 31 2E 31  - .4..HTTP/1.1
[Wed Jun 17 12:12:33.585 2009] [20225:3081386784] [debug] 
ajp_connection_tcp_send_message::jk_ajp_common.c (1070): 001000 00 19 2F 53 

Session replication using only PersistenceManager + JDBCStore

2009-06-17 Thread Yves Glodt
Hello,

I am currently trying to set up session replication, and reading this
document [1], but a few questions remain.

In my setup are 4 apaches with mod_proxy which connect to 4 tomcats.
In front of the apaches is a hardware balancer
which does round-robin, but with a kind of sticky TCP-sessions, so
mostly the clients on the web stay on the same server. Mostly...

To be completely safe and sleep well, I would like to replicate the
sessions now,
and in the mentioned document I read that it is possible using the
PersistenceManager with JDBCStore.

My question now:
Is it enough to set up PersistenceManager with JDBCStore on my 4
tomcats to use the same database/table as session store ?
Or do I need to mess with ReplicationValve and jvmRoute set up as well ?

I will put my server.xml at the end of the file, which is set up with
JDBCStore using a Firebird Database with JayBird.

Best regards,
Yves


[1] http://tomcat.apache.org/tomcat-5.5-doc/cluster-howto.html



Server.xml which I use for testing:

Server port=8005 shutdown=SHUTDOWN

Service name=Testing
Connector port=8181 /

Engine name=testing defaultHost=localhost

Host name=localhost debug=99 appBase=/storage/tomcat
unpackWARs=true autoDeploy=true

Context path=/HelloWorld docBase=HelloWorld debug=99
reloadable=false distributable=true

Manager className=org.apache.catalina.session.PersistentManager
debug=99 distributable=true
maxActiveSessions=-1
maxIdleBackup=10
maxIdleSwap=15
minIdleSwap=5
maxInactiveInterval=1800
saveOnRestart=true

Store className=org.apache.catalina.session.JDBCStore
driverName=org.firebirdsql.jdbc.FBDriver
connectionURL=jdbc:firebirdsql:myhighavailablefirebirdserver:tomcat_sessions?userName=SYSDBAamp;password=masterkeyamp;encoding=UTF8
sessionTable=session
sessionAppCol=app_name
sessionDataCol=session_data
sessionIdCol=session_id
sessionLastAccessedCol=last_access
sessionMaxInactiveCol=max_inactive
sessionValidCol=valid_session
debug=99 checkInterval=60 /

/Manager

/Context

/Host

/Engine
/Service

/Server

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



tomcat 6 - setting classpath

2009-06-17 Thread Tom Brown

Hi

On tomcat 6.0.18 i need to set the classpath of a webapp, its the only 
webapp running inside this tomcat.


i believe i need to do something like the following in the web.xml

context-param
param-nameclasspath/param-name
param-value/my/webapp/conf/param-value
/context-param

but this seems ignored so can anyone point me to the syntax of what this 
is and where to put it ?


thanks

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



Re: tomcat 6 - setting classpath

2009-06-17 Thread Mikolaj Rydzewski

Tom Brown wrote:
On tomcat 6.0.18 i need to set the classpath of a webapp, its the only 
webapp running inside this tomcat.


i believe i need to do something like the following in the web.xml

context-param
param-nameclasspath/param-name
param-value/my/webapp/conf/param-value
/context-param

but this seems ignored so can anyone point me to the syntax of what 
this is and where to put it ?

Why not use WEB-INF/lib directory?

--
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: tomcat 6 - setting classpath

2009-06-17 Thread Tom Brown



Why not use WEB-INF/lib directory?


quite a long story BUT that locations contains _default_ setting ie 
those for dev and when it goes into prod i need to override those with 
settings from the config directory - so i need to be able to manipulate 
it on the fly so to speak while still being able to use the same war.


hope that helps explain a little


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



Re: tomcat 6 - setting classpath

2009-06-17 Thread Mikolaj Rydzewski

Tom Brown wrote:

Why not use WEB-INF/lib directory?


quite a long story BUT that locations contains _default_ setting ie 
those for dev and when it goes into prod i need to override those with 
settings from the config directory - so i need to be able to 
manipulate it on the fly so to speak while still being able to use the 
same war.
Is the difference only between configuration files, or between jar files 
also?
I suggest to keep such configuration file outside of webapp - e.g. in 
${tomcat}/lib/classes. So you'll have dev tomcat setup, prod tomcat 
setup and one war file.


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



smime.p7s
Description: S/MIME Cryptographic Signature


Re: tomcat 6 - setting classpath

2009-06-17 Thread Tom Brown


Is the difference only between configuration files, or between jar 
files also?
I suggest to keep such configuration file outside of webapp - e.g. in 
${tomcat}/lib/classes. So you'll have dev tomcat setup, prod tomcat 
setup and one war file.




it is only configuration files - no jar changes. I am trying to get 
these stripped from the war but thats a difficult process, i know i can 
do it in about 5 seconds but its a 'process' thing and then the war is 
'different'


Is what i am asking not possible?



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



Re: tomcat 6 - setting classpath

2009-06-17 Thread Mikolaj Rydzewski

Tom Brown wrote:
it is only configuration files - no jar changes. I am trying to get 
these stripped from the war but thats a difficult process, i know i 
can do it in about 5 seconds but its a 'process' thing and then the 
war is 'different'


Is what i am asking not possible?
One can nest Loader component inside a Contex one. Your custom Loader 
component could use different class loading mechanism. I have never 
tried it, and I doubt it's worth your time. It's better to process your 
'process' and change the way war file is built ;-)


http://tomcat.apache.org/tomcat-6.0-doc/config/context.html
http://tomcat.apache.org/tomcat-6.0-doc/config/loader.html


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



smime.p7s
Description: S/MIME Cryptographic Signature


Tomcat tracks at the ApacheConUS2009

2009-06-17 Thread jean-frederic clere

Hi,

The Tomcat PMC has prepared the tracks of Tomcat for the ApacheCon US 
2009. The first track is the official Tomcat Wednesday track the second 
one will be held in a small room (50) on Thursday after the main track.


Drafts of the tracks are available at 
http://wiki.apache.org/tomcat/TomcatTrackUs09 and 
http://wiki.apache.org/tomcat/SmallTomcatTrackUs09


The first track needs to be fixed soon for the conference announcement 
but the second one could be changed later. We also plan to make Meetups 
or BOF the evening of the Thursday.


Comments?

Cheers

Jean-Frederic

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



Pointers on diagnosing session and thread hangs

2009-06-17 Thread Pete Helgren
We are having a devil of a time tracking down why a web app is hanging 
while running in Tomcat.  We are running version 5.5.27 in Windows XP 
with 2Gb RAM.  The symptom is that randomly a user will report that they 
cannot log into the application.  When we view the Tomcat application 
using Lambda Probe we see many sessions that are persisting long after 
their session expirations should have removed them and the number of 
threads steadily increasing.  The assumption is that we have some 
objects that are getting created that are not being destroyed and 
causing the session to persist or there is some object locked that is 
waiting on another process or thread  somewhere.  I am not an expert by 
any stretch in Tomcat internals so what I need is a way to determine 
what is causing the sessions to hang and the threads to begin to grow 
beyond the maximum (650 in our case). 

Is there a step by step FAQ somewhere that would allow us to 
systematically analyze the running servlet and determine where the 
hang is?  I'd love to see what instruction the code is executing when 
the hang is occurring.  Any pointers/tools you could suggest would be 
helpful.


Thanks,

Pete


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



RE: Beginner with apache

2009-06-17 Thread Hracek, Petr
Finally the servlet is working.
Could you please tell me how to deploy the application to tomcat from command 
line?

Is it enough to copy the application to the specific tomcat directories and 
afterwards
restart tomcat?

regards / S pozdravem
Petr Hráček

-Original Message-
From: Hracek, Petr [mailto:petr.hra...@siemens-enterprise.com] 
Sent: Wednesday, June 17, 2009 11:08 AM
To: Tomcat Users List
Subject: RE: Beginner with apache

Output of command find is:
apache:~ # find /opt/secm/servlet -print
/opt/secm/servlet
/opt/secm/servlet/WEB-INF
/opt/secm/servlet/WEB-INF/classes
/opt/secm/servlet/WEB-INF/classes/SecMServlet.class
/opt/secm/servlet/WEB-INF/web.xml
apache:~ #

Full URL is: https://10.6.81.5/SecM/servlet/SecMServlet

HTML Code of return page is:
htmlheadtitleApache Tomcat/5.0 - Error report/titlestyle!--H1 
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
 H2 
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;}
 H3 
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;}
 BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} 
B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P 
{font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A
 {color : black;}A.name {color : black;}HR {color : #525D76;}--/style 
/headbodyh1HTTP Status 404 - /SecM/servlet/SecMServlet/h1HR size=1 
noshade=noshadepbtype/b Status report/ppbmessage/b 
u/SecM/servlet/SecMServlet/u/ppbdescription/b uThe requested 
resource (/SecM/servlet/SecMServlet) is not available./u/pHR size=1 
noshade=noshadeh3Apache Tomcat/5.0/h3/body/html

Rewrite Log is:
10.6.254.22 - - [17/Jun/2009:12:07:35 +0200] 
[10.6.81.5/sid#801685c0][rid#80202038/initial] (2) init rewrite engine with 
requested uri /SecM/servlet/SecMServlet
10.6.254.22 - - [17/Jun/2009:12:07:35 +0200] 
[10.6.81.5/sid#801685c0][rid#80202038/initial] (3) applying pattern '/servlet/' 
to uri '/SecM/servlet/SecMServlet'
10.6.254.22 - - [17/Jun/2009:12:07:35 +0200] 
[10.6.81.5/sid#801685c0][rid#80202038/initial] (1) pass through 
/SecM/servlet/SecMServlet

Output of mod_jk.log is:
[Wed Jun 17 12:12:33.584 2009] [20225:3081386784] [debug] 
map_uri_to_worker_ext::jk_uri_worker_map.c (1036): Attempting to map URI 
'/SecM/servlet/SecMServlet' from 7 maps
[Wed Jun 17 12:12:33.584 2009] [20225:3081386784] [debug] 
find_match::jk_uri_worker_map.c (850): Attempting to map context URI 
'/RepGen/servlet/*=ajp13' source 'JkMount'
[Wed Jun 17 12:12:33.584 2009] [20225:3081386784] [debug] 
find_match::jk_uri_worker_map.c (850): Attempting to map context URI 
'/SNMP/servlet/*=ajp13' source 'JkMount'
[Wed Jun 17 12:12:33.584 2009] [20225:3081386784] [debug] 
find_match::jk_uri_worker_map.c (850): Attempting to map context URI 
'/SecM/servlet/*=ajp13' source 'JkMount'
[Wed Jun 17 12:12:33.584 2009] [20225:3081386784] [debug] 
find_match::jk_uri_worker_map.c (863): Found a wildchar match 
'/SecM/servlet/*=ajp13'
[Wed Jun 17 12:12:33.585 2009] [20225:3081386784] [debug] jk_handler::mod_jk.c 
(2459): Into handler jakarta-servlet worker=ajp13 r-proxyreq=0
[Wed Jun 17 12:12:33.585 2009] [20225:3081386784] [debug] 
wc_get_worker_for_name::jk_worker.c (116): found a worker ajp13
[Wed Jun 17 12:12:33.585 2009] [20225:3081386784] [debug] 
wc_maintain::jk_worker.c (339): Maintaining worker ajp13
[Wed Jun 17 12:12:33.585 2009] [20225:3081386784] [debug] 
wc_get_name_for_type::jk_worker.c (293): Found worker type 'ajp13'
[Wed Jun 17 12:12:33.585 2009] [20225:3081386784] [debug] 
init_ws_service::mod_jk.c (977): Service protocol=HTTP/1.1 method=GET ssl=true 
host=(null) addr=10.6.254.22 name=10.6.81.5 port=443 auth=(null) user=(null) 
laddr=10.6.81.5 raddr=10.6.254.22 uri=/SecM/servlet/SecMServlet
[Wed Jun 17 12:12:33.585 2009] [20225:3081386784] [debug] 
ajp_get_endpoint::jk_ajp_common.c (2977): acquired connection pool slot=0 after 
0 retries
[Wed Jun 17 12:12:33.585 2009] [20225:3081386784] [debug] 
ajp_marshal_into_msgb::jk_ajp_common.c (605): ajp marshaling done
[Wed Jun 17 12:12:33.585 2009] [20225:3081386784] [debug] 
ajp_service::jk_ajp_common.c (2283): processing ajp13 with 2 retries
[Wed Jun 17 12:12:33.585 2009] [20225:3081386784] [debug] 
ajp_send_request::jk_ajp_common.c (1501): (ajp13) all endpoints are 
disconnected.
[Wed Jun 17 12:12:33.585 2009] [20225:3081386784] [debug] 
jk_open_socket::jk_connect.c (452): socket TCP_NODELAY set to On
[Wed Jun 17 12:12:33.585 2009] [20225:3081386784] [debug] 
jk_open_socket::jk_connect.c (576): trying to connect socket 17 to 
127.0.0.1:8009
[Wed Jun 17 12:12:33.585 2009] [20225:3081386784] [debug] 
jk_open_socket::jk_connect.c (602): socket 17 connected to 127.0.0.1:8009
[Wed Jun 17 12:12:33.585 2009] [20225:3081386784] [debug] 
ajp_connect_to_endpoint::jk_ajp_common.c (931): Connected socket 17 to 
(127.0.0.1:8009)
[Wed Jun 17 12:12:33.585 2009] 

Re: Reading POSTed data

2009-06-17 Thread Tim Funk
Change your loop to be:  
 int i;

 while ((i=in.read())) {
   out.write(i);
 }

available() - Returns the number of bytes that can be read (or skipped 
over) from this input stream without blocking by the next caller of a 
method for this input stream. So its not an accurate gauge of how much 
content is available from the client.



-Tim


Kyle Brantley wrote:
I'm honestly not sure (being an entire day into tomcat servlets), but 
I don't believe so.



Full code:

public class Frontend extends HttpServlet {

public void doPost(HttpServletRequest request, HttpServletResponse 
response) throws ServletException, IOException {

PrintWriter out = response.getWriter();
InputStream in = request.getInputStream();
response.setContentType(text/xml);
response.setCharacterEncoding(UTF-8);
response.setStatus(HttpServletResponse.SC_OK);
   
while (in.available()  0)

out.write(in.read());
}
}



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



RE: SSL Configuration Problem, can not open https://localhost:8443

2009-06-17 Thread Caldarale, Charles R
 From: yuting lv [mailto:yutin...@gmail.com]
 Subject: Re: SSL Configuration Problem, can not open
 https://localhost:8443
 
 I found another tcnative-1.dll file under C:\windows\system32 
 directory too,

I would remove it - that .dll should only be in Tomcat's bin directory.

 - 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



Web Container Authentication Via LDAP for a JSPWiki

2009-06-17 Thread Stefan Kuhn
Hi,

i have configured a Web Container Authentication Via LDAP with the
instructions from this page:
http://www.jspwiki.org/wiki/WebContainerAuthenticationViaLDAP

I can now login to the wiki, but have problems with the rights, it isn't
even possible to read pages.

The web.xml seems to be definied correctly with:

   security-constraint
   web-resource-collection
   web-resource-nameAuthenticated area/web-resource-name
   url-pattern/Edit.jsp/url-pattern
   url-pattern/Comment.jsp/url-pattern
   url-pattern/Login.jsp/url-pattern
   url-pattern/NewGroup.jsp/url-pattern
   url-pattern/Rename.jsp/url-pattern
   url-pattern/Upload.jsp/url-pattern
   http-methodDELETE/http-method
   http-methodGET/http-method
   http-methodHEAD/http-method
   http-methodPOST/http-method
   http-methodPUT/http-method
   /web-resource-collection

   web-resource-collection
   web-resource-nameRead-only Area/web-resource-name
   url-pattern/attach/url-pattern
   http-methodDELETE/http-method
   http-methodPOST/http-method
   http-methodPUT/http-method
   /web-resource-collection

   auth-constraint
   role-namewikiuser/role-name
   role-namewikiadmin/role-name
   /auth-constraint

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

and

   security-role
   description
   This logical role includes all wikiusers
   /description
   role-namewikiuser/role-name
   /security-role

   security-role
   description
   This logical role includes all wikiadmins
   /description
   role-namewikiadmin/role-name
   /security-role


Has anybody ever done what i want to do?

Best regards,
  Stefan

-- 
/**
 * Stefan Kuhn
 * Software Developer
 * Synyx GmbH  Co. KG --OpenCms Solution Provider--J2ME Solutions--
 * Karlstr. 68
 * 76137 Karlsruhe
 *
 * phone  +49(0)721 66 24 866
 * fax+49(0)721 66 48 877
 * eMail  k...@synyx.de
 * wwwhttp://www.synyx.de
 * irc   irc.synyx.de
 *
 * Sitz der Gesellschaft: Karlsruhe
 * Registergericht: Mannheim
 * Handelsregisternummer: HRA 4793
 * USt-IdNr.: DE249264296
 *
 * Komplementärin: Elatech Verwaltungs GmbH
 * Sitz der Gesellschaft: Karlsruhe
 * Geschäftsführer: Markus Daniel
 * Registergericht: Mannheim
 * Handelsregisternummer: HRB 7250
 */
 */

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



Serving images from classes directory

2009-06-17 Thread Susan G. Conger
This may be a bit weird, however there is a reason for it.  I need to be
able to serve images from the classes directory of my web app.  The web app
is created using another companies program and all of the code is in the
classes directory.  I want to add an images directory and put all of my
custom images in that directory and then using them in my html/jsp pages.  I
also need to be able to insert/execute javascript code that is in the
classes directory or another directory below the classes directory.  Anyone
have any idea how to do this?

 

Thanks,

Susan

 

 


BFC Associates, Inc. 

  

Helping Save You Money on Warehouse Operations


Susan Conger

Chapel Hill, NC

630-562-0375 x106



Main Office:

245 W. Roosevelt Rd. #8-51

West Chicago, IL 60185

630.562.0375

630.562.0618 (fax)

 

 



Re: Just a few questions on my Tomcat Configuration

2009-06-17 Thread Josh Gooding
On Wed, Jun 17, 2009 at 12:02 AM, Caldarale, Charles R 
chuck.caldar...@unisys.com wrote:

  From: Josh Gooding [mailto:josh.good...@gmail.com]
  Subject: Re: Just a few questions on my Tomcat Configuration

 No, the appBase attribute defines where *all* of the Host webapps go,
 each in its own directory or .war file immediately under the appBase
 directory.  Again, look at what Tomcat has in its default distribution;
 under the webapps directory, you'll find docs, examples, host-manager,
 manager, and ROOT.  Each one of those is a separate, independent webapp,
 with ROOT being the default for the Host; ROOT is used when the URL
 doesn't match any of the others.


 This alternative scheme uses only one Host, and deploys the webapp under
 a different name for each sub.  This allows you to add or remove subs on
 the fly, without taking Tomcat down.  Your current scheme requires
 restarting Tomcat whenever you want to add or a remove a subdomain.


This is what I was trying to figure out.  How can I add one on the fly
without restarting Tomcat each time I add / remove a subdomain.



  - Chuck


UGH!  what an idiot I've been.  I did this, didn't have to mess with the
Host and tied everything to a sub directory.  :: bangs head on desk ::
This would have been S much faster if I had not been so stubborn and
hell bent on using subdomains  It took my install procedure from 8 steps
to 4 and now takes a mere few seconds rather than a few minutes of my
time

Thanks again!  You are the man


Mix http and https on one tomcat server?

2009-06-17 Thread Bruce Edge
Is it possible to deploy both http and https on the same tomcat instance?
I'd like to expose https to the external IP addr and http to 127.0.0.1.

How is this configured in the xerver.xml file?

I'm using apache cxf if that matters.

Thanks

-Bruce

P.S. Apologies if this is a resend, I have just joined and I'm not sure if
my first post got through.


Re: Tomcat shutdown problem due to running threads.

2009-06-17 Thread CBy
Thanks for pointing me in the right direction André. A 
ServletContextListener fixed my problem.



André Warnier wrote:

CBy wrote:
O'Reilly's Tomcat The Definitive Guide advises me to invoke the 
setDaemon(true) method on any Thread object a web application creates 
to keep them from hanging the JVM when Tomcat shuts down. My web 
service, however, uses a thread pool that is created via 
java.util.concurrent.Executors.newFixedThreadPool(NTHREADS) and I 
don't know how to make them daemon threads in this case.


My new plan was to register a shutdown hook with the JVM in my web 
service and to invoke shutdown() or shutdownNow() on the 
ExecutorService in it (the method above returns an ExecutorService). 
Unfortunately, this does not seem to work.


Is there another way to be notified when Tomcat shuts down, so I can 
shutdown the thread pool accordingly?



From a non-expert (but the expterts are mostly asleep right now) :
maybe this ?
http://tomcat.apache.org/tomcat-6.0-doc/config/listeners.html

-
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



DBCP connection pool exhausted, can I trace borrowed connnections from pool?

2009-06-17 Thread Arrowx7

Using mysql JDBC driver.  Somewhere in the appilcation, the connections are
drawn from the DBCP pool, and never returned.  I did
dataSource.getNumActive() and dataSource.getNumIdle().  There are 2 idle
connections, and 88 active connections.  Somewhere in my web application a
process does not close the connection and return it to pool.  there a way to
print stack trace the current active connections or something to find where
it's leaky?
-- 
View this message in context: 
http://www.nabble.com/DBCP-connection-pool-exhausted%2C-can-I-trace-borrowed-connnections-from-pool--tp24075241p24075241.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: Tomcat shutdown problem due to running threads.

2009-06-17 Thread André Warnier

CBy wrote:
Thanks for pointing me in the right direction André. A 
ServletContextListener fixed my problem.


My own contribution was minimal, and due mainly to the fact that I am 
eavesdropping on the real Tomcat experts conversations here and 
remembering some things, even if I never used them myself and would not 
recognise one if it appeared in some code.
Fortunately, a Listener is a Tomcat thing that has a pretty expressive 
name, and it seemed to fit your request.

Don't ask me how it works though..
;-)

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



RE: DBCP connection pool exhausted, can I trace borrowed connnections from pool?

2009-06-17 Thread Propes, Barry L
You have leaks all over the place!
You'll need to go explicitly close your connections with myriad 
try/catch/finally blocks and see if you can start shoring it up that way!

-Original Message-
From: Arrowx7 [mailto:aluminum3...@yahoo.com] 
Sent: Wednesday, June 17, 2009 9:45 AM
To: users@tomcat.apache.org
Subject: DBCP connection pool exhausted, can I trace borrowed connnections from 
pool?


Using mysql JDBC driver.  Somewhere in the appilcation, the connections are 
drawn from the DBCP pool, and never returned.  I did
dataSource.getNumActive() and dataSource.getNumIdle().  There are 2 idle 
connections, and 88 active connections.  Somewhere in my web application a 
process does not close the connection and return it to pool.  there a way to 
print stack trace the current active connections or something to find where 
it's leaky?
--
View this message in context: 
http://www.nabble.com/DBCP-connection-pool-exhausted%2C-can-I-trace-borrowed-connnections-from-pool--tp24075241p24075241.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


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



Re: DBCP connection pool exhausted, can I trace borrowed connnections from pool?

2009-06-17 Thread Filip Hanik - Dev Lists

set properties

removeAbandoned=true
removeAbandonedTimeout=60
logAbandoned=true

This will expire leaked connections and print out the stack trace from 
where they were acquired.


Filip

Arrowx7 wrote:

Using mysql JDBC driver.  Somewhere in the appilcation, the connections are
drawn from the DBCP pool, and never returned.  I did
dataSource.getNumActive() and dataSource.getNumIdle().  There are 2 idle
connections, and 88 active connections.  Somewhere in my web application a
process does not close the connection and return it to pool.  there a way to
print stack trace the current active connections or something to find where
it's leaky?
  



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



RE: Just a few questions on my Tomcat Configuration

2009-06-17 Thread Caldarale, Charles R
 From: Josh Gooding [mailto:josh.good...@gmail.com]
 Subject: Re: Just a few questions on my Tomcat Configuration
 
 This is what I was trying to figure out.  How can I add one on the fly
 without restarting Tomcat each time I add / remove a subdomain.

It's theoretically possible, since the APIs exist for Tomcat running embedded.  
However, I don't know of any reasonably easy to use mechanism that makes use of 
said APIs.

 - 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: Serving images from classes directory

2009-06-17 Thread Caldarale, Charles R
 From: Susan G. Conger [mailto:sus...@bfcassociates.com]
 Subject: Serving images from classes directory
 
 I need to be able to serve images from the classes directory 
 of my web app.

Try using ClassLoader.getResourceAsStream() to read the image, then write it to 
the response output stream.  You'll need to set the content-type header 
appropriately, of course.

 - 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: Serving images from classes directory

2009-06-17 Thread Susan G. Conger
So there isn't any easy way to do this without using java?  I was just
wanted to use a different url and have them served up correctly.  Can you
give me/point me to an example of what you are talking about below?

Thanks,
Susan

-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
Sent: Wednesday, June 17, 2009 11:33 AM
To: Tomcat Users List
Subject: RE: Serving images from classes directory

 From: Susan G. Conger [mailto:sus...@bfcassociates.com]
 Subject: Serving images from classes directory
 
 I need to be able to serve images from the classes directory 
 of my web app.

Try using ClassLoader.getResourceAsStream() to read the image, then write it
to the response output stream.  You'll need to set the content-type header
appropriately, of course.

 - 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: Mix http and https on one tomcat server?

2009-06-17 Thread Caldarale, Charles R
 From: Bruce Edge [mailto:bruce.e...@gmail.com]
 Subject: Mix http and https on one tomcat server?
 
 Is it possible to deploy both http and https on the same 
 tomcat instance?

Of course.

Read the doc:
http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html
http://tomcat.apache.org/tomcat-6.0-doc/config/http.html#SSL%20Support

 - 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



Celebrating Apache Tomcat 10th Anniversary

2009-06-17 Thread Mladen Turk

If you didn't know...

From the 1999 news:

The Jakarta Project was announced by the Apache developer community
 and Sun Microsystems, Inc. on the 15th of June, 1999 at JavaOne.
 It will be composed of members from the current Apache JServ Project,
 Sun, IBM, and other corporations as well as all interested developers.

The first message on dev@ list was posted by Brian Behlendorf
on Tue, 15 Jun 1999 07:53:14 GMT and it looked like this:

This is just a test of the ezmlm system... let's see if it works.  =)

So, wish us happy anniversary :)

Regards
--
Mladen Turk
Apache Tomcat PMC Chair

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



Re: Serving images from classes directory

2009-06-17 Thread Hassan Schroeder
On Wed, Jun 17, 2009 at 6:56 AM, Susan G. Conger
sus...@bfcassociates.com wrote:

 This may be a bit weird, however there is a reason for it.  I need to
 be able to serve images from the classes directory of my web app.

I have to ask -- why? It seems a pointless complication...

--
Hassan Schroeder  hassan.schroe...@gmail.com

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



RE: Serving images from classes directory

2009-06-17 Thread Susan G. Conger
The web app is made by another company that screen scrapes/translates a
mainframe app and then makes a web app out of it.  They store this in their
classes directory.  So in order to keep everything together and make
maintenance and deployment easier, I would like to have all of the generated
code and custom code in one location.  That way I don't have to pull things
from everywhere when I deploy to the web app to our customers.  I wish it
didn't work this way and if I was developing from scratch I wouldn't do it
this way.  However sometime we have to find work arounds caused by the
environment that others choose.  Basically I am stuck so I am trying to make
the best of it.

Thanks,
Susan

-Original Message-
From: Hassan Schroeder [mailto:hassan.schroe...@gmail.com] 
Sent: Wednesday, June 17, 2009 11:56 AM
To: Tomcat Users List; sus...@bfcassociates.com
Subject: Re: Serving images from classes directory

On Wed, Jun 17, 2009 at 6:56 AM, Susan G. Conger
sus...@bfcassociates.com wrote:

 This may be a bit weird, however there is a reason for it.  I need to
 be able to serve images from the classes directory of my web app.

I have to ask -- why? It seems a pointless complication...

--
Hassan Schroeder  hassan.schroe...@gmail.com

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




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



Re: Serving images from classes directory

2009-06-17 Thread Hassan Schroeder
On Wed, Jun 17, 2009 at 9:04 AM, Susan G. Conger
sus...@bfcassociates.comwrote:

 The web app is made by another company that screen scrapes/translates a
 mainframe app and then makes a web app out of it.  They store this in their
 classes directory.  So in order to keep everything together and make
 maintenance and deployment easier, I would like to have all of the
 generated
 code and custom code in one location.  That way I don't have to pull things
 from everywhere when I deploy to the web app to our customers.


That makes no sense at all.

A web app is a web app, and the classes directory is only one part
of it.  Pretty much any normal web app includes exposed content like
images, stylesheets, javascript.

Are you saying you deploy *only* a classes directory to customers?
Again, that makes no sense.

-- 
Hassan Schroeder  hassan.schroe...@gmail.com


Re: Mix http and https on one tomcat server?

2009-06-17 Thread Bruce Edge
On Wed, Jun 17, 2009 at 8:39 AM, Caldarale, Charles R 
chuck.caldar...@unisys.com wrote:

  From: Bruce Edge [mailto:bruce.e...@gmail.com]
  Subject: Mix http and https on one tomcat server?
 
  Is it possible to deploy both http and https on the same
  tomcat instance?

 Of course.

 Read the doc:
 http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html
 http://tomcat.apache.org/tomcat-6.0-doc/config/http.html#SSL%20Support

  - Chuck


I assume that I need a different connector for each, so I changed the 8080
redirector in server.xml:
Connector port=8080 protocol=HTTP/1.1 connectionTimeout=2
redirectPort=8443/
to:
Connector port=8080 protocol=HTTP/1.1 connectionTimeout=2/

My ssl connector is:
Connector port=8443 protocol=HTTP/1.1 SSLEnabled=true
maxThreads=150 scheme=https secure=true
keystoreFile=servIdentity.jks clientAuth=false sslProtocol=TLS/


However, I don't see where I designate the difference between a local
address, 127.0.0.1, and an external address.

I've defined 2 security-constraint blocks in web.xml:
security-constraint

  url-pattern/*/url-pattern   - Is this what needs to refer to
the internal vs. external address?  url-pattern127.0.0.1:8080/*/url-pattern
?

/security-constraint

I also have 2 roles setup in tomcat-users.xml which are referenced by the
above 2 security-constraint blocks.


I have this in web.xml for the ssl passwd:
  login-config
auth-methodBASIC/auth-method
   /login-config
but can it be setup to _not_ require a password for localhost access? Where
do I make this role specific?


In short, I want:
localhost - no auth, no ssl
external - passwd auth and ssl

I can get one or the other but not both at the same time.

-Bruce


RE: Serving images from classes directory

2009-06-17 Thread Susan G. Conger
As I said.  It is not a web app that I have created.  It is generated by a
third party development environment.  If I want my stuff to play nice with
their stuff then I have to wedge my stuff into their stuff.  Which is
located under the classes directory.  I don't make the rules I just try to
bend them to solve my problems.  I can't change the development environment.
I have to figure out how to get around it.  Do you have any idea on how I
can accomplish this.  I know it is weird but it is what it is.

Thanks,
Susan

-Original Message-
From: Hassan Schroeder [mailto:hassan.schroe...@gmail.com] 
Sent: Wednesday, June 17, 2009 12:10 PM
To: Tomcat Users List; sus...@bfcassociates.com
Subject: Re: Serving images from classes directory

On Wed, Jun 17, 2009 at 9:04 AM, Susan G. Conger
sus...@bfcassociates.comwrote:

 The web app is made by another company that screen scrapes/translates a
 mainframe app and then makes a web app out of it.  They store this in
their
 classes directory.  So in order to keep everything together and make
 maintenance and deployment easier, I would like to have all of the
 generated
 code and custom code in one location.  That way I don't have to pull
things
 from everywhere when I deploy to the web app to our customers.


That makes no sense at all.

A web app is a web app, and the classes directory is only one part
of it.  Pretty much any normal web app includes exposed content like
images, stylesheets, javascript.

Are you saying you deploy *only* a classes directory to customers?
Again, that makes no sense.

-- 
Hassan Schroeder  hassan.schroe...@gmail.com



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



Re: Celebrating Apache Tomcat 10th Anniversary

2009-06-17 Thread Markus Schönhaber
Mladen Turk:

 So, wish us happy anniversary :)

Congratulations!
And thanks for a decade of good work!

-- 
Regards
  mks

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



RE: Mix http and https on one tomcat server?

2009-06-17 Thread Caldarale, Charles R
 From: Bruce Edge [mailto:bruce.e...@gmail.com]
 Subject: Re: Mix http and https on one tomcat server?
 
 I assume that I need a different connector for each, so I changed the
 8080 redirector in server.xml:

Put it back the way it was; the redirectPort attribute is required so a switch 
to HTTPS can occur when needed.

 However, I don't see where I designate the difference between a local
 address, 127.0.0.1, and an external address.

You normally don't need to.  Tomcat listens on all available IP addresses, 
including 127.0.0.1.  If you want to restrict a particular connector to just 
127.0.0.1, use the address attribute.

 url-pattern/*/url-pattern   - Is this what needs to
 refer to the internal vs. external address?

No, the url-pattern is relative to the webapp.

 but can it be setup to _not_ require a password for localhost access?

Not without some additional configuration.  Don't try to do this at the 
Connector level - it's unlikely that you'll ever be able to get it to work.  
Instead, use a filter or Valve to check the client's IP address, and set the 
role in the Session object if it's localhost.

 In short, I want:
 localhost - no auth, no ssl
 external - passwd auth and ssl

I suspect you're going to have to use SSL for any protected webapp, regardless 
of the client's IP address.

You might want to look at http://securityfilter.sourceforge.net/ to see if it 
will do more of what you want.

 - 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: Serving images from classes directory

2009-06-17 Thread Caldarale, Charles R
 From: Susan G. Conger [mailto:sus...@bfcassociates.com]
 Subject: RE: Serving images from classes directory
 
 If I want my stuff to play nice with their stuff then I have 
 to wedge my stuff into their stuff.

So what is your stuff?  Still haven't heard an explanation of why you think 
images have to be placed under WEB-INF/classes.

 - 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: Serving images from classes directory

2009-06-17 Thread Hassan Schroeder
On Wed, Jun 17, 2009 at 9:24 AM, Susan G. Conger
sus...@bfcassociates.comwrote:

 As I said.  It is not a web app that I have created.  It is generated by a
 third party development environment.  If I want my stuff to play nice with
 their stuff then I have to wedge my stuff into their stuff.  Which is
 located under the classes directory.  I don't make the rules I just try to
 bend them to solve my problems.  I can't change the development
 environment.
 I have to figure out how to get around it.  Do you have any idea on how I
 can accomplish this.


Sure, have your own servlet deliver the images and javascript.


  I know it is weird but it is what it is.


It still sounds like utter nonsense. Can you give us any idea of
what this third party development environment is so I can be
sure to stay far away from it?  :-)

-- 
Hassan Schroeder  hassan.schroe...@gmail.com


Re: Serving images from classes directory

2009-06-17 Thread Tim Funk
If the images are physical images in the classes directory - you have a 
few options.


1) At build time - move (or copy) the files from the classes directory 
to somewhere more sane that the default servlet can access
2) Write a filter the detects these images that live in the classes dir, 
and then forwards to the images. (You need to be careful with this one)


For # 2 - it would look something like this:
doFilter(...) {
  String p = request.getServletPath();
  if (p.matches(/magic_prefix/[\\w]+\\.gif$)) {
String np = request.getServletPath().replaceFirst(.+/, );
request.getRequestDispatcher(/WEB-INF/class/more/cowbell/ + np)
   .forward(request, response);
  } else {
chain.doFilter(...);
  }
}


-Tim


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



Re: mod_jk does not recognize extension

2009-06-17 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Rainer,

On 6/17/2009 3:45 AM, Rainer Jung wrote:
 Thanks, added as r785498 in a slightly different wording. Will be part
 of 1.2.29.

Does that mean that the website has to wait for 1.2.29 to be released
for an update? It would be great if the doc update could go out now.

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

iEYEARECAAYFAko5JJYACgkQ9CaO5/Lv0PBE9QCcD95TAh3wXIwtgcrqVQg5BBPg
tYQAn3tYCD++YwJ+xwGgFsN7SN7vTgoM
=S5xe
-END PGP SIGNATURE-

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



RE: Serving images from classes directory

2009-06-17 Thread Susan G. Conger
Thanks Tim.  I don't have control during build because that is done by the
third party tool.  I am not going to mention their name.  I was hoping that
this would be easy.  You know a servlet mapping in the web.xml file that
would allow me to just map the directory/file type and I could just put that
in my html.  Since I can't use jsp everywhere I need the images.  Again I am
tied into their system and they have stuff in html files that they create.
I edit the html template files they have to add my images and javascript.
I use their environment to create/edit/build the web application. Underneath
I have tied in netBeans the best I can so I can debug their stuff.  But that
has issues too.  

Thanks,
Susan

-Original Message-
From: Tim Funk [mailto:funk...@apache.org] 
Sent: Wednesday, June 17, 2009 1:07 PM
To: Tomcat Users List
Subject: Re: Serving images from classes directory

If the images are physical images in the classes directory - you have a 
few options.

1) At build time - move (or copy) the files from the classes directory 
to somewhere more sane that the default servlet can access
2) Write a filter the detects these images that live in the classes dir, 
and then forwards to the images. (You need to be careful with this one)

For # 2 - it would look something like this:
doFilter(...) {
   String p = request.getServletPath();
   if (p.matches(/magic_prefix/[\\w]+\\.gif$)) {
 String np = request.getServletPath().replaceFirst(.+/, );
 request.getRequestDispatcher(/WEB-INF/class/more/cowbell/ + np)
.forward(request, response);
   } else {
 chain.doFilter(...);
   }
}


-Tim


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




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



Re: Reading POSTed data

2009-06-17 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Kyle,

On 6/16/2009 11:24 PM, Kyle Brantley wrote:
 The getParameter() calls are going to be of little to no value for me.
 The data isn't in a form where those calls would recognize them. Unless
 I'm missing something very obvious...?

No, if you're sending a whole document, then the getParameter calls will
not be useful to you.

 But thanks for the bit about the possible interference in method calls.

getParameter and friends will only read the request body if:

1. The request is HTTP or HTTPS (duh)
2. The request method is POST
3. The Content-Type is application/x-www-form-urlencoded

Since your Content-Type is text/xml, the request body should be
available via request.getReader (preferred for text formats) or
request.getInputStream.

Note that InputStream.available() returning 0 just means that the next
call to InputStream.read(...) will block before returning data. It
doesn't mean that there's no data that could be read.

When InputStream.read returns -1, that's when you know the stream is out
of data.

I disagree with Chuck's assertion that POST is inappropriate unless form
data is being sent. The only really appropriate HTTP methods for sending
lots of data are POST and PUT. PUT is (IMO) not appropriate because the
client is expected to provide the URI where the resource should be
available later.

HTTP section 9.6 says it plainly:

The fundamental difference between the POST and PUT requests is
reflected in the different meaning of the Request-URI.
The URI in a POST request identifies the resource that will handle the
enclosed entity. [...] In contrast, the URI in a PUT request identifies
the entity enclosed with the request -- the user agent knows what URI is
intended and the server MUST NOT attempt to apply the request to some
other resource.


I like POST for your requirements.

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

iEYEARECAAYFAko5Jr0ACgkQ9CaO5/Lv0PB33gCcDcbGVQWRJFKa0sYWOyUOhJr1
ViIAn35KtGzaBJmG0dz8KaWhe6jtZimj
=JEyB
-END PGP SIGNATURE-

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



Re: Serving images from classes directory

2009-06-17 Thread Pid
Susan G. Conger wrote:
 Thanks Tim.  I don't have control during build because that is done by the
 third party tool.  I am not going to mention their name.  I was hoping that
 this would be easy.  You know a servlet mapping in the web.xml file that
 would allow me to just map the directory/file type and I could just put that
 in my html.  Since I can't use jsp everywhere I need the images.  Again I am
 tied into their system and they have stuff in html files that they create.
 I edit the html template files they have to add my images and javascript.
 I use their environment to create/edit/build the web application. Underneath
 I have tied in netBeans the best I can so I can debug their stuff.  But that
 has issues too.  

If you can edit the template files, can't you include images in the same
place as the templates?

p



 Thanks,
 Susan
 
 -Original Message-
 From: Tim Funk [mailto:funk...@apache.org] 
 Sent: Wednesday, June 17, 2009 1:07 PM
 To: Tomcat Users List
 Subject: Re: Serving images from classes directory
 
 If the images are physical images in the classes directory - you have a 
 few options.
 
 1) At build time - move (or copy) the files from the classes directory 
 to somewhere more sane that the default servlet can access
 2) Write a filter the detects these images that live in the classes dir, 
 and then forwards to the images. (You need to be careful with this one)
 
 For # 2 - it would look something like this:
 doFilter(...) {
String p = request.getServletPath();
if (p.matches(/magic_prefix/[\\w]+\\.gif$)) {
  String np = request.getServletPath().replaceFirst(.+/, );
  request.getRequestDispatcher(/WEB-INF/class/more/cowbell/ + np)
 .forward(request, response);
} else {
  chain.doFilter(...);
}
 }
 
 
 -Tim
 
 
 -
 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: Serving images from classes directory

2009-06-17 Thread Tim Funk
The filter (below) can be made smarter to perform smarter checks - so 
regular images could be excluded.


-Tim

Susan G. Conger wrote:

Thanks Tim.  I don't have control during build because that is done by the
third party tool.  I am not going to mention their name.  I was hoping that
this would be easy.  You know a servlet mapping in the web.xml file that
would allow me to just map the directory/file type and I could just put that
in my html.  Since I can't use jsp everywhere I need the images.  Again I am
tied into their system and they have stuff in html files that they create.
I edit the html template files they have to add my images and javascript.
I use their environment to create/edit/build the web application. Underneath
I have tied in netBeans the best I can so I can debug their stuff.  But that
has issues too.  


Thanks,
Susan

-Original Message-
From: Tim Funk [mailto:funk...@apache.org] 
Sent: Wednesday, June 17, 2009 1:07 PM

To: Tomcat Users List
Subject: Re: Serving images from classes directory

If the images are physical images in the classes directory - you have a 
few options.


1) At build time - move (or copy) the files from the classes directory 
to somewhere more sane that the default servlet can access
2) Write a filter the detects these images that live in the classes dir, 
and then forwards to the images. (You need to be careful with this one)


For # 2 - it would look something like this:
doFilter(...) {
   String p = request.getServletPath();
   if (p.matches(/magic_prefix/[\\w]+\\.gif$)) {
 String np = request.getServletPath().replaceFirst(.+/, );
 request.getRequestDispatcher(/WEB-INF/class/more/cowbell/ + np)
.forward(request, response);
   } else {
 chain.doFilter(...);
   }
}


-Tim


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

2009-06-17 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

André,

On 6/17/2009 4:06 AM, André Warnier wrote:
 Sorry to interrupt, but actually guys I believe that the problem is due
 to the way the data is POSTed, which in this case is - I believe - invalid.
 See http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4

Note that this is an HTML thing, not an HTTP thing. HTML forms may only
be sent using two distinct Content-Types, but HTTP POST can do anything
it wants.

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

iEYEARECAAYFAko5KTkACgkQ9CaO5/Lv0PCtRQCfc2n/B5xeG9NSnMgWou0v3REI
taoAnA7RpmsmbzTGdiTCksI1+W2mmvFE
=Gf83
-END PGP SIGNATURE-

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



Error with Solr configuration in Tomcat container

2009-06-17 Thread Mukerjee, Neiloy (Neil)
When trying to integrate Tomcat 6.0.20 and Solr 1.3.0, I get the below error 
after trying to view the Solr admin page.

I downloaded Tomcat from the Apache website, and its installation went well, as 
indicated by the fact that I can see the Apache Tomcat page in my browser when 
typing in my IP address and indicating port 8080. I then downloaded the nightly 
build of Solr and tried to integrate the two by putting the solr.war file in 
the Tomcat webapps directory and copying the /example/solr/ directory from Solr 
to the /solr/ directory in Tomcat. At this point, when trying to access the 
Solr admin page from my browser, the below message is displayed (and it appears 
in the log files for Tomcat).

The file solrconfig.xml is in /solr/conf/ in the Tomcat directory, but I'm not 
sure how to interpret the current working directory, and Googling this error 
hasn't led me in any direction. Any suggestions as to where to go from here 
would be greatly appreciated.

SEVERE: Could not start SOLR. Check solr/home property
java.lang.RuntimeException: Can't find resource 'solrconfig.xml' in classpath 
or 'solr/conf/', cwd=/usr/local/tomcat6.0.20/conf
at 
org.apache.solr.core.SolrResourceLoader.openResource(SolrResourceLoader.java:197)
at 
org.apache.solr.core.SolrResourceLoader.openConfig(SolrResourceLoader.java:165)
at org.apache.solr.core.Config.init(Config.java:101)
at org.apache.solr.core.SolrConfig.init(SolrConfig.java:123)
at org.apache.solr.core.SolrConfig.init(SolrConfig.java:80)
at 
org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:126)
at 
org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:83)
at 
org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
at 
org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
at 
org.apache.catalina.core.ApplicationFilterConfig.init(ApplicationFilterConfig.java:108)
at 
org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3800)
at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:4450)
at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at 
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526)
at 
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:850)
at 
org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:724)
at 
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:493)
at 
org.apache.catalina.startup.HostConfig.check(HostConfig.java:1274)
at 
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:296)
at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at 
org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
at 
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
at 
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
at 
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
at java.lang.Thread.run(Thread.java:619)



Re: Address based security profile?

2009-06-17 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Bruce,

On 6/16/2009 7:44 PM, Bruce Edge wrote:
 I have tomcat working with ssl, but I'd like to allow localhost clients to
 use no authentication.
 
 Is it possible to deploy the same service with authentication to external
 addresses and no auth to 127.0.0.1?

This is not possible to do with Tomcat's built-in authentication
mechanism on a single webapp deployment. You do have some options, though:

1. Deploy the app twice, once with security conditions and once without.
Restrict the condition-less deployment to 127.0.0.1.

2. If this is just a few URIs that work this way, consider giving them
alternative mappings that are only available on 127.0.0.1, and do not
put access restrictions on them. Remember that your code may expect that
a valid principal (aka user) is associated with a request, so don't
forget to fully-test your code.

3. Use a different authenticator like securityfilter
(http://securityfilter.sourceforge.net) and write your own Realm that
auto-authenticates and authorizes anyone from 127.0.0.1

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

iEYEARECAAYFAko5KjEACgkQ9CaO5/Lv0PBxrgCgmV4qvi2RHS8okQB1NFP20H5v
y1gAoJdOJPPDB2FO+8rjy3gpOICph3L2
=LUd3
-END PGP SIGNATURE-

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



Re: Tomcat shutdown problem due to running threads.

2009-06-17 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Carsten,

On 6/17/2009 4:33 AM, CBy wrote:
 O'Reilly's Tomcat The Definitive Guide advises me to invoke the
 setDaemon(true) method on any Thread object a web application creates to
 keep them from hanging the JVM when Tomcat shuts down. My web service,
 however, uses a thread pool that is created via
 java.util.concurrent.Executors.newFixedThreadPool(NTHREADS) and I don't
 know how to make them daemon threads in this case.

Can you adjust that code? If so, use the form of that method that takes
a ThreadFactory object. Something like this ought to do it:

public class DaemonThreadFactory
implements ThreadFactory
{
   public Thread newThread(Runnable r)
   {
  Thread t = new Thread(r);
  t.setDaemon(true);

  return t;
   }
}

 My new plan was to register a shutdown hook with the JVM in my web
 service and to invoke shutdown() or shutdownNow() on the ExecutorService
 in it (the method above returns an ExecutorService). Unfortunately, this
 does not seem to work.

You should do as André suggests and use a ServletContextListener. You
should probably use the same listener to both create and teardown the
thread pool.

I recently had my first experience with Executors in Java. I have to say
that I love 'em. So simple, yet so powerful.

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

iEYEARECAAYFAko5KyoACgkQ9CaO5/Lv0PDgcQCfVTfVdv3xUXsEFhh+PYWy9uII
hpoAn37qoHfLeSVot+FjaYI3XS+8deeH
=j4WL
-END PGP SIGNATURE-

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



RE: Serving images from classes directory

2009-06-17 Thread Susan G. Conger
The template files are in the classes directory.  This is a web app that is
deploying it's own web app.  So it is rather convoluted.  The web app that
gets deployed is my web app while the web app doing the developing is the
third party tool.

Thanks,
Susan

-Original Message-
From: Pid [mailto:p...@pidster.com] 
Sent: Wednesday, June 17, 2009 1:29 PM
To: Tomcat Users List
Subject: Re: Serving images from classes directory

Susan G. Conger wrote:
 Thanks Tim.  I don't have control during build because that is done by the
 third party tool.  I am not going to mention their name.  I was hoping
that
 this would be easy.  You know a servlet mapping in the web.xml file that
 would allow me to just map the directory/file type and I could just put
that
 in my html.  Since I can't use jsp everywhere I need the images.  Again I
am
 tied into their system and they have stuff in html files that they create.
 I edit the html template files they have to add my images and javascript.
 I use their environment to create/edit/build the web application.
Underneath
 I have tied in netBeans the best I can so I can debug their stuff.  But
that
 has issues too.  

If you can edit the template files, can't you include images in the same
place as the templates?

p



 Thanks,
 Susan
 
 -Original Message-
 From: Tim Funk [mailto:funk...@apache.org] 
 Sent: Wednesday, June 17, 2009 1:07 PM
 To: Tomcat Users List
 Subject: Re: Serving images from classes directory
 
 If the images are physical images in the classes directory - you have a 
 few options.
 
 1) At build time - move (or copy) the files from the classes directory 
 to somewhere more sane that the default servlet can access
 2) Write a filter the detects these images that live in the classes dir, 
 and then forwards to the images. (You need to be careful with this one)
 
 For # 2 - it would look something like this:
 doFilter(...) {
String p = request.getServletPath();
if (p.matches(/magic_prefix/[\\w]+\\.gif$)) {
  String np = request.getServletPath().replaceFirst(.+/, );
  request.getRequestDispatcher(/WEB-INF/class/more/cowbell/ + np)
 .forward(request, response);
} else {
  chain.doFilter(...);
}
 }
 
 
 -Tim
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 


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




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



RE: Error with Solr configuration in Tomcat container

2009-06-17 Thread Caldarale, Charles R
 From: Mukerjee, Neiloy (Neil) [mailto:neil.muker...@alcatel-lucent.com]
 Subject: Error with Solr configuration in Tomcat container
 
 The file solrconfig.xml is in /solr/conf/ in the Tomcat directory

That wording is a bit ambiguous, since it's not clear what you mean by the 
Tomcat directory; give us the full path to solrconfig.xml.  Note that 
depending on some particular current directory in order to resolve relative 
paths is rather risky.

 SEVERE: Could not start SOLR. Check solr/home property

What is the solr/home property?  If it's a Java system property, set it via 
JAVA_OPTS before starting Tomcat, with a value of the *absolute* path to 
whatever Solr wants.

 - 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: Celebrating Apache Tomcat 10th Anniversary

2009-06-17 Thread Ken Bowen

+1 exp 10!
On Jun 17, 2009, at 12:28 PM, Markus Schönhaber wrote:


Mladen Turk:


So, wish us happy anniversary :)


Congratulations!
And thanks for a decade of good work!

--
Regards
 mks

-
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: DBCP connection pool exhausted, can I trace borrowed connnections from pool?

2009-06-17 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Arrow,

On 6/17/2009 10:44 AM, Arrowx7 wrote:
 Using mysql JDBC driver.  Somewhere in the appilcation, the connections are
 drawn from the DBCP pool, and never returned.  I did
 dataSource.getNumActive() and dataSource.getNumIdle().  There are 2 idle
 connections, and 88 active connections.  Somewhere in my web application a
 process does not close the connection and return it to pool.  there a way to
 print stack trace the current active connections or something to find where
 it's leaky?

Filip and Barry both have good suggestions. I wrote a blog post a while
back about how to code things properly, and my tips section mentions
how to find leaks.

http://blog.christopherschultz.net/?p=68

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

iEYEARECAAYFAko5LJAACgkQ9CaO5/Lv0PBTuQCeI3nlNBD+QLEGbXYPJ5ly2lFS
KZIAn3FUc9UwS9lJu2i2KZCH+ybCpwf5
=403c
-END PGP SIGNATURE-

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



unsubscribe request

2009-06-17 Thread veena pandit
UNSUBSCRIBE


Re: Tomcat shutdown problem due to running threads.

2009-06-17 Thread CBy
Thank you, Christopher. It appears that I now have to ways to solve my 
problem. Calling shutdown() stops the threads orderly, so I think I'll 
opt for the ContextListener, although I am not 100% sure.


Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Carsten,

On 6/17/2009 4:33 AM, CBy wrote:
  

O'Reilly's Tomcat The Definitive Guide advises me to invoke the
setDaemon(true) method on any Thread object a web application creates to
keep them from hanging the JVM when Tomcat shuts down. My web service,
however, uses a thread pool that is created via
java.util.concurrent.Executors.newFixedThreadPool(NTHREADS) and I don't
know how to make them daemon threads in this case.



Can you adjust that code? If so, use the form of that method that takes
a ThreadFactory object. Something like this ought to do it:

public class DaemonThreadFactory
implements ThreadFactory
{
   public Thread newThread(Runnable r)
   {
  Thread t = new Thread(r);
  t.setDaemon(true);

  return t;
   }
}

  

My new plan was to register a shutdown hook with the JVM in my web
service and to invoke shutdown() or shutdownNow() on the ExecutorService
in it (the method above returns an ExecutorService). Unfortunately, this
does not seem to work.



You should do as André suggests and use a ServletContextListener. You
should probably use the same listener to both create and teardown the
thread pool.

I recently had my first experience with Executors in Java. I have to say
that I love 'em. So simple, yet so powerful.

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

iEYEARECAAYFAko5KyoACgkQ9CaO5/Lv0PDgcQCfVTfVdv3xUXsEFhh+PYWy9uII
hpoAn37qoHfLeSVot+FjaYI3XS+8deeH
=j4WL
-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: unsubscribe request

2009-06-17 Thread Mukerjee, Neiloy (Neil)
In order to unsubscribe from the list, send an e-mail to 
unsubscr...@tomcat.apache.org 

-Original Message-
From: veena pandit [mailto:v.kri...@gmail.com] 
Sent: Wednesday, June 17, 2009 2:03 PM
To: users@tomcat.apache.org
Subject: unsubscribe request

UNSUBSCRIBE

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



Re: Serving images from classes directory

2009-06-17 Thread Pid
Susan G. Conger wrote:
 The template files are in the classes directory.  This is a web app that is
 deploying it's own web app.  So it is rather convoluted.  The web app that
 gets deployed is my web app while the web app doing the developing is the
 third party tool.


For reference then, we'll call the first one the 'tool app'.

So are you actually editing the template files yourself, or are you
using the tool app to edit the template files?

Where in your app do the modified template files end up, and are they
copied individually?


The thought also occurs that the authors of the tool app might be the
people you really want to be talking to about this.

p



 Thanks,
 Susan
 
 -Original Message-
 From: Pid [mailto:p...@pidster.com] 
 Sent: Wednesday, June 17, 2009 1:29 PM
 To: Tomcat Users List
 Subject: Re: Serving images from classes directory
 
 Susan G. Conger wrote:
 Thanks Tim.  I don't have control during build because that is done by the
 third party tool.  I am not going to mention their name.  I was hoping
 that
 this would be easy.  You know a servlet mapping in the web.xml file that
 would allow me to just map the directory/file type and I could just put
 that
 in my html.  Since I can't use jsp everywhere I need the images.  Again I
 am
 tied into their system and they have stuff in html files that they create.
 I edit the html template files they have to add my images and javascript.
 I use their environment to create/edit/build the web application.
 Underneath
 I have tied in netBeans the best I can so I can debug their stuff.  But
 that
 has issues too.  
 
 If you can edit the template files, can't you include images in the same
 place as the templates?
 
 p
 
 
 
 Thanks,
 Susan

 -Original Message-
 From: Tim Funk [mailto:funk...@apache.org] 
 Sent: Wednesday, June 17, 2009 1:07 PM
 To: Tomcat Users List
 Subject: Re: Serving images from classes directory

 If the images are physical images in the classes directory - you have a 
 few options.

 1) At build time - move (or copy) the files from the classes directory 
 to somewhere more sane that the default servlet can access
 2) Write a filter the detects these images that live in the classes dir, 
 and then forwards to the images. (You need to be careful with this one)

 For # 2 - it would look something like this:
 doFilter(...) {
String p = request.getServletPath();
if (p.matches(/magic_prefix/[\\w]+\\.gif$)) {
  String np = request.getServletPath().replaceFirst(.+/, );
  request.getRequestDispatcher(/WEB-INF/class/more/cowbell/ + np)
 .forward(request, response);
} else {
  chain.doFilter(...);
}
 }


 -Tim


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




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


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


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



RE: Serving images from classes directory

2009-06-17 Thread Susan G. Conger
I started with the authors of the tool app and they said it was a tomcat
limitation.  Basically can't be done.  So I figured I would try the list
before I took their word for it.  

Yes, I use the tool to modify the template files.  But that is basically
just editing html using the tool.  When the tool app builds my app it copies
everything into the classes directory.  So that everything looks like one
big Java class under the tool app.  So my thought is that my images and
javascripts should go in here so I can have everything together and make
maintenance easier.  I check everything the tool app builds into subversion
so I can have some source control.  

Thanks,
Susan


-Original Message-
From: Pid [mailto:p...@pidster.com] 
Sent: Wednesday, June 17, 2009 2:09 PM
To: Tomcat Users List
Subject: Re: Serving images from classes directory

Susan G. Conger wrote:
 The template files are in the classes directory.  This is a web app that
is
 deploying it's own web app.  So it is rather convoluted.  The web app that
 gets deployed is my web app while the web app doing the developing is the
 third party tool.


For reference then, we'll call the first one the 'tool app'.

So are you actually editing the template files yourself, or are you
using the tool app to edit the template files?

Where in your app do the modified template files end up, and are they
copied individually?


The thought also occurs that the authors of the tool app might be the
people you really want to be talking to about this.

p



 Thanks,
 Susan
 
 -Original Message-
 From: Pid [mailto:p...@pidster.com] 
 Sent: Wednesday, June 17, 2009 1:29 PM
 To: Tomcat Users List
 Subject: Re: Serving images from classes directory
 
 Susan G. Conger wrote:
 Thanks Tim.  I don't have control during build because that is done by
the
 third party tool.  I am not going to mention their name.  I was hoping
 that
 this would be easy.  You know a servlet mapping in the web.xml file that
 would allow me to just map the directory/file type and I could just put
 that
 in my html.  Since I can't use jsp everywhere I need the images.  Again I
 am
 tied into their system and they have stuff in html files that they
create.
 I edit the html template files they have to add my images and javascript.
 I use their environment to create/edit/build the web application.
 Underneath
 I have tied in netBeans the best I can so I can debug their stuff.  But
 that
 has issues too.  
 
 If you can edit the template files, can't you include images in the same
 place as the templates?
 
 p
 
 
 
 Thanks,
 Susan

 -Original Message-
 From: Tim Funk [mailto:funk...@apache.org] 
 Sent: Wednesday, June 17, 2009 1:07 PM
 To: Tomcat Users List
 Subject: Re: Serving images from classes directory

 If the images are physical images in the classes directory - you have a 
 few options.

 1) At build time - move (or copy) the files from the classes directory 
 to somewhere more sane that the default servlet can access
 2) Write a filter the detects these images that live in the classes dir, 
 and then forwards to the images. (You need to be careful with this one)

 For # 2 - it would look something like this:
 doFilter(...) {
String p = request.getServletPath();
if (p.matches(/magic_prefix/[\\w]+\\.gif$)) {
  String np = request.getServletPath().replaceFirst(.+/, );
  request.getRequestDispatcher(/WEB-INF/class/more/cowbell/ + np)
 .forward(request, response);
} else {
  chain.doFilter(...);
}
 }


 -Tim


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




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


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


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




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



Re: unsubscribe request

2009-06-17 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Neiloy,

Amusingly enough, the email address you posted was wrong, but it's
correct in the footer (users-unsubscr...@tomcat.apache.org).

- -chris

On 6/17/2009 2:04 PM, Mukerjee, Neiloy (Neil) wrote:
 In order to unsubscribe from the list, send an e-mail to 
 unsubscr...@tomcat.apache.org 
 
 -Original Message-
 From: veena pandit [mailto:v.kri...@gmail.com] 
 Sent: Wednesday, June 17, 2009 2:03 PM
 To: users@tomcat.apache.org
 Subject: unsubscribe request
 
 UNSUBSCRIBE
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAko5NWMACgkQ9CaO5/Lv0PCrjgCguqXgroOoXlozWLXiEV5zmUiY
0ZwAn2BxzbPvzIEE6k5hR90rpxlOxepo
=c1mR
-END PGP SIGNATURE-

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



Re: Pointers on diagnosing session and thread hangs

2009-06-17 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Pete,

On 6/17/2009 8:33 AM, Pete Helgren wrote:
 I am not an expert by any stretch in Tomcat internals so what I need
 is a way to determine what is causing the sessions to hang and the
 threads to begin to grow beyond the maximum (650 in our case).

Please post your Connector element(s) from server.xml, and any
Executor element(s) you may be using as well.

Can you also post a thread dump? I'm surprised that Tomcat is exceeding
(or appearing to exceed) its own limit on request processing threads. I
suspect something else is going on.

 Is there a step by step FAQ somewhere that would allow us to 
 systematically analyze the running servlet and determine where the 
 hang is?

Not really. These things tend to require investigation tailored to the
app in question.

Finding the cause of hung threads can be easy if the thread dumps point
to a single thing everyone's waiting on. If not, it could take a while
to find out what's going on. Being able to reproduce this problem in a
lab environment (preferably with fewer threads, just to maintain your
own sanity during research) is essential.

Finding the cause of dead sessions will require the use of a memory
profiler or some very good guesses and luck. Are the sessions themselves
not expiring, or are objects from those expired sessions living beyond
their expected expiration date?

Are you playing any games with your HttpSession objects such as caching
them somewhere for cross-session data manipulation?

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

iEYEARECAAYFAko5NxEACgkQ9CaO5/Lv0PAJPACdFi+hNUHSszFZa6ekMGI5A3Ju
BkAAniZYPUtFWdRvVAX1MttHlqld78ZG
=DgU1
-END PGP SIGNATURE-

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



Re: tomcat 6 - setting classpath

2009-06-17 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Tom,

On 6/17/2009 7:43 AM, Tom Brown wrote:
 it is only configuration files - no jar changes.

If your code uses getResourceAsStream(), then the classpath will be
checked. The webapp's classpath will essentially be
WEB-INF/classes:WEB-INF/lib:CATALINA_BASE/lib:JAVA_HOME/rt.jar

So, putting your configuration files in CATALINA_BASE/lib should do it,
unless you have those same configuration files in WEB-INF/classes (or a
JAR in WEB-INF/lib) already, which it sounds like you /do/.

Mikolaj's suggestion of using a custom classloader might be your only
option, unless you can change your code to load the configuration files
from a pre-defined location (or, even better, from a location specified
in web.xml!).

Note that your first solution was to modify web.xml which would, in
turn, modify the WAR file. So, how was that one going to work?

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

iEYEARECAAYFAko5OBoACgkQ9CaO5/Lv0PA7rQCgv2gBTk/RCpeRXFjSFX1VzJ4G
WVsAn1cxUNlzZgDaFvvM1cTwz5oTPry3
=y0/Y
-END PGP SIGNATURE-

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



Re: Tomcat shutdown problem due to running threads.

2009-06-17 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Carsten,

On 6/17/2009 2:04 PM, CBy wrote:
 Thank you, Christopher. It appears that I now have to ways to solve my
 problem. Calling shutdown() stops the threads orderly, so I think I'll
 opt for the ContextListener, although I am not 100% sure.

I'd do both if I were you :)

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

iEYEARECAAYFAko5ODwACgkQ9CaO5/Lv0PCYUgCgpSkcuXg2rFBlfNv+8It9GH34
eB0AoJwUVU7PdQ8dcejZX+FmtupmnwNP
=H87P
-END PGP SIGNATURE-

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



RE: Serving images from classes directory

2009-06-17 Thread Caldarale, Charles R
 From: Susan G. Conger [mailto:sus...@bfcassociates.com]
 Subject: RE: Serving images from classes directory
 
 This is a web app that is deploying it's own web app.

Isn't that illegal in some states/countries?

 The web app that gets deployed is my web app while the web 
 app doing the developing is the third party tool.

When are the images used?  When the 3rd-party tool deploys your webapp, or when 
your webapp is actually running?

Is there any way of configuring the 3rd-party tool to store specific files in 
specific locations in the deployed webapp?

 - 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: Serving images from classes directory

2009-06-17 Thread Pid
Susan G. Conger wrote:
 I started with the authors of the tool app and they said it was a tomcat
 limitation.  Basically can't be done.  

What is 'it', precisely?

If they control the tool app then why can't they specify a location to
place scripts, stylesheets and images, so that they output in a
predictable place in your webapp?


 So I figured I would try the list before I took their word for it.

You're not meant to _directly_ access anything in WEB-INF/.  It's
protected, and deliberately so, as it has stuff you don't want users to
access.

You *can* put stuff in there and write some code to access it and
deliver it on request, but there's not a lot of point in doing so if you
can just put the data in question somewhere more accessible.

Typically, your webapp would look like (something) this:

 appname/index.html

 appname/thing.jsp

 appname/images/logo.gif

 appname/styles/layout.css

 appname/scripts/common.js

 appname/WEB-INF/web.xml

 appname/WEB-INF/classes/com/my/app/AppServlet.class

 appname/WEB-INF/lib/commons-logging.jar


Anything you put under /classes isn't going to be available directly to
the user if the server is a properly functioning Servlet container.

Doesn't stop you putting things elsewhere though.



 Yes, I use the tool to modify the template files.  But that is basically
 just editing html using the tool.  When the tool app builds my app it copies
 everything into the classes directory.  

Which classes directory?  The one in the tool-app, or the one in your
generated webapp?

If it copies 'everything' why can't it copy images somewhere into the
generated app too?


 So that everything looks like one big Java class under the tool app.

That doesn't make a great deal of sense.  You're saying that there's a
file called (something like) BigBunchOfTemplates.class in WEB-INF/classes ?


 So my thought is that my images and javascripts should go in here so I can 
 have everything together and make
 maintenance easier.  I check everything the tool app builds into subversion
 so I can have some source control.  

Let's see if my understanding is accurate first.

p



 Thanks,
 Susan
 
 
 -Original Message-
 From: Pid [mailto:p...@pidster.com] 
 Sent: Wednesday, June 17, 2009 2:09 PM
 To: Tomcat Users List
 Subject: Re: Serving images from classes directory
 
 Susan G. Conger wrote:
 The template files are in the classes directory.  This is a web app that
 is
 deploying it's own web app.  So it is rather convoluted.  The web app that
 gets deployed is my web app while the web app doing the developing is the
 third party tool.
 
 
 For reference then, we'll call the first one the 'tool app'.
 
 So are you actually editing the template files yourself, or are you
 using the tool app to edit the template files?
 
 Where in your app do the modified template files end up, and are they
 copied individually?
 
 
 The thought also occurs that the authors of the tool app might be the
 people you really want to be talking to about this.
 
 p
 
 
 
 Thanks,
 Susan

 -Original Message-
 From: Pid [mailto:p...@pidster.com] 
 Sent: Wednesday, June 17, 2009 1:29 PM
 To: Tomcat Users List
 Subject: Re: Serving images from classes directory

 Susan G. Conger wrote:
 Thanks Tim.  I don't have control during build because that is done by
 the
 third party tool.  I am not going to mention their name.  I was hoping
 that
 this would be easy.  You know a servlet mapping in the web.xml file that
 would allow me to just map the directory/file type and I could just put
 that
 in my html.  Since I can't use jsp everywhere I need the images.  Again I
 am
 tied into their system and they have stuff in html files that they
 create.
 I edit the html template files they have to add my images and javascript.
 I use their environment to create/edit/build the web application.
 Underneath
 I have tied in netBeans the best I can so I can debug their stuff.  But
 that
 has issues too.  
 If you can edit the template files, can't you include images in the same
 place as the templates?

 p



 Thanks,
 Susan

 -Original Message-
 From: Tim Funk [mailto:funk...@apache.org] 
 Sent: Wednesday, June 17, 2009 1:07 PM
 To: Tomcat Users List
 Subject: Re: Serving images from classes directory

 If the images are physical images in the classes directory - you have a 
 few options.

 1) At build time - move (or copy) the files from the classes directory 
 to somewhere more sane that the default servlet can access
 2) Write a filter the detects these images that live in the classes dir, 
 and then forwards to the images. (You need to be careful with this one)

 For # 2 - it would look something like this:
 doFilter(...) {
String p = request.getServletPath();
if (p.matches(/magic_prefix/[\\w]+\\.gif$)) {
  String np = request.getServletPath().replaceFirst(.+/, );
  request.getRequestDispatcher(/WEB-INF/class/more/cowbell/ + np)
 .forward(request, response);
} else {
  

Re: Serving images from classes directory

2009-06-17 Thread David kerber

Susan G. Conger wrote:

The template files are in the classes directory.  This is a web app that is
deploying it's own web app.  So it is rather convoluted.  The web app that
gets deployed is my web app while the web app doing the developing is the
third party tool.

Thanks,
Susan
  


Self-modifying code; cool!!

D



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



RE: Error with Solr configuration in Tomcat container

2009-06-17 Thread Martin Gainty

Bonjour 

looking for solr configuration file solrconfig.xml
i would ask the folks at solr about this as they could send you or at least 
suggest

a working solrconfig.xml configuration is available at
http://wiki.apache.org/solr/SolrConfigXml

http://lucene.apache.org/solr/mailing_lists.html
A few years back I worked with Lucene and i remember having to supply the 
*correct* grammar files 

Keep us apprised,
Bon Chance
Martin 
__ 
Note de déni et de confidentialité

Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.




 From: neil.muker...@alcatel-lucent.com
 To: users@tomcat.apache.org
 Date: Wed, 17 Jun 2009 12:35:39 -0500
 Subject: Error with Solr configuration in Tomcat container
 
 When trying to integrate Tomcat 6.0.20 and Solr 1.3.0, I get the below error 
 after trying to view the Solr admin page.
 
 I downloaded Tomcat from the Apache website, and its installation went well, 
 as indicated by the fact that I can see the Apache Tomcat page in my browser 
 when typing in my IP address and indicating port 8080. I then downloaded the 
 nightly build of Solr and tried to integrate the two by putting the solr.war 
 file in the Tomcat webapps directory and copying the /example/solr/ directory 
 from Solr to the /solr/ directory in Tomcat. At this point, when trying to 
 access the Solr admin page from my browser, the below message is displayed 
 (and it appears in the log files for Tomcat).
 
 The file solrconfig.xml is in /solr/conf/ in the Tomcat directory, but I'm 
 not sure how to interpret the current working directory, and Googling this 
 error hasn't led me in any direction. Any suggestions as to where to go from 
 here would be greatly appreciated.
 
 SEVERE: Could not start SOLR. Check solr/home property
 java.lang.RuntimeException: Can't find resource 'solrconfig.xml' in classpath 
 or 'solr/conf/', cwd=/usr/local/tomcat6.0.20/conf
 at 
 org.apache.solr.core.SolrResourceLoader.openResource(SolrResourceLoader.java:197)
 at 
 org.apache.solr.core.SolrResourceLoader.openConfig(SolrResourceLoader.java:165)
 at org.apache.solr.core.Config.init(Config.java:101)
 at org.apache.solr.core.SolrConfig.init(SolrConfig.java:123)
 at org.apache.solr.core.SolrConfig.init(SolrConfig.java:80)
 at 
 org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:126)
 at 
 org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:83)
 at 
 org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
 at 
 org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
 at 
 org.apache.catalina.core.ApplicationFilterConfig.init(ApplicationFilterConfig.java:108)
 at 
 org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3800)
 at 
 org.apache.catalina.core.StandardContext.start(StandardContext.java:4450)
 at 
 org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
 at 
 org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
 at 
 org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526)
 at 
 org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:850)
 at 
 org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:724)
 at 
 org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:493)
 at 
 org.apache.catalina.startup.HostConfig.check(HostConfig.java:1274)
 at 
 org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:296)
 at 
 org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
 at 
 org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
 at 
 org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
 at 
 org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
 at 
 org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
 at java.lang.Thread.run(Thread.java:619)
 

_
Insert movie times and more without leaving Hotmail®.

Re: Reading POSTed data

2009-06-17 Thread Kyle Brantley

Tim Funk wrote:
available() - Returns the number of bytes that can be read (or 
skipped over) from this input stream without blocking by the next 
caller of a method for this input stream. So its not an accurate 
gauge of how much content is available from the client.
That explains that quite nicely. The problem wasn't my InputStream, but 
rather just my use of .available(). I tweaked your loop a bit, but it 
works - thanks.



Christopher:
Concerning the getParameter*() calls and info, yeah, I knew that much. I 
had only gone poking with them as a result of desperation.


I too like POST for my requirements. :)



Thanks for the help, all. It's working.

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



Re: [OT] Apache mod_jk HTTPS problem

2009-06-17 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Attacus,

On 6/16/2009 4:04 PM, attacus wrote:
 NameVirtualHost *:443

This ain't gonna work: SSL negotiation occurs /before/ the HTTP headers
are sent, meaning that the VirtualHost has already been chosen before
the Server header can be inspected. This will probably work with a
single VirtualHost on port 443, but it's not going to work if you add
others. Apache httpd will probably just choose the first one defined or
something.

 VirtualHost *:443
 ServerName *:443

This is not correct, either. If you're using name-based VirtualHosts,
you need to bind a name to the VirtualHost: something like
www.myserver.com. Again, see the note above about NameVirtualHost not
working for HTTPS.

 ErrorLog C:/tools/Apache2.2/logs/secure-channel-error.log 

This would be a good place to look for startup errors or warnings.

 JkMountFile conf/uriworkermap.properties

Is this the same JkMountFile you use for your (working) non-SSL VirtualHost?

 SSLCipherSuite
 ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL

Note that this is an overly-complicated Ciphers line... you're using ALL
and then customizing it by adding other ciphers. It's the equivalent of:

SSLCipherSuite ALL:-ADH
or even
SSLCIpherSuite ALL:!ADH

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

iEYEARECAAYFAko5Q20ACgkQ9CaO5/Lv0PBLEwCgvKwY0DBJBIa73+nTHeucscHl
7tAAnRA/SXg7OiBxm1bIZ2lcM2yvAQsp
=8WSd
-END PGP SIGNATURE-

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



Re: Session replication using only PersistenceManager + JDBCStore

2009-06-17 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Yves,

On 6/17/2009 6:04 AM, Yves Glodt wrote:
 In my setup are 4 apaches with mod_proxy which connect to 4 tomcats. 
 In front of the apaches is a hardware balancer which does
 round-robin, but with a kind of sticky TCP-sessions, so mostly the
 clients on the web stay on the same server. Mostly...

Why not use mod_jk's session stickiness? The httpd server can be chosen
randomly by the hw lb, but the right Tomcat always gets the request.
Then, you can forget about session replication and get better
performance. On the other hand, if your users cannot be expected to
tolerate interruptions (due to a failing server) then you'll /have/ to
go with some kind of replication.

 To be completely safe and sleep well, I would like to replicate the 
 sessions now, and in the mentioned document I read that it is
 possible using the PersistenceManager with JDBCStore.

Just note that this is probably the slowest of the 3 options presented
in the Replication HOWTO, since each session attribute will have to be
retrieved from the database every time. Option #3 (in-memory
replication) will probably be the fastest option for a cluster such as
yours, especially if all the members of the cluster are on the same
(real) network.

 My question now: Is it enough to set up PersistenceManager with
 JDBCStore on my 4 tomcats to use the same database/table as session
 store ?

It should be.

 Or do I need to mess with ReplicationValve and jvmRoute set up as
 well ?

No, but I think using real replication will give you better performance.

 I will put my server.xml at the end of the file, which is set up
 with JDBCStore using a Firebird Database with JayBird.

How are you sharing your database across your 4 Tomcat instances?

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

iEYEARECAAYFAko5RwoACgkQ9CaO5/Lv0PDK/wCffEK2IfLU3urah7UO4c8+NV2w
VOMAn2ly1yE2CO3+PdglPRj2k9plFn5F
=qeVK
-END PGP SIGNATURE-

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



RE: Error with Solr configuration in Tomcat container

2009-06-17 Thread Mukerjee, Neiloy (Neil)
The issue was indeed in the Java options in the startup file for Tomcat. In 
order to fix the issue, all I had to do was go to /etc/init.d/, edit the Tomcat 
startup file to include: explort JAVA_OPTS=$JAVA_OPTS 
-Dsolr.solr.home=/usr/local/tomcat6.0.20/solr, and restart Tomcat. 
Thank you!

-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
Sent: Wednesday, June 17, 2009 1:52 PM
To: Tomcat Users List
Subject: RE: Error with Solr configuration in Tomcat container

 From: Mukerjee, Neiloy (Neil) [mailto:neil.muker...@alcatel-lucent.com]
 Subject: Error with Solr configuration in Tomcat container
 
 The file solrconfig.xml is in /solr/conf/ in the Tomcat directory

That wording is a bit ambiguous, since it's not clear what you mean by the 
Tomcat directory; give us the full path to solrconfig.xml.  Note that 
depending on some particular current directory in order to resolve relative 
paths is rather risky.

 SEVERE: Could not start SOLR. Check solr/home property

What is the solr/home property?  If it's a Java system property, set it via 
JAVA_OPTS before starting Tomcat, with a value of the *absolute* path to 
whatever Solr wants.

 - 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



Problems with juli ClassLoaderLogManager.readConfiguration()

2009-06-17 Thread Matt Passell
I'm working with a set of webapps running on Tomcat 6.0.20 that use
java.util.logging (aka JDK1.4 Logging) for legacy reasons.  Since the
webapps each have their own logging configuration, I followed the
instructions on the Tomcat logging page (
http://tomcat.apache.org/tomcat-6.0-doc/logging.html) and started using
ClassLoaderLogManager.  Things work great at startup, but we have some code
that modifies the logging.properties file for a webapp and then calls
LogManager.getLogManager().readConfiguration(), expecting that to reload the
file.  Neither that method nor the readConfiguration(InputStream) version
seem to have any effect, but the changes to the file work if I restart
Tomcat.  Any suggestions?  Does it sound like I'm doing something wrong or
missing a step?
Thanks,
Matt


Re: Serving images from classes directory

2009-06-17 Thread André Warnier

Susan,
have a look at this :
http://tuckey.org/urlrewrite/

This is a servlet filter, which kind of wraps your webapp, 
intercepting all calls before they reach your webapp.
On the way, it allows you to modify the request URL (for instance), to 
for example to redirect the call to some simple servlet which would just 
return said image.
Or maybe - my knowledge is too limited to really tell - arrange for 
these calls to be served by Tomcat's default webapp, which serves static 
items.


Note that I am not in all this taking a stance on whether what you want 
to do is fundamentally a good idea, which from the previous expert 
testimonies here, it seems it is not.


Also, the reason that said experts object so strenuously to what you 
want to do, is not that they just personally don't like it for some 
reason of elegance or so.  Their main objection probably has to do with 
the security of your website.  Mixing code (which you do not want to 
disclose to just about anyone) with static objects (which you want to 
disclose of course) is probably the best way to introduce huge holes in 
whatever security scheme your site would otherwise have.
So the experts are telling you don't do that, because in their expert 
and considerate opinion, they don't feel that they should help you do by 
yourself something that will definitely put your site at risk.



Susan G. Conger wrote:

Thanks Tim.  I don't have control during build because that is done by the
third party tool.  I am not going to mention their name.  I was hoping that
this would be easy.  You know a servlet mapping in the web.xml file that
would allow me to just map the directory/file type and I could just put that
in my html.  Since I can't use jsp everywhere I need the images.  Again I am
tied into their system and they have stuff in html files that they create.
I edit the html template files they have to add my images and javascript.
I use their environment to create/edit/build the web application. Underneath
I have tied in netBeans the best I can so I can debug their stuff.  But that
has issues too.  


Thanks,
Susan

-Original Message-
From: Tim Funk [mailto:funk...@apache.org] 
Sent: Wednesday, June 17, 2009 1:07 PM

To: Tomcat Users List
Subject: Re: Serving images from classes directory

If the images are physical images in the classes directory - you have a 
few options.


1) At build time - move (or copy) the files from the classes directory 
to somewhere more sane that the default servlet can access
2) Write a filter the detects these images that live in the classes dir, 
and then forwards to the images. (You need to be careful with this one)


For # 2 - it would look something like this:
doFilter(...) {
   String p = request.getServletPath();
   if (p.matches(/magic_prefix/[\\w]+\\.gif$)) {
 String np = request.getServletPath().replaceFirst(.+/, );
 request.getRequestDispatcher(/WEB-INF/class/more/cowbell/ + np)
.forward(request, response);
   } else {
 chain.doFilter(...);
   }
}


-Tim


-
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: Serving images from classes directory

2009-06-17 Thread Tsirkin Evgeny
What is your OS?
If this a *nix - then you have make sure that Web-INF is readable for the
world,
this is NOT good .On the  other hand you could just create a soft link to
whatever they
have there...
Evgeny

On Wed, Jun 17, 2009 at 9:20 PM, Susan G. Conger
sus...@bfcassociates.comwrote:

 I started with the authors of the tool app and they said it was a tomcat
 limitation.  Basically can't be done.  So I figured I would try the list
 before I took their word for it.

 Yes, I use the tool to modify the template files.  But that is basically
 just editing html using the tool.  When the tool app builds my app it
 copies
 everything into the classes directory.  So that everything looks like one
 big Java class under the tool app.  So my thought is that my images and
 javascripts should go in here so I can have everything together and make
 maintenance easier.  I check everything the tool app builds into subversion
 so I can have some source control.

 Thanks,
 Susan


 -Original Message-
 From: Pid [mailto:p...@pidster.com]
  Sent: Wednesday, June 17, 2009 2:09 PM
 To: Tomcat Users List
 Subject: Re: Serving images from classes directory

 Susan G. Conger wrote:
  The template files are in the classes directory.  This is a web app that
 is
  deploying it's own web app.  So it is rather convoluted.  The web app
 that
  gets deployed is my web app while the web app doing the developing is the
  third party tool.


 For reference then, we'll call the first one the 'tool app'.

 So are you actually editing the template files yourself, or are you
 using the tool app to edit the template files?

 Where in your app do the modified template files end up, and are they
 copied individually?


 The thought also occurs that the authors of the tool app might be the
 people you really want to be talking to about this.

 p



  Thanks,
  Susan
 
  -Original Message-
  From: Pid [mailto:p...@pidster.com]
  Sent: Wednesday, June 17, 2009 1:29 PM
  To: Tomcat Users List
  Subject: Re: Serving images from classes directory
 
  Susan G. Conger wrote:
  Thanks Tim.  I don't have control during build because that is done by
 the
  third party tool.  I am not going to mention their name.  I was hoping
  that
  this would be easy.  You know a servlet mapping in the web.xml file that
  would allow me to just map the directory/file type and I could just put
  that
  in my html.  Since I can't use jsp everywhere I need the images.  Again
 I
  am
  tied into their system and they have stuff in html files that they
 create.
  I edit the html template files they have to add my images and
 javascript.
  I use their environment to create/edit/build the web application.
  Underneath
  I have tied in netBeans the best I can so I can debug their stuff.  But
  that
  has issues too.
 
  If you can edit the template files, can't you include images in the same
  place as the templates?
 
  p
 
 
 
  Thanks,
  Susan
 
  -Original Message-
  From: Tim Funk [mailto:funk...@apache.org]
  Sent: Wednesday, June 17, 2009 1:07 PM
  To: Tomcat Users List
  Subject: Re: Serving images from classes directory
 
  If the images are physical images in the classes directory - you have a
  few options.
 
  1) At build time - move (or copy) the files from the classes directory
  to somewhere more sane that the default servlet can access
  2) Write a filter the detects these images that live in the classes dir,
  and then forwards to the images. (You need to be careful with this one)
 
  For # 2 - it would look something like this:
  doFilter(...) {
 String p = request.getServletPath();
 if (p.matches(/magic_prefix/[\\w]+\\.gif$)) {
   String np = request.getServletPath().replaceFirst(.+/, );
   request.getRequestDispatcher(/WEB-INF/class/more/cowbell/ + np)
  .forward(request, response);
 } else {
   chain.doFilter(...);
 }
  }
 
 
  -Tim
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
  For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
  For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
  For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
  For additional commands, e-mail: users-h...@tomcat.apache.org
 
 


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




 

Redeploy application

2009-06-17 Thread Tokajac

Hello, 


Whenever i want to deploy new version of application (that's VERY often),
have to: 
stop tomcat; 
execute build.xml -ant script; 
start tomcat; 

Is there any way, target in ant, that can make this easier? 


Regards 

P.S.
http://www.coderanch.com/t/449958/Tomcat/Redeploy-application#2003409
-- 
View this message in context: 
http://www.nabble.com/Redeploy-application-tp24081872p24081872.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: Reading POSTed data

2009-06-17 Thread André Warnier

Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

André,

On 6/17/2009 4:06 AM, André Warnier wrote:

Sorry to interrupt, but actually guys I believe that the problem is due
to the way the data is POSTed, which in this case is - I believe - invalid.
See http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4


Note that this is an HTML thing, not an HTTP thing. HTML forms may only
be sent using two distinct Content-Types, but HTTP POST can do anything
it wants.


In a restricted sense, I agree.

But then, the servlet spec (2.5) explicitly talks about form data 2 
times, for post data 1 single time.


If the conditions are not met and the *post form data* is not included 
in the parameter set, the *post data* must still be available to the 
servlet via the request object’s input stream. If the conditions are 
met, *post form data* will no longer be available for reading directly 
from the request object’s input stream. 



Mmmm.
What does the 3.0 Servlet Spec say ?
Well, in section 3.1.1, it now only mentions form data, twice.

My main objection though, derives from this previous paragraph, at the 
end of section 3.1 :


Data from the query string and the post body are aggregated into the 
request parameter set. Query string data is presented before post body 
data. For example, if a request is made with a query string of a=hello 
and a post body of a=goodbyea= world, the resulting parameter set would 
be ordered a=(hello, goodbye, world).


So, what in case there /are/ parameters in the URL ?
How would the servlet container /combine/ these with a body made of XML 
or whatever else raw data ?


Maybe I am interpreting this one step too far, but it seems to me from 
all this, that the designers of the Servlet Spec at least, were only 
planning for form data, in pairs of parameter=value, and not for one big 
data blob (without parameter name) in the body.


To me thus, the correct way - and the only way a browser would do it - 
to POST this data, would be in the form of a multipart/form-data body, 
itself composed of a MIME header and a body that would be the XML blob.


Basically, to me the whole point is that that HTTP server has to be 
prepared to receive data in some predictable way.  Out of the blue, 
this webapp has no way to know that, for this request that comes in as a 
POST, getParameters() would crash, because it is trying to get 
parameter=value things where there are none.  That seems wrong.



Any further expert comments here ?


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



Re: Error with Solr configuration in Tomcat container

2009-06-17 Thread André Warnier

Mukerjee, Neiloy (Neil) wrote:

...
The file solrconfig.xml is in /solr/conf/ in the Tomcat directory, but 
I'm not sure how to interpret the current working directory, and 
Googling this error hasn't led me in any direction. Any suggestions as 
to where to go from here would be greatly appreciated.

...
Maybe to the Solr list ?

Not the expert here, but looking at your description, haven't you at 
some point put something under /examples/solr/, and something else 
directly under /solr/ ?  Isn't that your problem ?




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



Re: Redeploy application

2009-06-17 Thread Jonathan Mast
try:

http://tomcat.apache.org/tomcat-6.0-doc/manager-howto.html



On Wed, Jun 17, 2009 at 4:53 PM, Tokajac imre_to...@hotmail.com wrote:


 Hello,


 Whenever i want to deploy new version of application (that's VERY often),
 have to:
 stop tomcat;
 execute build.xml -ant script;
 start tomcat;

 Is there any way, target in ant, that can make this easier?


 Regards

 P.S.
 http://www.coderanch.com/t/449958/Tomcat/Redeploy-application#2003409
 --
 View this message in context:
 http://www.nabble.com/Redeploy-application-tp24081872p24081872.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: Celebrating Apache Tomcat 10th Anniversary

2009-06-17 Thread André Warnier

+1 multiplied by the number of websites powered by Apache httpd.
I don't know what else anyone could say that would be a greater 
endorsement and thank you.


Ken Bowen wrote:

+1 exp 10!
On Jun 17, 2009, at 12:28 PM, Markus Schönhaber wrote:


Mladen Turk:


So, wish us happy anniversary :)


Congratulations!
And thanks for a decade of good work!

--
Regards
 mks

-
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: Error with Solr configuration in Tomcat container

2009-06-17 Thread André Warnier

Martin Gainty wrote:
Bonjour 


...


Bon Chance
Martin 


Martin,
the correct spelling is Bonne Chance.
In French, Chance is a woman.


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



RE: Reading POSTed data

2009-06-17 Thread Caldarale, Charles R
 From: André Warnier [mailto:a...@ice-sa.com]
 Subject: Re: Reading POSTed data
 
 Maybe I am interpreting this one step too far, but it seems to me from
 all this, that the designers of the Servlet Spec at least, were only
 planning for form data, in pairs of parameter=value, and not for one
 big data blob (without parameter name) in the body.

That was my interpretation as well; the intent appears to be to support only a 
parameter=value type of POST body, even if there's only one parameter and the 
length of the value is huge.

Anybody here on the committee?

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



RE: Error with Solr configuration in Tomcat container

2009-06-17 Thread Caldarale, Charles R
 From: André Warnier [mailto:a...@ice-sa.com]
 Subject: Re: Error with Solr configuration in Tomcat container
 
 In French, Chance is a woman.

Any response to that is bound to get someone in trouble...

 - 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: Redeploy application

2009-06-17 Thread Tokajac

http://localhost:8080/manager/deploy?path=/appname

but i get:
Access to the requested resource has been denied
with user: tomcat; pass: tomcat

Can you explain step-by-step the redeployment configuration, please?


Regards



Jonathan Mast-2 wrote:
 
 try:
 
 http://tomcat.apache.org/tomcat-6.0-doc/manager-howto.html
 
 
 
 On Wed, Jun 17, 2009 at 4:53 PM, Tokajac imre_to...@hotmail.com wrote:
 

 Hello,


 Whenever i want to deploy new version of application (that's VERY often),
 have to:
 stop tomcat;
 execute build.xml -ant script;
 start tomcat;

 Is there any way, target in ant, that can make this easier?


 Regards

 P.S.
 http://www.coderanch.com/t/449958/Tomcat/Redeploy-application#2003409
 --
 View this message in context:
 http://www.nabble.com/Redeploy-application-tp24081872p24081872.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


 
 

-- 
View this message in context: 
http://www.nabble.com/Redeploy-application-tp24081872p24082327.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: Error with Solr configuration in Tomcat container

2009-06-17 Thread André Warnier

Caldarale, Charles R wrote:

From: André Warnier [mailto:a...@ice-sa.com]
Subject: Re: Error with Solr configuration in Tomcat container

In French, Chance is a woman.


Any response to that is bound to get someone in trouble...


For good balance though, Malchance is also of the feminine persuasion.


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



Re: Reading POSTed data

2009-06-17 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

André,

On 6/17/2009 4:58 PM, André Warnier wrote:
 Christopher Schultz wrote:

 Note that [restricted content-type] is an HTML thing, not an HTTP 
 thing. HTML forms may only be sent using two distinct
 Content-Types, but HTTP POST can do anything it wants.

 In a restricted sense, I agree.
 
 But then, the servlet spec (2.5) explicitly talks about form data 2
 times, for post data 1 single time.
 
 If the conditions are not met and the *post form data* is not included
 in the parameter set, the *post data* must still be available to the
 servlet via the request object’s input stream. If the conditions are
 met, *post form data* will no longer be available for reading directly
 from the request object’s input stream. 

Right: this just says that when (properly-advertised) form data is
present, it is available via the getParameter family of functions.

 Mmmm.
 What does the 3.0 Servlet Spec say ?
 Well, in section 3.1.1, it now only mentions form data, twice.
 
 My main objection though, derives from this previous paragraph, at the
 end of section 3.1 :
 
 Data from the query string and the post body are aggregated into the
 request parameter set. Query string data is presented before post body
 data. For example, if a request is made with a query string of a=hello
 and a post body of a=goodbyea= world, the resulting parameter set would
 be ordered a=(hello, goodbye, world).
 
 So, what in case there /are/ parameters in the URL ?
 How would the servlet container /combine/ these with a body made of XML
 or whatever else raw data ?

It can't, nor should it. If the POST data is not properly-formatted form
data, then it's left up to the servlet to decide what to do with it.

 Maybe I am interpreting this one step too far, but it seems to me from
 all this, that the designers of the Servlet Spec at least, were only
 planning for form data, in pairs of parameter=value, and not for one big
 data blob (without parameter name) in the body.

Only form data is supported by the servlet API directly (via
getParameter)... other types of data are supported indirectly through
getInputStream/getReader.

 To me thus, the correct way - and the only way a browser would do it -
 to POST this data, would be in the form of a multipart/form-data body,
 itself composed of a MIME header and a body that would be the XML blob.

Note that multipart/form-data is not supported by the servlet API
directly, either. If you want to read multipart/form-data, you need an
3rd-party library (or 1st party... if you feel like writing your own).

 Basically, to me the whole point is that that HTTP server has to be
 prepared to receive data in some predictable way.  Out of the blue,
 this webapp has no way to know that, for this request that comes in as a
 POST, getParameters() would crash, because it is trying to get
 parameter=value things where there are none.  That seems wrong.

getParameter, when called in the presence of POST data that is not
formatted according to the spec's guidelines, does not consume any part
of the request body. The servlet is free to read the data itself. No
crashing is necessary.

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

iEYEARECAAYFAko5YGkACgkQ9CaO5/Lv0PBPygCfcBHwGH0O4z7ahSpkALGlcW3p
5PoAn2Xndch9aVPzUBM/xd0AV5sXDhBg
=4bPs
-END PGP SIGNATURE-

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



Re: Redeploy application

2009-06-17 Thread Jonathan Mast
dude, step-by-step instructions are on that page, its actually one of the
more clear and concise how-tos provided by tomcat.

On Wed, Jun 17, 2009 at 5:21 PM, Tokajac imre_to...@hotmail.com wrote:


 http://localhost:8080/manager/deploy?path=/appname

 but i get:
 Access to the requested resource has been denied
 with user: tomcat; pass: tomcat

 Can you explain step-by-step the redeployment configuration, please?


 Regards



 Jonathan Mast-2 wrote:
 
  try:
 
  http://tomcat.apache.org/tomcat-6.0-doc/manager-howto.html
 
 
 
  On Wed, Jun 17, 2009 at 4:53 PM, Tokajac imre_to...@hotmail.com wrote:
 
 
  Hello,
 
 
  Whenever i want to deploy new version of application (that's VERY
 often),
  have to:
  stop tomcat;
  execute build.xml -ant script;
  start tomcat;
 
  Is there any way, target in ant, that can make this easier?
 
 
  Regards
 
  P.S.
  http://www.coderanch.com/t/449958/Tomcat/Redeploy-application#2003409
  --
  View this message in context:
  http://www.nabble.com/Redeploy-application-tp24081872p24081872.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
 
 
 
 

 --
 View this message in context:
 http://www.nabble.com/Redeploy-application-tp24081872p24082327.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: Reading POSTed data

2009-06-17 Thread Kyle Brantley

André Warnier wrote:
To me thus, the correct way - and the only way a browser would do it 
- to POST this data, would be in the form of a multipart/form-data 
body, itself composed of a MIME header and a body that would be the 
XML blob.


If I may:

   function loadXMLDoc(xmlRequest) {
   var xmlDoc;
   xmlDoc = new window.XMLHttpRequest();
   xmlDoc.open(POST, parent.serverURL, false);
   xmlDoc.setRequestHeader(Content-type, text/xml);
   xmlDoc.setRequestHeader(Content-length, 
xmlRequest.length);

   xmlDoc.setRequestHeader(Connection, close);
   xmlDoc.send(xmlRequest);
   return xmlDoc.responseXML;
   }



(Yes, I know I'm doing doing the proper HTTP status return checks. This 
is very rough code at the moment.)


I went with this for two reasons: one, it is absurdly simple and two, 
there is no required encoding. If I want to send a blob of data, then 
I'm going to send a blob of data. I saw a really simple, easy way out of 
encoding (sometimes /very/) long strings into the proper urlencoded 
form. I pass in an XML string, I get an XML string back - no extra 
effort involved. Granted, the getParameter*() methods are there for a 
reason. I just chose not to use them.


My point, is that it is entirely possible for a browser to POST data to 
a resource without sending it as multipart/form-data or 
application/x-www-form-urlencoded.


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



Re: Reading POSTed data

2009-06-17 Thread David Smith
André Warnier wrote:
 Christopher Schultz wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 André,

 On 6/17/2009 4:06 AM, André Warnier wrote:
 Sorry to interrupt, but actually guys I believe that the problem is due
 to the way the data is POSTed, which in this case is - I believe -
 invalid.
 See http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4

 Note that this is an HTML thing, not an HTTP thing. HTML forms may only
 be sent using two distinct Content-Types, but HTTP POST can do anything
 it wants.

 In a restricted sense, I agree.

 But then, the servlet spec (2.5) explicitly talks about form data 2
 times, for post data 1 single time.

 If the conditions are not met and the *post form data* is not
 included in the parameter set, the *post data* must still be available
 to the servlet via the request object’s input stream. If the
 conditions are met, *post form data* will no longer be available for
 reading directly from the request object’s input stream. 


 Mmmm.
 What does the 3.0 Servlet Spec say ?
 Well, in section 3.1.1, it now only mentions form data, twice.

 My main objection though, derives from this previous paragraph, at the
 end of section 3.1 :

 Data from the query string and the post body are aggregated into the
 request parameter set. Query string data is presented before post body
 data. For example, if a request is made with a query string of a=hello
 and a post body of a=goodbyea= world, the resulting parameter set
 would be ordered a=(hello, goodbye, world).

 So, what in case there /are/ parameters in the URL ?
 How would the servlet container /combine/ these with a body made of
 XML or whatever else raw data ?

 Maybe I am interpreting this one step too far, but it seems to me from
 all this, that the designers of the Servlet Spec at least, were only
 planning for form data, in pairs of parameter=value, and not for one
 big data blob (without parameter name) in the body.

 To me thus, the correct way - and the only way a browser would do it
 - to POST this data, would be in the form of a multipart/form-data
 body, itself composed of a MIME header and a body that would be the
 XML blob.

 Basically, to me the whole point is that that HTTP server has to be
 prepared to receive data in some predictable way.  Out of the blue,
 this webapp has no way to know that, for this request that comes in as
 a POST, getParameters() would crash, because it is trying to get
 parameter=value things where there are none.  That seems wrong.


 Any further expert comments here ?


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

Having had to recently do some SOAP work, it looks to me that is at
least partially what the OP was trying to begin with.  SOAP performs a
POST with XML as the body of the request.  It's not URI encoded
parameters or multipart data like the HTML Form posts, but a standard
POST operation with an xml body.  This is legitimate stuff to do and I
would consider the spec broken if it didn't support it.


Just my two cents.

--David


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



Re: Reading POSTed data

2009-06-17 Thread André Warnier

Kyle Brantley wrote:
...
My point, is that it is entirely possible for a browser to POST data to 
a resource without sending it as multipart/form-data or 
application/x-www-form-urlencoded.

Hey! that is cheating. You never mentioned Javascript before.
;-)

But true. I wasn't thinking of XMLHttpRequest (which is becoming 
entirely misnamed these days).  You /can/ POST any body which strikes 
your fancy.


And you are also right when you mention that assembling a real 
multipart/form-data body may be a p. in the a.


The real question however is whether you /should/.
(In the sense that you /can/ also do a GET or POST with an unparseable 
query string, but it would not get you far).


My point (awaiting a more expert opinion still), is that I believe that 
the way the servlet spec is written, you may very well get away with it 
under one servlet container, but not under another.
Now whether this is a concern in your particular circumstances, is for 
you to know.


I would gladly read the opinion of one of the designers though.

As an aside : in your case, there is also not much stopping you from 
sending your XML body in a way guaranteed to work in all cases.

You could send it as
name= all your XML, properly URL-encoded ..

Then it would work also with getParameters().

Unless it is really long of course; I would not recommend this with a 
file. But in that case, there is this :


http://commons.apache.org/fileupload/using.html

which also allows you to handle multipart/form-data containing blobs and 
simple form parameters, together in one POST.
(Mentioning it because I have often found that what is at the beginning 
a simple case where all we need to upload, ever, is a single blob, 
turns out in the end to be ..but we'd also like to send some additional 
meta-data describing the blop).





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



Re: Reading POSTed data

2009-06-17 Thread André Warnier

David Smith wrote:


Having had to recently do some SOAP work, it looks to me that is at
least partially what the OP was trying to begin with.  SOAP performs a
POST with XML as the body of the request.  It's not URI encoded
parameters or multipart data like the HTML Form posts, but a standard
POST operation with an xml body.  This is legitimate stuff to do and I
would consider the spec broken if it didn't support it.


Just my two cents.

I (relunctantly) believe you're right, and that I was being 
unnecessarily pernickety.

At least according to this :
http://www.w3schools.com/SOAP/soap_example.asp

OP, all is forgiven.  And David, you get your two cents back.
;-)

.. just don't do any getParameter() with your stuff.
That, I believe, /may/ still get you in trouble.
But I'm sure by now Chuck is already checking the Tomcat code of 
getParameter(), to see if that's the case.


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



Re: Reading POSTed data

2009-06-17 Thread Kyle Brantley

André Warnier wrote:

Kyle Brantley wrote:
...
My point, is that it is entirely possible for a browser to POST data 
to a resource without sending it as multipart/form-data or 
application/x-www-form-urlencoded.

Hey! that is cheating. You never mentioned Javascript before.
;-)

But true. I wasn't thinking of XMLHttpRequest (which is becoming 
entirely misnamed these days).  You /can/ POST any body which strikes 
your fancy.


And you are also right when you mention that assembling a real 
multipart/form-data body may be a p. in the a.
Which is really the only reason that matters as to why I wanted to do 
it. I don't want to encode/decode to send to the server, and then do the 
same to send to the client. It's a very simple solution.


The real question however is whether you /should/.

Definitely. Granted on every count.


My point (awaiting a more expert opinion still), is that I believe 
that the way the servlet spec is written, you may very well get away 
with it under one servlet container, but not under another.
Now whether this is a concern in your particular circumstances, is for 
you to know.


*nod* Probably will only ever be using tomcat. Unless someone suggests 
something else, but I don't think that would be the case... /here/. :)


As an aside : in your case, there is also not much stopping you from 
sending your XML body in a way guaranteed to work in all cases.

You could send it as
name= all your XML, properly URL-encoded ..

Then it would work also with getParameters().

And you know, I really debated that - but for absolutely no reason at 
all, I really wanted to see if I could accomplish it without. That, and 
I wasn't sure if I would need to tack on extra encoding - the XML in 
question has quite a few element attributes, all with their own 
var=whatever pairs. I wasn't positive how getParameter*() would parse 
that, and if I would/wouldn't need to add extra encoding. As you laid 
out right there, I would need to URL encode the data, and the reality is 
I just don't care that much (when presented with another solution that 
works with arguably less effort). The client is straight javascript, and 
while I'm not the one doing the client (not my problem), it would just 
be added effort for little to no gain.


Unless it is really long of course; I would not recommend this with a 
file. But in that case, there is this :


http://commons.apache.org/fileupload/using.html

which also allows you to handle multipart/form-data containing blobs 
and simple form parameters, together in one POST.
(Mentioning it because I have often found that what is at the 
beginning a simple case where all we need to upload, ever, is a 
single blob, turns out in the end to be ..but we'd also like to send 
some additional meta-data describing the blop).


Right. I doubt we'll ever have a need for that, but it would also be an 
option.


I am curious just how the expert opinion turns out, though.

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



Re: Pointers on diagnosing session and thread hangs

2009-06-17 Thread Pete Helgren

Thanks Chris.

I'll see if I can get the relevant sections from the server.xml.  The 
folks who have access to the server have gone home for the day.


You said:

Can you also post a thread dump? I'm surprised that Tomcat is exceeding
(or appearing to exceed) its own limit on request processing threads. I
suspect something else is going on.


*How* do you dump a thread? And, what is in it?  What I am looking for 
is an idea (at least) of where the app is hanging.  I have little doubt 
some object is getting created at some point and is not being destroyed 
or is inadvertently locked by something else.  Just a *hint* could get 
me pointed in the right direction I think. So if I can figure out how to 
dump a thread I may be able to head down the correct path.  A quick 
google on thread dumps in Tomcat turned up nothing that was immediately 
useful.


Pete


Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Pete,

On 6/17/2009 8:33 AM, Pete Helgren wrote:
  

I am not an expert by any stretch in Tomcat internals so what I need
is a way to determine what is causing the sessions to hang and the
threads to begin to grow beyond the maximum (650 in our case).



Please post your Connector element(s) from server.xml, and any
Executor element(s) you may be using as well.

Can you also post a thread dump? I'm surprised that Tomcat is exceeding
(or appearing to exceed) its own limit on request processing threads. I
suspect something else is going on.

  
Is there a step by step FAQ somewhere that would allow us to 
systematically analyze the running servlet and determine where the 
hang is?



Not really. These things tend to require investigation tailored to the
app in question.

Finding the cause of hung threads can be easy if the thread dumps point
to a single thing everyone's waiting on. If not, it could take a while
to find out what's going on. Being able to reproduce this problem in a
lab environment (preferably with fewer threads, just to maintain your
own sanity during research) is essential.

Finding the cause of dead sessions will require the use of a memory
profiler or some very good guesses and luck. Are the sessions themselves
not expiring, or are objects from those expired sessions living beyond
their expected expiration date?

Are you playing any games with your HttpSession objects such as caching
them somewhere for cross-session data manipulation?

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

iEYEARECAAYFAko5NxEACgkQ9CaO5/Lv0PAJPACdFi+hNUHSszFZa6ekMGI5A3Ju
BkAAniZYPUtFWdRvVAX1MttHlqld78ZG
=DgU1
-END PGP SIGNATURE-

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


  


RE: Reading POSTed data

2009-06-17 Thread Martin Gainty

Kyle-

i would like to hear some more on how to represent blob with title or 
content-type metadata 

an example would be axis2 1.4 HexBinary or Base64Binary (BLOBS) accompanied by 
a String title such as what is represented by this xmime.xsd

xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema;
xmlns:xmime=http://www.w3.org/2005/05/xmlmime;
targetNamespace=http://www.w3.org/2005/05/xmlmime;
xs:attribute name=contentType
xs:simpleType
xs:restriction base=xs:string
xs:minLength value=3 /
/xs:restriction
/xs:simpleType
/xs:attribute
xs:attribute name=expectedContentTypes type=xs:string /
xs:complexType name=base64Binary
xs:simpleContent
xs:extension base=xs:base64Binary
xs:attribute ref=xmime:contentType /
/xs:extension
/xs:simpleContent
/xs:complexType
xs:complexType name=hexBinary
xs:simpleContent
xs:extension base=xs:hexBinary
xs:attribute ref=xmime:contentType /
/xs:extension
/xs:simpleContent
/xs:complexType
/xs:schema

?
Martin Gainty 
__ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.




 Date: Wed, 17 Jun 2009 16:45:34 -0600
 From: k...@averageurl.com
 To: users@tomcat.apache.org
 Subject: Re: Reading POSTed data
 
 André Warnier wrote:
  Kyle Brantley wrote:
  ...
  My point, is that it is entirely possible for a browser to POST data 
  to a resource without sending it as multipart/form-data or 
  application/x-www-form-urlencoded.
  Hey! that is cheating. You never mentioned Javascript before.
  ;-)
 
  But true. I wasn't thinking of XMLHttpRequest (which is becoming 
  entirely misnamed these days).  You /can/ POST any body which strikes 
  your fancy.
 
  And you are also right when you mention that assembling a real 
  multipart/form-data body may be a p. in the a.
 Which is really the only reason that matters as to why I wanted to do 
 it. I don't want to encode/decode to send to the server, and then do the 
 same to send to the client. It's a very simple solution.
 
  The real question however is whether you /should/.
 Definitely. Granted on every count.
 
  My point (awaiting a more expert opinion still), is that I believe 
  that the way the servlet spec is written, you may very well get away 
  with it under one servlet container, but not under another.
  Now whether this is a concern in your particular circumstances, is for 
  you to know.
 
 *nod* Probably will only ever be using tomcat. Unless someone suggests 
 something else, but I don't think that would be the case... /here/. :)
 
  As an aside : in your case, there is also not much stopping you from 
  sending your XML body in a way guaranteed to work in all cases.
  You could send it as
  name= all your XML, properly URL-encoded ..
 
  Then it would work also with getParameters().
 
 And you know, I really debated that - but for absolutely no reason at 
 all, I really wanted to see if I could accomplish it without. That, and 
 I wasn't sure if I would need to tack on extra encoding - the XML in 
 question has quite a few element attributes, all with their own 
 var=whatever pairs. I wasn't positive how getParameter*() would parse 
 that, and if I would/wouldn't need to add extra encoding. As you laid 
 out right there, I would need to URL encode the data, and the reality is 
 I just don't care that much (when presented with another solution that 
 works with arguably less effort). The client is straight javascript, and 
 while I'm not the one doing the client (not my problem), it would just 
 be added effort for little to no gain.
 
  Unless it is really long of course; I would not recommend this with a 
  file. But in that case, there is this :
 
  http://commons.apache.org/fileupload/using.html
 
  which also allows you to handle multipart/form-data containing blobs 
  and simple form parameters, together in one POST.
  (Mentioning it 

Session replication fails on ReplicationValve invocation

2009-06-17 Thread David Nillesen
Hi,
I'm currently trying to establish a cluster of tomcat 5.5.27 
servers to deploy sakai in, so I'm stuck on version 5.5. It is not an option to 
upgrade to tomcat 6 which from all accounts has much better session replication.

I have cluster membership up and working via multicast and the two nodes add 
each other as replication targets. When I try to establish a connection to the 
server  from my web browser to the default port of 8080 I get this neat error 
in my catalina.out:

ERROR: An exception or error occurred in the container during the request 
processing (2009-06-17 16:43:49,545 
http-172.31.3.37-8080-Processor5_org.apache.catalina.connector.CoyoteAdapter)
java.lang.NullPointerException
at 
org.apache.catalina.cluster.tcp.ReplicationValve.invoke(ReplicationValve.java:348)

I'll put full errors and configs at the bottom of the email. The errors occurs 
regardless of whether I access an empty/nonexistent context or the 
servlet-examples which are currently installed.

The servers are multi homed with 3 interfaces. Eth0 is the 
primary public interface, eth1 is my iSCSI network and eth2 is the backend 
cluster network. All neatly VLANd from each other in seperate subnets. 
Multicast membership works, I can see the packets arriving via tcpdump and the 
membership propagation is occurring.
I have tried binding the receivers to both public and private interfaces but 
have had no luck. The receivers are up and appear to be functional. I can 
telnet to  them and when I enter gibberish into the console it tell me I am 
sending malformed headers.
By using tcpdump and netstat I can see that neither tomcat instance is 
originating a sender session to connect to the other servers receiver.

I have tried fastsyncqueue and pooled style senders from the documentation. 
Currently configured for pooled as it looked the simpler config to diagnose. 
jvmRoute is configured via -D options passed to java as a lot of our configs 
are done dynamically so as to have a single server.xml across the cluster 
environments. We have a shared disk backend system to enable this.

Any suggestions for diagnosis, help, fixes or otherwise would be very much 
appreciated.

Regards,
Dave

Log file and startup:
INFO: The Apache Tomcat Native library which allows optimal performance in 
production environments was not found on the java.library.path: 
/apps/java/jdk1.5.0_19/jre/lib/amd64/server:/apps/java/jdk1.5.0_19/jre/lib/amd64:/apps/java/jdk1.5
.0_19/jre/../lib/amd64 (2009-06-17 16:40:36,874 
main_org.apache.catalina.core.AprLifecycleListener)
INFO: Initializing Coyote HTTP/1.1 on http-172.31.3.37-8080 (2009-06-17 
16:40:37,019 main_org.apache.coyote.http11.Http11BaseProtocol)
INFO: Initialization processed in 1400 ms (2009-06-17 16:40:37,021 
main_org.apache.catalina.startup.Catalina)
INFO: Set JAAS app name ENGINE (2009-06-17 16:40:37,114 
main_org.apache.catalina.realm.JAASRealm)
INFO: Starting service SERVICE (2009-06-17 16:40:37,126 
main_org.apache.catalina.core.StandardService)
INFO: Starting Servlet Engine: Apache Tomcat/5.5.27 (2009-06-17 16:40:37,133 
main_org.apache.catalina.core.StandardEngine)
INFO: Cluster is about to start (2009-06-17 16:40:37,133 
main_org.apache.catalina.cluster.tcp.SimpleTcpCluster)
INFO: Start ClusterSender at cluster ENGINE:type=Cluster with name 
ENGINE:type=ClusterSender (2009-06-17 16:40:37,430 
main_org.apache.catalina.cluster.tcp.ReplicationTransmitter)
INFO: Setting cluster mcast soTimeout to 1000 (2009-06-17 16:40:37,440 
main_org.apache.catalina.cluster.mcast.McastService)
INFO: Sleeping for 4000 milliseconds to establish cluster membership 
(2009-06-17 16:40:37,460 main_org.apache.catalina.cluster.mcast.McastService)
INFO: membership mbean registered (ENGINE:type=ClusterMembership) (2009-06-17 
16:40:41,478 main_org.apache.catalina.cluster.mcast.McastService)
INFO: XML validation disabled (2009-06-17 16:40:41,504 
main_org.apache.catalina.core.StandardHost)
INFO: ContextListener: contextInitialized() (2009-06-17 16:40:43,318 
main_org.apache.catalina.core.ContainerBase.[ENGINE].[localhost].[/servlets-examples])
INFO: SessionListener: contextInitialized() (2009-06-17 16:40:43,318 
main_org.apache.catalina.core.ContainerBase.[ENGINE].[localhost].[/servlets-examples])
INFO: JvmRouteBinderValve started (2009-06-17 16:40:43,391 
main_org.apache.catalina.cluster.session.JvmRouteBinderValve)
INFO: Starting Coyote HTTP/1.1 on http-172.31.3.37-8080 (2009-06-17 
16:40:43,467 main_org.apache.coyote.http11.Http11BaseProtocol)
INFO: JK: ajp13 listening on /172.31.3.37:8009 (2009-06-17 16:40:43,640 
main_org.apache.jk.common.ChannelSocket)
INFO: Jk running ID=0 time=0/99  config=null (2009-06-17 16:40:43,648 
main_org.apache.jk.server.JkMain)
INFO: Find registry server-registry.xml at classpath resource (2009-06-17 
16:40:44,411 main_org.apache.catalina.storeconfig.StoreLoader)
INFO: Server startup in 7485 ms (2009-06-17 16:40:44,506 

Re: Just a few questions on my Tomcat Configuration

2009-06-17 Thread Josh Gooding
Oh I love a good theory!  Maybe each company would have a customized few
pages each with their own directories, tied to their own schema, etc, but
point to the core application in another directory.  Everyone would see
their own front ends, but use a common framework in the backend maybe?
That is something that I am willing to work on looking into though as a
different phase of the current project.  Are those API's part of teh
standard Tomcat docs?

- Josh

On Wed, Jun 17, 2009 at 11:28 AM, Caldarale, Charles R 
chuck.caldar...@unisys.com wrote:

  From: Josh Gooding [mailto:josh.good...@gmail.com]
  Subject: Re: Just a few questions on my Tomcat Configuration
 
  This is what I was trying to figure out.  How can I add one on the fly
  without restarting Tomcat each time I add / remove a subdomain.

 It's theoretically possible, since the APIs exist for Tomcat running
 embedded.  However, I don't know of any reasonably easy to use mechanism
 that makes use of said APIs.

  - 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




  1   2   >