SocketException: Software caused connection abort: recv failed

2004-09-10 Thread Antony Paul
Hi ,
I am getting this error when SSL is enabled.

Sep 10, 2004 11:14:30 AM org.apache.tomcat.util.net.TcpWorkerThread runIt
SEVERE: Remote Host /192.168.4.66 SocketException: Software caused
connection abort: recv failed

This is on console. What may be the cause for it ?.

Tomcat 4.1.30
Java HotSpot(TM) Client VM - build 1.4.1_01-b01

I am using unsigned certificates.

rgds
Anto Paul

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



[OFF-TOPIC]Yoav -- RE: Some pretty basic Tomcat Connection Pooling Questions????

2004-09-10 Thread Luke (Terry) Vanderfluit
Hi Yoav and all,
 - Hold the connection for as little a time as possible.  That is, get it
 from the pool, use it, and return it to the pool as soon as possible.
 - That means you don't get the connection in a servlet init() method and
 return it in a destroy() method.  That's too long a time to hold
 connections usually.
 - Always return connections to the pool.  Typically, this is done in the
 finally clause of a try/catch block to ensure it is executed even if the
 JDBC operation fails.
 - You create your pool once, preferably when the app starts up, and you
 close the pool itself once, preferably when the app shuts down.  A
 ServletContextListener is good for this purpose.  Make sure you close
 the pool.
 - Servlets and other classes use the pool as needed.  You don't have to
 use a one connection per servlet design (in fact those usually don't
 work in the real world).

I've been using connection pooling via an init() method.
Above you say that one should avoid that.
So now I have put the connection code inside the method that actually
does the database work and dispensed with the init() method.

Before I made this change I didn't have a conn.close() statement or a
finally clause anywhere either (I DID have resultset.close and
statement.close()).
Now I have added a conn.close() statement after each database
interaction has been completed. 

Both versions of the code work. 
Would you say the it is optimised after having gotten rid of the init()
method?

this is the code in it's latter version:
~~~
  try {   //establish the connection
 Context ctx = new InitialContext();
 if(ctx == null) {
throw new Exception(No Context);
}
 DataSource ds =
(DataSource)ctx.lookup(java:comp/env/jdbc/mb);
 if(ds != null) {
conn = ds.getConnection(); //conn is a global variable
if(conn != null) {
   message = Got Connection to DB  + conn.toString();
   }
}
 } // end try block
  catch(Exception e) {
 e.printStackTrace();
 }
  try {  //carry out the database query
 Statement stmt = conn.createStatement();
 ResultSet rst = stmt.executeQuery(select * from category where
categoryname not like '%Timetable%';);
 while(rst.next()) {
Category c  = new Category();
c.setCategoryName(rst.getString(categoryname));
clBean.addCategory(c);
} // end while block
 rst.close();
 stmt.close();
 conn.close();
 } // end try block
  catch(Exception e) {
 }
~~

Appreciate your help,
kind regards,
Luke

-- 

Luke (Terry) Vanderfluit 
Mobile: 0421 276 282 



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



AW: [OFF-TOPIC]Yoav -- RE: Some pretty basic Tomcat ConnectionPooling Questions????

2004-09-10 Thread SH Solutions
Hi

Sorry, I haven't read the whole treads, but:

 Before I made this change I didn't have a conn.close() statement or a
finally clause anywhere either (I DID have resultset.close and
statement.close()).

Never never do that.
If you do not call connection.close(), the connection is NOT returned to the
pool. So ALWAYS close().
(Maybe you are lucky and there are some special precautions of the pool
driver, that make this work, but most drivers do not.)

Regards,
  Steffen


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



Re: How to create/run a Java Service on UNIX

2004-09-10 Thread Nikola Milutinovic
John Najarian wrote:
It's very easy to launch a Java daemon in Linux/Unix.
It used to be difficult  require some JNI programming.
On the GNU site I found a slick way someone wronte in
Java and it is simple.  What I wanted to know from the
person asking the question is what they're trying to do
with the 'Service'. 'Service' this is Unix not winblows.
Get with the correct lingo! - LOL!
You should all look at http://jakarta.apache.org/commons/daemon/
There are other wrappers, but this one can be used by Tomcat, I think. 
Or is used in some binary distros.

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


$catalina_home/work/* ??

2004-09-10 Thread David . Pawson
tc 5.0.27

After running tc for a while, a directory work has suddenly appeared,
with contents 
/work
 /Catalina
  /localhost
 with a directory structure mirroring the whole app, each
containing a xxx.ser file (binary)

What are these please?


Regards DaveP.

 snip here *

-- 
DISCLAIMER: 

NOTICE: The information contained in this email and any attachments is 
confidential and may be privileged. If you are not the intended 
recipient you should not use, disclose, distribute or copy any of the 
content of it or of any attachment; you are requested to notify the 
sender immediately of your receipt of the email and then to delete it 
and any attachments from your system. 

RNIB endeavours to ensure that emails and any attachments generated by 
its staff are free from viruses or other contaminants. However, it 
cannot accept any responsibility for any  such which are transmitted.
We therefore recommend you scan all attachments. 

Please note that the statements and views expressed in this email and 
any attachments are those of the author and do not necessarily represent 
those of RNIB. 

RNIB Registered Charity Number: 226227 

Website: http://www.rnib.org.uk 

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



segmentation faults with jk2 w/ apache 2.0.50 and jakarta-tomcat-5.0.18/24

2004-09-10 Thread Alex

First i'll describe the environment:

[environment]
Linux monkeyboy 2.4.20-20.9 #1 Mon Aug 18 11:45:58 EDT 2003 i686 i686 i386 GNU/Linux

apache-2.0.50 with the following options:
--enable-so \
--enable-http \


jakarta-tomcat-connectors-jk2-2.0.4-src compiled with the following:
--with-jni --with-apxs2=/opt/apache-2.0.50/bin/apxs
--with-apache2=/usr/local/src/httpd-2.0.50 --with-java-home=/usr/local/jdk

cd ../build/jk2/apache2/
/opt/apache-2.0.50/bin/apxs -n jk2 -i mod_jk2.so

Which gives the output:
/opt/apache-2.0.50/build/instdso.sh SH_LIBTOOL='/opt/apache-2.0.50/build/libtool' 
mod_jk2.so
/opt/apache-2.0.50/modules
/opt/apache-2.0.50/build/libtool --mode=install cp mod_jk2.so
/opt/apache-2.0.50/modules/
cp mod_jk2.so /opt/apache-2.0.50/modules/mod_jk2.so
Warning!  dlname not found in /opt/apache-2.0.50/modules/mod_jk2.so.
Assuming installing a .so rather than a libtool archive.
chmod 755 /opt/apache-2.0.50/modules/mod_jk2.so

app server:
resides on another machine.  i have both 5.0.24 and 5.0.18 running (not at
the same time -- using the same port).  I can verify that the ajp13 works
as i can yield results using the isapi dll with iis5.0

[problem]

Right, so from the above, I've compiled and installed apache.  That works.
No problems there.  Compile and deploy the mod_jk2.so file.  I modify the
httpd.conf and add some virtual hosts.  Those work.  Tested.  I then
modify the one virtual host with the following:

Location /jsp-dev/*.jsp
JkUriSet worker ajp13:thinktank
/Location

The workers2.properties file has the following:

[logger.apache2]
level=DEBUG

[shm]
file=/opt/apache-2.0.50/logs/shm.file
size=1048576

[channel.socket:thinktank]
port=8009
host=10.10.12.14
type=ajp13

# define the worker
[ajp13:thinktank]
channel=channel.socket:thinktank

When I attempt to go to http://test1/jsp-dev/hello-world.jsp I get the
following below in the error log for apache.


[Thu Sep 09 15:28:47 2004] [notice] Apache/2.0.50 (Unix) mod_jk2/2.0.4 configured -- 
resuming normal operations
[Thu Sep 09 15:28:55 2004] [notice] jk2_init() Setting scoreboard slot 0 for child 9912
[Thu Sep 09 15:28:55 2004] [notice] channelApr.resolve(): create AF_NET 10.10.12.14 
8009
[Thu Sep 09 15:28:55 2004] [notice] workerEnv.init() ok 
/opt/apache-2.0.50/conf/workers2.properties
[Thu Sep 09 15:28:55 2004] [notice] mod_jk2 child 9912 initialized
[Thu Sep 09 15:28:55 2004] [notice] child pid 9907 exit signal Segmentation fault (11)
[Thu Sep 09 15:28:57 2004] [notice] jk2_init() Setting scoreboard slot 0 for child 9913
[Thu Sep 09 15:28:57 2004] [notice] channelApr.resolve(): create AF_NET  10.10.12.14 
8009
[Thu Sep 09 15:28:57 2004] [notice] workerEnv.init() ok 
/opt/apache-2.0.50/conf/workers2.properties
[Thu Sep 09 15:28:57 2004] [notice] mod_jk2 child 9913 initialized
[Thu Sep 09 15:28:57 2004] [notice] child pid 9908 exit signal Segmentation fault (11)

If i go to http://10.10.12.14:8080/jsp-dev/hello-world.jsp it yields up
the expected jsp.  Is there anyway or anything I can do to allow me to
trouble shoot this more?  I'm not given any context anywhere that I can
find to troubleshoot that segmentation fault.  If i switch it to a tomcat
5.0.24 instance, I get the same results.

Any help would be appreciated.


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



access restriction limits

2004-09-10 Thread David . Pawson

With a single context is it possible
to have variant access roles for different child directories
or different html files within the single context?

/webapps
  /myapp
a.html
b.jsp
c.html

Is it possible to configure 3 different roles for
a.html
b.jsp
c.html?

I.e. to restrict users to some or all of the 3 files?

From my trials to date I'm coming to the conclusion
it can't be done under tomcat.

I've not found any examples that use anything
other than 
  url-pattern/repository/*/url-pattern
in web.xml, within security-constraints



Regards DaveP.

 snip here *

-- 
DISCLAIMER: 

NOTICE: The information contained in this email and any attachments is 
confidential and may be privileged. If you are not the intended 
recipient you should not use, disclose, distribute or copy any of the 
content of it or of any attachment; you are requested to notify the 
sender immediately of your receipt of the email and then to delete it 
and any attachments from your system. 

RNIB endeavours to ensure that emails and any attachments generated by 
its staff are free from viruses or other contaminants. However, it 
cannot accept any responsibility for any  such which are transmitted.
We therefore recommend you scan all attachments. 

Please note that the statements and views expressed in this email and 
any attachments are those of the author and do not necessarily represent 
those of RNIB. 

RNIB Registered Charity Number: 226227 

Website: http://www.rnib.org.uk 

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



Help - Newbie questions - where are the uploaded files stored ?

2004-09-10 Thread MATHOT Jacques
Hi All,

I am implementing an upload function for my web applications using Tomcat 4.0.14 
server. I was expecting the files to be stored on the root directory of my application 
and not in one of the own Tomcat directories.
How can I specify that the directory to be used is my application root directory ?
Thanks in advance.
Regards,
Jacques Mathot

FileInputStream fis = new FIleInputStream(Doc8585.zip);
...



This message and any files transmitted with it are legally privileged and intended for 
the sole use of the individual(s) or entity to whom they are addressed. If you are not 
the intended recipient, please notify the sender by reply and delete the message and 
any attachments from your system. Any unauthorised use or disclosure of the content of 
this message is strictly prohibited and may be unlawful.

Nothing in this e-mail message amounts to a contractual or legal commitment on the 
part of EUROCONTROL unless it is confirmed by appropriately signed hard copy.

Any views expressed in this message are those of the sender.

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



Re: Can session time be modified at runtime?

2004-09-10 Thread Tim Funk
The session timeout can be changed at runtime (sort of). If you change 
web.xml - you would need to restart your webapp. This would cause a brief 
outage while sessions are saved to ???. (Unless your using clustering)

If you really need this changed on the fly, this might be able to be changed 
via JMX. (But I haven't checked)

-Tim
Arun Prasad R wrote:
hi
in web.xml the following comment has been given
  !-- You can set the default session timeout (in minutes) for all newly   --
  !-- created sessions by modifying the value below.   --
session-config
session-timeout30/session-timeout
/session-config
after changing session-timeout will it be effective for sessions
created thereafter?
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: 'referer' header contains Servlet path, not referrer

2004-09-10 Thread Tim Funk
javascript:history.go(-1) ?
-Tim
Keith Hankin wrote:
Here's the scenario: I am getting input data from the user and have
determined that the user has made an error. I want to redisplay the last
page so they can fix the errors.
- Original Message -
From: QM [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Thursday, September 09, 2004 6:50 PM
Subject: Re: 'referer' header contains Servlet path, not referrer

On Thu, Sep 09, 2004 at 03:16:19PM +0530, Keith Hankin wrote:
: I am trying to determine what JSP page sent me to my Servlet, so I use
request.getHeader(referer). Unfortunately, the String returned is the
Servlet itself and not the actual referer. This seems like a bug to me. Is
there some way to get the actual referer?
The referer header isn't reliable.  Browsers may refuse to send it,
for privacy reasons.
What's your high-level goal?
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: $catalina_home/work/* ??

2004-09-10 Thread Tim Funk
The ser files are generated on shutdown which store the current sessions. If 
you don't want these - see the FAQ on how to get rid of them.

-Tim
[EMAIL PROTECTED] wrote:
tc 5.0.27
After running tc for a while, a directory work has suddenly appeared,
with contents 
/work
 /Catalina
  /localhost
 with a directory structure mirroring the whole app, each
containing a xxx.ser file (binary)

What are these please?
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: access restriction limits

2004-09-10 Thread Tim Funk
You can but it is a PITA. The servlet spec doesn't do well for fine grained 
control of resources withoiut a lot of effort (in web.xml)

-Tim
[EMAIL PROTECTED] wrote:
With a single context is it possible
to have variant access roles for different child directories
or different html files within the single context?
/webapps
  /myapp
a.html
b.jsp
c.html
Is it possible to configure 3 different roles for
a.html
b.jsp
c.html?
I.e. to restrict users to some or all of the 3 files?
From my trials to date I'm coming to the conclusion
it can't be done under tomcat.
I've not found any examples that use anything
other than 
  url-pattern/repository/*/url-pattern
in web.xml, within security-constraints


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


Re: 'referer' header contains Servlet path, not referrer

2004-09-10 Thread Keith Hankin
My code is in the Servlet, and I can't access Javascript within the Servlet.

- Original Message -
From: Tim Funk [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Friday, September 10, 2004 4:10 PM
Subject: Re: 'referer' header contains Servlet path, not referrer


 javascript:history.go(-1) ?

 -Tim


 Keith Hankin wrote:

  Here's the scenario: I am getting input data from the user and have
  determined that the user has made an error. I want to redisplay the last
  page so they can fix the errors.
 
  - Original Message -
  From: QM [EMAIL PROTECTED]
  To: Tomcat Users List [EMAIL PROTECTED]
  Sent: Thursday, September 09, 2004 6:50 PM
  Subject: Re: 'referer' header contains Servlet path, not referrer
 
 
 
 On Thu, Sep 09, 2004 at 03:16:19PM +0530, Keith Hankin wrote:
 : I am trying to determine what JSP page sent me to my Servlet, so I use
 
  request.getHeader(referer). Unfortunately, the String returned is the
  Servlet itself and not the actual referer. This seems like a bug to me.
Is
  there some way to get the actual referer?
 
 The referer header isn't reliable.  Browsers may refuse to send it,
 for privacy reasons.
 
 What's your high-level goal?
 

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



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



RE: $catalina_home/work/* ??

2004-09-10 Thread David . Pawson
 

-Original Message-
From: Tim Funk

The ser files are generated on shutdown which store the 
current sessions. If you don't want these - see the FAQ on 
how to get rid of them.

Thanks Tim.
  Just wanted to make sure they were there for a good reason.

regards DaveP

** snip here **

-- 
DISCLAIMER: 

NOTICE: The information contained in this email and any attachments is 
confidential and may be privileged. If you are not the intended 
recipient you should not use, disclose, distribute or copy any of the 
content of it or of any attachment; you are requested to notify the 
sender immediately of your receipt of the email and then to delete it 
and any attachments from your system. 

RNIB endeavours to ensure that emails and any attachments generated by 
its staff are free from viruses or other contaminants. However, it 
cannot accept any responsibility for any  such which are transmitted.
We therefore recommend you scan all attachments. 

Please note that the statements and views expressed in this email and 
any attachments are those of the author and do not necessarily represent 
those of RNIB. 

RNIB Registered Charity Number: 226227 

Website: http://www.rnib.org.uk 

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



RE: 'referer' header contains Servlet path, not referrer

2004-09-10 Thread Bedrijven.nl
I think you should use struts.

-Oorspronkelijk bericht-
Van: Keith Hankin [mailto:[EMAIL PROTECTED]
Verzonden: Friday, September 10, 2004 11:52 AM
Aan: Tomcat Users List
Onderwerp: Re: 'referer' header contains Servlet path, not referrer


My code is in the Servlet, and I can't access Javascript within the Servlet.

- Original Message -
From: Tim Funk [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Friday, September 10, 2004 4:10 PM
Subject: Re: 'referer' header contains Servlet path, not referrer


 javascript:history.go(-1) ?

 -Tim


 Keith Hankin wrote:

  Here's the scenario: I am getting input data from the user and have
  determined that the user has made an error. I want to redisplay the last
  page so they can fix the errors.
 
  - Original Message -
  From: QM [EMAIL PROTECTED]
  To: Tomcat Users List [EMAIL PROTECTED]
  Sent: Thursday, September 09, 2004 6:50 PM
  Subject: Re: 'referer' header contains Servlet path, not referrer
 
 
 
 On Thu, Sep 09, 2004 at 03:16:19PM +0530, Keith Hankin wrote:
 : I am trying to determine what JSP page sent me to my Servlet, so I use
 
  request.getHeader(referer). Unfortunately, the String returned is the
  Servlet itself and not the actual referer. This seems like a bug to me.
Is
  there some way to get the actual referer?
 
 The referer header isn't reliable.  Browsers may refuse to send it,
 for privacy reasons.
 
 What's your high-level goal?
 

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



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


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



RE: access restriction limits

2004-09-10 Thread David . Pawson
 

-Original Message-
From: Tim Funk

You can but it is a PITA. The servlet spec doesn't do well 
for fine grained control of resources withoiut a lot of 
effort (in web.xml)

With 3 days reading/trials, I'm coming to that conclusion.
Does that mean I need (effectively) an 'application'
under webapps/
for each page(s) that I need to restrict to different roles?
I have 3, so I'd need

/webapps
  /app1  (all those for role 1)
x.html etc
/web-inf
   web.xml
  /app2  (all those for role 2)
x.html etc
/web-inf
   web.xml
  /app3  (all those for role 3)
x.html etc
/web-inf
   web.xml

Is that the general picture?

regards DaveP


-- 
DISCLAIMER: 

NOTICE: The information contained in this email and any attachments is 
confidential and may be privileged. If you are not the intended 
recipient you should not use, disclose, distribute or copy any of the 
content of it or of any attachment; you are requested to notify the 
sender immediately of your receipt of the email and then to delete it 
and any attachments from your system. 

RNIB endeavours to ensure that emails and any attachments generated by 
its staff are free from viruses or other contaminants. However, it 
cannot accept any responsibility for any  such which are transmitted.
We therefore recommend you scan all attachments. 

Please note that the statements and views expressed in this email and 
any attachments are those of the author and do not necessarily represent 
those of RNIB. 

RNIB Registered Charity Number: 226227 

Website: http://www.rnib.org.uk 

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



Re: Can session time be modified at runtime?

2004-09-10 Thread Mike Fowler
You could use the session instance method setMaxInactiveInterval which 
takes a single int paramter which is the maximum time in seconds between 
client requests before invalidation.

For example, for ten minute timeout:
session.setMaxInactiveInterval(600);
-Mike Fowler
I could be a genius if I just put my mind to it, and I,
I could do anything, if only I could get 'round to it
Tim Funk wrote:
The session timeout can be changed at runtime (sort of). If you change 
web.xml - you would need to restart your webapp. This would cause a 
brief outage while sessions are saved to ???. (Unless your using 
clustering)

If you really need this changed on the fly, this might be able to be 
changed via JMX. (But I haven't checked)

-Tim
Arun Prasad R wrote:
hi
in web.xml the following comment has been given
  !-- You can set the default session timeout (in minutes) for all 
newly   --
  !-- created sessions by modifying the value 
below.   --

session-config
session-timeout30/session-timeout
/session-config
after changing session-timeout will it be effective for sessions
created thereafter?
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: access restriction limits

2004-09-10 Thread Tim Funk
No.  You can define multiple roles in web.xml. A simple way of doing so is to 
split your roles by directory.
/rolea/
/roleb/
/rolec/

-Tim
[EMAIL PROTECTED] wrote:
 

-Original Message-
From: Tim Funk

You can but it is a PITA. The servlet spec doesn't do well 
for fine grained control of resources withoiut a lot of 
effort (in web.xml)

With 3 days reading/trials, I'm coming to that conclusion.
Does that mean I need (effectively) an 'application'
under webapps/
for each page(s) that I need to restrict to different roles?
I have 3, so I'd need
/webapps
  /app1  (all those for role 1)
x.html etc
/web-inf
   web.xml
  /app2  (all those for role 2)
x.html etc
/web-inf
   web.xml
  /app3  (all those for role 3)
x.html etc
/web-inf
   web.xml
Is that the general picture?
regards DaveP

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


Re: Can session time be modified at runtime?

2004-09-10 Thread Arun Prasad R
hi

if i don't control in application, 
so i can not do session.setMaxInactiveInterval(600);

but for that application i experience frequent timeout. is there any
other way, so that i need not to restart tomcat

arun

On Fri, 10 Sep 2004 11:59:39 +0100, Mike Fowler
[EMAIL PROTECTED] wrote:
 You could use the session instance method setMaxInactiveInterval which
 takes a single int paramter which is the maximum time in seconds between
 client requests before invalidation.
 
 For example, for ten minute timeout:
 
 session.setMaxInactiveInterval(600);
 
 
 -Mike Fowler
 I could be a genius if I just put my mind to it, and I,
 I could do anything, if only I could get 'round to it
 
 
 
 Tim Funk wrote:
  The session timeout can be changed at runtime (sort of). If you change
  web.xml - you would need to restart your webapp. This would cause a
  brief outage while sessions are saved to ???. (Unless your using
  clustering)
 
  If you really need this changed on the fly, this might be able to be
  changed via JMX. (But I haven't checked)
 
  -Tim
 
  Arun Prasad R wrote:
 
  hi
 
  in web.xml the following comment has been given
!-- You can set the default session timeout (in minutes) for all
  newly   --
!-- created sessions by modifying the value
  below.   --
 
  session-config
  session-timeout30/session-timeout
  /session-config
 
  after changing session-timeout will it be effective for sessions
  created thereafter?
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


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



Re: 'referer' header contains Servlet path, not referrer

2004-09-10 Thread Ronald Klop
You can send this back to the browser.
body onload='alert(you have an error.); history.go(-1);'/body
On Fri Sep 10 12:51:42 CEST 2004 Keith Hankin [EMAIL PROTECTED] wrote:

My code is in the Servlet, and I can't access Javascript within the Servlet.
- Original Message -
From: Tim Funk [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Friday, September 10, 2004 4:10 PM
Subject: Re: 'referer' header contains Servlet path, not referrer

javascript:history.go(-1) ?
-Tim
Keith Hankin wrote:
Here's the scenario: I am getting input data from the user and have
determined that the user has made an error. I want to redisplay the last
page so they can fix the errors.
- Original Message -
From: QM [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Thursday, September 09, 2004 6:50 PM
Subject: Re: 'referer' header contains Servlet path, not referrer

On Thu, Sep 09, 2004 at 03:16:19PM +0530, Keith Hankin wrote:
: I am trying to determine what JSP page sent me to my Servlet, so I use
request.getHeader(referer). Unfortunately, the String returned is the
Servlet itself and not the actual referer. This seems like a bug to me.
Is
there some way to get the actual referer?
The referer header isn't reliable. Browsers may refuse to send it,
for privacy reasons.
What's your high-level goal?
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

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



Re: Help - Newbie questions - where are the uploaded files stored ?

2004-09-10 Thread Arun Prasad R
hi

you can set a session property like 
System.setProperty(user.dir, /your/application/home);
this will change the applications current working dir.

i have not checked the side effects. whether tomcat will be affected
by this action or not
arun

On Fri, 10 Sep 2004 12:00:45 +0200, MATHOT Jacques
[EMAIL PROTECTED] wrote:
 Hi All,
 
 I am implementing an upload function for my web applications using Tomcat 4.0.14 
 server. I was expecting the files to be stored on the root directory of my 
 application and not in one of the own Tomcat directories.
 How can I specify that the directory to be used is my application root directory ?
 Thanks in advance.
 Regards,
 Jacques Mathot
 
 FileInputStream fis = new FIleInputStream(Doc8585.zip);
 ...
 
 
 
 This message and any files transmitted with it are legally privileged and intended 
 for the sole use of the individual(s) or entity to whom they are addressed. If you 
 are not the intended recipient, please notify the sender by reply and delete the 
 message and any attachments from your system. Any unauthorised use or disclosure of 
 the content of this message is strictly prohibited and may be unlawful.
 
 Nothing in this e-mail message amounts to a contractual or legal commitment on the 
 part of EUROCONTROL unless it is confirmed by appropriately signed hard copy.
 
 Any views expressed in this message are those of the sender.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


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



Question about multiple instances instead virtual hosts

2004-09-10 Thread Bedrijven.nl
Hello,

Now I have a production server with tomcat 4.1.24. I have several
applications installed (in webapps) and sets them up as virtual hosts. I get
the idea that using multiple instances would work better for me. I read the
documentation but what I read is there are 2 possible solutions: for each
instance install a new Tomcat installation and second modify the
CATALINA_BASE directory. Now my questions:

How could I best setup the multiple instances?? And second question is: my
Tomcat webserver is standalone. That means handles all the http requests to
port 80. How can I make this work with more than one instance?? In other
words how do I establish that a http request (port 80) will go to the right
Tomcat instance??

Thanx in advanced,

Maarten


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



Re: 'referer' header contains Servlet path, not referrer

2004-09-10 Thread Keith Hankin
Struts is an awfully heavy way to solve this little problem. Besides, we're
using JDO combined with a light-weight framework that solves most of the
problems addressed by Struts.

- Original Message -
From: Bedrijven.nl [EMAIL PROTECTED]
To: 'Tomcat Users List' [EMAIL PROTECTED]
Sent: Friday, September 10, 2004 4:28 PM
Subject: RE: 'referer' header contains Servlet path, not referrer


 I think you should use struts.

 -Oorspronkelijk bericht-
 Van: Keith Hankin [mailto:[EMAIL PROTECTED]
 Verzonden: Friday, September 10, 2004 11:52 AM
 Aan: Tomcat Users List
 Onderwerp: Re: 'referer' header contains Servlet path, not referrer


 My code is in the Servlet, and I can't access Javascript within the
Servlet.

 - Original Message -
 From: Tim Funk [EMAIL PROTECTED]
 To: Tomcat Users List [EMAIL PROTECTED]
 Sent: Friday, September 10, 2004 4:10 PM
 Subject: Re: 'referer' header contains Servlet path, not referrer


  javascript:history.go(-1) ?
 
  -Tim
 
 
  Keith Hankin wrote:
 
   Here's the scenario: I am getting input data from the user and have
   determined that the user has made an error. I want to redisplay the
last
   page so they can fix the errors.
  
   - Original Message -
   From: QM [EMAIL PROTECTED]
   To: Tomcat Users List [EMAIL PROTECTED]
   Sent: Thursday, September 09, 2004 6:50 PM
   Subject: Re: 'referer' header contains Servlet path, not referrer
  
  
  
  On Thu, Sep 09, 2004 at 03:16:19PM +0530, Keith Hankin wrote:
  : I am trying to determine what JSP page sent me to my Servlet, so I
use
  
   request.getHeader(referer). Unfortunately, the String returned is
the
   Servlet itself and not the actual referer. This seems like a bug to
me.
 Is
   there some way to get the actual referer?
  
  The referer header isn't reliable.  Browsers may refuse to send it,
  for privacy reasons.
  
  What's your high-level goal?
  
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 


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


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



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



Re: Read MS Word using Java?

2004-09-10 Thread Dov Rosenberg
We use an open source library from http://www.textmining.org/ - it seems to
work OK.



On 9/10/04 12:32 AM, Aris Javier [EMAIL PROTECTED] wrote:

 Hello everyone!
 
 I know this is out of tomcat discussion..
 but I need help on how to read MS Word files in java..
 
 does anybody have working codes?
 
 Any Help is greatly appreciated..
 
 Thanks in advance...
 
 aris
 

-- 
Dov Rosenberg
Conviveon Corporation
http://www.conviveon.com


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



How to configure jakarta-struts-1.2.2 with tomcat 4.1.27

2004-09-10 Thread Arun Prasad R
hi all,

i want to know step by step process of configuring
jakarta-struts-1.2.2 with tomcat 4.1.27,

any help

thanks in advance
arun

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



RE: Question about multiple instances instead virtual hosts

2004-09-10 Thread Ralph Einfeldt

My recommendations:
- Use one installation and define CATALINA_BASE for each.
- Define one virtual ip per instance
- bind each instance to one ip

 -Original Message-
 From: Bedrijven.nl [mailto:[EMAIL PROTECTED]
 Sent: Friday, September 10, 2004 2:16 PM
 To: 'Tomcat Users List'
 Subject: Question about multiple instances instead virtual hosts
 
 
 Hello,
 
 Now I have a production server with tomcat 4.1.24. I have several
 applications installed (in webapps) and sets them up as 
 virtual hosts. I get
 the idea that using multiple instances would work better for 
 me. I read the
 documentation but what I read is there are 2 possible 
 solutions: for each
 instance install a new Tomcat installation and second modify the
 CATALINA_BASE directory. Now my questions:
 
 How could I best setup the multiple instances?? And second 
 question is: my
 Tomcat webserver is standalone. That means handles all the 
 http requests to
 port 80. How can I make this work with more than one 
 instance?? In other
 words how do I establish that a http request (port 80) will 
 go to the right
 Tomcat instance??
 
 Thanx in advanced,
 
 Maarten
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

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



RE: [OFF-TOPIC]Yoav -- RE: Some pretty basic Tomcat ConnectionPooling Questions????

2004-09-10 Thread Shapira, Yoav

Hi,
I'd say your new version is much better designed and significantly more
scalable than the old, yeah.

But you went a bit too far: the DataSource lookup is potentially
expensive.  That you can do in the init() method and keep a reference to
the DataSource, because keeping that reference doesn't use a connection
resource.

Then in your servlet methods, get a connection from the DataSource, use
it, and release it.

In your servlet destroy method, null out your DataSource reference.

So the DataSource lookup is done once, the DataSource reference is kept
as a private non-static member variable of the servlet class, and the
Connenctions are used only within methods, they're not class member
variables.

Yoav Shapira
Millennium Research Informatics


-Original Message-
From: Luke (Terry) Vanderfluit [mailto:[EMAIL PROTECTED]
Sent: Friday, September 10, 2004 3:20 AM
To: Tomcat Users List
Subject: [OFF-TOPIC]Yoav -- RE: Some pretty basic Tomcat
ConnectionPooling
Questions

Hi Yoav and all,
 - Hold the connection for as little a time as possible.  That is, get
it
 from the pool, use it, and return it to the pool as soon as possible.
 - That means you don't get the connection in a servlet init() method
and
 return it in a destroy() method.  That's too long a time to hold
 connections usually.
 - Always return connections to the pool.  Typically, this is done in
the
 finally clause of a try/catch block to ensure it is executed even if
the
 JDBC operation fails.
 - You create your pool once, preferably when the app starts up, and
you
 close the pool itself once, preferably when the app shuts down.  A
 ServletContextListener is good for this purpose.  Make sure you close
 the pool.
 - Servlets and other classes use the pool as needed.  You don't have
to
 use a one connection per servlet design (in fact those usually don't
 work in the real world).

I've been using connection pooling via an init() method.
Above you say that one should avoid that.
So now I have put the connection code inside the method that actually
does the database work and dispensed with the init() method.

Before I made this change I didn't have a conn.close() statement or a
finally clause anywhere either (I DID have resultset.close and
statement.close()).
Now I have added a conn.close() statement after each database
interaction has been completed.

Both versions of the code work.
Would you say the it is optimised after having gotten rid of the init()
method?

this is the code in it's latter version:
~~~
  try {   //establish the connection
 Context ctx = new InitialContext();
 if(ctx == null) {
throw new Exception(No Context);
}
 DataSource ds =
(DataSource)ctx.lookup(java:comp/env/jdbc/mb);
 if(ds != null) {
conn = ds.getConnection(); //conn is a global variable
if(conn != null) {
   message = Got Connection to DB  + conn.toString();
   }
}
 } // end try block
  catch(Exception e) {
 e.printStackTrace();
 }
  try {  //carry out the database query
 Statement stmt = conn.createStatement();
 ResultSet rst = stmt.executeQuery(select * from category
where
categoryname not like '%Timetable%';);
 while(rst.next()) {
Category c  = new Category();
c.setCategoryName(rst.getString(categoryname));
clBean.addCategory(c);
} // end while block
 rst.close();
 stmt.close();
 conn.close();
 } // end try block
  catch(Exception e) {
 }
~~

Appreciate your help,
kind regards,
Luke

--

Luke (Terry) Vanderfluit
Mobile: 0421 276 282



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




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Can session time be modified at runtime?

2004-09-10 Thread Shapira, Yoav

Hi,
Why don't you investigate the cause for your timeouts instead of jumping
through hoops to apply band-aids? ;)

Consider an HttpSessionLister to track your sessions in a portable
manner.  Then you can zoom though the sessions and do whatever you want
(e.g. invalidate or extend the timeout) as needed.

Yoav Shapira
Millennium Research Informatics


-Original Message-
From: Arun Prasad R [mailto:[EMAIL PROTECTED]
Sent: Friday, September 10, 2004 7:05 AM
To: Tomcat Users List
Subject: Re: Can session time be modified at runtime?

hi

if i don't control in application,
so i can not do session.setMaxInactiveInterval(600);

but for that application i experience frequent timeout. is there any
other way, so that i need not to restart tomcat

arun

On Fri, 10 Sep 2004 11:59:39 +0100, Mike Fowler
[EMAIL PROTECTED] wrote:
 You could use the session instance method setMaxInactiveInterval
which
 takes a single int paramter which is the maximum time in seconds
between
 client requests before invalidation.

 For example, for ten minute timeout:

 session.setMaxInactiveInterval(600);


 -Mike Fowler
 I could be a genius if I just put my mind to it, and I,
 I could do anything, if only I could get 'round to it



 Tim Funk wrote:
  The session timeout can be changed at runtime (sort of). If you
change
  web.xml - you would need to restart your webapp. This would cause a
  brief outage while sessions are saved to ???. (Unless your using
  clustering)
 
  If you really need this changed on the fly, this might be able to
be
  changed via JMX. (But I haven't checked)
 
  -Tim
 
  Arun Prasad R wrote:
 
  hi
 
  in web.xml the following comment has been given
!-- You can set the default session timeout (in minutes) for
all
  newly   --
!-- created sessions by modifying the value
  below.   --
 
  session-config
  session-timeout30/session-timeout
  /session-config
 
  after changing session-timeout will it be effective for sessions
  created thereafter?
 
 
 
-
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail:
[EMAIL PROTECTED]
 

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



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




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Help - Newbie questions - where are the uploaded files stored ?

2004-09-10 Thread Shapira, Yoav

Hi,
Both this and the original poster's intent are pretty bad as far as
portability goes.

First, instead of re-inventing the wheel, use a good and proven componet
for upload handling, like commons-fileupload
(http://jakarta.apache.org/commons/fileupload/using.html).

Second, know that the Servlet Specification guarantees only one place
where you can write files: the directory accessible via
(File)
getServletContext().getAttribute(javax.servlet.context.tempdir).

If you want another directory, set it as an init-parameter to your
upload servlet or your servlet context, or maybe even a JNDI Environment
reference.  Don't rely on the concept of current working directory as
that's wildly different from one server implementation to another, and
it's highly insecure.

Yoav Shapira
Millennium Research Informatics


-Original Message-
From: Arun Prasad R [mailto:[EMAIL PROTECTED]
Sent: Friday, September 10, 2004 8:00 AM
To: Tomcat Users List
Subject: Re: Help - Newbie questions - where are the uploaded files
stored
?

hi

you can set a session property like
System.setProperty(user.dir, /your/application/home);
this will change the applications current working dir.

i have not checked the side effects. whether tomcat will be affected
by this action or not
arun

On Fri, 10 Sep 2004 12:00:45 +0200, MATHOT Jacques
[EMAIL PROTECTED] wrote:
 Hi All,

 I am implementing an upload function for my web applications using
Tomcat
4.0.14 server. I was expecting the files to be stored on the root
directory
of my application and not in one of the own Tomcat directories.
 How can I specify that the directory to be used is my application
root
directory ?
 Thanks in advance.
 Regards,
 Jacques Mathot

 FileInputStream fis = new FIleInputStream(Doc8585.zip);
 ...

 

 This message and any files transmitted with it are legally privileged
and
intended for the sole use of the individual(s) or entity to whom they
are
addressed. If you are not the intended recipient, please notify the
sender
by reply and delete the message and any attachments from your system.
Any
unauthorised use or disclosure of the content of this message is
strictly
prohibited and may be unlawful.

 Nothing in this e-mail message amounts to a contractual or legal
commitment on the part of EUROCONTROL unless it is confirmed by
appropriately signed hard copy.

 Any views expressed in this message are those of the sender.

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



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




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Question about multiple instances instead virtual hosts

2004-09-10 Thread Bedrijven.nl
can you give examples of:

- how to define CATALINA_BASE (i.e. a new director
applications/applicationX/webapps, applications/applicationY/webapps etc is
that OK??)
- how to bind the one ip address??

Maarten

-Oorspronkelijk bericht-
Van: Ralph Einfeldt [mailto:[EMAIL PROTECTED]
Verzonden: Friday, September 10, 2004 1:41 PM
Aan: Tomcat Users List; [EMAIL PROTECTED]
Onderwerp: RE: Question about multiple instances instead virtual hosts



My recommendations:
- Use one installation and define CATALINA_BASE for each.
- Define one virtual ip per instance
- bind each instance to one ip

 -Original Message-
 From: Bedrijven.nl [mailto:[EMAIL PROTECTED]
 Sent: Friday, September 10, 2004 2:16 PM
 To: 'Tomcat Users List'
 Subject: Question about multiple instances instead virtual hosts
 
 
 Hello,
 
 Now I have a production server with tomcat 4.1.24. I have several
 applications installed (in webapps) and sets them up as 
 virtual hosts. I get
 the idea that using multiple instances would work better for 
 me. I read the
 documentation but what I read is there are 2 possible 
 solutions: for each
 instance install a new Tomcat installation and second modify the
 CATALINA_BASE directory. Now my questions:
 
 How could I best setup the multiple instances?? And second 
 question is: my
 Tomcat webserver is standalone. That means handles all the 
 http requests to
 port 80. How can I make this work with more than one 
 instance?? In other
 words how do I establish that a http request (port 80) will 
 go to the right
 Tomcat instance??
 
 Thanx in advanced,
 
 Maarten
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

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

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

RE: How to create/run a Java Service on UNIX

2004-09-10 Thread Shapira, Yoav

Hi,
Commons-Daemon is used by Tomcat (in fact, it used to be part of the
Tomcat internals before we made it more generic and its own project).

To the OP: get a basic unix sysadmin book, it will cover cron and
daemons.  These are fairly essential basic unix skills, so if you work
in the unix environment this book will do you a lot of good ;)

Yoav Shapira
Millennium Research Informatics


-Original Message-
From: Nikola Milutinovic [mailto:[EMAIL PROTECTED]
Sent: Friday, September 10, 2004 5:28 AM
To: Tomcat Users List
Subject: Re: How to create/run a Java Service on UNIX

John Najarian wrote:

 It's very easy to launch a Java daemon in Linux/Unix.
 It used to be difficult  require some JNI programming.
 On the GNU site I found a slick way someone wronte in
 Java and it is simple.  What I wanted to know from the
 person asking the question is what they're trying to do
 with the 'Service'. 'Service' this is Unix not winblows.
 Get with the correct lingo! - LOL!

You should all look at http://jakarta.apache.org/commons/daemon/

There are other wrappers, but this one can be used by Tomcat, I think.
Or is used in some binary distros.

Nix.

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




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



[OFF-TOPIC] RE: Read MS Word using Java?

2004-09-10 Thread Shapira, Yoav

Hi,
Please mark off-topic threads on this list as such by adding the
[OFF-TOPIC] prefix to your subject line.  Thanks,

Yoav Shapira
Millennium Research Informatics


-Original Message-
From: Aris Javier [mailto:[EMAIL PROTECTED]
Sent: Friday, September 10, 2004 12:32 AM
To: [EMAIL PROTECTED]
Subject: Read MS Word using Java?

Hello everyone!

I know this is out of tomcat discussion..
but I need help on how to read MS Word files in java..

does anybody have working codes?

Any Help is greatly appreciated..

Thanks in advance...

aris



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: shutdown tomcat in command line error

2004-09-10 Thread Shapira, Yoav

Hi,
One idea: instead of copying all around, do a clean installation, try
start and stop out of the box, make sure that works for you.  After
that, apply your configuration changes slowly (possibly one at a time)
to see which one causes this error.

Yoav Shapira
Millennium Research Informatics


-Original Message-
From: Hongsong Zhou [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 09, 2004 5:29 PM
To: [EMAIL PROTECTED]
Subject: shutdown tomcat in command line error

Tomcat 5.5.1 in windows 2003 server
I copy tomcat/conf to another folder, modified server.xml, copy
startup.bat and shutdown.bat from tomcat/bin, setup CATALINA_BASE in
new
startup.bat and shutdown.bat, startup.bat works fine, when I try to run
shutdown.bat, I got an error:

Sep 9, 2004 4:21:54 PM org.apache.coyote.http11.Http11Protocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8219
Sep 9, 2004 4:21:55 PM org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.ja
va:3
9)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccesso
rImp
l.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
Caused by: java.lang.NullPointerException
at
org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:8
75)
at
org.apache.catalina.startup.HostConfig.undeployApps(HostConfig.java:111
7)
at
org.apache.catalina.startup.HostConfig.stop(HostConfig.java:1089)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:3
12)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleS
uppo
rt.java:119)
at
org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1043)
at
org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1055)
at
org.apache.catalina.core.StandardEngine.stop(StandardEngine.java:425)

at
org.apache.catalina.core.StandardService.stop(StandardService.java:512)
at
org.apache.catalina.core.StandardServer.stop(StandardServer.java:2001)
at
org.apache.catalina.startup.Catalina.stop(Catalina.java:590)
at
org.apache.catalina.startup.Catalina.start(Catalina.java:565)
... 6 more

Any ideas? Thanks.

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




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



Re: [OFF-TOPIC] RE: Read MS Word using Java?

2004-09-10 Thread Rhino
Have a look at POI, http://jakarta.apache.org/poi. I've never used it but I
stumbled across it while researching a similar question the other day.

Rhino


- Original Message - 
From: Shapira, Yoav [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Friday, September 10, 2004 8:57 AM
Subject: [OFF-TOPIC] RE: Read MS Word using Java?



Hi,
Please mark off-topic threads on this list as such by adding the
[OFF-TOPIC] prefix to your subject line.  Thanks,

Yoav Shapira
Millennium Research Informatics


-Original Message-
From: Aris Javier [mailto:[EMAIL PROTECTED]
Sent: Friday, September 10, 2004 12:32 AM
To: [EMAIL PROTECTED]
Subject: Read MS Word using Java?

Hello everyone!

I know this is out of tomcat discussion..
but I need help on how to read MS Word files in java..

does anybody have working codes?

Any Help is greatly appreciated..

Thanks in advance...

aris



This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential, proprietary
and/or privileged.  This e-mail is intended only for the individual(s) to
whom it is addressed, and may not be saved, copied, printed, disclosed or
used by anyone else.  If you are not the(an) intended recipient, please
immediately delete this e-mail from your computer system and notify the
sender.  Thank you.


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



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



Tomcat Start.bat and shutdown.bat

2004-09-10 Thread Venkat Radha Venkataramanan
Hello:

 

When I installed Tomcat 5.5.1 on Windows XP Professional, it failed to
create the program group.

 

I understand that it should have created two batch files for starting and
shutting down the Tomcat instance.

 

Can somebody share with me either the batch files or the command line for
accomplishing the tasks?

 

Thanks.







RE: Question about multiple instances instead virtual hosts

2004-09-10 Thread Ralph Einfeldt
To bind a IP to an engine have a look at either:

http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/host.html
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/host.html

For the installation structure:

First:
  Have a look at RUNNING.txt in the tomcat distribution
  ...

Second:

We have a structure like this:

/usr/local/java/jdk/ibm1.3
/usr/local/java/jdk/sun1.3
/usr/local/java/jdk/sun1.3.1
/usr/local/java/jdk/sun1.4

/usr/local/java/tomcat-4...
/usr/local/java/tomcat-5...

/www/online/site
  /log
dirctory for the log file
  /conf
web.xml
server.xml
  and other files that contain the site specific setup for tomcat
  (tailored versions of the files that are provided by 
   tomcat)
  make shure that the combination of IP and port are unique for
  each instance of tomcat. 
...
  /work
Directory where tomcat stores the generated files and classes
  /webapps
 Directories for the contexts
  /bin
start.sh
  Script that calls the tomcat version that we want to use for 
  this site with the environment for this site:

  JAVA_HOME=/usr/local/java/jdk/sun1.3.1
  CATALINA_HOME=/usr/local/java/tomcat-
  CATALINA_BASE=/www/online/site


  export JAVA_HOME CATALINA_HOME CATALINA_BASE
  ${CATALINA_HOME}/bin/startup.sh

This way we can have different versions of tomcat at the same time, 
all sites that use the same tomcat version use the same 'executable'
but different processes and individual configuration. If we want to 
use an other version of tomcat we just have to change CATALINA_HOME 
in start.sh (unless the config files are incompatible between these 
versions)

 -Original Message-
 From: Bedrijven.nl [mailto:[EMAIL PROTECTED]
 Sent: Friday, September 10, 2004 2:54 PM
 To: 'Tomcat Users List'
 Subject: RE: Question about multiple instances instead virtual hosts
 
 
 can you give examples of:
 
 - how to define CATALINA_BASE (i.e. a new director
 applications/applicationX/webapps, 
 applications/applicationY/webapps etc is
 that OK??)
 - how to bind the one ip address??
 
 Maarten
 
 -Oorspronkelijk bericht-
 Van: Ralph Einfeldt [mailto:[EMAIL PROTECTED]
 Verzonden: Friday, September 10, 2004 1:41 PM
 Aan: Tomcat Users List; [EMAIL PROTECTED]
 Onderwerp: RE: Question about multiple instances instead virtual hosts
 
 
 
 My recommendations:
 - Use one installation and define CATALINA_BASE for each.
 - Define one virtual ip per instance
 - bind each instance to one ip
 
  -Original Message-
  From: Bedrijven.nl [mailto:[EMAIL PROTECTED]
  Sent: Friday, September 10, 2004 2:16 PM
  To: 'Tomcat Users List'
  Subject: Question about multiple instances instead virtual hosts
  
  
  Hello,
  
  Now I have a production server with tomcat 4.1.24. I have several
  applications installed (in webapps) and sets them up as 
  virtual hosts. I get
  the idea that using multiple instances would work better for 
  me. I read the
  documentation but what I read is there are 2 possible 
  solutions: for each
  instance install a new Tomcat installation and second modify the
  CATALINA_BASE directory. Now my questions:
  
  How could I best setup the multiple instances?? And second 
  question is: my
  Tomcat webserver is standalone. That means handles all the 
  http requests to
  port 80. How can I make this work with more than one 
  instance?? In other
  words how do I establish that a http request (port 80) will 
  go to the right
  Tomcat instance??
  
  Thanx in advanced,
  
  Maarten
  
  
  
 -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

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



Re: Tomcat Start.bat and shutdown.bat

2004-09-10 Thread Hongsong Zhou
http://www.mail-archive.com/[EMAIL PROTECTED]/msg135694.html

 [EMAIL PROTECTED] 09/10/04 08:49AM 
Hello:

 

When I installed Tomcat 5.5.1 on Windows XP Professional, it failed to
create the program group.

 

I understand that it should have created two batch files for starting
and
shutting down the Tomcat instance.

 

Can somebody share with me either the batch files or the command line
for
accomplishing the tasks?

 

Thanks.






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



Re: 'referer' header contains Servlet path, not referrer

2004-09-10 Thread QM
On Fri, Sep 10, 2004 at 11:19:09AM +0530, Keith Hankin wrote:
: Here's the scenario: I am getting input data from the user and have
: determined that the user has made an error. I want to redisplay the last
: page so they can fix the errors.

Someone mentioned Struts as a solution.  That, in and of itself, is too
heavy a solution; but you can borrow some of those ideas:

Setup your form to pull data from request-scope vars.

- user goes to page first time: vars are empty, fields are blank

- user fills out some fields and clicks submit button: at least
  some fields are populated

- the servlet checks the form (based on request-scoped vars).  If some
  are missing, dispatch (not redirect!) to an error page.

- user sees form, some fields are prepopulated based on the information
  still in the request from when they clicked submit

-QM

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


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



Re: How to configure jakarta-struts-1.2.2 with tomcat 4.1.27

2004-09-10 Thread QM
On Fri, Sep 10, 2004 at 05:58:46PM +0530, Arun Prasad R wrote:
: i want to know step by step process of configuring
: jakarta-struts-1.2.2 with tomcat 4.1.27,

Struts is a collection of JARs and XML files meant to be used within a
webapp.  See the Tomcat docs for setting up a webapp (review the servlet
spec if needed), then follow the Struts docs for creating a Struts-based
webapp.

Struts also includes a stub webapp that you can drop into a container
and use as a base for your own code.  You could start with that.

-QM

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


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



RE: Running EXE CGI's from Tomcat 5.0.28

2004-09-10 Thread Mike Curwen
Try this:
http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topicf=56t=
002491



 -Original Message-
 From: Benjamin Goldsmith [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, September 09, 2004 8:38 PM
 To: [EMAIL PROTECTED]
 Subject: Running EXE CGI's from Tomcat 5.0.28
 
 
 Is it possible to run EXE cgi's from Tomcat 5.0 on Win XP SP2?


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



basic FORM-based authentication failing

2004-09-10 Thread Fred Blaise
Hello all

I have been trying to set up FORM based authentication, but it only works
half-way.
When I try to get to the protected resource, it sends me to the login page:
good.
If I authenticate incorrectly, then it sends me to the login error page: good.
If I authenticate _correctly_, it also sends me to the login error page: bad.

I have been reading at jakarta.apache.org, and in JSP  Servlets cookbook, and I
don't know what I am doing wrong. Please find the config files below. My form
uses the j_user_name, j_password and so forth. I have reloaded the app and
restarted tomcat.

Thank you for any help/pointers...

fb.

--tomcat-users.xml (truncated...)
 user username=joedoe password=1joe2 roles=clients/
--end tomcat-users.xml

--web.xml
?xml version=1.0 encoding=ISO-8859-1?

!DOCTYPE web-app
   PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN
   http://java.sun.com/dtd/web-app_2_3.dtd;

web-app

!-- Beginning of web.xml deployment descriptor --

security-constraint
web-resource-collection
web-resource-nameClient login/web-resource-name
url-pattern/clients/index.jsp/url-pattern
http-methodGET/http-method
http-methodPOST/http-method
/web-resource-collection

auth-constraint
role-nameclients/role-name
/auth-constraint

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

/security-constraint
login-config

auth-methodFORM/auth-method

form-login-config

form-login-page/login.jsp/form-login-page
form-error-page/loginError.jsp/form-error-page

/form-login-config

/login-config

security-role
role-nameclients/role-name
/security-role

/web-app
--end web.xml

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



RE: Question about multiple instances instead virtual hosts

2004-09-10 Thread Bedrijven.nl
I think I want to use several Tomcat installations, since the applications
are not so dependent on one jvm.
So how could I do that?? (especially all connect to port 80)

Maarten



-Oorspronkelijk bericht-
Van: Bedrijven.nl [mailto:[EMAIL PROTECTED]
Verzonden: Friday, September 10, 2004 1:54 PM
Aan: 'Tomcat Users List'
Onderwerp: RE: Question about multiple instances instead virtual hosts


can you give examples of:

- how to define CATALINA_BASE (i.e. a new director
applications/applicationX/webapps, applications/applicationY/webapps etc is
that OK??)
- how to bind the one ip address??

Maarten

-Oorspronkelijk bericht-
Van: Ralph Einfeldt [mailto:[EMAIL PROTECTED]
Verzonden: Friday, September 10, 2004 1:41 PM
Aan: Tomcat Users List; [EMAIL PROTECTED]
Onderwerp: RE: Question about multiple instances instead virtual hosts



My recommendations:
- Use one installation and define CATALINA_BASE for each.
- Define one virtual ip per instance
- bind each instance to one ip

 -Original Message-
 From: Bedrijven.nl [mailto:[EMAIL PROTECTED]
 Sent: Friday, September 10, 2004 2:16 PM
 To: 'Tomcat Users List'
 Subject: Question about multiple instances instead virtual hosts


 Hello,

 Now I have a production server with tomcat 4.1.24. I have several
 applications installed (in webapps) and sets them up as
 virtual hosts. I get
 the idea that using multiple instances would work better for
 me. I read the
 documentation but what I read is there are 2 possible
 solutions: for each
 instance install a new Tomcat installation and second modify the
 CATALINA_BASE directory. Now my questions:

 How could I best setup the multiple instances?? And second
 question is: my
 Tomcat webserver is standalone. That means handles all the
 http requests to
 port 80. How can I make this work with more than one
 instance?? In other
 words how do I establish that a http request (port 80) will
 go to the right
 Tomcat instance??

 Thanx in advanced,

 Maarten


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




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



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



Re: 'referer' header contains Servlet path, not referrer

2004-09-10 Thread erh
On Fri, Sep 10, 2004 at 12:58:30PM +0200, Bedrijven.nl wrote:
 I think you should use struts.
How would that help?  Struts is completely useless for figuring out
which page a user came from.

 -Oorspronkelijk bericht-
 Van: Keith Hankin [mailto:[EMAIL PROTECTED]
 Verzonden: Friday, September 10, 2004 11:52 AM
 Aan: Tomcat Users List
 Onderwerp: Re: 'referer' header contains Servlet path, not referrer
 
 
 My code is in the Servlet, and I can't access Javascript within the Servlet.

  Keith Hankin wrote:
 
   Here's the scenario: I am getting input data from the user and have
   determined that the user has made an error. I want to redisplay the last
   page so they can fix the errors.

well, your servlet could generate a small page that has the javascript
in it.  (although then it would be javascript:history.go(-2) instead of -1)
If you have control over the input page (and feel like changing it)
you could always add a hidden form field that describes which page the user
is looking at.  You could even use a bit of javascript (hiddenfield.value =
location.href) to grab the url.  Probably not the best way to do this,
however.

eric

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



RE: Question about multiple instances instead virtual hosts

2004-09-10 Thread Ralph Einfeldt

You just need one installation.

See my previous post for an exaple structure.

 -Original Message-
 From: Bedrijven.nl [mailto:[EMAIL PROTECTED]
 Sent: Friday, September 10, 2004 4:42 PM
 To: 'Tomcat Users List'
 Subject: RE: Question about multiple instances instead virtual hosts
 
 
 I think I want to use several Tomcat installations, since the 
 applications
 are not so dependent on one jvm.
 So how could I do that?? (especially all connect to port 80)
 
 Maarten
 
 
 
 -Oorspronkelijk bericht-
 Van: Bedrijven.nl [mailto:[EMAIL PROTECTED]
 Verzonden: Friday, September 10, 2004 1:54 PM
 Aan: 'Tomcat Users List'
 Onderwerp: RE: Question about multiple instances instead virtual hosts
 
 
 can you give examples of:
 
 - how to define CATALINA_BASE (i.e. a new director
 applications/applicationX/webapps, 
 applications/applicationY/webapps etc is
 that OK??)
 - how to bind the one ip address??
 
 Maarten
 
 -Oorspronkelijk bericht-
 Van: Ralph Einfeldt [mailto:[EMAIL PROTECTED]
 Verzonden: Friday, September 10, 2004 1:41 PM
 Aan: Tomcat Users List; [EMAIL PROTECTED]
 Onderwerp: RE: Question about multiple instances instead virtual hosts
 
 
 
 My recommendations:
 - Use one installation and define CATALINA_BASE for each.
 - Define one virtual ip per instance
 - bind each instance to one ip
 
  -Original Message-
  From: Bedrijven.nl [mailto:[EMAIL PROTECTED]
  Sent: Friday, September 10, 2004 2:16 PM
  To: 'Tomcat Users List'
  Subject: Question about multiple instances instead virtual hosts
 
 
  Hello,
 
  Now I have a production server with tomcat 4.1.24. I have several
  applications installed (in webapps) and sets them up as
  virtual hosts. I get
  the idea that using multiple instances would work better for
  me. I read the
  documentation but what I read is there are 2 possible
  solutions: for each
  instance install a new Tomcat installation and second modify the
  CATALINA_BASE directory. Now my questions:
 
  How could I best setup the multiple instances?? And second
  question is: my
  Tomcat webserver is standalone. That means handles all the
  http requests to
  port 80. How can I make this work with more than one
  instance?? In other
  words how do I establish that a http request (port 80) will
  go to the right
  Tomcat instance??
 
  Thanx in advanced,
 
  Maarten
 
 
  
 -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

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



Re: Help - Newbie questions - where are the uploaded files stored ?

2004-09-10 Thread erh
On Fri, Sep 10, 2004 at 12:00:45PM +0200, MATHOT Jacques wrote:
 I am implementing an upload function for my web applications using Tomcat 4.0.14 
 server. I was expecting the files to be stored on the root directory of my 
 application and not in one of the own Tomcat directories.
 How can I specify that the directory to be used is my application root directory ?
 
   FileInputStream fis = new FIleInputStream(Doc8585.zip);
   ...
I don't think you can.  You'll run into what seems to be a related problem
if you try to, for example, use struts-tiles and specify a dtd in the
tiles-defs.xml file.  The location is based on whereever you happen to
be when tomcat is started.  i.e. if you are in /foo/bar when you run
startup.sh files will end up there.
Either create a directory somewhere else, and hard code the entire path
to that, or hardcode the path to the tomcat webapps directory and use 
request.getContextPath() to append the application directory.

 This message and any files transmitted with it are legally privileged and intended 
 for the sole use of the individual(s) or entity to whom they are addressed. If you 
 are not the intended recipient, please notify the sender by reply and delete the 
 message and any attachments from your system. Any unauthorised use or disclosure of 
 the content of this message is strictly prohibited and may be unlawful.

What is this crap?  This seems rather inappropriate to be sending to
a mailing list.

eric


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



Re: [SOLVED] basic FORM-based authentication failing

2004-09-10 Thread Fred Blaise
Awful typo... works much better when j_user_name is spelled j_username

Issue resolved.

Thanks.

fb.

Quoting Fred Blaise [EMAIL PROTECTED]:

 Hello all

 I have been trying to set up FORM based authentication, but it only works
 half-way.
 When I try to get to the protected resource, it sends me to the login page:
 good.
 If I authenticate incorrectly, then it sends me to the login error page:
 good.
 If I authenticate _correctly_, it also sends me to the login error page: bad.

 I have been reading at jakarta.apache.org, and in JSP  Servlets cookbook,
 and I
 don't know what I am doing wrong. Please find the config files below. My form
 uses the j_user_name, j_password and so forth. I have reloaded the app and
 restarted tomcat.

 Thank you for any help/pointers...

 fb.

 --tomcat-users.xml (truncated...)
  user username=joedoe password=1joe2 roles=clients/
 --end tomcat-users.xml

 --web.xml
 ?xml version=1.0 encoding=ISO-8859-1?

 !DOCTYPE web-app
PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN
http://java.sun.com/dtd/web-app_2_3.dtd;

 web-app

 !-- Beginning of web.xml deployment descriptor --

 security-constraint
 web-resource-collection
 web-resource-nameClient login/web-resource-name
 url-pattern/clients/index.jsp/url-pattern
 http-methodGET/http-method
 http-methodPOST/http-method
 /web-resource-collection

 auth-constraint
 role-nameclients/role-name
 /auth-constraint

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

 /security-constraint
 login-config

 auth-methodFORM/auth-method

 form-login-config

 form-login-page/login.jsp/form-login-page
 form-error-page/loginError.jsp/form-error-page

 /form-login-config

 /login-config

 security-role
 role-nameclients/role-name
 /security-role

 /web-app
 --end web.xml

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






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



RE: Help - Newbie questions - where are the uploaded files stored ?

2004-09-10 Thread Shapira, Yoav

Hi,

 This message and any files transmitted with it are legally privileged
and
intended for the sole use of the individual(s) or entity to whom they
are
addressed. If you are not the intended recipient, please notify the
sender
by reply and delete the message and any attachments from your system.
Any
unauthorised use or disclosure of the content of this message is
strictly
prohibited and may be unlawful.

   What is this crap?  This seems rather inappropriate to be
sending to
a mailing list.

Isn't that crap self-evident? ;)  Most companies attach such footers
and related disclaimers or legal notices to all outgoing mail, and most
users can't control it.

Yoav



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



Re: Question about multiple instances instead virtual hosts

2004-09-10 Thread Mark Lowe
One reasonably strait forward way is to have a different startup script 
for each host.. The tricky part comes when you need to start them all 
up (nothing another shell script cant deal with).

export JAVA_HOME=/opt/jdkversion
export CATALINA_HOME=/opt/tomcat-4.1
export CATALINA_BASE=~/tomcat/webapps
This would be a config suitable for a user how wants tomcat running in 
his/her home dir..

~/bin/tomcat.sh
~/tomcat/conf/server.xml
~/tomcat/webapps
~/tomcat/logs
~/tomcat/tmp
If you restrict the user's bash profile and symlink the binaries 
required to fire tomcat and the tomcat start stop script itself.

The other alternative if you are hosting a number of sites but not 
letting other users start and stop tomcat is to have separate startup 
scripts in your rc.d directory or perhaps /Library/StartupItems on osx, 
dont ask me about windows as i think its silly (at least in terms of 
running java hosting). And you can simply run them all as a single 
tomcat user.

The server.xml's need to be different for each host, the jk port 
numbers are the biggest admin hassle. But this is how you have all 
hosts connecting to port 80.. This involves mod_jk apache and such 
like, there are plenty of postings in the archives on this. IMO stick 
to jk1 , I have jk1 and 2 running, and 2 involves more configuration 
hassles.

Mark
On 10 Sep 2004, at 16:42, Bedrijven.nl wrote:
I think I want to use several Tomcat installations, since the 
applications
are not so dependent on one jvm.
So how could I do that?? (especially all connect to port 80)

Maarten

-Oorspronkelijk bericht-
Van: Bedrijven.nl [mailto:[EMAIL PROTECTED]
Verzonden: Friday, September 10, 2004 1:54 PM
Aan: 'Tomcat Users List'
Onderwerp: RE: Question about multiple instances instead virtual hosts
can you give examples of:
- how to define CATALINA_BASE (i.e. a new director
applications/applicationX/webapps, applications/applicationY/webapps 
etc is
that OK??)
- how to bind the one ip address??

Maarten
-Oorspronkelijk bericht-
Van: Ralph Einfeldt [mailto:[EMAIL PROTECTED]
Verzonden: Friday, September 10, 2004 1:41 PM
Aan: Tomcat Users List; [EMAIL PROTECTED]
Onderwerp: RE: Question about multiple instances instead virtual hosts

My recommendations:
- Use one installation and define CATALINA_BASE for each.
- Define one virtual ip per instance
- bind each instance to one ip
-Original Message-
From: Bedrijven.nl [mailto:[EMAIL PROTECTED]
Sent: Friday, September 10, 2004 2:16 PM
To: 'Tomcat Users List'
Subject: Question about multiple instances instead virtual hosts
Hello,
Now I have a production server with tomcat 4.1.24. I have several
applications installed (in webapps) and sets them up as
virtual hosts. I get
the idea that using multiple instances would work better for
me. I read the
documentation but what I read is there are 2 possible
solutions: for each
instance install a new Tomcat installation and second modify the
CATALINA_BASE directory. Now my questions:
How could I best setup the multiple instances?? And second
question is: my
Tomcat webserver is standalone. That means handles all the
http requests to
port 80. How can I make this work with more than one
instance?? In other
words how do I establish that a http request (port 80) will
go to the right
Tomcat instance??
Thanx in advanced,
Maarten
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

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

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

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


DBCP Performance?

2004-09-10 Thread Henrik Rathje
Hi,
has enyone of you recently measured the performance of the DBCP
Connection Pool? I compared

snip
long start = System.currentTimeMillis();
Class.forName(ca.edbc.jdbc.EdbcDriver);
Connection dbcon = DriverManager.getConnection(loginUrl, loginUser, loginPa$
long diff = System.currentTimeMillis() - start;
System.out.println(creating connection without pool took:  + diff +  mil$
/snip

with 

snip
long start = System.currentTimeMillis();
Connection dbcon = ds.getConnection( );
long diff = System.currentTimeMillis() - start;
System.out.println(creating connection with pool took:  + diff +  milise$
/snip

And got surprisingly results like this:

creating connection without pool took: 465 miliseconds
creating connection with pool took: 585 miliseconds

In my tests the connection pool is always slower, so what did I do wrong?
I guess this Parameter is responsible for holding active Connections in
the Pool:
parameter
  nameinitialSize/name
  value20/value
/parameter
So there shold be active Connections before the getConnection( ) is
called .. Any ideas?
Regards, Henrik

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



org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory --help. using Tomcat4.1

2004-09-10 Thread Shilpa Nalgonda
org.apache.commons.dbcp.SQLNestedException: Cannot create
PoolableConnectionFact
ory, cause:
java.sql.SQLException: Connection
refused(DESCRIPTION=(TMP=)(VSNNUM=135286784)(E
RR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4
at oracle.jdbc.dbaccess.DBError.check_error(DBError.java)
at oracle.jdbc.driver.OracleConnection.init(OracleConnection.java)
at
oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
va)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java)
at
org.apache.commons.dbcp.DriverConnectionFactory.createConnection(Driv
erConnectionFactory.java:82)
at
org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(Poolable
ConnectionFactory.java:300)
at
org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(Bas
icDataSource.java:838)
at
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou
rce.java:821)
at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource
.java:518)
at
com.mypublisher.oemapi.DAO.DBAccess.getConnection(DBAccess.java:47)
at com.mypublisher.oemapi.DAO.Persister.init(Persister.java:32)
at org.apache.jsp.test_jsp._jspService(test_jsp.java:56)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)

I have this configuartion in server.xml,

Context path=/rpcoemapi docBase=rpcoemapi
debug=5 reloadable=true crossContext=true useNaming=true

Logger className=org.apache.catalina.logger.FileLogger
 prefix=localhost_rpcoemapi_log. suffix=.txt
 timestamp=true/
   Resource name=jdbc/DBNAME
   auth=Container
   type=javax.sql.DataSource/

ResourceParams name=jdbc/DBNAME
parameter
  namefactory/name
  valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
/parameter

!-- Maximum number of dB connections in pool. Make sure you
 configure your mysqld max_connections large enough to handle
 all of your db connections. Set to 0 for no limit.
 --
parameter
  namemaxActive/name
  value50/value
/parameter

!-- Maximum number of idle dB connections to retain in pool.
 Set to 0 for no limit.
 --
parameter
 namemaxIdle/name
 value10/value
/parameter

 !-- Maximum time to wait for a dB connection to become available
 in ms, in this example 10 seconds. An Exception is thrown if
 this timeout is exceeded.  Set to -1 to wait indefinitely.
 --
parameter
 namemaxWait/name
 value1/value
/parameter

!-- MySQL dB username and password for dB connections  --
parameter
  nameusername/name
  valueioeadmin/value
/parameter
parameter
  namepassword/name
  valueioeadmin/value
/parameter

!-- Class name for mm.mysql JDBC driver --
parameter
  namedriverClassName/name
  valueoracle.jdbc.driver.OracleDriver/value
/parameter

!-- The JDBC connection url for connecting to your MySQL dB.
 The autoReconnect=true argument to the url makes sure that the
 mm.mysql JDBC Driver will automatically reconnect if mysqld closed
the
 connection.  mysqld by default closes idle connections after 8
hours.
 --
parameter
nameurl/name

valuejdbc:oracle:thin:@IPADDRESS:1521:DBNAME?autoReconnect=true/value
/parameter
/ResourceParams
/Context

=
getConnection method uses the below code:

Context ctx = new InitialContext();
Context env = (Context)ctx.lookup(java:comp/env);
DataSource ds = (DataSource) env.lookup(jdbc/DBNAME);
conn = ds.getConnection();


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



RE: DBCP Performance?

2004-09-10 Thread Shapira, Yoav

Hi,
The initial connections can be closed if idle, depending on your pool
configuration, so you might be creating new connections each time even
with the pool.  Check your minIdle setting.

If you're creating a new connection each time, a tiny bit of overhead
can be expected for a pool over a direct DriverManager call.  But that
defeats the purpose of pooling.  If your pool is properly configured and
has a connection waiting, it should be a little bit more than a hash
lookup to return the connection, which would be significantly faster
than creating a new one.

Yoav Shapira
Millennium Research Informatics


-Original Message-
From: Henrik Rathje [mailto:[EMAIL PROTECTED]
Sent: Friday, September 10, 2004 11:16 AM
To: [EMAIL PROTECTED]
Subject: DBCP Performance?

Hi,
has enyone of you recently measured the performance of the DBCP
Connection Pool? I compared

snip
long start = System.currentTimeMillis();
Class.forName(ca.edbc.jdbc.EdbcDriver);
Connection dbcon = DriverManager.getConnection(loginUrl, loginUser,
loginPa$
long diff = System.currentTimeMillis() - start;
System.out.println(creating connection without pool took:  + diff + 
mil$
/snip

with

snip
long start = System.currentTimeMillis();
Connection dbcon = ds.getConnection( );
long diff = System.currentTimeMillis() - start;
System.out.println(creating connection with pool took:  + diff + 
milise$
/snip

And got surprisingly results like this:

creating connection without pool took: 465 miliseconds
creating connection with pool took: 585 miliseconds

In my tests the connection pool is always slower, so what did I do
wrong?
I guess this Parameter is responsible for holding active Connections in
the Pool:
parameter
  nameinitialSize/name
  value20/value
/parameter
So there shold be active Connections before the getConnection( ) is
called .. Any ideas?
Regards, Henrik

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




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



Re: tomcat as AJP frontend to other tomcats?

2004-09-10 Thread Matt Robinson
Tore,

We have a somewhat similar configuration. By
configuring workers in your main Tomcat, you can
redirect your client1, client2,... clientN
contexts to other tomcat servers via AJP13.

The Tomcat documentation has some decent examples of
how to configure this (at least in 3.2.4 which is what
we are using).

We started out with a worker for each client but this
is not scalable as your # of clients grows. The first
problem is that when you configure a new worker you
need to restart your main Apache/Tomcat server to
recognize the new worker -- this means that your
entire system is down, at least momentarily. More
importantly, if you are directing each context to a
single instance of Tomcat (i.e. you have a separate
instance of Tomcat for each customer) this quickly
becomes an inefficient use of resources. We ended up
having over 50 workers redirecting to an equal # of
Tomcat instances spread across 10 machines; this was
not at all scalable.

We ended up redesigning our system and in the process
converted it to a shared model in which an arbitrary
number of customers share use of the same tomcat
instances. Now we are only using 4 workers to redirect
to 4 tomcat servers for 60 multi-user customers.

-Matt

--- Tore Halset [EMAIL PROTECTED] wrote:

 Hello!
 
 We are using jboss+tomcat on some servers. As we are
 growing and need 
 more servers we want to introduce a frontend server.
 One solution would 
 be to use Apache httpd with mod_jk to route trafic
 to the correct 
 jboss+tomcat server.
 
 https://www.company.com/client1 - jboss+tomcat
 server 1 via AJP
 https://www.company.com/client2 - jboss+tomcat
 server 1 via AJP
 https://www.company.com/client3 - jboss+tomcat
 server 2 via AJP
 
 This are easy to configure under Linux, but this is
 a windows company.. 
 Should we look for a precompiled Apache httpd with
 matching mod_jk and 
 mod_ssl? Or compile it myself? Or should we use IIS?
 
 Is it possible to run tomcat on the frontend server
 and act as a Apache 
 httpd + mod_jk + mod_ssl? Are there any other
 options we should take a 
 look at?
 
 Regards,
   - Tore.
 
 

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




___
Do you Yahoo!?
Shop for Back-to-School deals on Yahoo! Shopping.
http://shopping.yahoo.com/backtoschool

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



which jar files help accomplish JNDI/LDAP/ADS authentication in 4.1.12

2004-09-10 Thread Robyne Vaughn
I have a configuration of tomcat 4.1.17 which uses a JNDI realm to
authenticate to Active Directory Server.  It works well.  Unfortunately,
I must accomplish the same thing in a configuration of Tomcat 4.1.12 in
order to be in step with a vendor supplied tool.  4.1.12 is not able to
accomplish this particular goal due to a problem in the way it issues an
error message inappropriately  javax.naming.PartialResultException
and then fails to authenticate.
 
I would like to know which jar files I need to copy from my tomcat
4.1.17 to replace in my 4.1.12 in order to accomplish the JNDI/LDAP
processing.  I've already copied the common/lib/jndi.jar  and
common/lib/naming-factory.jar and they haven't been enough to fix the
problem.  I need to move as little as possible so as to maintain the
4.1.12 integrity for my vendor supplied tool.
 
Any suggestions would be so appreciated.
Thanks,
[EMAIL PROTECTED]


RE: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory --help. using Tomcat4.1

2004-09-10 Thread Shapira, Yoav

Hi,
Look at the cause.  The connection is refused by your database.  It's
not a Tomcat problem, it's likely a simple misconfiguration.  Use
another tool to figure out the correct DB connection parameters, or ask
your DBA if you're not sure.

Yoav Shapira
Millennium Research Informatics


-Original Message-
From: Shilpa Nalgonda [mailto:[EMAIL PROTECTED]
Sent: Friday, September 10, 2004 11:17 AM
To: Tomcat Users List
Subject: org.apache.commons.dbcp.SQLNestedException: Cannot create
PoolableConnectionFactory --help. using Tomcat4.1

org.apache.commons.dbcp.SQLNestedException: Cannot create
PoolableConnectionFact
ory, cause:
java.sql.SQLException: Connection
refused(DESCRIPTION=(TMP=)(VSNNUM=135286784)(E
RR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4
at oracle.jdbc.dbaccess.DBError.check_error(DBError.java)
at
oracle.jdbc.driver.OracleConnection.init(OracleConnection.java)
at
oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
va)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java)
at
org.apache.commons.dbcp.DriverConnectionFactory.createConnection(Driv
erConnectionFactory.java:82)
at
org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(Poolable
ConnectionFactory.java:300)
at
org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(Bas
icDataSource.java:838)
at
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou
rce.java:821)
at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource
.java:518)
at
com.mypublisher.oemapi.DAO.DBAccess.getConnection(DBAccess.java:47)
at
com.mypublisher.oemapi.DAO.Persister.init(Persister.java:32)
at org.apache.jsp.test_jsp._jspService(test_jsp.java:56)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)

I have this configuartion in server.xml,

   Context path=/rpcoemapi docBase=rpcoemapi
   debug=5 reloadable=true crossContext=true
useNaming=true

   Logger className=org.apache.catalina.logger.FileLogger
 prefix=localhost_rpcoemapi_log. suffix=.txt
 timestamp=true/
   Resource name=jdbc/DBNAME
   auth=Container
   type=javax.sql.DataSource/

   ResourceParams name=jdbc/DBNAME
   parameter
 namefactory/name
 valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
   /parameter

   !-- Maximum number of dB connections in pool. Make sure you
 configure your mysqld max_connections large enough to handle
 all of your db connections. Set to 0 for no limit.
 --
   parameter
  namemaxActive/name
  value50/value
/parameter

   !-- Maximum number of idle dB connections to retain in pool.
 Set to 0 for no limit.
 --
parameter
 namemaxIdle/name
 value10/value
/parameter

!-- Maximum time to wait for a dB connection to become
available
 in ms, in this example 10 seconds. An Exception is thrown if
 this timeout is exceeded.  Set to -1 to wait indefinitely.
 --
   parameter
 namemaxWait/name
 value1/value
/parameter

   !-- MySQL dB username and password for dB connections  --
   parameter
 nameusername/name
 valueioeadmin/value
   /parameter
   parameter
 namepassword/name
 valueioeadmin/value
   /parameter

   !-- Class name for mm.mysql JDBC driver --
   parameter
 namedriverClassName/name
 valueoracle.jdbc.driver.OracleDriver/value
   /parameter

   !-- The JDBC connection url for connecting to your MySQL dB.
 The autoReconnect=true argument to the url makes sure that the
 mm.mysql JDBC Driver will automatically reconnect if mysqld
closed
the
 connection.  mysqld by default closes idle connections after 8
hours.
 --
   parameter
   nameurl/name

valuejdbc:oracle:thin:@IPADDRESS:1521:DBNAME?autoReconnect=true/valu
e
   /parameter
/ResourceParams
/Context
===

=
=
getConnection method uses the below code:

Context ctx = new InitialContext();
Context env = (Context)ctx.lookup(java:comp/env);
DataSource ds = (DataSource) env.lookup(jdbc/DBNAME);
conn = ds.getConnection();


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




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used 

Re: Help - Newbie questions - where are the uploaded files stored ?

2004-09-10 Thread erh
On Fri, Sep 10, 2004 at 10:57:18AM -0400, Shapira, Yoav wrote:
 Isn't that crap self-evident? ;)  Most companies attach such footers
 and related disclaimers or legal notices to all outgoing mail, and most
 users can't control it.

well then you shouldn't be using a work email address to send email
to a public list.  It's not at all reasonable to claim that those messages
are in any way confidential, or try to limit how they get saved and copied.
You don't expect the list maintainer to trim out from the archives any
messages that, as your footer says, may not be saved, do you?

eric

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



Re: Help - Newbie questions - where are the uploaded files stored ?

2004-09-10 Thread John Villar
Actually, the list and all its recipients are the actual individual(s) 
(Lawyer lingo, yuck!!) the mail is intended to
Remember, most of us have a daily work and use tomcat as a tool on our 
works...

[EMAIL PROTECTED] escribió:
On Fri, Sep 10, 2004 at 10:57:18AM -0400, Shapira, Yoav wrote:
 

Isn't that crap self-evident? ;)  Most companies attach such footers
and related disclaimers or legal notices to all outgoing mail, and most
users can't control it.
   

well then you shouldn't be using a work email address to send email
to a public list.  It's not at all reasonable to claim that those messages
are in any way confidential, or try to limit how they get saved and copied.
You don't expect the list maintainer to trim out from the archives any
messages that, as your footer says, may not be saved, do you?
eric
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 

--
John Villar
Gerente de Proyectos
Computadores Flor Hard Soft 2058 C.A.
www.florhard.com

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

RE: Help - Newbie questions - where are the uploaded files stored ?

2004-09-10 Thread Shapira, Yoav

Hi,
Nope, I don't expect the maintainers of this list to strip out my
messages.  They, you, and all the subscribers to the list (including
computerized archive addresses like MARC and Eyebrowse) are the intended
individual(s) for whom this email is addressed, so they may save and
copy it.  I had cleared it with our legal department in the past, not to
mention that this is a routine and accepted practice, so you're ranting
about nothing.

Yoav Shapira
Millennium Research Informatics


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Friday, September 10, 2004 11:36 AM
To: Shapira, Yoav
Cc: Tomcat Users List
Subject: Re: Help - Newbie questions - where are the uploaded files
stored
?

On Fri, Sep 10, 2004 at 10:57:18AM -0400, Shapira, Yoav wrote:
 Isn't that crap self-evident? ;)  Most companies attach such
footers
 and related disclaimers or legal notices to all outgoing mail, and
most
 users can't control it.

   well then you shouldn't be using a work email address to send
email
to a public list.  It's not at all reasonable to claim that those
messages
are in any way confidential, or try to limit how they get saved and
copied.
You don't expect the list maintainer to trim out from the archives any
messages that, as your footer says, may not be saved, do you?

eric



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



Re: DBCP Performance?

2004-09-10 Thread Henrik Rathje
Hi,
The minIdle value during this test was:
parameter
  nameminIdle/name
  value20/value
/parameter
any other suggestions?
Thanks in advance, Henrik



On Fri, 10 Sep 2004 11:21:08 -0400
Shapira, Yoav [EMAIL PROTECTED] wrote:

 
 Hi,
 The initial connections can be closed if idle, depending on your pool
 configuration, so you might be creating new connections each time even
 with the pool.  Check your minIdle setting.
 
 If you're creating a new connection each time, a tiny bit of overhead
 can be expected for a pool over a direct DriverManager call.  But that
 defeats the purpose of pooling.  If your pool is properly configured and
 has a connection waiting, it should be a little bit more than a hash
 lookup to return the connection, which would be significantly faster
 than creating a new one.
 
 Yoav Shapira
 Millennium Research Informatics
 
 
 -Original Message-
 From: Henrik Rathje [mailto:[EMAIL PROTECTED]
 Sent: Friday, September 10, 2004 11:16 AM
 To: [EMAIL PROTECTED]
 Subject: DBCP Performance?
 
 Hi,
 has enyone of you recently measured the performance of the DBCP
 Connection Pool? I compared
 
 snip
 long start = System.currentTimeMillis();
 Class.forName(ca.edbc.jdbc.EdbcDriver);
 Connection dbcon = DriverManager.getConnection(loginUrl, loginUser,
 loginPa$
 long diff = System.currentTimeMillis() - start;
 System.out.println(creating connection without pool took:  + diff + 
 mil$
 /snip
 
 with
 
 snip
 long start = System.currentTimeMillis();
 Connection dbcon = ds.getConnection( );
 long diff = System.currentTimeMillis() - start;
 System.out.println(creating connection with pool took:  + diff + 
 milise$
 /snip
 
 And got surprisingly results like this:
 
 creating connection without pool took: 465 miliseconds
 creating connection with pool took: 585 miliseconds
 
 In my tests the connection pool is always slower, so what did I do
 wrong?
 I guess this Parameter is responsible for holding active Connections in
 the Pool:
 parameter
   nameinitialSize/name
   value20/value
 /parameter
 So there shold be active Connections before the getConnection( ) is
 called .. Any ideas?
 Regards, Henrik
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 This e-mail, including any attachments, is a confidential business communication, 
 and may contain information that is confidential, proprietary and/or privileged.  
 This e-mail is intended only for the individual(s) to whom it is addressed, and may 
 not be saved, copied, printed, disclosed or used by anyone else.  If you are not 
 the(an) intended recipient, please immediately delete this e-mail from your computer 
 system and notify the sender.  Thank you.
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 

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



RE: DBCP Performance?

2004-09-10 Thread Shapira, Yoav

Hi,
Hmm, with minIdle set to 20 and assuming your test gets one connection
at a time (or less than 20 at a time), I'm a bit confused.

One next step would be to really verify that the pool has available
connections before the get connection call.  You obviously wouldn't do
this in a production application, but this is just for debugging a
performance test.  Cast the DataSource to the concrete implementation
type, probably org.apache.commons.dbcp.BasicDataSource, and call
getNumIdle on it to verify it's a positive number before calling
getConnection.  If it's zero or negative your pool is misconfigured and
you're creating a new connection, hence the slow performance.

Yoav Shapira
Millennium Research Informatics


-Original Message-
From: Henrik Rathje [mailto:[EMAIL PROTECTED]
Sent: Friday, September 10, 2004 11:46 AM
To: Tomcat Users List
Subject: Re: DBCP Performance?

Hi,
The minIdle value during this test was:
parameter
  nameminIdle/name
  value20/value
/parameter
any other suggestions?
Thanks in advance, Henrik



On Fri, 10 Sep 2004 11:21:08 -0400
Shapira, Yoav [EMAIL PROTECTED] wrote:


 Hi,
 The initial connections can be closed if idle, depending on your pool
 configuration, so you might be creating new connections each time
even
 with the pool.  Check your minIdle setting.

 If you're creating a new connection each time, a tiny bit of overhead
 can be expected for a pool over a direct DriverManager call.  But
that
 defeats the purpose of pooling.  If your pool is properly configured
and
 has a connection waiting, it should be a little bit more than a hash
 lookup to return the connection, which would be significantly faster
 than creating a new one.

 Yoav Shapira
 Millennium Research Informatics


 -Original Message-
 From: Henrik Rathje [mailto:[EMAIL PROTECTED]
 Sent: Friday, September 10, 2004 11:16 AM
 To: [EMAIL PROTECTED]
 Subject: DBCP Performance?
 
 Hi,
 has enyone of you recently measured the performance of the DBCP
 Connection Pool? I compared
 
 snip
 long start = System.currentTimeMillis();
 Class.forName(ca.edbc.jdbc.EdbcDriver);
 Connection dbcon = DriverManager.getConnection(loginUrl, loginUser,
 loginPa$
 long diff = System.currentTimeMillis() - start;
 System.out.println(creating connection without pool took:  + diff
+ 
 mil$
 /snip
 
 with
 
 snip
 long start = System.currentTimeMillis();
 Connection dbcon = ds.getConnection( );
 long diff = System.currentTimeMillis() - start;
 System.out.println(creating connection with pool took:  + diff + 
 milise$
 /snip
 
 And got surprisingly results like this:
 
 creating connection without pool took: 465 miliseconds
 creating connection with pool took: 585 miliseconds
 
 In my tests the connection pool is always slower, so what did I do
 wrong?
 I guess this Parameter is responsible for holding active Connections
in
 the Pool:
 parameter
   nameinitialSize/name
   value20/value
 /parameter
 So there shold be active Connections before the getConnection( ) is
 called .. Any ideas?
 Regards, Henrik
 

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




 This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential,
proprietary and/or privileged.  This e-mail is intended only for the
individual(s) to whom it is addressed, and may not be saved, copied,
printed, disclosed or used by anyone else.  If you are not the(an)
intended
recipient, please immediately delete this e-mail from your computer
system
and notify the sender.  Thank you.


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


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




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Tomcat Start.bat and shutdown.bat

2004-09-10 Thread Venkat Radha Venkataramanan
Hongsong:

I tried using the batch files I found in the zipped version.

Here's the problem I am running into.

I have JRE 1.4.2 installed on my machine.

But SetClassPath.bat looks for the following executables in JAVA_HOME:
java.exe
javaw.exe
jdb.exe
javac.exe

In my case, javac.exe and jdb.exe do not exist and as a result, it aborts.

Any ideas?

-Original Message-
From: Hongsong Zhou [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 10, 2004 10:03 AM
To: [EMAIL PROTECTED]
Subject: Re: Tomcat Start.bat and shutdown.bat

http://www.mail-archive.com/[EMAIL PROTECTED]/msg135694.html

 [EMAIL PROTECTED] 09/10/04 08:49AM 
Hello:

 

When I installed Tomcat 5.5.1 on Windows XP Professional, it failed to
create the program group.

 

I understand that it should have created two batch files for starting
and
shutting down the Tomcat instance.

 

Can somebody share with me either the batch files or the command line
for
accomplishing the tasks?

 

Thanks.






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



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



RE: Tomcat Start.bat and shutdown.bat

2004-09-10 Thread Hongsong Zhou
You should install JDK instead of JRE. If you install JDK, you'll have
all these 4 exe files. If you only installed JRE, you'll not be able to
compile servlets and jsps.

 [EMAIL PROTECTED] 09/10/04 11:06AM 
Hongsong:

I tried using the batch files I found in the zipped version.

Here's the problem I am running into.

I have JRE 1.4.2 installed on my machine.

But SetClassPath.bat looks for the following executables in JAVA_HOME:
java.exe
javaw.exe
jdb.exe
javac.exe

In my case, javac.exe and jdb.exe do not exist and as a result, it
aborts.

Any ideas?

-Original Message-
From: Hongsong Zhou [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 10, 2004 10:03 AM
To: [EMAIL PROTECTED] 
Subject: Re: Tomcat Start.bat and shutdown.bat

http://www.mail-archive.com/[EMAIL PROTECTED]/msg135694.html


 [EMAIL PROTECTED] 09/10/04 08:49AM 
Hello:

 

When I installed Tomcat 5.5.1 on Windows XP Professional, it failed to
create the program group.

 

I understand that it should have created two batch files for starting
and
shutting down the Tomcat instance.

 

Can somebody share with me either the batch files or the command line
for
accomplishing the tasks?

 

Thanks.






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



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


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



Re: DBCP Performance?

2004-09-10 Thread Henrik Rathje
Hi,
seems you are rite:

org.apache.commons.dbcp.BasicDataSource source = 
(org.apache.commons.dbcp.BasicDataSource)ds;
  System.out.println(num of idle connections  +  source.getNumIdle() );
  System.out.println(num of max act connections  +  source.getMaxActive()   );
   System.out.println(username  +  source.getUsername()   );

prints:
num of idle connections 0
num of max act connections 0
username tomcat

but why? here is the connection pool configuration:
Resource name=jdbc/sdb-login auth=Container
type=javax.sql.DataSource/ 
  
  ResourceParams name=jdbc/sdb-login
parameter
  namefactory/name
  valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
/parameter
parameter
  namedriverClassName/name
  valueca.edbc.jdbc.EdbcDriver/value
/parameter
parameter
  namepoolPreparedStatements/name
  valuetrue/value
/parameter
parameter
  namedefaultAutoCommit/name
  valuefalse/value
/parameter
parameter
  nameurl/name
  valuejdbc:edbc://localhost:IJ7/sdb/value
/parameter
parameter
  nameusername/name
  valuetomcat/value
/parameter
parameter
  namepassword/name
  valuepasswd ;-)/value
/parameter
parameter
  nameinitialSize/name
  value20/value
/parameter
parameter
  namemaxActive/name
  value0/value
/parameter
parameter
  namemaxIdle/name
  value0/value
/parameter
parameter
  nameminIdle/name
  value20/value
/parameter
parameter
  namemaxWait/name
  value-1/value
/parameter
parameter
  nametestOnBorrow/name
  valuefalse/value
/parameter
  /ResourceParams 
  
Thanks for support, Henrik



On Fri, 10 Sep 2004 11:51:05 -0400
Shapira, Yoav [EMAIL PROTECTED] wrote:

 
 Hi,
 Hmm, with minIdle set to 20 and assuming your test gets one connection
 at a time (or less than 20 at a time), I'm a bit confused.
 
 One next step would be to really verify that the pool has available
 connections before the get connection call.  You obviously wouldn't do
 this in a production application, but this is just for debugging a
 performance test.  Cast the DataSource to the concrete implementation
 type, probably org.apache.commons.dbcp.BasicDataSource, and call
 getNumIdle on it to verify it's a positive number before calling
 getConnection.  If it's zero or negative your pool is misconfigured and
 you're creating a new connection, hence the slow performance.
 
 Yoav Shapira
 Millennium Research Informatics
 
 
 -Original Message-
 From: Henrik Rathje [mailto:[EMAIL PROTECTED]
 Sent: Friday, September 10, 2004 11:46 AM
 To: Tomcat Users List
 Subject: Re: DBCP Performance?
 
 Hi,
 The minIdle value during this test was:
 parameter
   nameminIdle/name
   value20/value
 /parameter
 any other suggestions?
 Thanks in advance, Henrik
 
 
 
 On Fri, 10 Sep 2004 11:21:08 -0400
 Shapira, Yoav [EMAIL PROTECTED] wrote:
 
 
  Hi,
  The initial connections can be closed if idle, depending on your pool
  configuration, so you might be creating new connections each time
 even
  with the pool.  Check your minIdle setting.
 
  If you're creating a new connection each time, a tiny bit of overhead
  can be expected for a pool over a direct DriverManager call.  But
 that
  defeats the purpose of pooling.  If your pool is properly configured
 and
  has a connection waiting, it should be a little bit more than a hash
  lookup to return the connection, which would be significantly faster
  than creating a new one.
 
  Yoav Shapira
  Millennium Research Informatics
 
 
  -Original Message-
  From: Henrik Rathje [mailto:[EMAIL PROTECTED]
  Sent: Friday, September 10, 2004 11:16 AM
  To: [EMAIL PROTECTED]
  Subject: DBCP Performance?
  
  Hi,
  has enyone of you recently measured the performance of the DBCP
  Connection Pool? I compared
  
  snip
  long start = System.currentTimeMillis();
  Class.forName(ca.edbc.jdbc.EdbcDriver);
  Connection dbcon = DriverManager.getConnection(loginUrl, loginUser,
  loginPa$
  long diff = System.currentTimeMillis() - start;
  System.out.println(creating connection without pool took:  + diff
 + 
  mil$
  /snip
  
  with
  
  snip
  long start = System.currentTimeMillis();
  Connection dbcon = ds.getConnection( );
  long diff = System.currentTimeMillis() - start;
  System.out.println(creating connection with pool took:  + diff + 
  milise$
  /snip
  
  And got surprisingly results like this:
  
  creating connection without pool took: 465 miliseconds
  creating connection with pool took: 585 miliseconds
  
  In my tests the connection pool is always slower, so what did I do
  wrong?
  I guess this Parameter is responsible for holding active Connections
 in
  the Pool:
  parameter
nameinitialSize/name
value20/value
  /parameter
  So there shold be active Connections before the getConnection( ) is
  called .. Any ideas?
  Regards, Henrik
  
 
 

RE: Tomcat Start.bat and shutdown.bat

2004-09-10 Thread Shapira, Yoav

Hi,
One of the big Tomcat 5.5 changes is that there's no need for a JDK,
only a JRE.  But maybe there's a bug in the Tomcat 5.5.1
setclasspath.bat ;)

Yoav Shapira
Millennium Research Informatics


-Original Message-
From: Hongsong Zhou [mailto:[EMAIL PROTECTED]
Sent: Friday, September 10, 2004 12:17 PM
To: [EMAIL PROTECTED]
Subject: RE: Tomcat Start.bat and shutdown.bat

You should install JDK instead of JRE. If you install JDK, you'll have
all these 4 exe files. If you only installed JRE, you'll not be able to
compile servlets and jsps.

 [EMAIL PROTECTED] 09/10/04 11:06AM 
Hongsong:

I tried using the batch files I found in the zipped version.

Here's the problem I am running into.

I have JRE 1.4.2 installed on my machine.

But SetClassPath.bat looks for the following executables in JAVA_HOME:
java.exe
javaw.exe
jdb.exe
javac.exe

In my case, javac.exe and jdb.exe do not exist and as a result, it
aborts.

Any ideas?

-Original Message-
From: Hongsong Zhou [mailto:[EMAIL PROTECTED]
Sent: Friday, September 10, 2004 10:03 AM
To: [EMAIL PROTECTED]
Subject: Re: Tomcat Start.bat and shutdown.bat

http://www.mail-archive.com/[EMAIL PROTECTED]/msg135694.ht
ml


 [EMAIL PROTECTED] 09/10/04 08:49AM 
Hello:



When I installed Tomcat 5.5.1 on Windows XP Professional, it failed to
create the program group.



I understand that it should have created two batch files for starting
and
shutting down the Tomcat instance.



Can somebody share with me either the batch files or the command line
for
accomplishing the tasks?



Thanks.






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



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


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




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: DBCP Performance?

2004-09-10 Thread Shapira, Yoav

Hi,
Try minIdle = 19, maxIdle = 20, maxActive = 20, initialSize = 20.  I
think the maxActive 0 effectively means no pooling.

Yoav Shapira
Millennium Research Informatics


-Original Message-
From: Henrik Rathje [mailto:[EMAIL PROTECTED]
Sent: Friday, September 10, 2004 12:20 PM
To: Tomcat Users List
Subject: Re: DBCP Performance?

Hi,
seems you are rite:

org.apache.commons.dbcp.BasicDataSource source =
(org.apache.commons.dbcp.BasicDataSource)ds;
  System.out.println(num of idle connections  +
source.getNumIdle()
);
  System.out.println(num of max act connections  +
source.getMaxActive()   );
   System.out.println(username  +  source.getUsername()   );

prints:
num of idle connections 0
num of max act connections 0
username tomcat

but why? here is the connection pool configuration:
Resource name=jdbc/sdb-login auth=Container
   type=javax.sql.DataSource/

  ResourceParams name=jdbc/sdb-login
parameter
  namefactory/name
  valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
/parameter
parameter
  namedriverClassName/name
  valueca.edbc.jdbc.EdbcDriver/value
/parameter
parameter
  namepoolPreparedStatements/name
  valuetrue/value
/parameter
parameter
  namedefaultAutoCommit/name
  valuefalse/value
/parameter
parameter
  nameurl/name
  valuejdbc:edbc://localhost:IJ7/sdb/value
/parameter
parameter
  nameusername/name
  valuetomcat/value
/parameter
parameter
  namepassword/name
  valuepasswd ;-)/value
/parameter
parameter
  nameinitialSize/name
  value20/value
/parameter
parameter
  namemaxActive/name
  value0/value
/parameter
parameter
  namemaxIdle/name
  value0/value
/parameter
parameter
  nameminIdle/name
  value20/value
/parameter
parameter
  namemaxWait/name
  value-1/value
/parameter
parameter
  nametestOnBorrow/name
  valuefalse/value
/parameter
  /ResourceParams

Thanks for support, Henrik



On Fri, 10 Sep 2004 11:51:05 -0400
Shapira, Yoav [EMAIL PROTECTED] wrote:


 Hi,
 Hmm, with minIdle set to 20 and assuming your test gets one
connection
 at a time (or less than 20 at a time), I'm a bit confused.

 One next step would be to really verify that the pool has available
 connections before the get connection call.  You obviously wouldn't
do
 this in a production application, but this is just for debugging a
 performance test.  Cast the DataSource to the concrete implementation
 type, probably org.apache.commons.dbcp.BasicDataSource, and call
 getNumIdle on it to verify it's a positive number before calling
 getConnection.  If it's zero or negative your pool is misconfigured
and
 you're creating a new connection, hence the slow performance.

 Yoav Shapira
 Millennium Research Informatics


 -Original Message-
 From: Henrik Rathje [mailto:[EMAIL PROTECTED]
 Sent: Friday, September 10, 2004 11:46 AM
 To: Tomcat Users List
 Subject: Re: DBCP Performance?
 
 Hi,
 The minIdle value during this test was:
 parameter
   nameminIdle/name
   value20/value
 /parameter
 any other suggestions?
 Thanks in advance, Henrik
 
 
 
 On Fri, 10 Sep 2004 11:21:08 -0400
 Shapira, Yoav [EMAIL PROTECTED] wrote:
 
 
  Hi,
  The initial connections can be closed if idle, depending on your
pool
  configuration, so you might be creating new connections each time
 even
  with the pool.  Check your minIdle setting.
 
  If you're creating a new connection each time, a tiny bit of
overhead
  can be expected for a pool over a direct DriverManager call.  But
 that
  defeats the purpose of pooling.  If your pool is properly
configured
 and
  has a connection waiting, it should be a little bit more than a
hash
  lookup to return the connection, which would be significantly
faster
  than creating a new one.
 
  Yoav Shapira
  Millennium Research Informatics
 
 
  -Original Message-
  From: Henrik Rathje [mailto:[EMAIL PROTECTED]
  Sent: Friday, September 10, 2004 11:16 AM
  To: [EMAIL PROTECTED]
  Subject: DBCP Performance?
  
  Hi,
  has enyone of you recently measured the performance of the DBCP
  Connection Pool? I compared
  
  snip
  long start = System.currentTimeMillis();
  Class.forName(ca.edbc.jdbc.EdbcDriver);
  Connection dbcon = DriverManager.getConnection(loginUrl,
loginUser,
  loginPa$
  long diff = System.currentTimeMillis() - start;
  System.out.println(creating connection without pool took:  +
diff
 + 
  mil$
  /snip
  
  with
  
  snip
  long start = System.currentTimeMillis();
  Connection dbcon = ds.getConnection( );
  long diff = System.currentTimeMillis() - start;
  System.out.println(creating connection with pool took:  + diff
+ 
  milise$
  /snip
  
  And got surprisingly results like this:
  
  creating connection without pool took: 465 miliseconds
  creating connection with pool took: 585 miliseconds
  
  In my tests the connection pool is always 

RE: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory --help. using Tomcat4.1

2004-09-10 Thread Shilpa Nalgonda

But i use the same configuration and try to connect without using
datasource i have no error.

I have used this code to connect--
Class.forName(oracle.jdbc.driver.OracleDriver);
Connection conn =
DriverManager.getConnection(jdbc:oracle:thin:@IPADDRESS:1521:ODINPRD,
ioeadmin, ioeadmin);


Can i use someother factory instead of
org.apache.commons.dbcp.BasicDataSourceFactory , does that make any
difference...


-Original Message-
From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
Sent: Friday, September 10, 2004 11:28 AM
To: Tomcat Users List
Subject: RE: org.apache.commons.dbcp.SQLNestedException: Cannot create
PoolableConnectionFactory --help. using Tomcat4.1



Hi,
Look at the cause.  The connection is refused by your database.  It's
not a Tomcat problem, it's likely a simple misconfiguration.  Use
another tool to figure out the correct DB connection parameters, or ask
your DBA if you're not sure.

Yoav Shapira
Millennium Research Informatics


-Original Message-
From: Shilpa Nalgonda [mailto:[EMAIL PROTECTED]
Sent: Friday, September 10, 2004 11:17 AM
To: Tomcat Users List
Subject: org.apache.commons.dbcp.SQLNestedException: Cannot create
PoolableConnectionFactory --help. using Tomcat4.1

org.apache.commons.dbcp.SQLNestedException: Cannot create
PoolableConnectionFact
ory, cause:
java.sql.SQLException: Connection
refused(DESCRIPTION=(TMP=)(VSNNUM=135286784)(E
RR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4
at oracle.jdbc.dbaccess.DBError.check_error(DBError.java)
at
oracle.jdbc.driver.OracleConnection.init(OracleConnection.java)
at
oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
va)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java)
at
org.apache.commons.dbcp.DriverConnectionFactory.createConnection(Driv
erConnectionFactory.java:82)
at
org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(Poolable
ConnectionFactory.java:300)
at
org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(Bas
icDataSource.java:838)
at
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou
rce.java:821)
at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource
.java:518)
at
com.mypublisher.oemapi.DAO.DBAccess.getConnection(DBAccess.java:47)
at
com.mypublisher.oemapi.DAO.Persister.init(Persister.java:32)
at org.apache.jsp.test_jsp._jspService(test_jsp.java:56)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)

I have this configuartion in server.xml,

   Context path=/rpcoemapi docBase=rpcoemapi
   debug=5 reloadable=true crossContext=true
useNaming=true

   Logger className=org.apache.catalina.logger.FileLogger
 prefix=localhost_rpcoemapi_log. suffix=.txt
 timestamp=true/
   Resource name=jdbc/DBNAME
   auth=Container
   type=javax.sql.DataSource/

   ResourceParams name=jdbc/DBNAME
   parameter
 namefactory/name
 valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
   /parameter

   !-- Maximum number of dB connections in pool. Make sure you
 configure your mysqld max_connections large enough to handle
 all of your db connections. Set to 0 for no limit.
 --
   parameter
  namemaxActive/name
  value50/value
/parameter

   !-- Maximum number of idle dB connections to retain in pool.
 Set to 0 for no limit.
 --
parameter
 namemaxIdle/name
 value10/value
/parameter

!-- Maximum time to wait for a dB connection to become
available
 in ms, in this example 10 seconds. An Exception is thrown if
 this timeout is exceeded.  Set to -1 to wait indefinitely.
 --
   parameter
 namemaxWait/name
 value1/value
/parameter

   !-- MySQL dB username and password for dB connections  --
   parameter
 nameusername/name
 valueioeadmin/value
   /parameter
   parameter
 namepassword/name
 valueioeadmin/value
   /parameter

   !-- Class name for mm.mysql JDBC driver --
   parameter
 namedriverClassName/name
 valueoracle.jdbc.driver.OracleDriver/value
   /parameter

   !-- The JDBC connection url for connecting to your MySQL dB.
 The autoReconnect=true argument to the url makes sure that the
 mm.mysql JDBC Driver will automatically reconnect if mysqld
closed
the
 connection.  mysqld by default closes idle connections after 8
hours.
 --
   parameter
   nameurl/name

valuejdbc:oracle:thin:@IPADDRESS:1521:DBNAME?autoReconnect=true/valu
e
   /parameter
/ResourceParams
/Context
===

Issue Running Current Forrest Dev under Tomcat 5

2004-09-10 Thread Hare, Michael
Hi,

I am coming from the Forrest Mailing List.
I noticed that forrest 0.6 was causing a problem when trying to access the Tomcat 
homepage.

I first noticed the problem with Tomcat 5.0.27 (I never tried anything earlier), but 
it carries through to 5.0.28 and 5.5.1
(I am currently using Windows XP, SunJava 1.5.0 and Tomcat 5.5.1)

If I put the WAR file generated by Forrest 0.6 into the webapps dir, Tomcat will 
unravel the war and I can even access the Forrest site.
However if I try to access the Tomcat Homepage (http://mysite.com:8080/index.jsp), the 
JSP Samples or the Servlet Examples, I get an HTTP:404 error.

If I remove the war file and the unraveled webapp and restart Tomcat, I can once again 
access the Tomcat Homepage.

I should say that Forrest 0.5.1 does not cause this behavior with Tomcat. Everything 
works fine.

I have taken several stderr.log snapshots, before the forrest 0.6 installation, with 
forrest 0.6 installed and with forrest 0.5.1 installed.

Right off the bat, starting Tomcat with forrest 0.6 war in webapps causes the 
stderr.log to grow 130KB rather than 3KB without forrest.
The stderr.log is full of various errors:

snip
Sep 10, 2004 9:49:10 AM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Logging Error: Could not set up Cocoon Logger, will use screen instead
org.apache.avalon.framework.configuration.ConfigurationException: cannot create 
FileTarget
snip
NFO: Cache file root directory: 
C:\Programs\ApacheGroup\Tomcat5\work\Catalina\localhost\ForrestExamples\cocoon-files
Sep 10, 2004 9:49:23 AM org.apache.tomcat.util.digester.Digester endElement
SEVERE: End event threw exception
java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor22.invoke(Unknown Source)
snip
ep 10, 2004 9:49:23 AM org.apache.catalina.startup.ContextConfig 
processDefaultWebConfig
SEVERE: Parse error in default web.xml
org.apache.commons.logging.LogConfigurationException: 
org.apache.commons.logging.LogConfigurationException: 
java.lang.ClassNotFoundException: org.apache.commons.logging.impl.LogKitLogger (Caused 
by java.lang.ClassNotFoundException: org.apache.commons.logging.impl.LogKitLogger) 
(Caused by org.apache.commons.logging.LogConfigurationException: 
java.lang.ClassNotFoundException: org.apache.commons.logging.impl.LogKitLogger (Caused 
by java.lang.ClassNotFoundException: org.apache.commons.logging.impl.LogKitLogger))
at 
org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2746)
snip

and so on.. These do not appear if forrest 0.6 is not in the picture.

Can anyone help me determine the root cause for this problem?

Thanks,

Mike


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



Re: DBCP Performance?

2004-09-10 Thread Henrik Rathje
Hi,
I tried your settings, but getNumIdle() still returns 0.
Why that?
The maxActive value was 0 because i thought this is neccesary to let 
the pool never run out of connections:
http://jakarta.apache.org/commons/dbcp/configuration.html
maxActive   default:8The maximum number of active connections that can be 
allocated from this pool at the same time, or zero for no limit.
cheers, Henrik

On Fri, 10 Sep 2004 12:23:40 -0400
Shapira, Yoav [EMAIL PROTECTED] wrote:

 
 Hi,
 Try minIdle = 19, maxIdle = 20, maxActive = 20, initialSize = 20.  I
 think the maxActive 0 effectively means no pooling.
 
 Yoav Shapira
 Millennium Research Informatics
 
 
 -Original Message-
 From: Henrik Rathje [mailto:[EMAIL PROTECTED]
 Sent: Friday, September 10, 2004 12:20 PM
 To: Tomcat Users List
 Subject: Re: DBCP Performance?
 
 Hi,
 seems you are rite:
 
 org.apache.commons.dbcp.BasicDataSource source =
 (org.apache.commons.dbcp.BasicDataSource)ds;
   System.out.println(num of idle connections  +
 source.getNumIdle()
 );
   System.out.println(num of max act connections  +
 source.getMaxActive()   );
System.out.println(username  +  source.getUsername()   );
 
 prints:
 num of idle connections 0
 num of max act connections 0
 username tomcat
 
 but why? here is the connection pool configuration:
 Resource name=jdbc/sdb-login auth=Container
  type=javax.sql.DataSource/
 
   ResourceParams name=jdbc/sdb-login
 parameter
   namefactory/name
   valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
 /parameter
 parameter
   namedriverClassName/name
   valueca.edbc.jdbc.EdbcDriver/value
 /parameter
 parameter
   namepoolPreparedStatements/name
   valuetrue/value
 /parameter
 parameter
   namedefaultAutoCommit/name
   valuefalse/value
 /parameter
 parameter
   nameurl/name
   valuejdbc:edbc://localhost:IJ7/sdb/value
 /parameter
 parameter
   nameusername/name
   valuetomcat/value
 /parameter
 parameter
   namepassword/name
   valuepasswd ;-)/value
 /parameter
 parameter
   nameinitialSize/name
   value20/value
 /parameter
 parameter
   namemaxActive/name
   value0/value
 /parameter
 parameter
   namemaxIdle/name
   value0/value
 /parameter
 parameter
   nameminIdle/name
   value20/value
 /parameter
 parameter
   namemaxWait/name
   value-1/value
 /parameter
 parameter
   nametestOnBorrow/name
   valuefalse/value
 /parameter
   /ResourceParams
 
 Thanks for support, Henrik
 
 
 
 On Fri, 10 Sep 2004 11:51:05 -0400
 Shapira, Yoav [EMAIL PROTECTED] wrote:
 
 
  Hi,
  Hmm, with minIdle set to 20 and assuming your test gets one
 connection
  at a time (or less than 20 at a time), I'm a bit confused.
 
  One next step would be to really verify that the pool has available
  connections before the get connection call.  You obviously wouldn't
 do
  this in a production application, but this is just for debugging a
  performance test.  Cast the DataSource to the concrete implementation
  type, probably org.apache.commons.dbcp.BasicDataSource, and call
  getNumIdle on it to verify it's a positive number before calling
  getConnection.  If it's zero or negative your pool is misconfigured
 and
  you're creating a new connection, hence the slow performance.
 
  Yoav Shapira
  Millennium Research Informatics
 
 
  -Original Message-
  From: Henrik Rathje [mailto:[EMAIL PROTECTED]
  Sent: Friday, September 10, 2004 11:46 AM
  To: Tomcat Users List
  Subject: Re: DBCP Performance?
  
  Hi,
  The minIdle value during this test was:
  parameter
nameminIdle/name
value20/value
  /parameter
  any other suggestions?
  Thanks in advance, Henrik
  
  
  
  On Fri, 10 Sep 2004 11:21:08 -0400
  Shapira, Yoav [EMAIL PROTECTED] wrote:
  
  
   Hi,
   The initial connections can be closed if idle, depending on your
 pool
   configuration, so you might be creating new connections each time
  even
   with the pool.  Check your minIdle setting.
  
   If you're creating a new connection each time, a tiny bit of
 overhead
   can be expected for a pool over a direct DriverManager call.  But
  that
   defeats the purpose of pooling.  If your pool is properly
 configured
  and
   has a connection waiting, it should be a little bit more than a
 hash
   lookup to return the connection, which would be significantly
 faster
   than creating a new one.
  
   Yoav Shapira
   Millennium Research Informatics
  
  
   -Original Message-
   From: Henrik Rathje [mailto:[EMAIL PROTECTED]
   Sent: Friday, September 10, 2004 11:16 AM
   To: [EMAIL PROTECTED]
   Subject: DBCP Performance?
   
   Hi,
   has enyone of you recently measured the performance of the DBCP
   Connection Pool? I compared
   
   snip
   long start = System.currentTimeMillis();
   Class.forName(ca.edbc.jdbc.EdbcDriver);
   

Re: DBCP Performance?

2004-09-10 Thread Henrik Rathje
I have to correct myself:
getNumIdle() returned 19 after a little bit of waiting.
but getConnection( ) still takes 1238 miliseconds.
Henrik


On Fri, 10 Sep 2004 18:47:46 +0200
Henrik Rathje [EMAIL PROTECTED] wrote:

 Hi,
 I tried your settings, but getNumIdle() still returns 0.
 Why that?
 The maxActive value was 0 because i thought this is neccesary to let 
 the pool never run out of connections:
 http://jakarta.apache.org/commons/dbcp/configuration.html
 maxActive default:8The maximum number of active connections that can be 
 allocated from this pool at the same time, or zero for no limit.
 cheers, Henrik
 
 On Fri, 10 Sep 2004 12:23:40 -0400
 Shapira, Yoav [EMAIL PROTECTED] wrote:
 
  
  Hi,
  Try minIdle = 19, maxIdle = 20, maxActive = 20, initialSize = 20.  I
  think the maxActive 0 effectively means no pooling.
  
  Yoav Shapira
  Millennium Research Informatics
  
  
  -Original Message-
  From: Henrik Rathje [mailto:[EMAIL PROTECTED]
  Sent: Friday, September 10, 2004 12:20 PM
  To: Tomcat Users List
  Subject: Re: DBCP Performance?
  
  Hi,
  seems you are rite:
  
  org.apache.commons.dbcp.BasicDataSource source =
  (org.apache.commons.dbcp.BasicDataSource)ds;
System.out.println(num of idle connections  +
  source.getNumIdle()
  );
System.out.println(num of max act connections  +
  source.getMaxActive()   );
 System.out.println(username  +  source.getUsername()   );
  
  prints:
  num of idle connections 0
  num of max act connections 0
  username tomcat
  
  but why? here is the connection pool configuration:
  Resource name=jdbc/sdb-login auth=Container
 type=javax.sql.DataSource/
  
ResourceParams name=jdbc/sdb-login
  parameter
namefactory/name
valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
  /parameter
  parameter
namedriverClassName/name
valueca.edbc.jdbc.EdbcDriver/value
  /parameter
  parameter
namepoolPreparedStatements/name
valuetrue/value
  /parameter
  parameter
namedefaultAutoCommit/name
valuefalse/value
  /parameter
  parameter
nameurl/name
valuejdbc:edbc://localhost:IJ7/sdb/value
  /parameter
  parameter
nameusername/name
valuetomcat/value
  /parameter
  parameter
namepassword/name
valuepasswd ;-)/value
  /parameter
  parameter
nameinitialSize/name
value20/value
  /parameter
  parameter
namemaxActive/name
value0/value
  /parameter
  parameter
namemaxIdle/name
value0/value
  /parameter
  parameter
nameminIdle/name
value20/value
  /parameter
  parameter
namemaxWait/name
value-1/value
  /parameter
  parameter
nametestOnBorrow/name
valuefalse/value
  /parameter
/ResourceParams
  
  Thanks for support, Henrik
  
  
  
  On Fri, 10 Sep 2004 11:51:05 -0400
  Shapira, Yoav [EMAIL PROTECTED] wrote:
  
  
   Hi,
   Hmm, with minIdle set to 20 and assuming your test gets one
  connection
   at a time (or less than 20 at a time), I'm a bit confused.
  
   One next step would be to really verify that the pool has available
   connections before the get connection call.  You obviously wouldn't
  do
   this in a production application, but this is just for debugging a
   performance test.  Cast the DataSource to the concrete implementation
   type, probably org.apache.commons.dbcp.BasicDataSource, and call
   getNumIdle on it to verify it's a positive number before calling
   getConnection.  If it's zero or negative your pool is misconfigured
  and
   you're creating a new connection, hence the slow performance.
  
   Yoav Shapira
   Millennium Research Informatics
  
  
   -Original Message-
   From: Henrik Rathje [mailto:[EMAIL PROTECTED]
   Sent: Friday, September 10, 2004 11:46 AM
   To: Tomcat Users List
   Subject: Re: DBCP Performance?
   
   Hi,
   The minIdle value during this test was:
   parameter
 nameminIdle/name
 value20/value
   /parameter
   any other suggestions?
   Thanks in advance, Henrik
   
   
   
   On Fri, 10 Sep 2004 11:21:08 -0400
   Shapira, Yoav [EMAIL PROTECTED] wrote:
   
   
Hi,
The initial connections can be closed if idle, depending on your
  pool
configuration, so you might be creating new connections each time
   even
with the pool.  Check your minIdle setting.
   
If you're creating a new connection each time, a tiny bit of
  overhead
can be expected for a pool over a direct DriverManager call.  But
   that
defeats the purpose of pooling.  If your pool is properly
  configured
   and
has a connection waiting, it should be a little bit more than a
  hash
lookup to return the connection, which would be significantly
  faster
than creating a new one.
   
Yoav Shapira
Millennium Research Informatics
   
   

Re: DBCP Performance?

2004-09-10 Thread Peter Lin
wow, that just seems wrong. Have you tried other jdbc drivers?  I know
from first hand experience with Oracle's jdbc driver, w/o pooling it's
minimum of 100ms to get connection. With pooling, it's usually less
than 5ms.

peter


On Fri, 10 Sep 2004 18:56:42 +0200, Henrik Rathje [EMAIL PROTECTED] wrote:
 I have to correct myself:
 getNumIdle() returned 19 after a little bit of waiting.
 but getConnection( ) still takes 1238 miliseconds.
 Henrik
 
 On Fri, 10 Sep 2004 18:47:46 +0200
 
 
 Henrik Rathje [EMAIL PROTECTED] wrote:
 
  Hi,
  I tried your settings, but getNumIdle() still returns 0.
  Why that?
  The maxActive value was 0 because i thought this is neccesary to let
  the pool never run out of connections:
  http://jakarta.apache.org/commons/dbcp/configuration.html
  maxActive default:8The maximum number of active connections that can 
  be allocated from this pool at the same time, or zero for no limit.
  cheers, Henrik
 
  On Fri, 10 Sep 2004 12:23:40 -0400
  Shapira, Yoav [EMAIL PROTECTED] wrote:
 
  
   Hi,
   Try minIdle = 19, maxIdle = 20, maxActive = 20, initialSize = 20.  I
   think the maxActive 0 effectively means no pooling.
  
   Yoav Shapira
   Millennium Research Informatics
  
  
   -Original Message-
   From: Henrik Rathje [mailto:[EMAIL PROTECTED]
   Sent: Friday, September 10, 2004 12:20 PM
   To: Tomcat Users List
   Subject: Re: DBCP Performance?
   
   Hi,
   seems you are rite:
   
   org.apache.commons.dbcp.BasicDataSource source =
   (org.apache.commons.dbcp.BasicDataSource)ds;
 System.out.println(num of idle connections  +
   source.getNumIdle()
   );
 System.out.println(num of max act connections  +
   source.getMaxActive()   );
  System.out.println(username  +  source.getUsername()   );
   
   prints:
   num of idle connections 0
   num of max act connections 0
   username tomcat
   
   but why? here is the connection pool configuration:
   Resource name=jdbc/sdb-login auth=Container
  type=javax.sql.DataSource/
   
 ResourceParams name=jdbc/sdb-login
   parameter
 namefactory/name
 valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
   /parameter
   parameter
 namedriverClassName/name
 valueca.edbc.jdbc.EdbcDriver/value
   /parameter
   parameter
 namepoolPreparedStatements/name
 valuetrue/value
   /parameter
   parameter
 namedefaultAutoCommit/name
 valuefalse/value
   /parameter
   parameter
 nameurl/name
 valuejdbc:edbc://localhost:IJ7/sdb/value
   /parameter
   parameter
 nameusername/name
 valuetomcat/value
   /parameter
   parameter
 namepassword/name
 valuepasswd ;-)/value
   /parameter
   parameter
 nameinitialSize/name
 value20/value
   /parameter
   parameter
 namemaxActive/name
 value0/value
   /parameter
   parameter
 namemaxIdle/name
 value0/value
   /parameter
   parameter
 nameminIdle/name
 value20/value
   /parameter
   parameter
 namemaxWait/name
 value-1/value
   /parameter
   parameter
 nametestOnBorrow/name
 valuefalse/value
   /parameter
 /ResourceParams
   
   Thanks for support, Henrik
   
   
   
   On Fri, 10 Sep 2004 11:51:05 -0400
   Shapira, Yoav [EMAIL PROTECTED] wrote:
   
   
Hi,
Hmm, with minIdle set to 20 and assuming your test gets one
   connection
at a time (or less than 20 at a time), I'm a bit confused.
   
One next step would be to really verify that the pool has available
connections before the get connection call.  You obviously wouldn't
   do
this in a production application, but this is just for debugging a
performance test.  Cast the DataSource to the concrete implementation
type, probably org.apache.commons.dbcp.BasicDataSource, and call
getNumIdle on it to verify it's a positive number before calling
getConnection.  If it's zero or negative your pool is misconfigured
   and
you're creating a new connection, hence the slow performance.
   
Yoav Shapira
Millennium Research Informatics
   
   
-Original Message-
From: Henrik Rathje [mailto:[EMAIL PROTECTED]
Sent: Friday, September 10, 2004 11:46 AM
To: Tomcat Users List
Subject: Re: DBCP Performance?

Hi,
The minIdle value during this test was:
parameter
  nameminIdle/name
  value20/value
/parameter
any other suggestions?
Thanks in advance, Henrik



On Fri, 10 Sep 2004 11:21:08 -0400
Shapira, Yoav [EMAIL PROTECTED] wrote:


 Hi,
 The initial connections can be closed if idle, depending on your
   pool
 configuration, so you might be creating new connections each time
even
 with the pool.  Check your minIdle setting.

 If you're 

mod_jk2 : apr_socket_send error

2004-09-10 Thread Jacques Poulin
Hi,

I am hosted on linux (I'm pretty sure it's redhat, but not 100%), with
apache 2.0.40 running to handle my Perl scripts.

I want to be able to run Tomcat side-by-side with Apache to handle all JSP
requests.  I hope that I'm right in figuring out that mod_jk2 is the module
that I need... (please correct me if I'm wrong).

I installed Tomcat 5.0 just fine.  If I do a telnet localhost 8080, and type
GET /, I get the You installed Tomcat successfully page.

I initially got a binary of mod_jk2.so, and installed it in my Apache
modules directory, and added LoadModule jk2_module modules/mod_jk2.so to
httpd.conf.

I got the following error :

Cannot load /etc/httpd/modules/mod_jk2.so into server:
/etc/httpd/modules/mod_jk2.so: undefined symbol: apr_socket_send


I tried downloading the source and building it instead, but ended up with
the same message.


I was hoping someone could help me.  I've seen a lot of messages in the
archive about the apr_socket_send message, but couldn't make sense of them.



Thanks.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.752 / Virus Database: 503 - Release Date: 2004-09-03


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



Re: mod_jk2 : apr_socket_send error

2004-09-10 Thread QM
On Fri, Sep 10, 2004 at 01:03:42PM -0400, Jacques Poulin wrote:
: Cannot load /etc/httpd/modules/mod_jk2.so into server:
: /etc/httpd/modules/mod_jk2.so: undefined symbol: apr_socket_send
:  [snip]
: I was hoping someone could help me.  I've seen a lot of messages in the
: archive about the apr_socket_send message, but couldn't make sense of them.

Do a search on mod_jk2.so: undefined symbol instead, you'll turn up
more messages and likely explanations to go with them.

This topic comes up frequently. ;)

-QM

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


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



Re: DBCP Performance?

2004-09-10 Thread Henrik Rathje
hi,
im note sure if there exists another jdbc driver for ingres beside 
the one i use. can this really be a driver issue?
which connectionpool did you use while doing the measurements for your
'so you want high performance' paper?
regards, henrik


On Fri, 10 Sep 2004 12:02:13 -0500
Peter Lin [EMAIL PROTECTED] wrote:

 wow, that just seems wrong. Have you tried other jdbc drivers?  I know
 from first hand experience with Oracle's jdbc driver, w/o pooling it's
 minimum of 100ms to get connection. With pooling, it's usually less
 than 5ms.
 
 peter
 
 
 On Fri, 10 Sep 2004 18:56:42 +0200, Henrik Rathje [EMAIL PROTECTED] wrote:
  I have to correct myself:
  getNumIdle() returned 19 after a little bit of waiting.
  but getConnection( ) still takes 1238 miliseconds.
  Henrik
  
  On Fri, 10 Sep 2004 18:47:46 +0200
  
  
  Henrik Rathje [EMAIL PROTECTED] wrote:
  
   Hi,
   I tried your settings, but getNumIdle() still returns 0.
   Why that?
   The maxActive value was 0 because i thought this is neccesary to let
   the pool never run out of connections:
   http://jakarta.apache.org/commons/dbcp/configuration.html
   maxActive default:8The maximum number of active connections that can 
   be allocated from this pool at the same time, or zero for no limit.
   cheers, Henrik
  
   On Fri, 10 Sep 2004 12:23:40 -0400
   Shapira, Yoav [EMAIL PROTECTED] wrote:
  
   
Hi,
Try minIdle = 19, maxIdle = 20, maxActive = 20, initialSize = 20.  I
think the maxActive 0 effectively means no pooling.
   
Yoav Shapira
Millennium Research Informatics
   
   
-Original Message-
From: Henrik Rathje [mailto:[EMAIL PROTECTED]
Sent: Friday, September 10, 2004 12:20 PM
To: Tomcat Users List
Subject: Re: DBCP Performance?

Hi,
seems you are rite:

org.apache.commons.dbcp.BasicDataSource source =
(org.apache.commons.dbcp.BasicDataSource)ds;
  System.out.println(num of idle connections  +
source.getNumIdle()
);
  System.out.println(num of max act connections  +
source.getMaxActive()   );
   System.out.println(username  +  source.getUsername()   );

prints:
num of idle connections 0
num of max act connections 0
username tomcat

but why? here is the connection pool configuration:
Resource name=jdbc/sdb-login auth=Container
   type=javax.sql.DataSource/

  ResourceParams name=jdbc/sdb-login
parameter
  namefactory/name
  valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
/parameter
parameter
  namedriverClassName/name
  valueca.edbc.jdbc.EdbcDriver/value
/parameter
parameter
  namepoolPreparedStatements/name
  valuetrue/value
/parameter
parameter
  namedefaultAutoCommit/name
  valuefalse/value
/parameter
parameter
  nameurl/name
  valuejdbc:edbc://localhost:IJ7/sdb/value
/parameter
parameter
  nameusername/name
  valuetomcat/value
/parameter
parameter
  namepassword/name
  valuepasswd ;-)/value
/parameter
parameter
  nameinitialSize/name
  value20/value
/parameter
parameter
  namemaxActive/name
  value0/value
/parameter
parameter
  namemaxIdle/name
  value0/value
/parameter
parameter
  nameminIdle/name
  value20/value
/parameter
parameter
  namemaxWait/name
  value-1/value
/parameter
parameter
  nametestOnBorrow/name
  valuefalse/value
/parameter
  /ResourceParams

Thanks for support, Henrik



On Fri, 10 Sep 2004 11:51:05 -0400
Shapira, Yoav [EMAIL PROTECTED] wrote:


 Hi,
 Hmm, with minIdle set to 20 and assuming your test gets one
connection
 at a time (or less than 20 at a time), I'm a bit confused.

 One next step would be to really verify that the pool has available
 connections before the get connection call.  You obviously wouldn't
do
 this in a production application, but this is just for debugging a
 performance test.  Cast the DataSource to the concrete implementation
 type, probably org.apache.commons.dbcp.BasicDataSource, and call
 getNumIdle on it to verify it's a positive number before calling
 getConnection.  If it's zero or negative your pool is misconfigured
and
 you're creating a new connection, hence the slow performance.

 Yoav Shapira
 Millennium Research Informatics


 -Original Message-
 From: Henrik Rathje [mailto:[EMAIL PROTECTED]
 Sent: Friday, September 10, 2004 11:46 AM
 To: Tomcat Users List
 Subject: Re: DBCP Performance?
 
 Hi,
 The minIdle value during this test was:
 

Re: DBCP Performance?

2004-09-10 Thread Peter Lin
I used oracle's drivers :)

since I'm most experienced with Oracle and I have it installed at home
for development.

peter


On Fri, 10 Sep 2004 19:11:53 +0200, Henrik Rathje [EMAIL PROTECTED] wrote:
 hi,
 im note sure if there exists another jdbc driver for ingres beside
 the one i use. can this really be a driver issue?
 which connectionpool did you use while doing the measurements for your
 'so you want high performance' paper?
 regards, henrik
 
 On Fri, 10 Sep 2004 12:02:13 -0500
 
 
 Peter Lin [EMAIL PROTECTED] wrote:
 
  wow, that just seems wrong. Have you tried other jdbc drivers?  I know
  from first hand experience with Oracle's jdbc driver, w/o pooling it's
  minimum of 100ms to get connection. With pooling, it's usually less
  than 5ms.
 
  peter
 
 
  On Fri, 10 Sep 2004 18:56:42 +0200, Henrik Rathje [EMAIL PROTECTED] wrote:
   I have to correct myself:
   getNumIdle() returned 19 after a little bit of waiting.
   but getConnection( ) still takes 1238 miliseconds.
   Henrik
  
   On Fri, 10 Sep 2004 18:47:46 +0200
  
  
   Henrik Rathje [EMAIL PROTECTED] wrote:
  
Hi,
I tried your settings, but getNumIdle() still returns 0.
Why that?
The maxActive value was 0 because i thought this is neccesary to let
the pool never run out of connections:
http://jakarta.apache.org/commons/dbcp/configuration.html
maxActive default:8The maximum number of active connections that 
can be allocated from this pool at the same time, or zero for no limit.
cheers, Henrik
   
On Fri, 10 Sep 2004 12:23:40 -0400
Shapira, Yoav [EMAIL PROTECTED] wrote:
   

 Hi,
 Try minIdle = 19, maxIdle = 20, maxActive = 20, initialSize = 20.  I
 think the maxActive 0 effectively means no pooling.

 Yoav Shapira
 Millennium Research Informatics


 -Original Message-
 From: Henrik Rathje [mailto:[EMAIL PROTECTED]
 Sent: Friday, September 10, 2004 12:20 PM
 To: Tomcat Users List
 Subject: Re: DBCP Performance?
 
 Hi,
 seems you are rite:
 
 org.apache.commons.dbcp.BasicDataSource source =
 (org.apache.commons.dbcp.BasicDataSource)ds;
   System.out.println(num of idle connections  +
 source.getNumIdle()
 );
   System.out.println(num of max act connections  +
 source.getMaxActive()   );
System.out.println(username  +  source.getUsername()   );
 
 prints:
 num of idle connections 0
 num of max act connections 0
 username tomcat
 
 but why? here is the connection pool configuration:
 Resource name=jdbc/sdb-login auth=Container
type=javax.sql.DataSource/
 
   ResourceParams name=jdbc/sdb-login
 parameter
   namefactory/name
   valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
 /parameter
 parameter
   namedriverClassName/name
   valueca.edbc.jdbc.EdbcDriver/value
 /parameter
 parameter
   namepoolPreparedStatements/name
   valuetrue/value
 /parameter
 parameter
   namedefaultAutoCommit/name
   valuefalse/value
 /parameter
 parameter
   nameurl/name
   valuejdbc:edbc://localhost:IJ7/sdb/value
 /parameter
 parameter
   nameusername/name
   valuetomcat/value
 /parameter
 parameter
   namepassword/name
   valuepasswd ;-)/value
 /parameter
 parameter
   nameinitialSize/name
   value20/value
 /parameter
 parameter
   namemaxActive/name
   value0/value
 /parameter
 parameter
   namemaxIdle/name
   value0/value
 /parameter
 parameter
   nameminIdle/name
   value20/value
 /parameter
 parameter
   namemaxWait/name
   value-1/value
 /parameter
 parameter
   nametestOnBorrow/name
   valuefalse/value
 /parameter
   /ResourceParams
 
 Thanks for support, Henrik
 
 
 
 On Fri, 10 Sep 2004 11:51:05 -0400
 Shapira, Yoav [EMAIL PROTECTED] wrote:
 
 
  Hi,
  Hmm, with minIdle set to 20 and assuming your test gets one
 connection
  at a time (or less than 20 at a time), I'm a bit confused.
 
  One next step would be to really verify that the pool has available
  connections before the get connection call.  You obviously wouldn't
 do
  this in a production application, but this is just for debugging a
  performance test.  Cast the DataSource to the concrete implementation
  type, probably org.apache.commons.dbcp.BasicDataSource, and call
  getNumIdle on it to verify it's a positive number before calling
  getConnection.  If it's zero or negative your pool is misconfigured
 and
  you're creating a new connection, hence 

Re: DBCP Performance - solved.

2004-09-10 Thread Henrik Rathje
Hi,
i did not change any settings, no restart and no anything; but now the timings are:
67 miliseconds pool
956 miliseconds nopool.
seems it simply takes several minutes until the pool is ready to use.
sorry for asking those stupid questions + thanks for helping,
Henrik 



On Fri, 10 Sep 2004 12:16:18 -0500
Peter Lin [EMAIL PROTECTED] wrote:

 I used oracle's drivers :)
 
 since I'm most experienced with Oracle and I have it installed at home
 for development.
 
 peter
 
 
 On Fri, 10 Sep 2004 19:11:53 +0200, Henrik Rathje [EMAIL PROTECTED] wrote:
  hi,
  im note sure if there exists another jdbc driver for ingres beside
  the one i use. can this really be a driver issue?
  which connectionpool did you use while doing the measurements for your
  'so you want high performance' paper?
  regards, henrik
  
  On Fri, 10 Sep 2004 12:02:13 -0500
  
  
  Peter Lin [EMAIL PROTECTED] wrote:
  
   wow, that just seems wrong. Have you tried other jdbc drivers?  I know
   from first hand experience with Oracle's jdbc driver, w/o pooling it's
   minimum of 100ms to get connection. With pooling, it's usually less
   than 5ms.
  
   peter
  
  
   On Fri, 10 Sep 2004 18:56:42 +0200, Henrik Rathje [EMAIL PROTECTED] wrote:
I have to correct myself:
getNumIdle() returned 19 after a little bit of waiting.
but getConnection( ) still takes 1238 miliseconds.
Henrik
   
On Fri, 10 Sep 2004 18:47:46 +0200
   
   
Henrik Rathje [EMAIL PROTECTED] wrote:
   
 Hi,
 I tried your settings, but getNumIdle() still returns 0.
 Why that?
 The maxActive value was 0 because i thought this is neccesary to let
 the pool never run out of connections:
 http://jakarta.apache.org/commons/dbcp/configuration.html
 maxActive default:8The maximum number of active connections that 
 can be allocated from this pool at the same time, or zero for no limit.
 cheers, Henrik

 On Fri, 10 Sep 2004 12:23:40 -0400
 Shapira, Yoav [EMAIL PROTECTED] wrote:

 
  Hi,
  Try minIdle = 19, maxIdle = 20, maxActive = 20, initialSize = 20.  I
  think the maxActive 0 effectively means no pooling.
 
  Yoav Shapira
  Millennium Research Informatics
 
 
  -Original Message-
  From: Henrik Rathje [mailto:[EMAIL PROTECTED]
  Sent: Friday, September 10, 2004 12:20 PM
  To: Tomcat Users List
  Subject: Re: DBCP Performance?
  
  Hi,
  seems you are rite:
  
  org.apache.commons.dbcp.BasicDataSource source =
  (org.apache.commons.dbcp.BasicDataSource)ds;
System.out.println(num of idle connections  +
  source.getNumIdle()
  );
System.out.println(num of max act connections  +
  source.getMaxActive()   );
 System.out.println(username  +  source.getUsername()   );
  
  prints:
  num of idle connections 0
  num of max act connections 0
  username tomcat
  
  but why? here is the connection pool configuration:
  Resource name=jdbc/sdb-login auth=Container
 type=javax.sql.DataSource/
  
ResourceParams name=jdbc/sdb-login
  parameter
namefactory/name
valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
  /parameter
  parameter
namedriverClassName/name
valueca.edbc.jdbc.EdbcDriver/value
  /parameter
  parameter
namepoolPreparedStatements/name
valuetrue/value
  /parameter
  parameter
namedefaultAutoCommit/name
valuefalse/value
  /parameter
  parameter
nameurl/name
valuejdbc:edbc://localhost:IJ7/sdb/value
  /parameter
  parameter
nameusername/name
valuetomcat/value
  /parameter
  parameter
namepassword/name
valuepasswd ;-)/value
  /parameter
  parameter
nameinitialSize/name
value20/value
  /parameter
  parameter
namemaxActive/name
value0/value
  /parameter
  parameter
namemaxIdle/name
value0/value
  /parameter
  parameter
nameminIdle/name
value20/value
  /parameter
  parameter
namemaxWait/name
value-1/value
  /parameter
  parameter
nametestOnBorrow/name
valuefalse/value
  /parameter
/ResourceParams
  
  Thanks for support, Henrik
  
  
  
  On Fri, 10 Sep 2004 11:51:05 -0400
  Shapira, Yoav [EMAIL PROTECTED] wrote:
  
  
   Hi,
   Hmm, with minIdle set to 20 and assuming your test gets one
  connection
   at a time (or less than 20 at a time), I'm a bit confused.
  
   One next step would be to really verify that the pool has 

RE: Issue Running Current Forrest Dev under Tomcat 5

2004-09-10 Thread Shapira, Yoav

Hi,
How does Forrest 0.6 configure (or try to) its logging?

Yoav Shapira
Millennium Research Informatics


-Original Message-
From: Hare, Michael [mailto:[EMAIL PROTECTED]
Sent: Friday, September 10, 2004 12:38 PM
To: Tomcat Users List
Subject: Issue Running Current Forrest Dev under Tomcat 5

Hi,

I am coming from the Forrest Mailing List.
I noticed that forrest 0.6 was causing a problem when trying to access
the
Tomcat homepage.

I first noticed the problem with Tomcat 5.0.27 (I never tried anything
earlier), but it carries through to 5.0.28 and 5.5.1
(I am currently using Windows XP, SunJava 1.5.0 and Tomcat 5.5.1)

If I put the WAR file generated by Forrest 0.6 into the webapps dir,
Tomcat
will unravel the war and I can even access the Forrest site.
However if I try to access the Tomcat Homepage
(http://mysite.com:8080/index.jsp), the JSP Samples or the Servlet
Examples, I get an HTTP:404 error.

If I remove the war file and the unraveled webapp and restart Tomcat, I
can
once again access the Tomcat Homepage.

I should say that Forrest 0.5.1 does not cause this behavior with
Tomcat.
Everything works fine.

I have taken several stderr.log snapshots, before the forrest 0.6
installation, with forrest 0.6 installed and with forrest 0.5.1
installed.

Right off the bat, starting Tomcat with forrest 0.6 war in webapps
causes
the stderr.log to grow 130KB rather than 3KB without forrest.
The stderr.log is full of various errors:

snip
Sep 10, 2004 9:49:10 AM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Logging Error: Could not set up Cocoon Logger, will use screen instead
org.apache.avalon.framework.configuration.ConfigurationException:
cannot
create FileTarget
snip
NFO: Cache file root directory:
C:\Programs\ApacheGroup\Tomcat5\work\Catalina\localhost\ForrestExamples
\coc
oon-files
Sep 10, 2004 9:49:23 AM org.apache.tomcat.util.digester.Digester
endElement
SEVERE: End event threw exception
java.lang.reflect.InvocationTargetException
   at sun.reflect.GeneratedMethodAccessor22.invoke(Unknown Source)
snip
ep 10, 2004 9:49:23 AM org.apache.catalina.startup.ContextConfig
processDefaultWebConfig
SEVERE: Parse error in default web.xml
org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurationException:
java.lang.ClassNotFoundException:
org.apache.commons.logging.impl.LogKitLogger (Caused by
java.lang.ClassNotFoundException:
org.apache.commons.logging.impl.LogKitLogger) (Caused by
org.apache.commons.logging.LogConfigurationException:
java.lang.ClassNotFoundException:
org.apache.commons.logging.impl.LogKitLogger (Caused by
java.lang.ClassNotFoundException:
org.apache.commons.logging.impl.LogKitLogger))
   at
org.apache.tomcat.util.digester.Digester.createSAXException(Digester.ja
va:2
746)
snip

and so on.. These do not appear if forrest 0.6 is not in the picture.

Can anyone help me determine the root cause for this problem?

Thanks,

Mike


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




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory --help. using Tomcat4.1

2004-09-10 Thread Shapira, Yoav

Hi,
It just occurred to me that at some point the DBCP configuration changed
from username to user as the user name parameter.  Try changing
username to user in your configuration file and restarting Tomcat.

Yoav Shapira
Millennium Research Informatics


-Original Message-
From: Shilpa Nalgonda [mailto:[EMAIL PROTECTED]
Sent: Friday, September 10, 2004 12:21 PM
To: Tomcat Users List
Subject: RE: org.apache.commons.dbcp.SQLNestedException: Cannot create
PoolableConnectionFactory --help. using Tomcat4.1


But i use the same configuration and try to connect without using
datasource i have no error.

I have used this code to connect--
Class.forName(oracle.jdbc.driver.OracleDriver);
Connection conn =
DriverManager.getConnection(jdbc:oracle:thin:@IPADDRESS:1521:ODINPRD,
ioeadmin, ioeadmin);


Can i use someother factory instead of
org.apache.commons.dbcp.BasicDataSourceFactory , does that make any
difference...


-Original Message-
From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
Sent: Friday, September 10, 2004 11:28 AM
To: Tomcat Users List
Subject: RE: org.apache.commons.dbcp.SQLNestedException: Cannot create
PoolableConnectionFactory --help. using Tomcat4.1



Hi,
Look at the cause.  The connection is refused by your database.  It's
not a Tomcat problem, it's likely a simple misconfiguration.  Use
another tool to figure out the correct DB connection parameters, or ask
your DBA if you're not sure.

Yoav Shapira
Millennium Research Informatics


-Original Message-
From: Shilpa Nalgonda [mailto:[EMAIL PROTECTED]
Sent: Friday, September 10, 2004 11:17 AM
To: Tomcat Users List
Subject: org.apache.commons.dbcp.SQLNestedException: Cannot create
PoolableConnectionFactory --help. using Tomcat4.1

org.apache.commons.dbcp.SQLNestedException: Cannot create
PoolableConnectionFact
ory, cause:
java.sql.SQLException: Connection
refused(DESCRIPTION=(TMP=)(VSNNUM=135286784)(E
RR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4
at oracle.jdbc.dbaccess.DBError.check_error(DBError.java)
at
oracle.jdbc.driver.OracleConnection.init(OracleConnection.java)
at
oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
va)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java)
at
org.apache.commons.dbcp.DriverConnectionFactory.createConnection(Driv
erConnectionFactory.java:82)
at
org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(Poolable
ConnectionFactory.java:300)
at
org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(Bas
icDataSource.java:838)
at
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou
rce.java:821)
at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource
.java:518)
at
com.mypublisher.oemapi.DAO.DBAccess.getConnection(DBAccess.java:47)
at
com.mypublisher.oemapi.DAO.Persister.init(Persister.java:32)
at org.apache.jsp.test_jsp._jspService(test_jsp.java:56)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)

I have this configuartion in server.xml,

  Context path=/rpcoemapi docBase=rpcoemapi
  debug=5 reloadable=true crossContext=true
useNaming=true

  Logger className=org.apache.catalina.logger.FileLogger
 prefix=localhost_rpcoemapi_log. suffix=.txt
 timestamp=true/
   Resource name=jdbc/DBNAME
   auth=Container
   type=javax.sql.DataSource/

  ResourceParams name=jdbc/DBNAME
  parameter
namefactory/name

valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
  /parameter

  !-- Maximum number of dB connections in pool. Make sure you
 configure your mysqld max_connections large enough to handle
 all of your db connections. Set to 0 for no limit.
 --
  parameter
  namemaxActive/name
  value50/value
/parameter

  !-- Maximum number of idle dB connections to retain in pool.
 Set to 0 for no limit.
 --
parameter
 namemaxIdle/name
 value10/value
/parameter

   !-- Maximum time to wait for a dB connection to become
available
 in ms, in this example 10 seconds. An Exception is thrown if
 this timeout is exceeded.  Set to -1 to wait indefinitely.
 --
  parameter
 namemaxWait/name
 value1/value
/parameter

  !-- MySQL dB username and password for dB connections  --
  parameter
nameusername/name
valueioeadmin/value
  /parameter
  parameter
namepassword/name
valueioeadmin/value
  /parameter

  !-- Class name for mm.mysql JDBC driver --
  parameter
namedriverClassName/name
valueoracle.jdbc.driver.OracleDriver/value
  /parameter

  !-- The JDBC connection url for 

Re: DBCP Performance - solved.

2004-09-10 Thread Peter Lin
it's an easy mistake to make. the usual trick to benchmark and
performance testing is to prime the server a bit.   we've all made
that mistake at some point.

peter


On Fri, 10 Sep 2004 19:35:43 +0200, Henrik Rathje [EMAIL PROTECTED] wrote:
 Hi,
 i did not change any settings, no restart and no anything; but now the timings are:
 67 miliseconds pool
 956 miliseconds nopool.
 seems it simply takes several minutes until the pool is ready to use.
 sorry for asking those stupid questions + thanks for helping,
 Henrik


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



RE: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory --help. using Tomcat4.1

2004-09-10 Thread Shilpa Nalgonda
When i do that i get invalid arguments error..

-Original Message-
From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
Sent: Friday, September 10, 2004 1:38 PM
To: Tomcat Users List
Subject: RE: org.apache.commons.dbcp.SQLNestedException: Cannot create
PoolableConnectionFactory --help. using Tomcat4.1



Hi,
It just occurred to me that at some point the DBCP configuration changed
from username to user as the user name parameter.  Try changing
username to user in your configuration file and restarting Tomcat.

Yoav Shapira
Millennium Research Informatics


-Original Message-
From: Shilpa Nalgonda [mailto:[EMAIL PROTECTED]
Sent: Friday, September 10, 2004 12:21 PM
To: Tomcat Users List
Subject: RE: org.apache.commons.dbcp.SQLNestedException: Cannot create
PoolableConnectionFactory --help. using Tomcat4.1


But i use the same configuration and try to connect without using
datasource i have no error.

I have used this code to connect--
Class.forName(oracle.jdbc.driver.OracleDriver);
Connection conn =
DriverManager.getConnection(jdbc:oracle:thin:@IPADDRESS:1521:ODINPRD,
ioeadmin, ioeadmin);


Can i use someother factory instead of
org.apache.commons.dbcp.BasicDataSourceFactory , does that make any
difference...


-Original Message-
From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
Sent: Friday, September 10, 2004 11:28 AM
To: Tomcat Users List
Subject: RE: org.apache.commons.dbcp.SQLNestedException: Cannot create
PoolableConnectionFactory --help. using Tomcat4.1



Hi,
Look at the cause.  The connection is refused by your database.  It's
not a Tomcat problem, it's likely a simple misconfiguration.  Use
another tool to figure out the correct DB connection parameters, or ask
your DBA if you're not sure.

Yoav Shapira
Millennium Research Informatics


-Original Message-
From: Shilpa Nalgonda [mailto:[EMAIL PROTECTED]
Sent: Friday, September 10, 2004 11:17 AM
To: Tomcat Users List
Subject: org.apache.commons.dbcp.SQLNestedException: Cannot create
PoolableConnectionFactory --help. using Tomcat4.1

org.apache.commons.dbcp.SQLNestedException: Cannot create
PoolableConnectionFact
ory, cause:
java.sql.SQLException: Connection
refused(DESCRIPTION=(TMP=)(VSNNUM=135286784)(E
RR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4
at oracle.jdbc.dbaccess.DBError.check_error(DBError.java)
at
oracle.jdbc.driver.OracleConnection.init(OracleConnection.java)
at
oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
va)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java)
at
org.apache.commons.dbcp.DriverConnectionFactory.createConnection(Driv
erConnectionFactory.java:82)
at
org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(Poolable
ConnectionFactory.java:300)
at
org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(Bas
icDataSource.java:838)
at
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou
rce.java:821)
at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource
.java:518)
at
com.mypublisher.oemapi.DAO.DBAccess.getConnection(DBAccess.java:47)
at
com.mypublisher.oemapi.DAO.Persister.init(Persister.java:32)
at org.apache.jsp.test_jsp._jspService(test_jsp.java:56)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)

I have this configuartion in server.xml,

  Context path=/rpcoemapi docBase=rpcoemapi
  debug=5 reloadable=true crossContext=true
useNaming=true

  Logger className=org.apache.catalina.logger.FileLogger
 prefix=localhost_rpcoemapi_log. suffix=.txt
 timestamp=true/
   Resource name=jdbc/DBNAME
   auth=Container
   type=javax.sql.DataSource/

  ResourceParams name=jdbc/DBNAME
  parameter
namefactory/name

valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
  /parameter

  !-- Maximum number of dB connections in pool. Make sure you
 configure your mysqld max_connections large enough to handle
 all of your db connections. Set to 0 for no limit.
 --
  parameter
  namemaxActive/name
  value50/value
/parameter

  !-- Maximum number of idle dB connections to retain in pool.
 Set to 0 for no limit.
 --
parameter
 namemaxIdle/name
 value10/value
/parameter

   !-- Maximum time to wait for a dB connection to become
available
 in ms, in this example 10 seconds. An Exception is thrown if
 this timeout is exceeded.  Set to -1 to wait indefinitely.
 --
  parameter
 namemaxWait/name
 value1/value
/parameter

  !-- MySQL dB username and password for dB connections  --
  parameter
nameusername/name
valueioeadmin/value
  /parameter
  

RE: Issue Running Current Forrest Dev under Tomcat 5

2004-09-10 Thread Hare, Michael
Hi Yoav,

The only log files I find for forrest are located in forrest's WEB-INF/logs
directory under webapps.
The log files are 9 of them and they are all empty.

Other than that I do not know how forrest performs logging.

- m

-Original Message-
From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
Sent: Friday, September 10, 2004 12:37 PM
To: Tomcat Users List
Subject: RE: Issue Running Current Forrest Dev under Tomcat 5



Hi,
How does Forrest 0.6 configure (or try to) its logging?

Yoav Shapira
Millennium Research Informatics


-Original Message-
From: Hare, Michael [mailto:[EMAIL PROTECTED]
Sent: Friday, September 10, 2004 12:38 PM
To: Tomcat Users List
Subject: Issue Running Current Forrest Dev under Tomcat 5

Hi,

I am coming from the Forrest Mailing List.
I noticed that forrest 0.6 was causing a problem when trying to access
the
Tomcat homepage.

I first noticed the problem with Tomcat 5.0.27 (I never tried anything
earlier), but it carries through to 5.0.28 and 5.5.1
(I am currently using Windows XP, SunJava 1.5.0 and Tomcat 5.5.1)

If I put the WAR file generated by Forrest 0.6 into the webapps dir,
Tomcat
will unravel the war and I can even access the Forrest site.
However if I try to access the Tomcat Homepage
(http://mysite.com:8080/index.jsp), the JSP Samples or the Servlet
Examples, I get an HTTP:404 error.

If I remove the war file and the unraveled webapp and restart Tomcat, I
can
once again access the Tomcat Homepage.

I should say that Forrest 0.5.1 does not cause this behavior with
Tomcat.
Everything works fine.

I have taken several stderr.log snapshots, before the forrest 0.6
installation, with forrest 0.6 installed and with forrest 0.5.1
installed.

Right off the bat, starting Tomcat with forrest 0.6 war in webapps
causes
the stderr.log to grow 130KB rather than 3KB without forrest.
The stderr.log is full of various errors:

snip
Sep 10, 2004 9:49:10 AM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Logging Error: Could not set up Cocoon Logger, will use screen instead
org.apache.avalon.framework.configuration.ConfigurationException:
cannot
create FileTarget
snip
NFO: Cache file root directory:
C:\Programs\ApacheGroup\Tomcat5\work\Catalina\localhost\ForrestExamples
\coc
oon-files
Sep 10, 2004 9:49:23 AM org.apache.tomcat.util.digester.Digester
endElement
SEVERE: End event threw exception
java.lang.reflect.InvocationTargetException
   at sun.reflect.GeneratedMethodAccessor22.invoke(Unknown Source)
snip
ep 10, 2004 9:49:23 AM org.apache.catalina.startup.ContextConfig
processDefaultWebConfig
SEVERE: Parse error in default web.xml
org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurationException:
java.lang.ClassNotFoundException:
org.apache.commons.logging.impl.LogKitLogger (Caused by
java.lang.ClassNotFoundException:
org.apache.commons.logging.impl.LogKitLogger) (Caused by
org.apache.commons.logging.LogConfigurationException:
java.lang.ClassNotFoundException:
org.apache.commons.logging.impl.LogKitLogger (Caused by
java.lang.ClassNotFoundException:
org.apache.commons.logging.impl.LogKitLogger))
   at
org.apache.tomcat.util.digester.Digester.createSAXException(Digester.ja
va:2
746)
snip

and so on.. These do not appear if forrest 0.6 is not in the picture.

Can anyone help me determine the root cause for this problem?

Thanks,

Mike


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




This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential, proprietary
and/or privileged.  This e-mail is intended only for the individual(s) to
whom it is addressed, and may not be saved, copied, printed, disclosed or
used by anyone else.  If you are not the(an) intended recipient, please
immediately delete this e-mail from your computer system and notify the
sender.  Thank you.


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

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



RE: How to create/run a Java Service on UNIX

2004-09-10 Thread Daxin Zuo
First I thank very much for the replies. Please continue forward
instruction.
this service, written in Java,  will serves two applications: one is online
with Tomcat, and another one is an offline application. these two
applications will sometimes update the same data tables. This service will
provide unique keys, and do something else for these two applications.

This service will not depend on if Tomcat is running or not.
I want this service on UNIX runs automatically when the computer is started,
and keep running.

Thanks.

-Original Message-
From: John Najarian [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 09, 2004 8:35 PM
To: 'Tomcat Users List'
Subject: RE: How to create/run a Java Service on UNIX


It's very easy to launch a Java daemon in Linux/Unix.
It used to be difficult  require some JNI programming.
On the GNU site I found a slick way someone wronte in
Java and it is simple.  What I wanted to know from the
person asking the question is what they're trying to do
with the 'Service'. 'Service' this is Unix not winblows.
Get with the correct lingo! - LOL!

-Original Message-
From: John Gentilin [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 09, 2004 7:08 PM
To: Tomcat Users List
Subject: Re: How to create/run a Java Service on UNIX

Sorry, missed the beginning of this thread but..

I have this book
http://half.ebay.com/cat/buy/prod.cgi?cpid=282172meta_id=1
and I use it often. It has a very good section on how to create a single or
multi threaded server. It does not go into how to launch this process as
a daemon thread under Unix. I think all you really need to do is launch the
process as a background task by appending the  to the end of the
command line.
Look at the tomcat Catalina.sh as an example of a startup script to run the
service in the background.

HTH
-John G

Daxin Zuo wrote:

The program is written as Java class. Does it requires special functions?
How to make it a service, keep running and ready to provid data?
Thanks.

-Original Message-
From: Mike Curwen [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 09, 2004 3:30 PM
To: 'Tomcat Users List'
Subject: RE: How to create/run a Java Service on UNIX


So you've already written this java program, and it has a public static
void
main() method, and it all interfaces properly with what you need it to, and
you just want to know how to make it start when your UNIX box starts?

Or you haven't written the program yet at all, and you want to know how to
go about doing so?




-Original Message-
From: Daxin Zuo [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 09, 2004 5:19 PM
To: Tomcat Users List
Subject: RE: How to create/run a Java Service on UNIX


Yes. It keep running and sometimes it replies and provides
some data for other applications.

-Original Message-
From: John Najarian [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 09, 2004 2:59 PM
To: 'Tomcat Users List'
Subject: RE: How to create/run a Java Service on UNIX


Do you want to run this as a daemon?





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


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





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




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


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



RE: How to create/run a Java Service on UNIX

2004-09-10 Thread John Najarian
Hi Daxin,

   How are you going to genereate the keys?  Via the database?  Also, seeing
as you are going to use 'service' with  without Tomcat I'd like to know if
either application will be up as long as the server(s) is up.  If that's the
case you could have both applications check at startup if the daemon is
active(running) or not not.  If the daemon isn't active either application
could start it.  If this service should be up whenever the hardware is up
you could start the service on boot so it is in theory always available to
the 2 applications when they are started but each must check if the daemon
is running prior to accessing the daemon.

   The person who recommended learning daemons was entirely right and
without my knowing more of the 2 applications I can not tell you more except
since tomcat will access he daemon, I would look closely at the framework in
Jakarta to see if it will suit both applications.  I haven't looked at it
closely and it Tomcat must be running for the daemon to be running(which I
doubt) I wouldn't utilize that framework.

-Original Message-
From: Daxin Zuo [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 10, 2004 12:03 PM
To: Tomcat Users List
Subject: RE: How to create/run a Java Service on UNIX

First I thank very much for the replies. Please continue forward
instruction.
this service, written in Java,  will serves two applications: one is online
with Tomcat, and another one is an offline application. these two
applications will sometimes update the same data tables. This service will
provide unique keys, and do something else for these two applications.

This service will not depend on if Tomcat is running or not.
I want this service on UNIX runs automatically when the computer is started,
and keep running.

Thanks.

-Original Message-
From: John Najarian [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 09, 2004 8:35 PM
To: 'Tomcat Users List'
Subject: RE: How to create/run a Java Service on UNIX


It's very easy to launch a Java daemon in Linux/Unix.
It used to be difficult  require some JNI programming.
On the GNU site I found a slick way someone wronte in
Java and it is simple.  What I wanted to know from the
person asking the question is what they're trying to do
with the 'Service'. 'Service' this is Unix not winblows.
Get with the correct lingo! - LOL!

-Original Message-
From: John Gentilin [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 09, 2004 7:08 PM
To: Tomcat Users List
Subject: Re: How to create/run a Java Service on UNIX

Sorry, missed the beginning of this thread but..

I have this book
http://half.ebay.com/cat/buy/prod.cgi?cpid=282172meta_id=1
and I use it often. It has a very good section on how to create a single or
multi threaded server. It does not go into how to launch this process as
a daemon thread under Unix. I think all you really need to do is launch the
process as a background task by appending the  to the end of the
command line.
Look at the tomcat Catalina.sh as an example of a startup script to run the
service in the background.

HTH
-John G

Daxin Zuo wrote:

The program is written as Java class. Does it requires special functions?
How to make it a service, keep running and ready to provid data?
Thanks.

-Original Message-
From: Mike Curwen [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 09, 2004 3:30 PM
To: 'Tomcat Users List'
Subject: RE: How to create/run a Java Service on UNIX


So you've already written this java program, and it has a public static
void
main() method, and it all interfaces properly with what you need it to, and
you just want to know how to make it start when your UNIX box starts?

Or you haven't written the program yet at all, and you want to know how to
go about doing so?




-Original Message-
From: Daxin Zuo [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 09, 2004 5:19 PM
To: Tomcat Users List
Subject: RE: How to create/run a Java Service on UNIX


Yes. It keep running and sometimes it replies and provides
some data for other applications.

-Original Message-
From: John Najarian [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 09, 2004 2:59 PM
To: 'Tomcat Users List'
Subject: RE: How to create/run a Java Service on UNIX


Do you want to run this as a daemon?





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


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





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




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



RE: How to create/run a Java Service on UNIX

2004-09-10 Thread Mike Curwen
I think we should assume that 'the program' will function correctly and do
what it's advertised to do, since if that was the actual problem, then a
list like 'java-rmi-user' or 'java-io-user' would be more appropriate. 

The tomcat application, and that second application should be coded to
handle the cases when 'the program' is not available. If that's still a
problem, refer to the aformentioned, fictious(?) groups.  

All that remains is how do I get 'the program' to run? Oddly enough,
that's still not tomcat-user, but hey we like to help out.
 
For that (as Yoav said), you need a *nix admin type person to write some rc
scripts for you, or investigate how to do so for yourself. Find a BB or
other email-user list for the exact flavour of *nix you are running, and ask
about rc.d scripts on that list. (rc.d is the approximate equivalent on
*nix, of the Windows Services control panel).




 -Original Message-
 From: John Najarian [mailto:[EMAIL PROTECTED] 
 Sent: Friday, September 10, 2004 2:28 PM
 To: 'Tomcat Users List'
 Subject: RE: How to create/run a Java Service on UNIX
 
 
 Hi Daxin,
 
How are you going to genereate the keys?  Via the 
 database?  Also, seeing as you are going to use 'service' 
 with  without Tomcat I'd like to know if either application 
 will be up as long as the server(s) is up.  If that's the 
 case you could have both applications check at startup if the 
 daemon is
 active(running) or not not.  If the daemon isn't active 
 either application could start it.  If this service should be 
 up whenever the hardware is up you could start the service on 
 boot so it is in theory always available to the 2 
 applications when they are started but each must check if the 
 daemon is running prior to accessing the daemon.
 
The person who recommended learning daemons was entirely 
 right and without my knowing more of the 2 applications I can 
 not tell you more except since tomcat will access he daemon, 
 I would look closely at the framework in Jakarta to see if it 
 will suit both applications.  I haven't looked at it closely 
 and it Tomcat must be running for the daemon to be running(which I
 doubt) I wouldn't utilize that framework.
 


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



Re: How to create/run a Java Service on UNIX

2004-09-10 Thread Tom Simons
Are you just looking for Unix to start a daemon every time it boots? 
That's typically done via a shell script, which accepts start 
stop arguments (sometimes start_msg  stop_msg, too).  These
scripts are in /etc/init.d (/sbin/init.d for HPUX), and there are
corresponding links in /etc/rc.* directories.  Your flavor of Unix
will execute these scripts at boot time (with startup as the arg). 
You just need to make that script execute your application program or
script.  Check out the scripts you already have - for example, the
lp daemon on my system has the usual shell script and 2 links:
find /sbin -name '*lp*' | xargs ls -l  # change /sbin to
/etc, if not HPUX
-r-xr-xr-x   1 bin  bin  1604 Oct 27  1997 /sbin/init.d/lp
lrwxr-xr-x  1 root sys15 Nov 16  2001 /sbin/rc1.d/K280lp -
/sbin/init.d/lp
lrwxr-xr-x  1 root sys15 Nov 16  2001 /sbin/rc2.d/S720lp -
/sbin/init.d/lp


On Fri, 10 Sep 2004 12:02:36 -0700, Daxin Zuo [EMAIL PROTECTED] wrote:
 First I thank very much for the replies. Please continue forward
 instruction.
 this service, written in Java,  will serves two applications: one is online
 with Tomcat, and another one is an offline application. these two
 applications will sometimes update the same data tables. This service will
 provide unique keys, and do something else for these two applications.
 
 This service will not depend on if Tomcat is running or not.
 I want this service on UNIX runs automatically when the computer is started,
 and keep running.
 
 Thanks.
 
 -Original Message-
 From: John Najarian [mailto:[EMAIL PROTECTED]
 Sent: Thursday, September 09, 2004 8:35 PM
 To: 'Tomcat Users List'
 Subject: RE: How to create/run a Java Service on UNIX
 
 It's very easy to launch a Java daemon in Linux/Unix.
 It used to be difficult  require some JNI programming.
 On the GNU site I found a slick way someone wronte in
 Java and it is simple.  What I wanted to know from the
 person asking the question is what they're trying to do
 with the 'Service'. 'Service' this is Unix not winblows.
 Get with the correct lingo! - LOL!
 
 -Original Message-
 From: John Gentilin [mailto:[EMAIL PROTECTED]
 Sent: Thursday, September 09, 2004 7:08 PM
 To: Tomcat Users List
 Subject: Re: How to create/run a Java Service on UNIX
 
 Sorry, missed the beginning of this thread but..
 
 I have this book
 http://half.ebay.com/cat/buy/prod.cgi?cpid=282172meta_id=1
 and I use it often. It has a very good section on how to create a single or
 multi threaded server. It does not go into how to launch this process as
 a daemon thread under Unix. I think all you really need to do is launch the
 process as a background task by appending the  to the end of the
 command line.
 Look at the tomcat Catalina.sh as an example of a startup script to run the
 service in the background.
 
 HTH
 -John G
 
 Daxin Zuo wrote:
 
 The program is written as Java class. Does it requires special functions?
 How to make it a service, keep running and ready to provid data?
 Thanks.
 
 -Original Message-
 From: Mike Curwen [mailto:[EMAIL PROTECTED]
 Sent: Thursday, September 09, 2004 3:30 PM
 To: 'Tomcat Users List'
 Subject: RE: How to create/run a Java Service on UNIX
 
 
 So you've already written this java program, and it has a public static
 void
 main() method, and it all interfaces properly with what you need it to, and
 you just want to know how to make it start when your UNIX box starts?
 
 Or you haven't written the program yet at all, and you want to know how to
 go about doing so?
 
 
 

 
 -Original Message-
 From: Daxin Zuo [mailto:[EMAIL PROTECTED]
 Sent: Thursday, September 09, 2004 5:19 PM
 To: Tomcat Users List
 Subject: RE: How to create/run a Java Service on UNIX
 
 
 Yes. It keep running and sometimes it replies and provides
 some data for other applications.
 
 -Original Message-
 From: John Najarian [mailto:[EMAIL PROTECTED]
 Sent: Thursday, September 09, 2004 2:59 PM
 To: 'Tomcat Users List'
 Subject: RE: How to create/run a Java Service on UNIX
 
 
 Do you want to run this as a daemon?
 
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 



at the tomcat start up...log4j error..

2004-09-10 Thread Shilpa Nalgonda
log4j:WARN No appenders could be found for logger
(org.apache.commons.digester.D
igester).
log4j:WARN Please initialize the log4j system properly.
Starting service Tomcat-Standalone

I am getting the above error as the tomcat starts up, i hav elog4j.jar under
commom/lib and log4j.proprties
under webapps/myapps/WEB-INF/lib... any clue..



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



RE: How to create/run a Java Service on UNIX

2004-09-10 Thread Daxin Zuo
Thank John, Mike, and Tom, and all other repliers.

I hope Tome's instruction will work. I left UNIX for a long time. What Tom
told is familiar to me. I will test it after next week.
It is still a (rare) case that the Sever is not up when one of the
applications talks to it. In this rare case, I can try else way.

Thanks again.

-Original Message-
From: Tom Simons [mailto:[EMAIL PROTECTED]
Sent: Friday, September 10, 2004 1:31 PM
To: Tomcat Users List
Subject: Re: How to create/run a Java Service on UNIX


Are you just looking for Unix to start a daemon every time it boots?
That's typically done via a shell script, which accepts start 
stop arguments (sometimes start_msg  stop_msg, too).  These
scripts are in /etc/init.d (/sbin/init.d for HPUX), and there are
corresponding links in /etc/rc.* directories.  Your flavor of Unix
will execute these scripts at boot time (with startup as the arg).
You just need to make that script execute your application program or
script.  Check out the scripts you already have - for example, the
lp daemon on my system has the usual shell script and 2 links:
find /sbin -name '*lp*' | xargs ls -l  # change /sbin to
/etc, if not HPUX
-r-xr-xr-x   1 bin  bin  1604 Oct 27  1997 /sbin/init.d/lp
lrwxr-xr-x  1 root sys15 Nov 16  2001 /sbin/rc1.d/K280lp -
/sbin/init.d/lp
lrwxr-xr-x  1 root sys15 Nov 16  2001 /sbin/rc2.d/S720lp -
/sbin/init.d/lp


On Fri, 10 Sep 2004 12:02:36 -0700, Daxin Zuo [EMAIL PROTECTED] wrote:
 First I thank very much for the replies. Please continue forward
 instruction.
 this service, written in Java,  will serves two applications: one is
online
 with Tomcat, and another one is an offline application. these two
 applications will sometimes update the same data tables. This service will
 provide unique keys, and do something else for these two applications.

 This service will not depend on if Tomcat is running or not.
 I want this service on UNIX runs automatically when the computer is
started,
 and keep running.

 Thanks.

 -Original Message-
 From: John Najarian [mailto:[EMAIL PROTECTED]
 Sent: Thursday, September 09, 2004 8:35 PM
 To: 'Tomcat Users List'
 Subject: RE: How to create/run a Java Service on UNIX

 It's very easy to launch a Java daemon in Linux/Unix.
 It used to be difficult  require some JNI programming.
 On the GNU site I found a slick way someone wronte in
 Java and it is simple.  What I wanted to know from the
 person asking the question is what they're trying to do
 with the 'Service'. 'Service' this is Unix not winblows.
 Get with the correct lingo! - LOL!

 -Original Message-
 From: John Gentilin [mailto:[EMAIL PROTECTED]
 Sent: Thursday, September 09, 2004 7:08 PM
 To: Tomcat Users List
 Subject: Re: How to create/run a Java Service on UNIX

 Sorry, missed the beginning of this thread but..

 I have this book
 http://half.ebay.com/cat/buy/prod.cgi?cpid=282172meta_id=1
 and I use it often. It has a very good section on how to create a single
or
 multi threaded server. It does not go into how to launch this process as
 a daemon thread under Unix. I think all you really need to do is launch
the
 process as a background task by appending the  to the end of the
 command line.
 Look at the tomcat Catalina.sh as an example of a startup script to run
the
 service in the background.

 HTH
 -John G

 Daxin Zuo wrote:

 The program is written as Java class. Does it requires special functions?
 How to make it a service, keep running and ready to provid data?
 Thanks.
 
 -Original Message-
 From: Mike Curwen [mailto:[EMAIL PROTECTED]
 Sent: Thursday, September 09, 2004 3:30 PM
 To: 'Tomcat Users List'
 Subject: RE: How to create/run a Java Service on UNIX
 
 
 So you've already written this java program, and it has a public static
 void
 main() method, and it all interfaces properly with what you need it to,
and
 you just want to know how to make it start when your UNIX box starts?
 
 Or you haven't written the program yet at all, and you want to know how
to
 go about doing so?
 
 
 

 
 -Original Message-
 From: Daxin Zuo [mailto:[EMAIL PROTECTED]
 Sent: Thursday, September 09, 2004 5:19 PM
 To: Tomcat Users List
 Subject: RE: How to create/run a Java Service on UNIX
 
 
 Yes. It keep running and sometimes it replies and provides
 some data for other applications.
 
 -Original Message-
 From: John Najarian [mailto:[EMAIL PROTECTED]
 Sent: Thursday, September 09, 2004 2:59 PM
 To: 'Tomcat Users List'
 Subject: RE: How to create/run a Java Service on UNIX
 
 
 Do you want to run this as a daemon?
 
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

 

Re: Running EXE CGI's from Tomcat 5.0.28

2004-09-10 Thread Benjamin Goldsmith
That's the solution.  Thanks!  Set executable to an empty string.  Thanks!
Mike Curwen wrote:
Try this:
http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topicf=56t=
002491

 

-Original Message-
From: Benjamin Goldsmith [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 09, 2004 8:38 PM
To: [EMAIL PROTECTED]
Subject: Running EXE CGI's from Tomcat 5.0.28

Is it possible to run EXE cgi's from Tomcat 5.0 on Win XP SP2?
   


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

--
Benjamin Goldsmith [EMAIL PROTECTED]
Meaning Master Technologies


How to make Apache direct Servlet to Tomcat

2004-09-10 Thread Daxin Zuo
My Apache 2.0.49  Tomcat 5.0.19, windows 2000. (Soon I will move them to
UNIX)
I have a difficult in running servlet from Apache.
For example I have a servlet TestServlet.class (package: myServlet) in
C:\Program Files\Apache
Group\Apache2\tomcat\webapps\ROOT\WEB-INF\classes\myServlet\
I register this servlet in  \tomcat\webapps\ROOT\WEB-INF\web.xml:

  servlet
servlet-nameTestServlet/servlet-name
servlet-classTestServlet/servlet-class
  /servlet
  servlet-mapping
servlet-nameTestServlet/servlet-name
url-pattern/TestServlet/url-pattern
  /servlet-mapping

Tomcat port is 8008
When I run http://localhost:8008/TestServlet, it runs correctly.
Apache port is 82
I cannot start it with http://localhost:82/TestServlet. -- The page cannot
be found

My Aache and Tomcat is connected correctly. All JSP files can run on both.
For example, I have a jsp file
C:\Program Files\Apache
Group\Apache2\tomcat\webapps\ROOT\testJSP\testDBPool.jsp.
I can run http://localhost:82/testJSP/testDBPool.jsp
or http://localhost:8008/testJSP/testDBPool.jsp

in workers2.properties, I have:

[uri:/myServlet/*]
group=lb

[uri:/WEB-INF/*]
group=lb

[uri:/WEB-INF/classes/*]
group=lb


Please forward your instruction.

Thanks.


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



RE: [OFF-TOPIC]Yoav -- RE: Some pretty basic Tomcat ConnectionPooling Questions????

2004-09-10 Thread Luke (Terry) Vanderfluit
Hi Yoav and all,

Thanks for your reply,

 But you went a bit too far: the DataSource lookup is potentially
 expensive.  That you can do in the init() method and keep a reference to
 the DataSource, because keeping that reference doesn't use a connection
 resource.
 Then in your servlet methods, get a connection from the DataSource, use
 it, and release it.
 In your servlet destroy method, null out your DataSource reference. 
 So the DataSource lookup is done once, the DataSource reference is kept
 as a private non-static member variable of the servlet class, and the
 Connenctions are used only within methods, they're not class member
 variables.

So now I have changed my code to:
1. Declaration of private global variables:
code
   private Context ctx = null;
   private DataSource ds = null;
   private Connection conn;
/code

2. an init() method:
code
// init does DataSource lookup
   public void init(ServletConfig config) throws ServletException {
  super.init(config);
  try {
 ctx = new InitialContext();
 if(ctx == null) {
throw new Exception(No Context);
 }
 ds = (DataSource)ctx.lookup(java:comp/env/jdbc/mb);
  } // end try block
  catch(Exception e) {
 e.printStackTrace();
  }
   } // end init()
/code

3. an openConnection() method:
code
   private void openConnection() {
  try {
 if(ds != null) {
conn = ds.getConnection();
if(conn != null) {
   message = Got Connection to DB  + conn.toString();
   }
}
 } // end try block
  catch(Exception e) {
 e.printStackTrace();
 }
  } //end method openConnection()
/code

4. a destroy() method that nulls the DataSource:
code
   public void destroy() {
   ds = null;
   }
/code

remarks
-the conn.close() is called in the methods that call openConnection().
-I'm thinking of doing an 'include' for the openConnection method, so I
don't have the code for the same method sitting in multiple classes.
Would that be a good idea? (maintainability, yes but in terms of
overhead?)
/remarks

Would this be the 'leanest' scenario for a database connection?
thanks again,
Luke

-- 

Luke (Terry) Vanderfluit 
Mobile: 0421 276 282 



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



Re: at the tomcat start up...log4j error..

2004-09-10 Thread Jacob Kjome
At 05:21 PM 9/10/2004 -0400, you wrote:
log4j:WARN No appenders could be found for logger
(org.apache.commons.digester.D
igester).
log4j:WARN Please initialize the log4j system properly.
Starting service Tomcat-Standalone
I am getting the above error as the tomcat starts up, i hav elog4j.jar under
commom/lib and log4j.proprties
under webapps/myapps/WEB-INF/lib... any clue..
Tomcat itself won't see the log4j.properties in your webapp.  There are two 
issues here:

1.  Log4j tries to perform autoconfiguration at Tomcat startup and isn't 
finding a config file.  The solution here is to put a simple 
log4j.properties or log4j.xml file in common/classes

2.  Log4j won't perform automatic configuration for your webapp since the 
one in common/lib can't see WEB-INF/classes.  In this case, there are a few 
different solutions
   a.  add a copy of log4j.jar to WEB-INF/lib and your config file to 
WEB-INF/classes and autoconfiguration will happen and only affect your 
webapp logging.

   b.  perform manual configuration at webapp startup and provide Log4j 
with the URL of the config file.  However, keep in mind that this will 
configure logging not only for your webapp, but also for any other app that 
is using Log4j.  This is because Log4j is global to all apps.  The solution 
is to do as described in a or do c below...

   c.  use a repository selector so that Log4j can be global, but use a 
separate logger repository for each application.  This is certainly more 
complex than a, but it is a good option.  See more here...
http://wiki.apache.org/logging-log4j/AppContainerLogging

If you check out the log4j-sandbox code mentioned at that link, make sure 
to checkout the 0_3_alpha tag, as there are certain files that are required 
that were removed from the HEAD branch because they were moved into 
Log4j-1.3 HEAD.

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