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 def

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

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

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 anythi

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

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

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 c

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/l

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

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.

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 give

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 l

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 wond

[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 inser

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

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="tru

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, an

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

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.1

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/times

for both JSP and Servlets

2004-01-20 Thread Merrill Cornish
ost() 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

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:

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

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

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 inte

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

Tomcat 5 Service Fails on Windows 2000

2004-01-05 Thread Merrill Cornish
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?

Tomcat 5.0.16 Server Can't Find Keystore

2004-01-03 Thread Merrill Cornish
ind 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 looki

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

[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 wi

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

How is catch{} code handled

2004-01-02 Thread Merrill Cornish
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 inserti

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

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 dat

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 a

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 men

Sudden IllegalStateException

2003-12-31 Thread Merrill Cornish
d 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

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 m

Thread Safe JSP/Servlets

2003-12-29 Thread Merrill Cornish
ot; 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

Re: How to: Tomcat 5.0.16 as Windows Service

2003-12-24 Thread Merrill Cornish
ation) *> 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 Serv

Re: How to: Tomcat 5.0.16 as Windows Service

2003-12-23 Thread Merrill Cornish
. ... 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 Co

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 memor

404: File Not Found = Stupidity?

2003-12-23 Thread Merrill Cornish
ctly 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 a

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

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 com

How to: Tomcat 5.0.16 as Windows Service

2003-12-20 Thread Merrill Cornish
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

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

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

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 addition

Session "Goes Away" (?)

2003-11-29 Thread Merrill Cornish
he 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