Re: where to store user-generated files?

2007-02-21 Thread John Pedersen

Looks like roll your own then!

A few thoughts on the matter - maybe someone could add to them?

It should be easy to map requests for images to a servlet, which can
then find the appropriate image file wherever it might be ( within or
outside the server ). Like this in the web.xml file:

servlet-mapping
servlet-nameservletName/servlet-name
url-pattern*.jpg/url-pattern
/servlet-mapping

?

But how is the image then added to the reponse? Another servlet (
behind the scenes - I am actually using  the Spring framework ) is
handling the request/response. Can the request/response be passed to
the image-providing servlet for the images within a page to be written
to the reponse in this kind of way:

// This method is called by the servlet container to process a GET request.
   public void doGet(HttpServletRequest req, HttpServletResponse
resp) throws IOException {
   // Get the absolute path of the image
   ServletContext sc = getServletContext();
   String filename = sc.getRealPath(image.gif);

   // Get the MIME type of the image
   String mimeType = sc.getMimeType(filename);
   if (mimeType == null) {
   sc.log(Could not get MIME type of +filename);
   resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
   return;
   }

   // Set content type
   resp.setContentType(mimeType);

   // Set content size
   File file = new File(filename);
   resp.setContentLength((int)file.length());

   // Open the file and output streams
   FileInputStream in = new FileInputStream(file);
   OutputStream out = resp.getOutputStream();

   // Copy the contents of the file to the output stream
   byte[] buf = new byte[1024];
   int count = 0;
   while ((count = in.read(buf)) = 0) {
   out.write(buf, 0, count);
   }
   in.close();
   out.close();
   }

( from http://www.exampledepot.com/egs/javax.servlet/GetImage.html )

I'm off for a walk to mull it over - any suggestions while I am out
and before I get to experimenting will be most welcome.

Thanks,

John

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



Re: [OT] Rough hint about server sizing Apache/Tomcat

2007-02-21 Thread www.sizinglounge.com

Hello Sacha,

http://www.sizinglounge.com http://www.sizinglounge.com  is a free online
sizing tool for any kind of software. It allows you to perform sizings up to
2000 concurrent users. For even higher web server sizings, please visit 
http://apache.sizinglounge.com http://apache.sizinglounge.com 

Your SizingLounge Team



Sascha Wehnert wrote:
 
 Hi folks, 
 
  
 
 guess this is a more Apache related question but perhaps someone can give
 me some hints here:
 
  
 
 I am in the situation to provide a proposal for a Apache/Tomcat setup
 where Apache might have to serve 4000 clients. 
 
 I am a bit unsure about the hardware I need for this. Is a dual XEON 32bit
 system with about 2GB oversized or to 
 
 small? Is there any Documentation available that helps to create a server
 sizing?
 
  
 
 Regards, 
 
  
 
 Sascha
 
 
 Sitz der Gesellschaft: Ritterhude . Amtsgericht Walsrode HRB 122181.
 Ust.-Id. DE 153074644. Steuer-Nr. 36/201/00642.
 Geschaeftsfuehrer: Martin Gueldenpfennig. Jeroen Boon. Nigel Horn.
 Thomas Pasold. Mark Pearman.
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Rough-hint-about-server-sizing-Apache-Tomcat-tf3227112.html#a9078244
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



java.lang.OutOfMemoryError: PermGen space .

2007-02-21 Thread Muruganantham

hi,

I am using RHEL 4 and Tomcat. I have restarted my tomcat.

After restarting my Tomcat server i am getting the following error while i
try to view some jsp pages


*java.lang.OutOfMemoryError: PermGen space* .


Please any one help me.


Thanks,

M.Muruganantham.


--
Regards,

M.Muruganantham.
CheapChess Development Team,
Silicon Oyster Technologies,
Chennai-84.
www.sot.in


Re: [OT] RE: Found a product for running Tomcat off CDROM -have anybody tried it?

2007-02-21 Thread David Wishnie

Hello,


According to this page (select Tomcat in the left pane):
 http://stunnix.com/ws-ui-saws/ui.xpl/1/project.showprops
Tomcat seems to be 5.5.20 but here they state that one can add support for
any version of Tomcat to it (here:
http://stunnix.com/prod/aws/tomcat-cdrom.shtml )

As for use of MySQL w/JDK - I got the impression that it can't do this.
But I guess you'll have to contact them directly - probably they'll add
support for it if you'll ask.

-David

On 2/21/07, Jason Pyeron [EMAIL PROTECTED] wrote:


But it could be a useful spam. As I read it and said to myself, oh, maybe
we could use that here and then discovered that it does not allow use to
use MySQL w/JDK and did not mention which version of tomcat it was.

Then the costs, we don't mind paying costs, but not 3/4k$ to a fly by
night.

Oh well, but it was good spam.

-Jason


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-   -
- Jason Pyeron  PD Inc. http://www.pdinc.us -
- Sr. Consultant10 West 24th Street #100-
- +1 (443) 269-1555 x333Baltimore, Maryland 21218   -
-   -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

This message is for the designated recipient only and may contain
privileged, proprietary, or otherwise private information. If you
have received it in error, purge the message from your system and
notify the sender immediately.  Any other use of the email by you
is prohibited.


-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Stephen Souness
Sent: Tuesday, February 20, 2007 15:33
To: users@tomcat.apache.org
Subject: Re: Found a product for running Tomcat off CDROM -have anybody
tried it?

Interesting that the Stunnix website appears to make no mention of who
is actually behind it the product.

Also interesting that you have posted a very similar message to a python
mailing list, subject: Found a product for running Python-based
websites off CDROM -have anybody tried it?

--
Stephen


David Wishnie wrote:
 Hello,

 I've found a product on freshmeat.net that allows to run tomcat-based
 websites off cdrom, allowing to produce
 CDs that work on Windows, MacOS X and Linux at the same time (also it
seems
 to support perl,
 python, php  mysql). Apache is used for serving static content, and it
has
 a nice support
 for stopping everything and releasing the media.

http://www.stunnix.com/prod/aws/overview.shtml

 Have anybody tried it?

 Seems useful..

 Thanks for your input!
  David



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


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




Re: Found a product for running Tomcat off CDROM -have anybody tried it?

2007-02-21 Thread David Wishnie

Hello,


On 2/20/07, Stephen Souness [EMAIL PROTECTED] wrote:


Interesting that the Stunnix website appears to make no mention of who
is actually behind it the product.

Also interesting that you have posted a very similar message to a python
mailing list, subject: Found a product for running Python-based
websites off CDROM -have anybody tried it?



I'm considering to use Python and Tomcat with this product and I'm
collecting opinions on it.

-David


RE: java.lang.OutOfMemoryError: PermGen space .

2007-02-21 Thread Peter Crowther
 From: Muruganantham [mailto:[EMAIL PROTECTED] 
 *java.lang.OutOfMemoryError: PermGen space* .

http://tomcat.apache.org/faq/memory.html - search for MaxPermSize.

- Peter

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



Specifying -Djava.library.path when tomcat is running as a service

2007-02-21 Thread Sriram Saroop

Hi,
I am running tomcat 4.1.34 as a Windows Service by using service.bat
My application uses JNI and the required libraries exist in 3 folders:
C:\f1,C:\f2,C:\f3
When I add the these folders in -Djava.library.path:
%EXECUTABLE% //US//%SERVICE_NAME% ++JvmOptions -Djava.library.path=C:\f1
%EXECUTABLE% //US//%SERVICE_NAME% ++JvmOptions -Djava.library.path=C:\f2
%EXECUTABLE% //US//%SERVICE_NAME% ++JvmOptions -Djava.library.path=C:\f3

Only the last line seems to be effective. (Meaning f1,f2 are NOT in
java.library.path).
Also I cannot seem to specify :
%EXECUTABLE% //US//%SERVICE_NAME% ++JvmOptions
-Djava.library.path=C:\f1;C:\f2;C:\f3
since tomcat fails to start. I guess this is because ; is a separator for
the -D/-X options.

Other than merging the 3 folders, is it possible to specify multiple
directories as a part of -Djava.library.path ?

Regards,
Sriram


Re: overlapped parameters between sessions

2007-02-21 Thread Paul Singleton

Caldarale, Charles R wrote:
From: WILLIAM PARRA [mailto:[EMAIL PROTECTED] 
Subject: overlapped parameters between sessions


When  passing parameters with get metod, with many
users (about 200); some parameters, are overlapped
between sessions.


If you're speaking of parameters taken from a URL, they are relative to
a Request, not a Session.  There can be many Requests associated with a
single Session being processed concurrently.  If you app is storing
Request-specific information in a Session object, your app is in error.


If you don't *need* to process per-session requests
concurrently, you may find it easier and safer overall
to synchronise access to each session and continue to
code your sessions without worrying about concurrent
requests.  Your users will never notice.  Just don't
serialise *all* requests :-)

But this may not be what William is on about...

Paul Singleton

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



Re: overlapped parameters between sessions

2007-02-21 Thread WILLIAM PARRA
Hi

I understood that the sessions were of each user. isn't it?
I understood that One session to one Navegator to one user. isn't it?

I don't understand because the parameter can be overwritten by the value from 
another request. The object request is not part of the session?

Greetings and thanks for its patience. 

 
William Enrique Parra Alba
Ingeniero De Sistemas 
Universidad Pedagógica y Tecnológica de Colombia
 /\  /\  
/ //\\ \
\ \\// /
/ /  \ \
\/\/

- Mensaje original 
De: Caldarale, Charles R [EMAIL PROTECTED]
Para: Tomcat Users List users@tomcat.apache.org
Enviado: martes, 20 de febrero, 2007 18:13:32
Asunto: RE: overlapped parameters between sessions

 From: WILLIAM PARRA [mailto:[EMAIL PROTECTED] 
 Subject: Re: overlapped parameters between sessions
 
 I pass an parameter to identify the type user. With this 
 parameter, i define if show one page.. or other. Some times 
 the parameter requested, was changed.

Do you ever store the parameter in some place that's not specific to the
particular Request object currently being processsed?  For example, if
you store the parameter in the Session or in some static variable, it
can be overwritten by the value from another request.

 - Chuck


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

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







__
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
Regístrate ya - http://correo.espanol.yahoo.com/ 

Re: overlapped parameters between sessions

2007-02-21 Thread WILLIAM PARRA
My aplication is a system of inscription for aspirings to the 
university. Therefore, it has concurrent connections. that I do? 
 


William Enrique Parra Alba
Ingeniero De Sistemas 
Universidad Pedagógica y Tecnológica de Colombia
 /\  /\  
/ //\\ \
\ \\// /
/ /  \ \
\/\/

- Mensaje original 
De: Paul Singleton [EMAIL PROTECTED]
Para: Tomcat Users List users@tomcat.apache.org
Enviado: miércoles, 21 de febrero, 2007 7:02:48
Asunto: Re: overlapped parameters between sessions

Caldarale, Charles R wrote:
 From: WILLIAM PARRA [mailto:[EMAIL PROTECTED] 
 Subject: overlapped parameters between sessions

 When  passing parameters with get metod, with many
 users (about 200); some parameters, are overlapped
 between sessions.
 
 If you're speaking of parameters taken from a URL, they are relative to
 a Request, not a Session.  There can be many Requests associated with a
 single Session being processed concurrently.  If you app is storing
 Request-specific information in a Session object, your app is in error.

If you don't *need* to process per-session requests
concurrently, you may find it easier and safer overall
to synchronise access to each session and continue to
code your sessions without worrying about concurrent
requests.  Your users will never notice.  Just don't
serialise *all* requests :-)

But this may not be what William is on about...

Paul Singleton

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







__
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
Regístrate ya - http://correo.espanol.yahoo.com/ 

http://tomcat.apache.org/faq/misc.html#externalJndi

2007-02-21 Thread Marc Farrow

http://tomcat.apache.org/faq/misc.html#externalJndi

I noticed from the above link that you cannot access Tomcat's JNDI provider
outside of Tomcat at this time.  Is there plans to include it with Tomcat
6?

--
Marc Farrow


Re: [OT] mod_jk configuration for production

2007-02-21 Thread nuka

I've read the documentation and my question is :

- socket_timeout = 2s but reply_timeout is 0 meaning that the webserver is
waiting forever. Which of them is used for timeout ajp connection?



nuka wrote:
 
 Hello,
 
 I am facing to a problem concerning apache-tomcat configuration via mod_jk
 for our production environment. We are using  Apache: 2.0.55, Tomcat 5.0,
 mod_jk 1.2.15.
 
 Our first problem has been raised some weeks ago when the clients received
 http 404 errors. 
 
 mod_jk logs have shown errors such as:
 
 [Tue Feb 13 08:36:03 2007][info]  ajp_send_request::jk_ajp_common.c
 (1178): Socket 14 is not connected any more (errno=-1)
 [Tue Feb 13 08:36:03 2007][info]  ajp_send_request::jk_ajp_common.c
 (1202): Error sending request. Will try another pooled connection
 [Tue Feb 13 08:36:03 2007][info]  ajp_send_request::jk_ajp_common.c
 (1225): All endpoints are disconnected or dead
 [Tue Feb 13 08:36:03 2007][info]  ajp_service::jk_ajp_common.c (1749):
 Sending request to tomcat failed,  recoverable operation attempt=1
 
 After that, we changed the timeout for tomcat ajp connector (initially =
 1) to 6ms.
 
 Now we get other errors:
 
 - a lot of Error decoding request in the JBoss logs at the same times
 where  mod_jk is showing
   
 [Mon Feb 19 13:25:50 2007][info] 
 ajp_connection_tcp_get_message::jk_ajp_common.c (955): Tomcat has forced a
 connection close  for socket 14
 [Mon Feb 19 13:25:50 2007][error] ajp_get_reply::jk_ajp_common.c (1503):
 Tomcat is down or refused connection. No response has been sent to the
 client (yet)
 [Mon Feb 19 13:25:50 2007][info]  ajp_service::jk_ajp_common.c (1721):
 Receiving from tomcat failed, recoverable operation attempt=0
 
 Bellow is our configuration:
 
  !-- A AJP 1.3 Connector on port 8009 --
   Connector port=8009 address=${jboss.bind.address}
  enableLookups=false redirectPort=8443 debug=0
  protocol=AJP/1.3 connectionTimeout=6/
 
 workers.properties:
 
 # Define list of workers that will be used   
 # for mapping requests   
 worker.list=loadbalancer, loadbalancer2, status


 worker.xxxNode1.port=8109   
 worker.xxxNode1.host=
 worker.xxxNode1.type=ajp13 
 worker.xxxNode1.socket_keepalive=True
 worker.xxxNode1.socket_timeout=2
 worker.xxxNode1.recycle_timeout=300
 worker.xxxNode1.recovery_options=0
 
 worker.xxxNode2.port=8209   
 worker.xxxNode2.host=xxx.xx.xx.xx
 worker.xxxNode2.type=ajp13  
 worker.xxxNode2.socket_keepalive=True
 worker.xxxNode2.socket_timeout=2
 worker.xxxNode2.recycle_timeout=300
 worker.xxx2.recovery_options=0
 
 Do you have any idea which parameters do we need to change in this
 configuration?
 
 thanks
 
 rgds
 
 Nuka
   
 

-- 
View this message in context: 
http://www.nabble.com/mod_jk-configuration-for-production-tf3260752.html#a9080605
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



Re: [OT] mod_jk configuration for production

2007-02-21 Thread nuka



I've read the documentation and my question is : 

- socket_timeout = 2s but reply_timeout is 0 meaning that the webserver is
waiting forever. Which of them is used for timeout ajp connection? 





Rainer Jung-3 wrote:
 
 Then start reading on
 
 http://tomcat.apache.org/connectors-doc/reference/workers.html
 
 what your configuration means. You will notice, that a value of 2 for
 the socket_timeout does not really make any sense.
 
 Regards,
 
 Rainer
 
 nuka schrieb:
 This configuration was done some time ago by someone else. I  don't
 believe
 there is a specific reason for this parameter configuration. 
 I believe that this should be a default dev configuration.
 
 
 
 Rainer Jung-3 wrote:
 What's your idea why you configured a socket timeout of 2?

 nuka schrieb:
 Hello,

 I am facing to a problem concerning apache-tomcat configuration via
 mod_jk
 for our production environment. We are using   Apache: 2.0.55, Tomcat
 5.0,
 mod_jk 1.2.15.

 Our first problem has been raised some weeks ago when the clients
 received
 http 404 errors. 

 mod_jk logs have shown errors such as:

 [Tue Feb 13 08:36:03 2007][info]  ajp_send_request::jk_ajp_common.c
 (1178):
 Socket 14 is not connected any more (errno=-1)
 [Tue Feb 13 08:36:03 2007][info]  ajp_send_request::jk_ajp_common.c
 (1202):
 Error sending request. Will try another pooled connection
 [Tue Feb 13 08:36:03 2007][info]  ajp_send_request::jk_ajp_common.c
 (1225):
 All endpoints are disconnected or dead
 [Tue Feb 13 08:36:03 2007][info]  ajp_service::jk_ajp_common.c (1749):
 Sending request to tomcat failed,  recoverable operation attempt=1

 After that, we changed the timeout for tomcat ajp connector (initially
 =
 1) to 6ms.

 Now we get other errors:

 - a lot of Error decoding request in the JBoss logs at the same times
 where  mod_jk is showing

 [Mon Feb 19 13:25:50 2007][info] 
 ajp_connection_tcp_get_message::jk_ajp_common.c (955): Tomcat has
 forced
 a
 connection close  for socket 14
 [Mon Feb 19 13:25:50 2007][error] ajp_get_reply::jk_ajp_common.c
 (1503):
 Tomcat is down or refused connection. No response has been sent to the
 client (yet)
 [Mon Feb 19 13:25:50 2007][info]  ajp_service::jk_ajp_common.c (1721):
 Receiving from tomcat failed, recoverable operation attempt=0

 Bellow is our configuration:

  !-- A AJP 1.3 Connector on port 8009 --
   Connector port=8009 address=${jboss.bind.address}
  enableLookups=false redirectPort=8443 debug=0
  protocol=AJP/1.3 connectionTimeout=6/

 workers.properties:

 # Define list of workers that will be used   
 # for mapping requests   
 worker.list=loadbalancer, loadbalancer2, status


 worker.xxxNode1.port=8109   
 worker.xxxNode1.host=
 worker.xxxNode1.type=ajp13 
 worker.xxxNode1.socket_keepalive=True
 worker.xxxNode1.socket_timeout=2
 worker.xxxNode1.recycle_timeout=300
 worker.xxxNode1.recovery_options=0

 worker.xxxNode2.port=8209   
 worker.xxxNode2.host=xxx.xx.xx.xx
 worker.xxxNode2.type=ajp13  
 worker.xxxNode2.socket_keepalive=True
 worker.xxxNode2.socket_timeout=2
 worker.xxxNode2.recycle_timeout=300
 worker.xxx2.recovery_options=0

 Do you have any idea which parameters do we need to change in this
 configuration?

 thanks

 rgds

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



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

-- 
View this message in context: 
http://www.nabble.com/mod_jk-configuration-for-production-tf3260752.html#a9080778
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



Re: java.lang.OutOfMemoryError: PermGen space .

2007-02-21 Thread Mohan Wickramasinghe
try setting in JVM paramerter
MaxPermSize=256m
(if using linux)


 hi,

 I am using RHEL 4 and Tomcat. I have restarted my tomcat.

 After restarting my Tomcat server i am getting the following error while i
 try to view some jsp pages


 *java.lang.OutOfMemoryError: PermGen space* .


 Please any one help me.


 Thanks,

 M.Muruganantham.


 --
 Regards,

 M.Muruganantham.
 CheapChess Development Team,
 Silicon Oyster Technologies,
 Chennai-84.
 www.sot.in



Regards
Mohan Wickramasinghe


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



XML parser issue while defining a Realm

2007-02-21 Thread Serlet Jean-Claude
Hello

My environment :
Windows 2003 server
Tomcat 5.5.12

What i tried :
userSearch=(amp;(uid={0})(|(dncomp=ou=Oneorgunit)(dencomp=ou=AnOtherOU)))
while defining a Realm using an LDAP directory
I gave a xml parser error when i started the Tomcat Instance :
org.xml.sax.SAXParseException: The entity name must immediately follow the
'' in the entity reference.
When i use this filter through an LDAP browser (replacing {0} with a valid
uid) that works well
Thanks

Jean-Claude



RE: overlapped parameters between sessions

2007-02-21 Thread Caldarale, Charles R
 From: WILLIAM PARRA [mailto:[EMAIL PROTECTED] 
 Subject: Re: overlapped parameters between sessions
 
 I understood that the sessions were of each user. isn't it?

There may be multiple sessions per user, depending on the browser,
number of windows open, etc.

 I understood that One session to one Navegator to one user. isn't it?

Not necessarily; there may be more than one session.  A session will not
be shared by multiple clients, but it can be shared by multiple tabs or
browser windows opened by a single client.

 I don't understand because the parameter can be overwritten 
 by the value from another request. The object request is not 
 part of the session?

No, it is not part of the session.  A browser often submits multiple
requests simultaneously, resulting in multiple threads within Tomcat
utilizing the same Session object at the same time.  Any synchronization
of access to the Session object is the responsibility of the app.  The
same is true for any fields of your servlet objects.

 - Chuck


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

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



RE: where to store user-generated files?

2007-02-21 Thread Williams, Allen
I'm new at this, so bear with me here for a moment...

The servlet mapping seems to me to tell tomcat anytime you have a
request for a URI with .jpg extension, deliver the request to this
servlet, but that doesn't give any information about where in the
real file system said jpeg is stored, does it?  So, when you call
sc.getRealPath(), how does the servlet context know where to go?
Doesn't there have to be a mapping or alias somewhere (server.xml,
web.xml,...?) that resolves, or translates ThisTypeofFileName.ext into
/real/path/in/OS/ThatTypeOfFileName.oxt?


-Original Message-
From: John Pedersen [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 21, 2007 4:37 AM
To: Tomcat Users List
Subject: Re: where to store user-generated files?

Looks like roll your own then!

A few thoughts on the matter - maybe someone could add to them?

It should be easy to map requests for images to a servlet, which can
then find the appropriate image file wherever it might be ( within or
outside the server ). Like this in the web.xml file:

servlet-mapping
servlet-nameservletName/servlet-name
url-pattern*.jpg/url-pattern
/servlet-mapping

?

But how is the image then added to the reponse? Another servlet (
behind the scenes - I am actually using  the Spring framework ) is
handling the request/response. Can the request/response be passed to
the image-providing servlet for the images within a page to be written
to the reponse in this kind of way:

 // This method is called by the servlet container to process a GET
request.
public void doGet(HttpServletRequest req, HttpServletResponse
resp) throws IOException {
// Get the absolute path of the image
ServletContext sc = getServletContext();
String filename = sc.getRealPath(image.gif);

// Get the MIME type of the image
String mimeType = sc.getMimeType(filename);
if (mimeType == null) {
sc.log(Could not get MIME type of +filename);
 
resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
return;
}

// Set content type
resp.setContentType(mimeType);

// Set content size
File file = new File(filename);
resp.setContentLength((int)file.length());

// Open the file and output streams
FileInputStream in = new FileInputStream(file);
OutputStream out = resp.getOutputStream();

// Copy the contents of the file to the output stream
byte[] buf = new byte[1024];
int count = 0;
while ((count = in.read(buf)) = 0) {
out.write(buf, 0, count);
}
in.close();
out.close();
}

( from http://www.exampledepot.com/egs/javax.servlet/GetImage.html )

I'm off for a walk to mull it over - any suggestions while I am out
and before I get to experimenting will be most welcome.

Thanks,

John

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


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



RE: where to store user-generated files?

2007-02-21 Thread Caldarale, Charles R
 From: Williams, Allen [mailto:[EMAIL PROTECTED] 
 Subject: RE: where to store user-generated files?
 
 Doesn't there have to be a mapping or alias somewhere (server.xml,
 web.xml,...?) that resolves, or translates 
 ThisTypeofFileName.ext into
 /real/path/in/OS/ThatTypeOfFileName.oxt?

Yes.  Normally, such static content is handled by Tomcat's
DefaultServlet, and the file system mapping must correspond to the URI
path.  In this case, a servlet of your app will be handling the request,
and it's up to your app to implement whatever mapping you desire.

 - Chuck


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

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



Re: Expression Language in JSP and JasperException

2007-02-21 Thread Piotr Kiraga

Hi David,


Ok  forgive me now, but this is getting confusing.  Where does
result come into this picture?  Were you expecting actionBean to be an
instance of a different class?  You aren't offering a lot to go on here.


Sorry for mixup. I've just thought that it is just about some option
in Tomcat configuration or something, and I haven't knew it. Like I
see... It may be not. :(

Here goes more background.

login.jsp (handled by LoginActionBean class) redirects after
submission login form to calculator.jsp. After submition form from
calculator.jsp  (what is handled by CalculatorActionBean class) it
returns to calculator.jsp and shows the result of mathematical
equation. Sources of calculator.jsp and it's class are placed below.

Problem shows when I'm submiting from LoginActionVean to
calculator.jsp. Like I wrote before, LoginActionBean doesn't have
result field because it doesn't need it. But JSP (in this case used by
two classes) expects result in:
46:c:if test=${!empty actionBean.result}
47:Result: ${actionBean.result}br/
line.

Here actionBean could be an instance of different class.

Sorry for so much source in thread, here it goes:




#
package com.some.packages.action;

import net.sourceforge.stripes.action.ActionBean;
import net.sourceforge.stripes.action.ActionBeanContext;
import net.sourceforge.stripes.action.DefaultHandler;
import net.sourceforge.stripes.action.DontValidate;
import net.sourceforge.stripes.action.ForwardResolution;
import net.sourceforge.stripes.action.Resolution;
import net.sourceforge.stripes.validation.LocalizableError;
import net.sourceforge.stripes.validation.Validate;
import net.sourceforge.stripes.validation.ValidationErrors;
import net.sourceforge.stripes.validation.ValidationMethod;

/**
* A very simple calculator action.
* @author Tim Fennell
*/

public class CalculatorActionBean implements ActionBean {

private ActionBeanContext context;
private String forwardSuccess = /calculator.jsp;
private String forwardFail = /index.jsp;

private Double result;
@Validate(required=true, mask=^\\d*$) private double numberOne;
@Validate(required=true, mask=^\\d*$) private double numberTwo;

public CalculatorActionBean() {
}

/* execution */

/*
 * Handler method.
 * Handles addition functionality of web application form.
 */
@DefaultHandler
@DontValidate
public Resolution init() {
return new ForwardResolution(forwardSuccess);
}

/*
 * Handler method.
 * Handles addition functionality of web application form.
 */
public Resolution addition() {
result = getNumberOne() + getNumberTwo();
return new ForwardResolution(forwardSuccess);
}

/* getters and setters */

public ActionBeanContext getContext() {
return context;
}

public void setContext(ActionBeanContext context) {
this.context = context;
}

public double getNumberOne() {
return numberOne;
}

public void setNumberOne(double numberOne) {
this.numberOne = numberOne;
}

public double getNumberTwo() {
return numberTwo;
}

public void setNumberTwo(double numberTwo) {
this.numberTwo = numberTwo;
}

public Double getResult() {
return result;
}

public void setResult(Double result) {
this.result = result;
}

}
#




#
%@ page contentType=text/html;charset=UTF-8 language=java %
%@ taglib prefix=stripes uri=http://stripes.sourceforge.net/stripes.tld%
%@ taglib prefix=display uri=http://displaytag.sf.net%
%@ taglib prefix=c uri=http://java.sun.com/jsp/jstl/core; %
%@ taglib prefix=fmt uri=http://java.sun.com/jsp/jstl/fmt; %
fmt:setBundle basename=StripesResources/

stripes:layout-render name=/pages/layout/default.jsp

   stripes:layout-component name=contents

   h3fmt:message key=title / - fmt:message
key=title.calculator//h3

   stripes:errors /

   stripes:form action=/Calculator.action focus=

   table
   tr
   td
   div
   div style=width:150px;stripes:label
for=numberOne//div
   div style=display:inlinestripes:text
name=numberOne//div
   /div
   div
   div style=width:150px;stripes:label
for=numberTwo//div
   div style=display:inlinestripes:text
name=numberTwo//div
   /div
   /td
   td valign=bottom
   div
   

Re: XML parser issue while defining a Realm

2007-02-21 Thread David Delbecq
Hi

1) This is not an ldap or filter error, this is an xml wellformness
error. That mean tomcat can not parse your xml file
2) You say you can cut and paste it inside and ldap browser and it work?
Are you sure it is amp; that is inside your search rule? I mean your
ldap browser most probably do not parse xml entities, and as such, you
must probably feed it with '' instead of 'amp;' So check you have
correctly, in your xml, all '' replaces by 'amp;'
3) Send us you xml file as attachement if it still does not work :)

En l'instant précis du 02/21/07 14:43, Serlet Jean-Claude s'exprimait en
ces termes:
 Hello

 My environment :
 Windows 2003 server
 Tomcat 5.5.12

 What i tried :
 userSearch=(amp;(uid={0})(|(dncomp=ou=Oneorgunit)(dencomp=ou=AnOtherOU)))
 while defining a Realm using an LDAP directory
 I gave a xml parser error when i started the Tomcat Instance :
 org.xml.sax.SAXParseException: The entity name must immediately follow the
 '' in the entity reference.
 When i use this filter through an LDAP browser (replacing {0} with a valid
 uid) that works well
 Thanks

 Jean-Claude


   



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



Posting Xml

2007-02-21 Thread Dima Retov
Hello,

Is that good idea to POST XML data to Tomcat?

I wish to make HTTP request to servlet in Tomcat.

Method POST
Content Type: text/xml

Content would be non encoded XML file.

Is it good idea in general. My tomcat handles such requests now.
Is it expected that it will work in future?

Is there any limitations? e.g. request.getParameter() - should
parse GET parameters only.

-- 
Best regards,
 Dima  mailto:[EMAIL PROTECTED]



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



RE: where to store user-generated files?

2007-02-21 Thread Williams, Allen
Gotcha.  So, servlets can access the file system just like any other
java or C++ program?  I was thinking they were restricted, but now that
I'm thinking about it I think I was confusing that with applets.  If
tomcat is running as user tomcat55, do the servlets run as the same
user, so you can set file permissions up with something like rwx--
(700) if you make the directory owned by tomcat55? 


Thanks, and Regards,

Allen Williams
[EMAIL PROTECTED]
Office: (321)309-7931
Mobile: (321)258-1272
FAX: (321)727-9607

-Original Message-
From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 21, 2007 9:50 AM
To: Tomcat Users List; [EMAIL PROTECTED]
Subject: RE: where to store user-generated files?

 From: Williams, Allen [mailto:[EMAIL PROTECTED] 
 Subject: RE: where to store user-generated files?
 
 Doesn't there have to be a mapping or alias somewhere (server.xml,
 web.xml,...?) that resolves, or translates 
 ThisTypeofFileName.ext into
 /real/path/in/OS/ThatTypeOfFileName.oxt?

Yes.  Normally, such static content is handled by Tomcat's
DefaultServlet, and the file system mapping must correspond to the URI
path.  In this case, a servlet of your app will be handling the request,
and it's up to your app to implement whatever mapping you desire.

 - Chuck


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

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


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



Re: where to store user-generated files?

2007-02-21 Thread David Smith
I'm sure this is horribly insufficient, so I would recommend reading the
servlet spec.  It's not all that bad a read as far as specifications go
and you can learn a lot about how tomcat operates.

If you have a servlet mapping all *.jpg to some servlet myServlet in
web.xml, web.xml also has another section where the servlets are
individually declared.  In there you'll find the class that backs the
servlet named myServlet.  All that means is the request for the
resource goes to that specific servlet class to be handled.  What the
servlet does with it is open-ended.  In the case of the default servlet,
it basically calls sc.getResourceAsStream( request.getServletPath() +
request.getPathInfo() ) and returns the contents of the file to the
client.  That's over simplified -- the real default servlet does some
security checks to be sure it's not returning something it shouldn't and
set's the mime type in the response, but you get the idea. 
sc.getResourceAsStream is aware of the webapp's location in the
filesystem and takes care of finding the resource in the webapp's folder.

sc.getRealPath will only return a full path to a file if the webapp is
NOT compressed in a web archive file (.war).  From within a .war file,
it always returns null and isn't recommended except in rare cases where
you might want to write access.  This is all in the spec.

Servlet 2.4 spec is available at
http://jcp.org/aboutJava/communityprocess/final/jsr154/index.html

--David

Williams, Allen wrote:

I'm new at this, so bear with me here for a moment...

The servlet mapping seems to me to tell tomcat anytime you have a
request for a URI with .jpg extension, deliver the request to this
servlet, but that doesn't give any information about where in the
real file system said jpeg is stored, does it?  So, when you call
sc.getRealPath(), how does the servlet context know where to go?
Doesn't there have to be a mapping or alias somewhere (server.xml,
web.xml,...?) that resolves, or translates ThisTypeofFileName.ext into
/real/path/in/OS/ThatTypeOfFileName.oxt?


-Original Message-
From: John Pedersen [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 21, 2007 4:37 AM
To: Tomcat Users List
Subject: Re: where to store user-generated files?

Looks like roll your own then!

A few thoughts on the matter - maybe someone could add to them?

It should be easy to map requests for images to a servlet, which can
then find the appropriate image file wherever it might be ( within or
outside the server ). Like this in the web.xml file:

servlet-mapping
   servlet-nameservletName/servlet-name
   url-pattern*.jpg/url-pattern
/servlet-mapping

?

But how is the image then added to the reponse? Another servlet (
behind the scenes - I am actually using  the Spring framework ) is
handling the request/response. Can the request/response be passed to
the image-providing servlet for the images within a page to be written
to the reponse in this kind of way:

 // This method is called by the servlet container to process a GET
request.
public void doGet(HttpServletRequest req, HttpServletResponse
resp) throws IOException {
// Get the absolute path of the image
ServletContext sc = getServletContext();
String filename = sc.getRealPath(image.gif);

// Get the MIME type of the image
String mimeType = sc.getMimeType(filename);
if (mimeType == null) {
sc.log(Could not get MIME type of +filename);
 
resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
return;
}

// Set content type
resp.setContentType(mimeType);

// Set content size
File file = new File(filename);
resp.setContentLength((int)file.length());

// Open the file and output streams
FileInputStream in = new FileInputStream(file);
OutputStream out = resp.getOutputStream();

// Copy the contents of the file to the output stream
byte[] buf = new byte[1024];
int count = 0;
while ((count = in.read(buf)) = 0) {
out.write(buf, 0, count);
}
in.close();
out.close();
}

( from http://www.exampledepot.com/egs/javax.servlet/GetImage.html )

I'm off for a walk to mull it over - any suggestions while I am out
and before I get to experimenting will be most welcome.

Thanks,

John

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


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

  



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

Tomcat/mod_jk/Apache - up to date - matching versions?

2007-02-21 Thread Sharon French

We are configuring a new server for use in a production environment, we
would like to maintain a similar setup to our other servers (apache + mod_jk
+ tomcat) but would like to upgrade to the latest appropriate versions.

We are running on Red Hat Linux (kernel 2.6.9-5) with the 1.5.0_11 JVM -
looking around, I believe that the latest stable versions are:
apache: 2.2.4
mod_jk: 1.2.20
tomcat: 5.5.20

My understanding is that within reason the versions of tomcat/mod_jk/apache
don't need to match, but I wonder if there are any version combinations
that would best be avoided? Or conversely, a combination that is
particularly useful?

Anyone care to convince me that the above aren't the versions I ought to be
using?

Thank you in advance for any input,

Sharon French
Xtensible Technology Inc
195 McGregor St.
Suite 322
Manchester, NH 03102
603.641.8141 x202


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



RE: XML parser issue while defining a Realm

2007-02-21 Thread Serlet Jean-Claude
Sorry
I made a mistake 
The .war with an erronous context.xml stays under the webbapps directory
while i tried to modify the context.xml under the application directory
Now it works fine


Jean-Claude

-Message d'origine-
De : Serlet Jean-Claude 
Envoyé : mercredi 21 février 2007 14:44
À : TomcatUsers
Objet : XML parser issue while defining a Realm

Hello

My environment :
Windows 2003 server
Tomcat 5.5.12

What i tried :
userSearch=(amp;(uid={0})(|(dncomp=ou=Oneorgunit)(dencomp=ou=AnOtherOU)))
while defining a Realm using an LDAP directory I gave a xml parser error
when i started the Tomcat Instance :
org.xml.sax.SAXParseException: The entity name must immediately follow the
'' in the entity reference.
When i use this filter through an LDAP browser (replacing {0} with a valid
uid) that works well
Thanks

Jean-Claude


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



RE: where to store user-generated files?

2007-02-21 Thread Caldarale, Charles R
 From: Williams, Allen [mailto:[EMAIL PROTECTED] 
 Subject: RE: where to store user-generated files?
 
 So, servlets can access the file system just like any other
 java or C++ program?

Yes - they're just part of the Tomcat process.

 If tomcat is running as user tomcat55, do the servlets run 
 as the same user, so you can set file permissions up with
 something like rwx-- (700) if you make the directory
 owned by tomcat55? 

Correct.

David S's concerns about the use of getRealPath() apply to servlets
attempting to access resources within the deployed app, not to file
system references outside of the app's deployment location.  As Dave
suggests, familiarity with the servlet spec is strongly recommended.

 - Chuck


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

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



Get rid of 8080 port in Tomcat 3.3

2007-02-21 Thread Frank Nguyen
Hi,

 

We’re still running 3.3.1 – We’d like to get rid of specifying the port 8080
in the http request like HYPERLINK
http://www.something.com:8080/http://www.something.com:8080 and have it
default to 80 (HYPERLINK http://www.somehting.com/http://www.somehting.com
only) but could not find any way. I tried to define port=80 in server.xml
but tomcat threw exceptions. If you know a way, could you help ?

 

Thanks in advance,

 

 

Frank Nguyen


--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.441 / Virus Database: 268.18.1/691 - Release Date: 2/17/2007
5:06 PM



-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.441 / Virus Database: 268.18.1/691 - Release Date: 2/17/2007
5:06 PM
 


Re: Get rid of 8080 port in Tomcat 3.3

2007-02-21 Thread EDMOND KEMOKAI

80 is a privileged port on *nix systems, you'll need to run tomcat as root
(generally not recommended). May I ask why you're still running tomcat circa
version 3?

On 2/21/07, Frank Nguyen [EMAIL PROTECTED] wrote:


Hi,



We're still running 3.3.1 – We'd like to get rid of specifying the port
8080
in the http request like HYPERLINK
http://www.something.com:8080/http://www.something.com:8080 and have it
default to 80 (HYPERLINK http://www.somehting.com/;
http://www.somehting.com
only) but could not find any way. I tried to define port=80 in server.xml
but tomcat threw exceptions. If you know a way, could you help ?



Thanks in advance,





Frank Nguyen


--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.441 / Virus Database: 268.18.1/691 - Release Date: 2/17/2007
5:06 PM



--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.441 / Virus Database: 268.18.1/691 - Release Date: 2/17/2007
5:06 PM





--
talk trash and carry a small stick.
PAUL KRUGMAN (NYT)


RE: where to store user-generated files?

2007-02-21 Thread Williams, Allen
Got it.  I'll also get the spec.  Thanks to you and Dave!

-Original Message-
From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 21, 2007 10:51 AM
To: Tomcat Users List
Subject: RE: where to store user-generated files?

 From: Williams, Allen [mailto:[EMAIL PROTECTED] 
 Subject: RE: where to store user-generated files?
 
 So, servlets can access the file system just like any other
 java or C++ program?

Yes - they're just part of the Tomcat process.

 If tomcat is running as user tomcat55, do the servlets run 
 as the same user, so you can set file permissions up with
 something like rwx-- (700) if you make the directory
 owned by tomcat55? 

Correct.

David S's concerns about the use of getRealPath() apply to servlets
attempting to access resources within the deployed app, not to file
system references outside of the app's deployment location.  As Dave
suggests, familiarity with the servlet spec is strongly recommended.

 - Chuck


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

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


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



RE: Connection pool problem DBCP - 4.1.3

2007-02-21 Thread Propes, Barry L [GCG-NAOT]
I wonder...would I get mixed results trying to implement JNDI maing in my 
server.xml file, but only trying to (on a page by page basis, with an existing 
servlet and/or JSP) utilize the naming context method?

In other words, I test out DBCP with one dedicated servlet or JSP, and perhaps 
it works fine, but somehow that adversely affects another servlet or JSP where 
I've not really implemented the Naming Context portion, but since I've altered 
the server.xml file, that's affected it?

Please let me know if you have any insight into this.

Thanks!

-Original Message-
From: Mike Quilleash [mailto:[EMAIL PROTECTED]
Sent: Monday, February 19, 2007 1:08 PM
To: Tomcat Users List
Subject: RE: Connection pool problem DBCP - 4.1.3


Need a bit more info.  DB type and version, JDBC driver version,
ResultSet loop/access code.

Generally the pseudo code should be...


Open Connection
try
{
  Prepare Statement
  try
  {
Execute Query
try
{
  while ( resultSet.next() )
  {
// process row here
  }
}
finally
{
  Close ResultSet
}
  }
  finally
  {
Close PreparedStatement 
  }
}
finally
{
  Close Connection
}


All of the closing should be done in finally blocks so they happen even
if you get an exception.

-Original Message-
From: Propes, Barry L [GCG-NAOT] [mailto:[EMAIL PROTECTED] 
Sent: 19 February 2007 18:22
To: Tomcat Users List
Subject: Connection pool problem DBCP - 4.1.3


This is driving me crazy. I'm finally close, I think, on getting this
solved.

Problem is I seem to either get Connection is closed or Exhausted
resultset, depending where I put my close statement.


I've got the following up at the top, which replaces my driver reference
that was previously there.

Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup(java:comp/env); // Look up
our data source DataSource ds = (DataSource)
  envCtx.lookup(jdbc/myoracle);
// Allocate and use a connection from the pool Connection connection =
ds.getConnection();

Statement selstmt = connection.createStatement();

String prepSQL = SELECT AID, ACTIVE, REQUESTOR_NAME..., +
 PHONE_NUM,DATE_REQ,...  +
   +
 FROM table a INNER JOIN table b  +
 ON a.CTRL_ID = b.CTRL_ID  +
 WHERE AID = ?;

PreparedStatement prepstmt = connection.prepareStatement(prepSQL);
prepstmt.setString(1, aidstrd);
ResultSet admsql = prepstmt.executeQuery(); admsql.next();

(etc., etc.)

admsql.close();
selstmt.close();
connection.close();

If I move up connection.close, I get the Connection is closed statement,
otherwise I get exhausted result set. 
Any idea what gives?


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



 This e-mail is bound by the terms and conditions described at 
http://www.subexazure.com/mail-disclaimer.html



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


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



Re: Expression Language in JSP and JasperException

2007-02-21 Thread David Smith
Ok.  I'm not overly familiar with Stripes, so you'll have to bear with
me a little.  I can think of a few ways to handle this.

First, look at what makes a request from calculator.jsp unique.  You
could use the referrer header, the value of a submit button, or the
presence of the equation request parameter.  Below is an example using
the submit button:

c:if test=${(param.submitBtn == 'Calculate') and (actionBean.result !=
null)}
  pThe answer is ${actionBean.result}/p
/c:if

A better solution would be to name the actionBean that's a result of
CalculatorActionBean something more descript than just 'actionBean' like
'calcBean'.  The main advantage here is it's simple and you could use
your original expression language test -- just change the name of the
object being tested:

c:if test=${calcBean.result != null}
  ... display the result
/c:if

A more complicated solution if you can't change the name of 'actionBean'
might be to test the type of actionBean like...

c:set var=calcAvailablejsp:expression
  (request.getAttribute(actionBean) != null) 
(request.getAttribute(actionBean) instanceOf
com.some.packages.action.CalculatorActionBean )/jsp:expression/c:set
c:choose
c:when test=${calcAvailable and (actionBean.result != null)}
  pThe answer is  ${actionBean.result}/p
/c:when
c:when test=${calcAvailable}
  pSorry, I couldn't understand your equation.  Please rephrase it.../p
/c:when
c:otherwise
  !-- Just logged in.  Display the form. --
/c:otherwise
/c:choose

The essential point of this is testing for a property to be null is not
the same as testing for it's presence.  You'll have to know if it has a
property before you can test the property for null.

--David

Piotr Kiraga wrote:

 Hi David,

 Ok  forgive me now, but this is getting confusing.  Where does
 result come into this picture?  Were you expecting actionBean to be an
 instance of a different class?  You aren't offering a lot to go on here.


 Sorry for mixup. I've just thought that it is just about some option
 in Tomcat configuration or something, and I haven't knew it. Like I
 see... It may be not. :(

 Here goes more background.

 login.jsp (handled by LoginActionBean class) redirects after
 submission login form to calculator.jsp. After submition form from
 calculator.jsp  (what is handled by CalculatorActionBean class) it
 returns to calculator.jsp and shows the result of mathematical
 equation. Sources of calculator.jsp and it's class are placed below.

 Problem shows when I'm submiting from LoginActionVean to
 calculator.jsp. Like I wrote before, LoginActionBean doesn't have
 result field because it doesn't need it. But JSP (in this case used by
 two classes) expects result in:
 46:c:if test=${!empty actionBean.result}
 47:Result: ${actionBean.result}br/
 line.

 Here actionBean could be an instance of different class.

 Sorry for so much source in thread, here it goes:




 #
 package com.some.packages.action;

 import net.sourceforge.stripes.action.ActionBean;
 import net.sourceforge.stripes.action.ActionBeanContext;
 import net.sourceforge.stripes.action.DefaultHandler;
 import net.sourceforge.stripes.action.DontValidate;
 import net.sourceforge.stripes.action.ForwardResolution;
 import net.sourceforge.stripes.action.Resolution;
 import net.sourceforge.stripes.validation.LocalizableError;
 import net.sourceforge.stripes.validation.Validate;
 import net.sourceforge.stripes.validation.ValidationErrors;
 import net.sourceforge.stripes.validation.ValidationMethod;

 /**
 * A very simple calculator action.
 * @author Tim Fennell
 */

 public class CalculatorActionBean implements ActionBean {

 private ActionBeanContext context;
 private String forwardSuccess = /calculator.jsp;
 private String forwardFail = /index.jsp;
 
 private Double result;
 @Validate(required=true, mask=^\\d*$) private double numberOne;
 @Validate(required=true, mask=^\\d*$) private double numberTwo;

 public CalculatorActionBean() {
 }
 
 /* execution */
 
 /*
  * Handler method.
  * Handles addition functionality of web application form.
  */
 @DefaultHandler
 @DontValidate
 public Resolution init() {
 return new ForwardResolution(forwardSuccess);
 }

 /*
  * Handler method.
  * Handles addition functionality of web application form.
  */
 public Resolution addition() {
 result = getNumberOne() + getNumberTwo();
 return new ForwardResolution(forwardSuccess);
 }

 /* getters and setters */
 
 public ActionBeanContext getContext() {
 return context;
 }

 public void setContext(ActionBeanContext context) {
 this.context = context;
 }

 public double getNumberOne() {
 return numberOne;
 }

 public void setNumberOne(double numberOne) {
 this.numberOne = numberOne;
 }

 public double getNumberTwo() {
 

Re: Get rid of 8080 port in Tomcat 3.3

2007-02-21 Thread David Smith
I haven't tried it on such an old version of tomcat, but I would think
jsvc from the commons-daemon project would work here.

http://jakarta.apache.org/commons/daemon

It essentially allows you to start tomcat as a privileged user long
enough to grab the port and then drop back to a low privilege user for
general running.

--David

EDMOND KEMOKAI wrote:

 80 is a privileged port on *nix systems, you'll need to run tomcat as
 root
 (generally not recommended). May I ask why you're still running tomcat
 circa
 version 3?

 On 2/21/07, Frank Nguyen [EMAIL PROTECTED] wrote:


 Hi,



 We're still running 3.3.1 – We'd like to get rid of specifying the port
 8080
 in the http request like HYPERLINK
 http://www.something.com:8080/http://www.something.com:8080 and
 have it
 default to 80 (HYPERLINK http://www.somehting.com/;
 http://www.somehting.com
 only) but could not find any way. I tried to define port=80 in
 server.xml
 but tomcat threw exceptions. If you know a way, could you help ?



 Thanks in advance,





 Frank Nguyen


 -- 
 No virus found in this outgoing message.
 Checked by AVG Free Edition.
 Version: 7.5.441 / Virus Database: 268.18.1/691 - Release Date:
 2/17/2007
 5:06 PM



 -- 
 No virus found in this outgoing message.
 Checked by AVG Free Edition.
 Version: 7.5.441 / Virus Database: 268.18.1/691 - Release Date:
 2/17/2007
 5:06 PM





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



Re: Posting Xml

2007-02-21 Thread David Delbecq
Hi,
tomcat does not care what is in the body of request, it just look at url
to map it to a servlet and headers to create context and request
objects. The rest is entierly up to servlet to manager.

For your information, slide is a webdav servlet working under any J2EE
compliant webapp container that handles xml request from clients, and
there are also lots of webservices servlets around that take requests in
xml form


En l'instant précis du 02/21/07 16:17, Dima Retov s'exprimait en ces
termes:
 Hello,

 Is that good idea to POST XML data to Tomcat?

 I wish to make HTTP request to servlet in Tomcat.

 Method POST
 Content Type: text/xml

 Content would be non encoded XML file.

 Is it good idea in general. My tomcat handles such requests now.
 Is it expected that it will work in future?

 Is there any limitations? e.g. request.getParameter() - should
 parse GET parameters only.

   



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



Re: where to store user-generated files?

2007-02-21 Thread John Pedersen

I have something that works:

in web.xml:

servlet
servlet-nameimageServlet/servlet-name
servlet-classImageServlet/servlet-class
load-on-startup2/load-on-startup
/servlet

servlet-mapping
servlet-nameimageServlet/servlet-name
url-pattern/users/image/*/url-pattern
/servlet-mapping

Links to user images are like this:

img src=/starfriend/users/image/${match.thumbName}

( I am using Velocity )

and this is the servlet:

public class ImageServlet extends HttpServlet {

public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws IOException {

   String path = PhotoHandler.getUserImageDirectory();  
String pathInfo = req.getPathInfo();
String fileName = path + pathInfo;

   // Set content type
resp.setContentType(jpg);

// Set content size
File file = new File(fileName);
resp.setContentLength((int) file.length());
resp.setContentType(image/jpeg);

// Open the file and output streams
FileInputStream in = new FileInputStream(file);
OutputStream out = resp.getOutputStream();

// Copy the contents of the file to the output stream
FileCopyUtils.copy(in, out);
}

}

Image directory path is held in a properties file, which is held in
memory by a class called PhotoHandler - that is just the way I have it
- of course the path to the image folder could be an init parameter of
the servlet.

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



Help with tomcat installation

2007-02-21 Thread Pranathi


Note: forwarded message attached.

Speed is good only when wisdom leads the way. -James Poe
 
-
Don't be flakey. Get Yahoo! Mail for Mobile and 
always stay connected to friends.---BeginMessage---
Hi,
   
  I am a new user of tomcat. I have successfully downloaded tomcat 4.1.34 and 
installed it. Now when I try to startup the server using startup.bat, I see 
that a window flashes on my screen and the server doesnot startup. I tried 
starting the server from my command prompt as follows:
   
  C:\Tomcat\binstartup
C:\Tomcat\bin\catalina.bat
ECHO is off.
Using CATALINA_BASE:   C:\Tomcat
Using CATALINA_HOME:   C:\Tomcat
Using CATALINA_TMPDIR: C:\Tomcat\temp
Using JAVA_HOME:   C:\j2sdk1.4.2_10
C:\Tomcat\bin
   
  but still I see that a second window flashes with the above execution in my 
command prompt window and the server doesnot startup.
   
  Please help
   
  Thanks


Speed is good only when wisdom leads the way. -James Poe
 
-
Bored stiff? Loosen up...
Download and play hundreds of games for free on Yahoo! Games.---End Message---
-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: Get rid of 8080 port in Tomcat 3.3

2007-02-21 Thread Stefan

Frank Nguyen schrieb:

Hi,

 


We’re still running 3.3.1 – We’d like to get rid of specifying the port 8080
in the http request like HYPERLINK
http://www.something.com:8080/http://www.something.com:8080 and have it
default to 80 (HYPERLINK http://www.somehting.com/http://www.somehting.com
only) but could not find any way. I tried to define port=80 in server.xml
but tomcat threw exceptions. If you know a way, could you help ?

 


Thanks in advance,

 

 


Frank Nguyen


--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.441 / Virus Database: 268.18.1/691 - Release Date: 2/17/2007
5:06 PM



  

That's the way You should go:
http://www.linux.org.mt/article/tomcat-ports

We run several tomcat servers standalone with the combination of rinetd 
and iptables.


Good luck
Stefan

--

Stefan Riegel

TELIG GmbH


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



RE: Connection Pooling Question

2007-02-21 Thread Tim Lucia

 -Original Message-
 From: Marc Farrow [mailto:[EMAIL PROTECTED]
 Sent: Monday, February 19, 2007 3:56 PM
 To: tomcat-users
 Subject: Connection Pooling Question
 
 Slightly off topic, but the core of what I want is being done in the
 source
 code of Tomcat. I am trying to use the Apache Commons DBCP classes to
 create
 my own connection pooling factory that I can use within my servlet
 container
 (Tomcat) and also in stand alone programs.  I see how the Datasource that
 Tomcat creates when you use its connection pooling is put into a JNDI
 context, but I have scoured over the Tomcat source code and I have not
 been
 able to find the code that is actually doing the context bindings and
 where
 the information is being held.  Can someone point me in the right

I have done something similar, which may be helpful or of interest to you.
For our unit tests, I have used the standard JNDI jars from Tomcat
(naming-factory, naming-factory-dbcp, naming-resources) and in the
BaseTestCase (extends junit.framework.TestCase) I create and load the JNDI
context from a property file.

This allows the rest of the classes-under-test to function as if they were
running under the Tomcat container and allows for the regular and complete
JNDI lookup of all our DataSources.  I used to use the JavaRanch jndi helper
but it only supports a single DataSource.

I would be happy to share the code with anyone who may want it.  It's 200+
lines of code, and I wouldn't post the whole thing to the list, so send me
e-mail off-list if you want a copy.

 direction
 of the source code to review and also any advanced JNDI tutorials that
 teach you how to bind to a context that can be reused by external
 resources
 (meaning another JVM).

For one JVM to see or provide JNDI lookups for another would require a
network/port aware JNDI scheme.  I'm not aware of one, but wouldn't be
surprised if one exists either.

 
 Also, has anyone seen or done this type of solution before?
 
 Thank you,
 
 --
 Marc Farrow

Tim



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



Compiling mod-jk plugin for SunOne on Solaris

2007-02-21 Thread Kirk

There was a thread from February 1st on this same issue.  I am having the
same problem that person did, but I tried everything in the thread and still
no luck.

After I get mod_jk compiled I get this on server startup:

failure: CORE3170: Configuration initialization failed: Error running
init function load-modules:
dlopen of /wamu/hr/sunone/plugins/mod_jk/nsapi_redirector.so failed
(ld.so.1: webservd: fatal:
relocation error: file
/wamu/hr/sunone/plugins/mod_jk/nsapi_redirector.so: symbol __lshrdi3:
referenced symbol not found)


The one thing that I think is making a difference as compared to the person
in the earlier thread is that gcc is not installed on the server I am trying
to deploy on and I am not allowed to have it on there.  it is not an option,
don't ask.  I tried static linking, but I have a feeling I am doing it
wrong.

So, my question is, what exactly do I need to do to compile the mod_jk
plugin for SunOne on Solaris where it is to be deployed on a server that
does not have gcc installed at all?

Thanks,
Kirk


authentication security constraint error

2007-02-21 Thread Propes, Barry L [GCG-NAOT]
Hi,
 
I've been using versions 4.0 and 4.1.3 with a security constraint with no 
problems.
 
However, when I added info in my server.xml file to try and attempt DBCP, I get 
a warning in my logs about something being defined in in an auth-constraint 
without being in a security role. Maybe not too big a deal.
 
However, ever since I added the Resource Name and Params for the DBCP, I don't 
get challenged on the form to enter the password protected area, which in 
turn causes some other errors.
 
Does anyone know why adding that bit of configuration to the server.xml file 
would render the security constraint inoperable?
 
I'm open to feedback, let me know if more info's needed.
 
Thanks!

 
 
 
I've actually got the security constraint configured properly, as it's worked 
before with no issues.:
--
security-constraint
web-resource-collection
 web-resource-nameChange Control Protected 
Area/web-resource-name
 !-- Protect all files in the /murach/chngctrl/admin directory --
 url-pattern/chngctrl/admin/*/url-pattern
 url-pattern/chngctrl/change_ctrl_admin4.jsp/url-pattern
 url-pattern/chngctrl/chg_ctrl_adm_vote.jsp/url-pattern
 http-methodGET/http-method
 http-methodPOST/http-method
/web-resource-collection
auth-constraint
 !-- Users in the service and admin roles can access the admin dir 
 added several to match Change ctrl categs--
 role-nameservice/role-name
 role-nameadmin/role-name
 role-namecomply/role-name
 role-nameops/role-name
 role-namelegal/role-name
 role-namerisk/role-name
/auth-constraint
/security-constraint

 
Here's the log info:
 
2007-02-21 16:28:02 HostConfig[localhost]: Deploying web application directory 
murach
2007-02-21 16:28:02 StandardHost[localhost]: Installing web application at 
context path /murach from URL file:C:\jakarta-tomcat-4.1.31\webapps\murach
2007-02-21 16:28:02 WebappLoader[/murach]: Deploying class repositories to work 
directory C:\jakarta-tomcat-4.1.31\work\Standalone\localhost\murach
2007-02-21 16:28:02 WebappLoader[/murach]: Deploy class files /WEB-INF/classes 
to C:\jakarta-tomcat-4.1.31\webapps\murach\WEB-INF\classes
2007-02-21 16:28:02 WebappLoader[/murach]: Deploy JAR 
/WEB-INF/lib/mm.mysql-2.0.8-bin.jar to 
C:\jakarta-tomcat-4.1.31\webapps\murach\WEB-INF\lib\mm.mysql-2.0.8-bin.jar
2007-02-21 16:28:02 ContextConfig[/murach]: WARNING: Security role name service 
used in an auth-constraint without being defined in a security-role
2007-02-21 16:28:02 ContextConfig[/murach]: WARNING: Security role name admin 
used in an auth-constraint without being defined in a security-role
2007-02-21 16:28:02 ContextConfig[/murach]: WARNING: Security role name comply 
used in an auth-constraint without being defined in a security-role
2007-02-21 16:28:02 ContextConfig[/murach]: WARNING: Security role name ops 
used in an auth-constraint without being defined in a security-role
2007-02-21 16:28:02 ContextConfig[/murach]: WARNING: Security role name legal 
used in an auth-constraint without being defined in a security-role
2007-02-21 16:28:02 ContextConfig[/murach]: WARNING: Security role name risk 
used in an auth-constraint without being defined in a security-role
2007-02-21 16:28:02 ContextConfig[/murach]: Configured an authenticator for 
method FORM
2007-02-21 16:28:02 StandardManager[/murach]: Seeding random number generator 
class java.security.SecureRandom
2007-02-21 16:28:02 StandardManager[/murach]: Seeding of random number 
generator has been completed
2007-02-21 16:28:02 StandardWrapper[/murach:default]: Loading container servlet 
default
2007-02-21 16:28:02 default: init
2007-02-21 16:28:02 StandardWrapper[/murach:invoker]: Loading container servlet 
invoker
2007-02-21 16:28:02 invoker: init
2007-02-21 16:28:02 jsp: init
2007-02-21 16:28:02 HostConfig[localhost]: Deploying web application directory 
ROOT
 
-


RE: authentication security constraint error

2007-02-21 Thread Caldarale, Charles R
 From: Propes, Barry L [GCG-NAOT] 
 [mailto:[EMAIL PROTECTED] 
 Subject: authentication security constraint error
  
 However, when I added info in my server.xml file to try and 
 attempt DBCP, I get a warning in my logs about something 
 being defined in in an auth-constraint without being in a 
 security role. Maybe not too big a deal.

Read the servlet spec. A list of security-role elements is required in
the app's web.xml for an auth-constraint to be effective.

 - Chuck


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

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



RE: authentication security constraint error

2007-02-21 Thread Propes, Barry L [GCG-NAOT]
ok, thanks, Chuck.

-Original Message-
From: Caldarale, Charles R [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 21, 2007 5:02 PM
To: Tomcat Users List
Subject: RE: authentication security constraint error


 From: Propes, Barry L [GCG-NAOT] 
 [mailto:[EMAIL PROTECTED] 
 Subject: authentication security constraint error
  
 However, when I added info in my server.xml file to try and 
 attempt DBCP, I get a warning in my logs about something 
 being defined in in an auth-constraint without being in a 
 security role. Maybe not too big a deal.

Read the servlet spec. A list of security-role elements is required in
the app's web.xml for an auth-constraint to be effective.

 - Chuck


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

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


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



RE: authentication security constraint error

2007-02-21 Thread Propes, Barry L [GCG-NAOT]
Yeah, I had them in there.


-Original Message-
From: Caldarale, Charles R [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 21, 2007 5:02 PM
To: Tomcat Users List
Subject: RE: authentication security constraint error


 From: Propes, Barry L [GCG-NAOT] 
 [mailto:[EMAIL PROTECTED] 
 Subject: authentication security constraint error
  
 However, when I added info in my server.xml file to try and 
 attempt DBCP, I get a warning in my logs about something 
 being defined in in an auth-constraint without being in a 
 security role. Maybe not too big a deal.

Read the servlet spec. A list of security-role elements is required in
the app's web.xml for an auth-constraint to be effective.

 - Chuck


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

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


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



Re: Compiling mod-jk plugin for SunOne on Solaris

2007-02-21 Thread Rainer Jung
Option 1) (Quick and dirty): Deploy libgcc_s.so. It's *not* the
compiler. The lib contains some machine specific runtime routines, for
which appropriate machine statements are not available.

Option 2): Compiling statically. If you've got good control over the
compilation process you can add -static-libgcc to gcc as flags. If you
don't want to find out, where all the gcc compile flags are coming from
(configure, environment variables etc.) you can decide to make all
compiles using static libgcc by hacking a specs file.

a) dump a specs file by calling gcc -dumpspecs.

b) Edit the results and throw everything away except the block
beginneing with *libgcc. The exact structure depends on the gcc
version. Here is an example:

*libgcc:
%{static|static-libgcc:-lgcc
-lgcc_eh}%{!static:%{!static-libgcc:%{!shared:%{!shared-libgcc:-lgcc
-lgcc_eh}%{shared-libgcc:-lgcc_s -lgcc}}%{shared:-lgcc_s}}}

Caution: this is only two lines, the second one is pretty long.

Now edit to make gcc link against libgcc (this is the static version)
instead of libgcc_s (the shared one) even if it has been called to
produce a shared object. In our example the result would be:

%{static|static-libgcc:-lgcc
-lgcc_eh}%{!static:%{!static-libgcc:%{!shared:%{!shared-libgcc:-lgcc
-lgcc_eh}%{shared-libgcc:-lgcc -lgcc_eh}}%{shared:-lgcc -lgcc_eh}}}

Save this file, e.g. as /my/gcc.specs.

Then set the environment variable CC to gcc -specs=/my/gcc.specs and
start building. You can check the library dependencies of the resulting
*.so file by using ldd.

Good luck.

Regards,

Rainer

Kirk schrieb:
 There was a thread from February 1st on this same issue.  I am having the
 same problem that person did, but I tried everything in the thread and
 still
 no luck.
 
 After I get mod_jk compiled I get this on server startup:
 
 failure: CORE3170: Configuration initialization failed: Error running
 init function load-modules:
 dlopen of /wamu/hr/sunone/plugins/mod_jk/nsapi_redirector.so failed
 (ld.so.1: webservd: fatal:
 relocation error: file
 /wamu/hr/sunone/plugins/mod_jk/nsapi_redirector.so: symbol __lshrdi3:
 referenced symbol not found)
 
 
 The one thing that I think is making a difference as compared to the person
 in the earlier thread is that gcc is not installed on the server I am
 trying
 to deploy on and I am not allowed to have it on there.  it is not an
 option,
 don't ask.  I tried static linking, but I have a feeling I am doing it
 wrong.
 
 So, my question is, what exactly do I need to do to compile the mod_jk
 plugin for SunOne on Solaris where it is to be deployed on a server that
 does not have gcc installed at all?
 
 Thanks,
 Kirk
 

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



JVM per web App in Tomcat 5 possiable

2007-02-21 Thread jerrythenoob

Hi guys 
a noob question, my application uses a thrid-party native lib which will
bring down tomcat if the internet connectivity is lost after a couple of
attempts.  Is there a way to start another JVM for that web app alone ? or
does anyone have any suggestion for my situation ?  Thanks 
-- 
View this message in context: 
http://www.nabble.com/JVM-per-web-App-in-Tomcat-5-possiable-tf3269997.html#a9091456
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



RE: Get rid of 8080 port in Tomcat 3.3

2007-02-21 Thread Steffen Heil
Hi

 That's the way You should go:
 http://www.linux.org.mt/article/tomcat-ports

I totally disagree.
First, it would surely be best to update to 6.0 and run it using jsvc

However, let's look at the solution in the link above.

1. The Apache solution. (Which should be called the httpd solution.)
This will work, and might be okay, if you are already running apache on that
system.
BUT tomcat itself can be faster (at least newer ones, I don't know about
3.x) without httpd.

2. The IP tables solution
You webapplication will not know about the different port and encode urls
incorrecly. Bad Idea and impossible if SSL is required.

3. The rinetd solution
Good for development and tests. Adds a little overhead AND destroy a lot of
logging and security, as tomcat will always see ONE client ip.

4. IPchains alternative
see 2.

UPGRADE.
Otherwise get jsvc to work for you.

Regards,
  Steffen


smime.p7s
Description: S/MIME cryptographic signature


RE: authentication security constraint error

2007-02-21 Thread Caldarale, Charles R
 From: Propes, Barry L [GCG-NAOT] 
 [mailto:[EMAIL PROTECTED] 
 Subject: RE: authentication security constraint error
 
 Yeah, I had them in there.

Are they in the right order relative to the other elements?  The
web-app schema is rather picky about how things are arranged.  The
web.xml files for Tomcat's manager and admin apps server as good
examples.

 - Chuck


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

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



RE: authentication security constraint error

2007-02-21 Thread Propes, Barry L [GCG-NAOT]
now I'll double check that part. That could be an issue.

-Original Message-
From: Caldarale, Charles R [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 21, 2007 5:35 PM
To: Tomcat Users List
Subject: RE: authentication security constraint error


 From: Propes, Barry L [GCG-NAOT] 
 [mailto:[EMAIL PROTECTED] 
 Subject: RE: authentication security constraint error
 
 Yeah, I had them in there.

Are they in the right order relative to the other elements?  The
web-app schema is rather picky about how things are arranged.  The
web.xml files for Tomcat's manager and admin apps server as good
examples.

 - Chuck


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

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


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



RE: JVM per web App in Tomcat 5 possiable

2007-02-21 Thread Caldarale, Charles R
 From: jerrythenoob [mailto:[EMAIL PROTECTED] 
 Subject: JVM per web App in Tomcat 5 possiable
 
 my application uses a thrid-party native lib which will
 bring down tomcat if the internet connectivity is lost
 after a couple of attempts.

Hope you didn't pay money for that.

 Is there a way to start another JVM for that web app alone ?

You can run multiple Tomcat instances on the same box, but each will
require its own unique IP-address/port combination.  See the Advanced
Configuration section of RUNNING.txt in your Tomcat home directory for
details.

If you need to run multiple instances all with the same IP address and
port, you'll need something in front of them to dispatch requests to the
proper instance.  Apache httpd can do this, for example.

 - Chuck


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

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



RE: JVM per web App in Tomcat 5 possiable

2007-02-21 Thread Rutherford, Michael
I had a similar problem (native exceptions propagating out and killing
the JVM and thereby Tomcat). My quick and dirty solution was to wrap the
calls with a main() and run them as a separate java app in its own JVM.
Any problems therefore killed the subordinate JVM not the one running
Tomcat.

I'm sure there are better ways but I haven't had the luxury of time to
re-address this yet.

Michael Rutherfurd

-Original Message-
From: jerrythenoob [mailto:[EMAIL PROTECTED] 
Sent: Thursday, 22 February 2007 10:26 AM
To: users@tomcat.apache.org
Subject: JVM per web App in Tomcat 5 possiable


Hi guys 
a noob question, my application uses a thrid-party native lib which will
bring down tomcat if the internet connectivity is lost after a couple of
attempts.  Is there a way to start another JVM for that web app alone ?
or
does anyone have any suggestion for my situation ?  Thanks 
-- 
View this message in context:
http://www.nabble.com/JVM-per-web-App-in-Tomcat-5-possiable-tf3269997.ht
ml#a9091456
Sent from the Tomcat - User mailing list archive at Nabble.com.


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

** IMPORTANT MESSAGE *   
This e-mail message is intended only for the addressee(s) and contains 
information which may be
confidential. 
If you are not the intended recipient please advise the sender by return email, 
do not use or
disclose the contents, and delete the message and any attachments from your 
system. Unless
specifically indicated, this email does not constitute formal advice or 
commitment by the sender
or the Commonwealth Bank of Australia (ABN 48 123 123 124) or its subsidiaries. 
We can be contacted through our web site: commbank.com.au. 
If you no longer wish to receive commercial electronic messages from us, please 
reply to this
e-mail by typing Unsubscribe in the subject line. 
**



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



RE: Get rid of 8080 port in Tomcat 3.3

2007-02-21 Thread Frank Nguyen
Great article! Yes, this is the way to do it! Many thanks.

Frank Nguyen

-Original Message-
From: Stefan [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 21, 2007 10:43 AM
To: Tomcat Users List
Subject: Re: Get rid of 8080 port in Tomcat 3.3

Frank Nguyen schrieb:
 Hi,

  

 We’re still running 3.3.1 – We’d like to get rid of specifying the port
8080
 in the http request like HYPERLINK
 http://www.something.com:8080/http://www.something.com:8080 and have it
 default to 80 (HYPERLINK
http://www.somehting.com/http://www.somehting.com
 only) but could not find any way. I tried to define port=80 in server.xml
 but tomcat threw exceptions. If you know a way, could you help ?

  

 Thanks in advance,

  

  

 Frank Nguyen


 --
 No virus found in this outgoing message.
 Checked by AVG Free Edition.
 Version: 7.5.441 / Virus Database: 268.18.1/691 - Release Date: 2/17/2007
 5:06 PM



   
That's the way You should go:
http://www.linux.org.mt/article/tomcat-ports

We run several tomcat servers standalone with the combination of rinetd 
and iptables.

Good luck
Stefan

-- 

Stefan Riegel

TELIG GmbH


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

-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.441 / Virus Database: 268.18.1/691 - Release Date: 2/17/2007
5:06 PM
 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.441 / Virus Database: 268.18.1/691 - Release Date: 2/17/2007
5:06 PM
 



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



RE: JVM per web App in Tomcat 5 possiable

2007-02-21 Thread jerrythenoob

Thanks for the help : )  I'll try that 


Caldarale, Charles R wrote:
 
 From: jerrythenoob [mailto:[EMAIL PROTECTED] 
 Subject: JVM per web App in Tomcat 5 possiable
 
 my application uses a thrid-party native lib which will
 bring down tomcat if the internet connectivity is lost
 after a couple of attempts.
 
 Hope you didn't pay money for that.
 
 Is there a way to start another JVM for that web app alone ?
 
 You can run multiple Tomcat instances on the same box, but each will
 require its own unique IP-address/port combination.  See the Advanced
 Configuration section of RUNNING.txt in your Tomcat home directory for
 details.
 
 If you need to run multiple instances all with the same IP address and
 port, you'll need something in front of them to dispatch requests to the
 proper instance.  Apache httpd can do this, for example.
 
  - Chuck
 
 
 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
 MATERIAL and is thus for use only by the intended recipient. If you
 received this in error, please contact the sender and delete the e-mail
 and its attachments from all computers.
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/JVM-per-web-App-in-Tomcat-5-possiable-tf3269997.html#a9092113
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



RE: Maximum single threaded moldel servlets

2007-02-21 Thread Caldarale, Charles R
 From: James McIntosh [mailto:[EMAIL PROTECTED] 
 Subject: Maximum single threaded moldel servlets
 
 I am trying to find out how to limit the number of 
 Single Threaded Model servlets which get created by
 the StandardWrapper.

I suspect there's not much interest in this aspect of the servlet
environment these days, considering the following quote from section
2.2.1 of the 2.4 servlet spec:

The SingleThreadModel Interface is deprecated in this version of the
specification.

I don't know when it became deprecated, but it strikes me as a bit risky
to base an application architecture on such a capability.

 - Chuck


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

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



System property use in web.xml?

2007-02-21 Thread Martin . X . Zaidel

I've inherited a webapp which includes a system property reference (ie., 
region) in its web.xml (BTW, this context-param is used to lookup a 
Spring context file---e.g. /WEB-INF/jmsContext-eur.xml)

context-param
param-namecontextConfigLocation/param-name
param-value
/WEB-INF/jmsContext-${region}.xml,
/param-value
/context-param

When I deploy this webapp to Tomcat 5.5.12, and define a command-line 
system property with '-Dregion=eur' in catalina.sh, it works fine: the 
jmsContext-eur.xml file is found.

However, when I try to deploy this webapp to Websphere 6.0.x, even after 
defining a custom property for 'region' in the server profile, I get a:

java.io.FileNotFoundException: /WEB-INF/jmsContext-${region}.xml,

 when the server starts.

While my immediate problem is how to deploy the webapp to Websphere, my 
question to this group is this: Which component is responsible for this 
behaviour (the parsing of the web deployment descriptor and the 
substitution of the system property)?  Is it expected J2EE 1.4 
behaviour---ie., something I can complain to IBM about?

Thanks,

Martin 

National Australia Bank Ltd - ABN 12 004 044 937
This email may contain confidential information. If you are not the intended 
recipient, please immediately notify us at [EMAIL PROTECTED] or by replying to 
the sender, and then destroy all copies of this email. Except where this email 
indicates otherwise, views expressed in this email are those of the sender and 
not of National Australia Bank Ltd. Advice in this email does not take account 
of your objectives, financial situation, or needs. It is important for you to 
consider these matters and, if the e-mail refers to a product(s), you should 
read the relevant Product Disclosure Statement(s)/other disclosure document(s) 
before making any decisions. If you do not want email marketing from us in 
future, forward this email with unsubscribe in the subject line to [EMAIL 
PROTECTED] in order to stop marketing emails from this sender. National 
Australia Bank Ltd does not represent that this email is free of errors, 
viruses or interference.

How can I set tomcat 5.5 NOT Case Sensitive

2007-02-21 Thread mukesh sriwastava

Hello,

Sir i have a problem .
Actually i am using tomcat 5.5, and i want that when i run 
jsp file on the server it will be case insensitive.
  means case sensitive free.
as  when I write in browser's 'http://localhost/test.html'
equals to 'http://localhost/TEST.htm'. 
Can I do it ? 


Sir, i search this on the web like google
But they all said that to use
Context caseSensitive=false

  I have use this also, but i dont get any sollution
Sir please giv me whole information about above topic
in detail.

  Thanks !!

-- 
View this message in context: 
http://www.nabble.com/How-can-I-set-tomcat-5.5-NOT-Case-Sensitive-tf3270850.html#a9094007
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



Mysql timouts...

2007-02-21 Thread Jacob Rhoden
I am having the seemingly common Broken pipe to mysql problem with 
tomcat.


All i could find was some info about a maxideltime setting and 
idleconnectiontestperiod where can I find out info about tuning to 
make sure tomcat doesn't serve out stale database connections? The 
following settings don't seem to be doing the trick:


 Resource auth=Container name=jdbc/blah type=javax.sql.DataSource
 maxActive=5 removeAbandoned=true
 maxIdle=2 maxIdleTime=300 idleConnectionTestPeriod=60
 maxWait=1 username=blah password=blah
 driverClassName=com.mysql.jdbc.Driver 
url=jdbc:mysql://localhost:3306/blah?autoReconnect=trueamp;useUnicode=trueamp;characterEncoding=utf8/



Thanks guys.
Jacob

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



Re: System property use in web.xml?

2007-02-21 Thread Bill Barker

[EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]

 I've inherited a webapp which includes a system property reference (ie.,
 region) in its web.xml (BTW, this context-param is used to lookup a
 Spring context file---e.g. /WEB-INF/jmsContext-eur.xml)

context-param
param-namecontextConfigLocation/param-name
param-value
/WEB-INF/jmsContext-${region}.xml,
/param-value
/context-param

 When I deploy this webapp to Tomcat 5.5.12, and define a command-line
 system property with '-Dregion=eur' in catalina.sh, it works fine: the
 jmsContext-eur.xml file is found.

 However, when I try to deploy this webapp to Websphere 6.0.x, even after
 defining a custom property for 'region' in the server profile, I get a:

 java.io.FileNotFoundException: /WEB-INF/jmsContext-${region}.xml,

 when the server starts.

 While my immediate problem is how to deploy the webapp to Websphere, my
 question to this group is this: Which component is responsible for this
 behaviour (the parsing of the web deployment descriptor and the
 substitution of the system property)?  Is it expected J2EE 1.4
 behaviour---ie., something I can complain to IBM about?


I'm afraid that system property substitution is a Tomcat-specific feature. 
You can't rely on it working in any other Servlet Container.

 Thanks,

 Martin

 National Australia Bank Ltd - ABN 12 004 044 937
 This email may contain confidential information. If you are not the 
 intended recipient, please immediately notify us at [EMAIL PROTECTED] 
 or by replying to the sender, and then destroy all copies of this email. 
 Except where this email indicates otherwise, views expressed in this email 
 are those of the sender and not of National Australia Bank Ltd. Advice in 
 this email does not take account of your objectives, financial situation, 
 or needs. It is important for you to consider these matters and, if the 
 e-mail refers to a product(s), you should read the relevant Product 
 Disclosure Statement(s)/other disclosure document(s) before making any 
 decisions. If you do not want email marketing from us in future, forward 
 this email with unsubscribe in the subject line to 
 [EMAIL PROTECTED] in order to stop marketing emails from this 
 sender. National Australia Bank Ltd does not represent
  that this email is free of errors, viruses or interference. 




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



Pls help : How to make case insensitive URL(JSP) on Tomcat 5.5

2007-02-21 Thread Bhandari

Hi,

I have an intranet based JSP application on Tomcat 5.5. i have rolled it
out. but the problem my JSP application users are facing is ' URL of
application' is case sensetive.

CAN ANYBODY  TELL me a way to make my URL CASE INSENSITIVE?
I need a step by step guide.

Pls help.
Thanks and Regards,
Bhandari
-- 
View this message in context: 
http://www.nabble.com/Pls-help-%3A-How-to-make-case-insensitive-URL%28JSP%29-on-Tomcat-5.5-tf3271075.html#a9094670
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



RE: Pls help : How to make case insensitive URL(JSP) on Tomcat 5.5

2007-02-21 Thread Caldarale, Charles R
 From: Bhandari [mailto:[EMAIL PROTECTED] 
 Subject: Pls help : How to make case insensitive URL(JSP) on 
 Tomcat 5.5
 
 CAN ANYBODY  TELL me a way to make my URL CASE INSENSITIVE?
 I need a step by step guide.

Read the doc:
http://tomcat.apache.org/tomcat-5.5-doc/config/context.html

caseSensitive

If the value of this flag is true, all case sensitivity checks will be
disabled. If not specified, the default value of the flag is true.

NOTE: This flag MUST NOT be set to false on the Windows platform (or
any other OS which does not have a case sensitive filesystem), as it
will disable case sensitivity checks, allowing JSP source code
disclosure, among other security problems.

It's strongly recommended that you teach your users to type, since
case-sensitivity is mandated by the URI Generic Syntax document (RFC
3986) and the servlet spec.

 - Chuck


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

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



How can I realize server side GUI??

2007-02-21 Thread wang suya
 Hello

I want to make a server side GUI application that draw
senveral Rectanges and when mouse drag the bottom of Rectange, the rectange
extends. Do anybody know how I can realize this appication.

  Thank you at advance.

 Wang suya


wang suya

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