URL alias
I have a web application that I have written that uses a controller servlet. The controller fires off event handlers that process the various forms submitted by the user in various parts of the webapp. I am also using container managed security (forms based). A typical URL will look like this: http://myhost:8080/webappname/controller?event=login or event=whatever, depending on where they are in the webapp. Just for convenience sake, I would like to make an alias for login purposes that looks something like: http://myhost:8080/webappname/login I can't figure out how to map that to my controller servlet AND at the same time include the parameter event=login. The servlet-mapping configuration in web.xml will allow me to map login - controller, but how do I throw in the parameter and its value? Thanks Paul Phillips -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
jdbc realm fails to authenticate sometimes
Hello all I am running Tomcat 4.1.10 and using a jdbc realm with mysql. It is setup accordingto the docs on the jakarta web site. (At least I think it is!) The entry in my server.xml file looks like this: Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=org.gjt.mm.mysql.Driver connectionURL=jdbc:mysql://localhost/authority connectionName=me connectionPassword=mypassword userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=user_roles roleNameCol=role_name/ I am finding occasional authentication failures that always follow the same pattern.I say occasional in that often the authentication works perfectly well. When it doesn't this is what happens... 1) user tries to authenticate (typing very carefully the username and password),tomcat throws error, sending user to error.jsp page. 2) Sometimes, on second attempt, authentication works, and user is allowed accessto webapp. 3) However, sometimes on second attempt, Tomcat throws a null pointer exception.If the user simply presses retry (on the browser) at that point, he/she is allowedaccess to the application! So, in this case, somehow the authentication is takingplace on the second attempt, but an exception is being thrown somewhere... I was wondering if this had something to do with the 8 hour disconnect of mysql, andI added: autoreconnect=true to the URL above, but that didn't seem to fix the problem. This is driving users of my webapp nuts (as you can imagine). Does anyone haveany ideas of where to look, or what I can do to avoid this? Thanks Paul Phillips -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
JDBC realm on 4.1.10
I have a server running 4.0.3. On this server, I implemented a webapp that uses a JDBC realm for form based authentication. The database is mysql. It works fine. The lines in the 4.0.3 server.xml file relative to the JDBC realm look like this: Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=org.gjt.mm.mysql.Driver connectionURL=jdbc:mysql://localhost/xyz?user=meamp;password=mypassword userTable=userTableName userNameCol=login userCredCol=password userRoleTable=roles roleNameCol=role / So, I decided to give 4.1.10 a try. I used the admin app included in 4.1.10 to setup the realm for my context. When setting up the realm, I did not put anything in the digest field in the admin app, since I am sending clear text. However, Tomcat would not restart. I found that, if this line is left blank, the admin app puts: digest= into the server.xml. This won't parse, so it won't start. I had to remove it by hand. When I got it to start, the authentication on my webapp won't work. The login screen shows up, then I enter my username and password. When I submit it, the page starts to process, but never goes anywhere. It doesn't time out, doesn't give an error, nothing. It just sits and tries something (I don't know what...). The relevant lines in the 4.1.10 server.xml (generated by the admin app) are: Realm className=org.apache.catalina.realm.JDBCRealm connectionName=me connectionPassword=mypassword connectionURL=jdbc:mysql://localhost/xyz debug=9 driverName=com.mysql.jdbc.Driver roleNameCol=role userCredCol=password userNameCol=login userRoleTable=roles userTable=userTableName validate=true/ I have tried a number of variants of the above, all to no avail. I have tried the older mysql driver - no change. If anybody has any ideas, I would be grateful for the help. Regards, Paul Phillips -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: sweeping stale connections - Commons DBCP and Tomcat 4.1.9
Hello - I had this same problem, appending ?autoReconnect=true to your connect URL does work. I tried this -- parameter nameurl/name valuejdbc:mysql://localhost:3306/javatest?autoReconnect=true/value /parameter in my server.xml and it DOES work. Thanks to Glenn and Jay who suggested it. Regards, Paul Phillips -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: tomcat conn pooling question
Hello - Earlier today, Craig wrote: In answer to Rick's original question, the standard connection pool includes a validationQuery configuration property. This is an SQL query that the pool will execute before it hands you back a requested connection (so it should be something that executes very quickly). If the connection was closed externally (your scenario), this query will fail and the pool will throw that connection away and give you another one instead. So, in a JNDI DataSource configuration, in the server.xml, I suppose that we would have something like: parameter namevalidationQuery/name valueSQL_here/value /parameter Am I correct in surmising that we would put an actual SQL query within the value/value tags? Paul Phillips -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: sweeping stale connections - Commons DBCP and Tomcat 4.1.9
Hello I would suggest trying either of the following: parameter nameautoReconnect/name valuetrue/value /parameter I know that the above does not work... I tried it. or parameter nameurl/name valuejdbc:mysql://localhost:3306/javatest?autoReconnect=true/value /parameter I didn't try this, because I think that the ? in the url is already being provided by the code somewhere, so to add it here would duplicate it. From what I could tell by reading the code, there is some way to trigger an expire mechanism at regular intervals - I just don't know how to set that up... Thanks, Paul Phillips my original message is below... I'm using Tomcat 4.1.9. I have been having a problem with the DBCP jdbc connection pool when used with MySQL. Apparently MySQL kills off stale connections after an 8 hour period. According to Mark Matthews (developer of the jdbc-mysql driver), I need to configure the pool to sweep out the stale connections, and initiate new ones. I have looked and looked in vain for documentation for DBCP that would explain how to set the configuration in my Tomcat server.xml file (using JNDI) that would enable this. I can't find anything. I've tried examining the source of DBCP, but I'm afraid that I can't figure it out. My Tomcat server.xml file uses this configuration below, which is right out of: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples- ho wto.html From what I can tell, there are other parameters that I can enter to force the sweeping of stale connections. However, I don't know what they are, or how to use them. If anyone can give me an example of the correct syntax here, I would be very grateful, ( since my webapp dies every night, due to this problem!) Thanks -- Paul Phillips (excerpt of server.xml...) Context path=/DBTest docBase=DBTest debug=5 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_DBTest_log. suffix=.txt timestamp=true/ Resource name=jdbc/TestDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/TestDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namemaxActive/name value100/value /parameter parameter namemaxIdle/name value3/value /parameter parameter namemaxWait/name value100/value /parameter parameter nameusername/name valuejavauser/value /parameter parameter namepassword/name valuejavadude/value /parameter parameter namedriverClassName/name valueorg.gjt.mm.mysql.Driver/value /parameter parameter nameurl/name valuejdbc:mysql://localhost:3306/javatest/value /parameter /ResourceParams /Context -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
sweeping stale connections - Commons DBCP and Tomcat 4.1.9
I'm using Tomcat 4.1.9. I have been having a problem with the DBCP jdbc connection pool when used with MySQL. Apparently MySQL kills off stale connections after an 8 hour period. According to Mark Matthews (developer of the jdbc-mysql driver), I need to configure the pool to sweep out the stale connections, and initiate new ones. I have looked and looked in vain for documentation for DBCP that would explain how to set the configuration in my Tomcat server.xml file (using JNDI) that would enable this. I can't find anything. I've tried examining the source of DBCP, but I'm afraid that I can't figure it out. My Tomcat server.xml file uses this configuration below, which is right out of: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-ho wto.html From what I can tell, there are other parameters that I can enter to force the sweeping of stale connections. However, I don't know what they are, or how to use them. If anyone can give me an example of the correct syntax here, I would be very grateful, ( since my webapp dies every night, due to this problem!) Thanks -- Paul Phillips (excerpt of server.xml...) Context path=/DBTest docBase=DBTest debug=5 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_DBTest_log. suffix=.txt timestamp=true/ Resource name=jdbc/TestDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/TestDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namemaxActive/name value100/value /parameter parameter namemaxIdle/name value3/value /parameter parameter namemaxWait/name value100/value /parameter parameter nameusername/name valuejavauser/value /parameter parameter namepassword/name valuejavadude/value /parameter parameter namedriverClassName/name valueorg.gjt.mm.mysql.Driver/value /parameter parameter nameurl/name valuejdbc:mysql://localhost:3306/javatest/value /parameter /ResourceParams /Context -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
context problem with webapp connector
Tomcat 4.0.4 + Apache 1.3... I have setup the mod_webapp connector and it sort of works... However, I have a context in my tomcat server.xml file that looks like this: Context path=/tester docBase=tester debug=0 reloadable=false Parameter name=userdatadirectory value=/pathToData override=false / /Context Now, when I access my servlet directly into Tomcat standalone like this: http://URL:8080/tester/etc -- the parameter is passed to my application just fine. However, when I access my servlet through warp like this: http://URL/tester/etc -- the parameter doesn't get passed. I don't know why.. This is a stock Tomcat and Apache setup - the only thing I did was add mod_webapp and modify the apache configs according to the documentation. Other than the parameter passing not working, the webapp connector seems to work. -- that is: http://URL/examples/etc work fine. In a blind attempt to make it work, I added a hostcontext (same as above) /context/host to the warp connector section near the bottom of the Tomcat server.xml. That didn't seem to help any. Any ideas? Thanks Paul Phillips -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
unpacking of WAR
I worked on deploying my first webapp to another server today. I packaged it up as a war, transferred it to the other tomcat server, added the one line context element in the server.xml, and restarted. Nothing - the logs said that the webapp that was referenced by the context statement was not available or in a readable format. In fact, the war did not expand into the file system. So, I removed the context element, and restarted. With the context gone, the WAR expanded properly. Then I added the context back in, and it worked fine. Is this normal? Thanks Paul Phillips PS - the context element in the server.xml is just there to pass in a parameter containing the location of a data directory. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
io path information in servlets
I have a webapp that stores some data in an xml file. (I am using jdom to read and write the xml files.) Right now I am using a construct like: String prefix = sc.getRealPath(/) + /WEB-INF/dirName/; to get the path. I then concatonate that with the file name and it works fine. However, in the javadocs for javax.servlet I read: This method returns null if the servlet container cannot translate the virtual path to a real path for any reason (such as when the content is being made available from a .war archive). I am not exactly sure what this means. If I deploy this application as a .war, does the sc.getRealPath stop working? Thanks Paul Phillips -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
j_security_check and logout
Hello, all -- I have a small application consisting of servlets and jsp pages. I use form based authentication via j_security_check to login. I have a strange problem know how to solve. I have implemented a simple logout procedure whereby the logout servlet invalidates the session, and then transfers to a final thanks.jsp page that just says thanks... So far, so good. However, I wanted to try and do something about the back button issue, so, on the main.jsp page that calls the logout, I wrote this bit of javascript: a href=greeting?event=LOGOUT onclick=javascript:window.location.replace(this.href); event.returnValue=false; logout/a Ok, this seems to work fine. After logout, if the user is sitting on the thanks.jsp page, and presses the back button, it skips back to the initial login.jsp page (ignoring the main.jsp page that used to be in between. Good.. However! If I try and use the login.jsp page at that point, I get this error from tomcat: Apache Tomcat/4.0.3 - HTTP Status 400 - Invalid direct reference to form login page So, it seems at that point that the login page doesn't know where I want to go, and bombs. The place where I do want to go is greeting?event=WELCOME, but j_security_check has no way of knowing that, because it didn't come in throught the URL. Since we came back to login.jsp via the back button, it isn't there. Any ideas on how to solve this? Thanks Paul Phillips -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: j_security_check and logout
As Craig wrote below: You should never reference the URL of the login page directly. Instead, if you want to make them log back in, you should simply redirect them to some page within the protected area (perhaps the main menu). The usual login dialog will happen. I am not referencing the URL of the login page directly. (At least I'm trying not to! :)) That is the problem. The direct reference is a byproduct of the user pressing the back button when the regular intervening pages have been erased from history using javascript. I still can't figure out a way around this... Any ideas are appreciated... Paul Phillips --On Tuesday, July 9, 2002 10:50 AM -0700 Craig R. McClanahan [EMAIL PROTECTED] wrote: On Tue, 9 Jul 2002, Paul Phillips wrote: Date: Tue, 09 Jul 2002 10:40:13 -0500 From: Paul Phillips [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: j_security_check and logout Hello, all -- I have a small application consisting of servlets and jsp pages. I use form based authentication via j_security_check to login. I have a strange problem know how to solve. I have implemented a simple logout procedure whereby the logout servlet invalidates the session, and then transfers to a final thanks.jsp page that just says thanks... So far, so good. However, I wanted to try and do something about the back button issue, so, on the main.jsp page that calls the logout, I wrote this bit of javascript: a href=greeting?event=LOGOUT onclick=javascript:window.location.replace(this.href); event.returnValue=false; logout/a Ok, this seems to work fine. After logout, if the user is sitting on the thanks.jsp page, and presses the back button, it skips back to the initial login.jsp page (ignoring the main.jsp page that used to be in between. Good.. However! If I try and use the login.jsp page at that point, I get this error from tomcat: Apache Tomcat/4.0.3 - HTTP Status 400 - Invalid direct reference to form login page So, it seems at that point that the login page doesn't know where I want to go, and bombs. The place where I do want to go is greeting?event=WELCOME, but j_security_check has no way of knowing that, because it didn't come in throught the URL. Since we came back to login.jsp via the back button, it isn't there. Any ideas on how to solve this? You should never reference the URL of the login page directly. Instead, if you want to make them log back in, you should simply redirect them to some page within the protected area (perhaps the main menu). The usual login dialog will happen. Thanks Paul Phillips Craig -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
JNDI Data Source and Mac OS X with Tomcat
I am trying to debug JNDI resources as described at the jakarta.apache documentation pages at: http://jakarta.apache.org/tomcat/tomcat-4.0-doc/jndi-resources-howto.html I should add that I have already successfully done this on Solaris and Linux. However, when I try the exact same setup on Mac OS X, I am getting a naming exception when I try to access the database. What I am trying to do is use a data source with connection pooling. I have copied the server.xml and web.xml files exactly from my solaris box, where it works fine. The database is the same (mysql). I can access the database fine from within a servlet if I go directly with the DriverManager. It is the data source that doesn't work. I can't figure out at all what might be different about OS X... It seems so generic. I have quoted portions of the server.xml and web.xml below. I would be most grateful for any suggestions... Paul Phillips Here is the relevant portion of the web.xml file: resource-ref description Resource reference to a factory for java.sql connection instances that may be used for talking to a particular database that is configured in the server.xml file. /description res-ref-name jdbc/theDB /res-ref-name res-type javax.sql.DataSource /res-type res-auth Container /res-auth /resource-ref Here is the relevant portion of the server.xml file. (from within a context) Resource name=jdbc/theDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/theDB parameter nameuser/name valueusername/value /parameter parameter namepassword/name valuethepassword/value /parameter parameter namedriverClassName/name valueorg.gjt.mm.mysql.Driver/value /parameter parameter namedriverName/name valuejdbc:mysql://localhost/dbname/value /parameter /ResourceParams -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
alias
I need some generic advice... probably really easy. I have written an application with a controller servlet. The controller servlet is event driven - every form submit button on one of the jsp pages maps to controller?event=DOWHATEVER. After the controller does its thing, it sends the puts the results in a session, and transfers control back to a jsp page for display. My first attempt at MVC. My initial page is generated when the user types URL/whatever/controller?event=WELCOME Now I would like to make an alias that is like: URL/whatever/login which will map to URL/whatever/controller?event=WELCOME. What is the best way to do that? Not being much of an expert at the web.xml file, I tried the following within web.xml: servlet-mapping servlet-namecontroller/servlet-name url-pattern/controller/url-pattern /servlet-mapping servlet-mapping servlet-namecontroller?event=WELCOME/servlet-name url-pattern/login/url-pattern /servlet-mapping That, most assuredly, did not work. How should I go about doing this? I guess I could change the code of my servlet so that if there is no event definition provided, it goes to the welcome page... But it seems that there should be some way to setup an alias like this. Thanks Paul Phillips -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: alias
Actually, its a bit more complicated, so I don't think Jay's solution (quoted below) will work. I am using a security constraint with form based authentication. This means that I have to request a servlet that is in a constrained area. The container forwards the request to a login page outside of the constrained area. Once the login is processed, it goes back to the originally requested page. So, I have to actually have the query string passed in during the initial login. That is what I am trying to replace with an alias. Paul Phillips --On Sunday, April 7, 2002 12:09 PM -0600 Jay Gardner [EMAIL PROTECTED] wrote: Did you try servlet servlet-namecontroller/servlet-name servlet-classcontroller/servlet-class !--This servlet-class needs to be the actual name of the servlet. If name is com.mycompany.myproject.Controller, then that is what needs to appear here.-- /servlet servlet-mapping servlet-namecontroller/servlet-name url-pattern/login/url-pattern /servlet-mapping Don't worry about the query string being passed in to the servlet. That will be passed by the container from the jsp to the servlet. Hope this helps! --Jay Gardner -Original Message- From: Paul Phillips [mailto:[EMAIL PROTECTED]] Sent: Sunday, April 07, 2002 10:49 AM To: Tomcat Users List Subject: alias I need some generic advice... probably really easy. I have written an application with a controller servlet. The controller servlet is event driven - every form submit button on one of the jsp pages maps to controller?event=DOWHATEVER. After the controller does its thing, it sends the puts the results in a session, and transfers control back to a jsp page for display. My first attempt at MVC. My initial page is generated when the user types URL/whatever/controller?event=WELCOME Now I would like to make an alias that is like: URL/whatever/login which will map to URL/whatever/controller?event=WELCOME. What is the best way to do that? Not being much of an expert at the web.xml file, I tried the following within web.xml: servlet-mapping servlet-namecontroller/servlet-name url-pattern/controller/url-pattern /servlet-mapping servlet-mapping servlet-namecontroller?event=WELCOME/servlet-name url-pattern/login/url-pattern /servlet-mapping That, most assuredly, did not work. How should I go about doing this? I guess I could change the code of my servlet so that if there is no event definition provided, it goes to the welcome page... But it seems that there should be some way to setup an alias like this. Thanks Paul Phillips -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] ___ Paul Phillips Director of Orchestral Activities, Meadows School of the Arts Southern Methodist University You must sing every note you play, sing even through the rests! Arturo Toscanini -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
memory usage
I have a RedHat Linux box on which I am running tomcat 4. The machine has 1 gig of physical RAM. Just out of curiousity, I ran the free command yesterday, and discovered to my horror that it appeared that virtually all of the 1 gig was being used up! The machine had been running Tomcat only a couple of days. And, every time I ran free the amount of free memory was slightly smaller. So I did a PS -aux and found all these java processes - over 30. After reading the archives of this list, I now know that those are threads, not processes, and that they are sharing the same memory space. However - two questions. 1) Is the free command confused, and reporting much less free memory than I actually have? When I look at the ps -aux output, there is nothing else there (other than all the java) that would account for anywhere near that kind of memory use. Shutting down the tomcat server freed up nothing. However, a restart freed up about 3/4 of the memory on the machine. 2) Why is the memory use of Java gradually creeping upward? I know about the reported memory leak when compiling jsp pages, but I just have a very tiny number of those (5 or 6), so certainly that isn't it. I see the Java memory use slowly climbing (as reported by repeated invocations of free, or ps, or top) even when no one is accessing the tomcat servets. Why is this? Thanks, Paul Phillips -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Tomcat on Mac OS X, please help!
I don't know about the 404 errors. However, I did see Invalid virtual host name when I did not define the server name (with the servername directive) in the apache httpd.conf file. As I recall, this is commented out by default. It has to be there for mod_webapp to work. Good luck, Paul Phillips --On Friday, March 22, 2002 1:00 PM -0800 [EMAIL PROTECTED] wrote: The players: * Mac OS 10.1.3 * JDK 1.3.1 * Tomcat 4.0.2 * Apache * webapp-module-1.0-tc40 (for Mac) The problems: * Running Tomcat standalone or with Apache, I get 404 errors on the example links. * When trying to use webapp-module, I get this error: Syntax error on line 288 of /etc/httpd/httpd.conf: Invalid virtual host name I have made no changes to Tomcat's config files, but here are the only changes I've made to httpd.conf (in the appropriate spots). Line 288 is the WebAppDeploy line: LoadModule webapp_module libexec/httpd/mod_webapp.so AddModule mod_webapp.c WebAppConnection warpConnection warp localhost:8008 WebAppDeploy examples warpConnection /examples/ ServerName localhost I've followed instructions from Apple's and Apache's sites, but still cannot get it to work. Thanks -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] ___ Paul Phillips Director of Orchestral Activities, Meadows School of the Arts Southern Methodist University You must sing every note you play, sing even through the rests! Arturo Toscanini -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
mysql-jdbc in redhat linux
This is not a question, but rather an answer. After about three hours of work this morning, I found out why my tomcat configuration (which worked fine on my Solaris development server) was not working under redhat linux 7.2. I use Tomcat with mysql and jdbc to do both authentication, and serve up the data of my site. The issue apparently has to do with how redhat configures mysql. A user must be configured in the mysql grant tables as [EMAIL PROTECTED] - NOT just as user@localhost. Then, the normal mm.mysql driver, jdbc syntax works to connect to it just fine. Note that the jdbc syntax doesn't have to include the localdomain, only the mysql grant table. Without that localdomain in the mysql grant table, the connection is always refused. Regards, Paul Phillips -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
apache tomcat integration syntax error in httpd.conf
Hello - I am trying to integrate Apache and Tomcat with the warp connector. I am following the instructions at: http://www.galatea.com/flashguides/apache-tomcat-4-unix.xml which are dated March 6, 2002, so they aren't too old! I have followed the instructions exactly as stated on my RedHat Linux 7.2 platform. I am not using the RedHat Apache, but rather I built it from scratch. Per the instructions, I added these lines to the very end of httpd.conf IfModule mod_webapp.c WebAppConnection conn warp localhost:8008 WebAppDeploy examplesconn /examples WebAppInfo /webapp-info /IfModule When I run apachectl configtest, I get this error message: Syntax error line xxx Invalid virtual host name The line number is the line that is: WebAppDeploy examplesconn /examples I cannot figure out why it thinks this is a virtual host name, or what I have wrong that is producing the syntax error. Can anyone help? Thanks Paul Phillips -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: apache tomcat integration syntax error in httpd.conf
Here's what else I found since first writing the email quoted below. FYI - Tomcat 4.0.3 mod_webapp binary for linux i386 (I did not compile it) If I comment out the WebAppDeploy line, then apachectl configtest (and start) report the same error of invalid virtual host name for the following WebAppInfo line. If I comment out both the WebAppDeploy line and the WebAppInfo line, apachectl configtest reports syntax OK. However, that is useless, because I haven't associated any tomcat webapps to an apache URL. I tried adding a trailing slash to /examples, but that didn't change anything. If anybody has any ideas, I would be most grateful. Regards, Paul Phillips --On Tuesday, March 12, 2002 5:37 PM -0600 Paul Phillips [EMAIL PROTECTED] wrote: Hello - I am trying to integrate Apache and Tomcat with the warp connector. I am following the instructions at: http://www.galatea.com/flashguides/apache-tomcat-4-unix.xml which are dated March 6, 2002, so they aren't too old! I have followed the instructions exactly as stated on my RedHat Linux 7.2 platform. I am not using the RedHat Apache, but rather I built it from scratch. Per the instructions, I added these lines to the very end of httpd.conf IfModule mod_webapp.c WebAppConnection conn warp localhost:8008 WebAppDeploy examplesconn /examples WebAppInfo /webapp-info /IfModule When I run apachectl configtest, I get this error message: Syntax error line xxx Invalid virtual host name The line number is the line that is: WebAppDeploy examplesconn /examples I cannot figure out why it thinks this is a virtual host name, or what I have wrong that is producing the syntax error. Can anyone help? Thanks Paul Phillips -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] ___ Paul Phillips Director of Orchestral Activities, Meadows School of the Arts Southern Methodist University You must sing every note you play, sing even through the rests! Arturo Toscanini -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
images and login page for form authentication
System - Tomcat 4. I have setup form based authentication using a JDBC realm. The authentication works fine. When a user types a URL for a protected servlet, they are redirected to a login.jsp that is in an unprotected area of the webapp. After authentication, it returns to the servet for processing. Ok, fine. Then, I decided to add a banner to my login page so it would look like all the other servlet and jsp generated pages in the webapp. No matter what I do, the image will not display on the login page. I have tried every path name that I can think of, and tested paths that I know work that are on regular (not login) jsp pages. The funny thing is - when I have an image tag on the login page, the image doesn't show up when the page is first loaded (there is a broken image indicator is on the page) - BUT - after I type the name and password, then submit, the browser then shows that image, and no longer goes back to the servlet! So, obviously, the image is being protected from loading until authentication has taken place. However, the image is NOT in a protected area of the webapp. I tried it in the root directory of the webapp, and in a non protected subdirectory - no luck. Certainly there is a way around this. Anyone have ideas? I thought the whole basis for form based authentication was so that the designers could have their own design on the login page... Paul Phillips -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: images and login page for form authentication
Well, I figured it out - I had misconfigured a security constraint in my web.xml. It took a nights sleep to finally realize that... --On Monday, January 21, 2002 9:03 AM -0600 Paul Phillips [EMAIL PROTECTED] wrote: System - Tomcat 4. I have setup form based authentication using a JDBC realm. The authentication works fine. When a user types a URL for a protected servlet, they are redirected to a login.jsp that is in an unprotected area of the webapp. After authentication, it returns to the servet for processing. Ok, fine. Then, I decided to add a banner to my login page so it would look like all the other servlet and jsp generated pages in the webapp. No matter what I do, the image will not display on the login page. I have tried every path name that I can think of, and tested paths that I know work that are on regular (not login) jsp pages. The funny thing is - when I have an image tag on the login page, the image doesn't show up when the page is first loaded (there is a broken image indicator is on the page) - BUT - after I type the name and password, then submit, the browser then shows that image, and no longer goes back to the servlet! So, obviously, the image is being protected from loading until authentication has taken place. However, the image is NOT in a protected area of the webapp. I tried it in the root directory of the webapp, and in a non protected subdirectory - no luck. Certainly there is a way around this. Anyone have ideas? I thought the whole basis for form based authentication was so that the designers could have their own design on the login page... Paul Phillips -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] ___ Paul Phillips Director of Orchestral Activities, Meadows School of the Arts Southern Methodist University You must sing every note you play, sing even through the rests! Arturo Toscanini -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: JDBC authentication configuration
Thanks to David! This fixed my authentication problem! --On Monday, January 14, 2002 10:22 AM -0500 David Smith [EMAIL PROTECTED] wrote: This may or may not be the full problem, but one glaring error is in the connectionURL of your server.xml file. It should read as follows. Note the URL for making a connection to a MySQL database uses an symbol before 'password' and in XML it has to be encoded. Hope this helps you out. connectionURL=jdbc:mysql://localhost/rmta?user=myuseramp;password=mypa ssword I copied the URL directly from the Apache-Jakarta-Tomcat Realm Configuration How-To, and it shows only the semicolon following the user=username pair. It doesn't mention the ampersand at all. Should this be changed in the docs (since the example is showing a connection to a mysql database)? Thanks Paul Phillips -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
JDBC authentication configuration
Hello, I am relatively new to servlet/jsp programming, and struggling with JDBC authentication. I have a tiny test application that works fine using form authentication against passwords and names in the tomcat-users.xml file. However, when I reconfigure the server.xml file for JDBC authentication (following the instructions on the Apache/Tomcat site) the server hangs during startup. My little app is in a folder called /rmta-test. Specifically, in the log, the hang comes early on in the startup process, right after a line saying: Standard Manager [:/rmta-test]: Seeding of random number generator has completed. Below I have quoted the relavant lines from the server.xml file, and the web.xml file for this application. I don't think this has anything to do with the database, as Tomcat seems to hang on startup well before any interaction with the database. However, the database tables are setup correctly per the docs, and I can query it manually. I have also used a small stand-alone java program to create a table using the JDBC driver, so I know that the driver is installed correctly (in the tomcat library). If I simply remove the Realm statement, then Tomcat starts up normally. I'm pretty sure I've got something wrong in the configuration, of server.xml or web.xml, but i can't figure out what it is. I would be grateful for anyone's help. By the way, I'm using Tomcat 4.0.1 on unix. Thanks! Paul Phillips ___ Here are the lines that I inserted in my server.xml file to try and get JDBC authentication going: Context path=/rmta-test docBase=rmta-test debug=99 reloadable=true Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=org.gjt.mm.mysql.Driver connectionURL=jdbc:mysql://localhost/rmta?user=myuser;password=mypassword userTable=tablename userNameCol=login userCredCol=password userRoleTable=rolestable roleNameCol=role / /Context ___ Here is my web.xml file: ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app servlet servlet-nameGreetingServlet/servlet-name servlet-classfenced.GreetingServlet/servlet-class /servlet servlet-mapping servlet-nameGreetingServlet/servlet-name url-pattern/greeting/url-pattern /servlet-mapping security-constraint web-resource-collection web-resource-nameEntire Application/web-resource-name url-pattern/*/url-pattern /web-resource-collection auth-constraint role-namethename/role-name /auth-constraint /security-constraint login-config auth-methodFORM/auth-method form-login-config form-login-page/login.jsp/form-login-page form-error-page/error.jsp/form-error-page /form-login-config /login-config /web-app ___ Paul Phillips Director of Orchestral Activities, Meadows School of the Arts Southern Methodist University You must sing every note you play, sing even through the rests! Arturo Toscanini -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]