Directory Structure Problems
Hi, I've encountered a difficulty in a web site implementation, which uses Tomcat 4.1.18 on RH Linux 8.0, MySQL 3.23.54, J2SDK 1.4.1_01, and connection pooling with Form based authentication. Everything was working fine, until some tweaks were done to the proxy server. The directory strucuture is as follows: CATALINA_HOME/webapps/LiveSite/Restricted CATALINA_HOME/webapps/LiveSite/[main files and folders] CATALINA_HOME/webapps/LiveSite/Login/login.jsp I'm told that there is an Apache proxy server set up, that forwards the requests to Tomcat. When it was originally set up, requests that came in for www.companyName.com would be redirected to the LiveSite folder, and the index.jsp page was served up. I noticed that the URL in the browser would display the LiveSite folder in the address bar, after www.companyName.com, like this: www.companyName.com/LiveSite/index.jsp. After some tweaks were done on the proxy server, the LiveSite folder no longer displays in the address bar. As a matter of fact, if you include it, you get a 404 page not found error. This would all be fine, and an improvement, since it hides the directory structure, if it weren't for what it has done to the authentication process. Everything under the Restricted folder requires login. So, when everything was working, a person would login, and, once authenticated, they would be able to happily do their thing in that admin area. Now, however, they can login in (usually after three attempts), but the stylesheets are no longer recognized, the javascripts are not recognized, images are broken, and if you click on a link, you are presented with the login screen again. There seems to be domain/directory structure confusion in the server. My problem is that I don't know which server is confused. I think that this LiveSite folder is now the default root folder. I tried to set this as such in the server.xml file in Tomcat, to see if that would help. So, whereas I'd had the context as this: Context path=/LiveSite docBase=LiveSite debug=0 reloadable=true I tried changing it to this: Context path= docBase=LiveSite debug=0 reloadable=true This at first looked like a good move, until I discovered that doing this gave me the following error: java.sql.SQLException: Cannot load JDBC driver class 'null' so I've put it back the way I had it. At least people can view the site, though they can't use the restricted admin area, because they keep getting the login page coming up. It's like the session is lost, but the log files in Tomcat don't show an error. In the web.xml file for the site, this is what I have for the security constraint on the restricted folder: security-constraint web-resource-collection web-resource-nameAdmin/web-resource-name !-- Define the context-relative URL(s) to be protected -- url-pattern/Restricted/*/url-pattern snip... /web-resource-collection auth-constraint descriptiononly let the admin users login/description role-namerole1/role-name role-namerole2/role-name /auth-constraint /security-constraint Since the problems started with tweaks that were done on the proxy server, I think we should be looking there. But I've been told that the problem is probably with the site or Tomcat. However, all of the documentation that I've read, and the searching I've done in the archives, has brought me to a dead end. And I still think there must be something that either should be done in Tomcat to accommodate the fact that requests are going through a proxy (though the same settings that I've got on this site work on other sites that are on the same server--they're just not the default sites), or there should be something done to the proxy itself. I have been searching for a solution for two days, and don't know what direction to go in. The Tomcat logs don't indicate that there is a problem at all, unless I have the context path as , and searching on the SQLException didn't get me anywhere. If anyone can give me a direction to look, I'd be really grateful. Thanks for any help. Val - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Can I set up 2 realms for the same server so I can access 2 databases
Hi, I've got two sites set up on one server, and I am trying to set up security for each of them. They use 2 different databases. Is it possible to set things up in the server.xml the way I have below, or do I have to put all users in the same database? I can't find anything on the Web that deals with this issue. Realm roleNameCol=RoleID userCredCol=Password className=org.apache.catalina.realm.JDBCRealm userTable=tblUSERS debug=99 userRoleTable=tblUSERROLES userNameCol=Username connectionURL=jdbc:mysql://localhost/DB1?user=MyNameamp;password=MyPW driverName=com.mysql.jdbc.Driver / Realm roleNameCol=RoleID userCredCol=Password className=org.apache.catalina.realm.JDBCRealm userTable=tblUSERS debug=99 userRoleTable=tblUSERROLES userNameCol=Username connectionURL=jdbc:mysql://localhost/DB2?user=MyNameamp;password=MyPW driverName=com.mysql.jdbc.Driver / Thank you for any help. Val - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can I set up 2 realms for the same server so I can access 2 databases
- Original Message - From: Angus Mezick [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Wednesday, June 18, 2003 2:48 PM Subject: RE: Can I set up 2 realms for the same server so I can access 2 databases According to the spec, you can have 0 or 1 realms configured. Now, if you want to rewrite the code that uses the realms for logging people in I think you can use 2 DB's. Thank you for the info. I think I'll set up one database for logging in. Val - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Invalid pc in line number table
Hi, Does anyone understand what might be causing this error? The log files don't enlighten me at all, and searching on the Web brought no resolution. replylibrary is a package name, and SampleReply is the class. I'm accessing it from a JSP. It works fine on another site, and all other files and classes in this site work fine. What is an invalid pc in line number table??? The server encountered an internal error () that prevented it from fulfilling this request. org.apache.jasper.JasperException: replylibrary/SampleReply (Invalid pc in line number table) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2 48) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:260) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:191)\ Thanks for any help. Val - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Invalid pc in line number table
Hi, Strange error... What are the JDK's that are involved along with the Operating Environment and`what version of Tomcat? I'd say it is some sort of incompatibility between the two, is one maybe a very early version of the JDK? Also what JDK was it compiled under? It's not that, because I've got it compiling just fine on another application on the same server. It's on a RH Linux 7.3 machine with Tomcat 4.1.18, JDK 1.4 and I'm accessing a MySQL database (3.23). I don't even know where to look next. Val - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Invalid pc in line number table
Hi, I just wanted to post the fact that this error message has been cleaned up. I deleted the file that was giving me problems and dropped in a copy from the site where it was working fine. They were both originally copied from the same source, so I don't really know what the difference was. I guess something must have gotten corrupted somehow. While I have it working now, I have no idea how it broke or how it was fixed. I just wanted to let the list know it was resolved, and I thank you for your suggestions. Val - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Auto Login Using Form Based Authentication
Hi, I have an atypical situation in that I am trying to auto login users from another system (a Lotus Domino system) when they connect to my JSP application. I am using Tomcat 4.1.18 and have form based authentication working on it. I would prefer if the users did not have to explicitly login, because, as far as they are concerned, it's all part of the same application. Here is what I was hoping to be able to do: The user, who is already logged in on the Domino system, clicks on the link to my application. The link contains the user's UserID, as a parameter. The page they are linking to is in a restricted area, so Tomcat serves up the login page, which takes the UID parameter, retrieves the related password from the database, and logs the user in onload. I have it all working beautifully, EXCEPT that I can't seem to be able to retrieve the parameter from the URL. I suspect that it is lost when, instead of serving up the destination page, Tomcat serves up the login page instead. Is there a way to pass a parameter to the login page? I think the issue is the fact that you can't just call the login page directly. Does anyone see a way around this? I was thinking that maybe I'd have to link to an index page first, and then write a cookie, which I'd have to access from the login page. That seems like such a round-about way to go, when it would be so much simpler to just grab a parameter from the URL. Thanks in advance for any advice. Val - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JDBCRealm with Postgres Behaving Strangely When Accessed using IE
Hi everyone, I've got a strange problem that may be browser related or could be due to my development environment. I couldn't find any reference to this problem occurring for anyone else when I dug around the archives, but I'm hoping that some experienced person will recognize what may be happening to I can get past it. I am using DW MX to create the user interface of my Web application. Tomcat 4.1.12 is the web container and it is installed on RH Linux 7.3. PostgreSQL 7 is the database. I'm using JDBCRealm for security, and it is form based. Everything seems to be working fine, except when I try to view it from my development machine on Windows 2000 using IE 6. In that particular environment, if MX is open, after I've logged in and cruised around my files that are in the restricted folder, I will click on a link, and the browser closes, and I get an error saying that it can't find a temporary file on C:\. I'm assuming this might be a caching problem, but why only when MX is open? If MX is NOT open, then, every once in a while (more frequently after it happens once), I'll get the login screen displaying, even though I have been logged in. This happens a lot if I hit the refresh button in my browser. Sometimes, I'll know it is going to happen, because one of the images on the page I've clicked through to will display as a broken image with only the alt text displaying. Then, I know that if I click on any other link on that page, it will present me with the login screen. I will then login and get the page I was trying to click to. This does not happen if I am viewing the pages through NS 6.2 on the same machine. This does not happen on any machines using IE 6, so long as it is not my development machine outside of my internal network. Does anyone have any thoughts on what this could be? Is this really a Tomcat issue, or could this be a Macromedia issue? Could it be a combination of MX and Tomcat? Maybe it is a coincidence, but it just seems strange that when MX is open, the browser crashes and the MX environment displays the error message that it can't find a temporary file on C:. Frustratingly, I can't get it to duplicate that little problem since I rebooted the Linux machine and restarted Tomcat, so whatever it was doing before, that might actually no longer be a problem. Still, it should not be forcing me to relogin when I've logged in, and why IE? Is it the session variables? What configuration file, if any, can I even look in? Everything is set up in the server.xml and the web.xml as directed in the various documents I found on the Net, and it works for the other person that tried it with IE from a remote location, so it shouldn't be the config files, I think. Thanks in advance for any suggestions, Val -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Manual session management
Giorgio Saviane a écrit : Hi! I'm using Tomcat with a telephone (interactive-voice-recognition) client.This client communicates with the servlet via HTTP, and it all works well, except for one thing. When I start a new session, Tomcat sends a Set-Cookie and a Set-Cookie2 response header, both containing the JSESSIONID= parameter; the problem is, I can't manage to propagate the session in my request, I mean, to make tomcat recognize my request as part of the same session. With Allaire JRun, it was sufficient to pass the parameter without changes in the GET query string, but I tried this way with tomcat, and it doesn't work. How can I do it? Of course, my client doesn't support cookies, nor is capable of an automatic URL-rewriting... the question is, how can I 'fake' it manually? Best regards, Germano Hi, You should try : RequestInterceptor className=org.apache.tomcat.request.SessionInterceptor noCookies=true/ in server.xml file (tomcat/conf) which will enable url rewriting on your server and disable cookies.
IIS - Tomcat 3.2.1
Hi, I have 2 problems in using tomcat 3.2.1 with IIS(4 or 5), whereas it is configured following the 'how to IIS - Tomcat' doc : 1) It is impossible to get the remote user from java code (method getRemoteUser always returns null) with IIS4 With IIS 5, I can correctly get the remote user if I comment the line /myContext/*=ajp12 in uriWorkerMap.properties file. 2) On both configuration the http request is emptied : there are no parameters in request after submit It happens randomly... Thanks for any help Val