RE: Tomcat reboot runtime

2004-05-14 Thread Richard Calosso
The script will need to be a 2 stage process otherwise the kill tomcat
command will kill your shell as part of its shutdown sequence and the rest
of your script will not execute (no restart).

Stage 1. - start disconnected sub shell for process 2
Stage 2. - kill tomcat, sleep, start tomcat

In most UNIX shell these is a nohup command that disconnects the shell for
daemon processing that should work.  You can either script both parts or
build the correct nohup shell and do stage 2 from java.

-Original Message-
From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 13, 2004 9:02 AM
To: Tomcat Users List
Subject: RE: Tomcat reboot runtime



Hi,
What's running your program (in order to wait and issue a startup
command) after you've done a shutdown? ;)  

(Unless you're talking about highly tomcat-specific code that shuts down
tomcat and leaves the JVM itself running)

Yoav Shapira
Millennium Research Informatics


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Thursday, May 13, 2004 11:55 AM
To: Tomcat Users List
Subject: RE: Tomcat reboot runtime

Personally, I don't see why the scheme that Adam came up with wouldn't
work. You would want your program to do a shutdown, wait, then issue a
startup command.

--Tim Sabin




Shapira, Yoav [EMAIL PROTECTED]
05/13/2004 11:23 AM
Please respond to
Tomcat Users List [EMAIL PROTECTED]


To
Tomcat Users List [EMAIL PROTECTED]
cc

Subject
RE: Tomcat reboot runtime







Hi,
I, on the other hand, would be interested to see what you come up with,
so don't stop your train of thought on my account.

Yoav Shapira
Millennium Research Informatics


-Original Message-
From: Adam Buglass [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 13, 2004 11:13 AM
To: Tomcat Users List
Subject: RE: Tomcat reboot runtime

Wouldn't it be possible to restart tomcat by writing a server-side
program to trigger a shell-script?? Of course that may disrupt the
operation of the website itself - I'd have to consult the docs to be
clearer on that.

If Yoav says it can't be done then I'm sure we'd be wasting our time
by
trying!  ;-)

However I'm curious, just thinking off the top of my head! :-)

Adam

On Thu, 2004-05-13 at 15:56, Shapira, Yoav wrote:
 Hi,
 No to both.

 Yoav Shapira
 Millennium Research Informatics


 -Original Message-
 From: Rudolf Feyerkleist [mailto:[EMAIL PROTECTED]
 Sent: Thursday, May 13, 2004 8:11 AM
 To: [EMAIL PROTECTED]
 Subject: Tomcat reboot runtime
 
 Is there a way to restart tomcat from a webapplication running on
 tomcat?
 Or is there a way for canges to the server.xml of tomcat to become
 effective at runtime?
 
 __
 Do You Yahoo!?
 Tired of spam?  Yahoo! Mail has the best spam protection around
 http://mail.yahoo.com



 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 no



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

Adam Buglass,  
The Golden Freeway,
Department of Child Health,
University of Newcastle-upon-Tyne.
Royal Victoria Infirmary.

(0191) 2023062

Democracy is two wolves and a lamb voting on what to have for lunch.
Liberty is a well-armed lamb contesting the vote.
~Benjamin Franklin, 1759


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





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]




JDBC Source getting null url

2004-05-10 Thread Richard Calosso



I just started to 
try and use a database source for some of my pages in my web app and am not 
getting a connection. I am using Tomcat 5.0.19 with JRE 1.4.2_04 on redhat 
9 with mysql. Every time I try to connect I get a exception saying 
Datasource invalid, not suitable driver for class '' url null (actual error page 
attached). I am trying the examples in the docs, I get the same error in 
either servlet or jsp page, I have included the jsp page. I have 
everything packaged in the web.xml file of the application to try and keep it 
portable. I also tried using the admin tool and register a global data 
source and get the same result.

If I mistype the 
datasource name in the jsp it says it cannot find it so I does find some of it 
to verify, but why does it not find the resource parameters providing the driver 
and url? I tried to google for some answers, but did not find much that 
applied to the same versions.

Thanks in 
advance.

===
Attached are my 
web.xml, sqltest.jsp, and the error output
?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 xmlns=http://java.sun.com/xml/ns/j2ee;
  xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
  xsi:schemaLocation=htp://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd
  version=2.4  

!-- Global declaration for Broadline DB access --
Resource name=jdbc/BroadlineDB auth=Container
  type=javax.sql.DataSource
   description=Broadline Global DB connection to local database
/Resource

ResourceParams name=jdbc/BroadlineDB
  parameter
namefactory/name
valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
  /parameter
  parameter
namemaxActive/name
value95/value
  /parameter
  parameter
namemaxIdle/name
value10/value
  /parameter
  parameter
namemaxWait/name
value10/value
  /parameter
  parameter
nameusername/name
valuetomcat/value
  /parameter
  parameter
namepassword/name
valuetomcat/value
  /parameter
  parameter
namedriverClassName/name
valuecom.mysql.jdbc.Driver/value
  /parameter
  parameter
nameurl/name
valuejdbc:mysql://localhost/broadline?autoreconnect=true/value
  /parameter
   /ResourceParams

!-- General description of your web application --

display-nameBroadline File Manager/display-name
description
  This is version X.X of an application to perform
  a File stuff using JSP pages.  It was written for
  Broadline Media Corp, who should be contacted for
  more information.
/description

resource-ref
  descriptionDB Connector/description
  res-ref-namejdbc/BroadlineDB/res-ref-name
  res-typejavax.sql.DataSource/res-type
  res-authContainer/res-auth
/resource-ref
resource-ref
  descriptionDB Connector test/description
  res-ref-namejdbc/TestDB/res-ref-name
  res-typejavax.sql.DataSource/res-type
  res-authContainer/res-auth
/resource-ref

!-- Context initialization parameters that define shared
 String constants used within your application, which
 can be customized by the system administrator who is
 installing your application.  The values actually
 assigned to these parameters can be retrieved in a
 servlet or JSP page by calling:

 String value =
   getServletContext().getInitParameter(name);

 where name matches the param-name element of
 one of these initialization parameters.

 You can define any number of context initialization
 parameters, including zero.
--

context-param
  param-namewebmaster/param-name
  param-value[EMAIL PROTECTED]/param-value
  description
The EMAIL address of the administrator to whom questions
and comments about this application should be addressed.
  /description
/context-param


!-- Servlet definitions for the servlets that make up
 your web application, including initialization
 parameters.  With Tomcat, you can also send requests
 to servlets not listed here with a request like this:

   http://localhost:8080/{context-path}/servlet/{classname}

 but this usage is not guaranteed to be portable.  It also
 makes relative references to images and other resources
 required by your servlet more complicated, so defining
 all of your servlets (and defining a mapping to them with
 a servlet-mapping element) is recommended.

 Servlet initialization parameters can be retrieved in a
 servlet or JSP page by calling:

 String value =
   getServletConfig().getInitParameter(name);

 where name matches the param-name element of
   

RE: JDBC Source getting null url

2004-05-10 Thread Richard Calosso
I also tried it using a global resource (option 1) with the same error
result.  Built it by hand and used the admin pages, same result.  Since I do
not have a context entry for my app I will try to build one and see if
option 2 works.


-Original Message-
From: Sasha Borodin [mailto:[EMAIL PROTECTED]
Sent: Monday, May 10, 2004 2:30 PM
To: Tomcat Users List
Subject: Re: JDBC Source getting null url


Richard,

I believe the first two elements appearing in your web.xml (Resource and
ResourceParams) need to be present in the server configuration:

1. either as a global resource in your server.xml (inside the Server
element)
2. or as a context specific resource in a context descriptor - a Context
entry in your server.xml, or (the new way) an external xml file
(http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/context.html)

This way Tomcat knows about and sets up the resource for you web application
to use; I think the only thing you should do in your web.xml is declare a
need for a resource, though this part I'm hazy on, as my stuff has always
worked without any mention of the container-managed resource in my
web.xml's.

If anyone can clarify the requirement/logic behind declaring resource
needs in web.xml, I'd appreciate it.

-Sasha






From: Richard Calosso [EMAIL PROTECTED]
Reply-To: Tomcat Users List [EMAIL PROTECTED]
Date: Mon, 10 May 2004 14:12:02 -0700
To: Tomcat Users List (E-mail) [EMAIL PROTECTED]
Subject: JDBC Source getting null url

I just started to try and use a database source for some of my pages in my
web app and am not getting a connection.  I am using Tomcat 5.0.19 with JRE
1.4.2_04 on redhat 9 with mysql.  Every time I try to connect I get a
exception saying Datasource invalid, not suitable driver for class '' url
null (actual error page attached).  I am trying the examples in the docs, I
get the same error in either servlet or jsp page, I have included the jsp
page.  I have everything packaged in the web.xml file of the application to
try and keep it portable.  I also tried using the admin tool and register a
global data source and get the same result.

If I mistype the datasource name in the jsp it says it cannot find it so I
does find some of it to verify, but why does it not find the resource
parameters providing the driver and url?  I tried to google for some
answers, but did not find much that applied to the same versions.

Thanks in advance.

===
Attached are my web.xml, sqltest.jsp, and the error output


-
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: JDBC Source getting null url

2004-05-10 Thread Richard Calosso
Ok, option 2 worked.  If I placed the resource and resourceparams in the
context it worked.  I used the tomcat5 version and modified the web app
default standalone context xml file.

I would like to still understand why the global one did not work or
declaring it in the web.xml file.

-Original Message-
From: Richard Calosso [mailto:[EMAIL PROTECTED]
Sent: Monday, May 10, 2004 3:32 PM
To: 'Tomcat Users List'
Subject: RE: JDBC Source getting null url


I also tried it using a global resource (option 1) with the same error
result.  Built it by hand and used the admin pages, same result.  Since I do
not have a context entry for my app I will try to build one and see if
option 2 works.


-Original Message-
From: Sasha Borodin [mailto:[EMAIL PROTECTED]
Sent: Monday, May 10, 2004 2:30 PM
To: Tomcat Users List
Subject: Re: JDBC Source getting null url


Richard,

I believe the first two elements appearing in your web.xml (Resource and
ResourceParams) need to be present in the server configuration:

1. either as a global resource in your server.xml (inside the Server
element)
2. or as a context specific resource in a context descriptor - a Context
entry in your server.xml, or (the new way) an external xml file
(http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/context.html)

This way Tomcat knows about and sets up the resource for you web application
to use; I think the only thing you should do in your web.xml is declare a
need for a resource, though this part I'm hazy on, as my stuff has always
worked without any mention of the container-managed resource in my
web.xml's.

If anyone can clarify the requirement/logic behind declaring resource
needs in web.xml, I'd appreciate it.

-Sasha






From: Richard Calosso [EMAIL PROTECTED]
Reply-To: Tomcat Users List [EMAIL PROTECTED]
Date: Mon, 10 May 2004 14:12:02 -0700
To: Tomcat Users List (E-mail) [EMAIL PROTECTED]
Subject: JDBC Source getting null url

I just started to try and use a database source for some of my pages in my
web app and am not getting a connection.  I am using Tomcat 5.0.19 with JRE
1.4.2_04 on redhat 9 with mysql.  Every time I try to connect I get a
exception saying Datasource invalid, not suitable driver for class '' url
null (actual error page attached).  I am trying the examples in the docs, I
get the same error in either servlet or jsp page, I have included the jsp
page.  I have everything packaged in the web.xml file of the application to
try and keep it portable.  I also tried using the admin tool and register a
global data source and get the same result.

If I mistype the datasource name in the jsp it says it cannot find it so I
does find some of it to verify, but why does it not find the resource
parameters providing the driver and url?  I tried to google for some
answers, but did not find much that applied to the same versions.

Thanks in advance.

===
Attached are my web.xml, sqltest.jsp, and the error output


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