RE: Mysterious failures
Sorry but I don't use apache-httpd so can't help you there, although would comment that if you have mod_jk compilation warnings they sound worth looking at. My only experience of httpd with tc gave me the impression that it was unreliable. Although to be fair that was a few versions back, on windoze. Do you have a logger configured in tc at all? For example on my 5.0.28 I had this within the Engine.../Engine tag of in my webapp's context.xml Logger className=org.apache.catalina.logger.FileLogger timestamp=true/ See http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/logger.html for more details for 5.0 Your alternative to Logger is to move to commons-logging and/or log4j, which is what I am about to do myself. -Original Message- From: Grant Ingersoll [mailto:[EMAIL PROTECTED] Sent: Wednesday 25 May 2005 02:29 To: Tomcat Users List Subject: Re: Mysterious failures Thanks for the ideas. I cranked my debugging up to 99. There are a couple of things that I see, but don't know if they are serious: 1. SEVERE: The scratchDir you specified: /development/jakarta-tomcat-5.0.28/work/Catalina/localhost/admin is unusable. -- I never set this, I am assuming it is the default 2. WARNING: Duplicate name in Manifest: Class-Path -- I think this is due to some JAR in struts 3. In the apache log I get warnings about compiling mod_jk with EAPI on I am mapping through mod_jk, so the error I get is the Apache Internal Server Error. The Tomcat process is dead, so there is no tomcat error page. I am using struts, I will am pretty sure I am returning everything to the pool. I have a top level servlet filter that logs all exceptions, including Throwable all to no avail. It seems to crash at random, but mostly b/c I am not always aware of when it crashes. Today, after rebooting, it didn't even start up, but then started fine when I called startup.sh -Grant On May 22, 2005, at 9:51 PM, Steve Kirk wrote: What is your actual logging config? Hazy memory, but don't you want debug=99 rather than debug=1 to get more detail? If you really can't get logging to work, you could insert System.out.println(blah) statements at key points around where you think the crash might be caused, in lieu of your log statements. Not pretty but it can get you results. Some Qs to narrow it down a bit: Is the crash triggered by a single type of request, or maybe a burst of traffic, or will it crash even with no requests? Is the crashing request direct to TC or via apache httpd? Is a TC html error page generated, what does it say? Do you start any of your own threads? Does your code always return pooled objects to the pool? Is there some app that people use to make sure the server stays up by checking it every so often and restarting if needed? I've never come across that. TC is pretty reliable, shouldn't need it IMHE. -Original Message- From: Grant Ingersoll [mailto:[EMAIL PROTECTED] Sent: Monday 23 May 2005 02:39 To: tomcat-user@jakarta.apache.org Subject: Mysterious failures Hi, Have been a long time user of TC, but first time poster. I am running 5.0.28 on OS X with PostgreSQL and Struts and connecting to Apache using mod_jk. I have a webapp deployed that is pretty mature. However, I am having some mysterious crashes of Tomcat that I haven't been able to get my head around. The whole process is dying w/o so much as a peep. Not one single log/exception is being written anywhere (as far as I know) that gives even the most remote clue as to why and I am at a loss for how to get at the problem. Here is what I have done to date: 1. Put a catch (Throwable) with a log message at my top level part of the servlet that logs the exception and then throws it out. 2. I have turned on DEBUG level logging for every piece of the application 3. I have set debug=1 everywhere I could in server.xml Anyone have any suggestions on what else to do for debugging this? Part of me feels that it might be JDBC related as I am not using the Tomcat JNDI lookup methods for getting connections (but am managing a pool myself). Should I be using the JNDI lookup methods for getting connections? My only other guess was that it seems to happen after it has been running for a little while and I thought it might have something to do with the session timeout stuff, but I can't see why that would cause the process to exit. Is there some app that people use to make sure the server stays up by checking it every so often and restarting if needed? Thanks for any advice, Grant - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
log files with servlets ?
I am testing MIDlets connection to servlet. I am using Netbeans 4.1 with mobility pack, Tomcat bundled with NB (5.5.7) or external Tomcat (5.028). I have added an EchoServlet under TomcatServletExample (Servlet v 2.3). My EchoServlet can respond to POST and GET methods. It is OK when i send parameters from a browser with GET method. With POST method from a MIDlet, i cannot reach the servlet (the HttpConnexion seems no connect ...) My first question : how can i find or trace log events which relate to that servlet or tomcat ? I want to trace the access of my MIDlet to tomcat and to the servlet... but i don't find any log file about, except the TOMCAT_HOME/logs/TomcatServletExample.2005-05-xx.log (which describes the starting of the servlet). Can i find or initiate any log file similar to the .../httpd/access_log of my apache web site ? Thanks. -- Jean-Luc Douville - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
apache2 + mod_jk + tomcat 4.1.31 - jkstatus
Hi all, I've installation of apache2, mod_jk and tomcat4.1.31 where the apache is serving port 80, and 5 vhost are directing jsp/servlet requests to 5 separate workers. I'm entering into bottlenecks where one of the workers issues, threadpool full. I've had problems debugging the situation and am seeking advice on how to determine the state of the workers. When using mod_jk2, jkstatus could be used but what is equivalent for mod_jk? BR. Arnar Arnar Gestsson, MSc Trackwell Software
Re: Minimal server
== Date: Tue, 24 May 2005 10:42:46 -0700 (PDT) From: Dola Woolfe [EMAIL PROTECTED] To: Tomcat Users List tomcat-user@jakarta.apache.org Subject: Re: Minimal server == Yes, I think Will captured what I'm trying to do. Let me give you a slightly more specific description because I would like to hear what you guys have to say. I basically want to write a relatively small application which has nothing to with being a web server. What it will have a significant GUI component, mostly of static nature. Now I've written a million GUIs in my life in Motif, QT, gtk, tcl/tk, Glut, Swing, and even SAS and Matlab. My experience tells me that all are a pain in the butt in one way or another. The use of these tookits is often unavoidable. But I have concluded over the years that if I can talk to my program through a browser it is worth doing so. I can enter input parameters, it can serve back data, charts or anything you want, I can talk to my program from anywhere in the world and, most importantly, I find HTML forms very easy to code and maintain. There are a number of other little advantages, such as being able to drive the program w/o a browser. The niuance that prompted my original post is that now I would like to write a program (with a browser based gui) that I will distribute to others. It would be easy to simply distribute it as a jsp webapp, but then the intended users will need to have Tomcat installed which, of course, is prohibitive. (I need to admit that having switched to TC5.5 I have been unable to figure out how to install it properly and have been running it out of the DOS shell. Shame on me!) Anyway, that's where I am. Dola Tell me if I understood properly: 1. you need a simple gui (thus browser) 2. you need to install such application on several client 3. this client must be able to respond on a http request 4. you have enough control on such clients to install a servlet server such Tomcat and a jre compatible with your Tomcat version IMHO: 1. the easiest way for interfaces developing is Visual Basic ;-) 2. when I need features as 2 and 3 I'm oriented on services and socket programming G. -- Giuseppe Briotti [EMAIL PROTECTED] Alme Sol, curru nitido diem qui promis et celas aliusque et idem nasceris, possis nihil urbe Roma visere maius. (Orazio) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: log files with servlets ?
For how to set up logging of your Java servlet code on 5.0.28, you need to add a Logger to your conf/server.xml file, inserting it inside your Host.../Host or Engine.../Engine tags will probably get you going. To get apache-httpd type logging going, you need a Valve, again insert it within your Engine or Host tags, looks a bit like this: Valve className=org.apache.catalina.valves.FastCommonAccessLogValve directory=logs prefix=access_log_ suffix=.log pattern=common resolveHosts=false/ Do you have doPost method() implemented in your servlet class? If you only have doGet(), that is most likely your problem. -Original Message- From: Jean-Luc Douville [mailto:[EMAIL PROTECTED] Sent: Wednesday 25 May 2005 09:53 To: tomcat-user@jakarta.apache.org Subject: log files with servlets ? I am testing MIDlets connection to servlet. I am using Netbeans 4.1 with mobility pack, Tomcat bundled with NB (5.5.7) or external Tomcat (5.028). I have added an EchoServlet under TomcatServletExample (Servlet v 2.3). My EchoServlet can respond to POST and GET methods. It is OK when i send parameters from a browser with GET method. With POST method from a MIDlet, i cannot reach the servlet (the HttpConnexion seems no connect ...) My first question : how can i find or trace log events which relate to that servlet or tomcat ? I want to trace the access of my MIDlet to tomcat and to the servlet... but i don't find any log file about, except the TOMCAT_HOME/logs/TomcatServletExample.2005-05-xx.log (which describes the starting of the servlet). Can i find or initiate any log file similar to the .../httpd/access_log of my apache web site ? Thanks. -- Jean-Luc Douville - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to create user thread in tomcat
Hi, Please help. I would like to create a thread or service that start running once the web server is started. This thread need to communicate with other applications using HTTP protocol. Terence -- Internal Virus Database is out-of-date. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.11.8 - Release Date: 5/10/2005 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem with Tomcat 5.5.9
Hi, please advise possible reason for: We have a java web application running under Tomcat 5.0.19 without problems. After upgrade to Tomcat 5.5.9 we encountered the following: When requesting http://localhost:8080/test/;(where test is our webapp context) an empty page with the following content is returned: htmlbody/body/html All .jsp files are compiled correctly in the work directory but the result is always as written above. When testing with a .html file everything is OK. When testing with a .jsp file with no jsp code in it - blank page again. The Tomcat logs do not indicate any problems during startup or loading of the webapp. We tried to put something in the standard output(System.out) but nothing was written. It seems that the generated servlets are created but not executed at all. Thank you in advance, Alexander P.S. System parameters: OS - Slackware Linux, Windows XP Browser - Mozilla Firefox 1.0.4, Mozilla 1.7.6, IE 6.0 JDK - 1.5.0 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat Training
Since Tomcat is an open source application, no school has training class on that. You can check into the Apache organization as they might have something set up. But frankly, most people train by themselves. There are some good books on Tomcat that you can buy and study. Hope this helps. - Original Message - From: Tim Sodergren [EMAIL PROTECTED] To: 'Tomcat Users List' tomcat-user@jakarta.apache.org Sent: Monday, May 23, 2005 1:47 PM Subject: Tomcat Training We would like to send one of our employees to some type of training for Tomcat administration. Does anyone have any suggestions on how to find reliable courses? We are located in Salt Lake City and prefer something local. -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.322 / Virus Database: 266.11.15 - Release Date: 5/22/2005 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: Validation Frame work
I agree with Steve, but there is a much simpler possibility that the JS validation does not work: The user can just switch it off in the browser. This might not be just to bypass validation, but maybe just for security reasons, so for a business critical apllications I'd discourage anyone from using it, if you have something like a guestbook, and the validation fails and you end up with something like an entry without email address, so what. Bernhard -Ursprüngliche Nachricht- Von: Steve Kirk [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 24. Mai 2005 20:02 An: 'Tomcat Users List' Betreff: RE: Validation Frame work David is right, JS and serverside validation perform different roles. To expand on his comment a bit more, remember that the requests that your webapp receives could be sent by any HTTP client, not necessarily by a friendly web browser. If someone were so inclined, they could write their own HTTP client to interact with your webapp, that aimed to deliberately submit bad data to your servlet, in which case your JS validation would have been bypassed. What they can't do is bypass your serverside validation (or at least this is much harder). Just one trick that such nasty people might try is to insert JS code in any form fields that you let them create or edit. If this field data is then displayed in other pages of your app, this might cause anyone viewing that page on your site to download a trojan/virus/etc. It's really very easy to do. And this is only one such exploit. There are many others. -Original Message- From: David Smith [mailto:[EMAIL PROTECTED] Sent: Tuesday 24 May 2005 16:19 To: Tomcat Users List Subject: Re: Validation Frame work Because you should never trust the client. They may not be submitting from your form. Javascript is just a nicety to save the user a whole request/response cycle just to find out a field is missing or wrong. Consider it a security issue. -- David raja buddha wrote: Hi all In struts why do we need validation frame work we have java script to do validations. Is there any extra advantage of using the validation frame work raj _ On the road to retirement? Check out MSN Life Events for advice on how to get there! http://lifeevents.msn.com/category.aspx?cid=Retirement - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem with Tomcat 5.5.9
Have you moved your config files across? conf/web.xml conf/server.xml conf/tomcat-users.xml conf/[engineName]/[hostName]/contextName.xml Do you have the welcome files configured in web.xml (either in conf/ or in the webapp's WEB-INF folder) ? What do they point to for /test/? If a servlet, are the servlet and its mapping both config'd in web.xml? If a JSP, is the jsp servlet and mapping config's in web.xml? Put a Logger and Valve in your server.xml's Host tag and see if you get any more clues from the extra logging. Se my earlier posts today and yesterday for details on those. Hope this helps. -Original Message- From: Aleksandar Valchev [mailto:[EMAIL PROTECTED] Sent: Wednesday 25 May 2005 13:19 To: tomcat-user@jakarta.apache.org Subject: Problem with Tomcat 5.5.9 Hi, please advise possible reason for: We have a java web application running under Tomcat 5.0.19 without problems. After upgrade to Tomcat 5.5.9 we encountered the following: When requesting http://localhost:8080/test/;(where test is our webapp context) an empty page with the following content is returned: htmlbody/body/html All .jsp files are compiled correctly in the work directory but the result is always as written above. When testing with a .html file everything is OK. When testing with a .jsp file with no jsp code in it - blank page again. The Tomcat logs do not indicate any problems during startup or loading of the webapp. We tried to put something in the standard output(System.out) but nothing was written. It seems that the generated servlets are created but not executed at all. Thank you in advance, Alexander P.S. System parameters: OS - Slackware Linux, Windows XP Browser - Mozilla Firefox 1.0.4, Mozilla 1.7.6, IE 6.0 JDK - 1.5.0 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to create user thread in tomcat
Write your thread class (myThreadClass) as implementing Runnable. Write a class that implements ServletContextListener and config it in web.xml like this: listener listener-classmypackage.MyScListenerClass/listener-class /listener Now have your ServletContextListener start a new thread using your Runnable class in its contextInitialized method, which is called when the app starts. You might want to consider what happens if/when the run() method of your myThreadClass returns. Do you want to restart the thread again or not? If yes, you might need to put it in a while loop within run() - if this is of the type while(true) until it throws an exception, make sure that you catch the Exception gracefully, and also include code like this in the innermost part of the loop so that it is well-behaved about sharing resources with other threads on the machine: Thread.currentThread().sleep(1000 * delayMilliseconds); You might also think about what needs to be done to gracefully exit from the thread when TC shuts down. This will influence whether you make the thread daemon or not, and whether you need inter-thread communication so that your main webapp can tell your non-daemon thread to exit gracefully ASAP. Have used this approach before, and am about to use same approach again on another project. It works. You *do* need to take care about being threadsafe. If you don't understand how to do that, then you need to read up on it - it's beyond the scope of a single email. You can find more detail on all the stuff above in the javadocs, or reply to the list if you have any specific Qs and I'll try to pick it up. -Original Message- From: Terence Chan [mailto:[EMAIL PROTECTED] Sent: Wednesday 25 May 2005 11:24 To: 'Tomcat Users List' Subject: How to create user thread in tomcat Hi, Please help. I would like to create a thread or service that start running once the web server is started. This thread need to communicate with other applications using HTTP protocol. Terence -- Internal Virus Database is out-of-date. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.11.8 - Release Date: 5/10/2005 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Validation Frame work
What a good point, especially as IE becomes harder and harder to secure, people are starting to turn off active content, which can include simple innocent js code. I'm a fan of the lowest common denominator approach to using HTML and JS features. -Original Message- From: Bernhard Slominski [mailto:[EMAIL PROTECTED] Sent: Wednesday 25 May 2005 13:35 To: 'Tomcat Users List' Subject: AW: Validation Frame work I agree with Steve, but there is a much simpler possibility that the JS validation does not work: The user can just switch it off in the browser. This might not be just to bypass validation, but maybe just for security reasons, so for a business critical apllications I'd discourage anyone from using it, if you have something like a guestbook, and the validation fails and you end up with something like an entry without email address, so what. Bernhard -Ursprüngliche Nachricht- Von: Steve Kirk [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 24. Mai 2005 20:02 An: 'Tomcat Users List' Betreff: RE: Validation Frame work David is right, JS and serverside validation perform different roles. To expand on his comment a bit more, remember that the requests that your webapp receives could be sent by any HTTP client, not necessarily by a friendly web browser. If someone were so inclined, they could write their own HTTP client to interact with your webapp, that aimed to deliberately submit bad data to your servlet, in which case your JS validation would have been bypassed. What they can't do is bypass your serverside validation (or at least this is much harder). Just one trick that such nasty people might try is to insert JS code in any form fields that you let them create or edit. If this field data is then displayed in other pages of your app, this might cause anyone viewing that page on your site to download a trojan/virus/etc. It's really very easy to do. And this is only one such exploit. There are many others. -Original Message- From: David Smith [mailto:[EMAIL PROTECTED] Sent: Tuesday 24 May 2005 16:19 To: Tomcat Users List Subject: Re: Validation Frame work Because you should never trust the client. They may not be submitting from your form. Javascript is just a nicety to save the user a whole request/response cycle just to find out a field is missing or wrong. Consider it a security issue. -- David raja buddha wrote: Hi all In struts why do we need validation frame work we have java script to do validations. Is there any extra advantage of using the validation frame work raj _ On the road to retirement? Check out MSN Life Events for advice on how to get there! http://lifeevents.msn.com/category.aspx?cid=Retirement - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Performing an action on form-based login
Not maybe of direct help unless you get really stuck, but my approach was to use TCs sessions, but not its authentication framework. My original reasoning for this was that I wanted login details to be in a RDMS table along with other data. So I coded the login/logout process myself, which was a little work to achieve, but gives me freedom to handle the sorts of things you are talking about in a flexible way. My way around the problem you describe is that when someone successfully authenticates, I add their uid to the session object as a String in the doGet() method: String uid = request.getParameter(form_uid_field); request.getSession(true).setAttribute(uid, null); And because the uid is now accessible via the session object, when your SessionListener catches the attributeAdded/Changed/Replaced events, they pass a HttpSessionBindingEvent, from which you can call .getSession().getAttribute(uid) -Original Message- From: Ross Nicoll [mailto:[EMAIL PROTECTED] Sent: Tuesday 24 May 2005 15:17 To: Tomcat Users List Subject: Re: Performing an action on form-based login We're having more or less the same problem. Is there perhaps a chance of a UserFormLoginListener in a future version of Tomcat? Anyone have any advice on this? Some reliable method for logging out a user would also be extremely useful. On 5/22/05, Torsten Römer [EMAIL PROTECTED] wrote: This question has been asked (and answered to) earlier, but I am still unsure: I am using container managed security with form-based authentication. I am really happy with how it works. But now I would like to perform an action when a user has authenticated, such as loading user preferences and store them in the session. First I thought I could use a HttpSessionListener for that. Now I know when a new session has been created, but what I am missing is the username. The only way to get it seems to be from a request using getRemoteUser(). Or am I wrong? I really hope I am... I read about setting up a filter but then read somewhere else that this is not reliable. I also found this article Active Authentication http://java.sys-con.com/read/37660.htm which sounds interesting but the link to the source code is broken, so I don't get how to implement that. Can someone help me out? Torsten - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
EJB3/JBoss Entity Bean remoting issue
Hi, I am having an issue with a ClassCastException whilst trying to remote an EJB3 entity bean. I have a simple Entity bean Account which appears to function perfectly. I then have a stateless session bean with the following function: public Account findAccountById(int id) { Account a = (Account)manager.find(Account.class, id); } I.e. return the account that matches the given id. In my client (on top of Tomcat 5.5 - external to JBoss - I know perhaps that this is not currently supported, but it seems to work in most cases), I have a call in a Spring MultiActionController: AccountServices service = (AccountServices) context.lookup(AccountServices.class.getName()); Account a = service.findAccountById(id); Which causes: java.lang.ClassCastException: db.mapping.Account at $Proxy0.findAccountById(Unknown Source) at web.AccountMAController.showAccountSummary(AccountMAController.java:43) etc.. Interestingly, if I return the account in an ArrayList from the function findAccountById (i.e. getResultList), and pass this resultant list to a JSP page, and inject the arraylist as a bean - I can access the members of the Account object perfectly. Also, if I return the Entity bean as an Object, and pass this object through to a jsp, this works too - i.e. i can access the members. So my object is clearly of the type db.mapping.Account, but casting to it causes the above exception. This exception is the only output given (other than the full stack trace) - nothing goes to catalina.out I cannot fault my code, and indeed this workaround seems to work - so my EJB is clearly returning the correct data, but I cannot cast to the Account object from within the servlet. I am running this on Tomcat 5.5.9. There is no exception thrown on the JBoss Server, so there would appear to be some issue with the Tomcat class-loader here. Ideas anyone? Cheers, Alex. -- Alexander Taylor [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
IMPORTANT NEED Tomcat Connection advice
Please, I need Advice for connections Hi guys. I need a technical advice using tomcat 5.0 Presently, tomcat server is used with JBOSS in a solution that I am developping for my clients. Users are connecting to the solution by invoking a servlet (runned by tomcat). If a user is auhentified, then I use HTTPServletResponse object (in the service method) to get the Outputstream of that object = HTTPServletResponse.getoutputstream) Then this stream will be use to handle communications between my client application and my custom Server Process (I need to send real time informations through this canal). Important = A client session can last several hours, so the life of the servlet is set to time infinite . In fact I had the idea delegate socket connection managment, to tomcat engine, by setting servlet life time to infinite. Is it a good way to do, or should I use a socket pooling algorithm (actualy, the server can freeze, after unregular amout of times, time for writing operation in the Output stream can increase until being totaly unusuable, I have to close, and reconnect) The objective is to handle more than 1000 client sessions. Please, i need a quick answer . Thank you for your help. Best regards Kenoh. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: redeploy of webapp loses GlobalNamingResource DataSource
Thanks for the response Steve. It is certainly a good thing to check, but unfortunately not the issue here. Actually I know I have the driver correctly configured because I have been using it successfully for a v. long time :). My problem is specifically that on *redeploy* of a war file, the Context loses the JNDI GlobalNamingResources specified in the server.xml file. I have found some postings that also describe this problem: http://mail-archives.apache.org/mod_mbox/jakarta-tomcat-user/200402.mbox/[EMAIL PROTECTED] but they refer to a workaround solution of separating Resource out of GlobalNamingResources and specifying it in the Context. However, I wish to use the Resource Globally across Contexts, so would prefer a solution that didn't require duplication of Database Pools. any help would be greatly appreciated. :) From the look of the stacktrace, which mentions org.postgresql.Driver.parseURL as the point where the initial exception was thrown, maybe the URL attribute in your Context's Resource or ResourceParams might either contain a wrong value or a typo. This might be leading to a parsing exception, even though the trace doesn't say so explicitly. My experience is that the exceptions in these cases do not always give you a very precise clue as to the problem. For example, very recently on 5.5.9, I was getting a similar problem to you, where just because I had a leading space in the url attribute value, the whole DBCP resource was rejected, with the exception messages Cannot create JDBC driver of class '' for connect URL 'null' caused by no suitable driver. Check that config *extremely* carefully -Original Message- From: bob_b [mailto:[EMAIL PROTECTED] Sent: Tuesday 24 May 2005 22:28 To: tomcat-user@jakarta.apache.org Subject: redeploy of webapp loses GlobalNamingResource DataSource I have a globally named db pool resource that I use across multiple contexts to access a particular database. When I redeploy a webapp in Tomcat 5.0.28, I am losing the DataSource and getting a pooled connection fails with the following (truncated) message: org.apache.commons.dbcp .SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' =09at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou= rce.java:780) =09at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource= .java:540) . Caused by: java.lang.NullPointerException =09at org.postgresql.Driver.parseURL(Driver.java:269) =09at org.postgresql.Driver.acceptsURL(Driver.java:177) =09at java.sql.DriverManager.getDriver(DriverManager.java:232) =09at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou= rce.java:773) =09... 44 more.. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JAAS LoginModule weird error
I've written a JAAS Login Module for my web application that authenticates against a third party (Documentum) content management server. It works fine but it seems to attempt to login once before the dialog is even presented to the user. The logs show: DfPrincipalException:: THREAD: http-443-Processor13; MSG: [DM_API_E_NOUSERNAME]error: No user name have been provided for a connection. ... (more authentication failed messages from LoginModule code) ... Yet I haven't even tried to login yet. I am able to login successfully after this error but it still bothers me that something is causing it to attempt a login before it even presents the dialog. Any suggestion, solutions would be appreciated. -Mark - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: EJB3/JBoss Entity Bean remoting issue
AccountServices service = (AccountServices) context.lookup(AccountServices.class.getName()); Account a = service.findAccountById(id); One thing occurs immediately: The lookup will be fine if AccountServices is a local interface on the bean. If it is a remote interface, you'll need to narrow the reference before you can cast it. julian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validation of HowTo Deploy
Because of no answer, I create a bug enhancement in bugzilla (http://issues.apache.org/bugzilla/show_bug.cgi?id=35063) with the HowTo document and an example more complete. ... On Mon, 23 May 2005 19:12:07 +0200 Lionel Farbos [EMAIL PROTECTED] wrote: 2nd test with the doc HTML inside... Hi, Because there is a lot of informations on several documents for deploying a webapp in Tomcat, it is difficult to define a simple and standard way to do it on a production server. Moreover, the deployment is different with Tomcat 3, 4, 5.0 or 5.5 So I decided to initialize a document which would be available for all Tomcat versions = 5.5.7 If you have a well knowledge of Tomcat in a production environment, Can you help me to validate (correct and/or complete) a simple document like the one attach ? Notes : - The goal of this document is only to be a as simple as possible starting point for this theme. - I'm not sure the re-deployment paragraph when Automatic deployment is disabled is correct ... In advance, thank you. Regards. !DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html ... see in the bugzilla attachment for more details - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
error while precompiling JSP with ant file
Hi ! I want to precompile my JSP files with a ant file. after starting the ant file i get this error: java.lang.NoClassDefFoundError: org/apache/jasper/jspc Exception in Thread main. I'm working with tomcat 3.3. I searched in all jar files but didnt find anything. After searching in all jat files of a tomcat 4.x i found jasper-compiler.jar , which I also add to my clsspath. but i have still the same error. What did i do wrong ? thanks. bouml
error while precompiling JSP with ant file
Hi ! I want to precompile my JSP files with a ant file. after starting the ant file i get this error: java.lang.NoClassDefFoundError: org/apache/jasper/jspc Exception in Thread main. I'm working with tomcat 3.3. I searched in all jar files but didnt find anything. After searching in all jat files of a tomcat 4.x i found jasper-compiler.jar , which I also add to my clsspath. but i have still the same error. What did i do wrong ? thanks. bouml
Doubt on Validator Plug in
Hi All, I get the following exception while validating a user name field . Struts Version is 1.2.4 Jakarta ORO version is 2.0.8 Validator Package version is 1.1.3 Error details : EVERE: org.apache.struts.validator.FieldChecks.validateMask(java.lang.Object, org.apache.commons.validator.ValidatorAction, org.apache.commons.validator.Field, org.apache.struts.action.ActionErrors, javax.servlet.http.HttpServletRequest) rg.apache.commons.validator.ValidatorException: org.apache.struts.validator.FieldChecks.validateMask(java.lang.Object, org.apache.commons.validator.ValidatorAction, org.apache.commons.validator.Field, org.apache.struts.action.ActionErrors, jav at org.apache.commons.validator.ValidatorAction.loadValidationMethod(Valida torAction.java:627) at org.apache.commons.validator.ValidatorAction.executeValidationMethod(Val idatorAction.java:557) at org.apache.commons.validator.Field.validateForRule(Field.java:811) at org.apache.commons.validator.Field.validate(Field.java:890) at org.apache.commons.validator.Form.validate(Form.java:174) at org.apache.commons.validator.Validator.validate(Validator.java:367) at org.apache.struts.validator.ValidatorForm.validate(ValidatorForm.java:11 2) at org.apache.struts.action.RequestProcessor.processValidate(RequestProcess or.java:921) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java: 206) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Se rvletStubImpl.java:1053) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl. java:387) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl. java:305) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.r un(WebAppServletContext.java:6310) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSu bject.java:317) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118 ) at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServl etContext.java:3622) at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl. java:2569) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170) Let me know what is the problem ? Expecting for your speedy reply, Thanks and Regards, Sriram Mahalingam -- HCU CES, Satyam Computer Services, India. Ph - Work : +91-44-22540321x 6619; Cell : +91-98407 17079 email : [EMAIL PROTECTED] DISCLAIMER: This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated.
Different Authentication Requirements Based On Connector, Port or Protocol?
Hi, We have a Tomcat server (without Apache HTTP server) serving on two ports, 8080 and 8443 (HTTP and HTTPS respectively) using two connectors as described in the various Tomcat SSL FAQs. What I want to do is require users coming in on port 8443 (from the internet) to pass basic user authentication before they can access anything while still allowing our internal users on port 8080 (which will not be accessible from the internet) access without authentication. Basically, I am trying to make a secure extranet the lazy way without annoying the existing intranet users. Can anybody suggest a reasonably easy way to do this? At first I was thinking that I could just put a url-pattern inside a security-constraint in web.xml but I realised that this does not operate on the full URL so I could not filter by port number or protocol here. Thanks, Daniel. -- Daniel Rigal MSc. Systems Administrator - Jai Kudo IT Support Team. This message has been scanned for viruses by MessageLabs. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: HttpSessionListener
Randy, I don't believe you have session replication set up in your cluster. This is why when a session is created it only calls your HttpSessionListener on one box. The second box will only get the session if its replicated over to that box. However! I tried to do the same thing and I was getting server lockups when it a cluster. The HttpSessionListener would work fine on a single box, but in a cluster both servers would lock up. It is my belief that there is some concurrency issue in Tomcat/Session Replication/HttpSessionListeners. However, I never found anything firm, as is usually the case with concurrency issues. Well I would love to hear if you get this working. Jacob Champlin EMO Corporation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Different Authentication Requirements Based On Connector, Por t or Protocol?
You might think about using Apache HTTP server to proxy (mod_proxy) the external traffic back to your tomcat instance on ports 80 (80 -8080) 443 (443-8443). I've run into situations where ports other than the standard 80 443 are blocked by corporate firewalls. You might be able to use apache to do the authentication that way too. Just my 2 cents. --Dan -Original Message- From: Daniel Rigal [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 25, 2005 9:09 AM To: tomcat-user@jakarta.apache.org Subject: Different Authentication Requirements Based On Connector, Port or Protocol? Hi, We have a Tomcat server (without Apache HTTP server) serving on two ports, 8080 and 8443 (HTTP and HTTPS respectively) using two connectors as described in the various Tomcat SSL FAQs. What I want to do is require users coming in on port 8443 (from the internet) to pass basic user authentication before they can access anything while still allowing our internal users on port 8080 (which will not be accessible from the internet) access without authentication. Basically, I am trying to make a secure extranet the lazy way without annoying the existing intranet users. Can anybody suggest a reasonably easy way to do this? At first I was thinking that I could just put a url-pattern inside a security-constraint in web.xml but I realised that this does not operate on the full URL so I could not filter by port number or protocol here. Thanks, Daniel. -- Daniel Rigal MSc. Systems Administrator - Jai Kudo IT Support Team. This message has been scanned for viruses by MessageLabs. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: HttpSessionListener
Hi Jacob, Thanks for the reply. My situation is a little more straightforward than the replication cluster you are dealing with. In my case the first server is simply the development environment and the second server is the production deployment server. The two environments use identical OS and Tomcat so I am baffled at why HttpSessionListener will only work on the server used for development. Thanks Randy -Original Message- From: Jacob Champlin [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 25, 2005 8:51 AM To: tomcat-user@jakarta.apache.org Subject: Re: HttpSessionListener Randy, I don't believe you have session replication set up in your cluster. This is why when a session is created it only calls your HttpSessionListener on one box. The second box will only get the session if its replicated over to that box. However! I tried to do the same thing and I was getting server lockups when it a cluster. The HttpSessionListener would work fine on a single box, but in a cluster both servers would lock up. It is my belief that there is some concurrency issue in Tomcat/Session Replication/HttpSessionListeners. However, I never found anything firm, as is usually the case with concurrency issues. Well I would love to hear if you get this working. Jacob Champlin EMO Corporation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: HttpSessionListener
Hi Jacob, Thanks for the reply. My situation is a little more straightforward than the replication cluster you are dealing with. In my case the first server is simply the development environment and the second server is the production deployment server. The two environments use identical OS and Tomcat so I am baffled at why HttpSessionListener will only work on the server used for development. Thanks Randy -Original Message- From: Jacob Champlin [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 25, 2005 8:51 AM To: tomcat-user@jakarta.apache.org Subject: Re: HttpSessionListener Randy, I don't believe you have session replication set up in your cluster. This is why when a session is created it only calls your HttpSessionListener on one box. The second box will only get the session if its replicated over to that box. However! I tried to do the same thing and I was getting server lockups when it a cluster. The HttpSessionListener would work fine on a single box, but in a cluster both servers would lock up. It is my belief that there is some concurrency issue in Tomcat/Session Replication/HttpSessionListeners. However, I never found anything firm, as is usually the case with concurrency issues. Well I would love to hear if you get this working. Jacob Champlin EMO Corporation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DNS Request distribution and TCP NAT distribution For Tomcat Cluster
I was looking at the book, 'Tomcat: the definitive guide' last night, and the clustering chapter talked about load balancing via DNS Request distribution or TCP NAT distribution. Could someone explain these to me a little better in relation to Tomcat in a microsoft architecture? most of that book is based on Unix. My questions are as follows - mostly they are just clarification of the mechanism: 1) for DNS Request Distribution - I dont understand. The browser sends a URL to the DNS, the DNS responds back with an IP address. But what if at that IP address, you have a web server listening on port 80? If Tomcat is at that address also, Tomcat would have to listen on another port. Can the DNS distribute back to the browser the IP Address AND the Tomcat port so the browser connects to Tomcat on a non port 80 port? Also, is there a way to setup the DNS to Round Robin or check server load on the servers in the Tomcat cluster so it knows which Tomcat server ip:port to send back. OR does this whole thing imply that you have an IP for each web server (IIS), and each web server is tied to each server in the Tomcat cluster via a jk2 redirector? 2)TCP NAT distribution - Does this mean that when the browser connects to the IP address, that that connection is intercepted and the request is distributed to a server in the Tomcat cluster? If this is the case, then what does the interception? and how do you configure that thing to use a specific algorithm (server load, Round Robin, etc..) to choose which server to forward the request to? can it forward to an IP:PORT or does it have to forward to an IP John McClain Senior Software Engineer TCS Healthcare [EMAIL PROTECTED] (530)886-1700x235 Skepticism is the first step toward truth - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: HttpSessionListener
I suspect that the Listener class is not found on the production server. You should check your deployment. Are you deplyoing via WAR files in both cases? Randy George wrote: Hi Jacob, Thanks for the reply. My situation is a little more straightforward than the replication cluster you are dealing with. In my case the first server is simply the development environment and the second server is the production deployment server. The two environments use identical OS and Tomcat so I am baffled at why HttpSessionListener will only work on the server used for development. Thanks Randy -Original Message- From: Jacob Champlin [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 25, 2005 8:51 AM To: tomcat-user@jakarta.apache.org Subject: Re: HttpSessionListener Randy, I don't believe you have session replication set up in your cluster. This is why when a session is created it only calls your HttpSessionListener on one box. The second box will only get the session if its replicated over to that box. However! I tried to do the same thing and I was getting server lockups when it a cluster. The HttpSessionListener would work fine on a single box, but in a cluster both servers would lock up. It is my belief that there is some concurrency issue in Tomcat/Session Replication/HttpSessionListeners. However, I never found anything firm, as is usually the case with concurrency issues. Well I would love to hear if you get this working. Jacob Champlin EMO Corporation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: DNS Request distribution and TCP NAT distribution For Tomcat Cluster
From: John MccLain [mailto:[EMAIL PROTECTED] 1) for DNS Request Distribution - I dont understand. The browser sends a URL to the DNS, the DNS responds back with an IP address. But what if at that IP address, you have a web server listening on port 80? The browser talks to that Web server. If Tomcat is at that address also, Tomcat would have to listen on another port. Can the DNS distribute back to the browser the IP Address AND the Tomcat port so the browser connects to Tomcat on a non port 80 port? Only if your original URL uses the name:port notation - there is nothing in this scheme to prevent that. Also, is there a way to setup the DNS to Round Robin or check server load on the servers in the Tomcat cluster so it knows which Tomcat server ip:port to send back. No standard way afaik. Worse, downstream DNS servers may (often do) cache the returned IPs for up to a day despite any cache expiry you put on them. If (say) the AOL DNS servers all get the same IP address in their cache, all your AOL visitors will visit the same IP address. DNS is a very lumpy way of doing load balancing. OR does this whole thing imply that you have an IP for each web server (IIS) IP address yes; IIS depends on whether you want IIS or Tomcat at the business end of the cluster. and each web server is tied to each server in the Tomcat cluster via a jk2 redirector? If you wish to use that architecture, yes. 2)TCP NAT distribution - Does this mean that when the browser connects to the IP address, that that connection is intercepted and the request is distributed to a server in the Tomcat cluster? Yes. If this is the case, then what does the interception? Generically, a router that has this capability. It's that router that also does the NATing. Many mid- to high-end hardware routers and some software routing packages can do this. and how do you configure that thing to use a specific algorithm (server load, Round Robin, etc..) to choose which server to forward the request to? That is router-specific. There is no standard (afaik) for the servers to return load information, so you're stuck with proprietary solutions *or* the router doesn't load-balance. can it forward to an IP:PORT or does it have to forward to an IP That is router-specific. Given that the capability typically exists on mid- to high-end routers, most will also have the capability to change the internal port that is in use. - Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: IMPORTANT NEED Tomcat Connection advice
[EMAIL PROTECTED] wrote: Please, I need Advice for connections Hi guys. I need a technical advice using tomcat 5.0 Presently, tomcat server is used with JBOSS in a solution that I am developping for my clients. Users are connecting to the solution by invoking a servlet (runned by tomcat). If a user is auhentified, then I use HTTPServletResponse object (in the service method) to get the Outputstream of that object = HTTPServletResponse.getoutputstream) Then this stream will be use to handle communications between my client application and my custom Server Process (I need to send real time informations through this canal). Then you're messing it up. HTTP has no paradigm of a session, which is what you need here. HTTP has a very clear request/response model. It is not designed to hold the HTTP channel open indefinitely and will break off after a timeout. Timeout is configurable both on client and server sides. So, you can easily get server timeout or client timeout on the connection. And that is definitely not good for a realtime application :-) Even if you consider using HTTP/1.1 and Keep-Alive option, it will not help you, since it holds the TCP channel open, but request and rsponse may still timeout. Important = A client session can last several hours, so the life of the servlet is set to time infinite. Then you're definitely looking for some session oriented protocol, be it your own or something existing, like SSH (not your case), a generic SSL channel (if you need encryption) or something you build. In fact I had the idea delegate socket connection managment, to tomcat engine, by setting servlet life time to infinite. Is it a good way to do, or should I use a socket pooling algorithm (actualy, the server can freeze, after unregular amout of times, time for writing operation in the Output stream can increase until being totaly unusuable, I have to close, and reconnect) The objective is to handle more than 1000 client sessions. Please, i need a quick answer . Thank you for your help. Use servlets what they are intended for, please. Even if you succeed, somehow, you'll be writing most of the low-level code anyway, so why not go for a clean solution - one that you can control and configure yourself. Nix. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: HttpSessionListener
From: Christoph Kutzinski [EMAIL PROTECTED] Sent: Wednesday, May 25, 2005 9:04 AM I suspect that the Listener class is not found on the production server. You should check your deployment. Are you deplyoing via WAR files in both cases? Yea, I would make sure that your listener is even being instantiated. Tomcat is pretty quiet with things like Listners, it doens't write error or output where you typically see it for you application. Check all of your logs to make sure the class is loading and starting up correctly. Regards, Will Hartung ([EMAIL PROTECTED]) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: DNS Request distribution and TCP NAT distribution For Tomcat Cluster
Peter, I agree that DNS is a very lumpy way of doing load balancing. But your comments interested me. Can I ask how sure you felt of what you say here please: No standard way afaik. Worse, downstream DNS servers may (often do) cache the returned IPs for up to a day despite any cache expiry you put on them. If (say) the AOL DNS servers all get the same IP address in their cache, all your AOL visitors will visit the same IP address. I'm not for a minute suggesting that it is wrong :) and wouldn't dream of doing so, because I don't know all the facts myself. I tried to research it but could not get to the bottom of it with any real info from ISPs (the problem is that they seem to do their own thing to various extents). I'm just interested in comparing experiences/opinions. I have set up roundrobin DNS for an ecommerce site in the past without any complaints from users, and the balance of load between a pair of clustered servers seemed pretty even. I would expect any DNS server run by an ISP (such as AOL) to receive the zone records from SOA intact, i.e. these major dns servers should know about all rr Ips for a given dns name, and would therefore be able to RR distribute them to lower-tier DNS servers. I would have thought that the level at which DNS servers do not pick up the fact that there is a RR DNS entry is where they do not do a zone transfer from a primary DNS server - they simply act as a client and cache what they get as a response, so they are unaware that there even are more than one IP. I'm speculating that these minor DNS servers belong to small ISPs, or private companies running their own DNS in-house? So overall I guess I'm saying I'd be surprised if AOL's DNS servers only cached one entry of a RR set for a DNS name. What are your thoughts? -Original Message- From: Peter Crowther [mailto:[EMAIL PROTECTED] Sent: Wednesday 25 May 2005 17:15 To: Tomcat Users List; [EMAIL PROTECTED] Subject: RE: DNS Request distribution and TCP NAT distribution For Tomcat Cluster From: John MccLain [mailto:[EMAIL PROTECTED] 1) for DNS Request Distribution - I dont understand. The browser sends a URL to the DNS, the DNS responds back with an IP address. But what if at that IP address, you have a web server listening on port 80? The browser talks to that Web server. If Tomcat is at that address also, Tomcat would have to listen on another port. Can the DNS distribute back to the browser the IP Address AND the Tomcat port so the browser connects to Tomcat on a non port 80 port? Only if your original URL uses the name:port notation - there is nothing in this scheme to prevent that. Also, is there a way to setup the DNS to Round Robin or check server load on the servers in the Tomcat cluster so it knows which Tomcat server ip:port to send back. No standard way afaik. Worse, downstream DNS servers may (often do) cache the returned IPs for up to a day despite any cache expiry you put on them. If (say) the AOL DNS servers all get the same IP address in their cache, all your AOL visitors will visit the same IP address. DNS is a very lumpy way of doing load balancing. OR does this whole thing imply that you have an IP for each web server (IIS) IP address yes; IIS depends on whether you want IIS or Tomcat at the business end of the cluster. and each web server is tied to each server in the Tomcat cluster via a jk2 redirector? If you wish to use that architecture, yes. 2)TCP NAT distribution - Does this mean that when the browser connects to the IP address, that that connection is intercepted and the request is distributed to a server in the Tomcat cluster? Yes. If this is the case, then what does the interception? Generically, a router that has this capability. It's that router that also does the NATing. Many mid- to high-end hardware routers and some software routing packages can do this. and how do you configure that thing to use a specific algorithm (server load, Round Robin, etc..) to choose which server to forward the request to? That is router-specific. There is no standard (afaik) for the servers to return load information, so you're stuck with proprietary solutions *or* the router doesn't load-balance. can it forward to an IP:PORT or does it have to forward to an IP That is router-specific. Given that the capability typically exists on mid- to high-end routers, most will also have the capability to change the internal port that is in use. - Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: log files with servlets ?
If you don't want to mess with your server.xml file, or you're a mere user and can't, you can do it easily with Apache log4j. Create the following file, log4j.properties and put it in your WEB-INF/classes directory. This will create a log file in /var/tmp named logtags.log. The docs for log4j are at http://logging.apache.org/log4j/docs/ # Sample properties to initialise log4j log4j.rootCategory=debug, logfile log4j.appender.logfile=org.apache.log4j.RollingFileAppender log4j.appender.logfile.File=/var/tmp/logtags.log log4j.appender.logfile.MaxFileSize=100KB log4j.appender.logfile.MaxBackupIndex=2 log4j.appender.logfile.layout=org.apache.log4j.PatternLayout log4j.appender.logfile.layout.ConversionPattern=%p %t %c - %m%n - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: IMPORTANT NEED Tomcat Connection advice
Nikola Milutinovic wrote: [EMAIL PROTECTED] wrote: Then you're messing it up. HTTP has no paradigm of a session, which is what you need here. HTTP has a very clear request/response model. It is not designed to hold the HTTP channel open indefinitely and will break off after a timeout. Timeout is configurable both on client and server sides. So, you can easily get server timeout or client timeout on the connection. And that is definitely not good for a realtime application :-) Sure all that is in place, but OTOH the http keep-alive connection *can* be opened for several hours or days. HTTP/1.1 uses persistent connections by default and you must explicitly add the 'Connection: close' in the header. Without that, things like internet radio for example would be a pure wish :) Regards, Mladen. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: IMPORTANT NEED Tomcat Connection advice
On 5/25/05, Mladen Turk [EMAIL PROTECTED] wrote: Nikola Milutinovic wrote: [EMAIL PROTECTED] wrote: Then you're messing it up. HTTP has no paradigm of a session, which is what you need here. HTTP has a very clear request/response model. It is not designed to hold the HTTP channel open indefinitely and will break off after a timeout. Timeout is configurable both on client and server sides. So, you can easily get server timeout or client timeout on the connection. And that is definitely not good for a realtime application :-) Sure all that is in place, but OTOH the http keep-alive connection *can* be opened for several hours or days. HTTP/1.1 uses persistent connections by default and you must explicitly add the 'Connection: close' in the header. Without that, things like internet radio for example would be a pure wish :) Do internet radio and the like actually use the HTTP protocol though? I'm by no means an expert but I would have expected them to use their own protocol to handle the streaming? -- Jason Bainbridge http://kde.org - [EMAIL PROTECTED] Personal Site - http://jasonbainbridge.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: HttpSessionListener
Hi Will and Christopher, Good thought. I shut down Tomcat and started it again with a clean set of logs: localhost.2005-05-25.log . . May 25, 2005 11:22:17 AM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: contextInitialized() May 25, 2005 11:27:45 AM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: sessionCreated('BD963D7E6AACE0E2387F37919BB277FC') I interpret this to show that the listener element in web.xml is initialized and later a sessionCeated() method was actually called: . . public synchronized void sessionCreated (HttpSessionEvent se) { System.out.println(sessionCreated +sessionCount); sessionCount++; } However, there is no entry in the stout log so whatever sessionCreated method is called it is not the one registered? listener listener-classcom.test.SessionCounter/listener-class /listener I also just noticed that the Tomcat WebApp Manager is showing only 0's for sessions regardless of how many sessions are started? Thanks Randy -Original Message- From: Will Hartung [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 25, 2005 10:46 AM To: Tomcat Users List Subject: Re: HttpSessionListener From: Christoph Kutzinski [EMAIL PROTECTED] Sent: Wednesday, May 25, 2005 9:04 AM I suspect that the Listener class is not found on the production server. You should check your deployment. Are you deplyoing via WAR files in both cases? Yea, I would make sure that your listener is even being instantiated. Tomcat is pretty quiet with things like Listners, it doens't write error or output where you typically see it for you application. Check all of your logs to make sure the class is loading and starting up correctly. Regards, Will Hartung ([EMAIL PROTECTED]) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: HttpSessionListener
Hi Will and Christopher, Good thought. I shut down Tomcat and started it again with a clean set of logs: localhost.2005-05-25.log . . May 25, 2005 11:22:17 AM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: contextInitialized() May 25, 2005 11:27:45 AM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: sessionCreated('BD963D7E6AACE0E2387F37919BB277FC') I interpret this to show that the listener element in web.xml is initialized and later a sessionCeated() method was actually called: . . public synchronized void sessionCreated (HttpSessionEvent se) { System.out.println(sessionCreated +sessionCount); sessionCount++; } However, there is no entry in the stout log so whatever sessionCreated method is called it is not the one registered? listener listener-classcom.test.SessionCounter/listener-class /listener I also just noticed that the Tomcat WebApp Manager is showing only 0's for sessions regardless of how many sessions are started? Thanks Randy -Original Message- From: Will Hartung [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 25, 2005 10:46 AM To: Tomcat Users List Subject: Re: HttpSessionListener From: Christoph Kutzinski [EMAIL PROTECTED] Sent: Wednesday, May 25, 2005 9:04 AM I suspect that the Listener class is not found on the production server. You should check your deployment. Are you deplyoing via WAR files in both cases? Yea, I would make sure that your listener is even being instantiated. Tomcat is pretty quiet with things like Listners, it doens't write error or output where you typically see it for you application. Check all of your logs to make sure the class is loading and starting up correctly. Regards, Will Hartung ([EMAIL PROTECTED]) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JAAS LoginModule weird error
Might be related to bug 22617 (which has been fixed in CVS). Mark Faine, Mark wrote: I've written a JAAS Login Module for my web application that authenticates against a third party (Documentum) content management server. It works fine but it seems to attempt to login once before the dialog is even presented to the user. The logs show: DfPrincipalException:: THREAD: http-443-Processor13; MSG: [DM_API_E_NOUSERNAME]error: No user name have been provided for a connection. ... (more authentication failed messages from LoginModule code) ... Yet I haven't even tried to login yet. I am able to login successfully after this error but it still bothers me that something is causing it to attempt a login before it even presents the dialog. Any suggestion, solutions would be appreciated. -Mark - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Mysterious failures
--- Grant Ingersoll [EMAIL PROTECTED] wrote: Thanks for the ideas. I cranked my debugging up to 99. There are a couple of things that I see, but don't know if they are serious: 1. SEVERE: The scratchDir you specified: /development/jakarta-tomcat-5.0.28/work/Catalina/localhost/admin is unusable. -- I never set this, I am assuming it is the default This is normally the work directory for the admin application. Are you trying to replace this application, or could there be a context problem? 2. WARNING: Duplicate name in Manifest: Class-Path -- I think this is due to some JAR in struts I will have to load and launch a Struts application to check on this. I don't recall seeing this recently. 3. In the apache log I get warnings about compiling mod_jk with EAPI on EAPI compilation is for a module compiled for Apache 1.3 and supporting SSL. Are you using Apache 1.3 or 2.0? From the error message below, it sounds like you are trying to run a 1.3 module on a 2.0 server. This won't be successful. Either download and compile the source, or get the binary release for apache 2.0.47. I am mapping through mod_jk, so the error I get is the Apache Internal Server Error. The Tomcat process is dead, so there is no tomcat error page. Hope this helps /mde/ __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: IMPORTANT NEED Tomcat Connection advice
From: Mladen Turk [EMAIL PROTECTED] Sent: Wednesday, May 25, 2005 10:08 AM Sure all that is in place, but OTOH the http keep-alive connection *can* be opened for several hours or days. HTTP/1.1 uses persistent connections by default and you must explicitly add the 'Connection: close' in the header. Without that, things like internet radio for example would be a pure wish :) Keep-Alive is for essentially reusing a connection, but even for something like internet radio, you don't need keep-alive. Typically, transactions time out because there's no activity, not simply because they're open a long time. Simple, most basic example is downloading a large file over HTTP using a slow connection. The basics of the protocol are that you send the length, and then the body. The client reads that and start sucking on the socket. There are other aspects of the HTTP protocol that let you get pieces of files (so called chunking), and you CAN use those kinds of things, but you don't have too. You simply have to deal with the issues is you lose your connection. If you don't use the more advanced parts of the protocol, you simply start over with: GET /hugefile.zip HTTP/1.0 But the fact of the matter is that you really shouldn't be using the Servlet API for lower level protocols. You really shouldn't be having a servlet sitting on a socket and feeding it back underneath HTTP. HTTP isn't really a connection protocol, it's a higher level transfer protocol. There are other frameworks that are better suited to implementing lower level protocols and customer socket listeners and handlers and what not for Java. It's a shame, really, because we DO have Servlets AND HttpServlets, as a subclass, implying that you can have other protocols than HTTP, but truth is a lot of assumptions that just happen to fit HTTP bubbled up into the Servlet part of the spec, and not just within the HTTP part of the Servlet spec. For example, you couldn't easily implement FTP on top of a Servlet container. But poke around Jakarta, they have frameworks to make it easier to write socket server application, rather than just HTTP based server applicatons. Conecptually you could do this in tomcat, but it's kind of off the main path of what Tomcat does. Regards, Will Hartung ([EMAIL PROTECTED]) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ConcurrentModificationException in 5.0.27
We discovered what appears to be a bug regarding a ConcurrentModificationException Tomcat 5.0.27. The problem arises when two web apps are deployed that are trying to interact with each other in some way. The exception isn't thrown when one of the web apps is taken out of the loop. Here is the relevant error: May 25, 2005 2:41:01 PM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=10/131 config=C:\Program Files\Apache Software Foundation\Tomcat 5.0\conf\jk2.properties May 25, 2005 2:41:02 PM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8441 May 25, 2005 2:41:02 PM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8080 May 25, 2005 2:41:02 PM org.apache.coyote.tomcat5.MapperListener init WARNING: Error registering contexts java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextEntry(Unknown Source) at java.util.HashMap$EntryIterator.next(Unknown Source) at java.util.HashMap.putAllForCreate(Unknown Source) at java.util.HashMap.clone(Unknown Source) at mx4j.server.DefaultMBeanRepository.clone(DefaultMBeanRepository.java:56) at mx4j.server.MBeanServerImpl.findMBeansByPattern(MBeanServerImpl.java:1603) at mx4j.server.MBeanServerImpl.queryObjectNames(MBeanServerImpl.java:1568) at mx4j.server.MBeanServerImpl.queryMBeans(MBeanServerImpl.java:1512) at org.apache.coyote.tomcat5.MapperListener.init(MapperListener.java:115) at org.apache.coyote.tomcat5.CoyoteConnector.start(CoyoteConnector.java:1537) at org.apache.catalina.core.StandardService.start(StandardService.java:489) at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313) at org.apache.catalina.startup.Catalina.start(Catalina.java:556) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:284) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:422) May 25, 2005 2:41:02 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 37674 ms Regards, Ryan
Tomcat/Personal Web Server Problem
I had both Tomcat 4.1 and Microsoft Personal Web Server installed on my laptop ( an IBM Thinkpad - Windows NT operating system). It had been several months since I used Tomcat. When I started the Tomcat server and typed in localhost:8080 in the Internet Explorer address window, it brought me to Personal Web Server rather than bringing up the Tomcat page. I then decided to uninstall both Personal Web Server and the Java Web Services Developers Pack. But after reinstalling the latter, I am getting a page not found condition. (Details are below). On the advice of someone at a technical forum, I started Tomcat (Start/Programs/Java Web Services Developer Pack 1.1/Start Tomcat) and then checked Start/Programs/Administrative Tools/Windows NT Diagnostics/Services It had: JavaWebServer Stopped although the services log file (and all other log files) under jwsdp-1_1 indicated Tomcat was running If anyone can help, I'd really appreciate it. Robin Type in Address Window: http://localhost:8080 Error message: Page cannot be displayed The page you are looking for is currently unavailable In Internet Explorer Above Address Window: res://C:\WINNT\System32\shdoclc.dll/dnserror.htm#http://localhost:8080/
Re: Tomcat/Personal Web Server Problem
On 5/25/05, Robin Rembish [EMAIL PROTECTED] wrote: I had both Tomcat 4.1 and Microsoft Personal Web Server installed on my laptop ( an IBM Thinkpad - Windows NT operating system). It had been several months since I used Tomcat. When I started the Tomcat server and typed in localhost:8080 in the Internet Explorer address window, it brought me to Personal Web Server rather than bringing up the Tomcat page. I then decided to uninstall both Personal Web Server and the Java Web Services Developers Pack. But after reinstalling the latter, I am getting a page not found condition. (Details are below). Is there any reason you need to use that bizarre setup and can't just download the vanilla windows installer for Tomcat? It would save you a lot of grief if you could do that... -- Jason Bainbridge http://kde.org - [EMAIL PROTECTED] Personal Site - http://jasonbainbridge.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Building mod_jk from source Apache2.0.52/Tomcat5.5.9/Solaris8 - aspx issues
In my staging environment I am attempting to create a mod_jk connector (1.2.13) between Apache 2.0.52 and Tomcat 5.5.9 on a Solaris8 box. The system is spitting out Errors with the apxs file. rc=65536. Are there any known issues around this? Also, I am using JDK 1.4.2_08 Are there any known solutions to fix this issue within this environment? Thanks a lot, -u This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.
Re: Mysterious failures
On May 25, 2005, at 3:32 PM, Mark Eggers wrote: --- Grant Ingersoll [EMAIL PROTECTED] wrote: Thanks for the ideas. I cranked my debugging up to 99. There are a couple of things that I see, but don't know if they are serious: 1. SEVERE: The scratchDir you specified: /development/jakarta-tomcat-5.0.28/work/Catalina/localhost/admin is unusable. -- I never set this, I am assuming it is the default This is normally the work directory for the admin application. Are you trying to replace this application, or could there be a context problem? No, just restarting Tomcat 2. WARNING: Duplicate name in Manifest: Class-Path -- I think this is due to some JAR in struts I will have to load and launch a Struts application to check on this. I don't recall seeing this recently. 3. In the apache log I get warnings about compiling mod_jk with EAPI on EAPI compilation is for a module compiled for Apache 1.3 and supporting SSL. Are you using Apache 1.3 or 2.0? From the error message below, it sounds like you are trying to run a 1.3 module on a 2.0 server. This won't be successful. 1.3 or Apache on OS X and Tomcat 5.0.28. Should I upgrade? I have had it fail even when Apache isn't running. Either download and compile the source, or get the binary release for apache 2.0.47. I am mapping through mod_jk, so the error I get is the Apache Internal Server Error. The Tomcat process is dead, so there is no tomcat error page. Hope this helps /mde/ __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Force Non-SSL
In my webapp I force clients to use SSL encryption for logins with a security constraint and transport-guarantee elements like this: security-constraint web-resource-collection web-resource-nameLogin/web-resource-name url-pattern/login/*/url-pattern /web-resource-collection user-data-constraint transport-guaranteeCONFIDENTIAL/transport-guarantee /user-data-constraint /security-constraint However, once a user hits the login page, every subsequent page also uses https. Is there a way to force them back to regular http once they leave the login section? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Force Non-SSL
no -Tim August Detlefsen wrote: In my webapp I force clients to use SSL encryption for logins with a security constraint and transport-guarantee elements like this: security-constraint web-resource-collection web-resource-nameLogin/web-resource-name url-pattern/login/*/url-pattern /web-resource-collection user-data-constraint transport-guaranteeCONFIDENTIAL/transport-guarantee /user-data-constraint /security-constraint However, once a user hits the login page, every subsequent page also uses https. Is there a way to force them back to regular http once they leave the login section? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Force Non-SSL
Is there no way to do it? SSL creates a lot of overhead for a site that is serving up 100MB image files. --- Tim Funk [EMAIL PROTECTED] wrote: no -Tim August Detlefsen wrote: In my webapp I force clients to use SSL encryption for logins with a security constraint and transport-guarantee elements like this: security-constraint web-resource-collection web-resource-nameLogin/web-resource-name url-pattern/login/*/url-pattern /web-resource-collection user-data-constraint transport-guaranteeCONFIDENTIAL/transport-guarantee /user-data-constraint /security-constraint However, once a user hits the login page, every subsequent page also uses https. Is there a way to force them back to regular http once they leave the login section? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Prevent the Default Servlet from piggybacking data
Greetings all, I have attempted to scour the list for this problem, but I haven't been able to find it. This is a special case where I need Tomcat to serve MIDlets. When a handset downloads a JAD file, it processes the file and locates the corresponding JAR file. It will then proceed to download the JAR file. I am using a servlet to serve the JAR files, which seems to work. My problem is getting the Default servlet to properly serve the JAR files. I have performed some captures of the packets running through and came to this possibility: Apache and Weblogic do not piggyback the data in the HTTP 200 OK packet while Tomcat does. So my question is: Is it possible to control how the Default Servlet returns data, is there another servlet, or can a filter be created to prevent data from being piggybacked into the response? Or is there a header one can use? From weblogic: Hypertext Transfer Protocol HTTP/1.1 200 OK\r\n Date: Wed, 25 May 2005 23:12:39 GMT\r\n Pragma: no-cache\r\n Server: WebLogic Server 7.0 SP4 Tue Aug 12 11:22:26 PDT 2003 284033 \r\n Content-Length: 76816\r\n Content-Type: application/java-archive\r\n Expires: Thu, 01 Jan 1970 00:00:00 GMT\r\n Cache-Control: no-cache, no-transform, must-revalidate\r\n \r\n - From Tomcat: Hypertext Transfer Protocol HTTP/1.1 200 OK\r\n Date: Tue, 24 May 2005 19:29:06 GMT\r\n Server: Apache\r\n Cache-Control: no transform, no cache\r\n ETag: W/151920-1116513093000\r\n Last-Modified: Thu, 19 May 2005 14:31:33 GMT\r\n Content-Type: application/java-archive\r\n Content-Length: 151920\r\n \r\n Media Type: application/java-archive (1207 bytes) - Notice that Tomcat uses this to append the JAR file. The Server: Apache line is included because I'm using mod_jk2 Thanks all!
html:errors/ blank page on invalid form
Hi All, I'm unable to output any errors using html:errors/ tag, in Tomcat 5.5.7 I've tried numerous configurations and have now ran out of patience. As I haven't been using Struts for more than three days I hope somebody more experienced can point help me out. When I select Submit, entering data into my form fields so the form is parsed as valid, the forward works correctly. When I leave the fields empty, so the form is parsed as invalid, I just get an empty page back - which must be generated by Struts as it doesn't match any HTML I have. Here is what I have in various files - logon.jsp - %@ page contentType=text/html;charset=UTF-8 language=java % %@ taglib uri=/tags/struts-bean prefix=bean % %@ taglib uri=/tags/struts-html prefix=html % html head titlebean:message key=logon.title//title /head body html:errors/ html:form action=/SubmitLogonForm.do table tr tdUsername/td tdhtml:text property=username//td /tr tr tdPassword/td tdhtml:text property=password//td /tr tr td html:submit/ html:cancel/ /td td/td /tr /table /html:form /body In LogonAction.java - public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { if (isCancelled(request)) { log.debug(cancel pressed); return mapping.findForward(Constants.FAILURE); } LogonForm logonForm = (LogonForm)form; log.debug(username +logonForm.getUsername()); log.debug(password +logonForm.getPassword()); return mapping.findForward(Constants.SUCCESS); } In LogonForm.java (I have getters/setters for HTML fields, and a reset method, not shown) - public ActionErrors validate(ActionMapping actionMapping, HttpServletRequest httpServletRequest) { log.debug(validate); ActionErrors errors = new ActionErrors(); if (FormUtils.isNullOrEmpty(httpServletRequest.getParameter(username))) { log.debug(logon.form.username.invalid); errors.add(ActionErrors.GLOBAL_MESSAGE,new ActionMessage(logon.form.username.invalid)); } if (FormUtils.isNullOrEmpty(httpServletRequest.getParameter(password))) { log.debug(logon.form.password.invalid); errors.add(ActionErrors.GLOBAL_MESSAGE,new ActionMessage(logon.form.password.invalid)); } return errors.isEmpty() ? null : errors; } Two tags of interest from struts-config.xml - !-- Process a user logon -- action path=/SubmitLogonForm type=template.action.LogonAction name=LogonForm scope=request input=/logon.jsp forward name=success path=/welcome.jsp / /action !-- Logon form -- form-bean name=LogonForm type=template.form.LogonForm/ ApplicationResources.properties - Note this is found and read by Tomcat, I can pull values from it using bean:message - the errors.head and prefix are not displayed however, so clearly no error messages are being generated at all. index.heading=Index Page Heading index.logon=Logon index.register=New User # struts.logo.path=/struts-power.gif struts.logo.alt=Powered by Struts # form fields logon.form.username.invalid=Username invalid logon.form.password.invalid=Password invalid # page titles error.title=Error Title logoff.title=Logoff Title logon.title=Logon Title register.title=Register Title welcome.title=Welcome Title # errors.header=Errors errors.prefix=Error prefix Well it's 2AM here in London, so here's hoping for an answer when I get up later today ! TIA, Andy. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
sign Files using Aladdin's eToken USB Pro
i had configured tomcat to use secure connections (https), and i've included the root certificated from my CA in the cacerts file from JAVA_HOME. so, i've also installed the drivers from my eToken, and when i load my page with https, the certificated stored in my eToken is shown. when i choose it. it ask me for the password, and after i put it, the servlet in the other side sees the certificate without problems the question is, how do i use or obtain the private key stored in the eToken?? here is the code that i'm using XMLSignature sig = *new* XMLSignature(XMLDoc, BaseURI, XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA1 ); NodeList nl = XMLDoc.getElementsByTagName(Content); *if* (nl.getLength() 1) { System.out.println(firmar::no hay nodo Content??); *return* *false*; } (nl.item(0)).appendChild(sig.getElement()); { String Id = S + (firmantes.size() + 1); Transforms transforms = *new* Transforms(XMLDoc); transforms.addTransform(Transforms.TRANSFORM_C14N_OMIT_COMMENTS); sig.addDocument(BaseURI, transforms, Constants.ALGO_ID_DIGEST_SHA1); sig.setId(Id); } sig.addKeyInfo(cert); sig.addKeyInfo(cert.getPublicKey()); System.out.println(Start signing); sig.sign(privateKey); System.out.println(Finished signing); -- Nada es imposible, hasta que se demuestre lo contrario - yo
Re: Force Non-SSL
Since there is no way to maintain the session without hacking Tomcat, as Tim said no. But what you could try is a single use password. User hits the SSL encrypted login page. User authenticates with normal username and password. Random string password is created and stored in database and put in query string. User then is redirected to the unencrypted jsp login page that pulls the password from the request query string and inserts it into the form. The page does a submit on load. (JavaScript onload in the body tag) Once the user is logged in the password would need deleted from the database and replaced with normal password. So the user logs in with the normal password. It is the swapped for the single use password. Once logged in with the single use password it is replaced with the normal password. Now the question is how bad did you want this? And no I have not done this, so it is all theory at this point. Doug - Original Message - From: August Detlefsen [EMAIL PROTECTED] To: Tomcat Users List tomcat-user@jakarta.apache.org Sent: Wednesday, May 25, 2005 8:43 PM Subject: Re: Force Non-SSL Is there no way to do it? SSL creates a lot of overhead for a site that is serving up 100MB image files. --- Tim Funk [EMAIL PROTECTED] wrote: no -Tim August Detlefsen wrote: In my webapp I force clients to use SSL encryption for logins with a security constraint and transport-guarantee elements like this: security-constraint web-resource-collection web-resource-nameLogin/web-resource-name url-pattern/login/*/url-pattern /web-resource-collection user-data-constraint transport-guaranteeCONFIDENTIAL/transport-guarantee /user-data-constraint /security-constraint However, once a user hits the login page, every subsequent page also uses https. Is there a way to force them back to regular http once they leave the login section? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: apache2 + mod_jk + tomcat 4.1.31 - jkstatus
Increase MaxThread in server.xml file Regards, Praveen Soni STMicroelectronics Pvt Ltd. Arnar Gestsson wrote, On 05/25/2005 02:45 PM: Hi all, I've installation of apache2, mod_jk and tomcat4.1.31 where the apache is serving port 80, and 5 vhost are directing jsp/servlet requests to 5 separate workers. I'm entering into bottlenecks where one of the workers issues, threadpool full. I've had problems debugging the situation and am seeking advice on how to determine the state of the workers. When using mod_jk2, jkstatus could be used but what is equivalent for mod_jk? BR. Arnar Arnar Gestsson, MSc Trackwell Software - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:errors/ blank page on invalid form
Look for an exception in the logs. Empty output usually means an uncaught exception. --David Andy wrote: Hi All, I'm unable to output any errors using html:errors/ tag, in Tomcat 5.5.7 I've tried numerous configurations and have now ran out of patience. As I haven't been using Struts for more than three days I hope somebody more experienced can point help me out. When I select Submit, entering data into my form fields so the form is parsed as valid, the forward works correctly. When I leave the fields empty, so the form is parsed as invalid, I just get an empty page back - which must be generated by Struts as it doesn't match any HTML I have. Here is what I have in various files - logon.jsp - %@ page contentType=text/html;charset=UTF-8 language=java % %@ taglib uri=/tags/struts-bean prefix=bean % %@ taglib uri=/tags/struts-html prefix=html % html head titlebean:message key=logon.title//title /head body html:errors/ html:form action=/SubmitLogonForm.do table tr tdUsername/td tdhtml:text property=username//td /tr tr tdPassword/td tdhtml:text property=password//td /tr tr td html:submit/ html:cancel/ /td td/td /tr /table /html:form /body In LogonAction.java - public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { if (isCancelled(request)) { log.debug(cancel pressed); return mapping.findForward(Constants.FAILURE); } LogonForm logonForm = (LogonForm)form; log.debug(username +logonForm.getUsername()); log.debug(password +logonForm.getPassword()); return mapping.findForward(Constants.SUCCESS); } In LogonForm.java (I have getters/setters for HTML fields, and a reset method, not shown) - public ActionErrors validate(ActionMapping actionMapping, HttpServletRequest httpServletRequest) { log.debug(validate); ActionErrors errors = new ActionErrors(); if (FormUtils.isNullOrEmpty(httpServletRequest.getParameter(username))) { log.debug(logon.form.username.invalid); errors.add(ActionErrors.GLOBAL_MESSAGE,new ActionMessage(logon.form.username.invalid)); } if (FormUtils.isNullOrEmpty(httpServletRequest.getParameter(password))) { log.debug(logon.form.password.invalid); errors.add(ActionErrors.GLOBAL_MESSAGE,new ActionMessage(logon.form.password.invalid)); } return errors.isEmpty() ? null : errors; } Two tags of interest from struts-config.xml - !-- Process a user logon -- action path=/SubmitLogonForm type=template.action.LogonAction name=LogonForm scope=request input=/logon.jsp forward name=success path=/welcome.jsp / /action !-- Logon form -- form-bean name=LogonForm type=template.form.LogonForm/ ApplicationResources.properties - Note this is found and read by Tomcat, I can pull values from it using bean:message - the errors.head and prefix are not displayed however, so clearly no error messages are being generated at all. index.heading=Index Page Heading index.logon=Logon index.register=New User # struts.logo.path=/struts-power.gif struts.logo.alt=Powered by Struts # form fields logon.form.username.invalid=Username invalid logon.form.password.invalid=Password invalid # page titles error.title=Error Title logoff.title=Logoff Title logon.title=Logon Title register.title=Register Title welcome.title=Welcome Title # errors.header=Errors errors.prefix=Error prefix Well it's 2AM here in London, so here's hoping for an answer when I get up later today ! TIA, Andy. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Force Non-SSL
August Detlefsen wrote: Is there no way to do it? SSL creates a lot of overhead for a site that is serving up 100MB image files. There are ugly or less ugly workarounds, like the one yahoo uses. Login can go against HTTPS, sets up it's version of session and then redirects the user to HTTP. There the server will pickup the user via a cookie or a URL containing yahoo's session. From there on, yahoo can use any session mechanism it likes. This, of course cannot be coupled with HTTP AUTH Basic. It is outside of that spec. Nix. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:errors/ blank page on invalid form
Andy wrote: Hi All, I'm unable to output any errors using html:errors/ tag, in Tomcat 5.5.7 I've tried numerous configurations and have now ran out of patience. As I haven't been using Struts for more than three days I hope somebody more experienced can point help me out. When I select Submit, entering data into my form fields so the form is parsed as valid, the forward works correctly. When I leave the fields empty, so the form is parsed as invalid, I just get an empty page back - which must be generated by Struts as it doesn't match any HTML I have. Check out the logs, you could be running into an exception. Also, set buffer size of 20kb on all your pages, while you're testing. Empty output can also be caused by an exception in the page itself, and buffer being already sent. Here is what I have in various files - logon.jsp - %@ page contentType=text/html;charset=UTF-8 language=java % %@ taglib uri=/tags/struts-bean prefix=bean % %@ taglib uri=/tags/struts-html prefix=html % html head titlebean:message key=logon.title//title /head body html:errors/ html:form action=/SubmitLogonForm.do table tr tdUsername/td tdhtml:text property=username//td /tr tr tdPassword/td tdhtml:text property=password//td /tr tr td html:submit/ html:cancel/ /td td/td /tr /table /html:form /body Looks fine, except for the buffer page directive. In LogonAction.java - public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { if (isCancelled(request)) { log.debug(cancel pressed); return mapping.findForward(Constants.FAILURE); } Why would you consider Cancel a failure? Not that it will not work, but... LogonForm logonForm = (LogonForm)form; log.debug(username +logonForm.getUsername()); log.debug(password +logonForm.getPassword()); return mapping.findForward(Constants.SUCCESS); } You're not checking the login, but that's fine for a test. In LogonForm.java (I have getters/setters for HTML fields, and a reset method, not shown) - public ActionErrors validate(ActionMapping actionMapping, HttpServletRequest httpServletRequest) { log.debug(validate); ActionErrors errors = new ActionErrors(); if (FormUtils.isNullOrEmpty(httpServletRequest.getParameter(username))) { log.debug(logon.form.username.invalid); errors.add(ActionErrors.GLOBAL_MESSAGE,new ActionMessage(logon.form.username.invalid)); } You don't need to use GLOBAL_MESSAGE, that is wrong, I think. And use errors, not messages. My validation would read: errors.add( username, new ActionError( logon.form.username.invalid)); Nix. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]