Per-context authentication database

2001-06-01 Thread Twylite

Hi,

It is possible to have a per-context authentication database, especially one that does 
not have to be configured 
using server.xml ?

This is the sort of scenario I am looking at:  A WAR file is added to the webapps 
directory, and on restarting 
Tocmat will be deployed.  It contains all of the information necessary for it to 
function, including its own 
password database (and maybe even the database drivers).  There is no need to modify 
the server.xml in any 
way.  

The very important catch here is that I want to use Tomcat's support for form logon - 
that is, the form-logon-
page and logon-error-page in the web.xml, and all that jazz.  I do not intend writing 
my own logic to handle the 
authentication!

Can this be done?

If it can't, would it be possible to do it by making a new RequestInterceptor?

Twylite




xml parser

2001-06-01 Thread Zsolt Koppany

Hi,

do tomcat and ant use an xml parser? If yes where can I find the
documentation of the xml parser and some examples would be useful too.

Zsolt

-- 
Zsolt Koppany
Intland GmbH www.intland.com
Schulze-Delitzsch-Strasse 16
D-70565 Stuttgart
Tel: +49-711-7221873 Fax: +49-711-7871017



jasper.log config

2001-06-01 Thread Carsten Elshoff

Hi,

could someone possibly tell me where I can configure the scratch
directory for jasper? The problem is that Tomcat keeps telling me in
jasper.log that the directory specified is unusable but I didn't manage
to find a place to change the directory / file in either of the config
files. I didn't find any description in the docs either. Maybe someone
can point me to the location?!

Thanks in advance,

Carsten




AW: How to disable Backspace Button in the Keyboard

2001-06-01 Thread Alexander Hörnlein

: Whenever the user presses backspace key in the keyboard the
: browser goes to
: the previous page, which crashes our site when the user tries to save its
: contents once again or he loses data which have been typed.
:
: I think its remedy is to disable backspace button by JavaScript, but how
: should I do it ?
: If anybody know this code snippet please let me to know

you can't change such low-level mechanisms of browsers with javascript only.
you'd have to use things like trusted java-applets, activex and such. if you
could do that with js that would be such an enourmous security problem that
no user would activate javascript anymore.

you can access the history (normally only the last item) and capture events
in all frames but menus / toolbar of the browser is (and should be) out of
javascripts range. of course you could do such nasty things like body
onUnload=window.open(...) but that's not a solution but a deadend.

what i once did is that every link uses location.replace() so whenever the
user goes back he actually leaves / restarts the application. additionally i
rebuilt the back/forward buttons inside the application. the user gets
informed about this at the starting page of the application.

the second solution is to give every link a hidden uid, so you can check if
a link is used twice. i am trying this right now and it looks promising
although i have currently no satisfying solution on how to react in a
user-friendly way on a second usage apart from just not responding to that
request.

--
alexander hoernlein
[EMAIL PROTECTED]




Re: How to disable Backspace Button in the Keyboard

2001-06-01 Thread Endre Stølsvik

On Thu, 31 May 2001, Mike Haberman wrote:

| 
|  Whenever the user presses backspace key in the keyboard the browser goes to
|  the previous page, which crashes our site when the user tries to save its
|  contents once again or he loses data which have been typed.
| 
|  I think its remedy is to disable backspace button by JavaScript, but how
|  should I do it ?
|  If anybody know this code snippet please let me to know
|
| The remedy is to fix your site.  Even if you could capture the key stroke
| events,  ignoring the backspace is not the solution.  This advice falls in
| the same category as NEVER rely on javascript for something that is
| critical to your site.

A cool solution for this that actually works is that you use a Controller
and a Renderer servlet, the Controller taking all the parameters, and then
response.sendRedirect the user to the Renderer, storing whatever state is
neccessary in the user's session.

The nice thing is that you skip the Controller in the browser's history,
and (at least on Netscape), the history actually realizes that multiple
loadings of the same page is just one event, and you end up with only
one history entry for your whole application. If you press back after
clicking 589 times in your application, you immediately exits back out of
your application to the page you were before those 589 clicks.

But of course, you have to put the state in the session too. A state
variable as in a state-machine (state diagram, whatever, you know the
circles with arrows pointing back and forth, each circle having a letter
or digit in it. ;), telling the system where you are, so that the user
can't f... up the routes in your application.

These two approaches together is an excellent solution, I feel. Some will
argue that the sendRedirect is more network traffic and what not, but in
reality you solve two pretty annoying issues by it, and that's worth it.

-- 
Mvh,
Endre





Greek encoding in Java Servlet Output

2001-06-01 Thread Kotsari Aspasia

Hi all!

I am facing the following problem:

I have made a Java servlet that reads HTML form data and sends it to an 
e-mail address.
When the data is in Latin characters (ISO-8859-1, I assume) the output is 
ok.
However, when the form data is in Greek it appears as ??? in the 
e-mail.

I know it's a problem of Internationalization and bytes.

I have tried both PrintStream and PrintWriter, and also ISO-8859-7 and 
Cp1253 for the encoding, as well as other modified Writer classes, but no 
result.

Does anyone have any idea on how to get rid of those fussy questionmarks 
that are giving me quite a headache?

Thanx a lot! :)

Sassa.-




Re: Per-context authentication database

2001-06-01 Thread Antony Bowesman

Hi,

My comments relate to tomcat 3, not 4 but the same principles apply.

Twylite wrote:
 
 Hi,
 
 It is possible to have a per-context authentication database,
 especially one that does not have to be configured using server.xml ?
 
 This is the sort of scenario I am looking at:  A WAR file is added
 to the webapps directory, and on restarting Tocmat will be deployed.
 It contains all of the information necessary for it to function, 
 including its own password database (and maybe even the database 
 drivers).  There is no need to modify the server.xml in any way.
 
 
 Can this be done?

I have written a JAAS Realm which is configured in the usual way in
server.xml.  e.g.

RequestInterceptor 
className=com.teamware.phoenix.security.JAASRealm 
JAASConfigEntry=other
debug=99 /

The server.xml attributes specify defaults for all contexts.  However,
specific attributes can be configured in web.xml for each web app, such
as

  context-param
param-nameJAASConfigEntry/param-name
param-valuetest/param-value
  /context-param

to override the default.  In the realm implementation authenticate() I
just do stuff like

Context ctx = req.getContext();
String jaasConfigEntry = ctx.getInitParameter(jaasConfigKey);

which allows context specific authentication.  I guess it's easy enough
to modify the JDBC realm so that you can use different databases per
context using this mechanism or write your own realm.

 The very important catch here is that I want to use Tomcat's support
 for form logon - that is, the form-logon-page and logon-error-page
 in the web.xml, and all that jazz.  I do not intend writing my own
 logic to handle the authentication!

I'm not sure what you mean by not wanting to write your own logic to
handle the authentication.  JDBC realm simply does string comparison
between two passwords.  Authentication in the JAAS Realm is handled by
the JAAS Login module.  The form login support is not really relevant, I
think all the realm implementations I've seen support both form/basic
auth.

Rgds
-- 
Antony Bowesman
Teamware Group 
[EMAIL PROTECTED]
tel: +358 9 5128 2562
fax: +358 9 5128 2705



Re: Greek encoding in Java Servlet Output

2001-06-01 Thread Ian Goodchild

Hi Sassa

We are experiencing similar problems. We are using an Oracle database in the
UTF8 charset and were accessing thru JDBC thin with nlscharset classes.

DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
connection =
DriverManager.getConnection(jdbc:oracle:thin:@server:1521:TEST,username,pa
sswd);

However we had problems with various characters so we changed to the thick
driver

Enumeration e = DriverManager.getDrivers();
Class.forName(sun.jdbc.odbc.JdbcOdbcDriver);
Connection connection =
DriverManager.getConnection(jdbc:odbc:TPSO,username,passwd);

and also added the following lines in the servlet.

  response.setContentType(text/html;charset=UTF-8);
  out.println(meta http-equiv=\Content-Type\
content=\text/html;charset=UTF-8\);

This is however only tested for IE5.5.


Ian




IIS5 + Tomcat 3.2.1 problems

2001-06-01 Thread Baraboi, Tiberiu

Hi,

I have a Win2K multiprocessor version, IIS5 and tomcat3.2.1. For unknown
reason jakarta server stalled after about a week of working. Service is
running but don't answer to anymore requests. I tried to play with
parameters for the connectors but it seems I did not find the right
combination. 
Now I have:
 max_threads = 80
 max_spare_threads = 20
 min_spare_threads = 10 

Can you suggest me some other settings or maybe some other aspects that I
should cover?

 Best regards,

Tibi Baraboi



Win2k, Tomcat 3.2.2 stalled

2001-06-01 Thread Baraboi, Tiberiu

Hi,

I have a Win2K multiprocessor version, IIS5 and tomcat 3.2.2. For unknown
reason jakarta server stalled after about a week of working. Service is
running but don't answer to anymore requests. I tried to play with
parameters for the connectors but it seems I did not find the right
combination. 
Now I have:
 max_threads = 80
 max_spare_threads = 20
 min_spare_threads = 10 

Can you suggest me some other settings or maybe some other aspects that I
should cover?

 Best regards,

Tibi Baraboi




RE: Greek encoding in Java Servlet Output

2001-06-01 Thread altuga

Hi , tomcat's default is  8859-1  
so u have to convert it .. 

example 

for Turkish  characters ; 

String endeks_name = request.getParameter("name");
String endeks_name_tr =new
String(endeks_name.getBytes("ISO-8859-1"),"ISO-8859-9") ;


Regards.

Altug .



-Original Message-
From: Kotsari Aspasia [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 01, 2001 12:06 PM
To: '[EMAIL PROTECTED]'
Subject: Greek encoding in Java Servlet Output


Hi all!

I am facing the following problem:

I have made a Java servlet that reads HTML form data and sends it to an 
e-mail address.
When the data is in Latin characters (ISO-8859-1, I assume) the output is 
ok.
However, when the form data is in Greek it appears as "???" in the 
e-mail.

I know it's a problem of Internationalization and bytes.

I have tried both PrintStream and PrintWriter, and also ISO-8859-7 and 
Cp1253 for the encoding, as well as other modified Writer classes, but no 
result.

Does anyone have any idea on how to get rid of those fussy questionmarks 
that are giving me quite a headache?

Thanx a lot! :)

Sassa.-



Re: AW: Why doesn't this work:

2001-06-01 Thread Terje Kristensen

Any idea on how to get rid of this error? 

Terje K.
-- Original Message --
From: Ralph Einfeldt [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
Date: Thu, 31 May 2001 15:46:56 +0200

It looks like request.getParameterValues(paramName)
returns a null value on at least one param.





Win2k, IIS5 - Jakarta service stalled

2001-06-01 Thread Baraboi, Tiberiu

Hi,

I have a Win2K multiprocessor version, IIS5 and tomcat 3.2.2. For unknown
reason jakarta server stalled after about a week of working. Service is
running but don't answer to anymore requests. I tried to play with
parameters for the connectors but it seems I did not find the right
combination. 
Now I have:
 max_threads = 80
 max_spare_threads = 20
 min_spare_threads = 10 

Can you suggest me some other settings or maybe some other aspects that I
should cover?

 Best regards,

Tibi Baraboi




Where will Tomcat search for HTML-Files ?

2001-06-01 Thread Matthias Schiffer



Hi!

I have embedded my Tomcat Ver. 4.0 Beta 5 into an existing application
but
now when I start my Tomcat and want to browse on my HTML-Files, Tomcat
tells
me that it can't find the files! I have set my App-Base values as
parameters
of the connector and the host... Now my question:

Is there any chance to set a parameter with the absolute or relative
path to
my directory, where i have saved my HTML-Files ??

Thanks for your help



Where will Tomcat search for HTML-Files ?

2001-06-01 Thread Matthias Schiffer

 Hi!
 
I have embedded my Tomcat Ver. 4.0 Beta 5 into an existing application
but now when I start my Tomcat and want to browse on my HTML-Files,
Tomcat
tells me that it can't find the files! I have set my App-Base values as
parameters of the connector and the host... Now my question:
Is there any chance to set a parameter with the absolute or relative
path to my directory, where i have saved my HTML-Files ??
 
 Thanks for your help



AW: AW: Why doesn't this work:

2001-06-01 Thread Ralph Einfeldt

String[] paramValues = request.getParameterValues(paramName);

if (paramValues == null) {
  // Do what you want
} else if (paramValues.length == 1) {
  // Do what you want
} else { 
  // Do what you want
}

 -Ursprüngliche Nachricht-
 Von: Terje Kristensen [mailto:[EMAIL PROTECTED]]
 Gesendet: Freitag, 1. Juni 2001 14:12
 An: [EMAIL PROTECTED]
 Betreff: Re: AW: Why doesn't this work:
 
 
 Any idea on how to get rid of this error? 
 
 Terje K.
 -- Original Message --
 From: Ralph Einfeldt [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 Date: Thu, 31 May 2001 15:46:56 +0200
 
 It looks like request.getParameterValues(paramName)
 returns a null value on at least one param.
 
 
 



only a test

2001-06-01 Thread Matthias Schiffer

please trash this message, i have several problems with my mail program



Compiling JSP's under Solaris

2001-06-01 Thread Martin Anstis

Hello,
I've developed a fairly large JSP based application which runs nicely on
windows NT, but due to spec of machines performance is slow. So moved
application to Sun Sparc running Solaris 2.5. JSP compilation fails with
noClassDef looking for sun.tools.javac.Main despite tools.jar being in the
classpath. I've been trying hacks of startup/tomcat.sh, building my own
'java' command, using different versions of JDK (1.2.2,1.3) all to no avail.
What am I doing wrong? Should tomcat operate as a standalone servlet
container in the environment I describe? Please help, I'm losing hope,
sanity and temperance...

Martin


Searchspace Limited Tel: 020 7255 1054
Prospect House  Fax: 020 7436 9443
80-110 New Oxford StreetMob: 07890 896 654  
London WC1A 1HB [EMAIL PROTECTED]
UK  www.searchspace.com


**
  WARNING: For your own safety all email attachments
  should be virus scanned prior to opening.
  This communication contains information which is
  confidential and may be privileged. Please note
  that the opinions expressed in this communication
  are not necessarily those of Searchspace Limited.
**





ÁÐ: Greek encoding in Java Servlet Output

2001-06-01 Thread Kotsari Aspasia

Any ideas on how to include src.jar in the classpath???
I'm using Win98.

Sassa.-




RE: Servlets and relative paths

2001-06-01 Thread Cox, Charlie
Title: RE: Servlets and relative paths





What I had to do was put the xsl files in the root directory for my webapp where I could make the href the full url (http://localhost/webapp/sections.xsl) This was the only way I could get it to work correctly. Obviously this exposes your stylesheet to anyone who requests that url. I finally gave up on the include since I was only sharing with 2 stylesheets, but I still use it for my dtd, which has the same problem when processed by a stylesheet.

I didn't think that I would get it to work as I wanted since Xalan(library I'm using) doesn't know about tomcat, and I couldn't find anywhere in xalan to set a default path to look for include files/dtd's. Therefore it always assumes the 'working dir' for the application when looking for includes. 

The ugly option is that you could make the include path = ../webapps/MyContext/sections.xsl assuming your context is under webapps. Of course this is inconsistant with other paths in your application(i.e. getResourceAsStream()) and is a pain to maintain if you move your context.

The other ugly option being chucking the includes into the bin directory, but that defeats the purpose of separating contexts.

Charlie


-Original Message-
From: Chris McNeilly [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 30, 2001 2:22 PM
To: [EMAIL PROTECTED]
Subject: RE: Servlets and relative paths



No, my problem is that I can use this method to read the xsl file just
fine. It's the includes inside the xsl file that aren't working.


For example, inside the xsl file (which I read into the servlet using
your pointer from the earlier email) there is the line


xsl:include href='sections.xsl'/


and I get an error saying that it cannot find file
tomcat/bin/sections.xsl. Which, of course, it cannot, since the file is
located in Meta-Inf/.


Chris


 -Original Message-
 From: Bo Xu [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, May 30, 2001 10:45 AM
 To: [EMAIL PROTECTED]
 Subject: Re: Servlets and relative paths


 Chris McNeilly wrote:

  Thanks Bo. This is certainly a step in the right direction.
 
  I can now include the xml file and xsl file using relative
 paths. My
  only problem now is that there are xsl includes inside the
 xsl files and
  they are still being loaded incorrectly (using the
 tomcat/bin directory
  as root, not the servlet context). Any ideas?
 
  Thanks,
 
  Chris
 
   Chris McNeilly wrote:
  
I've got a servlet and am trying to open files. The
   problem is that its
defaulting to the tomcat/bin directory whenever I attempt
   to refer to
them. How can I change this? Hardcoding the path isn't
   such a good
idea as my dev environment is different from production.
   These are xml
and xsl files and they are located on the webroot.
   
Thanks,
   
Chris
  
   Hi :-) from several emails in Servlet-List and this List:
  
   * InputStream is = this.getServletContext().
  
   getResourceAsStream(/WEB-INF/testApp.properties);
  
   now testApp.properties is in myapp/WEB-INF/
  
  
   *
   - InputStream is =
   this.getClass().getResourceAsStream(testApp.properties);
   - InputStream is = Thread.currentThread().getContextClassLoader().
  
 getResourceAsStream(myservlet.conf);
  
   now, (normally), myservlet.conf/testApp.properties is in
   myapp/WEB-INF/classes
  
  
   Bo
   May.29, 2001
  
  [...]

 Hello Chris :-) I am not sure, do you want to read a file in
 TOMCAT_HOME/bin?
 is the following possible?

 - put MyUtil.class in TOMCAT_HOME/bin
 - include TOMCAT_HOME/bin/MyUtil.class into CLASSPATH
 - put testApp.properties into TOMCAT_HOME/bin
 - in MyServlet, write the following code:
 ...
 MyUtil myobject=new MyUtil();
 InputStream is =
 myobject.getClass().getResourceAsStream(testApp.properties);
 ...

 I don't test it, if it is not right, please correct it, thanks! :-)


 Bo
 May.30, 2001









Src.jar and Classpath

2001-06-01 Thread Kotsari Aspasia


Any ideas on how to include src.jar in the classpath???
I'm using Win98.

S.-




RE: Src.jar and Classpath

2001-06-01 Thread Chris McNeilly

I modify my autoexec.bat.  On Win98, you'll probably have to reboot to
have it take effect.

set classpath=.;C:\jdk1.3.0_02\lib\tools.jar ...

Chris

 -Original Message-
 From: Kotsari Aspasia [mailto:[EMAIL PROTECTED]]
 Sent: Friday, June 01, 2001 8:51 AM
 To: '[EMAIL PROTECTED]'
 Subject: Src.jar and Classpath



 Any ideas on how to include src.jar in the classpath???
 I'm using Win98.

 S.-






Configuration and performance

2001-06-01 Thread Brian Kejser

Hi

1. Is there any advantage in using Apache Web Server as a front end to
Tomcat when the bulk of the site being served is dynamic (i.e. servlets)?

2. Is there any advantage in using high end drives on a Tomcat Web Server
(running Red Hat Linux on Intel hardware)? When is disk access required
(i.e. what is cached in memory and what isn't)? Would using a RAM drive
negate the need for high end drives? If so, what files would be placed in
the RAM drive?

3. How much memory can Tomcat take advantage of (512M, 1024M)?

4. How does Tomcat perform in relation to other Java Application Servers?
Are there any web sites that display test results?

Thank you



RE: Re: How to debug a missing servlet error?

2001-06-01 Thread Chris McNeilly

I removed the servlet-mapping and still no luck.

This is really odd.  Is there any way to see where Tomcat is actually
looking for the class?

Chris

 -Original Message-
 From: Chris McNeilly [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, May 31, 2001 6:54 PM
 To: [EMAIL PROTECTED]
 Subject: [Fwd: Re: How to debug a missing servlet error?]




  Original Message 
 Subject: Re: How to debug a missing servlet error?
 Date: Thu, 31 May 2001 14:02:01 -0700
 From: Jeff Kilbride [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 References: [EMAIL PROTECTED]

 Hi Chris,

 Tomcat should recognize /servlet/briefXSL without the explicit
 servlet-mapping you are using -- but I don't know if that is
 what's causing
 your problem. For all my servlets, I have the following type of entry:

 servlet
  servlet-namebriefXSL/servlet-name
  servlet-classcom.smartbrief.BriefXSL.Servlet/servlet-class
 /servlet

 The default Invoker automatically sets up /servlet/ as a
 mapping for all
 your defined servlets. So, the above should be enough to get
 /servlet/briefXSL to pull up correctly -- without the
 servlet-mapping you
 have below. Maybe the explicit servlet-mapping you are doing
 is somehow
 messing with the default Invoker on Linux, but that's only
 speculation...

 Thanks,
 --jeff

 - Original Message -
 From: Chris McNeilly [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, May 31, 2001 1:15 PM
 Subject: How to debug a missing servlet error?


   Hi,
  
   I have a development environment that works correctly (Win
 98), but when
   I move the code over to my QA environment (Linux) tomcat
 can no longer
   find the servlet.  I have a web.xml file in the Web-Inf
 directory that
   has the following:
  
   web-app
   servlet
   servlet-name
   briefXSL
   /servlet-name
   servlet-class
   com.smartbrief.BriefXSLServlet
   /servlet-class
   /servlet
   servlet-mapping
   servlet-namebriefXSL/servlet-name
   url-pattern/servlet/briefXSL/url-pattern
   /servlet-mapping
  
   /web-app
  
   Tomcat receives the request from apache, but doesn't know
 what to do
   with it and spits back a 404.  It's almost as if tomcat
 isn't reading
   the web.xml file at all.
  
   Thanks,
  
   Chris
  







RE: Servlets and relative paths

2001-06-01 Thread Chris McNeilly
Title: RE: Servlets and relative paths



That's 
eventually what I did. I now have two top xsl pages, one includes with 
fully qualified urls and the other uses the relative includes. One for the 
xsl designer and the other for testing/prod. It's not ideal, but isn't too 
much of a pain.

Chris

  -Original Message-From: Cox, Charlie 
  [mailto:[EMAIL PROTECTED]]Sent: Friday, June 01, 2001 8:45 
  AMTo: '[EMAIL PROTECTED]'Subject: RE: 
  Servlets and relative paths
  What I had to do was put the xsl files in the root directory 
  for my webapp where I could make the href the full url (http://localhost/webapp/sections.xsl) 
  This was the only way I could get it to work correctly. Obviously this exposes 
  your stylesheet to anyone who requests that url. I finally gave up on the 
  include since I was only sharing with 2 stylesheets, but I still use it for my 
  dtd, which has the same problem when processed by a stylesheet.
  I didn't think that I would get it to work as I wanted since 
  Xalan(library I'm using) doesn't know about tomcat, and I couldn't find 
  anywhere in xalan to set a default path to look for include files/dtd's. 
  Therefore it always assumes the 'working dir' for the application when looking 
  for includes. 
  The ugly option is that you could make the include path = 
  "../webapps/MyContext/sections.xsl" assuming your context is under webapps. Of 
  course this is inconsistant with other paths in your application(i.e. 
  getResourceAsStream()) and is a pain to maintain if you move your 
  context.
  The other ugly option being chucking the includes into the bin 
  directory, but that defeats the purpose of separating contexts.
  Charlie 
  -Original Message- From: Chris 
  McNeilly [mailto:[EMAIL PROTECTED]] 
  Sent: Wednesday, May 30, 2001 2:22 PM To: [EMAIL PROTECTED] Subject: RE: 
  Servlets and relative paths 
  No, my problem is that I can use this method to read the xsl 
  file just fine. It's the includes inside the xsl 
  file that aren't working. 
  For example, inside the xsl file (which I read into the 
  servlet using your pointer from the earlier email) 
  there is the line 
  xsl:include href='sections.xsl'/ 
  and I get an error saying that it cannot find file 
  tomcat/bin/sections.xsl. Which, of course, it cannot, 
  since the file is located in Meta-Inf/. 
  Chris 
   -Original Message-  
  From: Bo Xu [mailto:[EMAIL PROTECTED]]  Sent: Wednesday, May 30, 2001 10:45 AM  To: [EMAIL PROTECTED]  
  Subject: Re: Servlets and relative paths  
Chris McNeilly 
  wrote:Thanks 
  Bo. This is certainly a step in the right direction. I can now include the xml 
  file and xsl file using relative  paths. 
  My   only problem now is that there are xsl 
  includes inside the  xsl files and 
they are still being loaded incorrectly (using 
  the  tomcat/bin directory   as root, not the servlet context). Any ideas? 
  Thanks, 
  Chris 
   Chris 
  McNeilly wrote:I've got a servlet and am trying to open 
  files. Theproblem is that 
  its defaulting to the 
  tomcat/bin directory whenever I attempt
  to refer to them. How 
  can I change this? Hardcoding the path isn'tsuch a good
   idea as my dev environment is different from production.These are xml   
and xsl files and they are located on the webroot. 

Thanks,
   Chris   Hi :-) from 
  several emails in Servlet-List and this List:  
   * InputStream is = 
  this.getServletContext().
 
  getResourceAsStream("/WEB-INF/testApp.properties");   now 
  testApp.properties is in myapp/WEB-INF/   

   *- InputStream is = 
 
  this.getClass().getResourceAsStream("testApp.properties");- InputStream is = 
  Thread.currentThread().getContextClassLoader().  
 
  getResourceAsStream("myservlet.conf");   
  now, 
  (normally), myservlet.conf/testApp.properties is inmyapp/WEB-INF/classes   

   BoMay.29, 2001  [...]   Hello Chris :-) I am not sure, 
  do you want to read a file in  
  TOMCAT_HOME/bin?  is the following 
  possible?   - put 
  MyUtil.class in TOMCAT_HOME/bin  - include 
  TOMCAT_HOME/bin/MyUtil.class into CLASSPATH  - put 
  testApp.properties into TOMCAT_HOME/bin  - in 
  MyServlet, write the following code:  
  ...  MyUtil myobject=new 
  MyUtil();  InputStream is = 
   
  myobject.getClass().getResourceAsStream("testApp.properties"); 
   ...  
   I don't test it, if it is not right, please 
  correct it, thanks! :-)Bo  
  May.30, 2001   




RE: Compiling JSP's under Solaris

2001-06-01 Thread Williamson, James
Title: RE: Compiling JSP's under Solaris





Martin, 


When you mention tools.jar is in the classpath, are we talking of you setting in within the shell script that launches tomcat or the enviornment (aka shell) which you invoke the script from. Looking at the shell script that starts up tomcat (tc4) it appears that it doesn't adopt the classpath within the shell that invoked it. Why don't you put some debug statements inside this script which tell you exactly what classpath it's using?

Regards,


James


-Original Message-
From: Martin Anstis [mailto:[EMAIL PROTECTED]]
Sent: 01 June 2001 13:08
To: '[EMAIL PROTECTED]'
Subject: Compiling JSP's under Solaris



Hello,
I've developed a fairly large JSP based application which runs nicely on
windows NT, but due to spec of machines performance is slow. So moved
application to Sun Sparc running Solaris 2.5. JSP compilation fails with
noClassDef looking for sun.tools.javac.Main despite tools.jar being in the
classpath. I've been trying hacks of startup/tomcat.sh, building my own
'java' command, using different versions of JDK (1.2.2,1.3) all to no avail.
What am I doing wrong? Should tomcat operate as a standalone servlet
container in the environment I describe? Please help, I'm losing hope,
sanity and temperance...


Martin



Searchspace Limited  Tel: 020 7255 1054
Prospect House  Fax: 020 7436 9443
80-110 New Oxford Street   Mob: 07890 896 654  
London WC1A 1HB[EMAIL PROTECTED]
UK www.searchspace.com



**
 WARNING: For your own safety all email attachments
 should be virus scanned prior to opening.
 This communication contains information which is
 confidential and may be privileged. Please note
 that the opinions expressed in this communication
 are not necessarily those of Searchspace Limited.
**




**
This e-mail (including any documents which may accompany it) contains
information which is confidential and may also be privileged.
It is for the exclusive use of the intended recipient(s).
If you are not the intended recipient(s) please note that any form of
distribution, copying or use of this e-mail or the information in it
or attached to it is strictly prohibited and may be unlawful.
If you have received this e-mail in error please notify us immediately
by e-mail to [EMAIL PROTECTED] or telephone +44 (0)207 940 1200 and
delete the e-mail.
Please advise immediately if you or your employer do not consent to
Internet E-Mail for messages of this type.
Information or opinions in this message that do not relate to the
business of Windsor plc and/or subsidiary and/or associated companies
shall be treated as neither given or endorsed by it.
**



Re: Per-context authentication database

2001-06-01 Thread Twylite

Hi,

I sortof answered my own question, by writing my own Realm to do the trick.  But I'm 
having some trouble :/

to override the default.  In the realm implementation authenticate() I
just do stuff like
Context ctx = req.getContext();
String jaasConfigEntry = ctx.getInitParameter(jaasConfigKey);

Interestingly I'm doing something almost exactly like that ... but no matter what 
page/context I'm accessing I 
appear to be getting the root context from req.getContext() .  Any suggestions?

I'm not sure what you mean by not wanting to write your own logic to
handle the authentication.  JDBC realm simply does string comparison

Many in the Great Unwashed Masses seem oblivious to the existance of Tomcat's logon 
handling, and write 
their own code in JSPs with lots of If...Thens to check if the person is logged on, 
and authenticate in their own 
way against their own database(s).  i.e. not using Realms at all.

Thanks,

Twylite




RE: Servlets and relative paths

2001-06-01 Thread Steve Meyfroidt

Set the SystemID for xsl includes: this line is part of the setup for some
SAX-driven XSL processing I've used in servlets:
StreamSource source = new StreamSource(stream, getSystemID());
// set system id for xsl includes
where getSystemID() returns the URI to use as a base location for xsl
includes. See the xalan javadoc.

Hope that helps.

SteveM


-Original Message-
From: Chris McNeilly [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 01, 2001 2:18 PM
To: [EMAIL PROTECTED]
Subject: RE: Servlets and relative paths


That's eventually what I did.  I now have two top xsl pages, one includes
with fully qualified urls and the other uses the relative includes.  One for
the xsl designer and the other for testing/prod.  It's not ideal, but isn't
too much of a pain.

Chris
-Original Message-
From: Cox, Charlie [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 01, 2001 8:45 AM
To: '[EMAIL PROTECTED]'
Subject: RE: Servlets and relative paths


What I had to do was put the xsl files in the root directory for my webapp
where I could make the href the full url
(http://localhost/webapp/sections.xsl) This was the only way I could get it
to work correctly. Obviously this exposes your stylesheet to anyone who
requests that url. I finally gave up on the include since I was only sharing
with 2 stylesheets, but I still use it for my dtd, which has the same
problem when processed by a stylesheet.
I didn't think that I would get it to work as I wanted since Xalan(library
I'm using) doesn't know about tomcat, and I couldn't find anywhere in xalan
to set a default path to look for include files/dtd's. Therefore it always
assumes the 'working dir' for the application when looking for includes. 
The ugly option is that you could make the include path =
../webapps/MyContext/sections.xsl assuming your context is under webapps.
Of course this is inconsistant with other paths in your application(i.e.
getResourceAsStream()) and is a pain to maintain if you move your context.
The other ugly option being chucking the includes into the bin directory,
but that defeats the purpose of separating contexts.
Charlie 
-Original Message- 
From: Chris McNeilly [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, May 30, 2001 2:22 PM 
To: [EMAIL PROTECTED] 
Subject: RE: Servlets and relative paths 


No, my problem is that I can use this method to read the xsl file just 
fine.  It's the includes inside the xsl file that aren't working. 
For example, inside the xsl file (which I read into the servlet using 
your pointer from the earlier email) there is the line 
xsl:include href='sections.xsl'/ 
and I get an error saying that it cannot find file 
tomcat/bin/sections.xsl.  Which, of course, it cannot, since the file is 
located in Meta-Inf/. 
Chris 
 -Original Message- 
 From: Bo Xu [mailto:[EMAIL PROTECTED]] 
 Sent: Wednesday, May 30, 2001 10:45 AM 
 To: [EMAIL PROTECTED] 
 Subject: Re: Servlets and relative paths 
 
 
 Chris McNeilly wrote: 
 
  Thanks Bo.  This is certainly a step in the right direction. 
  
  I can now include the xml file and xsl file using relative 
 paths.  My 
  only problem now is that there are xsl includes inside the 
 xsl files and 
  they are still being loaded incorrectly (using the 
 tomcat/bin directory 
  as root, not the servlet context).  Any ideas? 
  
  Thanks, 
  
  Chris 
  
   Chris McNeilly wrote: 
   
 I've got a servlet and am trying to open files.  The 
   problem is that its 
 defaulting to the tomcat/bin directory whenever I attempt 
   to refer to 
 them.  How can I change this?  Hardcoding the path isn't 
   such a good 
 idea as my dev environment is different from production. 
   These are xml 
 and xsl files and they are located on the webroot. 
 
 Thanks, 
 
 Chris 
   
   Hi :-)  from several emails in Servlet-List and this List: 
   
   * InputStream is = this.getServletContext(). 
   
   getResourceAsStream(/WEB-INF/testApp.properties); 
   
   now testApp.properties is in myapp/WEB-INF/ 
   
   
   * 
   - InputStream is = 
   this.getClass().getResourceAsStream(testApp.properties); 
   - InputStream is = Thread.currentThread().getContextClassLoader(). 
   
 getResourceAsStream(myservlet.conf); 
   
  now, (normally),  myservlet.conf/testApp.properties is in 
   myapp/WEB-INF/classes 
   
   
   Bo 
   May.29, 2001 
   
  [...] 
 
 Hello Chris :-)  I am not sure, do you want to  read a file in 
 TOMCAT_HOME/bin? 
 is the following possible? 
 
 - put MyUtil.class in TOMCAT_HOME/bin 
 - include TOMCAT_HOME/bin/MyUtil.class into CLASSPATH 
 - put testApp.properties into TOMCAT_HOME/bin 
 - in MyServlet, write the following code: 
   ... 
   MyUtil myobject=new MyUtil(); 
   InputStream is = 
   myobject.getClass().getResourceAsStream(testApp.properties); 
   ... 
 
 I don't test it,  if it is not right, please correct it, thanks! :-) 
 
 
 Bo 
 May.30, 2001 
 
 
 
 



What are 'notes' all about

2001-06-01 Thread Antony Bowesman

Hello,

For Tomcat 3, is there any information on 'notes', what they are and
what they do.  There are various references to these notes in the source
but I'd like to see concrete examples of their usage as the comments are
fairly abstract and don't give much clue.

Rgds
Antony

-- 
Antony Bowesman
Teamware Group 
[EMAIL PROTECTED]
tel: +358 9 5128 2562
fax: +358 9 5128 2705



Debugging servlets in Tomcat using Visual Cafe Expert 4.0 Edition

2001-06-01 Thread Kumar, Amit

Hi,
 
I followed the instructions provided  at
http://people.netscape.com/chanezon/tech/java/tomcat/debug_jsp_in_cafe.htm
http://people.netscape.com/chanezon/tech/java/tomcat/debug_jsp_in_cafe.htm

to debug servlets in Visual Cafe Expert 4.0. I am using tomcat 3.2.1
 
I get following error when I provide -start as the argument to
org.apache.tomcat.startup.Tomcat
 
org.apache.tomcat.startup.Tomcat.class successfully loaded
Usage: java org.apache.tomcat.startup.Tomcat {options}
  Options are:
-config file (or -f file)  Use this file instead of server.xml
-help (or help)Show this usage report
-home dir (or -h dir)  Use this directory as tomcat.home
-stop  Shut down currently running Tomcat

 
When I don't specify any argument it fails with 
 
org.apache.tomcat.startup.Tomcat.class successfully loaded
Exception raised:  java.lang.ClassNotFoundException:
org/apache/tomcat/util/xml/XmlMapper
You may press F5 to continue with default exception handling)
 
 
Please help.
 
Thanks
Amit Kumar




Re: Per-context authentication database

2001-06-01 Thread Antony Bowesman

Hi,

Twylite wrote:
 
Context ctx = req.getContext();
String jaasConfigEntry = ctx.getInitParameter(jaasConfigKey);
 
 Interestingly I'm doing something almost exactly like that ... but
 no matter what page/context I'm accessing I appear to be getting
 the root context from req.getContext() .  Any suggestions?

Have you got the different contexts defined in server.xml?

 I'm not sure what you mean by not wanting to write your own logic to
 handle the authentication.  JDBC realm simply does string comparison
 
 Many in the Great Unwashed Masses seem oblivious to the existance
 of Tomcat's logon handling, and write their own code in JSPs with
 lots of If...Thens to check if the person is logged on, and
 authenticate in their own way against their own database(s). 
 i.e. not using Realms at all.

Given the paucity of documentation, it's not surprising!

Antony



Re: Greek encoding in Java Servlet Output

2001-06-01 Thread Frank Morton

Is your out in the example below a ServletOutputStream or
a PrintWriter?

 We are experiencing similar problems. We are using an Oracle database in
the
 UTF8 charset and were accessing thru JDBC thin with nlscharset classes.

 DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
 connection =

DriverManager.getConnection(jdbc:oracle:thin:@server:1521:TEST,username,pa
 sswd);

 However we had problems with various characters so we changed to the thick
 driver

 Enumeration e = DriverManager.getDrivers();
 Class.forName(sun.jdbc.odbc.JdbcOdbcDriver);
 Connection connection =
 DriverManager.getConnection(jdbc:odbc:TPSO,username,passwd);

 and also added the following lines in the servlet.

   response.setContentType(text/html;charset=UTF-8);
   out.println(meta http-equiv=\Content-Type\
 content=\text/html;charset=UTF-8\);

 This is however only tested for IE5.5.


 Ian





Building Tomcat - Ambigous class

2001-06-01 Thread Wright, Steve

I'm trying to build tomcat and I'm getting an Ambiguous class error from the
compiler.  
My system is as follows:
*   Redhat 7.0
*   Linux Kernal 2.2.16-22
*   tomcat 3.2.1
*   ant 1.3
*   jdk1.3.1
*   jakarta-servletapi-3.2
Has anyone seen this?
The full error dump follows.
Thanks
Steve Wright

***
Buildfile: build.xml

prepare:
 [copy] Could not find file /usr/local/jakarta/jaxp-1.0.1/jaxp.jar to
copy.
 [copy] Could not find file /usr/local/jakarta/jaxp-1.0.1/parser.jar to
copy.

tomcat:
[javac] Compiling 4 source files to
/usr/local/jakarta/build/tomcat/classes
[javac]
/usr/local/jakarta/jakarta-tomcat-3.2.1-src/src/share/org/apache/tomcat/faca
de/HttpServletRequestFacade.java:290: Ambiguous class:
org.apache.tomcat.util.Constants and org.apache.tomcat.core.Constants
[javac] encoding = Constants.DEFAULT_CHAR_ENCODING;
[javac]^
[javac]
/usr/local/jakarta/jakarta-tomcat-3.2.1-src/src/share/org/apache/tomcat/faca
de/ServletOutputStreamFacade.java:130: Ambiguous class:
org.apache.tomcat.core.Constants and org.apache.tomcat.util.Constants
[javac] if ( Constants.DEFAULT_CHAR_ENCODING.equals(enc) )
[javac]   ^
[javac]
/usr/local/jakarta/jakarta-tomcat-3.2.1-src/src/share/org/apache/tomcat/requ
est/StaticInterceptor.java:188: Ambiguous class:
org.apache.tomcat.core.RequestUtil and org.apache.tomcat.util.RequestUtil
[javac]RequestUtil.getLocale(req),
[javac]^
[javac]
/usr/local/jakarta/jakarta-tomcat-3.2.1-src/src/share/org/apache/tomcat/requ
est/StaticInterceptor.java:218: Ambiguous class:
org.apache.tomcat.core.RequestUtil and org.apache.tomcat.util.RequestUtil
[javac]  RequestUtil.getLocale(req),
[javac]  ^
[javac]
/usr/local/jakarta/jakarta-tomcat-3.2.1-src/src/share/org/apache/tomcat/requ
est/StaticInterceptor.java:457: Ambiguous class:
org.apache.tomcat.core.RequestUtil and org.apache.tomcat.util.RequestUtil
[javac] Locale locale=RequestUtil.getLocale(req);
[javac]   ^
[javac]
/usr/local/jakarta/jakarta-tomcat-3.2.1-src/src/share/org/apache/tomcat/util
/SessionUtil.java:106: No variable SESSION_COOKIE_NAME defined in class
org.apache.tomcat.util.Constants.
[javac] Cookie cookie = new Cookie(Constants.SESSION_COOKIE_NAME,
id);
[javac] ^
[javac]
/usr/local/jakarta/jakarta-tomcat-3.2.1-src/src/share/org/apache/tomcat/util
/SessionUtil.java:196: No variable SESSION_COOKIE_NAME defined in class
org.apache.tomcat.util.Constants.
[javac] if
(Constants.SESSION_COOKIE_NAME.equals(cookies[i].getName()))
[javac]  ^
[javac]
/usr/local/jakarta/jakarta-tomcat-3.2.1-src/src/share/org/apache/tomcat/util
/SessionUtil.java:215: No variable SESSION_PARAMETER_NAME defined in class
org.apache.tomcat.util.Constants.
[javac] String match = ; + Constants.SESSION_PARAMETER_NAME + =;
[javac]   ^
[javac]
/usr/local/jakarta/jakarta-tomcat-3.2.1-src/src/share/org/apache/tomcat/util
/SessionUtil.java:266: No variable SESSION_PARAMETER_NAME defined in class
org.apache.tomcat.util.Constants.
[javac] buf.append(Constants.SESSION_PARAMETER_NAME);
[javac] ^
[javac] Note:
/usr/local/jakarta/jakarta-tomcat-3.2.1-src/src/share/org/apache/tomcat/requ
est/StaticInterceptor.java uses or overrides a deprecated API.  Recompile
with -deprecation for details.
[javac] 9 errors, 1 warning

BUILD FAILED

/usr/local/jakarta/jakarta-tomcat-3.2.1-src/build.xml:94: Compile failed,
messages should have been provided.

Total time: 3 seconds





RE: Compiling JSP's under Solaris

2001-06-01 Thread Williamson, James
Title: RE: Compiling JSP's under Solaris



Martin, 

That's 
pretty odd, have youmanually compiling your jsp files using jspc.sh? 
Having taken a brief look there is no difference between a manual and automatic 
(i.e. via Tomcat)compilation ofyour jsp files (i.e. it calls 
org.apache.jasper.JspC). This relies on tools.jar (from what I remember is new 
to java 1.2) so it should give you some idea of whether either your java install 
ortools.jar is broken or not.

Regards, 

James

  -Original Message-From: Martin Anstis 
  [mailto:[EMAIL PROTECTED]]Sent: 01 June 2001 
  14:55To: '[EMAIL PROTECTED]'Subject: RE: 
  Compiling JSP's under Solaris
  James,
  Using Tomcat version 3.2.1.
  Have 
  triedall methods of influencing classpath and writing it out,am 
  being told that tools.jar is included butstill no 
  compilation.
  Is 
  the classpath given to SunJavaCompiler.class that makes the 
  call?
  
  Martin
  
-Original Message-From: Williamson, James 
[mailto:[EMAIL PROTECTED]]Sent: 01 June 2001 
14:33To: '[EMAIL PROTECTED]'Subject: RE: 
Compiling JSP's under Solaris
Martin, 
When you mention tools.jar is in the classpath, are we 
talking of you setting in within the shell script that launches tomcat or 
the enviornment (aka shell) which you invoke the script from. Looking at the 
shell script that starts up tomcat (tc4) it appears that it doesn't adopt 
the classpath within the shell that invoked it. Why don't you put some debug 
statements inside this script which tell you exactly what classpath it's 
using?
Regards, 
James 
-Original Message- From: 
Martin Anstis [mailto:[EMAIL PROTECTED]] 
Sent: 01 June 2001 13:08 To: 
'[EMAIL PROTECTED]' Subject: Compiling 
JSP's under Solaris 
Hello, I've developed a fairly large 
JSP based application which runs nicely on windows 
NT, but due to spec of machines performance is slow. So moved 
application to Sun Sparc running Solaris 2.5. JSP 
compilation fails with noClassDef looking for 
sun.tools.javac.Main despite tools.jar being in the classpath. I've been trying hacks of startup/tomcat.sh, building my 
own 'java' command, using different versions of JDK 
(1.2.2,1.3) all to no avail. What am I doing wrong? 
Should tomcat operate as a standalone servlet container in the environment I describe? Please help, I'm losing 
hope, sanity and temperance... 
Martin 
Searchspace 
Limited 
 Tel: 020 7255 1054 Prospect 
House 
 Fax: 020 7436 9443 80-110 New 
Oxford Street  
 Mob: 07890 896 
654  
London WC1A 1HB 
 
 
 [EMAIL PROTECTED] 
UK 
 
 
 
 www.searchspace.com 

** 
 WARNING: For your own safety all email 
attachments  should be virus scanned prior to 
opening.  This communication contains 
information which is  confidential and may be 
privileged. Please note  that the opinions 
expressed in this communication  are not 
necessarily those of Searchspace Limited. ** 
**This 
e-mail (including any documents which may accompany it) 
containsinformation which is confidential and may also be 
privileged.It is for the exclusive use of the intended 
recipient(s).If you are not the intended recipient(s) please note that 
any form ofdistribution, copying or use of this e-mail or the 
information in itor attached to it is strictly prohibited and may be 
unlawful.If you have received this e-mail in error please notify us 
immediatelyby e-mail to [EMAIL PROTECTED] or telephone +44 (0)207 940 
1200 anddelete the e-mail.Please advise immediately if you or your 
employer do not consent toInternet E-Mail for messages of this 
type.Information or opinions in this message that do not relate to 
thebusiness of Windsor plc and/or subsidiary and/or associated 
companiesshall be treated as neither given or endorsed by 
it.**

**
This e-mail (including any documents which may accompany it) contains
information which is confidential and may also be privileged.
It is for the exclusive use of the intended recipient(s).
If you are not the intended recipient(s) please note that any form of
distribution, copying or use of this e-mail or the information in it
or attached to it is strictly prohibited and may be unlawful.
If you have received this e-mail in error please notify us immediately
by e-mail to [EMAIL PROTECTED] or telephone +44 (0)207 940 1200 and
delete the e-mail.
Please advise immediately if you or your employer do not consent to
Internet E-Mail for messages of this type.

RE: Servlets and relative paths

2001-06-01 Thread Chris McNeilly

That's an improvement, although not quite it.  Now I have the full path
portion hardcoded in the java and not the xsl.  Ideally, I'd like it all
to be a relative path, but if I don't fully qualify the systemID
portion, the include still tries to prepend the tomcat/bin directory.

This helps, though.

Thanks,

Chris

 -Original Message-
 From: Steve Meyfroidt [mailto:[EMAIL PROTECTED]]
 Sent: Friday, June 01, 2001 9:40 AM
 To: '[EMAIL PROTECTED]'
 Subject: RE: Servlets and relative paths


 Set the SystemID for xsl includes: this line is part of the
 setup for some
 SAX-driven XSL processing I've used in servlets:
 StreamSource source = new StreamSource(stream,
 getSystemID());
 // set system id for xsl includes
 where getSystemID() returns the URI to use as a base location for xsl
 includes. See the xalan javadoc.

 Hope that helps.

 SteveM


 -Original Message-
 From: Chris McNeilly [mailto:[EMAIL PROTECTED]]
 Sent: Friday, June 01, 2001 2:18 PM
 To: [EMAIL PROTECTED]
 Subject: RE: Servlets and relative paths


 That's eventually what I did.  I now have two top xsl pages,
 one includes
 with fully qualified urls and the other uses the relative
 includes.  One for
 the xsl designer and the other for testing/prod.  It's not
 ideal, but isn't
 too much of a pain.

 Chris
 -Original Message-
 From: Cox, Charlie [mailto:[EMAIL PROTECTED]]
 Sent: Friday, June 01, 2001 8:45 AM
 To: '[EMAIL PROTECTED]'
 Subject: RE: Servlets and relative paths


 What I had to do was put the xsl files in the root directory
 for my webapp
 where I could make the href the full url
 (http://localhost/webapp/sections.xsl) This was the only way
 I could get it
 to work correctly. Obviously this exposes your stylesheet to
 anyone who
 requests that url. I finally gave up on the include since I
 was only sharing
 with 2 stylesheets, but I still use it for my dtd, which has the same
 problem when processed by a stylesheet.
 I didn't think that I would get it to work as I wanted since
 Xalan(library
 I'm using) doesn't know about tomcat, and I couldn't find
 anywhere in xalan
 to set a default path to look for include files/dtd's.
 Therefore it always
 assumes the 'working dir' for the application when looking
 for includes.
 The ugly option is that you could make the include path =
 ../webapps/MyContext/sections.xsl assuming your context is
 under webapps.
 Of course this is inconsistant with other paths in your
 application(i.e.
 getResourceAsStream()) and is a pain to maintain if you move
 your context.
 The other ugly option being chucking the includes into the
 bin directory,
 but that defeats the purpose of separating contexts.
 Charlie
 -Original Message-
 From: Chris McNeilly [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, May 30, 2001 2:22 PM
 To: [EMAIL PROTECTED]
 Subject: RE: Servlets and relative paths


 No, my problem is that I can use this method to read the xsl
 file just
 fine.  It's the includes inside the xsl file that aren't working.
 For example, inside the xsl file (which I read into the servlet using
 your pointer from the earlier email) there is the line
 xsl:include href='sections.xsl'/
 and I get an error saying that it cannot find file
 tomcat/bin/sections.xsl.  Which, of course, it cannot, since
 the file is
 located in Meta-Inf/.
 Chris
  -Original Message-
  From: Bo Xu [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, May 30, 2001 10:45 AM
  To: [EMAIL PROTECTED]
  Subject: Re: Servlets and relative paths
 
 
  Chris McNeilly wrote:
 
   Thanks Bo.  This is certainly a step in the right direction.
  
   I can now include the xml file and xsl file using relative
  paths.  My
   only problem now is that there are xsl includes inside the
  xsl files and
   they are still being loaded incorrectly (using the
  tomcat/bin directory
   as root, not the servlet context).  Any ideas?
  
   Thanks,
  
   Chris
  
Chris McNeilly wrote:
   
  I've got a servlet and am trying to open files.  The
problem is that its
  defaulting to the tomcat/bin directory whenever I attempt
to refer to
  them.  How can I change this?  Hardcoding the path isn't
such a good
  idea as my dev environment is different from production.
These are xml
  and xsl files and they are located on the webroot.
 
  Thanks,
 
  Chris
   
Hi :-)  from several emails in Servlet-List and this List:
   
* InputStream is = this.getServletContext().
   
getResourceAsStream(/WEB-INF/testApp.properties);
   
now testApp.properties is in myapp/WEB-INF/
   
   
*
- InputStream is =
this.getClass().getResourceAsStream(testApp.properties);
- InputStream is =
 Thread.currentThread().getContextClassLoader().
   
  getResourceAsStream(myservlet.conf);
   
   now, (normally),  myservlet.conf/testApp.properties is in
myapp/WEB-INF/classes
   
   
Bo
May.29, 2001
   
   [...]
 
  Hello Chris :-)  I am not sure, do you 

** JVM and Processes

2001-06-01 Thread myatt83

Hi,

For a particular web server we are running with Tomcat 3.1, we are having
an issue with the java servlets that are running. What appears to be
happening is that each time a servlet is called from the web site, a new
process is created to run the java program. When I view processes with ps
ax, I see dozens of instances of: 
/usr/java/jdk1.3/bin/i386/native_threads/java
 
It was briefly stated in Java Servlet Programming by Hunter  Crawford, (c)
Oreilly that 'most servlet containers execute all servlets in a single JVM
... the exception being high-end containers that support execution across
multiple backend servers...' 

We are only using 1 web server with an average weekly load of a couple of
hundred visitors.

Any ideas as to why we would be seeing so many identical processes and if
so, how to modify that?

Thanks in advance.

  -Adam





RE: Servlets and relative paths

2001-06-01 Thread Steve Meyfroidt

True. We ended up pulling a full path from config file and had the XSL pull
from a known place on the filesystem. You're right... not ideal! Untidy
deployment.

You could (I imagine) make a URL resolver that will work from the classpath.
Say it could resolve classpath://blah/foo. Would that help? Are URL
resolvers created by a factory somewhere? Is there a xalan resolver... I bet
there is somewhere.

SteveM


 -Original Message-
 From: Chris McNeilly [mailto:[EMAIL PROTECTED]]
 Sent: Friday, June 01, 2001 3:41 PM
 To: [EMAIL PROTECTED]
 Subject: RE: Servlets and relative paths
 
 
 That's an improvement, although not quite it.  Now I have the 
 full path
 portion hardcoded in the java and not the xsl.  Ideally, I'd 
 like it all
 to be a relative path, but if I don't fully qualify the systemID
 portion, the include still tries to prepend the tomcat/bin directory.
 
 This helps, though.
 
 Thanks,
 
 Chris
 
  -Original Message-
  From: Steve Meyfroidt [mailto:[EMAIL PROTECTED]]
  Sent: Friday, June 01, 2001 9:40 AM
  To: '[EMAIL PROTECTED]'
  Subject: RE: Servlets and relative paths
 
 
  Set the SystemID for xsl includes: this line is part of the
  setup for some
  SAX-driven XSL processing I've used in servlets:
  StreamSource source = new StreamSource(stream,
  getSystemID());
  // set system id for xsl includes
  where getSystemID() returns the URI to use as a base 
 location for xsl
  includes. See the xalan javadoc.
 
  Hope that helps.
 
  SteveM
 
 
  -Original Message-
  From: Chris McNeilly [mailto:[EMAIL PROTECTED]]
  Sent: Friday, June 01, 2001 2:18 PM
  To: [EMAIL PROTECTED]
  Subject: RE: Servlets and relative paths
 
 
  That's eventually what I did.  I now have two top xsl pages,
  one includes
  with fully qualified urls and the other uses the relative
  includes.  One for
  the xsl designer and the other for testing/prod.  It's not
  ideal, but isn't
  too much of a pain.
 
  Chris
  -Original Message-
  From: Cox, Charlie [mailto:[EMAIL PROTECTED]]
  Sent: Friday, June 01, 2001 8:45 AM
  To: '[EMAIL PROTECTED]'
  Subject: RE: Servlets and relative paths
 
 
  What I had to do was put the xsl files in the root directory
  for my webapp
  where I could make the href the full url
  (http://localhost/webapp/sections.xsl) This was the only way
  I could get it
  to work correctly. Obviously this exposes your stylesheet to
  anyone who
  requests that url. I finally gave up on the include since I
  was only sharing
  with 2 stylesheets, but I still use it for my dtd, which 
 has the same
  problem when processed by a stylesheet.
  I didn't think that I would get it to work as I wanted since
  Xalan(library
  I'm using) doesn't know about tomcat, and I couldn't find
  anywhere in xalan
  to set a default path to look for include files/dtd's.
  Therefore it always
  assumes the 'working dir' for the application when looking
  for includes.
  The ugly option is that you could make the include path =
  ../webapps/MyContext/sections.xsl assuming your context is
  under webapps.
  Of course this is inconsistant with other paths in your
  application(i.e.
  getResourceAsStream()) and is a pain to maintain if you move
  your context.
  The other ugly option being chucking the includes into the
  bin directory,
  but that defeats the purpose of separating contexts.
  Charlie
  -Original Message-
  From: Chris McNeilly [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, May 30, 2001 2:22 PM
  To: [EMAIL PROTECTED]
  Subject: RE: Servlets and relative paths
 
 
  No, my problem is that I can use this method to read the xsl
  file just
  fine.  It's the includes inside the xsl file that aren't working.
  For example, inside the xsl file (which I read into the 
 servlet using
  your pointer from the earlier email) there is the line
  xsl:include href='sections.xsl'/
  and I get an error saying that it cannot find file
  tomcat/bin/sections.xsl.  Which, of course, it cannot, since
  the file is
  located in Meta-Inf/.
  Chris
   -Original Message-
   From: Bo Xu [mailto:[EMAIL PROTECTED]]
   Sent: Wednesday, May 30, 2001 10:45 AM
   To: [EMAIL PROTECTED]
   Subject: Re: Servlets and relative paths
  
  
   Chris McNeilly wrote:
  
Thanks Bo.  This is certainly a step in the right direction.
   
I can now include the xml file and xsl file using relative
   paths.  My
only problem now is that there are xsl includes inside the
   xsl files and
they are still being loaded incorrectly (using the
   tomcat/bin directory
as root, not the servlet context).  Any ideas?
   
Thanks,
   
Chris
   
 Chris McNeilly wrote:

   I've got a servlet and am trying to open files.  The
 problem is that its
   defaulting to the tomcat/bin directory whenever I attempt
 to refer to
   them.  How can I change this?  Hardcoding the path isn't
 such a good
   idea as my dev environment is different from production.
  

Bean Persistence

2001-06-01 Thread Sulman . Jeff

I am currently calling a servlet that retrieves data from a database and
sets the instance variables for a number of beans.
My question is how do I make the beans available to the JSP?  I know in a
JSP I can set the scope of a bean to the session so other JSPs and servlets
can access it.  How do it do it from the other direction from a servlet to
a JSP or other servlets?

Jeff Sulman




AW: Bean Persistence

2001-06-01 Thread Anja Beckmann

if you want the beans to have request scope you add them to the
servletrequest with setAttribute, for the session you add it to the session
object with setAttribute, if you want to add it to the application scope
then you write
  ServletContext sc = getServletContext(); 
  sc.setAttribute(beanname, bean);
when you retrieve the bean in the jsp you can do it with usebean.

-Ursprüngliche Nachricht-
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Gesendet: Freitag, 1. Juni 2001 17:07
An: [EMAIL PROTECTED]
Betreff: Bean Persistence


I am currently calling a servlet that retrieves data from a database and
sets the instance variables for a number of beans.
My question is how do I make the beans available to the JSP?  I know in a
JSP I can set the scope of a bean to the session so other JSPs and servlets
can access it.  How do it do it from the other direction from a servlet to
a JSP or other servlets?

Jeff Sulman



AW: Configuration and performance

2001-06-01 Thread Ralph Einfeldt

1. has been discussed several times in this list, 
   here my last reply to this question:
 
There are some things to add:

- tomcat has to run as root to use a privileged
  port (like 80). Apache just opens the port as 
  root and spawns children under a different
  user id that process the requests.

- there are several modules around that only
  exist for apache (Like mod_gzip, mod_zlog)

- tomcat doesn't support Frontpage Server 
  Extensions (Or other CGI-Packages)
  (Please no flames, I'm not using it, but
   some of our customers)

Summary from previous posts:
- tomcat access logging is not standard
- apache will be faster in serving static content
- apache will be faster in 'speaking' http
- apache 'speaks' HTTP 1.1, tomcat 3.x speaks only 1.0
- apache is more stable
- apache is more secure

2. With linux you should hardly have reasons to use a ramdisk as 
   you are talking about. What you need is enough memory.
   Linux is quite good at caching file data on it's on.

   What effect the speed of your harddrive has to your application
   depends more on your application than on tomcat.
   If you have enough memory nearly everything that is needed
   will be in memory.
   Looking isolated at tomcat there will be a high impact for the
   write access (Look at the logs that are generated).

3. Tomcat has no memory limit of it's own. It just dependends on the os
   and the vm (Since 1.3.1 you can use more than 2 GB as heap with the 
   sun vm)

4. I don't know

 -Ursprüngliche Nachricht-
 Von: Brian Kejser [mailto:[EMAIL PROTECTED]]
 Gesendet: Freitag, 1. Juni 2001 15:06
 An: '[EMAIL PROTECTED]'
 Betreff: Configuration and performance
 
 
 Hi
 
 1. Is there any advantage in using Apache Web Server as a front end to
 Tomcat when the bulk of the site being served is dynamic 
 (i.e. servlets)?
 
 2. Is there any advantage in using high end drives on a 
 Tomcat Web Server
 (running Red Hat Linux on Intel hardware)? When is disk 
 access required
 (i.e. what is cached in memory and what isn't)? Would using a 
 RAM drive
 negate the need for high end drives? If so, what files would 
 be placed in
 the RAM drive?
 
 3. How much memory can Tomcat take advantage of (512M, 1024M)?
 
 4. How does Tomcat perform in relation to other Java 
 Application Servers?
 Are there any web sites that display test results?
 
 Thank you
 



Re: Tomcat tanks all by itself

2001-06-01 Thread Joe Howes

Nope..1.2.2

Chris Janicki wrote:
 
 Are you using Java 1.3?  If so downgrade to 1.2.2.5 or later.  Java 1.3
 has intermittent synchronization problems.
 
  Original Message 
 
 On 5/31/01, 5:06:00 PM, Joe Howes [EMAIL PROTECTED] wrote regarding Tomcat
 tanks all by itself:
 
  I've found a couple of posts on this but no solutions yet.
 
  Running apache 1.3.12, jakarta-tomcat 3.2.2, Solaris 5.8.
 
  Tomcat seems to just die all by itself for no reason.  Sometimes it dies
  quickly, sometimes it takes a few hours.  You try hitting a servlet and
  you get an apache Internal Server Error message.  The only log entry
  that gets made on this request is in the tomcat log mod_jk.log.  No
  other apache or tomcat logs get updated.  The lines are:
 
  ---
  [jk_connect.c (143)]: jk_open_socket, connect() failed errno = 146
  [jk_ajp12_worker.c (152)]: In jk_endpoint_t::service, Error sd = -1
  ---
 
  At this point, if you do a startup.sh everything works fine, so it's
  just like Tomcat dies.
 
  Anyone come across this?
 
  - Joe



RE: ** JVM and Processes

2001-06-01 Thread myatt83

Randy,

Thanks for the advice. Could you be a little more specific, though, about
how to use green threads instead of native threads and possibly differences
between the two? Thanks.

 - Adam


At 10:59 AM 6/1/2001 -0400, you wrote:

   Don't use ps - these are actually threads.  ps is showing them as
processes because that is what it does.  If you use green thread (as opposed
to the native threads you are using now), the display will go away, but you
will experience a slowdown (how much depends on your operating system and
other activity on the system).

   Randy


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Friday, June 01, 2001 10:37 AM
 To: [EMAIL PROTECTED]
 Subject: ** JVM and Processes
 
 
 Hi,
 
 For a particular web server we are running with Tomcat 3.1, 
 we are having
 an issue with the java servlets that are running. What appears to be
 happening is that each time a servlet is called from the web 
 site, a new
 process is created to run the java program. When I view 
 processes with ps
 ax, I see dozens of instances of: 
 /usr/java/jdk1.3/bin/i386/native_threads/java
  
 It was briefly stated in Java Servlet Programming by Hunter  
 Crawford, (c)
 Oreilly that 'most servlet containers execute all servlets in 
 a single JVM
 ... the exception being high-end containers that support 
 execution across
 multiple backend servers...' 
 
 We are only using 1 web server with an average weekly load of 
 a couple of
 hundred visitors.
 
 Any ideas as to why we would be seeing so many identical 
 processes and if
 so, how to modify that?
 
 Thanks in advance.
 
   -Adam
 
 






RE: ** JVM and Processes

2001-06-01 Thread BARRAUD Valérie
Title: RE: ** JVM and Processes






http://java.sun.com/products/jdk/1.1/packs/native-threads/README


-Message d'origine-
De: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]]
Date: vendredi 1 juin 2001 17:46
À: [EMAIL PROTECTED]
Objet: RE: ** JVM and Processes


Randy,


Thanks for the advice. Could you be a little more specific, though, about
how to use green threads instead of native threads and possibly differences
between the two? Thanks.


- Adam



At 10:59 AM 6/1/2001 -0400, you wrote:

 Don't use ps - these are actually threads. ps is showing them as
processes because that is what it does. If you use green thread (as opposed
to the native threads you are using now), the display will go away, but you
will experience a slowdown (how much depends on your operating system and
other activity on the system).

 Randy


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Friday, June 01, 2001 10:37 AM
 To: [EMAIL PROTECTED]
 Subject: ** JVM and Processes
 
 
 Hi,
 
 For a particular web server we are running with Tomcat 3.1, 
 we are having
 an issue with the java servlets that are running. What appears to be
 happening is that each time a servlet is called from the web 
 site, a new
 process is created to run the java program. When I view 
 processes with ps
 ax, I see dozens of instances of: 
 /usr/java/jdk1.3/bin/i386/native_threads/java
 
 It was briefly stated in Java Servlet Programming by Hunter  
 Crawford, (c)
 Oreilly that 'most servlet containers execute all servlets in 
 a single JVM
 ... the exception being high-end containers that support 
 execution across
 multiple backend servers...' 
 
 We are only using 1 web server with an average weekly load of 
 a couple of
 hundred visitors.
 
 Any ideas as to why we would be seeing so many identical 
 processes and if
 so, how to modify that?
 
 Thanks in advance.
 
 -Adam
 
 







Re: ** JVM and Processes

2001-06-01 Thread Michael Jennings
Title: RE: ** JVM and Processes



My understanding of green vs. native threads is as 
follows:
With native threads, an actual system thread is 
created when a Java thread is created.
On linux a system thread takes the form of another 
process, but one that shares memory
etc. with another process. This is why if you 
create a program that allocates 100 megs of memory,
then spins off 10 threads, it looks like 10 
processes each taking up 100 megs of memory, when in
fact the amount of memory is 100 megs + 10*overhead 
for each thread (not much more than 100 megs).

On WIN32 systems, threads do not show up as 
separate processes, they are separate threads of execution
inside the same process (essentially the same as 
the Linux implementation with differences too subtle to care about)

Green threads on the other hand use timers, 
signals, setjmp etc. voodoo to "simulate" threads within one 
process.
Essentially taking over the scheduling from the 
kernel.

I believe the command-line option for green threads 
is simply "-green" as in
java -green MyThreaddedApp

If you have a multi-cpu system, green threads will 
only take advantage of one cpu, whereas native threads
will use all the cpus on your system (that's the 
theory anyway)

I've heard of problems with blocking I/O with green 
threads, but have no first hand knowledge.

Hope this helps.
-Mike Jennings


  - Original Message - 
  From: 
  BARRAUD Valérie 
  
  To: '[EMAIL PROTECTED]' 
  
  Sent: Friday, June 01, 2001 9:01 AM
  Subject: RE: ** JVM and Processes
  
  http://java.sun.com/products/jdk/1.1/packs/native-threads/README 
  
  
-Message d'origine- De: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]] 
Date: vendredi 1 juin 2001 17:46 À: [EMAIL PROTECTED] 
Objet: RE: ** JVM and Processes 
Randy, 
Thanks for the advice. Could you be a little more 
specific, though, about how to use green 
threads instead of native threads and possibly differences between the two? Thanks. 
- Adam 
At 10:59 AM 6/1/2001 -0400, you wrote: 
  Don't use ps - these are 
actually threads. ps is showing them as processes because that is what it does. If you use green 
thread (as opposed to the native 
threads you are using now), the display will go away, but you 
will experience a slowdown (how much depends 
on your operating system and other 
activity on the system).  
 
Randy-Original 
Message-  From: 
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]  Sent: 
Friday, June 01, 2001 10:37 AM  
To: [EMAIL PROTECTED]  Subject: ** JVM and ProcessesHi,  
 For a particular web server we 
are running with Tomcat 3.1,  we 
are having  an issue with the 
java servlets that are running. What appears to be  happening is that each time a servlet is called 
from the web  site, a new 
 process is created to run the java 
program. When I view  processes 
with "ps  ax", I see dozens of 
instances of:  
/usr/java/jdk1.3/bin/i386/native_threads/java   It was 
briefly stated in Java Servlet Programming by Hunter   Crawford, (c)  Oreilly that 'most servlet containers execute all servlets 
in  a single JVM  ... the exception being high-end containers that 
support  execution across 
 multiple backend servers...' 
  We are only using 1 web server with an average weekly load 
of  a couple of  hundred visitors.   Any ideas as to 
why we would be seeing so many identical  processes and if  
so, how to modify that?  
 Thanks in advance. 
  -Adam 



Classloader, JNI and already loaded in another classloader

2001-06-01 Thread Mark Benzel

I have a webapp running under Tomcat 3.2.1 that needs to make JNI calls in
order to access data and methods in legacy C++ code.  A servlet is loaded on
startup of the webapp that, as part if its init method, causes a data set
specific to that webapp instance to be loaded into the C++ data structures.
This Java code for this servlet contains the following:

static
{
try {
System.loadLibrary(JCoreImpl);
System.out.println(JCoreImpl loaded);
m_bLibraryLoaded = true;
} catch (UnsatisfiedLinkError e) {
m_bLibraryLoaded = false;
System.out.println(JCoreImpl NOT loaded  + e);
}
}

Things work fine if there is only one webapp (let's call it webapps/aaa).
If I have a second webapp (webapps/bbb) that is identical to webapps/aaa
except for the data set used in the C++ data structures, then webapps/aaa
starts up just fine, but when webapps/bbb is started I get an error stating
that:

JCoreImpl NOT loaded java.lang.UnsatisfiedLinkError: Native Library
E:\WebStation\binDebug\JCoreImpl.dll already loaded in another classloader

I need to have a separate instance of the native library for each of my
webapps as each instance needs to contain data that is unique to that
particular webapp.  I have searched through the mail archives and read
emails by Craig McLanahan explaining the classloader hierarchy.  But I have
not been able to find anything specific to loading a unique instance of a
native library for each webapp.

Any ideas?  Thanks,

Mark



Re: Netscape and Tomcat

2001-06-01 Thread Aaron Nance

I know a lot of the time Netscape 4.76 on Windows tends to become a zombie process if 
you push it to much.   When this happens the browser starts behaving erratically.  
Exit out of Netscape and check you task manager.  If you see netscape.exe in the task 
list kill it then relaunch Netscape.  That usually works for me, anyway.

Aaron

 [EMAIL PROTECTED] 05/31/01 10:46PM 
Does anybody know of any reason why Tomcat would not work properly with
Netscape?

When I try to access my server, using http://localhost:8080, it correctly
returns the Tomcat default page.  However, none of the links work, and I
cannot access any of my own applications (JSPs) under Tomcat.  I have
observed this behaviour on Windows 2000 and on Linux with Netscape 4.75.
Netscape 6 is OK, as is IE.

Any ideas?

Stephen Oakes
senior developer
-
[EMAIL PROTECTED] 
-
a t o m i c m e d i a
Leading Partners Online

Level 1 / 216 City Road
Southbank, Melbourne, Vic 3006
Australia.

+61 3 9695 5777 phone
+61 3 9695 5700 fax
-
www.atomicmedia.com 
-






UNSUSCRIBE

2001-06-01 Thread rene-michel . thuny

 UNSUSCRIBE




Re: Classloader, JNI and already loaded in another classloader

2001-06-01 Thread Pae Choi

Just to give a thought for your situation, how would you think if we
place a plain java bean(i.e., common wrapper class) that interact with the
c++/dll module and provide the access from the Web components, i.e.,
servlet/jsp --- the jb's user --- to the java bean(jb). In that case,
multiple jb's users are accessing a single dll through the jb.

Does it make sense to you?


Pae



I have a webapp running under Tomcat 3.2.1 that needs to make JNI calls in
order to access data and methods in legacy C++ code.  A servlet is loaded
on
startup of the webapp that, as part if its init method, causes a data set
specific to that webapp instance to be loaded into the C++ data structures.
This Java code for this servlet contains the following:

static
{
try {
System.loadLibrary(JCoreImpl);
System.out.println(JCoreImpl loaded);
m_bLibraryLoaded = true;
} catch (UnsatisfiedLinkError e) {
m_bLibraryLoaded = false;
System.out.println(JCoreImpl NOT loaded  + e);
}
}

Things work fine if there is only one webapp (let's call it webapps/aaa).
If I have a second webapp (webapps/bbb) that is identical to webapps/aaa
except for the data set used in the C++ data structures, then webapps/aaa
starts up just fine, but when webapps/bbb is started I get an error stating
that:

JCoreImpl NOT loaded java.lang.UnsatisfiedLinkError: Native Library
E:\WebStation\binDebug\JCoreImpl.dll already loaded in another classloader

I need to have a separate instance of the native library for each of my
webapps as each instance needs to contain data that is unique to that
particular webapp.  I have searched through the mail archives and read
emails by Craig McLanahan explaining the classloader hierarchy.  But I have
not been able to find anything specific to loading a unique instance of a
native library for each webapp.

Any ideas?  Thanks,

Mark




Re: ** JVM and Processes

2001-06-01 Thread Jeff Kilbride

When Java first came to the Linux platform (via the Blackdown port),
green-threads were the only option. Native threads took a little longer to
implement, but are a much better option for the reasons listed in the
previous message. So, I would recommend avoiding green-threads unless you
have a specific reason for using them.

A lot of people freak out when they see the number of processes being
reported by ps or top, without realizing that these are merely threads and
not full-blown processes. If you have a lightly loaded Tomcat, you can tune
down the number of threads being spawned by using the max_threads,
max_spare_threads, and min_spare_threads parameters of the PoolTCPConnector
in your server.xml file. For an example of this, take a look at the tomcat
user's guide:

http://jakarta.apache.org/tomcat/tomcat-3.2-doc/index.html

Do a find in your web browser for max_threads. I use this to limit the
number of ajp12 threads and maximize ajp13 threads -- because I'm using
ajp13 for my servlets and ajp12 only for startup/shutdown of Tomcat.

Conversely, if you have a heavily loaded Tomcat, you should use these
parameters to increase performance.

Thanks,
--jeff

- Original Message -
From: Michael Jennings [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, June 01, 2001 9:32 AM
Subject: Re: ** JVM and Processes


RE: ** JVM and ProcessesMy understanding of green vs. native threads is as
follows:
With native threads, an actual system thread is created when a Java thread
is created.
On linux a system thread takes the form of another process, but one that
shares memory
etc. with another process. This is why if you create a program that
allocates 100 megs of memory,
then spins off 10 threads, it looks like 10 processes each taking up 100
megs of memory, when in
fact the amount of memory is 100 megs + 10*overhead for each thread (not
much more than 100 megs).

On WIN32 systems, threads do not show up as separate processes, they are
separate threads of execution
inside the same process (essentially the same as the Linux implementation
with differences too subtle to care about)

Green threads on the other hand use timers, signals, setjmp etc. voodoo to
simulate threads within one process.
Essentially taking over the scheduling from the kernel.

I believe the command-line option for green threads is simply -green as in
java -green MyThreaddedApp

If you have a multi-cpu system, green threads will only take advantage of
one cpu, whereas native threads
will use all the cpus on your system (that's the theory anyway)

I've heard of problems with blocking I/O with green threads, but have no
first hand knowledge.

Hope this helps.
-Mike Jennings

  - Original Message -
  From: BARRAUD Valérie
  To: '[EMAIL PROTECTED]'
  Sent: Friday, June 01, 2001 9:01 AM
  Subject: RE: ** JVM and Processes




  http://java.sun.com/products/jdk/1.1/packs/native-threads/README

-Message d'origine-
De: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]]
Date:   vendredi 1 juin 2001 17:46
À:  [EMAIL PROTECTED]
Objet:  RE: ** JVM and Processes

Randy,

Thanks for the advice. Could you be a little more specific, though,
about
how to use green threads instead of native threads and possibly
differences
between the two? Thanks.

 - Adam



At 10:59 AM 6/1/2001 -0400, you wrote:

   Don't use ps - these are actually threads.  ps is showing them
as
processes because that is what it does.  If you use green thread (as
opposed
to the native threads you are using now), the display will go away, but
you
will experience a slowdown (how much depends on your operating system
and
other activity on the system).

   Randy


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Friday, June 01, 2001 10:37 AM
 To: [EMAIL PROTECTED]
 Subject: ** JVM and Processes


 Hi,

 For a particular web server we are running with Tomcat 3.1,
 we are having
 an issue with the java servlets that are running. What appears to be
 happening is that each time a servlet is called from the web
 site, a new
 process is created to run the java program. When I view
 processes with ps
 ax, I see dozens of instances of:
 /usr/java/jdk1.3/bin/i386/native_threads/java

 It was briefly stated in Java Servlet Programming by Hunter 
 Crawford, (c)
 Oreilly that 'most servlet containers execute all servlets in
 a single JVM
 ... the exception being high-end containers that support
 execution across
 multiple backend servers...'

 We are only using 1 web server with an average weekly load of
 a couple of
 hundred visitors.

 Any ideas as to why we would be seeing so many identical
 processes and if
 so, how to modify that?

 Thanks in advance.

   -Adam










URLConection and readfully failsHi

2001-06-01 Thread kaab kaoutar


Hi
i use the follwing:

try {
 URL urlObject = new URL(url);
 URLConnection agent = urlObject.openConnection();
 DataInputStream input =
   new DataInputStream(agent.getInputStream());

and
the following code doesn't work
/*
 byte[] b = new byte[input.available 
()];//System.out.println(input.available());
 input.readFully (b);
 input.close ();//System.out.println(b.length);
 page=new String (b, 0, b.length);
 System.out.println(page);System.out.println(end);
 return page;
  */


but that one does!

while((nextLine = input.readLine()) != null) {
page.append(nextLine+\n);}
 input.close();
 return(page.toString());


aslong as reding line by line consumes time i'd like to use readfully! ho 
wto do it ? is there a more performent and speedy when to get the page ?
thanks
_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.




Re: Classloader, JNI and already loaded in another classloader

2001-06-01 Thread Bo Xu

 [...]
 I have a webapp running under Tomcat 3.2.1 that needs to make JNI calls in
 order to access data and methods in legacy C++ code.  A servlet is loaded
 on startup of the webapp that, as part if its init method, causes a data set
 specific to that webapp instance to be loaded into the C++ data structures.
 This Java code for this servlet contains the following:
 
 static
 {
 try {
 System.loadLibrary(JCoreImpl);
 System.out.println(JCoreImpl loaded);
 m_bLibraryLoaded = true;
 } catch (UnsatisfiedLinkError e) {
 m_bLibraryLoaded = false;
 System.out.println(JCoreImpl NOT loaded  + e);
 }
 }
 
 Things work fine if there is only one webapp (let's call it webapps/aaa).
 If I have a second webapp (webapps/bbb) that is identical to webapps/aaa
 except for the data set used in the C++ data structures, then webapps/aaa
 starts up just fine, but when webapps/bbb is started I get an error stating
 that:
 
 JCoreImpl NOT loaded java.lang.UnsatisfiedLinkError: Native Library
 E:\WebStation\binDebug\JCoreImpl.dll already loaded in another classloader
 
 I need to have a separate instance of the native library for each of my
 webapps as each instance needs to contain data that is unique to that
 particular webapp.  I have searched through the mail archives and read
 emails by Craig McLanahan explaining the classloader hierarchy.  But I have
 not been able to find anything specific to loading a unique instance of a
 native library for each webapp.
 
 Any ideas?  Thanks,
 
 Mark

Hi :-) is the following possible?

- don't put System.loadLibrary(JCoreImpl) in Servlet class,
   but put it in a utility class which is loaded by a classloader who is
   upper than the classloader of aaa or bbb.  for example, put this
utility class and the native code Both in TOMCAT_HOME/lib

- then in the init method of those Servlet classes in webapp aaa
   or bbb, first load that utility class, then/so load the native code.


Bo
June.01, 2001







Re: ** JVM and Processes

2001-06-01 Thread myatt83

Jeff,

Thanks a bunch. Your answer appears to be the best so far. I have
implemented the PoolTCPConnector in the server xml file and it appears to
be limiting the number of threads as it should. However, something that has
been happening (even before switching to PoolTCPConnector) is that when
running multiple java servlets the threads stay alive long after they
should have died or been garbage collected. Even after a long wait, the
only way (apparently) to get rid of them is to go through and kill them one
at a time. Is there a setting somewhere that is telling the java threads to
stay alive indefinitely?

Thanks for your help,
 - Adam


At 10:34 AM 6/1/2001 -0700, you wrote:
When Java first came to the Linux platform (via the Blackdown port),
green-threads were the only option. Native threads took a little longer to
implement, but are a much better option for the reasons listed in the
previous message. So, I would recommend avoiding green-threads unless you
have a specific reason for using them.

A lot of people freak out when they see the number of processes being
reported by ps or top, without realizing that these are merely threads and
not full-blown processes. If you have a lightly loaded Tomcat, you can tune
down the number of threads being spawned by using the max_threads,
max_spare_threads, and min_spare_threads parameters of the PoolTCPConnector
in your server.xml file. For an example of this, take a look at the tomcat
user's guide:

http://jakarta.apache.org/tomcat/tomcat-3.2-doc/index.html

Do a find in your web browser for max_threads. I use this to limit the
number of ajp12 threads and maximize ajp13 threads -- because I'm using
ajp13 for my servlets and ajp12 only for startup/shutdown of Tomcat.

Conversely, if you have a heavily loaded Tomcat, you should use these
parameters to increase performance.

Thanks,
--jeff

- Original Message -
From: Michael Jennings [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, June 01, 2001 9:32 AM
Subject: Re: ** JVM and Processes


RE: ** JVM and ProcessesMy understanding of green vs. native threads is as
follows:
With native threads, an actual system thread is created when a Java thread
is created.
On linux a system thread takes the form of another process, but one that
shares memory
etc. with another process. This is why if you create a program that
allocates 100 megs of memory,
then spins off 10 threads, it looks like 10 processes each taking up 100
megs of memory, when in
fact the amount of memory is 100 megs + 10*overhead for each thread (not
much more than 100 megs).

On WIN32 systems, threads do not show up as separate processes, they are
separate threads of execution
inside the same process (essentially the same as the Linux implementation
with differences too subtle to care about)

Green threads on the other hand use timers, signals, setjmp etc. voodoo to
simulate threads within one process.
Essentially taking over the scheduling from the kernel.

I believe the command-line option for green threads is simply -green as in
java -green MyThreaddedApp

If you have a multi-cpu system, green threads will only take advantage of
one cpu, whereas native threads
will use all the cpus on your system (that's the theory anyway)

I've heard of problems with blocking I/O with green threads, but have no
first hand knowledge.

Hope this helps.
-Mike Jennings

  - Original Message -
  From: BARRAUD Valérie
  To: '[EMAIL PROTECTED]'
  Sent: Friday, June 01, 2001 9:01 AM
  Subject: RE: ** JVM and Processes




  http://java.sun.com/products/jdk/1.1/packs/native-threads/README

-Message d'origine-
De: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]]
Date:   vendredi 1 juin 2001 17:46
À:  [EMAIL PROTECTED]
Objet:  RE: ** JVM and Processes

Randy,

Thanks for the advice. Could you be a little more specific, though,
about
how to use green threads instead of native threads and possibly
differences
between the two? Thanks.

 - Adam



At 10:59 AM 6/1/2001 -0400, you wrote:

   Don't use ps - these are actually threads.  ps is showing them
as
processes because that is what it does.  If you use green thread (as
opposed
to the native threads you are using now), the display will go away, but
you
will experience a slowdown (how much depends on your operating system
and
other activity on the system).

   Randy


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Friday, June 01, 2001 10:37 AM
 To: [EMAIL PROTECTED]
 Subject: ** JVM and Processes


 Hi,

 For a particular web server we are running with Tomcat 3.1,
 we are having
 an issue with the java servlets that are running. What appears to be
 happening is that each time a servlet is called from the web
 site, a new
 process is created to run the java program. When I view
 processes with ps
 ax, I see 

RE: Classloader, JNI and already loaded in another classloader

2001-06-01 Thread Mark Benzel

Yes, it makes sense.  However, I'm not sure if it solves my problem.  In
the scenario you describe, I would want to have 2 Java Beans, each accessing
a separate instance of the C++/DLL.  That's because the data contained in
the 
C++/DLL used by webapps/aaa is different than the data contained in the
C++/DLL
used by webapps/bbb.  An equivalent case would be running the same
standalone
Java application twice with each instance of the Java application accessing
a
different set of data.

Thanks,

Mark

-Original Message-
From: Pae Choi [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 01, 2001 10:30 AM
To: [EMAIL PROTECTED]
Subject: Re: Classloader, JNI and already loaded in another classloader


Just to give a thought for your situation, how would you think if we
place a plain java bean(i.e., common wrapper class) that interact with the
c++/dll module and provide the access from the Web components, i.e.,
servlet/jsp --- the jb's user --- to the java bean(jb). In that case,
multiple jb's users are accessing a single dll through the jb.

Does it make sense to you?


Pae



I have a webapp running under Tomcat 3.2.1 that needs to make JNI calls in
order to access data and methods in legacy C++ code.  A servlet is loaded
on
startup of the webapp that, as part if its init method, causes a data set
specific to that webapp instance to be loaded into the C++ data structures.
This Java code for this servlet contains the following:

static
{
try {
System.loadLibrary(JCoreImpl);
System.out.println(JCoreImpl loaded);
m_bLibraryLoaded = true;
} catch (UnsatisfiedLinkError e) {
m_bLibraryLoaded = false;
System.out.println(JCoreImpl NOT loaded  + e);
}
}

Things work fine if there is only one webapp (let's call it webapps/aaa).
If I have a second webapp (webapps/bbb) that is identical to webapps/aaa
except for the data set used in the C++ data structures, then webapps/aaa
starts up just fine, but when webapps/bbb is started I get an error stating
that:

JCoreImpl NOT loaded java.lang.UnsatisfiedLinkError: Native Library
E:\WebStation\binDebug\JCoreImpl.dll already loaded in another classloader

I need to have a separate instance of the native library for each of my
webapps as each instance needs to contain data that is unique to that
particular webapp.  I have searched through the mail archives and read
emails by Craig McLanahan explaining the classloader hierarchy.  But I have
not been able to find anything specific to loading a unique instance of a
native library for each webapp.

Any ideas?  Thanks,

Mark



J2ME and Tomcat

2001-06-01 Thread gunter . woytowitz




Hi,

I want to use Apache,Tomcat Java Servlet engine, and Velocity with J2ME on
Linux.
I don't need the the JSP portion of Tomcat.
Does anyone know if this is possible?
Is there a way to configure Tomcat so that it looks for cvm instead of java
for the JRE?
Is there an easy way to remove the JSP portion of Tomcat?

Thanks,
Gunter Woytowitz





Re: File uploads and Ajp13 with Tomcat 3.2.2

2001-06-01 Thread Paul Rubenis

Yes.  I downed the binary installation for Tomcat 3.2.2 and the src for
3.2.2.  I compiled the mod_jk and copied it into the libexec directory under
Apache.

Hunter Hillegas wrote:

 Did you compile and install the new mod_jk.so?

Paul Rubenis
[EMAIL PROTECTED]




Re: Classloader, JNI and already loaded in another classloader

2001-06-01 Thread Pae Choi

I may be completely misunderstanding your case. However, the DLL itself
is runnging as a single instance but has separate data segments for its
each reference. Fro example, 2 users and 1 DLL will result a single instance
of code segment and 2 different data segments for each user respectively.
Agreeable?

If so, isn't java bean as a user calling the DLL twice create the same
scenario?
So two different accesses from the jb's user can get the separate data
returned
by the DLL.


Pae



-Original Message-
From: Mark Benzel [EMAIL PROTECTED]
To: '[EMAIL PROTECTED]' [EMAIL PROTECTED]
Date: Friday, June 01, 2001 11:18 AM
Subject: RE: Classloader, JNI and already loaded in another classloader


Yes, it makes sense.  However, I'm not sure if it solves my problem.  In
the scenario you describe, I would want to have 2 Java Beans, each
accessing
a separate instance of the C++/DLL.  That's because the data contained in
the
C++/DLL used by webapps/aaa is different than the data contained in the
C++/DLL
used by webapps/bbb.  An equivalent case would be running the same
standalone
Java application twice with each instance of the Java application accessing
a
different set of data.

Thanks,

Mark

-Original Message-
From: Pae Choi [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 01, 2001 10:30 AM
To: [EMAIL PROTECTED]
Subject: Re: Classloader, JNI and already loaded in another classloader


Just to give a thought for your situation, how would you think if we
place a plain java bean(i.e., common wrapper class) that interact with the
c++/dll module and provide the access from the Web components, i.e.,
servlet/jsp --- the jb's user --- to the java bean(jb). In that case,
multiple jb's users are accessing a single dll through the jb.

Does it make sense to you?


Pae



I have a webapp running under Tomcat 3.2.1 that needs to make JNI calls in
order to access data and methods in legacy C++ code.  A servlet is loaded
on
startup of the webapp that, as part if its init method, causes a data set
specific to that webapp instance to be loaded into the C++ data
structures.
This Java code for this servlet contains the following:

static
{
try {
System.loadLibrary(JCoreImpl);
System.out.println(JCoreImpl loaded);
m_bLibraryLoaded = true;
} catch (UnsatisfiedLinkError e) {
m_bLibraryLoaded = false;
System.out.println(JCoreImpl NOT loaded  + e);
}
}

Things work fine if there is only one webapp (let's call it
webapps/aaa).
If I have a second webapp (webapps/bbb) that is identical to webapps/aaa
except for the data set used in the C++ data structures, then webapps/aaa
starts up just fine, but when webapps/bbb is started I get an error
stating
that:

JCoreImpl NOT loaded java.lang.UnsatisfiedLinkError: Native Library
E:\WebStation\binDebug\JCoreImpl.dll already loaded in another classloader

I need to have a separate instance of the native library for each of my
webapps as each instance needs to contain data that is unique to that
particular webapp.  I have searched through the mail archives and read
emails by Craig McLanahan explaining the classloader hierarchy.  But I
have
not been able to find anything specific to loading a unique instance of a
native library for each webapp.

Any ideas?  Thanks,

Mark




Re: Per-context authentication database

2001-06-01 Thread Twylite

Hi,

Thanks for the reply.

 Interestingly I'm doing something almost exactly like that ... but
 no matter what page/context I'm accessing I appear to be getting
 the root context from req.getContext() .  Any suggestions?
Have you got the different contexts defined in server.xml?

Yes.  
Of course ... I should probably have consulted my configuration before jumping to 
conclusions ...
let's just say I changed the root context to my development directory, and wasn't 
expecting Ctx ( ) for it ;)
*hits head and weeps in shame*

But everything's working fine now ;)  It was working fine before ... I just didn't 
know it.  Shees.

Twylite




Re: ** JVM and Processes

2001-06-01 Thread Jeff Kilbride

Hi Adam,

No, the garbage collector runs as a low priority background process and, on
a lightly loaded server, may never get called because the server's not using
enough resources to warrant it. I really wouldn't worry about it too much
and I would definitely avoid killing threads individually, especially since
you're now utilizing a Pool connector. (you don't want to kill threads that
are marked as available in the pool...) The min_spare_threads and
max_spare_threads settings are supposed to take care of cleaning up any
extra unused threads that are laying around.

I think the best benefit you could do yourself would be to upgrade your 3.1
version of Tomcat to the newly released 3.2.2 final to take advantage of
upgrades and bug fixes.

Thanks,
--jeff

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, June 01, 2001 11:03 AM
Subject: Re: ** JVM and Processes


 Jeff,

 Thanks a bunch. Your answer appears to be the best so far. I have
 implemented the PoolTCPConnector in the server xml file and it appears to
 be limiting the number of threads as it should. However, something that
has
 been happening (even before switching to PoolTCPConnector) is that when
 running multiple java servlets the threads stay alive long after they
 should have died or been garbage collected. Even after a long wait, the
 only way (apparently) to get rid of them is to go through and kill them
one
 at a time. Is there a setting somewhere that is telling the java threads
to
 stay alive indefinitely?

 Thanks for your help,
  - Adam


 At 10:34 AM 6/1/2001 -0700, you wrote:
 When Java first came to the Linux platform (via the Blackdown port),
 green-threads were the only option. Native threads took a little longer
to
 implement, but are a much better option for the reasons listed in the
 previous message. So, I would recommend avoiding green-threads unless you
 have a specific reason for using them.
 
 A lot of people freak out when they see the number of processes being
 reported by ps or top, without realizing that these are merely threads
and
 not full-blown processes. If you have a lightly loaded Tomcat, you can
tune
 down the number of threads being spawned by using the max_threads,
 max_spare_threads, and min_spare_threads parameters of the
PoolTCPConnector
 in your server.xml file. For an example of this, take a look at the
tomcat
 user's guide:
 
 http://jakarta.apache.org/tomcat/tomcat-3.2-doc/index.html
 
 Do a find in your web browser for max_threads. I use this to limit
the
 number of ajp12 threads and maximize ajp13 threads -- because I'm using
 ajp13 for my servlets and ajp12 only for startup/shutdown of Tomcat.
 
 Conversely, if you have a heavily loaded Tomcat, you should use these
 parameters to increase performance.
 
 Thanks,
 --jeff
 
 - Original Message -
 From: Michael Jennings [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, June 01, 2001 9:32 AM
 Subject: Re: ** JVM and Processes
 
 
 RE: ** JVM and ProcessesMy understanding of green vs. native threads is
as
 follows:
 With native threads, an actual system thread is created when a Java
thread
 is created.
 On linux a system thread takes the form of another process, but one that
 shares memory
 etc. with another process. This is why if you create a program that
 allocates 100 megs of memory,
 then spins off 10 threads, it looks like 10 processes each taking up 100
 megs of memory, when in
 fact the amount of memory is 100 megs + 10*overhead for each thread (not
 much more than 100 megs).
 
 On WIN32 systems, threads do not show up as separate processes, they are
 separate threads of execution
 inside the same process (essentially the same as the Linux implementation
 with differences too subtle to care about)
 
 Green threads on the other hand use timers, signals, setjmp etc. voodoo
to
 simulate threads within one process.
 Essentially taking over the scheduling from the kernel.
 
 I believe the command-line option for green threads is simply -green as
in
 java -green MyThreaddedApp
 
 If you have a multi-cpu system, green threads will only take advantage of
 one cpu, whereas native threads
 will use all the cpus on your system (that's the theory anyway)
 
 I've heard of problems with blocking I/O with green threads, but have no
 first hand knowledge.
 
 Hope this helps.
 -Mike Jennings
 
   - Original Message -
   From: BARRAUD Valérie
   To: '[EMAIL PROTECTED]'
   Sent: Friday, June 01, 2001 9:01 AM
   Subject: RE: ** JVM and Processes
 
 
 
 
   http://java.sun.com/products/jdk/1.1/packs/native-threads/README
 
 -Message d'origine-
 De: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]]
 Date:   vendredi 1 juin 2001 17:46
 À:  [EMAIL PROTECTED]
 Objet:  RE: ** JVM and Processes
 
 Randy,
 
 Thanks for the advice. Could you be a little more specific, though,
 about
 how to use green threads instead of native threads and possibly
 differences
 between the 

Tomcat running as a service!

2001-06-01 Thread Shailendra T Kontham

Hello all,
I just wanted to know if there is any way i can run the tomcat
as a serivce just like apache on win200.
so that it starts up as soon as i log on just like apache.
Any help will be greately appreciated.
Thanks,
Shailendra

-
Shailendra T. Kontham
Advcancework Inc., 
2-212 Center for Science and Technology
Syracuse NY-13244-4100
Off:(315)-443-4237




3.2.2 Dies After Prolonged Use...

2001-06-01 Thread Hunter Hillegas

You may remember my posts about Tomcat dying on me... Well I upgraded to
3.2.2 and it is still happening.

It only seems to happen after prolonged periods (lots of hits)...

I increased the heap to 256MB with a max of 512MB. We're not using sessions
on the site and the session timeout is set to 5 minutes anyway...

What could be going on?

Hunter




RE: Tomcat running as a service!

2001-06-01 Thread Ronald G. Louzon

In the Tomcat Documentation \doc directory, look at index.html.  It has a
link to The Jakarta NT Service.  This describes what you are looking
for...

-Original Message-
From: Shailendra T Kontham [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 01, 2001 3:03 PM
To: [EMAIL PROTECTED]
Subject: Tomcat running as a service!


Hello all,
I just wanted to know if there is any way i can run the tomcat
as a serivce just like apache on win200.
so that it starts up as soon as i log on just like apache.
Any help will be greately appreciated.
Thanks,
Shailendra

-
Shailendra T. Kontham
Advcancework Inc., 
2-212 Center for Science and Technology
Syracuse NY-13244-4100
Off:(315)-443-4237



RE: Tomcat running as a service!

2001-06-01 Thread Ratnakar Palle

Yes, you can do that...
Download the jk_nt_service.exe from the tomcat site and execute 
jk_nt_service.exe -i servicename location of your wrapper.properties

But, before that you may have to update your wrapper.properties like
wrapper.tomcat_home=c:\jakarta-tomcat-3.2.1
wrapper.java_home=c:\jdk1.3
if it's not already done...

Hope that helps...

-Ratnakar

-Original Message-
From: Shailendra T Kontham [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 01, 2001 12:03 PM
To: [EMAIL PROTECTED]
Subject: Tomcat running as a service!


Hello all,
I just wanted to know if there is any way i can run the tomcat
as a serivce just like apache on win200.
so that it starts up as soon as i log on just like apache.
Any help will be greately appreciated.
Thanks,
Shailendra

-
Shailendra T. Kontham
Advcancework Inc., 
2-212 Center for Science and Technology
Syracuse NY-13244-4100
Off:(315)-443-4237




RE: [ClassPath] JSP, JDBC, and mm.MySql

2001-06-01 Thread Michael Wentzel

 i'm not too sure about Apache, i don't use that one for JSP. 
 I'm running JRun for my JSP. I do use Apache for PHP though. 
 It took me a long time setting up a mySQL connection using 
 JSP before someone told me that there is no need for any 
 CLASSPATH inclusions in the bat file. CLASSPATH was not 
 required. Only thing needed to be done was placing the 
 mysql.jar file in the /servers/lib folder of my JRun. And 
 voila...it worked. Apache has a /lib folder too, trying 
 placing the jar file thier and see if it works...
 
 SupremeBeing
 
 
 Date: Thu, 17 May 2001 23:49:16 -0500
 Reply-To: [EMAIL PROTECTED]
 From: Jon Shoberg [EMAIL PROTECTED]
 SUBJECTTo: [EMAIL PROTECTED]
 
 Its getting late but I'm not having too much luck at 
 getting a sucessful
 JSP / mysql connection.  Given the error message below can 
 someone explain
 where I should be setting my class path and the actual 
 mm.mysql files or the
 entire jar file? I am using jdk1.3 with the latest apache on 
 win2K pro.

You simply need to put your jar in web-inf/lib/.  This is
all well documented and has been posted several times on
this list already.  If you want to get the answer to your
questions much more quickly and bog down the list much
less at the same time please check archives before posting
a question.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



Internationalization

2001-06-01 Thread Wyn Easton

After a bunch of trial and error and some help from
Jason Hunter's NEW Servlet Programming (2nd Edition)
Book we finally got our JSPs and Servlets to support
foreign languages.

I'm going to put what we did in this note for anybody
else that may need to do this and ask a related
question at the end.

First, we added the following to the JSPs:

%@ page
contentType=text/html;charset=UTF-8
%

We also added the following to the HTML header in each
JSP:

meta http-equiv=Content-Type content=text/html;
charset=UTF-8

It seems that the JSP page directive will get you an
out (a JspWriter) that will ouput UTF-8 encoded
characters.  This is needed for everthing that is
translated on the page like labels and headings.
(Our property files have been translate into the
different languages we need and we get the labels and
headings from these files)

The meta tag controls the way the browser returns the
data for the forms we have in our JSPs.

That is all we had to do for the JSPs.

In the Servlets that process the Form data we did the
little trick from Jason's book:

String input = request.getParameter(firstName);
input=new String(input.getBytes(ISO-8859-1,UTF-8);

Now input is a String encoded in UTF-8.

If we used this String as the VALUE of an INPUT tag
before we converted it to UTF-8, the JspWriter would
convert it to UTF-8 not knowing that it was already
UTF-8 and expand the String.

input type=text name=firstname
value=%=input%

My question is,  is there a Java setting or maybe a
Tomcat setting that will use UTF-8 as the default for
String objects?  I'm not so sure that even if we did
default Java to UTF-8 that we would have a better
soultion because not everything we read is UTF-8
encoded.

Hope this helps and
thanks for any ideas.



















__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/



How to Unsubscribe -Please help

2001-06-01 Thread Venkatesh Sangam


_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.




Tomcat/JSP Question

2001-06-01 Thread Mike Alba



Hi,

 Forgive me for the beginner question but I 
am trying to 
instantiate a class for a JSP.
I am using:

jsp:useBean id = "EX" class = "Example" scope = "session" 
/
Thus I am under the assumption that my "Example" class is being
instantiated and the constructor is called, is this incorrect?Basically 
I am trying to instantiate a class for a session and
was wondering if this is the way to do it. 
And so if it is can I access class objects, I am assuming
I am supposed to use 
 jsp:get_property
 jsp:set_property

rather then EX.counter
where counter is a property of the "Example class"

Once again sorry for the newbie question
and thanks for any help you can give!!

Mike


RE: How to Unsubscribe -Please help

2001-06-01 Thread Loflin, Charles

To remove your address from the list, send a message to:
   [EMAIL PROTECTED]

-Original Message-
From: Venkatesh Sangam [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 01, 2001 3:42 PM
To: [EMAIL PROTECTED]
Subject: How to Unsubscribe -Please help



_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.



relationship between tomcat and servletapi .zips?

2001-06-01 Thread Gilbert, David

What is the difference/relationship between the jakarta-tomcat-3.2.2 and the
jakarta-servletapi-3.2.2 file groups/.zip files?  Looks like tomcat uses the
tomcat files, but does it also use the servletapi files or are they for
another purpose?

___
David Gilbert
Siebel Development
eoTek, LLC
303.679.7028



RE: Tomcat/JSP Question

2001-06-01 Thread Purcell, Scott

I think you may have the syntax for 
  jsp:get_property
  jsp:set_property
wrong.
It is jsp:getProperty()
and jsp:setProperty()
 
Here is a textbook example from Fields and Kolbs book. Hope it helps
#JSP
 
% page import = com.taglib.wdjsp.components.CompoundIntrestBean %
jsp:useBean id=calculator class=CompoundInterestBean /
jsp:setProperty name=calculator property=principal /
/jsp:useBean
jsp:getProperty name=calculator property=principal /
 
Hope that helps,
Scott
 
 
 

-Original Message-
From: Mike Alba [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 01, 2001 2:47 PM
To: [EMAIL PROTECTED]
Subject: Tomcat/JSP Question


Hi,
 
  Forgive me for the beginner question but I am trying to 
instantiate a class for a JSP.
I am using:
jsp:useBean id = EX class = Example scope = session /

Thus I am under the assumption that my Example class is being
instantiated and the constructor is called, is this incorrect?
Basically I am trying to instantiate a class for a session and
was wondering if this is the way to do it. 
And so if it is can I access class objects, I am assuming
I am supposed to use 
  jsp:get_property
  jsp:set_property
 
rather then EX.counter
where counter is a property of the Example class
 
Once again sorry for the newbie question
and thanks for any help you can give!!
 
Mike




Re: How to Unsubscribe -Please help

2001-06-01 Thread Chinni . Venkateswara


Just follow below...

Hi! This is the ezmlm program. I'm managing the
[EMAIL PROTECTED] mailing list.

I'm working for my owner, who can be reached
at [EMAIL PROTECTED]


Welcome to [EMAIL PROTECTED]!

Please save this message so that you know the address you are
subscribed under, in case you later want to unsubscribe or change your
subscription address.


--- Administrative commands for the tomcat-user list ---

I can handle administrative requests automatically. Please
do not send them to the list address! Instead, send
your message to the correct command address:

To subscribe to the list, send a message to:
   [EMAIL PROTECTED]

To remove your address from the list, send a message to:
   [EMAIL PROTECTED]

Send mail to the following for info and FAQ for this list:
   [EMAIL PROTECTED]
   [EMAIL PROTECTED]

Similar addresses exist for the digest list:
   [EMAIL PROTECTED]
   [EMAIL PROTECTED]

To get messages 123 through 145 (a maximum of 100 per request), mail:
   [EMAIL PROTECTED]

To get an index with subject and author for messages 123-456 , mail:
   [EMAIL PROTECTED]

They are always returned as sets of 100, max 2000 per request,
so you'll actually get 100-499.

To receive all messages with the same subject as message 12345,
send an empty message to:
   [EMAIL PROTECTED]

The messages do not really need to be empty, but I will ignore
their content. Only the ADDRESS you send to is important.

You can start a subscription for an alternate address,
for example [EMAIL PROTECTED], just add a hyphen and your
address (with '=' instead of '@') after the command word:
[EMAIL PROTECTED]

To stop subscription for this address, mail:
[EMAIL PROTECTED]

In both cases, I'll send a confirmation message to that address. When
you receive it, simply reply to it to complete your subscription.

If despite following these instructions, you do not get the
desired results, please contact my owner at
[EMAIL PROTECTED] Please be patient, my owner is a
lot slower than I am ;-)

--- Enclosed is a copy of the request I received.

Return-Path: [EMAIL PROTECTED]
Received: (qmail 28341 invoked from network); 1 Jun 2001 15:50:11 -
Received: from myrtle.rtpnc.epa.gov (134.67.208.33)
  by h31.sny.collab.net with SMTP; 1 Jun 2001 15:50:11 -
Received: from epahub11.rtp.epa.gov (epahub11.rtp.epa.gov [134.67.213.52])
 by epamail.epa.gov (PMDF V5.2-32 #42055)
 with ESMTP id [EMAIL PROTECTED] for

[EMAIL PROTECTED];

Fri,
 1 Jun 2001 11:49:14 -0400 (EDT)
Date: Fri, 01 Jun 2001 10:49:11 -0500
From: [EMAIL PROTECTED]
Subject: Re: confirm subscribe to [EMAIL PROTECTED]
To:

[EMAIL PROTECTED]

Message-id: [EMAIL PROTECTED]
MIME-version: 1.0
X-Mailer: Lotus Notes Release 5.0.1a August 17, 1999
X-MIMETrack: Serialize by Router on EPAHUB11/USEPA/US(Release 5.0.6a
|January
 17, 2001) at 06/01/2001 11:49:13 AM
X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N



---

V R Chinni (DPRA).
Contractor for EPA.
214-665-6783
---




   
   
Venkatesh Sangam   
   
venkatesh_sangam@hoTo: [EMAIL PROTECTED] 
   
tmail.com  cc:
   
Subject: How to Unsubscribe 
-Please help  
06/01/01 02:42 PM  
   
Please respond to  
   
tomcat-user
   
   
   
   
   





_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.








IO Exceptions

2001-06-01 Thread thomas . jodway

I am a pretty new user on Tomcat. We are running Tomcat 3.2.1 on Solaris 2.7.  Just 
recently getting CPU utilization for this process consistently over 95%.  Tomcat also 
is producing the following messages everytime our servlet runs (the servlet has not 
changed, and we catch exceptions):
IOException state = 0
IOException state = 0
IOException state = 0
IOException state = 0
IOException state = 0

The Solaris system appears OK.  File descriptors have been increased, no filesystems 
are at their limits.

Is there a way to get better information on the messages above, or has anyone seen 
this message before and resolved it? 

Thanks.


Thomas A. Jodway
SeeBeyond - EDS 
310.594.1759 
   





Tomcat hangs when my ORACLE database instance is running

2001-06-01 Thread Barry Hodges

OS: SunSolaris 2.6
Database: ORACLE 8.1.6 patchset 2
WebServer: Tomcat 3.2.1

I have Tomcat running as a standalone jsp container. If I startup the 
database instance before starting Tomcat, Tomcat hangs before the 
HttpConnectionHandler and Ajp12ConnectionHandler are started. After this I
am 
unable to browse to my jsp applications. Here is the output to the tomcat
console:
Using classpath:
/usr/j2se/src.jar:/usr/j2se/jre/lib/rt.jar:/usr/j2se/tools.jar:/usr/local/ja
karta-tomcat-3.2.1/classes:/usr/local/jakarta-tomcat-3.2.1/lib/ant.jar:/usr/
local/jakarta-tomcat-3.2.1/lib/jasper.jar:/usr/local/jakarta-tomcat-3.2.1/li
b/jaxp.jar:/usr/local/jakarta-tomcat-3.2.1/lib/parser.jar:/usr/local/jakarta
-tomcat-3.2.1/lib/servlet.jar:/usr/local/jakarta-tomcat-3.2.1/lib/test:/usr/
local/jakarta-tomcat-3.2.1/lib/webserver.jar:/usr/j2se/lib/tools.jar
Starting tomcat. Check logs/tomcat.log for error messages
2001-06-01 12:49:37 - ContextManager: Adding context Ctx( /examples )
2001-06-01 12:49:37 - ContextManager: Adding context Ctx( /admin )
2001-06-01 12:49:37 - ContextManager: Adding context Ctx(  )
2001-06-01 12:49:37 - ContextManager: Adding context Ctx( /test )

If I start tomcat before starting my database instance, I can navigate to
all of my pages. However I do get the following error message in my tomcat
console when I navigate to my first jsp page:
2001-06-01 12:46:10 - ContextManager: SocketException reading request,
ignored - java.net.SocketException: Connection reset by peer
at java.net.PlainSocketImpl.socketAvailable(Native Method)
at java.net.PlainSocketImpl.available(PlainSocketImpl.java:462)
at java.net.SocketInputStream.available(SocketInputStream.java:137)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:214)
at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:484)

Has anyone encountered this problem before? What can I do to resolve this
conflict?

Barry Hodges
Sr. Engineer, Software
PRIMUS* 
mailto:[EMAIL PROTECTED]




relationship between tomcat and servletapi .zips?

2001-06-01 Thread Gilbert, David

What is the difference/relationship between the jakarta-tomcat-3.2.2 and the
jakarta-servletapi-3.2.2 file groups/.zip files?  Looks like tomcat uses the
tomcat files, but does it also use the servletapi files or are they for
another purpose?

___
David Gilbert
Siebel Development
eoTek, LLC
303.679.7028



RE: Tomcat hangs when my ORACLE database instance is running

2001-06-01 Thread Craig O'Brien

Oracle 8i includes its own apache server and Jserv.  Jserv has a port
conflict with Tomcat's ajp12 (8007 I believe??).  Stop the
Oracle/Apache/Jserv web server and you will not have the problem. It starts
by default when you start Oracle. You must reassign the port for one or the
other if you want both servers running.

Regards,
Craig

-Original Message-
From: Barry Hodges [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 01, 2001 12:55 PM
To: Tomcat (E-mail)
Subject: Tomcat hangs when my ORACLE database instance is running


OS: SunSolaris 2.6
Database: ORACLE 8.1.6 patchset 2
WebServer: Tomcat 3.2.1

I have Tomcat running as a standalone jsp container. If I startup the
database instance before starting Tomcat, Tomcat hangs before the
HttpConnectionHandler and Ajp12ConnectionHandler are started. After this I
am
unable to browse to my jsp applications. Here is the output to the tomcat
console:
Using classpath:
/usr/j2se/src.jar:/usr/j2se/jre/lib/rt.jar:/usr/j2se/tools.jar:/usr/local/ja
karta-tomcat-3.2.1/classes:/usr/local/jakarta-tomcat-3.2.1/lib/ant.jar:/usr/
local/jakarta-tomcat-3.2.1/lib/jasper.jar:/usr/local/jakarta-tomcat-3.2.1/li
b/jaxp.jar:/usr/local/jakarta-tomcat-3.2.1/lib/parser.jar:/usr/local/jakarta
-tomcat-3.2.1/lib/servlet.jar:/usr/local/jakarta-tomcat-3.2.1/lib/test:/usr/
local/jakarta-tomcat-3.2.1/lib/webserver.jar:/usr/j2se/lib/tools.jar
Starting tomcat. Check logs/tomcat.log for error messages
2001-06-01 12:49:37 - ContextManager: Adding context Ctx( /examples )
2001-06-01 12:49:37 - ContextManager: Adding context Ctx( /admin )
2001-06-01 12:49:37 - ContextManager: Adding context Ctx(  )
2001-06-01 12:49:37 - ContextManager: Adding context Ctx( /test )

If I start tomcat before starting my database instance, I can navigate to
all of my pages. However I do get the following error message in my tomcat
console when I navigate to my first jsp page:
2001-06-01 12:46:10 - ContextManager: SocketException reading request,
ignored - java.net.SocketException: Connection reset by peer
at java.net.PlainSocketImpl.socketAvailable(Native Method)
at java.net.PlainSocketImpl.available(PlainSocketImpl.java:462)
at java.net.SocketInputStream.available(SocketInputStream.java:137)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:214)
at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:484)

Has anyone encountered this problem before? What can I do to resolve this
conflict?

Barry Hodges
Sr. Engineer, Software
PRIMUS*
mailto:[EMAIL PROTECTED]





tomcat run problem: NoClassDefFoundError

2001-06-01 Thread Gilbert, David

When I run tomcat 3.2.2 (using the tomcat run command) I get a
NoClassDefFoundError for the Tomcat class.  I have this class in my
webserver.jar file and this file is in my CLASSPATH.

Any idea what else should be checked/fixed?

___
David Gilbert
Siebel Development
eoTek, LLC
303.679.7028



RE: tomcat run problem: NoClassDefFoundError

2001-06-01 Thread Gilbert, David

PS.  I am running on NT with SP6.  TOMCAT_HOME and JAVA_HOME have both been
set and I am running with VisualCafe using JDK 1.2.2.  I downloaded and
extracted the tomcat and servletapi files from the tomcat site.


-Original Message-
From: Gilbert, David [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 01, 2001 2:09 PM
To: '[EMAIL PROTECTED]'
Subject: tomcat run problem: NoClassDefFoundError


When I run tomcat 3.2.2 (using the tomcat run command) I get a
NoClassDefFoundError for the Tomcat class.  I have this class in my
webserver.jar file and this file is in my CLASSPATH.

Any idea what else should be checked/fixed?

___
David Gilbert
Siebel Development
eoTek, LLC
303.679.7028



RE: Tomcat hangs when my ORACLE database instance is running

2001-06-01 Thread Barry Hodges

I have changed the ajp12 port for my tomcat to 9009, but I get the same
problem.
How can I stop the Oracle/Apache/Jserv web server but keep my database
instance running?

-Original Message-
From: Craig O'Brien [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 01, 2001 4:13 PM
To: [EMAIL PROTECTED]
Subject: RE: Tomcat hangs when my ORACLE database instance is running


Oracle 8i includes its own apache server and Jserv.  Jserv has a port
conflict with Tomcat's ajp12 (8007 I believe??).  Stop the
Oracle/Apache/Jserv web server and you will not have the problem. It starts
by default when you start Oracle. You must reassign the port for one or the
other if you want both servers running.

Regards,
Craig

-Original Message-
From: Barry Hodges [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 01, 2001 12:55 PM
To: Tomcat (E-mail)
Subject: Tomcat hangs when my ORACLE database instance is running


OS: SunSolaris 2.6
Database: ORACLE 8.1.6 patchset 2
WebServer: Tomcat 3.2.1

I have Tomcat running as a standalone jsp container. If I startup the
database instance before starting Tomcat, Tomcat hangs before the
HttpConnectionHandler and Ajp12ConnectionHandler are started. After this I
am
unable to browse to my jsp applications. Here is the output to the tomcat
console:
Using classpath:
/usr/j2se/src.jar:/usr/j2se/jre/lib/rt.jar:/usr/j2se/tools.jar:/usr/local/ja
karta-tomcat-3.2.1/classes:/usr/local/jakarta-tomcat-3.2.1/lib/ant.jar:/usr/
local/jakarta-tomcat-3.2.1/lib/jasper.jar:/usr/local/jakarta-tomcat-3.2.1/li
b/jaxp.jar:/usr/local/jakarta-tomcat-3.2.1/lib/parser.jar:/usr/local/jakarta
-tomcat-3.2.1/lib/servlet.jar:/usr/local/jakarta-tomcat-3.2.1/lib/test:/usr/
local/jakarta-tomcat-3.2.1/lib/webserver.jar:/usr/j2se/lib/tools.jar
Starting tomcat. Check logs/tomcat.log for error messages
2001-06-01 12:49:37 - ContextManager: Adding context Ctx( /examples )
2001-06-01 12:49:37 - ContextManager: Adding context Ctx( /admin )
2001-06-01 12:49:37 - ContextManager: Adding context Ctx(  )
2001-06-01 12:49:37 - ContextManager: Adding context Ctx( /test )

If I start tomcat before starting my database instance, I can navigate to
all of my pages. However I do get the following error message in my tomcat
console when I navigate to my first jsp page:
2001-06-01 12:46:10 - ContextManager: SocketException reading request,
ignored - java.net.SocketException: Connection reset by peer
at java.net.PlainSocketImpl.socketAvailable(Native Method)
at java.net.PlainSocketImpl.available(PlainSocketImpl.java:462)
at java.net.SocketInputStream.available(SocketInputStream.java:137)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:214)
at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:484)

Has anyone encountered this problem before? What can I do to resolve this
conflict?

Barry Hodges
Sr. Engineer, Software
PRIMUS*
mailto:[EMAIL PROTECTED]




Re: ** JVM and Processes

2001-06-01 Thread myatt83

Using the Pool connector and the min_spare_threads,max_spare_threads, and
max_threads, I set max_threads to 30 just to test it. Once I restart the
server.xml file, if I wait a little while (after some people have visited
the site and used some of the servlets) more than 30 threads appear (listed
as previously mentioned: /usr/java/jdk1.3/bin/i386/native_threads/java ).
Sometimes as many as 80 or 90 appear after a while. It appears the
max_threads variable has no affect and is useless. Can you shed light on
the issue?

 - Thanks,
   Adam



At 11:57 AM 6/1/2001 -0700, you wrote:
Hi Adam,

No, the garbage collector runs as a low priority background process and, on
a lightly loaded server, may never get called because the server's not using
enough resources to warrant it. I really wouldn't worry about it too much
and I would definitely avoid killing threads individually, especially since
you're now utilizing a Pool connector. (you don't want to kill threads that
are marked as available in the pool...) The min_spare_threads and
max_spare_threads settings are supposed to take care of cleaning up any
extra unused threads that are laying around.

I think the best benefit you could do yourself would be to upgrade your 3.1
version of Tomcat to the newly released 3.2.2 final to take advantage of
upgrades and bug fixes.

Thanks,
--jeff

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, June 01, 2001 11:03 AM
Subject: Re: ** JVM and Processes


 Jeff,

 Thanks a bunch. Your answer appears to be the best so far. I have
 implemented the PoolTCPConnector in the server xml file and it appears to
 be limiting the number of threads as it should. However, something that
has
 been happening (even before switching to PoolTCPConnector) is that when
 running multiple java servlets the threads stay alive long after they
 should have died or been garbage collected. Even after a long wait, the
 only way (apparently) to get rid of them is to go through and kill them
one
 at a time. Is there a setting somewhere that is telling the java threads
to
 stay alive indefinitely?

 Thanks for your help,
  - Adam


 At 10:34 AM 6/1/2001 -0700, you wrote:
 When Java first came to the Linux platform (via the Blackdown port),
 green-threads were the only option. Native threads took a little longer
to
 implement, but are a much better option for the reasons listed in the
 previous message. So, I would recommend avoiding green-threads unless you
 have a specific reason for using them.
 
 A lot of people freak out when they see the number of processes being
 reported by ps or top, without realizing that these are merely threads
and
 not full-blown processes. If you have a lightly loaded Tomcat, you can
tune
 down the number of threads being spawned by using the max_threads,
 max_spare_threads, and min_spare_threads parameters of the
PoolTCPConnector
 in your server.xml file. For an example of this, take a look at the
tomcat
 user's guide:
 
 http://jakarta.apache.org/tomcat/tomcat-3.2-doc/index.html
 
 Do a find in your web browser for max_threads. I use this to limit
the
 number of ajp12 threads and maximize ajp13 threads -- because I'm using
 ajp13 for my servlets and ajp12 only for startup/shutdown of Tomcat.
 
 Conversely, if you have a heavily loaded Tomcat, you should use these
 parameters to increase performance.
 
 Thanks,
 --jeff
 
 - Original Message -
 From: Michael Jennings [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, June 01, 2001 9:32 AM
 Subject: Re: ** JVM and Processes
 
 
 RE: ** JVM and ProcessesMy understanding of green vs. native threads is
as
 follows:
 With native threads, an actual system thread is created when a Java
thread
 is created.
 On linux a system thread takes the form of another process, but one that
 shares memory
 etc. with another process. This is why if you create a program that
 allocates 100 megs of memory,
 then spins off 10 threads, it looks like 10 processes each taking up 100
 megs of memory, when in
 fact the amount of memory is 100 megs + 10*overhead for each thread (not
 much more than 100 megs).
 
 On WIN32 systems, threads do not show up as separate processes, they are
 separate threads of execution
 inside the same process (essentially the same as the Linux implementation
 with differences too subtle to care about)
 
 Green threads on the other hand use timers, signals, setjmp etc. voodoo
to
 simulate threads within one process.
 Essentially taking over the scheduling from the kernel.
 
 I believe the command-line option for green threads is simply -green as
in
 java -green MyThreaddedApp
 
 If you have a multi-cpu system, green threads will only take advantage of
 one cpu, whereas native threads
 will use all the cpus on your system (that's the theory anyway)
 
 I've heard of problems with blocking I/O with green threads, but have no
 first hand knowledge.
 
 Hope this helps.
 -Mike Jennings
 
   - Original Message -
   From: 

Upgrading tomcat 3.2.1 to 3.2.2

2001-06-01 Thread Brandon Cruz

Has anyone gone though an upgrade of Tomcat 3.2.1 to 3.2.2?  I am using
3.2.1 connected via mod_jk to Apache and using Apj12.  If I want to perform
this upgrade, is it going to take a very long time?  I seem to remember
having quite a bit of difficulty setting everything up in the first place,
compiling mod_jk, etc.  Does anyone have any good or bad news relating to
their experiences upgrading?  Any helpful hints or warnings?

Brandon Cruz




RE: Upgrading tomcat 3.2.1 to 3.2.2

2001-06-01 Thread Skidmore, Walt
Title: RE: Upgrading tomcat 3.2.1 to 3.2.2





I just saved all my necessary conf files and other files (jsps, classes, libs, etc), and put it over the top... Then I put them back in... So, it wasn't very difficult for me. I'm running standalone, though.

-Original Message-
From: Brandon Cruz [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 01, 2001 1:49 PM
To: [EMAIL PROTECTED]
Subject: Upgrading tomcat 3.2.1 to 3.2.2



Has anyone gone though an upgrade of Tomcat 3.2.1 to 3.2.2? I am using
3.2.1 connected via mod_jk to Apache and using Apj12. If I want to perform
this upgrade, is it going to take a very long time? I seem to remember
having quite a bit of difficulty setting everything up in the first place,
compiling mod_jk, etc. Does anyone have any good or bad news relating to
their experiences upgrading? Any helpful hints or warnings?


Brandon Cruz





Re: Upgrading tomcat 3.2.1 to 3.2.2

2001-06-01 Thread David Lennartsson

On Fri, 1 Jun 2001, Brandon Cruz wrote:

 Has anyone gone though an upgrade of Tomcat 3.2.1 to 3.2.2?  I am using
 3.2.1 connected via mod_jk to Apache and using Apj12.  If I want to perform
 this upgrade, is it going to take a very long time?  I seem to remember
 having quite a bit of difficulty setting everything up in the first place,
 compiling mod_jk, etc.  Does anyone have any good or bad news relating to
 their experiences upgrading?  Any helpful hints or warnings?

Did that one today. I used the same mod_jk.so in the same location. No
changes in mod_jk.conf and no changes to the server.xml files. Very
smooth.

/david




WAR file behavior and Tomcat 3.2.x

2001-06-01 Thread Darrell Porter

I've read the documentation.  I've added the unpackWARfiles=FALSE to my
server.xml

Why is Tomcat still unpacking the WAR file into the WEBAPPS directory?
Should it not simply be unpacking files to WORK as it needs them?

I had heard that it was possible to encrypt or password-protect the WAR file
but I can find no instructions on configuring Tomcat to access these
encrypted files.  Any sources?

Thanks

Darrell Porter


Only a man who can not conquer his deficiencies feels the need to convince
the world he has none.





RE: Upgrading tomcat 3.2.1 to 3.2.2

2001-06-01 Thread Roytman, Alex
Title: RE: Upgrading tomcat 3.2.1 to 3.2.2





Did it for RedHat Linux 7.1 and Win2k (Apache server 1.3.19) today took 15 min each. Did stress test for an hour on linux - no problems

-Original Message-
From: Brandon Cruz [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 01, 2001 4:49 PM
To: [EMAIL PROTECTED]
Subject: Upgrading tomcat 3.2.1 to 3.2.2



Has anyone gone though an upgrade of Tomcat 3.2.1 to 3.2.2? I am using
3.2.1 connected via mod_jk to Apache and using Apj12. If I want to perform
this upgrade, is it going to take a very long time? I seem to remember
having quite a bit of difficulty setting everything up in the first place,
compiling mod_jk, etc. Does anyone have any good or bad news relating to
their experiences upgrading? Any helpful hints or warnings?


Brandon Cruz





Info question for 4.0 under apache 1.3.20

2001-06-01 Thread Skyberg, David

Hi all,
I'm new to the list, so can anyone point me to a descent info cache for
working with Tomcat 4.0 under Apache 1.3.20?  I've got everything built and
mod_webapp loads.  But Apache doesn't like the WebAppDeploy directive.  I
could use some examples.

Thanks.



RE: Tomcat hangs when my ORACLE database instance is running

2001-06-01 Thread Craig O'Brien

Do a netstat -a from your shell to see where your conflict is. Do it with
nothing running, do it again with only oracle running, stop oracle and do it
again with tomcat running (confirm it is running) and find the conflict. I
am not familiar with Oracle on Solaris.  The Oracle command console for NT
has an easy stop http server button. Oracle 8i is really meant to be run
on its own machine so it conflicts with other server instillations. (IIS,
Apache, etc port 80 etc.)

Look in the bin directory. Look in your etc/services directory to see what
ports are registered. Do a search for JServ. Search the directory tree. You
could always kill the process if you can identify it. If all else fails,
...read the manual.

Oracle works fine without its http server running in my development
environment.

Good luck,
Craig

-Original Message-
From: Barry Hodges [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 01, 2001 1:27 PM
To: '[EMAIL PROTECTED]'
Subject: RE: Tomcat hangs when my ORACLE database instance is running


I have changed the ajp12 port for my tomcat to 9009, but I get the same
problem.
How can I stop the Oracle/Apache/Jserv web server but keep my database
instance running?

-Original Message-
From: Craig O'Brien [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 01, 2001 4:13 PM
To: [EMAIL PROTECTED]
Subject: RE: Tomcat hangs when my ORACLE database instance is running


Oracle 8i includes its own apache server and Jserv.  Jserv has a port
conflict with Tomcat's ajp12 (8007 I believe??).  Stop the
Oracle/Apache/Jserv web server and you will not have the problem. It starts
by default when you start Oracle. You must reassign the port for one or the
other if you want both servers running.

Regards,
Craig

-Original Message-
From: Barry Hodges [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 01, 2001 12:55 PM
To: Tomcat (E-mail)
Subject: Tomcat hangs when my ORACLE database instance is running


OS: SunSolaris 2.6
Database: ORACLE 8.1.6 patchset 2
WebServer: Tomcat 3.2.1

I have Tomcat running as a standalone jsp container. If I startup the
database instance before starting Tomcat, Tomcat hangs before the
HttpConnectionHandler and Ajp12ConnectionHandler are started. After this I
am
unable to browse to my jsp applications. Here is the output to the tomcat
console:
Using classpath:
/usr/j2se/src.jar:/usr/j2se/jre/lib/rt.jar:/usr/j2se/tools.jar:/usr/local/ja
karta-tomcat-3.2.1/classes:/usr/local/jakarta-tomcat-3.2.1/lib/ant.jar:/usr/
local/jakarta-tomcat-3.2.1/lib/jasper.jar:/usr/local/jakarta-tomcat-3.2.1/li
b/jaxp.jar:/usr/local/jakarta-tomcat-3.2.1/lib/parser.jar:/usr/local/jakarta
-tomcat-3.2.1/lib/servlet.jar:/usr/local/jakarta-tomcat-3.2.1/lib/test:/usr/
local/jakarta-tomcat-3.2.1/lib/webserver.jar:/usr/j2se/lib/tools.jar
Starting tomcat. Check logs/tomcat.log for error messages
2001-06-01 12:49:37 - ContextManager: Adding context Ctx( /examples )
2001-06-01 12:49:37 - ContextManager: Adding context Ctx( /admin )
2001-06-01 12:49:37 - ContextManager: Adding context Ctx(  )
2001-06-01 12:49:37 - ContextManager: Adding context Ctx( /test )

If I start tomcat before starting my database instance, I can navigate to
all of my pages. However I do get the following error message in my tomcat
console when I navigate to my first jsp page:
2001-06-01 12:46:10 - ContextManager: SocketException reading request,
ignored - java.net.SocketException: Connection reset by peer
at java.net.PlainSocketImpl.socketAvailable(Native Method)
at java.net.PlainSocketImpl.available(PlainSocketImpl.java:462)
at java.net.SocketInputStream.available(SocketInputStream.java:137)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:214)
at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:484)

Has anyone encountered this problem before? What can I do to resolve this
conflict?

Barry Hodges
Sr. Engineer, Software
PRIMUS*
mailto:[EMAIL PROTECTED]





Re: AW: servlet error..

2001-06-01 Thread Krishna Kishore Thotakura

Ralf,
 There is X server running on the machine running the WEb Server. I'm running
Red Hat 7.0. The servlet runs fine when i am logged onto the WEb server m/c. 

I think that the Servlet is able to access the X-Server while i am logged in but
it is unable to access it after i log out. 

Please let me know if i need to make any changes in the configuration files
of X11-library in order to allow, tomcat-java process that i started in the
background, to access the X-Server.

thanks.



Tuukk4 |[:)-| p4s4n3n wrote:
 
 hei
 Java AWT really needs X (Stupid) to run but using Pure Java AWT (can be found at 
http://www.eteks.com/pja/en/) you can make it go away:)
 I have used this for pruduct succesfully.. before it i was sooo frustrated
 
 Tuukka
 
 ps. eteks server is slow:P
 
 ---
 --Me olemme keskella jotain. jossa olemme totaalisen ulkopuolisia--
 
 On Wed, 30 May 2001 08:51:45
  Ralph Einfeldt wrote:
 The AWT classes need an x-server to work with images.
 
 Can it be that there isn't one running, when this error happens ?
 
  -Ursprüngliche Nachricht-
  Von: Krishna Kishore Thotakura [mailto:[EMAIL PROTECTED]]
  Gesendet: Mittwoch, 30. Mai 2001 01:05
  An: [EMAIL PROTECTED]
  Betreff: servlet error..
 
 
  Hi,
   i am trying to write an image to the outputstream of a
  servlet. The image is
  actually obtained from an invisible awt Canvas.
  I'm using Jimi package to encode the Image into JPEG format
  and writing this
  out to the ServletOutputStream. Sometimes this works fine and
  i see a nice
  image in the browser but at times, i get the following error:
  in tomcat.log
  Xlib: connection to :0.0 refused by server
  Xlib: Invalid MIT-MAGIC-COOKIE-1 key
 
  in browser ---
  Error: 500
  Location: /wms/servlet/WmsServlet
  Internal Servlet Error:
 
  java.lang.NoClassDefFoundError
   at java.lang.Class.forName0(Native Method)
   at java.lang.Class.forName(Class.java:120)
   at java.awt.Toolkit$2.run(Toolkit.java:498)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:489)
   at java.awt.Component.getToolkitImpl(Component.java:657)
   at java.awt.Component.getToolkit(Component.java:641)
   at java.awt.Component.createImage(Component.java:2265)
   at stt.View.ViewJava3D.initMem(ViewJava3D.java:190)
   at stt.View.ViewJava3D.(ViewJava3D.java:214)
   at stt.Display.DisplayManager.initView(DisplayManager.java:126)
   at stt.Display.DisplayManager.(DisplayManager.java:64)
   at sttx.Display.GeoDisplayManager.(GeoDisplayManager.java:79)
   at WmsServlet.init(WmsServlet.java:49)
 
  Any comments,suggestions,explanations would be greatly appreciated.
 
 
 
 Get 250 color business cards for FREE!
 http://businesscards.lycos.com/vp/fastpath/

-- 
Krishna Kishore Thotakura.
Work 256 961 7818
Home 256 837 9927



Re: Tomcat/JSP Question

2001-06-01 Thread Mike Alba

Actually I was wondering if you can do this

Class Example
{
  
  public Object myObject;

  public Example()
  {
 this.myObject = new myObject();
  } // end constructor

}

then acess it via my JSP

jsp:useBean id = EX class = Example scope = session /
% int my_object = EX.myObject %

It says that this doesnt exist? Is there no way 
to do this?

Thanks so much for your help!

Mike

- Original Message - 
From: Purcell, Scott [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, June 01, 2001 12:47 PM
Subject: RE: Tomcat/JSP Question


 I think you may have the syntax for 
   jsp:get_property
   jsp:set_property
 wrong.
 It is jsp:getProperty()
 and jsp:setProperty()
  
 Here is a textbook example from Fields and Kolbs book. Hope it helps
 #JSP
  
 % page import = com.taglib.wdjsp.components.CompoundIntrestBean %
 jsp:useBean id=calculator class=CompoundInterestBean /
 jsp:setProperty name=calculator property=principal /
 /jsp:useBean
 jsp:getProperty name=calculator property=principal /
  
 Hope that helps,
 Scott
  
  
  
 
 -Original Message-
 From: Mike Alba [mailto:[EMAIL PROTECTED]]
 Sent: Friday, June 01, 2001 2:47 PM
 To: [EMAIL PROTECTED]
 Subject: Tomcat/JSP Question
 
 
 Hi,
  
   Forgive me for the beginner question but I am trying to 
 instantiate a class for a JSP.
 I am using:
 jsp:useBean id = EX class = Example scope = session /
 
 Thus I am under the assumption that my Example class is being
 instantiated and the constructor is called, is this incorrect?
 Basically I am trying to instantiate a class for a session and
 was wondering if this is the way to do it. 
 And so if it is can I access class objects, I am assuming
 I am supposed to use 
   jsp:get_property
   jsp:set_property
  
 rather then EX.counter
 where counter is a property of the Example class
  
 Once again sorry for the newbie question
 and thanks for any help you can give!!
  
 Mike
 




Queue Implementation

2001-06-01 Thread Venkatesh Sangam

Hi,

If the apache-Tomcat Server has more requests that it can service then the 
requests have to wait ..
in this time if some some requests arrive ..will these requests be serviced 
first or the previously waiting requests ..
is the Queue implementation last in first out(LIFO)

please help
thanks
Venkatesh
_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.




Queue Implementation

2001-06-01 Thread Venkatesh Sangam

Hi,

If the apache-Tomcat Server has more requests that it can service then the 
requests have to wait ..
in this time if some some requests arrive ..will these requests be serviced 
first or the previously waiting requests ..
is the Queue implementation last in first out(LIFO)

please help
thanks
Venkatesh
_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.




Re: Tomcat/JSP Question

2001-06-01 Thread Francisco Areas Guimaraes

I could be wrong, but 'int' is a primitive type, I don´t know if it extends
Object, have you tried 'Integer my_object = EX.myObject' ?

Francisco

- Original Message -
From: Mike Alba [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, June 01, 2001 7:17 PM
Subject: Re: Tomcat/JSP Question


 Actually I was wondering if you can do this

 Class Example
 {

   public Object myObject;

   public Example()
   {
  this.myObject = new myObject();
   } // end constructor

 }

 then acess it via my JSP

 jsp:useBean id = EX class = Example scope = session /
 % int my_object = EX.myObject %

 It says that this doesnt exist? Is there no way
 to do this?

 Thanks so much for your help!

 Mike

 - Original Message -
 From: Purcell, Scott [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, June 01, 2001 12:47 PM
 Subject: RE: Tomcat/JSP Question


  I think you may have the syntax for
jsp:get_property
jsp:set_property
  wrong.
  It is jsp:getProperty()
  and jsp:setProperty()
 
  Here is a textbook example from Fields and Kolbs book. Hope it helps
  #JSP
 
  % page import = com.taglib.wdjsp.components.CompoundIntrestBean %
  jsp:useBean id=calculator class=CompoundInterestBean /
  jsp:setProperty name=calculator property=principal /
  /jsp:useBean
  jsp:getProperty name=calculator property=principal /
 
  Hope that helps,
  Scott
 
 
 
 
  -Original Message-
  From: Mike Alba [mailto:[EMAIL PROTECTED]]
  Sent: Friday, June 01, 2001 2:47 PM
  To: [EMAIL PROTECTED]
  Subject: Tomcat/JSP Question
 
 
  Hi,
 
Forgive me for the beginner question but I am trying to
  instantiate a class for a JSP.
  I am using:
  jsp:useBean id = EX class = Example scope = session /
 
  Thus I am under the assumption that my Example class is being
  instantiated and the constructor is called, is this incorrect?
  Basically I am trying to instantiate a class for a session and
  was wondering if this is the way to do it.
  And so if it is can I access class objects, I am assuming
  I am supposed to use
jsp:get_property
jsp:set_property
 
  rather then EX.counter
  where counter is a property of the Example class
 
  Once again sorry for the newbie question
  and thanks for any help you can give!!
 
  Mike
 






Trying to extend JNDIRealm

2001-06-01 Thread Bragg, Casey

Hello : 

   I'm trying to extend JNDIRealm in tomcat4 to implement my own digest
method for SHA1. 

   When I use org.apache.catalina.realm.JNDIRealm, Tomcat starts up fine.
When I use my extension of JNDIRealm, I get the error listed below.  To
test, I made a duplicate of org.apache.catalina.realm.JNDIRealm and called
it org.apache.catalina.realm.JNDIRealm2.  I used the exact same Realm
descriptor listed below except that I referenced
org.apache.catalina.realm.JNDIRealm2.  Even though the code in the two
classes is identical, I still get the error listed below.  What am I doing
wrong?

Thanks!

Here's my realm entry in conf/server.xml : 

  Realm className=org.apache.catalina.realm.JNDIRealm
 connectionName=cn=withheld
 connectionPassword=withheld
  connectionURL=ldap://withheld:392;
userPattern=uid={0},ou=people,o=withheld
   userPassword=userpassword
   roleBase=ou=groups,o=withheld
   roleName=cn
 roleSearch=(|(uniqueMember={0})(member={0}))
roleSubtree=false
  debug=99 /

The error : 

more catalina.out
ERROR reading ../bin/../conf/server.xml
At Line 164 /Server/Service/Engine/Realm/ 

Catalina.start: java.lang.IllegalArgumentException: argument type mismatch
java.lang.IllegalArgumentException: argument type mismatch
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.catalina.util.xml.AddChild.end(XmlMapper.java:806)
at
org.apache.catalina.util.xml.XmlMapper.matchEnd(XmlMapper.java:419)
at
org.apache.catalina.util.xml.XmlMapper.endElement(XmlMapper.java:119)
at
org.xml.sax.helpers.XMLReaderAdapter.endElement(XMLReaderAdapter.java:347)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1497)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1700)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1468)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1700)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1468)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1700)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1468)
at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:499)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:304)
at
org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:433)
at
org.xml.sax.helpers.XMLReaderAdapter.parse(XMLReaderAdapter.java:223)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:317)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:260)
at
org.apache.catalina.util.xml.XmlMapper.readXml(XmlMapper.java:228)
at org.apache.catalina.startup.Catalina.start(Catalina.java:677)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:647)
at org.apache.catalina.startup.Catalina.process(Catalina.java:177)
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:196)


==
Casey Bragg - Software Engineer
Allegiance Telecom, Inc.  Dallas, TX
469-259-2702 - [EMAIL PROTECTED]
==




Re: Tomcat/JSP Question

2001-06-01 Thread Mike Alba

Oops it is supposed to be

% Object myObject = EX.myObject %
- Original Message -
From: Francisco Areas Guimaraes [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, June 01, 2001 3:22 PM
Subject: Re: Tomcat/JSP Question


 I could be wrong, but 'int' is a primitive type, I don´t know if it
extends
 Object, have you tried 'Integer my_object = EX.myObject' ?

 Francisco

 - Original Message -
 From: Mike Alba [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, June 01, 2001 7:17 PM
 Subject: Re: Tomcat/JSP Question


  Actually I was wondering if you can do this
 
  Class Example
  {
 
public Object myObject;
 
public Example()
{
   this.myObject = new myObject();
} // end constructor
 
  }
 
  then acess it via my JSP
 
  jsp:useBean id = EX class = Example scope = session /
  % int my_object = EX.myObject %
 
  It says that this doesnt exist? Is there no way
  to do this?
 
  Thanks so much for your help!
 
  Mike
 
  - Original Message -
  From: Purcell, Scott [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Friday, June 01, 2001 12:47 PM
  Subject: RE: Tomcat/JSP Question
 
 
   I think you may have the syntax for
 jsp:get_property
 jsp:set_property
   wrong.
   It is jsp:getProperty()
   and jsp:setProperty()
  
   Here is a textbook example from Fields and Kolbs book. Hope it helps
   #JSP
  
   % page import = com.taglib.wdjsp.components.CompoundIntrestBean %
   jsp:useBean id=calculator class=CompoundInterestBean /
   jsp:setProperty name=calculator property=principal /
   /jsp:useBean
   jsp:getProperty name=calculator property=principal /
  
   Hope that helps,
   Scott
  
  
  
  
   -Original Message-
   From: Mike Alba [mailto:[EMAIL PROTECTED]]
   Sent: Friday, June 01, 2001 2:47 PM
   To: [EMAIL PROTECTED]
   Subject: Tomcat/JSP Question
  
  
   Hi,
  
 Forgive me for the beginner question but I am trying to
   instantiate a class for a JSP.
   I am using:
   jsp:useBean id = EX class = Example scope = session /
  
   Thus I am under the assumption that my Example class is being
   instantiated and the constructor is called, is this incorrect?
   Basically I am trying to instantiate a class for a session and
   was wondering if this is the way to do it.
   And so if it is can I access class objects, I am assuming
   I am supposed to use
 jsp:get_property
 jsp:set_property
  
   rather then EX.counter
   where counter is a property of the Example class
  
   Once again sorry for the newbie question
   and thanks for any help you can give!!
  
   Mike
  
 
 





Error Handling

2001-06-01 Thread Francisco Areas Guimaraes



Is there anyway to show a cutomized page when an 
internal error occurs, instead of the tomcat´s default?

ps. I´m not talking about exception 
handling...

thanks,

Francisco
[EMAIL PROTECTED]


UNSUSCRIBE

2001-06-01 Thread agent man





  UNSUSCRIBE


_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.




RE: Tomcat/JSP Question

2001-06-01 Thread Skidmore, Walt
Title: RE: Tomcat/JSP Question





Try putting in get/set methods for the object, then getting them that way, e.g.:


--
public Object getMyObject()
{
 return myObject;
}


public void setMyObject(Object _o)
{
 myObject = _o;
}


% Object myObject = EX.getMyObject(); %
--


The get/set methods will allow introspection.


Or, if you want to just get it directly, you need to have a semicolon on the end, like this:


--
% Object myObject = EX.myObject; %
--


For regular code in the jsp, you need to enclose it in % % and follow regular syntax rules. If your bean had a String property, you could get it this way:

--
%=EX.myString%
--


The %= % is shorthand for % out.print( );%.


Kinda confusing at first, but you get used to it. Hope this helps...


-Original Message-
From: Mike Alba [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 01, 2001 3:26 PM
To: [EMAIL PROTECTED]
Subject: Re: Tomcat/JSP Question



Oops it is supposed to be


% Object myObject = EX.myObject %
- Original Message -
From: Francisco Areas Guimaraes [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, June 01, 2001 3:22 PM
Subject: Re: Tomcat/JSP Question



 I could be wrong, but 'int' is a primitive type, I don´t know if it
extends
 Object, have you tried 'Integer my_object = EX.myObject' ?

 Francisco

 - Original Message -
 From: Mike Alba [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, June 01, 2001 7:17 PM
 Subject: Re: Tomcat/JSP Question


  Actually I was wondering if you can do this
 
  Class Example
  {
 
  public Object myObject;
 
  public Example()
  {
  this.myObject = new myObject();
  } // end constructor
 
  }
 
  then acess it via my JSP
 
  jsp:useBean id = EX class = Example scope = session /
  % int my_object = EX.myObject %
 
  It says that this doesnt exist? Is there no way
  to do this?
 
  Thanks so much for your help!
 
  Mike
 
  - Original Message -
  From: Purcell, Scott [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Friday, June 01, 2001 12:47 PM
  Subject: RE: Tomcat/JSP Question
 
 
   I think you may have the syntax for
   jsp:get_property
   jsp:set_property
   wrong.
   It is jsp:getProperty()
   and jsp:setProperty()
  
   Here is a textbook example from Fields and Kolbs book. Hope it helps
   #JSP
  
   % page import = com.taglib.wdjsp.components.CompoundIntrestBean %
   jsp:useBean id=calculator class=CompoundInterestBean /
   jsp:setProperty name=calculator property=principal /
   /jsp:useBean
   jsp:getProperty name=calculator property=principal /
  
   Hope that helps,
   Scott
  
  
  
  
   -Original Message-
   From: Mike Alba [mailto:[EMAIL PROTECTED]]
   Sent: Friday, June 01, 2001 2:47 PM
   To: [EMAIL PROTECTED]
   Subject: Tomcat/JSP Question
  
  
   Hi,
  
   Forgive me for the beginner question but I am trying to
   instantiate a class for a JSP.
   I am using:
   jsp:useBean id = EX class = Example scope = session /
  
   Thus I am under the assumption that my Example class is being
   instantiated and the constructor is called, is this incorrect?
   Basically I am trying to instantiate a class for a session and
   was wondering if this is the way to do it.
   And so if it is can I access class objects, I am assuming
   I am supposed to use
   jsp:get_property
   jsp:set_property
  
   rather then EX.counter
   where counter is a property of the Example class
  
   Once again sorry for the newbie question
   and thanks for any help you can give!!
  
   Mike
  
 
 






¡¯¯Â°Ó·~¿ì¤½«Ç¥X¯²¡¯

2001-06-01 Thread v2m_2gkgfvlycqk



  **
  ¯Â°Ó·~¿ì¤½«Ç¥X¯²  
  **
   
   ±MªùªA°È°Ó¥Î¿ì¤½«Ç¤§©Ó¯²¤H¡C

   ¥x¥_¦Uµ¥¯Å°Ó¥Î¿ì¤½«Ç®×¥ó¡A¾A¦X¦UºØ°Ó·~»Ý¨D¡I¡I

   §Ú­Ì¾Ö¦³ºZ³qªº¸ê°T¡B¦³«Ü¦h¥ß§Y­n¥X¯²ªº¿ì¤½«Ç¡A¥¿µ¥«ÝµÛ±zªº¬D¿ï¡A
   
   ¤@©w­n¬°±z§ä¨ì¤@³B³Ì¾A¦X±z¹ê²{±z¶¯¹Ï§§§Óªº³õ©Ò¡I¡I¡I¡I

  °Ï°ì¡G
  ¤j¦w°Ï   ¦p ¡G´°¤Æ«n¡B¥_¸ô¯Â¿ì¡A80¢w700©W¡I¡I   
  ªQ¤s°Ï   ¦p ¡G«n¨ÊªF¸ô ¤T¡B¥|¬q¯Â¿ì  50¢w250©W ¡I¡I
  «H¸q°Ï   ¦p ¡G°ò¶©¸ô¤G¬q¡A«H¸q¸ô¤T¬q¯Â¿ì¡A¬Á¼þ±c¹õ¤j¼Ó¡C 30-280©W¡I¡I
  ¤¤¤s°Ï   ¦p ¡Gªø¦wªF¸ô¡A¤¤¤s¥_¸ô¯Â¿ì  70¢w200©W  ¡I¡I
  
  

  ªA°È²Ä¤@¡A«~½è«OÃÒ¡CÅwªï¬¢¸ß.
 

  ·ç°T¤£°Ê²£ °Ó¥ò³¡
  Ápµ¸¤H¡G³³¤p©j 
  TeL¡]¥Nªí¸¹¡^¡G 02-27548587
  ¦æ°Ê¹q¸Ü¡G0937063831
  
  ±zªºº¡·N¡A¬O§Ú­Ìªº¦¨´N¡C





RE: Classloader, JNI and already loaded in another classloader

2001-06-01 Thread Mark Benzel

I'll give it try.  Thanks.

-Original Message-
From: Bo Xu [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 01, 2001 10:56 AM
To: [EMAIL PROTECTED]
Subject: Re: Classloader, JNI and already loaded in another
classloader


 [...]
 I have a webapp running under Tomcat 3.2.1 that needs to make JNI calls
in
 order to access data and methods in legacy C++ code.  A servlet is loaded
 on startup of the webapp that, as part if its init method, causes a data
set
 specific to that webapp instance to be loaded into the C++ data
structures.
 This Java code for this servlet contains the following:
 
 static
 {
 try {
 System.loadLibrary(JCoreImpl);
 System.out.println(JCoreImpl loaded);
 m_bLibraryLoaded = true;
 } catch (UnsatisfiedLinkError e) {
 m_bLibraryLoaded = false;
 System.out.println(JCoreImpl NOT loaded  + e);
 }
 }
 
 Things work fine if there is only one webapp (let's call it
webapps/aaa).
 If I have a second webapp (webapps/bbb) that is identical to
webapps/aaa
 except for the data set used in the C++ data structures, then webapps/aaa
 starts up just fine, but when webapps/bbb is started I get an error
stating
 that:
 
 JCoreImpl NOT loaded java.lang.UnsatisfiedLinkError: Native Library
 E:\WebStation\binDebug\JCoreImpl.dll already loaded in another
classloader
 
 I need to have a separate instance of the native library for each of my
 webapps as each instance needs to contain data that is unique to that
 particular webapp.  I have searched through the mail archives and read
 emails by Craig McLanahan explaining the classloader hierarchy.  But I
have
 not been able to find anything specific to loading a unique instance of a
 native library for each webapp.
 
 Any ideas?  Thanks,
 
 Mark

Hi :-) is the following possible?

- don't put System.loadLibrary(JCoreImpl) in Servlet class,
   but put it in a utility class which is loaded by a classloader who is
   upper than the classloader of aaa or bbb.  for example, put this
utility class and the native code Both in TOMCAT_HOME/lib

- then in the init method of those Servlet classes in webapp aaa
   or bbb, first load that utility class, then/so load the native code.


Bo
June.01, 2001






Re: Error Handling

2001-06-01 Thread Simon Chatfield



The errorPage jsp directive?
%@ page errorPage="customError.jsp"%>

--
Simon Chatfield
VP, Software Development
Inteflux Inc.




startup problem under win32

2001-06-01 Thread Jeff Gu

Hi guys,

I am a newbie in this area, so please forgive my ignorance.  I have a question 
concerning the startup of Tomcat.  I use windows 2000 server version and wish to 
integrate Tomcat with Apache, which is already configured.  I have JDK 1.3 SE 
installed at c:\jdk1.3.  I have downloaded the zip file of tomcat 3.2.2.  After I 
unzipped the package to D:\jakarta-tomcat-3.2.2, I tried to launch Tomcat in command 
window with either tomcat start or tomcat run.  The problem is the new window 
disappears immediately if I use tomcat start.  The information I got when I use 
tomcat run is like this:
---
D:\jakarta-tomcat-3.2.2\bintomcat run
Including all jars in D:\jakarta-tomcat-3.2.2\\lib in your CLASSPATH.

Using CLASSPATH: D:\jakarta-tomcat-3.2.2\\classes;D:\jakarta-tomcat-3.2.2\\lib\s
ervlet.jar;D:\jakarta-tomcat-3.2.2\\lib\parser.jar;D:\jakarta-tomcat-3.2.2\\lib\
jaxp.jar;D:\jakarta-tomcat-3.2.2\\lib\ant.jar;D:\jakarta-tomcat-3.2.2\\lib\webse
rver.jar;D:\jakarta-tomcat-3.2.2\\lib\jasper.jar;.;;c:\jdk1.3\\lib\tools.jar

Usage: java [-options] class [args...]
   (to execute a class)
   or  java -jar [-options] jarfile [args...]
   (to execute a jar file)

where options include:
-cp -classpath directories and zip/jar files separated by ;
  set search path for application classes and resources
-Dname=value
  set a system property
-verbose[:class|gc|jni]
  enable verbose output
-version  print product version and exit
-showversion  print product version and continue
-? -help  print this help message
-Xprint help on non-standard options
---
It seems that the command to use java is not appropriate.  However, this is the exact 
batch file I use from the package.  I then tried to use java 
org.apache.tomcat.startup.Tomcat to launch it manually, but my doubt is that all the 
java files have not been compiled.  Anyway, I just cannot launch it and the message I 
get is like this:
---
D:\jakarta-tomcat-3.2.2java org.apache.tomcat.startup.Tomcat
Exception in thread main java.lang.NoClassDefFoundError: org/apache/tomcat/sta
rtup/Tomcat
---
I don't think this is a problem with xml engine, because the jasper.jar and parser.jar 
have already been incluced in the CLASSPATH.  I looked in all the archive, mailing 
list, and faq, but these is no address to this sympton.  I hope someone can help me 
out.  Also, do I need to upgrade J2SE to J2EE?  Thank you.

Best,
Jeff





How do you unsubscribe if you email address has changed?

2001-06-01 Thread Neil Edney

I know this has been posted before, but I can't remember how... please can
you let me know.

Thanks.




  1   2   >