RE: FW: After manager says that there was a leak, how to use a profiler?

2010-11-17 Thread Brian
Solved: I had several contexts in my server, in each one was already a WAR
created days ago. I forgot about all these old WARs. Since I took off my
JARs from the shared/lib directory, all these old WARs could not work
because they didn't include the JARs inside. So basically I was trying to
run the new WAR and it worked, but I was still watching in the log the
output of the old WARs trying to deploy and work, but failing.

> -Original Message-
> From: Brian [mailto:bbprefix-m...@yahoo.com]
> Sent: Wednesday, November 17, 2010 11:35 PM
> To: 'Tomcat Users List'
> Subject: RE: FW: After manager says that there was a leak, how to use a
> profiler?
> 
> I have notices several weird things:
> 
> - Sometimes it runs, sometimes it doesn't
> - When I'm in Eclipse, if I already started the Tomcat server and it is
running, if
> I ask to run it again, it does without any error messages in the log
> 
> It looks like if it was a syncronization issue. Something like these: "If
nothing is
> running, it will wait when I ask it to start. But of something is already
running,
> maybe it will run. And if it did run before at least once, maybe it will
run next
> time I ask it". Makes sense?
> 
> 
> 
> 
> > -Original Message-
> > From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com]
> > Sent: Wednesday, November 17, 2010 06:46 PM
> > To: Tomcat Users List
> > Subject: RE: FW: After manager says that there was a leak, how to use
> > a profiler?
> >
> > > From: Brian [mailto:bbprefix-m...@yahoo.com]
> > > Subject: RE: FW: After manager says that there was a leak, how to
> > > use a
> > profiler?
> >
> > > It seems that the JARs inside "...WEB-INF/lib" are not being
> > > discovered or used.
> >
> > Hence the request to see your catalina.properties - which looks fine.
> What's
> > in the  elements for your webapps?  If you're using anything
> other
> > than the default (and implicit) , that might affect how class
> searching
> > is done.  Also, if you have anything in the system classpath at Tomcat
> startup,
> > that might also impact proceedings.
> >
> >  - Chuck
> >
> >
> > THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE
> > PROPRIETARY MATERIAL and is thus for use only by the intended recipient.
> If
> > you received this in error, please contact the sender and delete the
> e-mail and
> > its attachments from all computers.
> >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> > For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org


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



Re: Problem in accessing jsp:useBean

2010-11-17 Thread Karl San Gabriel
*Your code:

<%@ page import = "beans.*, java.sql.*"%>
*

I think the value for class should be "beans.PasswordEncryptService". Class
should be "package.class". That's what I remember.

or

http://java.sun.com/products/jsp/tags/syntaxref.fm14.html


On Thu, Nov 18, 2010 at 1:29 PM, Rekha Ravi Pai  wrote:

> users-digest-h...@tomcat.apache.org wrote:
>
> users Digest 15 Nov 2010 11:40:18 - Issue 10062
>
> Topics (messages 219005 through 219016):
>
> Re: Tomcat 6.0.29 using more and more RAM until it collapses?
>219005 by: Andr Warnier
>219010 by: Mark Thomas
>
> Re: 7.0.4 problem
>219006 by: Anthony J. Biacco
>
> Re: Using mod_jk in cluster environment responds HTTP 500
>219007 by: rikslovein
>219009 by: Andr Warnier
>219013 by: rikslovein
>
> Problem in accessing jsp:useBean
>219008 by: Rekha Ravi Pai
>219011 by: Mark Thomas
>
> Re: Shutting down one instance of tomcat 6 from a listener
>219012 by: Patrick Sauts
>
> Tomcat Going down Frequently
>219014 by: Amol Puglia
>219015 by: Andr Warnier
>219016 by: Pid
>
> Administrivia:
>
>
>
>
> Subject:
> Problem in accessing jsp:useBean
> From:
> Rekha Ravi Pai 
> Date:
> Mon, 15 Nov 2010 12:40:46 +0530
> To:
> users@tomcat.apache.org
> To:
> users@tomcat.apache.org
>
> Hi,
> I have installed tomcat-6.0.20 and postgresql-9.0.1
> I have created a java bean PasswordEncryptService.java
> I have kept it in WEB-INF/classes/beans directory and in beans package.
> I compiled the java file and successfully ran the class and could
> enter a data in a table in pgsql database.
> I have created a jsp file under webapps/apps/InfoMgmt/secure directory.
> In this jsp file I imported the PasswordEncryptService class and used
> the
> bean under the tag jsp:useBean. But I am getting the following error.
>
> The value for the useBean class attribute PasswordEncryptService is
> invalid.
>
>
> Can anybody please, help me in resolving this issue?
>
> Thanks and Regards,
> Rekha.
>
>
>
>
>
> Subject:
> Re: Problem in accessing jsp:useBean
> From:
> Mark Thomas 
> Date:
> Mon, 15 Nov 2010 09:04:37 +
> To:
> Tomcat Users List 
> To:
> Tomcat Users List 
>
> On 15/11/2010 07:10, Rekha Ravi Pai wrote:
>
>
> Hi,
> I have installed tomcat-6.0.20 and postgresql-9.0.1
> I have created a java bean PasswordEncryptService.java
> I have kept it in WEB-INF/classes/beans directory and in beans
> package.
> I compiled the java file and successfully ran the class and could
> enter a data in a table in pgsql database.
> I have created a jsp file under webapps/apps/InfoMgmt/secure
> directory.
> In this jsp file I imported the PasswordEncryptService class and
> used the
> bean under the tag jsp:useBean. But I am getting the following
> error.
>
> The value for the useBean class attribute PasswordEncryptService is
> invalid.
>
>
> Can anybody please, help me in resolving this issue?
>
>
>
> Not without you showing us the source for the simplest JSP and bean
> that
> recreates this issue.
>
> Mark
>
>
>
>
>
> PasswordEncryptService.java file I am giving below.
> I have placed this in the path
> /usr/local/apache-tomcat-6.0.20/webapps/apps/WEB-INF/classes/beans
>
> /// class to verify the password
> package beans;
>
> import java.security.NoSuchAlgorithmException;
> import java.io.*; //UnsupportedEncodingException;
> import java.security.MessageDigest;
> import org.apache.commons.codec.binary.Base64;
> import java.security.DigestOutputStream;
> import java.sql.*;
>
> public class PasswordEncryptService implements Serializable {
> private static final long serialVersionUID = 7526472295622776147L;
> Connection con;
> Statement stm ;
> ResultSet rs = null;
>
> public PasswordEncryptService (){
> try{
> Class.forName("org.postgresql.Driver");
> con =
> DriverManager.getConnection("jdbc:postgresql:employee_release","postgres",
> "");
> stm = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
> ResultSet.CONCUR_UPDATABLE);
> }
> catch (SQLException sqle ){
> sqle.printStackTrace();
> }
> catch (ClassNotFoundException cnfe  ) {
> cnfe.printStackTrace();
> }
>
> }
>
> private String getEncryptedString  (String rawString ) throws Exception
> {  /// encrypt the raw String using SHA algorithm
> String encryptedString = "";
> byte[] encoded = Base64.encodeBase64(rawString.getBytes());
>
> encryptedString = new String(encoded);
> return encryptedString;
> }
>
> public void writeNewPasswd(String username,String passwd)throws
> Exception { ///writing new passw

Re: Problem in accessing jsp:useBean

2010-11-17 Thread Rekha Ravi Pai

users-digest-h...@tomcat.apache.org wrote:

 users Digest 15 Nov 2010 11:40:18 - Issue 10062

 Topics (messages 219005 through 219016):

 Re: Tomcat 6.0.29 using more and more RAM until it collapses?
219005 by: Andr Warnier
219010 by: Mark Thomas

 Re: 7.0.4 problem
219006 by: Anthony J. Biacco

 Re: Using mod_jk in cluster environment responds HTTP 500
219007 by: rikslovein
219009 by: Andr Warnier
219013 by: rikslovein

 Problem in accessing jsp:useBean
219008 by: Rekha Ravi Pai
219011 by: Mark Thomas

 Re: Shutting down one instance of tomcat 6 from a listener
219012 by: Patrick Sauts

 Tomcat Going down Frequently
219014 by: Amol Puglia
219015 by: Andr Warnier
219016 by: Pid

 Administrivia:




 Subject:
 Problem in accessing jsp:useBean
 From:
 Rekha Ravi Pai 
 Date:
 Mon, 15 Nov 2010 12:40:46 +0530
 To:
 users@tomcat.apache.org
 To:
 users@tomcat.apache.org

 Hi,
 I have installed tomcat-6.0.20 and postgresql-9.0.1
 I have created a java bean PasswordEncryptService.java
 I have kept it in WEB-INF/classes/beans directory and in beans 
package.

 I compiled the java file and successfully ran the class and could
 enter a data in a table in pgsql database.
 I have created a jsp file under webapps/apps/InfoMgmt/secure 
directory.
 In this jsp file I imported the PasswordEncryptService class and used 
the

 bean under the tag jsp:useBean. But I am getting the following error.

 The value for the useBean class attribute PasswordEncryptService is 
invalid.



 Can anybody please, help me in resolving this issue?

 Thanks and Regards,
 Rekha.





 Subject:
 Re: Problem in accessing jsp:useBean
 From:
 Mark Thomas 
 Date:
 Mon, 15 Nov 2010 09:04:37 +
 To:
 Tomcat Users List 
 To:
 Tomcat Users List 

 On 15/11/2010 07:10, Rekha Ravi Pai wrote:


 Hi,
 I have installed tomcat-6.0.20 and postgresql-9.0.1
 I have created a java bean PasswordEncryptService.java
 I have kept it in WEB-INF/classes/beans directory and in beans 
package.

 I compiled the java file and successfully ran the class and could
 enter a data in a table in pgsql database.
 I have created a jsp file under webapps/apps/InfoMgmt/secure 
directory.
 In this jsp file I imported the PasswordEncryptService class and 
used the
 bean under the tag jsp:useBean. But I am getting the following 
error.


 The value for the useBean class attribute PasswordEncryptService 
is

 invalid.


 Can anybody please, help me in resolving this issue?



 Not without you showing us the source for the simplest JSP and bean 
that

 recreates this issue.

 Mark





PasswordEncryptService.java file I am giving below.
I have placed this in the path
/usr/local/apache-tomcat-6.0.20/webapps/apps/WEB-INF/classes/beans

/// class to verify the password
package beans;

import java.security.NoSuchAlgorithmException;
import java.io.*; //UnsupportedEncodingException;
import java.security.MessageDigest;
import org.apache.commons.codec.binary.Base64;
import java.security.DigestOutputStream;
import java.sql.*;

public class PasswordEncryptService implements Serializable {
 private static final long serialVersionUID = 7526472295622776147L;
 Connection con;
 Statement stm ;
 ResultSet rs = null;

 public PasswordEncryptService (){
 try{
 Class.forName("org.postgresql.Driver");
 con = 
DriverManager.getConnection("jdbc:postgresql:employee_release","postgres", 
"");
 stm = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, 
ResultSet.CONCUR_UPDATABLE);

 }
 catch (SQLException sqle ){
 sqle.printStackTrace();
 }
 catch (ClassNotFoundException cnfe  ) {
 cnfe.printStackTrace();
 }

 }

 private String getEncryptedString  (String rawString ) throws 
Exception {  /// encrypt the raw String using SHA algorithm

 String encryptedString = "";
 byte[] encoded = Base64.encodeBase64(rawString.getBytes());

 encryptedString = new String(encoded);
 return encryptedString;
 }

 public void writeNewPasswd(String username,String passwd)throws 
Exception { ///writing new password in case the password is forgotten

 String encryptedPasswd = "";
 try{
 encryptedPasswd = getEncryptedString(passwd);
 }
 catch(Exception e){

 e.toString();
 //System.out.println(e.toString());
 }
 String query = "insert into passwd_tbl values(\'"+username;
 query += "\',\'"+encryptedPasswd+"\')";
 try{
 int a = stm.executeUpdate(query);
 }catch

configuring the tomcat-6 to support list of user certificates

2010-11-17 Thread shashidhar v
Hi,

Can anyone give some idea to configure the tomcat-6.0.18 to enable SSL (
https ) and also to support the list of user certificates to access a sample
web application
I have the user certificate and also the CA certficate , I have checked the
docs of tomcat but i was not clear to configure it if we have both user and
CA certifcates

Thanks & Regards,
shashi


RE: FW: After manager says that there was a leak, how to use a profiler?

2010-11-17 Thread Brian
I have notices several weird things:

- Sometimes it runs, sometimes it doesn't
- When I'm in Eclipse, if I already started the Tomcat server and it is
running, if I ask to run it again, it does without any error messages in the
log

It looks like if it was a syncronization issue. Something like these: "If
nothing is running, it will wait when I ask it to start. But of something is
already running, maybe it will run. And if it did run before at least once,
maybe it will run next time I ask it". Makes sense?




> -Original Message-
> From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com]
> Sent: Wednesday, November 17, 2010 06:46 PM
> To: Tomcat Users List
> Subject: RE: FW: After manager says that there was a leak, how to use a
> profiler?
> 
> > From: Brian [mailto:bbprefix-m...@yahoo.com]
> > Subject: RE: FW: After manager says that there was a leak, how to use a
> profiler?
> 
> > It seems that the JARs inside "...WEB-INF/lib" are not being
> > discovered or used.
> 
> Hence the request to see your catalina.properties - which looks fine.
What's
> in the  elements for your webapps?  If you're using anything
other
> than the default (and implicit) , that might affect how class
searching
> is done.  Also, if you have anything in the system classpath at Tomcat
startup,
> that might also impact proceedings.
> 
>  - Chuck
> 
> 
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE
> PROPRIETARY MATERIAL and is thus for use only by the intended recipient.
If
> you received this in error, please contact the sender and delete the
e-mail and
> its attachments from all computers.
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org


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



Re: its never too soon to start a new career

2010-11-17 Thread kcole
If you only new.
--Original Message--
From: Ed _
To: tbott9...@aol.com
ReplyTo: Tomcat Users List
Subject: its never too soon to start a new career
Sent: Nov 17, 2010 10:15 PM

http://bit.ly/ctw5IG
  


Sent from my Verizon Wireless BlackBerry

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



RE: FW: After manager says that there was a leak, how to use a profiler?

2010-11-17 Thread Brian


> -Original Message-
> From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com]
> Sent: Wednesday, November 17, 2010 06:46 PM
> To: Tomcat Users List
> Subject: RE: FW: After manager says that there was a leak, how to use a
> profiler?
> 
> > From: Brian [mailto:bbprefix-m...@yahoo.com]
> > Subject: RE: FW: After manager says that there was a leak, how to use a
> profiler?
> 
> > It seems that the JARs inside "...WEB-INF/lib" are not being
> > discovered or used.
> 
> Hence the request to see your catalina.properties - which looks fine.
What's
> in the  elements for your webapps?  If you're using anything
other
> than the default (and implicit) , that might affect how class
searching
> is done.  Also, if you have anything in the system classpath at Tomcat
startup,
> that might also impact proceedings.
 

Inside the  there is nothing non-standard. Nothing about the loader
indeed. 
It doesn't work either in the Tomcat installation at my production server,
or the Tomcat local installation that my Eclipse uses when running the app.

One interesting thing is happening though. Now it is showing the error
messages in the log when I run it on Eclipse, but then IT WORKS!

This is the context that Eclipse generated for the app, that shows all the
error messages in the log:

   
  



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



RE: FW: After manager says that there was a leak, how to use a profiler?

2010-11-17 Thread Caldarale, Charles R
> From: Brian [mailto:bbprefix-m...@yahoo.com] 
> Subject: RE: FW: After manager says that there was a leak, how to use a 
> profiler?

> It seems that the JARs inside "...WEB-INF/lib" are not 
> being discovered or used.

Hence the request to see your catalina.properties - which looks fine.  What's 
in the  elements for your webapps?  If you're using anything other 
than the default (and implicit) , that might affect how class searching 
is done.  Also, if you have anything in the system classpath at Tomcat startup, 
that might also impact proceedings.

 - Chuck


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


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



RE: FW: After manager says that there was a leak, how to use a profiler?

2010-11-17 Thread Brian
> -Original Message-
> From: Pid [mailto:p...@pidster.com]
> Sent: Wednesday, November 17, 2010 04:02 PM
> To: Tomcat Users List
> Subject: Re: FW: After manager says that there was a leak, how to use a
> profiler?
> 
> On 17/11/2010 20:56, Brian wrote:
> > I will have to swallow my pride with this question. I bet this is a
> > very easy issue, but for some reason I haven't found an answer.
> > I moved my JARs from the ".../tomcat/shared/lib" directory to the
> > "web-inf/lib" directory in the app itself, but it seems that the JARs
> > there are not being discovered by Tomcat. This is what the log says:
> 
> WEB-INF/lib or web-inf/lib?

The first one, I made a mistake when typing the email.

 
> > Nov 17, 2010 3:46:56 PM org.apache.catalina.startup.Catalina load
> > INFO: Initialization processed in 730 ms Nov 17, 2010 3:46:56 PM
> > org.apache.catalina.core.StandardService start
> > INFO: Starting service Catalina
> > Nov 17, 2010 3:46:56 PM org.apache.catalina.core.StandardEngine start
> > INFO: Starting Servlet Engine: Apache Tomcat/6.0.29 Nov 17, 2010
> > 3:46:56 PM org.apache.catalina.startup.HostConfig deployWAR
> > INFO: Deploying web application archive ROOT.war Nov 17, 2010 3:46:56
> > PM org.apache.catalina.core.ApplicationContext log
> > INFO: Marking servlet action as unavailable Nov 17, 2010 3:46:56 PM
> > org.apache.catalina.core.ApplicationContext log
> > SEVERE: Error loading WebappClassLoader
> >   context:
> >   delegate: false
> >   repositories:
> > /WEB-INF/classes/
> 
> A war is a zip.  You can open it using a zip util, or the jar command, to
check
> that the files are actually where you think they are.
> 
> E.g. jar -tf ROOT.war

I did. All the files are where they should be, even the JAR files that are
in "WEB-INF/lib". The file expands correctly and all the files are being
placed where they should be.
It seems that the JARs inside "...WEB-INF/lib" are not being discovered or
used.


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



RE: After manager says that there was a leak, how to use a profiler?

2010-11-17 Thread Brian
Hi Chuck,

> -Original Message-
> From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com]
> Sent: Wednesday, November 17, 2010 04:02 PM
> To: Tomcat Users List
> Subject: RE: After manager says that there was a leak, how to use a
profiler?
> 
> > From: Brian [mailto:bbprefix-m...@yahoo.com]
> > Subject: FW: After manager says that there was a leak, how to use a
> profiler?
> 
> > I moved my JARs from the ".../tomcat/shared/lib" directory to the
> > "web-inf/lib" directory in the app itself
> 
> It better be WEB-INF/lib; case matters (even on Windows).

Yes, it is, I forgot to use the shift key.
 
> > it seems that the JARs there are not being discovered by Tomcat.
> 
> Access permissions?  (Not likely if you're starting with a .war file.)

That is not the problem, because as you said there is the WAR file that
expands, and other files there (.jsp for example) are reachable
 
> Did you remove the jars from the shared library?  (You must.)

Yes, I did, even though I read somewhere that if the JAR files are found in
"WEB-INF/lib", they are read from there before the "/shared/lib"
directory, if present at both places at the same time.
 
> What does your catalina.properties look like now?

Taking out the comments, now this is the content:
package.access=sun.,org.apache.catalina.,org.apache.coyote.,org.apache.tomca
t.,org.apache.jasper.,sun.beans.
package.definition=sun.,java.,org.apache.catalina.,org.apache.coyote.,org.ap
ache.tomcat.,org.apache.jasper.
common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.hom
e}/lib,${catalina.home}/lib/*.jar
server.loader=
shared.loader=
tomcat.util.buf.StringCache.byte.enabled=true


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



Re: [OT] How to obtain the id of the current process

2010-11-17 Thread Leon Rosenberg
On Wed, Nov 17, 2010 at 11:41 PM, André Warnier  wrote:
> Leon Rosenberg wrote:
>>
>> Pid, Andre
>> thanx.
>> I will try both approaches.
>> I will try the MX Bean first, this just seems to be more elegant ;)
>
> Typical Java thinking..
> Sure, let's pull in another 15 classes..
> Gotta use those GB of RAM for something..
> Why do simple when complicated would do just as well, he ?
> :-)

Well it will actually replace one line of code with another. In fact
the whole code will be shorter (reading of output etc).

>
> While you're at it, here is another variation of the original scheme, much
> more to my own liking :
> String[] cmd = { "/usr/bin/perl", "-e", "print getppid(),\"\\n\";" };
> p = Runtime.getRuntime().exec(cmd);
>
> Same defect as yours though, damn.
>
> Or (from the same jguru post) :
>
> String[] cmd = { "/bin/sh", "-c", "/bin/ps -f | /bin/awk '{print $2,$3}' |
> /bin/grep \"^$$\" | /bin/awk '{print $2}'" };
> p = Runtime.getRuntime().exec(cmd);
>

same fork problem.

> Now that one is not really elegant, but kind of .. macho ! 5 processes in a
> row, with pipes. Woaw.
>
> To get serious again, it /is/ funny that Java does not provide this simple
> function.

I assume that's because not each of the target platforms supports the
concept of a pid ;-)

> And somehow I have a feeling that there may be a catch somewhere when
> dealing with threads under various platforms.

threads? which threads?

> I prefer Konstantin's first suggestion.
> Now the question is : if Tomcat writes it's PID to that file, where does
> Tomcat get it from ?

The problem is, that I don't always run my processes in a tomcat, in
fact most of the time they don't (hence the OT).

>>> java -Dpid=$$ program.java
>>> and in the java program using the statement System.getProperty("pid");

this looks nice, but won't work without a script (aka start from eclipse).

thank you
regards
Leon

>
>
>>
>> thank you
>> Leon
>>
>> On Wed, Nov 17, 2010 at 10:50 PM, André Warnier  wrote:
>>>
>>> I found the following trick somewhere, maybe it works for you :
>>>
>>> When starting your JVM, use a line like
>>>
>>> java -Dpid=$$ program.java
>>> and in the java program using the statement System.getProperty("pid");
>>>
>>> If it works, it's cute, and certainly a lot less overhead.
>>>
>>> Credits : http://www.jguru.com/faq/view.jsp?EID=416212
>>> (last one)
>>>
>>> Leon Rosenberg wrote:

 Hi,

 I have a ugly issue I'm sure many people on this list already solved.
 For multiple purposes I need pid's of processes, to stop/start them or
 ensure they are running. So far nothing spectacular.
 To obtain the pid I have following util:

 String[] cmd = { "/bin/bash", "-c", "echo $PPID" };
 p = Runtime.getRuntime().exec(cmd);

 and afterwards read the ppid from the output stream of my process. So
 far - so good.

 The problem now occurs if a process has a lot of memory configured.
 Like 25Gb on a 32Gb machine. In such a configuration the above command
 fails with an OS'es out of memory, because fork
 fails to create another process with THAT amount of memory:

 1598388 2010-11-17 02:54:47,061 ERROR net.anotheria.util.PidTools -
 Could not determine PID: java.io.IOException: Cannot run program
 "/bin/bash": java.io.IOException: error=12, Cannot allocate memory

 Is there another method to obtain the process id from within the
 process?

 regards
 Leon

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


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

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



Re: [OT] How to obtain the id of the current process

2010-11-17 Thread Leon Rosenberg
On Thu, Nov 18, 2010 at 12:00 AM, Konstantin Kolinko
 wrote:
> I like the following:
>  int pid = Integer.parseInt( ( new
> File("/proc/self")).getCanonicalFile().getName() );

doesn't work on a mac ;-(

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



Re: [OT] How to obtain the id of the current process

2010-11-17 Thread Konstantin Kolinko
2010/11/18 André Warnier :
> I prefer Konstantin's first suggestion.
> Now the question is : if Tomcat writes it's PID to that file, where does
> Tomcat get it from ?
>

Look into catalina.sh

echo $! > "$CATALINA_PID"

(after spawning java as a background process)


BTW, from all methods listed in the comments on

[2] http://blog.igorminar.com/2007/03/how-java-application-can-discover-its.html

I like the following:
  int pid = Integer.parseInt( ( new
File("/proc/self")).getCanonicalFile().getName() );

There are others as well.

Best regards,
Konstantin Kolinko

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



Re: [OT] How to obtain the id of the current process

2010-11-17 Thread André Warnier

Leon Rosenberg wrote:

Pid, Andre
thanx.
I will try both approaches.
I will try the MX Bean first, this just seems to be more elegant ;)


Typical Java thinking..
Sure, let's pull in another 15 classes..
Gotta use those GB of RAM for something..
Why do simple when complicated would do just as well, he ?
:-)

While you're at it, here is another variation of the original scheme, much more to my own 
liking :

String[] cmd = { "/usr/bin/perl", "-e", "print getppid(),\"\\n\";" };
p = Runtime.getRuntime().exec(cmd);

Same defect as yours though, damn.

Or (from the same jguru post) :

String[] cmd = { "/bin/sh", "-c", "/bin/ps -f | /bin/awk '{print $2,$3}' | /bin/grep 
\"^$$\" | /bin/awk '{print $2}'" };

p = Runtime.getRuntime().exec(cmd);

Now that one is not really elegant, but kind of .. macho ! 5 processes in a row, with 
pipes. Woaw.


To get serious again, it /is/ funny that Java does not provide this simple 
function.
And somehow I have a feeling that there may be a catch somewhere when dealing with threads 
under various platforms.

I prefer Konstantin's first suggestion.
Now the question is : if Tomcat writes it's PID to that file, where does Tomcat 
get it from ?




thank you
Leon

On Wed, Nov 17, 2010 at 10:50 PM, André Warnier  wrote:

I found the following trick somewhere, maybe it works for you :

When starting your JVM, use a line like

java -Dpid=$$ program.java
and in the java program using the statement System.getProperty("pid");

If it works, it's cute, and certainly a lot less overhead.

Credits : http://www.jguru.com/faq/view.jsp?EID=416212
(last one)

Leon Rosenberg wrote:

Hi,

I have a ugly issue I'm sure many people on this list already solved.
For multiple purposes I need pid's of processes, to stop/start them or
ensure they are running. So far nothing spectacular.
To obtain the pid I have following util:

String[] cmd = { "/bin/bash", "-c", "echo $PPID" };
p = Runtime.getRuntime().exec(cmd);

and afterwards read the ppid from the output stream of my process. So
far - so good.

The problem now occurs if a process has a lot of memory configured.
Like 25Gb on a 32Gb machine. In such a configuration the above command
fails with an OS'es out of memory, because fork
fails to create another process with THAT amount of memory:

1598388 2010-11-17 02:54:47,061 ERROR net.anotheria.util.PidTools -
Could not determine PID: java.io.IOException: Cannot run program
"/bin/bash": java.io.IOException: error=12, Cannot allocate memory

Is there another method to obtain the process id from within the process?

regards
Leon

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




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




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





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



Re: [OT] How to obtain the id of the current process

2010-11-17 Thread Pid
On 17/11/2010 22:02, Konstantin Kolinko wrote:
> 2010/11/18 Leon Rosenberg :
>> Is there another method to obtain the process id from within the process?
> 
> Of Tomcat process, or of something else?
> 
> You can set $CATALINA_PID in your bin/setenv.sh, and Tomcat's PID will
> be written to that file.
> 
> 
> If you need it for something else, ... these are the two first results
> for 'java process PID' in Google::
> 
> [1] http://bugs.sun.com/view_bug.do?bug_id=4244896
> (an RFE asking for tis feature, you can vote for it)
> 
> [2] 
> http://blog.igorminar.com/2007/03/how-java-application-can-discover-its.html

So the first request for PID method was ~1999?
This is great progress.


But I guess it's probably more important to add Lambdas than to add a
useful method call to the language.  :s


p

> Best regards,
> Konstantin Kolinko
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 



0x62590808.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


RE: 7.0.4 problem

2010-11-17 Thread Anthony J. Biacco
I can confirm my thread issue is fixed in trunk (Revision 1036249) using
defaults.

-Tony
---
Manager, IT Operations
Format Dynamics, Inc.
P: 303-228-7327
F: 303-228-7305
abia...@formatdynamics.com
http://www.formatdynamics.com


> -Original Message-
> From: Anthony J. Biacco [mailto:abia...@formatdynamics.com]
> Sent: Sunday, November 14, 2010 4:54 PM
> To: Tomcat Users List
> Subject: RE: 7.0.4 problem
> 
> Thank you Mark, I'll test with 7.0.5 when it's available and report
> back.
> 
> -Tony
> ---
> Manager, IT Operations
> Format Dynamics, Inc.
> P: 303-228-7327
> F: 303-228-7305
> abia...@formatdynamics.com
> http://www.formatdynamics.com
> 
> 
> > -Original Message-
> > From: Mark Thomas [mailto:ma...@apache.org]
> > Sent: Saturday, November 13, 2010 5:27 AM
> > To: Tomcat Users List
> > Subject: Re: 7.0.4 problem
> >
> > On 13/11/2010 00:30, Anthony J. Biacco wrote:
> > >
> > > Centos 5.5 Linux x64
> > > Mysql connector j 5.1.13
> > > Tomcat 7.0.4 w/apr ajp
> > > Mysql cluster 7.1.3
> > > Jdk 1.6.0_21 x64
> > >
> > > Anybody aware of any problems with this combination? Using jmeter
to
> > load test my servlet, i see mysql threads held up indefinately until
i
> get a 'Too
> > many connections' error from mysql. Ajp threads all go back to
Waiting
> > according to visualvm.
> > >
> > > I have had no such problems with 7.0.2
> >
> > I think you have hit this:
> > https://issues.apache.org/bugzilla/show_bug.cgi?id=50159
> >
> > Technically, 7.0.4 is sticking to the letter of the J2EE spec but it
> > isn't what applications expect. 7.0.5 will revert to the previous
> > behaviour but with an configurable option for those folks who want
> their
> > resource factories to behave differently.
> >
> > Mark
> >
> >
-
> > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> > For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org


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



Re: [OT] How to obtain the id of the current process

2010-11-17 Thread Konstantin Kolinko
2010/11/18 Leon Rosenberg :
> Is there another method to obtain the process id from within the process?

Of Tomcat process, or of something else?

You can set $CATALINA_PID in your bin/setenv.sh, and Tomcat's PID will
be written to that file.


If you need it for something else, ... these are the two first results
for 'java process PID' in Google::

[1] http://bugs.sun.com/view_bug.do?bug_id=4244896
(an RFE asking for tis feature, you can vote for it)

[2] http://blog.igorminar.com/2007/03/how-java-application-can-discover-its.html



Best regards,
Konstantin Kolinko

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



RE: String index out of range when compilling a file

2010-11-17 Thread Noah, Craig [USA]
Specifically, are you sure that your String is not null?

-Original Message-
From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
Sent: Wednesday, November 17, 2010 10:42 AM
To: Tomcat Users List
Subject: Re: String index out of range when compilling a file

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

To whom it may concern,

On 11/17/2010 3:56 AM, rcabanas wrote:
> java.lang.StringIndexOutOfBoundsException: String index out of range: -1
> java.lang.String.substring(String.java:1937)
> java.lang.String.substring(String.java:1904)
> org.n52.wps.webadmin.ConfigUploadBean.compile(ConfigUploadBean.java:233)

To add to Mark's comment: this is not a problem with JSP compilation,
it's a problem with your JSP. The compiler is working correctly, your
code is not.

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

iEYEARECAAYFAkzkBdcACgkQ9CaO5/Lv0PDOuQCgjuxXN93qcxEt4jGcZ/OuI6N9
4s4An0tfxOKeUUT63Kmt1jFUHvZBr3LF
=Y7Aa
-END PGP SIGNATURE-

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



smime.p7s
Description: S/MIME cryptographic signature


RE: Tomcat hung

2010-11-17 Thread Caldarale, Charles R
> From: Robillard, Greg L [mailto:greg.l.robill...@lmco.com] 
> Subject: Tomcat hung

> JVM version is 10.0-b19

No idea what JVM that is; strongly suggest you install a real one (e.g., 6u22) 
and see if the problem goes away.

What happens if you run Tomcat directly, not under control of the IDE?

 - Chuck


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


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



Re: Tomcat hung

2010-11-17 Thread Pid
On 17/11/2010 21:50, Robillard, Greg L wrote:
> I continually get tomcat in this state and can only recover by restarting 
> tomcat from the command line.  Here is the stack trace that I gathered while 
> getting into this state, but it does not make any sense to me.

Production or testing?

Are these the only threads?

What happens if you jstack without attempting to connect a profiler?


p

> Tomcat version apache-tomcat-6.0.26
> 
> OS linux
> 
> Jstack trace on tomcat hang.
> Tomcat is not responding, nor any webapps.  Profiler will not attach
> 
> Attaching to process ID 21989, please wait...
> Debugger attached successfully.
> Server compiler detected.
> JVM version is 10.0-b19
> Deadlock Detection:
> 
> No deadlocks found.
> 
> Thread 15911: (state = BLOCKED)
> - 
> org.netbeans.lib.profiler.server.ProfilerRuntimeMemory.getAndSendCurrentStackTrace(char,
>  char, int, long) @bci=0, line=218 (Compiled frame)
> - 
> org.netbeans.lib.profiler.server.ProfilerRuntimeObjLiveness.traceObjAlloc(java.lang.Object,
>  char) @bci=158, line=278 (Compiled frame)
> - 
> java.io.ObjectInputStream$BlockDataInputStream.(java.io.ObjectInputStream,
>  java.io.InputStream) @bci=91, line=2359 (Interpreted frame)
> - java.io.ObjectInputStream.(java.io.InputStream) @bci=25, line=276 
> (Interpreted frame)
> - sun.rmi.server.MarshalInputStream.(java.io.InputStream) @bci=2, 
> line=107 (Interpreted frame)
> - sun.rmi.transport.ConnectionInputStream.(java.io.InputStream) @bci=2, 
> line=38 (Interpreted frame)
> - sun.rmi.transport.StreamRemoteCall.getInputStream() @bci=32, line=115 
> (Interpreted frame)
> - sun.rmi.transport.Transport.serviceCall(java.rmi.server.RemoteCall) @bci=1, 
> line=124 (Interpreted frame)
> - 
> sun.rmi.transport.tcp.TCPTransport.handleMessages(sun.rmi.transport.Connection,
>  boolean) @bci=217, line=541 (Compiled frame)
> - sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0() @bci=821, 
> line=810 (Interpreted frame)
> - sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run() @bci=58, 
> line=652 (Interpreted frame)
> - java.util.concurrent.ThreadPoolExecutor$Worker.runTask(java.lang.Runnable) 
> @bci=59, line=885 (Interpreted frame)
> - java.util.concurrent.ThreadPoolExecutor$Worker.run() @bci=28, line=907 
> (Interpreted frame)
> - java.lang.Thread.run() @bci=11, line=619 (Interpreted frame)
> 
> 
> Thread 12244: (state = BLOCKED)
> - 
> org.netbeans.lib.profiler.server.ProfilerRuntimeMemory.getAndSendCurrentStackTrace(char,
>  char, int, long) @bci=0, line=218 (Compiled frame)
> - 
> org.netbeans.lib.profiler.server.ProfilerRuntimeObjLiveness.traceObjAlloc(java.lang.Object,
>  char) @bci=158, line=278 (Compiled frame)
> - 
> java.io.ObjectInputStream$BlockDataInputStream.(java.io.ObjectInputStream,
>  java.io.InputStream) @bci=91, line=2359 (Interpreted frame)
> - java.io.ObjectInputStream.(java.io.InputStream) @bci=25, line=276 
> (Interpreted frame)
> - sun.rmi.server.MarshalInputStream.(java.io.InputStream) @bci=2, 
> line=107 (Interpreted frame)
> - sun.rmi.transport.ConnectionInputStream.(java.io.InputStream) @bci=2, 
> line=38 (Interpreted frame)
> - sun.rmi.transport.StreamRemoteCall.getInputStream() @bci=32, line=115 
> (Interpreted frame)
> - sun.rmi.transport.Transport.serviceCall(java.rmi.server.RemoteCall) @bci=1, 
> line=124 (Interpreted frame)
> - 
> sun.rmi.transport.tcp.TCPTransport.handleMessages(sun.rmi.transport.Connection,
>  boolean) @bci=217, line=541 (Compiled frame)
> - sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0() @bci=821, 
> line=810 (Interpreted frame)
> - sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run() @bci=58, 
> line=652 (Interpreted frame)
> - java.util.concurrent.ThreadPoolExecutor$Worker.runTask(java.lang.Runnable) 
> @bci=59, line=885 (Interpreted frame)
> - java.util.concurrent.ThreadPoolExecutor$Worker.run() @bci=28, line=907 
> (Interpreted frame)
> - java.lang.Thread.run() @bci=11, line=619 (Interpreted frame)
> 
> 
> Thread 22760: (state = BLOCKED)
> - java.lang.Object.wait(long) @bci=0 (Interpreted frame)
> - java.lang.Object.wait() @bci=2, line=485 (Interpreted frame)
> - java.util.TimerThread.mainLoop() @bci=28, line=483 (Interpreted frame)
> - java.util.TimerThread.run() @bci=1, line=462 (Interpreted frame)
> 
> 
> Thread 3343: (state = BLOCKED)
> - 
> org.netbeans.lib.profiler.server.ProfilerRuntimeMemory.getAndSendCurrentStackTrace(char,
>  char, int, long) @bci=0, line=218 (Compiled frame)
> - 
> org.netbeans.lib.profiler.server.ProfilerRuntimeObjLiveness.traceObjAlloc(java.lang.Object,
>  char) @bci=158, line=278 (Compiled frame)
> - java.lang.String.valueOf(char[]) @bci=12, line=2841 (Interpreted frame)
> - java.lang.Thread.getName() @bci=4, line=1061 (Interpreted frame)
> - 
> org.apache.catalina.connector.CoyoteAdapter.service(org.apache.coyote.Request,
>  org.apache.coyote.Response) @bci=120, line=295 (Interpreted frame)
> - org.apache.coyote.http11.Http11Processor.process(java.net.Socket) @bci=468, 
> line=852 (

Re: [OT] How to obtain the id of the current process

2010-11-17 Thread Leon Rosenberg
Pid, Andre
thanx.
I will try both approaches.
I will try the MX Bean first, this just seems to be more elegant ;)

thank you
Leon

On Wed, Nov 17, 2010 at 10:50 PM, André Warnier  wrote:
> I found the following trick somewhere, maybe it works for you :
>
> When starting your JVM, use a line like
>
> java -Dpid=$$ program.java
> and in the java program using the statement System.getProperty("pid");
>
> If it works, it's cute, and certainly a lot less overhead.
>
> Credits : http://www.jguru.com/faq/view.jsp?EID=416212
> (last one)
>
> Leon Rosenberg wrote:
>>
>> Hi,
>>
>> I have a ugly issue I'm sure many people on this list already solved.
>> For multiple purposes I need pid's of processes, to stop/start them or
>> ensure they are running. So far nothing spectacular.
>> To obtain the pid I have following util:
>>
>> String[] cmd = { "/bin/bash", "-c", "echo $PPID" };
>> p = Runtime.getRuntime().exec(cmd);
>>
>> and afterwards read the ppid from the output stream of my process. So
>> far - so good.
>>
>> The problem now occurs if a process has a lot of memory configured.
>> Like 25Gb on a 32Gb machine. In such a configuration the above command
>> fails with an OS'es out of memory, because fork
>> fails to create another process with THAT amount of memory:
>>
>> 1598388 2010-11-17 02:54:47,061 ERROR net.anotheria.util.PidTools -
>> Could not determine PID: java.io.IOException: Cannot run program
>> "/bin/bash": java.io.IOException: error=12, Cannot allocate memory
>>
>> Is there another method to obtain the process id from within the process?
>>
>> regards
>> Leon
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

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



Tomcat hung

2010-11-17 Thread Robillard, Greg L
I continually get tomcat in this state and can only recover by restarting 
tomcat from the command line.  Here is the stack trace that I gathered while 
getting into this state, but it does not make any sense to me.

Tomcat version apache-tomcat-6.0.26

OS linux

Jstack trace on tomcat hang.
Tomcat is not responding, nor any webapps.  Profiler will not attach

Attaching to process ID 21989, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 10.0-b19
Deadlock Detection:

No deadlocks found.

Thread 15911: (state = BLOCKED)
- 
org.netbeans.lib.profiler.server.ProfilerRuntimeMemory.getAndSendCurrentStackTrace(char,
 char, int, long) @bci=0, line=218 (Compiled frame)
- 
org.netbeans.lib.profiler.server.ProfilerRuntimeObjLiveness.traceObjAlloc(java.lang.Object,
 char) @bci=158, line=278 (Compiled frame)
- 
java.io.ObjectInputStream$BlockDataInputStream.(java.io.ObjectInputStream,
 java.io.InputStream) @bci=91, line=2359 (Interpreted frame)
- java.io.ObjectInputStream.(java.io.InputStream) @bci=25, line=276 
(Interpreted frame)
- sun.rmi.server.MarshalInputStream.(java.io.InputStream) @bci=2, 
line=107 (Interpreted frame)
- sun.rmi.transport.ConnectionInputStream.(java.io.InputStream) @bci=2, 
line=38 (Interpreted frame)
- sun.rmi.transport.StreamRemoteCall.getInputStream() @bci=32, line=115 
(Interpreted frame)
- sun.rmi.transport.Transport.serviceCall(java.rmi.server.RemoteCall) @bci=1, 
line=124 (Interpreted frame)
- 
sun.rmi.transport.tcp.TCPTransport.handleMessages(sun.rmi.transport.Connection, 
boolean) @bci=217, line=541 (Compiled frame)
- sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0() @bci=821, 
line=810 (Interpreted frame)
- sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run() @bci=58, line=652 
(Interpreted frame)
- java.util.concurrent.ThreadPoolExecutor$Worker.runTask(java.lang.Runnable) 
@bci=59, line=885 (Interpreted frame)
- java.util.concurrent.ThreadPoolExecutor$Worker.run() @bci=28, line=907 
(Interpreted frame)
- java.lang.Thread.run() @bci=11, line=619 (Interpreted frame)


Thread 12244: (state = BLOCKED)
- 
org.netbeans.lib.profiler.server.ProfilerRuntimeMemory.getAndSendCurrentStackTrace(char,
 char, int, long) @bci=0, line=218 (Compiled frame)
- 
org.netbeans.lib.profiler.server.ProfilerRuntimeObjLiveness.traceObjAlloc(java.lang.Object,
 char) @bci=158, line=278 (Compiled frame)
- 
java.io.ObjectInputStream$BlockDataInputStream.(java.io.ObjectInputStream,
 java.io.InputStream) @bci=91, line=2359 (Interpreted frame)
- java.io.ObjectInputStream.(java.io.InputStream) @bci=25, line=276 
(Interpreted frame)
- sun.rmi.server.MarshalInputStream.(java.io.InputStream) @bci=2, 
line=107 (Interpreted frame)
- sun.rmi.transport.ConnectionInputStream.(java.io.InputStream) @bci=2, 
line=38 (Interpreted frame)
- sun.rmi.transport.StreamRemoteCall.getInputStream() @bci=32, line=115 
(Interpreted frame)
- sun.rmi.transport.Transport.serviceCall(java.rmi.server.RemoteCall) @bci=1, 
line=124 (Interpreted frame)
- 
sun.rmi.transport.tcp.TCPTransport.handleMessages(sun.rmi.transport.Connection, 
boolean) @bci=217, line=541 (Compiled frame)
- sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0() @bci=821, 
line=810 (Interpreted frame)
- sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run() @bci=58, line=652 
(Interpreted frame)
- java.util.concurrent.ThreadPoolExecutor$Worker.runTask(java.lang.Runnable) 
@bci=59, line=885 (Interpreted frame)
- java.util.concurrent.ThreadPoolExecutor$Worker.run() @bci=28, line=907 
(Interpreted frame)
- java.lang.Thread.run() @bci=11, line=619 (Interpreted frame)


Thread 22760: (state = BLOCKED)
- java.lang.Object.wait(long) @bci=0 (Interpreted frame)
- java.lang.Object.wait() @bci=2, line=485 (Interpreted frame)
- java.util.TimerThread.mainLoop() @bci=28, line=483 (Interpreted frame)
- java.util.TimerThread.run() @bci=1, line=462 (Interpreted frame)


Thread 3343: (state = BLOCKED)
- 
org.netbeans.lib.profiler.server.ProfilerRuntimeMemory.getAndSendCurrentStackTrace(char,
 char, int, long) @bci=0, line=218 (Compiled frame)
- 
org.netbeans.lib.profiler.server.ProfilerRuntimeObjLiveness.traceObjAlloc(java.lang.Object,
 char) @bci=158, line=278 (Compiled frame)
- java.lang.String.valueOf(char[]) @bci=12, line=2841 (Interpreted frame)
- java.lang.Thread.getName() @bci=4, line=1061 (Interpreted frame)
- 
org.apache.catalina.connector.CoyoteAdapter.service(org.apache.coyote.Request, 
org.apache.coyote.Response) @bci=120, line=295 (Interpreted frame)
- org.apache.coyote.http11.Http11Processor.process(java.net.Socket) @bci=468, 
line=852 (Interpreted frame)
- 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(java.net.Socket)
 @bci=82, line=588 (Interpreted frame)
- org.apache.tomcat.util.net.JIoEndpoint$Worker.run() @bci=41, line=489 
(Interpreted frame)
- java.lang.Thread.run() @bci=11, line=619 (Interpreted frame)


Thread 3255: (state = BLOCKED)
- java.lang.Object.wait(long) @bci=0 (Interprete

Re: [OT] How to obtain the id of the current process

2010-11-17 Thread André Warnier

I found the following trick somewhere, maybe it works for you :

When starting your JVM, use a line like

java -Dpid=$$ program.java
and in the java program using the statement System.getProperty("pid");

If it works, it's cute, and certainly a lot less overhead.

Credits : http://www.jguru.com/faq/view.jsp?EID=416212
(last one)

Leon Rosenberg wrote:

Hi,

I have a ugly issue I'm sure many people on this list already solved.
For multiple purposes I need pid's of processes, to stop/start them or
ensure they are running. So far nothing spectacular.
To obtain the pid I have following util:

String[] cmd = { "/bin/bash", "-c", "echo $PPID" };
p = Runtime.getRuntime().exec(cmd);

and afterwards read the ppid from the output stream of my process. So
far - so good.

The problem now occurs if a process has a lot of memory configured.
Like 25Gb on a 32Gb machine. In such a configuration the above command
fails with an OS'es out of memory, because fork
fails to create another process with THAT amount of memory:

1598388 2010-11-17 02:54:47,061 ERROR net.anotheria.util.PidTools -
Could not determine PID: java.io.IOException: Cannot run program
"/bin/bash": java.io.IOException: error=12, Cannot allocate memory

Is there another method to obtain the process id from within the process?

regards
Leon

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





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



Re: [OT] How to obtain the id of the current process

2010-11-17 Thread Pid
On 17/11/2010 21:30, Leon Rosenberg wrote:
> Hi,
> 
> I have a ugly issue I'm sure many people on this list already solved.
> For multiple purposes I need pid's of processes, to stop/start them or
> ensure they are running. So far nothing spectacular.
> To obtain the pid I have following util:
> 
> String[] cmd = { "/bin/bash", "-c", "echo $PPID" };
> p = Runtime.getRuntime().exec(cmd);
> 
> and afterwards read the ppid from the output stream of my process. So
> far - so good.
> 
> The problem now occurs if a process has a lot of memory configured.
> Like 25Gb on a 32Gb machine. In such a configuration the above command
> fails with an OS'es out of memory, because fork
> fails to create another process with THAT amount of memory:
> 
> 1598388 2010-11-17 02:54:47,061 ERROR net.anotheria.util.PidTools -
> Could not determine PID: java.io.IOException: Cannot run program
> "/bin/bash": java.io.IOException: error=12, Cannot allocate memory
> 
> Is there another method to obtain the process id from within the process?

I'm not sure I entirely understand the context, but if it's a Java 5+
process: ManagementFactory.getRuntimeMXBean().getName() will return
@.

Are you trying to determine the PID of a new process, or the current one?


p

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



0x62590808.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


[OT] How to obtain the id of the current process

2010-11-17 Thread Leon Rosenberg
Hi,

I have a ugly issue I'm sure many people on this list already solved.
For multiple purposes I need pid's of processes, to stop/start them or
ensure they are running. So far nothing spectacular.
To obtain the pid I have following util:

String[] cmd = { "/bin/bash", "-c", "echo $PPID" };
p = Runtime.getRuntime().exec(cmd);

and afterwards read the ppid from the output stream of my process. So
far - so good.

The problem now occurs if a process has a lot of memory configured.
Like 25Gb on a 32Gb machine. In such a configuration the above command
fails with an OS'es out of memory, because fork
fails to create another process with THAT amount of memory:

1598388 2010-11-17 02:54:47,061 ERROR net.anotheria.util.PidTools -
Could not determine PID: java.io.IOException: Cannot run program
"/bin/bash": java.io.IOException: error=12, Cannot allocate memory

Is there another method to obtain the process id from within the process?

regards
Leon

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



Re: FW: After manager says that there was a leak, how to use a profiler?

2010-11-17 Thread Pid
On 17/11/2010 20:56, Brian wrote:
> I will have to swallow my pride with this question. I bet this is a very
> easy issue, but for some reason I haven't found an answer.
> I moved my JARs from the ".../tomcat/shared/lib" directory to the
> "web-inf/lib" directory in the app itself, but it seems that the JARs there
> are not being discovered by Tomcat. This is what the log says:

WEB-INF/lib or web-inf/lib?

> Nov 17, 2010 3:46:56 PM org.apache.catalina.startup.Catalina load
> INFO: Initialization processed in 730 ms
> Nov 17, 2010 3:46:56 PM org.apache.catalina.core.StandardService start
> INFO: Starting service Catalina
> Nov 17, 2010 3:46:56 PM org.apache.catalina.core.StandardEngine start
> INFO: Starting Servlet Engine: Apache Tomcat/6.0.29
> Nov 17, 2010 3:46:56 PM org.apache.catalina.startup.HostConfig deployWAR
> INFO: Deploying web application archive ROOT.war
> Nov 17, 2010 3:46:56 PM org.apache.catalina.core.ApplicationContext log
> INFO: Marking servlet action as unavailable
> Nov 17, 2010 3:46:56 PM org.apache.catalina.core.ApplicationContext log
> SEVERE: Error loading WebappClassLoader
>   context: 
>   delegate: false
>   repositories:
> /WEB-INF/classes/

A war is a zip.  You can open it using a zip util, or the jar command,
to check that the files are actually where you think they are.

E.g. jar -tf ROOT.war


p
> --> Parent Classloader:
> org.apache.catalina.loader.standardclassloa...@2eb0a3f5
>  org.apache.struts.action.ActionServlet
> java.lang.ClassNotFoundException: org.apache.struts.action.ActionServlet
>   at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
> a:1645)
>   at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
> a:1491)
>   at
> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:10
> 95)
>   at
> org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
>   at
> org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:
> 4350)
>   at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4659)
>   at
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:7
> 91)
>   at
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
>   at
> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
>   at
> org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:905)
>   at
> org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:740)
>   at
> org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:500)
>   at
> org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
>   at
> org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
>   at
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSuppor
> t.java:119)
>   at
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
>   at
> org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
>   at
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
>   at
> org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
>   at
> org.apache.catalina.core.StandardService.start(StandardService.java:519)
>   at
> org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
>   at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
> )
>   at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
> .java:25)
>   at java.lang.reflect.Method.invoke(Method.java:597)
>   at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
>   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
> Nov 17, 2010 3:46:56 PM org.apache.catalina.core.StandardContext
> loadOnStartup
> SEVERE: Servlet  threw load() exception
> java.lang.ClassNotFoundException: org.apache.struts.action.ActionServlet
>   at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
> a:1645)
>   at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
> a:1491)
>   at
> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:10
> 95)
>   at
> org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
>   at
> org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:
> 4350)
>   at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4659)
>   at
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:7
> 91)
>   at
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
>   at
> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
>  

RE: After manager says that there was a leak, how to use a profiler?

2010-11-17 Thread Caldarale, Charles R
> From: Brian [mailto:bbprefix-m...@yahoo.com] 
> Subject: FW: After manager says that there was a leak, how to use a profiler?

> I moved my JARs from the ".../tomcat/shared/lib" directory to the
> "web-inf/lib" directory in the app itself

It better be WEB-INF/lib; case matters (even on Windows).

> it seems that the JARs there are not being discovered by Tomcat.

Access permissions?  (Not likely if you're starting with a .war file.)

Did you remove the jars from the shared library?  (You must.)

What does your catalina.properties look like now?

 - Chuck


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



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



FW: After manager says that there was a leak, how to use a profiler?

2010-11-17 Thread Brian
I will have to swallow my pride with this question. I bet this is a very
easy issue, but for some reason I haven't found an answer.
I moved my JARs from the ".../tomcat/shared/lib" directory to the
"web-inf/lib" directory in the app itself, but it seems that the JARs there
are not being discovered by Tomcat. This is what the log says:


Nov 17, 2010 3:46:56 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 730 ms
Nov 17, 2010 3:46:56 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Nov 17, 2010 3:46:56 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.29
Nov 17, 2010 3:46:56 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive ROOT.war
Nov 17, 2010 3:46:56 PM org.apache.catalina.core.ApplicationContext log
INFO: Marking servlet action as unavailable
Nov 17, 2010 3:46:56 PM org.apache.catalina.core.ApplicationContext log
SEVERE: Error loading WebappClassLoader
  context: 
  delegate: false
  repositories:
/WEB-INF/classes/
--> Parent Classloader:
org.apache.catalina.loader.standardclassloa...@2eb0a3f5
 org.apache.struts.action.ActionServlet
java.lang.ClassNotFoundException: org.apache.struts.action.ActionServlet
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
a:1645)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
a:1491)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:10
95)
at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:
4350)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4659)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:7
91)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
at
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:905)
at
org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:740)
at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:500)
at
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSuppor
t.java:119)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at
org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
at
org.apache.catalina.core.StandardService.start(StandardService.java:519)
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Nov 17, 2010 3:46:56 PM org.apache.catalina.core.StandardContext
loadOnStartup
SEVERE: Servlet  threw load() exception
java.lang.ClassNotFoundException: org.apache.struts.action.ActionServlet
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
a:1645)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
a:1491)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:10
95)
at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:
4350)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4659)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:7
91)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
at
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:905)
at
org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:740)
at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:500)
at
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
at
org.apache.catalina.startup.HostConfig.li

RE: After manager says that there was a leak, how to use a profiler?

2010-11-17 Thread Brian
I'm doing it, thanks!

> -Original Message-
> From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com]
> Sent: Tuesday, November 16, 2010 04:27 PM
> To: Tomcat Users List
> Subject: RE: After manager says that there was a leak, how to use a
profiler?
> 
> > From: Brian [mailto:bbprefix-m...@yahoo.com]
> > Subject: RE: After manager says that there was a leak, how to use a
profiler?
> 
> > All my JARs are in the shared directory that Tomcat has.
> > Is that a problem?
> 
> Yes, that's a problem.  You very likely have some references in the shared
> classes that point to objects of one webapp or the other - and that will
> prevent their every being garbage collected.
> 
> Put the jars where they belong - in each webapp's WEB-INF/lib directory.
Disk
> is cheap, instability isn't.
> 
>  - Chuck
> 
> 
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE
> PROPRIETARY MATERIAL and is thus for use only by the intended recipient.
If
> you received this in error, please contact the sender and delete the
e-mail and
> its attachments from all computers.
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org


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



Re: Request count increases drastically in tomcat 6.0.29

2010-11-17 Thread Pid
On 17/11/2010 13:51, rujin raj wrote:
> s it the normal for any application to keeps increasing the request count.

Yes, if either the number of users is increasing, or you are counting
cumulative requests.


p


0x62590808.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


Re: WEB Application need to upload a txt / csv file with 100K records

2010-11-17 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Karthik,

On 11/17/2010 7:41 AM, Karthik Nanjangude wrote:
> JDK1.5

Upgrade.

> WEB SERVER : TOMCAT 5.0.20

Upgrade.

> Logged Session Time
> 
> An module of our WEB Application need to upload a txt / csv file 
> with 100K records. These Records are to be validated with certain
> checks in the Business layer..Before the pumped to a PLSQL of Oracle
> DB The process has to further Waite for the response of Errors from 
> PLSQL and has to be displayed on the JSP Screen.

Maybe a web application/service isn't appropriate for this type of
thing. Perhaps the web service could be used to /submit/ jobs like this,
but post-processing reporting should be done in another way: JMX
message, email, FTP, etc.

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

iEUEARECAAYFAkzkHnEACgkQ9CaO5/Lv0PAn3gCY6foyFT2wmDOQMaUozSvu/7UB
OgCfU6YgXe2BfPWZF3VF3NjM1Unk398=
=oyxT
-END PGP SIGNATURE-

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



Re: Change the class loading of tomcat 6.0.29 to child-first

2010-11-17 Thread Mark Thomas
On 17/11/2010 16:44, Alberto Bugna wrote:
> Hi Mark
> 
> Thanks for responding.
> 
> Let's make an example.
> 
> Suppose I have two libraries that implement the same functionality. The only
> differ for example for the version.
> Suppose my web app uses that kind of library.
> 
> I have libV2.jar in the lib folder of the web app, and libV1.jar in the libs
> folder of tomcat so that libV1.jar is visible for all web applications.
> 
> Now suppose that my web app only works with libV2.jar.
> 
> I understand from your response that the class loader loads "offers" to my
> web app the libV2.jar so everything should work! right?
> 
> 
> But in my real situation if i run my web app in a "clean tomcat" without the
> Mule libs loaded it works. When i run the web app in a tomcat installation
> that loads those Mule libraries the web app does not work anymore.
> 
> So waht is not working?

Generally multiple copies of the same class visible to an app but loaded
by different class loaders is liable to cause issues. You can sometimes
get away with it but often not.

This sounds like something you need to raise with Mule support.

Mark

> 
> Thanks
> Alberto
> 
> 2010/11/17 Mark Thomas 
> 
>> On 17/11/2010 16:18, Alberto Bugna wrote:
>>> Hi
>>>
>>> I'm running tomcat 6.0.29 on windows vista.
>>>
>>> I'have deployed a web application under webapps folder. This web
>> application
>>> comes with some jar libraries.
>>> Unfortunately these libraries conflicts with others libraries installed
>>> under tomcat.
>>> I deployed under tomcat Mule esb so I have a lot of libraries loaded by
>> the
>>> common loader that belong to Mule esb.
>>> And these Mule libraries conflict with my web application libraries.
>>>
>>> So basically I would like to tell tomcat to first load for my web
>>> application his libraries (under WEB-INF/lib) and then if a resource is
>> not
>>> found it should be searched in the global libraries.
>>>
>>> How can i do that?
>>
>> That is how Tomcat loads classes by default (with some spec mandated
>> exceptions).
>>
>> Mark
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>
> 


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



Re: Change the class loading of tomcat 6.0.29 to child-first

2010-11-17 Thread Alberto Bugna
Hi Mark

Thanks for responding.

Let's make an example.

Suppose I have two libraries that implement the same functionality. The only
differ for example for the version.
Suppose my web app uses that kind of library.

I have libV2.jar in the lib folder of the web app, and libV1.jar in the libs
folder of tomcat so that libV1.jar is visible for all web applications.

Now suppose that my web app only works with libV2.jar.

I understand from your response that the class loader loads "offers" to my
web app the libV2.jar so everything should work! right?


But in my real situation if i run my web app in a "clean tomcat" without the
Mule libs loaded it works. When i run the web app in a tomcat installation
that loads those Mule libraries the web app does not work anymore.

So waht is not working?

Thanks
Alberto

2010/11/17 Mark Thomas 

> On 17/11/2010 16:18, Alberto Bugna wrote:
> > Hi
> >
> > I'm running tomcat 6.0.29 on windows vista.
> >
> > I'have deployed a web application under webapps folder. This web
> application
> > comes with some jar libraries.
> > Unfortunately these libraries conflicts with others libraries installed
> > under tomcat.
> > I deployed under tomcat Mule esb so I have a lot of libraries loaded by
> the
> > common loader that belong to Mule esb.
> > And these Mule libraries conflict with my web application libraries.
> >
> > So basically I would like to tell tomcat to first load for my web
> > application his libraries (under WEB-INF/lib) and then if a resource is
> not
> > found it should be searched in the global libraries.
> >
> > How can i do that?
>
> That is how Tomcat loads classes by default (with some spec mandated
> exceptions).
>
> Mark
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Dynamic GlobalNamingResources / Shared JDBC connection pools

2010-11-17 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Rob,

On 11/17/2010 7:07 AM, Rob Gregory wrote:
> Is it possible to just store my existing collection of datasources in
> some global context? 
> 
> I.e. 
> initCtx = new InitialContext();  
> Context envCtx  = (Context)initCtx.lookup("java:/comp/env");
> envCtx.bind("datasource_live", objLiveDatasource);
> envCtx.bind("datasource_test", objTestDatasource);
> 
> or something along those lines?

The above isn't going to work because Tomcat provides webapp isolation
in the JNDI space.

You should look into the documentation for Tomcat's JMX beans: I'm sure
there is a way to use those to create on-the-fly DataSources (really
DataSourceFactories I think) using the mbeans that Tomcat exposes.
Running under a SecurityManager may complicate that effort.

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

iEYEARECAAYFAkzkBlwACgkQ9CaO5/Lv0PAh5wCeKQssMRezSzwagZ9AmCZuZf/5
5gwAoMPy5pYlKYgyYM6UNh/nnH3DAZiI
=jH6U
-END PGP SIGNATURE-

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



Re: String index out of range when compilling a file

2010-11-17 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

To whom it may concern,

On 11/17/2010 3:56 AM, rcabanas wrote:
> java.lang.StringIndexOutOfBoundsException: String index out of range: -1
> java.lang.String.substring(String.java:1937)
> java.lang.String.substring(String.java:1904)
> org.n52.wps.webadmin.ConfigUploadBean.compile(ConfigUploadBean.java:233)

To add to Mark's comment: this is not a problem with JSP compilation,
it's a problem with your JSP. The compiler is working correctly, your
code is not.

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

iEYEARECAAYFAkzkBdcACgkQ9CaO5/Lv0PDOuQCgjuxXN93qcxEt4jGcZ/OuI6N9
4s4An0tfxOKeUUT63Kmt1jFUHvZBr3LF
=Y7Aa
-END PGP SIGNATURE-

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



Re: Usage of Tomcat SSL in client-side class

2010-11-17 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Moley,

On 11/17/2010 3:23 AM, Moley Harey wrote:
> Thanks a lot Christopher, my web services are implemented using JAX WS API
> and I am connecting using REST, I was planning to use Apache Http Commons
> library for HTTPS as is the one I am using for simple HTTP connections...

Note that commons-http-client is no longer part of the commons:
http://hc.apache.org/httpclient-3.x/index.html

You'll want to read the SSL Guide, which has a section on customization
of the behavior for things such as self-signed SSL certificates:

http://hc.apache.org/httpclient-3.x/sslguide.html

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

iEYEARECAAYFAkzkBYQACgkQ9CaO5/Lv0PAmPgCbBHWEwruLC7qsijA3k3c4HS3T
5iEAn01Id6PU2uT2UxgWPskIbmhl9seL
=k+rp
-END PGP SIGNATURE-

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



Re: Using mod_jk in cluster environment responds HTTP 500

2010-11-17 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Rikslovein,

On 11/17/2010 12:14 AM, rikslovein wrote:
> Thanks for your help and your responses once again. I now solved the
> problem. The problem was with the jkmanager URL I was using in the code. 

Glad to hear you found the problem.

> I think there is a change in URL attributes from older version. The current
> version uses vwa, vwr and vwf (which was coded as wa, wr & wf respectively).
> I'm not sure on this but i saw them working on Unix where we have quite
> older version of Apache and Tomcat installed. Please confirm on this if you
> have any info.

You'll have to do your own checking between whatever versions you are
talking about:

http://tomcat.apache.org/tomcat-6.0-doc/changelog.html

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

iEYEARECAAYFAkzkBOsACgkQ9CaO5/Lv0PCDPwCaAn5w4baYQdYNdZ/E00aCge02
V1UAmwQAumUMdmtvKjeJ/1H8A2uCKEjs
=Gozw
-END PGP SIGNATURE-

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



Re: Tomcat Going down Frequently

2010-11-17 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Pid,

On 11/16/2010 6:24 PM, Pid wrote:
> On 16/11/2010 21:15, Christopher Schultz wrote:
>> 2. There is no way for a client to check the validity of an HttpSession
>> object before calling getAttribute (or setAttribute for that matter)
>>
>> The HttpSession interface javadoc says "For session that are invalidated
>> or expire, notifications are sent after the session has been invalidated
>> or expired." which means that, at least, the state above is correct.
> 
> The class is calling: StandardSessionFacade.getAttributeNames.
> 
> Shouldn't we see the HttpSession class in the stacktrace, not the
> implementation, if that's what they're calling?  Makes me think the OP
> is interacting with Tomcat internal classes.

No, HttpSession is just an interface, so you'll never see it in a stack
trace. Instead, you see the class that implements that interface.

N.B.: the HttpSession documentation says that IllegalStateException will
be thrown when calling getAttributeNames on an invalidated session. I
guess objects such as the LoginBean should expect that the session might
be invalidated, and catch IllegalStateException in those cases.

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

iEYEARECAAYFAkzkBHIACgkQ9CaO5/Lv0PBeBACfeAVbuM/C4rAMJTxM72VOwlOr
n58AnAq+E6whVUz6pMmJ1Q2yA2DnzAWJ
=W+ri
-END PGP SIGNATURE-

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



Re: Change the class loading of tomcat 6.0.29 to child-first

2010-11-17 Thread Mark Thomas
On 17/11/2010 16:18, Alberto Bugna wrote:
> Hi
> 
> I'm running tomcat 6.0.29 on windows vista.
> 
> I'have deployed a web application under webapps folder. This web application
> comes with some jar libraries.
> Unfortunately these libraries conflicts with others libraries installed
> under tomcat.
> I deployed under tomcat Mule esb so I have a lot of libraries loaded by the
> common loader that belong to Mule esb.
> And these Mule libraries conflict with my web application libraries.
> 
> So basically I would like to tell tomcat to first load for my web
> application his libraries (under WEB-INF/lib) and then if a resource is not
> found it should be searched in the global libraries.
> 
> How can i do that?

That is how Tomcat loads classes by default (with some spec mandated
exceptions).

Mark

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



Change the class loading of tomcat 6.0.29 to child-first

2010-11-17 Thread Alberto Bugna
Hi

I'm running tomcat 6.0.29 on windows vista.

I'have deployed a web application under webapps folder. This web application
comes with some jar libraries.
Unfortunately these libraries conflicts with others libraries installed
under tomcat.
I deployed under tomcat Mule esb so I have a lot of libraries loaded by the
common loader that belong to Mule esb.
And these Mule libraries conflict with my web application libraries.

So basically I would like to tell tomcat to first load for my web
application his libraries (under WEB-INF/lib) and then if a resource is not
found it should be searched in the global libraries.

How can i do that?

Thanks
Regards
Alberto


Re: Problem with Tomcat windows service when user delete/changed

2010-11-17 Thread Tomislav Petrović

Konstantin Kolinko said on 17.11.2010 12:05:

2010/11/17 Tomislav Petrović:

Konstantin Kolinko said on 17.11.2010 11:22:


2010/11/17 Tomislav Petrović:


After the did this Tomcat stopped working correctly. Default application
and
doc are been served (localhost:8080/ and localhost:8080/docs) but no
other
webapp (mine and several others) is working (getting 404s).

I've checked user file premissions and all seem ok.
The problem was resolved by removing Tomcat window service and installing
it
again.

Windows 2003 Server, 32 bit, server java sun/oracle 6.0 latest update.

Anyone had similar problems and knows why it happens?


And nothing in the logs?

Probably it does not have permissions to write them
(as well as write unpacked war files, as well as necessary files and
compiled JSPs in work etc.).  The default app and docs are static and
can be served as is, directly from hard drive.



I had logging on Debug and nothing in logs.


What ever logging is set in the service wrapper applies to the service
wrapper only,
and *not* to the java application (here: Tomcat) that it runs.

Without any log messages it is very hard to diagnose anything.



I know, I'll have to try to recreate if I want to investigate further.
I just wanted to know if anyone else had similar experience and/or knows 
of a problem.





Service was set up per default, meaning it was run under System account and
file premissions for System account should be all ok (System account file
permissions didn't change when my initial account was removed and new
created).


And what is your user account used for?


Me being able to log in, change files, monitor logs, etc

--
Tomy 

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



RE: WEB Application need to upload a txt / csv file with 100K records

2010-11-17 Thread Karthik Nanjangude
Hi

>> but if the browser has to wait more than 3-4 minutes for a server response, 
>> the browser will time out on the connection and declare the server dead.

I definitely vote for this primary Issue .. :{

Any more suggestions



With regards
karthik

-Original Message-
From: André Warnier [mailto:a...@ice-sa.com]
Sent: Wednesday, November 17, 2010 6:20 PM
To: Tomcat Users List
Subject: Re: WEB Application need to upload a txt / csv file with 100K records

Karthik Nanjangude wrote:
> Hi
>
> SPEC :
>
> JDK1.5
> WEB SERVER : TOMCAT 5.0.20
> O/s  Linux - Unix
> DB Oracle 10gAS + PLSQL
>
> Logged Session Time
>
> An module of our WEB Application need to upload a  txt / csv  file with  100K 
> records.
> These Records are to be validated with certain checks in the Business 
> layer..Before the pumped to a PLSQL of Oracle DB
> The process has to further Waite for the response of Errors from PLSQL and 
> has to be displayed on the JSP Screen.
>
> Question  :  I fear the  Login session time out may NOT commit the Process 
> for 100K records.
>
>
> Can some body suggest me a better way of handling the same successfully 
> .:(
>
I don't know about the "login session timeout" (or even if it is relevant in 
this case),
but if the browser has to wait more than 3-4 minutes for a server response, the 
browser
will time out on the connection and declare the server dead.
You may want to consider that part first.


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


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



Re: Request count increases drastically in tomcat 6.0.29

2010-11-17 Thread André Warnier

Hi.

Again, I do not know LambdaProbe and I don't know precisely how it names things.
But what I believe is this :

> http-443
> Current thread count: 1149 Current threads busy: 1148 Max threads: 3000 Max
> spare threads: 0 Min spare threads: 0 Max time (ms): 896953 Processing time
> (ms): 166070125 *Request count: 148736* Error count: 527 Received: 687Kb
> Sent: 143Mb


The "Request count" which you see there is probably a cumulative count of all the requests 
that Tomcat has already processed (or received) so far, since the time it was started.

If so, then it is normal that this number will always go up, and never go down.

What is more striking here, are the threads counts : the above says that Tomcat currently 
has 1149 threads started, and that all of them are busy.
To me it looks like either your server is too small for the load, or your application is 
too slow to respond.


Even if you told Tomcat that it can start a maximum of 3000 threads, that does not mean 
that it will do so.  It may not have enough memory available to do it.


How much RAM does your server have, and how much of it is being used ? (for a quick check, 
use the Windows Task Manager).


It may also be your back-end database system which is slow in responding, and keeping the 
threads busy.


Anyway, as per the information above, there are no "idle threads".  That explains why 
additional users would be rejected : your server is just too busy to answer them.

You need a bigger boat.


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



RE: Placing JARs in "..../tomcat/shared/lib" causes leaks when stopping apps?

2010-11-17 Thread Caldarale, Charles R
> From: Brian [mailto:bbprefix-m...@yahoo.com] 
> Subject: RE: Placing JARs in "/tomcat/shared/lib" causes leaks when 
> stopping apps?

> if I don’t remember any valid reason to keep two contexts,
> I will start using just one!

One strong reason to not merge the contexts is to preclude any chance of 
mingling data between the two.  Don't know what your client requirements or 
expectations are, so that may or may not be a concern.

 - Chuck


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



Re: Request count increases drastically in tomcat 6.0.29

2010-11-17 Thread rujin raj
Warnier,

Herewith I given the details:

http-443
Current thread count: 1149 Current threads busy: 1148 Max threads: 3000 Max
spare threads: 0 Min spare threads: 0 Max time (ms): 896953 Processing time
(ms): 166070125 *Request count: 148736* Error count: 527 Received: 687Kb
Sent: 143Mb

Tomcat Version: Tomcat 6.0.29
Java:1.6.0 64 bit version
Os: Windows 2008 Enterprise edition 64 bit

The problem is when the request count is less the users can able to login
and submit the forms without delay.Meantime request time keeps increasing
and they are not able to login into application and submission of forms also
taking long time and finally page is expired.We set the session timeout as
30 min.Then we are forced to restart the tomcat to come to normal
condition.We are using the Oracle database.

Is it the normal for any application to keeps increasing the request count.
Is there any way to recycle this request count in my tomcat application
server?


--rujin

On 17 November 2010 17:41, André Warnier  wrote:

> Rujin,
>
> as it is phrased, your message is not very clear.
> It is probably a question of language or terminology.
> I don't know how LambdaProbe displays the information, but
>
> - a "request" is what the browser sends to Tomcat (like "GET /index.jsp")
> - when Tomcat receives the request, it selects an idle thread to process
> the request
> - while processing the request, the thread is no longer idle, it is working
> - the thread produces the response and sends it back to the client
> - then the thread becomes idle again, ready to process another request
>
> So, an "idle request" seems to be a contradiction in terms.
> Please explain better what you mean.
>
> And the list strips attachments, so sending screenshots does not help.
>
>
> rujin raj wrote:
>
>> MArk,
>>
>> Its request count
>>
>> Screen shot attached.
>>
>> --rujin
>> On 17/11/2010, Mark Thomas  wrote:
>>
>>> On 17/11/2010 06:45, rujin raj wrote:
>>>
 Hi,

 I am using an application in tomcat 6.0.29 and the java version is 1.6
  64 bit. I am facing the problem in my application when the request
 count is more(this i am watching through Lambda probe).

 Please give me some idea why this request count is keeps increasing
 and how to destroy the idle requests.Herewith i attached the
 screenshot of that application

>>> The list strips attachments.
>>>
>>> Do you really mean request count or do you actually mean thread count?
>>>
>>> Mark
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>>
>>>
>>>
>>
>> 
>>
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


RE: Placing JARs in "..../tomcat/shared/lib" causes leaks when stopping apps?

2010-11-17 Thread Brian
Hi Mikolaj and Mark,

Thanks for your help. I do know about aliases, but for some reason a couple of 
years ago I decided to keep each domain in a different context. And that reason 
was.hummm..like.. you know what? Either I forgot what the reason 
was (maybe because I have barely slept last night cause my website crashed), or 
there was no valid reason! 
As soon as I finish moving my JARs from the shared directory to the web-inf/lib 
directory and everything is OK, I will review that. Certaintly, if I don’t 
remember any valid reason to keep two contexts, I will start using just one!


> -Original Message-
> From: Mark Shifman [mailto:mark.shif...@yale.edu]
> Sent: Wednesday, November 17, 2010 08:30 AM
> To: Tomcat Users List
> Subject: Re: Placing JARs in "/tomcat/shared/lib" causes leaks when
> stopping apps?
> 
> On 11/17/2010 02:43 AM, Mikolaj Rydzewski wrote:
> >
> > On Tue, 16 Nov 2010 22:55:10 -0500, "Brian" 
> wrote:
> >
> >> I have two identical apps running at the same time. I mean, they use
> >> exactly the same WAR, but each one runs in a different web domain.
> > [...]
> >
> > You should rather change your application to be aware of domain it runs in.
> > Done that, there would be only one webapp deployed - no matter how
> many domains you need to handle.
> >
> Perhaps you could give Brian a hint on how to do this.  Would using aliases
> within the host do the trick?
> 
> mas
> 
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org


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



Re: Placing JARs in "..../tomcat/shared/lib" causes leaks when stopping apps?

2010-11-17 Thread Mark Shifman
On 11/17/2010 02:43 AM, Mikolaj Rydzewski wrote:
> 
> On Tue, 16 Nov 2010 22:55:10 -0500, "Brian"  wrote:
> 
>> I have two identical apps running at the same time. I mean, they use exactly
>> the same WAR, but each one runs in a different web domain.
> [...]
> 
> You should rather change your application to be aware of domain it runs in.
> Done that, there would be only one webapp deployed - no matter how many 
> domains you need to handle.
> 
Perhaps you could give Brian a hint on how to do this.  Would using aliases 
within the host do the trick?

mas



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



Re: WEB Application need to upload a txt / csv file with 100K records

2010-11-17 Thread Marian Simpetru
Hi,

you can do this using some ajax:

First upload the file
then in the returning JSP you will have a ajax request that check the
status of the process. You can check the validation process, then the
actual database insert.
The resource checked will return the message (and depending of the
returned message you display 'under processing' or the error message or
whatever you need.

Best,

Marian



On Wed, 2010-11-17 at 18:11 +0530, Karthik Nanjangude wrote:

> Hi
> 
> SPEC :
> 
> JDK1.5
> WEB SERVER : TOMCAT 5.0.20
> O/s  Linux - Unix
> DB Oracle 10gAS + PLSQL
> 
> Logged Session Time
> 
> An module of our WEB Application need to upload a  txt / csv  file with  100K 
> records.
> These Records are to be validated with certain checks in the Business 
> layer..Before the pumped to a PLSQL of Oracle DB
> The process has to further Waite for the response of Errors from PLSQL and 
> has to be displayed on the JSP Screen.
> 
> Question  :  I fear the  Login session time out may NOT commit the Process 
> for 100K records.
> 
> 
> Can some body suggest me a better way of handling the same successfully 
> .:(
> 
> 
> 
> 
> 
> 
> 
> with regards
> 
> N.S.Karthik
> 




Re: WEB Application need to upload a txt / csv file with 100K records

2010-11-17 Thread André Warnier

Karthik Nanjangude wrote:

Hi

SPEC :

JDK1.5
WEB SERVER : TOMCAT 5.0.20
O/s  Linux - Unix
DB Oracle 10gAS + PLSQL

Logged Session Time

An module of our WEB Application need to upload a  txt / csv  file with  100K 
records.
These Records are to be validated with certain checks in the Business 
layer..Before the pumped to a PLSQL of Oracle DB
The process has to further Waite for the response of Errors from PLSQL and has 
to be displayed on the JSP Screen.

Question  :  I fear the  Login session time out may NOT commit the Process for 
100K records.


Can some body suggest me a better way of handling the same successfully .:(

I don't know about the "login session timeout" (or even if it is relevant in this case), 
but if the browser has to wait more than 3-4 minutes for a server response, the browser 
will time out on the connection and declare the server dead.

You may want to consider that part first.


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



WEB Application need to upload a txt / csv file with 100K records

2010-11-17 Thread Karthik Nanjangude

Hi

SPEC :

JDK1.5
WEB SERVER : TOMCAT 5.0.20
O/s  Linux - Unix
DB Oracle 10gAS + PLSQL

Logged Session Time

An module of our WEB Application need to upload a  txt / csv  file with  100K 
records.
These Records are to be validated with certain checks in the Business 
layer..Before the pumped to a PLSQL of Oracle DB
The process has to further Waite for the response of Errors from PLSQL and has 
to be displayed on the JSP Screen.

Question  :  I fear the  Login session time out may NOT commit the Process for 
100K records.


Can some body suggest me a better way of handling the same successfully .:(







with regards

N.S.Karthik



Re: Request count increases drastically in tomcat 6.0.29

2010-11-17 Thread André Warnier

Rujin,

as it is phrased, your message is not very clear.
It is probably a question of language or terminology.
I don't know how LambdaProbe displays the information, but

- a "request" is what the browser sends to Tomcat (like "GET /index.jsp")
- when Tomcat receives the request, it selects an idle thread to process the 
request
- while processing the request, the thread is no longer idle, it is working
- the thread produces the response and sends it back to the client
- then the thread becomes idle again, ready to process another request

So, an "idle request" seems to be a contradiction in terms.
Please explain better what you mean.

And the list strips attachments, so sending screenshots does not help.


rujin raj wrote:

MArk,

Its request count

Screen shot attached.

--rujin
On 17/11/2010, Mark Thomas  wrote:

On 17/11/2010 06:45, rujin raj wrote:

Hi,

I am using an application in tomcat 6.0.29 and the java version is 1.6
 64 bit. I am facing the problem in my application when the request
count is more(this i am watching through Lambda probe).

Please give me some idea why this request count is keeps increasing
and how to destroy the idle requests.Herewith i attached the
screenshot of that application

The list strips attachments.

Do you really mean request count or do you actually mean thread count?

Mark

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








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



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



Re: Tomcat Going down Frequently

2010-11-17 Thread Amol Puglia
Hello Andre,

We are proxying request from apache to tomcat using mod_proxy and mod_proxy_ajp

Following is the load balancer configuration in apache.

kindly let me know in case you need further details.

# Port 80
   Listen server_name:80
   #Listen 153.88.86.250:80
   
  ServerName server_name
   

  Timeout 10800
  ProxyTimeout 10800
  ProxyRequests Off


   ProxyPass /eMatrix balancer://cluster 
stickysession=JSESSIONID|jsessionid nofailover=On
   #ProxyPass /eMatrix balancer://cluster stickysession=JSESSIONID 
nofailover=On

   ProxyPreserveHost On


   ProxyPass /eMatrix ajp://server_name:8009/eMatrix

   ProxyPass /eMatrix ajp://server_name:8010/eMatrix

  ProxyPass /eMatrix ajp://server_name:8011/eMatrix

  ProxyPass /eMatrix ajp://server_name:9009/eMatrix

  ProxyPass /eMatrix ajp://server_name:9010/eMatrix

  ProxyPass /eMatrix ajp://server_name:9011/eMatrix

   ProxyPassReverse /eMatrix ajp://server_name:8009/eMatrix

   ProxyPassReverse /eMatrix ajp://server_name:8010/eMatrix

   ProxyPassReverse /eMatrix ajp://server_name:8011/eMatrix

   ProxyPassReverse /eMatrix ajp://server_name:9009/eMatrix

   ProxyPassReverse /eMatrix ajp://server_name:9010/eMatrix

   ProxyPassReverse /eMatrix ajp://server_name:9011/eMatrix

   
 BalancerMember ajp://server_name:8009/eMatrix 
route=marsprod_rmiserver_1 loadfactor=33 retry=60
 BalancerMember ajp://server_name:8010/eMatrix 
route=marsprod_rmiserver_2 loadfactor=33 retry=60
 BalancerMember ajp://server_name:8011/eMatrix 
route=marsprod_rmiserver_3 loadfactor=33 retry=60
 BalancerMember ajp://server_name:9009/eMatrix 
route=marsprod_rmiserver_4 loadfactor=33 retry=60
 BalancerMember ajp://server_name:9010/eMatrix 
route=marsprod_rmiserver_5 loadfactor=33 retry=60
 #load balancing performed based on number of user requests
 #ProxySet lbmethod=byrequests
 # Report server is for Report purpose only so balancing is required 
now.
 BalancerMember ajp://server_name:9011/eMatrix 
route=marsprod_rmiserver_6 loadfactor=33 retry=60
 ProxySet lbmethod=byrequests
   

   #Status page for balancer

   
   SetHandler balancer-manager
   Order Deny,Allow
   Deny from all
   Allow from all
  

  ProxyStatus On

  
  SetHandler server-status
  Order Deny,Allow
  Deny from all
  Allow from all
  

  ErrorLog /opt/web/apache/app/mxora/logs/error.log



  
   
# END port 80

--- On Tue, 11/16/10, André Warnier  wrote:

From: André Warnier 
Subject: Re: Tomcat Going down Frequently
To: "Tomcat Users List" 
Date: Tuesday, November 16, 2010, 4:55 PM

Amol Puglia wrote:
> Hello Andre,
> 
> Thanks for the updates. I am not using mod_jk , I am using proxy modules for 
> redirecting request from apache to tomcat.
> 

Ok, sorry, I confused your post with another one.

But anyway, your configuration shows a whole lot of proxy modules, many of 
which do not seem to have any relation with proxying calls to Tomcat. Such as 
these :

>> LoadModule proxy_connect_module modules/mod_proxy_connect.so
>> LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
>> LoadModule proxy_scgi_module modules/mod_proxy_scgi.so

The following /may/ have a relation with the proxying to Tomcat, but which one 
are you really using ?

>> LoadModule proxy_http_module modules/mod_proxy_http.so
>> LoadModule proxy_ajp_module modules/mod_proxy_ajp.so

Usually, people use *either* mod_proxy_http *or* mod_proxy_ajp, so which one is 
being used ? Can you provide some information about the apache httpd 
configuration that shows what is being proxied and how ?


> As you said that there is problem in application code, Is there anything we 
> can point out where exactly is the problem in the code or configuration?
> 

I thought that Pid already pointed that out.




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




  

RE: Dynamic GlobalNamingResources / Shared JDBC connection pools

2010-11-17 Thread Rob Gregory
Is it possible to just store my existing collection of datasources in
some global context? 

I.e. 
initCtx = new InitialContext();  
Context envCtx  = (Context)initCtx.lookup("java:/comp/env");
envCtx.bind("datasource_live", objLiveDatasource);
envCtx.bind("datasource_test", objTestDatasource);

or something along those lines?

Thanks
Rob


> -Original Message-
> From: Rob Gregory [mailto:rob.greg...@ibsolutions.com]
> Sent: 17 November 2010 11:09
> To: Tomcat Users List
> Subject: Dynamic GlobalNamingResources / Shared JDBC connection pools
> 
> Tomcat Users,
> 
> 
> 
> We are trying to migrate a web application from a single context
> containing multiple JDBC datasources to a web application deployed
over
> multiple contexts but without duplicating the shared datasources.
> Reading the docs at
>
http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.h
> tml states that we should be using the GlobalNamingResources but I do
> not know how to create these dynamically as we do with the
> per-web-application JNDI contexts. The docs explain how to declare
them
> within the xml files but I need to create them on the fly. Could
anyone
> point me at some documentation or some hints at what I should be
> googling for. One approach I thought about was moving the datasource
> code into the shared location of Tomcat but following some posts this
> morning it doesn't sound like shared locations should be used by web
> apps. Sorry if my question is not clear and thanks for any assistance.
> 
> 
> 
> Tomcat 6.0.29 under Java 1.5+
> 
> 
> 
> Regards
> 
> Rob


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



Re: Request count increases drastically in tomcat 6.0.29

2010-11-17 Thread André Warnier

rujin raj wrote:

MArk,

Its request count

Screen shot attached.

--rujin
On 17/11/2010, Mark Thomas  wrote:

On 17/11/2010 06:45, rujin raj wrote:

Hi,

I am using an application in tomcat 6.0.29 and the java version is 1.6
 64 bit. I am facing the problem in my application when the request
count is more(this i am watching through Lambda probe).

Please give me some idea why this request count is keeps increasing
and how to destroy the idle requests.Herewith i attached the
screenshot of that application




The list strips attachments.   <=== *





Do you really mean request count or do you actually mean thread count?

Mark

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








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



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



Re: Request count increases drastically in tomcat 6.0.29

2010-11-17 Thread rujin raj
MArk,

Its request count

Screen shot attached.

--rujin
On 17/11/2010, Mark Thomas  wrote:
> On 17/11/2010 06:45, rujin raj wrote:
>> Hi,
>>
>> I am using an application in tomcat 6.0.29 and the java version is 1.6
>>  64 bit. I am facing the problem in my application when the request
>> count is more(this i am watching through Lambda probe).
>>
>> Please give me some idea why this request count is keeps increasing
>> and how to destroy the idle requests.Herewith i attached the
>> screenshot of that application
>
> The list strips attachments.
>
> Do you really mean request count or do you actually mean thread count?
>
> Mark
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


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

Dynamic GlobalNamingResources / Shared JDBC connection pools

2010-11-17 Thread Rob Gregory
Tomcat Users,

 

We are trying to migrate a web application from a single context
containing multiple JDBC datasources to a web application deployed over
multiple contexts but without duplicating the shared datasources.
Reading the docs at
http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.h
tml states that we should be using the GlobalNamingResources but I do
not know how to create these dynamically as we do with the
per-web-application JNDI contexts. The docs explain how to declare them
within the xml files but I need to create them on the fly. Could anyone
point me at some documentation or some hints at what I should be
googling for. One approach I thought about was moving the datasource
code into the shared location of Tomcat but following some posts this
morning it doesn't sound like shared locations should be used by web
apps. Sorry if my question is not clear and thanks for any assistance.  

 

Tomcat 6.0.29 under Java 1.5+

 

Regards

Rob



Re: Problem with Tomcat windows service when user delete/changed

2010-11-17 Thread Konstantin Kolinko
2010/11/17 Tomislav Petrović :
> Konstantin Kolinko said on 17.11.2010 11:22:
>>
>> 2010/11/17 Tomislav Petrović:
>>>
>>> After the did this Tomcat stopped working correctly. Default application
>>> and
>>> doc are been served (localhost:8080/ and localhost:8080/docs) but no
>>> other
>>> webapp (mine and several others) is working (getting 404s).
>>>
>>> I've checked user file premissions and all seem ok.
>>> The problem was resolved by removing Tomcat window service and installing
>>> it
>>> again.
>>>
>>> Windows 2003 Server, 32 bit, server java sun/oracle 6.0 latest update.
>>>
>>> Anyone had similar problems and knows why it happens?
>>
>> And nothing in the logs?
>>
>> Probably it does not have permissions to write them
>> (as well as write unpacked war files, as well as necessary files and
>> compiled JSPs in work etc.).  The default app and docs are static and
>> can be served as is, directly from hard drive.
>>
>
> I had logging on Debug and nothing in logs.

What ever logging is set in the service wrapper applies to the service
wrapper only,
and *not* to the java application (here: Tomcat) that it runs.

Without any log messages it is very hard to diagnose anything.


> Service was set up per default, meaning it was run under System account and
> file premissions for System account should be all ok (System account file
> permissions didn't change when my initial account was removed and new
> created).

And what is your user account used for?

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



Re: Problem with Tomcat windows service when user delete/changed

2010-11-17 Thread Tomislav Petrović

Konstantin Kolinko said on 17.11.2010 11:22:

2010/11/17 Tomislav Petrović:

After the did this Tomcat stopped working correctly. Default application and
doc are been served (localhost:8080/ and localhost:8080/docs) but no other
webapp (mine and several others) is working (getting 404s).

I've checked user file premissions and all seem ok.
The problem was resolved by removing Tomcat window service and installing it
again.

Windows 2003 Server, 32 bit, server java sun/oracle 6.0 latest update.

Anyone had similar problems and knows why it happens?


And nothing in the logs?

Probably it does not have permissions to write them
(as well as write unpacked war files, as well as necessary files and
compiled JSPs in work etc.).  The default app and docs are static and
can be served as is, directly from hard drive.



I had logging on Debug and nothing in logs.

Service was set up per default, meaning it was run under System account 
and file premissions for System account should be all ok (System account 
file permissions didn't change when my initial account was removed and 
new created).


--
Tomy 

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



Re: Problem with Tomcat windows service when user delete/changed

2010-11-17 Thread Konstantin Kolinko
2010/11/17 Tomislav Petrović :
> After the did this Tomcat stopped working correctly. Default application and
> doc are been served (localhost:8080/ and localhost:8080/docs) but no other
> webapp (mine and several others) is working (getting 404s).
>
> I've checked user file premissions and all seem ok.
> The problem was resolved by removing Tomcat window service and installing it
> again.
>
> Windows 2003 Server, 32 bit, server java sun/oracle 6.0 latest update.
>
> Anyone had similar problems and knows why it happens?

And nothing in the logs?

Probably it does not have permissions to write them
(as well as write unpacked war files, as well as necessary files and
compiled JSPs in work etc.).  The default app and docs are static and
can be served as is, directly from hard drive.

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



Problem with Tomcat windows service when user delete/changed

2010-11-17 Thread Tomislav Petrović

Recently had this problem on customer site.

I've been given one windows user to install Tomcat and my application 
under it. Tomcat service+native has been installed and all worked well.


Recently their IT deleted this user and gave me another one for 
monitoring and support.
After the did this Tomcat stopped working correctly. Default application 
and doc are been served (localhost:8080/ and localhost:8080/docs) but no 
other webapp (mine and several others) is working (getting 404s).


I've checked user file premissions and all seem ok.
The problem was resolved by removing Tomcat window service and 
installing it again.


Windows 2003 Server, 32 bit, server java sun/oracle 6.0 latest update.

Anyone had similar problems and knows why it happens?

--
Tomy 

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



RE: the tomcat encoding

2010-11-17 Thread Rob Gregory
Thanks Chris,

I originally did struggle with encoding so have probably gone over the top in 
an attempt to fix the issues I was having. I will review my code following your 
suggestions.

Many Thanks
Rob

> From: Christopher Schultz [mailto:ch...@christopherschultz.net]
> Sent: 16 November 2010 19:19
> To: Tomcat Users List
> Subject: Re: the tomcat encoding
> 
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> Rob,
> 
> On 11/16/2010 4:31 AM, Rob Gregory wrote:
> > I also use a filter to set the following:-
> >
> > request.setCharacterEncoding("UTF-8");
> > response.setContentType("text/html; charset=UTF-8");
> > response.setCharacterEncoding("UTF-8");
> 
> FWIW, you shouldn't override any character encoding sent by the client.
> If there is no encoding, feel free to "default" to UTF-8.
> 
> > Within the final html output I always include the following meta tag:-
> > 
> 
> This only makes sense if the response is actually in UTF-8. I would
> recommend something like this:
> 
> 
> 
> http://wiki.apache.org/tomcat/FAQ/CharacterEncoding
> 
> - -chris
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iEYEARECAAYFAkzi2RQACgkQ9CaO5/Lv0PBlaQCeOMxcnhPuX4hV/TPHT94+tmaM
> oyMAoKR87o0U7voSaQ0OiUg9useP/aGJ
> =O2Sy
> -END PGP SIGNATURE-
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org



Re: String index out of range when compilling a file

2010-11-17 Thread Mark Thomas
On 17/11/2010 08:56, rcabanas wrote:
> 
> Hello,
> I'm using a server WPS which has a Admin Console that allows you to upload
> java files and compile them. When doing that I get the following message:

That's nice. I don't see a question above but I assume that your post
was trying to report what you believed was a problem with Tomcat.

The root cause of the exception is in code from org.n52:
> org.n52.wps.webadmin.ConfigUploadBean.compile(ConfigUploadBean.java:233)

You need to talk to whoever wrote/provided that code.

Mark

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



Re: Request count increases drastically in tomcat 6.0.29

2010-11-17 Thread Mark Thomas
On 17/11/2010 06:45, rujin raj wrote:
> Hi,
> 
> I am using an application in tomcat 6.0.29 and the java version is 1.6
>  64 bit. I am facing the problem in my application when the request
> count is more(this i am watching through Lambda probe).
> 
> Please give me some idea why this request count is keeps increasing
> and how to destroy the idle requests.Herewith i attached the
> screenshot of that application

The list strips attachments.

Do you really mean request count or do you actually mean thread count?

Mark

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



String index out of range when compilling a file

2010-11-17 Thread rcabanas

Hello,
I'm using a server WPS which has a Admin Console that allows you to upload
java files and compile them. When doing that I get the following message:

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it
from fulfilling this request.

exception

org.apache.jasper.JasperException:
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
   
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522)
   
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:416)
   
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

root cause

java.lang.StringIndexOutOfBoundsException: String index out of range: -1
java.lang.String.substring(String.java:1937)
java.lang.String.substring(String.java:1904)
   
org.n52.wps.webadmin.ConfigUploadBean.compile(ConfigUploadBean.java:233)
   
org.n52.wps.webadmin.ConfigUploadBean.doUpload(ConfigUploadBean.java:208)
org.apache.jsp.webAdmin.index_jsp._jspService(index_jsp.java:86)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
   
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

-- 
View this message in context: 
http://old.nabble.com/String-index-out-of-range-when-compilling-a-file-tp30236325p30236325.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



Re: Usage of Tomcat SSL in client-side class

2010-11-17 Thread Moley Harey
Thanks André, I have been checking Apache Http Commons API for connecting
through HTTPS in my client-side classes and it seems that protocol is
supported well.

My doubt regarding if I had to do anything special in the client side was
related to the certificate, I have a self generated certificate using JSSE
keystore tool and I had read that those kind of certificates must be
accepted explicitly by the client (the same that browsers do), therefore I
was wondering how can I do that in my client to accept that automatically...

2010/11/16 André Warnier 

> Moley Harey wrote:
>
>> Hello folks,
>>
>> I have a set of web services installed in Tomcat 6.0.26 that I would like
>> to
>> access using HTTPs, I have following the instructions in Tomcat web side
>> to
>> set up JSSE support and now I can access the web services using SSH.
>>
>> My question is what do I have to do in my Java client-side classes to work
>> with HTTPs requests from Tomcat? Do I have to accept somehow the
>> certificate
>> provided by Tomcat in my Java classes? Well, I'm totally newbie in these
>> security issues :-/
>>
>>
> Only because you mention that you are a total newbie, and because I am
> myself not far above that level, some beginning pointers :
>
> It helps to give things their correct name (or acronym), so as to be able
> to find the correct documentation and understand their relationship.
> SSL is "Secure Socket Layer". (Google : SSL RFC)
> SSH is an acronym for "Secure Shell" (Google : SSH RFC)
> HTTP is an acronym for "HyperText Transport Protocol". (Google : HTTP RFC)
> HTTPS (with a big S) is an acronym for "HTTP over SSL". (Google : HTTPS
> RFC)
>
> So you are not accessing the web services over SSH, you are accessing your
> web services over HTTPS, which itself "lives" above an SSL connection, which
> itself lives above a TCP connection, which itself lives above an IP link
> (which itself lives over an Ethernet link (probably) etc..).
>
> And on top of it all, you have the application (both at the client side,
> and at the server side).
>
> Schematically :
>
> Client applicationServer application
> Client "container" (?) (e.g. a JVM)   Server container (e.g. JVM +
> Tomcat)
> Client O.S.   Server OS
> Client SSL layer (optional)   Server SSL layer (optional)
> Client OS TCP/IP layerServer OS TCP/IP layer
> Client-side Ethernet layerServer-side Ethernet layer
> Client-side hardware layer <-->   Server-side hardware layer
>
> When the client side application sends something to the server-side
> application, whatever data is sent goes through all the layers on the client
> side, then over the physical connection, then through all the layers on the
> server side up to the server application.
> The encryption/decryption, if any, takes place at the SSL layer level,
> automatically.
>
> So basically, to answer our question, you do not /have/ to do something
> special at the application level.  The container and the OS take care of the
> interface, so that your application can just use the standard "read" and
> "write" and "open" and "close" and request.getParameters() calls, no matter
> if the connection uses an SSL layer or not.
>
> But you /can/ make use of some of the SSL-specific things, if you want.
> For example, the server-side application setup /could/ tell the container
> that it will only accept requests that come over a secure channel, and only
> if they come from a client identified as "X" or "Y".
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Usage of Tomcat SSL in client-side class

2010-11-17 Thread Moley Harey
Thanks a lot Christopher, my web services are implemented using JAX WS API
and I am connecting using REST, I was planning to use Apache Http Commons
library for HTTPS as is the one I am using for simple HTTP connections...

2010/11/16 Christopher Schultz 

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Moley,
>
> On 11/16/2010 9:33 AM, Moley Harey wrote:
> > My question is what do I have to do in my Java client-side classes to
> work
> > with HTTPS requests [to] Tomcat? Do I have to accept somehow the
> certificate
> > provided by Tomcat in my Java classes?
>
> Yes. If you are using a certificate signed by a well-known CA (VeriSign,
> Thawte, etc.) then you probably don't need to do anything special. If
> you are using a self-signed certificate, you'll need to import that
> certificate into your certificate store (cacerts) and make sure that
> your client-side classes are configured to use it. Presumably, your web
> services client library makes this kind of thing easy.
>
> You'll, of course, have to use an "https://"; URL when trying to connect
> as well. Presumably, your web services client library makes this kind of
> thing easy.
>
> > Well, I'm totally newbie in these security issues :-/
>
> At least you're asking :)
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAkzi/dkACgkQ9CaO5/Lv0PAMsgCfSV2S8E8leRxUlAMZnSnAuFRM
> wF8An2wUwuj4a6LnFZ/ZMB27saseiI2V
> =sbPz
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>