RE: Another Try at MySQL Connection Pooling

2004-02-11 Thread Merrill Cornish
Jay,

  >>> once in my .WAR, and once as a result of my Ant deploy task

  I have yet to move to that plane of confusion.  I'm not using a META-INF directory 
or a .WAR file since I'm still trying to figure out WHAT to deploy.  I am manually 
editing

  * the conf/server.xml file (to change the default ports, but nothing else), 

  * the webapps/timesheet/* directory (to hold the application), 

  * the webapps/WEB-INF/web.xml file (to name and map the various servlets, etc.), and

  * conf/Cataline/localhost/timesheet.xml (to define the context).

I think it's time I reverted to DriverManager and got on with other things.  While 
Tomcat DataSources are proved to be a learning experience with a vengance, it hasn't 
been a very positive one.  :-(

Nevertheless, thanks for your help and support.

Merrill


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



Re: Another Try at MySQL Connection Pooling

2004-02-11 Thread Merrill Cornish
Doug,

The application directory under webapps is named "timesheet", therefore, the context 
fragment in conf/Catalina/localhost is "timesheet.xml" to match the context name.  The 
beginning of the  element in timesheet.xml is

   

to match the directory name under webapps.  So, I think  as far as Tomcat  goes, I've 
got it consistently as "timesheet".

The class name under webapps/timesheet/WEB_INF/classes is "Timesheet" to follow the 
Java capitalization conventions of class names.  Therefore, "Timesheet" appears in my 
web.xml as the prefix to the various  names, but nowhere else.

Now, as for the MySQL database, I named it "Timesheets" (note the capital and the 
plural).  My logic being that  the application was for doing a single timesheet at a 
time while the database was for recording all the timesheets at once. (Yes, I'm anal.  
I know.  :-) ).

The database name shows up in the url parameter: jdbc:mysql://localhost/Timesheets?... 
  In that case the plural is critical, but the capitalization isn't (in my case) since 
a MySQL database name is merely a file name and file names in Windows are case 
insensitive.  Nevertheless, I've got it matching.  As far as I can tell, this URL is 
the only place in the Tomcat configuration files that the name of the MySQL database 
appears.  Unless...

Now we come to 

   
... 

I was just reading up on the JNI naming conventions from a link someone gave me when I 
stopped to check my mail again.  As nearly as I can tell, the "jdbc" part of the 
"jdbc/TimesheetsDB" is magic, and it must be that to work.  However, the 
"TimesheetsDB" part can be anything you want as long as the name attributes in 
 and  matches.  Therefore, I used "Timesheets" to reflect 
the MySQL database name and "DB" just because the first example I saw used that suffix.

I think I've got all that consistent, but if DataSource is supposed to be the way to 
go in the future for JDBC, it shouldn't be this hard.

By the way, I do appreciate the time you're spending thinking about my problem.

Merrill

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



Re: Another Try at MySQL Connection Pooling

2004-02-11 Thread Merrill Cornish
Adam,

The following line occurs in stdout.log:

INFO: Processing Context configuration file URL file:C:\Program Files\Apache 
Group\Tomcat 5.0.18\conf\Catalina\localhost\timesheet.xml

so it appears to be getting the correct context fragment.


Merrill

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



Re: Another Try at MySQL Connection Pooling

2004-02-11 Thread Merrill Cornish
Doug,

  >>> "Timesheet" vs. "timesheet"

   Good catch, but it didn't make any difference.

   I originally had three  entries for names "Timesheet", (the way I thought 
of it), "timesheet" (for those who don't want to use the shift key), and "ts" (for 
those diehard Unix freaks who believe anything worth doing should be done in three 
characters or less).  The actual directory  under webapps is "timesheets".  I've 
edited timesheet.xml (note the lower case) to match the directory, but the result was 
unchanged.

Thanks for the thoughts, though.

Merrill

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



RE: Another Try at MySQL Connection Pooling

2004-02-11 Thread Merrill Cornish
Ken,

I didn't intend to include the password in ANY of my posts, but I guess some slipped 
though.  In the version that running, the password is there.  And, even if I had 
fumble fingered the password, THAT would have simply gotten a convention MySQL error 
rather than a NameNotFoundException for "jdbc".

Merrill

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



Re: Another Try at MySQL Connection Pooling

2004-02-11 Thread Merrill Cornish
Doug,

I noticed the class name discrepancy myself between the name I had used for 
DriverManager and the one the DataSource example had.  However, when I peeked inside 
the Connector/J jar file, I found both .class files, altough they are of different 
sizes.

I tried it with your alternative, but the error is the same either way:

  "At org.apache.naming.NamingContext.lookup(NamingContext.java:814) there occurred a
   javax.naming.NameNotFoundException: Name TimesheetsDB is not bound in this Context"

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



RE: Another Try at MySQL Connection Pooling

2004-02-11 Thread Merrill Cornish
Jay,

  Context initialContext = new InitialContext();
  Context envContext = (Context) initialContext.lookup("java:comp/env");
  this.dataSource = (DataSource) envContext.lookup("jdbc/TimesheetsDB ");

Ah ha!  I was missing the second step.  When I added the second step, it still fails, 
but the complaint has changed.  Slightly.

   "At org.apache.naming.NamingContext.lookup(NamingContext.java:814) there occurred a
javax.naming.NameNotFoundException: Name TimesheetsDB is not bound in this Context"

So now it can find "jdbc", but not "TimesheetsDB".

By the way, what does the "java:comp/env" argument mean?


Merrill



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



Re: Another Try at MySQL Connection Pooling

2004-02-11 Thread Merrill Cornish
David,

I THINK I've figure out that MySQL's Connector/J jar worked in jre/lib/ex when I was 
using DriverManager because only MySQL needed to see it, and it knew to look in 
jre/lib/ex.  However, with DataSource, I'm assuming it's Tomcat who needs to see it, 
so it needs to be in Tomcat's common/lib. 

So I put Connect/J's jar in common/lib--and it still failed in the same manner.

I'm wondering if the actual error message MIGHT be giving a clue.  It says "Name jdbc 
is not bound in this Context" when the only thing that EVER appears in any of the XML 
is "jdbc/TimesheetsDB". 

  * Does this imply that "jdbc/TimesheetsDB" is wrong and the entries should be 
something like simply "TimesheetsDB"?

   * Does this imply that "jdbc" has to be declared in some manner before 
"jdbc/TimesheetsDB" can be declared?


Merrill

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



RE: Another Try at MySQL Connection Pooling

2004-02-11 Thread Merrill Cornish
I think I read the using named pipes is faster, but that's not going to be a problem 
here.  If I can't get named pipes to work, then I'll try using TCP/IP restricted to 
localhost.

Actually, this whole DataSource experiment has a questionable return on investment.  I 
already have it working just fine with DriverManager using nothing more than the 
little README file what comes with MySQL's Connector/J download.  However, I'd read 
that DataSource was "the way to go" for the future, so I thought that switching from 
DriverManger to DataSource would be a good exercise.  So far, all this exercise has 
given me is sore muscles.


Merrill

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



RE: Another Try at MySQL Connection Pooling

2004-02-11 Thread Merrill Cornish
Jay,

Thanks for your comments.

I think the problem may be that I don't have the MySQL Connector/J jar in the 
common/lib.  When using DriverManager, it worked fine in jre/lib/ext, which is one of 
the places the MySQL documentation recommended.  I need to try again with it in the 
new location.

Also under DriverManager, the named pipe access worked as advertised. The MySQL 
instance will be dedicated to my timesheet application and running on the same machine 
as Tomcat.  For security reasons, I don't want MySQL accepting commands over TCP/IP.  
There is a my.cnf initialization parameter which tells MySQL to not even start up its 
TCP/IP listener and used named pipes instead.  This obviously only works when MySQL is 
on the same machine as the application, but that's my situation.

The named resource factory stuff was carried over from what worked under 
DriverManager.  However, if may have been redundant, but harmless, under DriverManger 
too, and I just didn't notice.

One general problem I'm having with the document I can find is that it tends to simply 
say, "do THIS..." without explaining how "THIS" is doing what it's supposed to be 
doing.  As a result, I'm having trouble reasoning as to what should and should not 
work. Instead, I'm reduced to plugging in the examples and hoping they work.

Merrill

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



Another Try at MySQL Connection Pooling

2004-02-10 Thread Merrill Cornish
I'm running 
  * Tomcat 5.0.18 running as a Wndows service, 
  * MySQL 4.0.16 running as a Windows service, and 
  * MySQL Connector/J 3.0.10 stable 
all on Windows 2000 Server, which is where I'm also doing the testing (i.e., on 
localhost).

A number of tomcat-user mailing list denizens have given me snippets of XML to put in 
various places. Nothing worked.  So I tried following the "MySQL Configuration" 
example from 
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html. 
After all changes were made to server.xml, web.xml and timesheet.xml (the  
fragment under conf/Catalina/localhost), I restarted Tomcat and tried to login (the 
first action that would have had to touch the MySQL database).

I got the following errorPage:

> At Timesheet.Util.errorPage(Util.java:550) there occurred a
> java.lang.Exception: A fatal exception occurred while retrieving login name and pass 
> phrase because...
>
> At Timesheet.Util.getSqlConnection(Util.java:492) there occurred a
> java.lang.Exception: Unable to establish a MysqlDataSource connection for 
> ResourceLine name "jdbc/TimesheetsDB" >because...
>
> At org.apache.naming.NamingContext.lookup(NamingContext.java:814) there occurred a
> javax.naming.NameNotFoundException: Name jdbc is not bound in this Context

OK, that seems to say it doesn't know what the name "jdbc/TimesheetsDB" is.  Tomcat 
has written nothing to stderr.log and stdout.log shows a clean startup, so Tomcat 
itself isn't too perturbed.  stdout.log includes the following line:

> INFO: Processing Context configuration file URL file:C:\Program Files\Apache 
> Group\Tomcat 5.0.18\conf\Catalina\localhost\timesheet.xml

implying that my timesheet.xml context fragment file was found and processed.  The 
Timesheet application log file contains the following:

> 2004-02-10 16:20:05 NamingContextListener[/Catalina/localhost/timesheet]:   Resource 
> parameters for jdbc/TimesheetsDB = ResourceParams[name=jdbc/TimesheetsDB, 
> parameters={factory=org.apache.commons.dbcp.BasicDataSourceFactory, 
> url=jdbc:mysql://localhost/Timesheets?autoReconnect=true&socketFactory=com.mysql.jdbc.NamedPipeSocketFactory,
>  password=All41a14all, maxWait=1, maxActive=100, 
> driverClassName=org.gjt.mm.mysql.Driver, username=timesheet_app, maxIdle=30}]

> 2004-02-10 16:20:05 NamingContextListener[/Catalina/localhost/timesheet]:   Adding 
> resource ref jdbc/TimesheetsDB

> 2004-02-10 16:20:05 NamingContextListener[/Catalina/localhost/timesheet]:   
> ResourceRef[className=javax.sql.DataSource,factoryClassLocation=null,factoryClassName=org.apache.naming.factory.ResourceFactory,{type=scope,content=Shareable},{type=auth,content=Container},{type=factory,content=org.apache.commons.dbcp.BasicDataSourceFactory},{type=url,content=jdbc:mysql://localhost/Timesheets?autoReconnect=true&socketFactory=com.mysql.jdbc.NamedPipeSocketFactory},{type=password,content=All41a14all},{type=maxWait,content=1},{type=maxActive,content=100},{type=driverClassName,content=org.gjt.mm.mysql.Driver},{type=username,content=timesheet_app},{type=maxIdle,content=30}]

> 2004-02-10 16:20:05 NamingContextListener[/Catalina/localhost/timesheet]:   Resource 
> parameters for UserTransaction = null

[Blank lines added for clarity.]  As per the instructions in the 
jndi-datasource-examples-howto.html page, my web.xml file has the following addition

>  
> MySql Connection Pool
> jdbc/TimesheetsDB
> javax.sql.DataSource
> Container
>  

immediately after the  element and immediately before the 
 element.

Now that I am using the timesheet.xml  fragment file, server.xml is unchanged 
except that I have modified it to use port 80 in place of 8080 and port 443 in place 
of 8443.

The timesheet.xml  fragment file looks like this:


  
  
  

  factory
  org.apache.commons.dbcp.BasicDataSourceFactory



  maxActive 
  100 



  maxIdle 
  30  



  maxWait   
  1   



 username
 timesheet_app



 password
 xxx



  url
 
jdbc:mysql://localhost/Timesheets?autoReconnect=true&socketFactory=com.mysql.jdbc.NamedPipeSocketFactory
  


   driverClassName 
   org.gjt.mm.mysql.Driver

  


I apologize for being so verbose, but I'm trying to provide all of the relevant 
information in the initial message.  Does anyone see what I've missed?  The example in 
jndi-datasource-examples-howto.html does NOT look like the other things I was told to 
do.  (?)


Merrill





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



RE: preloading JSPs

2004-02-08 Thread Merrill Cornish
I'm running Tomcat 5.0.18 under Windows and I don't see a jspc script in the Tomcat 
bin directory.


Merrill

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



Re: for

2004-01-28 Thread Merrill Cornish
Ankur

Replace the "exception-code" with the "error-code" tag and you'll be in
business.
 

Agh!  (But thanks.)

Merrill

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


Filter to detect a user not logged in

2004-01-26 Thread Merrill Cornish
I'm trying to learn filters by writing one to detect when someone who 
has not logged in tries to access a JSP page that requires login.  From 
what I've read, this seems to be one common use of filters.

I think I understand how to write the filter, but to determine whether 
the session had been logged in, I need to HttpSession object.

The doFilter() method receives ServletRequest rather than 
HttpServletRequest, so there is no getSession() method.  At the same 
time, since the filter is tied to ServletRequest and ServletResponse, it 
appears that the filter runs at a level "above" individual sessions, 
implying that a filter could never check whether a specific session was 
logged in.

Can filters be used to check whether a user is logged in?

Merrill

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


Re: Being Ignored?

2004-01-25 Thread Merrill Cornish
Jake,

Well, I've managed to show that the  element itself isn't being 
ignored.  I modified it so that typing "ts" on the URL would execute the 
"timesheet" app in webapps.  However, the  sub-element that 
defines a custom log file name for the application still doesn't seem to 
be active.  I wonder if that was another change between 4.1 and 5.0?

Merrill

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


[OT] "Prohibited Content"

2004-01-24 Thread Merrill Cornish
In the last day or two, each message I send to this mailing list gets a 
response with the subject line "Symantec Mail Security detected that you 
sent a message containing prohibited content"  I initially assumed it 
thought the XML fragments I was including in my posts were some attempt 
to insert Trojan code.  However, I've also received the same response to 
a message without any XML.

Anyone know what it's objecting to?

Merrill

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


for

2004-01-24 Thread Merrill Cornish
I originally had errorPage declarations at the top of all my JSP pages, 
which worked.  Then I heard about the  element in web.xml.  
So I replaced all of the individual errorPage declarations with:

 
   java.lang.Exception
   /errorPage.jsp
 
in my application's web.xml, and it worked fine.  Next I tried

 
   404
   /login.jsp
 
to intercept bad URLs and redirect them to the login page.  However, 
THIS does not work.  Bad URLs just get the standard Tomcat 404 error 
page as always.  I've Googled the problem and found "it doesn't work for 
me," "but it DOES work for me," "but it does NOT work for me," and so 
on.  Is there some secret here? (I'm running 5.0.18.)

Merrill

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


Being Ignored?

2004-01-24 Thread Merrill Cornish
Below is the Context element I'm using for my application.  It was 
originally created for Tomcat 4.1.  With this Context element in 
server.xml in Tomcat 4.1, a log file of "localhost_timesheet_log.txt" 
appeared in the %CATALINA%\log directory.

   
reloadable="true" crossContext="true">
 
   prefix="localhost_timesheet_log." suffix=".txt" 
timestamp="true"/>
   

However, under 5.0.18 (and maybe under 5.0.16--I didn't notice), the 
only log I get is the (apparently) generic 
"localhost_log.2004-01-24.txt".  Does this mean that my Context element 
is being ignored, or does 5.0 not observe the Logger sub-element of the 
Context element?

Merrill

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


Re: 5.0.18: Windows XP Pro vs Windows 2000

2004-01-24 Thread Merrill Cornish
Remy,

No, it does not. .xml files in the Host appBase will be ignored.
[Sigh...]  I thought I had it.  Checking back, I see that only the  
balancer sample app has it context description file there.

You need to put your Context elements in XML files next to the ones 
for the manager and admin, and it will work ok.
OK, I tried doing searches of the various *.xml files.  Here's what I found:

balancer.xml is in:
  %CATALINA_HOME%\webapps\balancer
  %CATALINA_HOME\conf\Catalina\localhost
jsp-examples.xml is in:
  can't find it, but it got installed according to stdout.log
servlets-examples.xml is in:
  can't find it, but it got installed according to stdout.log
admin.xml is in:
  %CATALINA_HOME%\server\webapps\admin
  %CATALINA_HOME\conf\Catalina\localhost
manager.xml is in:
  %CATALINA_HOME%\server\webapps\manager
  %CATALINA_HOME\conf\Catalina\localhost
 
The %CATALINA_HOME\conf\Catalina\localhost location is mentioned in the 
Tomcat docs, but I thought the server.xml location was mentioned also.  
To top it all off,  the book TOMCAT, THE DEFINITIVE  GUIDE (the only 
O'Reilly book I've ever been disappointed in) says the *.xml context 
descriptions (or "fragments", is it calls them) are placed in 
%CATALINA_HOME%\webapps directory.

[signed]
Confused in Austin


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


5.0.18: Windows XP Pro vs Windows 2000

2004-01-23 Thread Merrill Cornish
I have Windows XP Pro at home and Windows 2000 at work.  I run Tomcat on 
both of them, and I try to keep identical environments on both.  
However,  it's not easy.

Under 5.0.16, I would run it as a server on XP, but not 2000.  Under 
5.0.18, I got it running as a server on 2000 immediately while XP took 
many installs, uninstalls, reboots and what not.  (I still don't know 
what I finally did to get it to work.)

After getting 5.0.18 to run under XP, I tried launching my application.  
Entering "http://localhost/timesheet"; into the browser got a Page Not 
Found and did not resolve to "https://localhost/timesheet/login.jsp"; as 
it should.  Examining the log showed that the 
"localhost-timesheet_log.txt" log file defined in the  element 
for the timesheet application in server.xml didn't exist either.  Tomcat 
seemed to be ignoring my application and its context even when I tried 
using the same conf\server.xml and conf\web.xml files that had worked on 
Windows 2000.

The stdout.logdid exist and showed that the various example contexts 
(servlet-examples, jsp-examples, balancer, etc.) had been initialized 
even though mine application hadn't.  There were no error messages.  
Then I noticed that the samples didn't have a  element in the 
server.xml file.  Instead, they had a *.xml file in their application 
directory with ONLY the  element in it (i.e., not a well-formed 
XML file).

When I made a copy of  my application's  element shown below 
and put it in "...\webapps\timesheet\timesheet.xml" it worked.

I've read the 5.0.18 release notes, the FAQ on the Jakarta website, and 
the tomcat-docs distributed with 5.0.18.  I can't find a reference to 
these fragment files except for the mention of "Context Descriptions" 
under Deployer.  However, those files are nested under the conf 
directory rather than under the application context.

Why does 5.0.18 recognize my application's  element in the 
server.xml file on Windows 2000 but will only recognize it in a 
timesheet.xml file in my application directory on Windows XP?  What is 
the value of having three possible locations for the same information? 
Where can I find it documented?

Merrill

=

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


SOLVED: 5.0.18 Ignoring ?

2004-01-23 Thread Merrill Cornish
I (accidently) figured out the problem with the .  The problem 
was in the Connector definition for port 80 in server.xml.  The excerpt from 
server.xml that I posted was correct because it was inadvertently from the 5.0.16 
installation. (The editor helpfully "remembered" it for me.)

In the 5.0.18 installation that I was actually using, the redirectPort attribute for 
the Connect on port 80 was still port 8443 rather than port 443, which I had set up 
the SSL Connector for.

Not that I'm trying salve my ego or anything :-), but I still think there may be a 
Tomcat installation problem/oddity/gotcha.  

During the installation of the *.exe version, it asks what port you want Tomcat to 
listen on with the default (reasonably enough) as 8080.  I set that input field to 80. 
 In server.xml, the port attribute of the Connector element was properly changed from 
8080 to 80, but the redirectPort of that connector was left unchanged as 8443.

This may be a mis-feature, depending upon on your view point.  One way of looking at 
it is that ports 80 and 443 go together while ports 8080 and 8433 go together.  If the 
installation dialog allows the default listen port to be changed from 8080 to 80, then 
shouldn't it also change the default SSL port from 8433 to 433 along with enabling the 
Connector for port 443?  

Perhaps the installation needs an additional option of the "what port do you want" 
dialog that lets you pick an SSL port if you want one where the default is no SSL.  At 
least that dialog choice would make it clear that the choice of HTTP port is 
independent of the choice of HTTPS port.

Anyway, it works for now.

Merrill


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



5.0.18 Ignoring ?

2004-01-23 Thread Merrill Cornish
I had been running Tomcat 5.0.16 standalone (it wouldn't start as a service) on 
Windows 2000 and j2sdk1.4.2 successfully.  Yesterday, I installed 5.0.18 and was 
finally able to get it to run as a service.  However, when I launch my timesheet 
application in the usual way,  "http://localhost/timesheet";, I get "Page Cannot Be 
Displayed."

My timesheet context has the index.html welcome page shown below in the docbase 
directory of that context so the user will automatically be redirected to the login 
page.  (I also have a copy of index.html is all other directories in the application 
so attempts to "drill down" into the application aways result in the login page.)

I want the login to be done over SSL, so I have specified connectors for port 80 and 
443 as shown below in the server.xml excerpt.

In my original implementation, I had the index.html welcome page redirect to 
"https://localhost/timesheet/login.jsp";.  Also, I had a check at the top fo the 
login.jsp page to redirect via HTTPS if the connection wasn't secure.  Then I found 
out about the  element in my application's web.xml.  Under 
5.0.16, I added the  element to my web.xml, and it all worked, so 
I could simplify my JSP pages.

Under 5.0.18, entering "http://localhost/timesheet"; in the browser results in Page Not 
Found. However, if I enter "https://localhost/timesheet"; (note the explicit HTTPS), 
the application launches correctly.  So, it appears (to my understanding) that 5.0.18 
is ignoring the  element in the application's web.xml.  

I know that Tomcat is sensitive to the ordering of elements in web.xml.  In my case, 
the  element is the last element in , which according to 
the DTD:

   

is acceptable, since I don't have any of the other elements that follows 
.

Is the problem with 5.0.18, or am I missing something?

Merrill

--- index.html 
http://www.w3.org/TR/html4/strict.dtd";>


  
  




--- server.xml 
. . .


. . .


--- context web.xml --
http://java.sun.com/dtd/web-app_2_3.dtd";>

  . . .
  
ConnectTel Timesheet Application Security Constraint

  Protected Area
  *.jsp
  GET
  POST



  CONFIDENTIAL 

  


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



for both JSP and Servlets

2004-01-20 Thread Merrill Cornish
As I understand it, instead of putting a 

  <%@ page errorPage="/errorPage.jsp" %> 

in each JSP page, you can put

  
java.lang.Throwable
/errorPage.jsp
  

in the web.xml file.  I've tried this and it appears to work as advertised.  

However, I read in www.onJava.com that as of JSP 2.0, you can combine the error 
handling of both JSP pages and servlets because servlets now pass the exception by the 
same attribute name as JSP pages do: javax.servlet.error.exception.  OK, but how?

All of my servlets implement doPost() which is documented to throw ServletException 
and IOException.  Most of the errors I am throwing (and that I want my errorPage.jsp 
page to handle) are SQLException errors.  

* If I put a catch for SQLException errors in my servlets, then nothing "escapes" the 
servlet to be handled by the errorPage.jsp page declared in the web.xml file.  

* If I do NOT catch the SQLExceptions, then the javac compiler complains (apparently 
quite rightly) that an undocumented exception was thrown in reference to the 
ServletException and IOException exceptions doPost() is documented to throw.

* If I try to add SQLException to the doPost() throws list, the compiler complains 
that the overloaded method didn't originally throw SQLException.


So, what is the problem way to get exceptions thrown in a servlet conveyed to the 
error page recorded in the  element of the web.xml file?


Merrill Cornish

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



setContentType() vs.

2004-01-16 Thread Merrill Cornish
Does Tomcat see any difference in a servlet that calls setContentType() before 
generating a page for output versus not calling setContentType() but including an HTML 
 tag in the generated page?

Merrill

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



Re: restricting access to jsp pages

2004-01-15 Thread Merrill Cornish
>>> I don't want to check for whether user is logged in or not in every page


Is there any particular reason why?  The extra time is in the noise.  The code is 
boilerplate, and you can hige that behind a function call if you want.


Merrill

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



Re: restricting access to jsp pages

2004-01-15 Thread Merrill Cornish
I'm confused.

>>> I don't want the user to have to log in, ...  
>>> I can't find in the docs how Tomcat knows whether the user has logged in yet,

Question:  Do you want your users to log in or not--nevermind who does it?

>>> I want to have my "guard" servlet authenticate the user 

How is that different from log in?  Regardless of what you call it or whether it's 
done by a JSP page or a servlet, the user is going to have to identify himself to the 
guard servlet--and that's logbin, even if the phrase "log in" is never shown to the 
user.

In my own application, each of the JSP pages that needs the user to be logged in 
before coming to the page start with this:

<%
  if (Util.verifyLogin(session, response)) {
 // then we are logged in
 
 ... // other Java code needed for the page initialization
%>

... 

<% }//then logged in %>


If Util.verifyLogin() determine--in whatever manner--that the user is not yet logged 
in, it redirected to the login page (or whatever you are using to determine who the 
user is) and returns false.  It it returns false, the rest of the JSP page is skipped, 
since the loggin page is being displayed.

In my case, Util.verifyLogin() determines that the user is logged in by checking that 
session is not null and that a certain session attribute set by the login servlet is 
not null.  

In servlets, the test is

  if (Util.verifyLogin(session, response)) { return; }

Merrill





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



Sharing among session of ONE application

2004-01-13 Thread Merrill Cornish
I think I know the answer to this, but I would like reassurance.

I'm building a timesheet application using JSP, servlets, and Tomcat.  So far, I been 
very careful to keep all non-contant data out of servlet class instance variables so 
everything should be thread safe and there should be no interference between 
simultaneous users of the application.  

Now, I've got some information I WOULD like to share across all sessions of the 
application (but not across other Tomcat applications).  So, that should mean that all 
I really have to do is defined the information in instance variables (and remember 
when using it that it can change unexpectedly).  Right?

Merrill

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



RE: communication issue between .jsp and servlet

2004-01-12 Thread Merrill Cornish
session is an implicit object in a JSP page.  Therefore, you should just reference 
session rather than "getting" it.  Perhaps the get is creating a new session.

Merrill

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



Tomcat 5 Service Fails on Windows 2000

2004-01-05 Thread Merrill Cornish
I downloaded the Tomcat 5.0.16.exe binary (with installer) and installed it on my 
Window XP Pro workstation at home.  It installed, started, and runs just fine.

I then tried to do the same thing on my Windows 2000 workstation at work.  The install 
completed without an error.  However, attempting to start it from the Windows Service 
applet produces a message from Windows that "Could not start the service ... The 
service did not return an error...".  The Stderr.log and Stdout.log logs created at 
installation time are still empty.  There is nothing in the Event Viewer with than a 
warning that W32Time couldn't find a Domain Controller.

Tomcat 5.0.16 is installed and runs standalone on this machine just fine, however that 
standalone version was not running when the service installation took place.

Any ideas?

Merrill Cornish

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



Tomcat 5.0.16 Server Can't Find Keystore

2004-01-03 Thread Merrill Cornish
Yesterday, in response to a post asking how to run Tomcat as a server, 
someone pointed out that the *.exe binary, which includes the installer, 
is now available.  (Hooray!)  So, I downloaded it, and it installed 
flawlessly.  I had renamed my previous Tomcat 5.0.16 installation so the 
server version could be installed in parallel.

I am using HTTPS, and I have enabled the proper connectors in server.xml 
as I had done before. However, with the Tomcat service started, when I 
start the application, it fails with the following entry in the 
stdout.log file:

java.io.FileNotFoundException: 
C:\WINDOWS\system32\config\systemprofile\.keystore (The system cannot 
find the file specified)

The error message is valid in that my .keystore is under C:\Document 
Settings.  That keystore had been generated by the Java keytool utility 
using the instructions in Tomcat for establishing an SSL connector..  I 
tried generating another key, thinking maybe this version looked in a 
different place.  However, the keytool failed claiming that the alias 
"Tomcat" already existed, implying it was looking C:\Document Settings.

I have check server.xml and web.xml, but I can't find anything to 
specify where Tomcat is to look for the .keystore file.

Anyone have any suggestions as to how to make Tomcat look in C:\Document 
Settings or how to make keytool generate a .keystore file in 
C:\WINDOWS\System32\config\systemprofile where it's looking?

Merrill Cornish



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


Re: Really dumb question -- how do I set up Tomcat 5 to run as a service on NT?

2004-01-02 Thread Merrill Cornish
Betty,

As nearly as I can tell, Tomcat 4 was distributed for Windows as a .exe 
file which included an installer.  That installer which could do the 
service install.  However, Tomcat 5 is distributed (so far, at least) as 
a .zip file, which has no installer.  I can run  Tomcat 5 standalone, as 
I did Tomcat 4, but I haven't yet been able to run as a service yet. 
When I try to command line approach, it doesn't work--I think it's 
because the command line is too long.

Merrill

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


[Off Topic] Java printing to network printer

2004-01-02 Thread Merrill Cornish
I apologize for the off-topic question, but can someone point me to 
where I can find out how to print to a remote printer on the LAN from 
Java. 

While Java seems to have many "printing" classes, none of them appear to 
actually reference a physical printer.  While that's obviously in 
keeping with the hardware-independent nature of Java, sometimes an 
application needs to route output to a specific location on the net.  
But how?

Merrill

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


Re: How is catch{} code handled

2004-01-02 Thread Merrill Cornish
George,

Unfortunately, your logic is flawed.
 

Yes, that's very clear at this point.  :-)

I understand that the sendRedirect() does NOT terminate the execution 
flow that it is in.  That's why I follow each one with a return. 
However, I think I now recognize my problem.

In my mind, I've always associated a catch{} with an exception and 
nothing "escapes" from the exception.  And that's true, assuming you did 
NOT do what I did and disolve the exception into a simple message that 
displayed as text on a JSP page.  As I now see, in THAT case, the 
catch{} DOES return, thereby allowing multiple sendRedirect()s to occurs.

Thank you for setting my thinking straight.

Merrill

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


How is catch{} code handled

2004-01-02 Thread Merrill Cornish
My sudden IllegalStateException problem turned out to be caused by my 
error handling technique, but I'm not sure why.

When I started this project (as a way or learning JSP), I have 
EVERYTHING in JSP pages, meaning that there was a lot of Java code in <% 
... %> sections of the JSP page.  I added an errorPage declaration to 
each of my JSP pages to divert all errors to my standard error handling 
page--and all was well.

Later, I decided to limit the JSP pages to HTML as much as possible and 
move all of the Java program logic into servlets.  I left the errorPage 
declarations in the JSP pages, although there wasn't much left there to 
throw an exception.

In the servlets, I used the standard try/catch constructs to intercept 
exceptions.  However, I decided I wanted the exceptions caught in 
servlets to be handled by the same error page as the JSP pages used. 
Rather than have EVERY catch{} clause do the redirect, I defined a 
utility subroutine named errorPage() that collected various information 
in the catch{} clause, then called sendRedirect() to the error page.

Separate from these catch{} clauses, whenever the processing in a 
servlet was complete, it ended with a sendRedirect() to the next JSP 
page followed immediately by a return. I had assumed that the 
sendRedirect()s in the main servlet code were "safe" from the 
sendRedirect() in the catch{} cause since--as I understood it--once the 
exception was thrown and the catch{} entered, nothing else in the 
servlet was processed.

However, my "IllegalStateException" experience suggests there is 
something going on with catch{} that I don't understand.  Or, as a 
friend of mine used to say, "I don't understand all I know about that." :-)

To recap, I got an IllegalStateExceptioni pointing to a sendRedirect() 
in a servlet until I effectively removed the sendRedirect() by returning 
before the sendRedirect() could be reached.  Only then did I see an 
SQLException  intercepted by a catch{} and redirected with 
sendRedirect() to the error page.

Why did main servlet processing appear to continue (allowing the second 
sendRedirect() to cause a problem) after the exception was triggered?

Merrill Cornish

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


SuddenIllegalStateException: Solved(?)

2004-01-02 Thread Merrill Cornish
Well--I think I've found the cause for my sudden IllegalStateException, 
although I'm still not sure why.

Because it was claiming an IllegalStateException, and it was pointing to 
the sendRedirect() statement, I assumed the sendRedirect() was the 
CAUSE. So--

I started probing the code by inserting

  response.sendRedirect();
  return;
By putting this pair of statements in various places, I was able to 
deduce that the problem was occurring in a subroutine that accessed the 
MySQL database.  Furthermore, if only the first part of the subroutine 
was executed (as it would be with an invalid login name), it worked, but 
if the full subroutine was executed (valid login name), it failed.

At that point, I noticed that if I clicked on the brower's Back Button, 
the sendRedirect() that I had suspected of being the culprit had 
actually worked.  H.  So, I tried simply inserting extra return 
statements in the code rather than the sendRedirect()/return shown 
above.  Lo and behold, I got a SQLException from the suspect subroutine 
I had been probing.

Shortly before the problem started occurring (remember the "suddenly" 
part of my message subject?), I had removed a certain field from the 
database table, but I was still asking JDBC to get() that field value.  
That, of course, was an error (MY error) and fully worthy of an 
exception, but the question was why did it cause the error it did.

I apears my error handling  needs some work.  I'm going to post a 
separate question about catch{} to try to find out what I'm doing wrong.

In the meantime, thanks to Howard and Ben for their offers of help.

Merrill

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


Re: Sudden IllegalStateException

2004-01-02 Thread Merrill Cornish
Ben,

Yes, I can post the code, but now I'm not sure that will help.

Yesterday I tried my old standby debugging technique of commenting out 
virtually all of the code in the servlet.  It worked.  I then started 
uncommenting portions until it stopped working.  For a while, I thought 
I was winning.  I got it down to where if a call to one subroutine was 
commented out, it worked; but if the subroutine was called, the return 
would fail when it reached the sendRedirect() back in the servlet.  Then 
I noticed that SOMETIMES a call to the subroutine would not fail. [sigh...]

The subroutine in question does database access with no sendRedirect() 
or any other "funny business."  Right now, I'm trying to further 
characterize the problem. 

I may still take you up on your offer of help (and thank you, by the 
way), but I need to do some work first.

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


Re: Sudden IllegalStateException

2003-12-31 Thread Merrill Cornish
Ben,

I don't know if it's a good idea or not, but I separate the HTML stuff 
into the JSP pages and use the servlets solely for program logic.  
Therefore, my servlets never output content..  Instead they merely 
redirect to a JSP page which then contains only enough Java logic to 
collect the data it needs from session attributes.

Merrill

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


Re: Sudden IllegalStateException

2003-12-31 Thread Merrill Cornish
Howard,

There are three sendRedirect() calls in the servlet.  The first two 
redirect back to the login page if with the login user id is not found 
or  the login password doesn't match.  In both cases, the sendRedirect() 
is immediately followed by a return.  (I learned to use explicit returns 
after sendRedirect() some time ago.)

The sendRedirect() that is throwing the error is the last statement in 
the overall try{} block.  There is a catch for SQLException which calls 
a function that would call sendRedirect() to get to the error page, but 
if we've gotten to the last statement in the try{} block, there was no 
SQLException. The only thing after the try{}/catch{} is again a return.

Merrill

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


Re: Sudden IllegalStateException

2003-12-31 Thread Merrill Cornish
Howard,

I had already read the misc.html#illegalstate.  In my case, I KNOW the 
illegal state was triggered by sendRedirect() since that's what's in the 
trace back.  Also, I've already verified that immediately before the 
call to sendRedirect(), both session and response are OK.

I forgot to mention in the first post that I've already tried stopping 
and starting Tomcat, stopping and relaunching the browser, and 
recompiling all servlets.  My question is WHY is sendRedirect() causing 
the problem.

Merrill

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


Sudden IllegalStateException

2003-12-31 Thread Merrill Cornish
I have been developing a JSP/servlet application using Tomcat 5.0.16.  
Over the past months, I felt that I had learned enough (partially with 
the help of this mailing list) about JSP, servlets, and Tomcat that I 
could debug most of the obsticales that popped up.  Until this morning. 

I  started addnig a new servlet several "levels" down. Suddenly, I 
started getting the following error:

java.lang.IllegalStateException

org.apache.coyote.tomcat5.CoyoteResponseFacade.sendRedirect(CoyoteResponseFacade.java:379)
Timesheet.LoginServlet.doPost(LoginServlet.java:67)
javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
When I launch the application, the Tomcat HTML welcome page redirects 
via a refresh to my login.jsp page via https.  That login page displays 
properly.  When I fill in the login name and password and click on 
submit, I immediately get the above exception.  The line number it 
references is the following:

 response.sendRedirect(Util.MAIN_MENU_PAGE_URL);

where Util.MAIN_MENU_PAGE_URL is "/timesheet/mainMenu.jsp", a valid page 
URL.

This sendRedirect() is the last thing the login servlet does after 
validating the login and collecting information about the logged in user 
from the database.  This has all been working for months.

The one time I got an illegal state exception before was when I 
accidently did something like session.getAttribute() when the session 
was invalid.  However,  the login servlet starts with

   HttpSession session = request.getSession(true);

which is the ONLY time it's called with a true argument.  I have also 
verified that immediately before the call to sendRedirect(), both the 
session and response variables have reasonable values.

Can any one suggest what I may have changed to suddenly get an illegal 
state exception?

Merrill Cornish

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


Re: [Q] Tomcat & ZoneAlarm?

2003-12-29 Thread Merrill Cornish
Riaan,

   I run Tomcat with ZoneAlarm Pro at home and it works.  Not only does Tomcat need to 
be able to access the Internet (even though it's not actually accessing anything 
outside the localhost) as Phil said, but the browser you are using also needs to be 
able to access the Internet.

   The two times I get "Page cannot be displayed" is 1) I've forgotten to start my 
standalone version of Tomcat (I still haven't succeeded in getting it to run as a 
service), or 2) I've forgotten and left ZoneAlarm's manual Internet lock on (the [Z|A] 
tray icon is a padlock).

Merrill

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



RE: Thread Safe JSP/Servlets

2003-12-29 Thread Merrill Cornish
>>> you have to go out of your way to declare instance variables in a JSP (by putting 
>>> them in a <%! //declaration block %>


John,

   After I posted the question, I started browsing the generated _jsp file in earnest. 
 I had decided that <% ... %> stuff was safe since it gets up in its own method rather 
than instance fields.

   Thanks for the reassurance.

Merrill

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



Thread Safe JSP/Servlets

2003-12-29 Thread Merrill Cornish
I understand how to write thread-safe software in general, but I suddenly realized 
that I don't understand what, if anything, Tomcat "shares" among different sessions 
(i.e., different users accessing the same JSP application) and would therefore be 
thread sensitive.

For example, in my servlets, I have only constant class fields--no instance fields.  
All user-specific information is stored in session attributes that exist only between 
user login and logout.  However, it finally dawned on me that my JSP pages are quietly 
being turned into servlets behind my back (this is despite my occassionally 
referencing the generated *_jsp files while debugging), and those servlets DO have 
instance fields.

My specific question is whether Tomcat keeps the instance fields for JSP servlets 
separate by session.  My more general request is for a pointer to "best practices" 
documentation on how to keep JSPs and servlets thread safe.

Merrill Cornish

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



Re: How to: Tomcat 5.0.16 as Windows Service

2003-12-26 Thread Merrill Cornish
Bill,

   Thanks for the information.  I was worried about the command line length.  Where 
can I find documentation for the various //?// commands?

Thanks again,
Merrill

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



Re: How to: Tomcat 5.0.16 as Windows Service

2003-12-24 Thread Merrill Cornish
Bill,

Here's the Dr. Watson log for the failure of the install of Tomcat as a 
service.

Application exception occurred:
   App: E:\Program Files\Apache Group\Tomcat 5.0.16\bin\tomcat.exe 
(pid=2032)
   When: 12/24/2003 @ 10:01:13.045
   Exception number: c005 (access violation)

*> System Information <*
   Computer Name: MERRILL
   User Name: Merrill Cornish
   Terminal Session Id: 0
   Number of Processors: 1
   Processor Type: x86 Family 6 Model 8 Stepping 1
   Windows Version: 5.1
   Current Build: 2600
   Service Pack: 1
   Current Type: Uniprocessor Free
   Registered Organization:
   Registered Owner: Merrill Cornish
*> Task List <*
  0 System Process
  4 System
372 smss.exe
588 csrss.exe
612 winlogon.exe
656 services.exe
668 lsass.exe
872 svchost.exe
964 svchost.exe
1124 svchost.exe
1184 ccEvtMgr.exe
1328 spoolsv.exe
1424 mysqld-max-nt.exe
1496 navapsvc.exe
1596 Error 0xD022
1864 Explorer.EXE
1960 ccApp.exe
180 jusched.exe
184 Error 0xD022
220 Remind32.exe
1800 cmd.exe
508 HTMLKit.exe
3264 iexplore.exe
3724 cmd.exe
3568 drwtsn32.exe
3556 thunderbird.exe
2032 tomcat.exe
2336 drwtsn32.exe
*> Module List <*
(0040 - 0040d000: E:\Program Files\Apache 
Group\Tomcat 5.0.16\bin\tomcat.exe
(70a7 - 70ad5000: C:\WINDOWS\system32\SHLWAPI.dll
(77c0 - 77c07000: C:\WINDOWS\system32\VERSION.dll
(77c1 - 77c63000: C:\WINDOWS\system32\msvcrt.dll
(77c7 - 77cb: C:\WINDOWS\system32\GDI32.dll
(77d4 - 77dcc000: C:\WINDOWS\system32\USER32.dll
(77dd - 77e5d000: C:\WINDOWS\system32\ADVAPI32.dll
(77e6 - 77f46000: C:\WINDOWS\system32\kernel32.dll
(77f5 - 77ff7000: C:\WINDOWS\System32\ntdll.dll
(7800 - 78086000: C:\WINDOWS\system32\RPCRT4.dll

*> State Dump for Thread Id 0xc4c <*

eax= ebx=00832430 ecx= edx=00832024 esi=0007 
edi=
eip=00405971 esp=0012fce4 ebp=00833d74 iopl=0 nv up ei pl nz na 
pe nc
cs=001b  ss=0023  ds=0023  es=0023  fs=0038  gs= 
efl=0202

*** WARNING: Unable to verify checksum for E:\Program Files\Apache 
Group\Tomcat 5.0.16\bin\tomcat.exe
*** ERROR: Module load completed but symbols could not be loaded for 
E:\Program Files\Apache Group\Tomcat 5.0.16\bin\tomcat.exe
function: tomcat
   00405953 40   inc eax
   00405954 0057ff   add [edi-0x1],dl
   00405957 152c714000   adc eax,0x40712c
   0040595c 83c40c   add esp,0xc
   0040595f 85c0 testeax,eax
   00405961 0f858900 jne tomcat+0x59f0 (004059f0)
   00405967 8b7d04   mov edi,[ebp+0x4]
   0040596a 83c504   add ebp,0x4
   0040596d 83c9ff   or  ecx,0x
   00405970 46   inc esi
FAULT ->00405971 f2ae repne   scasb
es:=??
   00405973 8b54242c mov edx,[esp+0x2c]
   00405977 8974241c mov [esp+0x1c],esi
   0040597b f7d1 not ecx
   0040597d 2bf9 sub edi,ecx
   0040597f 8bc1 mov eax,ecx
   00405981 8bf7 mov esi,edi
   00405983 8bfa mov edi,edx
   00405985 c1e902   shr ecx,0x2
   00405988 f3a5 rep movsd
   0040598a 8bc8 mov ecx,eax

*> Stack Back Trace <*
WARNING: Stack unwind information not available. Following frames may be 
wrong.
ChildEBP RetAddr  Args to Child 
00833d74 505c3a45 72676f72 46206d61 73656c69 tomcat+0x5971
     0x505c3a45

*> Raw Stack Dump <*
0012fce4  30 24 83 00 29 fe 12 00 - e5 4d e7 77 00 00 00 00  
0$..)M.w
0012fcf4  00 00 00 00 10 00 00 00 - 83 54 40 00 06 00 00 00  
[EMAIL PROTECTED]
0012fd04  07 00 00 00 58 3d 83 00 - 20 fd 12 00 24 fd 12 00  
X=.. ...$...
0012fd14  92 c8 c3 77 38 3e 83 00 - e9 68 e7 77 00 00 00 00  
...w8>...h.w
0012fd24  45 3a 5c 50 72 6f 67 72 - 61 6d 20 46 69 6c 65 73  
E:\Program Files
0012fd34  5c 41 70 61 63 68 65 20 - 47 72 6f 75 70 5c 54 6f  
\Apache Group\To
0012fd44  6d 63 61 74 20 35 2e 30 - 2e 31 36 5c 62 69 6e 5c  
mcat 5.0.16\bin\
0012fd54  74 6f 6d 63 61 74 2e 65 - 78 65 20 2f 2f 52 53 2f  
tomcat.exe //RS/
0012fd64  2f 54 6f 6d 63 61 74 35 - 00 00 00 00 00 00 00 00  
/Tomcat5
0012fd74  00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00  

0012fd84  00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00  

0012fd94  00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00  

0012fd

Re: How to: Tomcat 5.0.16 as Windows Service

2003-12-23 Thread Merrill Cornish
Jacob,

I tried your batch file for installing Tomcat 5 as a Windows service.  I had to edit 
it to put double quotes around %EXECUTABLE% since my Tomcat is located under the 
\Program Files\ directory and the space in the pathname was messing up the command 
line parsing.

With my standalone Tomcat stopped, the batch file runs fine (i.e., no output to 
STDERR, no error messages to STDOUT, ends by saying Tomcat is installed), but the 
following error dialog pops up:

Apache Process Runner
Apache Process Runner has encountered a problem and needs to close.  We are sorry for 
the inconvenience. ... Please tell Microsoft about this problem. ... [Send Error 
Report]/[Don't Send]

There is no Apache Tomcat5 service in the services list.

I tried rebooting and running the batch file from a clean system, but the same thing 
happened.  Any ideas?

Merrill Cornish

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



Re: 404: File Not Found = Stupidity?

2003-12-23 Thread Merrill Cornish
[Sound of head pounding on keyboard...]

Yes. I did forget to add the mapping for the new servlet. Mea culpa. I 
had even briefly thought about the server.xml and web.xml files--but 
then dismissed them as "they are already set up." If I had just taken a 
look. . .

Thanks for the kick in the memory.

Merrill

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


404: File Not Found = Stupidity?

2003-12-23 Thread Merrill Cornish
I'm running Tomcat 5.0.16 standalone on Windows XP Pro.  My JSP/servlet 
application has been coming along nicely, but perhaps I've become 
complacent.

The structure of the application is simple enough: The user starts with 
a JSP page and fills in a form.  The form calls a companion servlet to 
process it.  That servlet then launches the next JSP page which has its 
own servlet to process it, and so on.

Today, I added a new JSP page and processing servlet pair.  The page 
works, but clicking on the submit button brings up the 404-Page Not 
Found error message. The displayed name of the page not found is the 
correct one.  Furthermore:

* The servlet that can't be found is in the same package directory with 
all of the other servlets that do work. (Two other servlets in this 
directory have already been called before reaching the new JSP/servlet.)

* The page request names are spelled correctly with the same 
capitalization.  There are no inadvertent blanks in the names.

* The servlet compiles cleanly.

* The name of the servlet file matches the name of the class it holds.

* Both Internet Explorer and Firebird display the 404 error.

* I've stopped and restarted Tomcat.  I've rebooted Windows.  I've 
stopped and restarted the browsers.

* The failing servlet is addressed with exactly the same URL as all of 
the servlets that are found except for the actual servlet name at the end.

In everyway I can see, this new, failing servlet is exactly like all of 
its brothers, except the browser can't find it.  Any suggestions?

Merrill Cornish



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


Re: How to: Tomcat 5.0.16 as Windows Service

2003-12-22 Thread Merrill Cornish
Bill,

   Yes, I should have thought of the --StdOutFile and --StdErrorFile arguments.  
However, specifying them does no good.  The files are created, but they are empty.

Merrill

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



Re: How to: Tomcat 5.0.16 as Windows Service

2003-12-21 Thread Merrill Cornish
OK, I'm answering myself.

The first time I saw that page of jakarta.apache.org and tried it, it didn't work.  I 
tried again just now, and the command line command did seem to work (although it looks 
like it's over the 256 byte limit).  The result is a Tomcat entry in the services 
list, set for automatic, but not started.  When I use the services display to start 
it, Windows claims that Tomcat starts and then immediately stops.

There are no entries in the logs and on entries in the OS events viewer, so I have no 
idea of what it didn't like.  I can still start and stop Tomcat in standalone mode.  
(I attempted the service install without any other form of Tomcat running.)

With the service apparently installed, entering

   tomcat //TS//Tomcat5

doesn't appear to fail, but it doesn't appear to do anything either.  Entering

   tomcat //DS//Tomcat5

does  uninstall the service (as verified in the services display) as advertised.


Is there any way of determining what is preventing the Tomcat service from running. 
(BTW, I did enter fully qualified pathnames in the //IS//Tomcat5 command line).

Merrill

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



Re: How to: Tomcat 5.0.16 as Windows Service

2003-12-21 Thread Merrill Cornish
Bill,

  I had seen that page before, but I'll have to admit I didn't understand it fully.  
It says, in part:

" To install the service, you need to use the //IS// parameter. ... 

"   tomcat //IS//Tomcat5 ...

I know this sounds dumb, but is "//IS//" what you actually enter on the command line, 
or is it a place holder for a path?


Merrill



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



How to: Tomcat 5.0.16 as Windows Service

2003-12-20 Thread Merrill Cornish
I am current running Tomcat 5.0.16 standalone on Windows XP Pro.  I 
would like to install it as a Windows service.  All the documentation I 
can find dismisses it by saying that you are asked if you want it to run 
it as a service by the installer.

The Tomcat 4.1 binary came as an .exe and had an installer; but the 
5.0.16 binaries are offered as a ZIP file without installer.  Any 
suggestions for how to install 5.0.16 as a Windows service?

Merrill Cornish

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


Re: Problems with HTTPS in Tomcat 5

2003-12-16 Thread Merrill Cornish
If you really want a trusted certificate, shop around.  There are companies other than 
VeriSign.  I found one for $50/year.


Merrill Cornish

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



Placement of JSP/HTML Files

2003-12-09 Thread Merrill Cornish
Asad,

You need to define a "context" in the conf/server.xml  file:


 

The path attribute represents the path that appears in the URL following 
"http://localhost"; while the docbase attribute represents the directory 
under webapps where the the JSP/HTML files will be found.

Merrill

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


Re: Session "Goes Away" (?)

2003-11-30 Thread Merrill Cornish
>>> my firewall (Zone Alarm Pro) was blocking session cookies.

Interesting.  I'm also using Zone Alert Pro.  I'll try turning it off and see what 
happens.

Thanks,
Merrill

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



Session "Goes Away" (?)

2003-11-29 Thread Merrill Cornish
I'm running Tomcat 4.1.27 standalone on Windows XP Pro using IE.

I've been developing my first web application in JSP with some success--then I decided 
to converted it into servlets. [sigh...]

I tried following the examples in Dustin Callaway's INSIDE SERVLETS, Second Edition.  
The structure he proposes for the servlet is simple enough (detail omitted):

1. session = request.getSession(true);

2. if (session.isNew()), then output an HTML page.  In this case, the page contains a 
form with my servlet as the ACTION destination.

3. Else (i.e., if not isNew()), process whatever the form returned.

My problem is that if I print session, then I find that everytime I enter the servlet, 
I have a different session.  If I print the result of getRequestedSessionId(), it's 
differnt too. Also, I've tried doing a session.setAttribute(), but it's always null on 
the return to the servlet. This all implies that I'm constantly getting a different 
session object.

getMaxInactiveInterval() = 1800, so the session isn't being artificially invalidated 
by a ultra-short timeout.

Any suggestions?

Merrill Cornish

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