How to do some work when a webapp is first loaded
Hi! Perhaps one of the gurus could space a few minutes... I have worked with tomcat quite a bit, but never had to do anythings like this before: I need to do some work (basically get some data from a db and set up a scheduler) once and immediately when my webapp is deployed or redeployed (ideally even before requests to it get served). Is there a neat way to do this? Any clued would be very appreciated. Thanks in advance, Philipp Taprogge - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to do some work when a webapp is first loaded
Hi and thanks for the quick replies. QM wrote: -or you could search the archives. ;) Your question comes up regularly. Yes, I should have. I am sorry. I did not imagine my problem was that common... For Tomcat 4.x and later, investigate the ContextListener class. Looks exactly like what I was missing. The app will run in tc5, so no problems there. Thanks again everyone, Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Beginner for Apache Tomcat: Need Help
Hi! TK wrote: 1. Can I install and run Apache and Tomcat on the same machine? Or, at the first place, do I need to do so if Tomcat alone can be used as a Web server? Yes, you can and no, you don't have to if your setup does not require it. Often sites use apache for serving static content (due to it's superior performance and security concerns) and let it pass requests to jsps to a tomcat. 2. If I install both of them on the same machine, how do I differentiate the host names? Does http://127.0.0.1/ refers to the Apache or Tomcat server? You might want to familiarize yourself with tcp/ip networking basics. For short, each application running on a host that wants to talk ip allocates a port on that host. You access different ports by appending the port number to the hostname separated by a colon: http://localhost:8080/ In a common setup with apache and tomcat, apache binds port 80 (the standard HTTP port) and passes along jsp requests to tomcat by talking to it on another port, on which tomcat listens. 3. How could I create a virtual link to point from the root directory to another directory located at the other machine or the other disk drive? I am not entirely sure I understand what you mean. In general, all requests go to the apache first and it decides which of them to server from where. If the requests call servlets or jsps, apache just forwards the request to tomcat to serve as it sees fit. 6. Can I used JSP to access MS Access database? If not, what is the recommended DBMS to be used, both in Windows and Linux environments? Since jsps and servlets are (basically) java programs, they can access any database for which a jdbc driver exists. If there is one for access (which is not a DBMS system really...) I do not know. I would not however recommend using access in a live environment. Use a real RDBMS like MySQL, postgresql (if you want OSS) or MS SQL Server, Oracle and the like (if you want commercially supported software). HTH Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Ant and Tomcat Manager over HTTPS
Hi! Harry Mantheakis wrote: Does anyone know if it is possible to use the Tomcat Manager tasks in Ant over HTTPS? snip Now I am running my own server, and I have got to bite this bullet. Any pointers would be much appreciated! Firstly, it would be nice if you could start your own thread next time instead of highjacking an existing one with your question. As for your problem: is SSL not working altogether or is it just ant complaining? Can you access the manager via a browser using https? Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Ant and Tomcat Manager over HTTPS
Hi! Parsons Technical Services wrote: Harry DID start his own. He may have used the same subject line as an old message, but nothing existing in the last few months. I am sorry, but he did not. Quoting from the headers: Philipp Taprogge wrote: Subject: Programmatically deploying webapps Message-Id: [EMAIL PROTECTED] Harry Mantheakis wrote: Subject: Programmatically deploying webapps Message-Id: [EMAIL PROTECTED] In-Reply-To: [EMAIL PROTECTED] What he did is he opened my original posting and then hit the reply button. This causes a new mail composition window to open, and works just like composing a new mail to the given address, but invisible to the user, most MUAs include In-Reply-To: or Reference: headers that are used to display the threads. It's no big deal, but most people who do not use threaded display in their MUAs are unaware of this. Regards Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Programmatically deploying webapps
Hi! I am stuck here :-/ Perhaps anyone could give me a poke in the right direction. What is want to do is this: I am writing an installer for my web application. It is intended to ask the user for hostnames/IP-addresses for tomcat and a db-server, edit the context.xml to reflect the datasource, do some sql initialisation (so far, so good) and then (now that seems tricky) antomatically deploy the (local) war to a remote tomcat instance. It seems possible at least with tc5, since the ant task and the deployer app seem to do exactly this. How can it be archived? Thanks in advance Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to disable TRACE|TRACK method in tomcat
Hi! zhicheng wang wrote: can any one tell me how to disbale the TRACE|TRACK method in tomcat (4.1.27 i am using) any suggesstions are welcome Well then, here goes. I don't know if there's a configuration option in tomcat somewhere (I never needed to disable a method), but could you not just write a filter that passes along all request types except TRACE, for which it returns a Method Not Allowed error? Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to disable TRACE|TRACK method in tomcat
Hi! zhicheng wang wrote: hi, my colleague has find the solution is here: http://archives.real-time.com/pipermail/tomcat-users/2003-June/115025.html Just for the record: it is at least questionable (from the rfc's point of view) to have your server respond to a TRACE with a 3xx and especially a 302 status code. A 302 indicated that the requested resource is available, but (temporarly) resides under a different URI which the server should return in the Location field of it's response. What the server should do in your case is respond with a 405 Method not Allowed, indicating that regardless wether the resource is available or not, it may not be accessed with the HTTP method the client used. I don't want to appread nitpicking, it's just that it is often my job to work around ill-behaving servers :-/ For what it's worth, Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Slightly OT: NoBodyResponse
Hi and thanks for your response! Shapira, Yoav wrote: These are private support classes of the Servlet API. They're still present, but they're file-private inner classes and thus no in the JavaDoc (intentionally). I thought so, that's why I asked. The class name you're quoting for them is wrong, by the way: it's javax.servlet.http.HttpServlet$NoBodyResponse and javax.servlet.http.HttpServlet$NoBodyOutputStream. That explains it. As I said, I just quoted them from several newsgroup postings I stumbled across. Your second guess is also wrong, and I wouldn't normally mention this but it's significant: there's nothing tomcat-specific (or specific to any server) in the javax.servlet classes. It would by all means be bad practice and I would never imply that the tomcat developers worked that way, but since HttpServletResponse is not final, it could hypothetically be extended by a third party inside the same package. I just thought I might have accidently discovered a sin of the past ;-) Thanks for your clarification. Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Slightly OT: NoBodyResponse
Hi all! While I was reading some mail archives today, I stumbles stumbled over a few postings discribing problems with webapplications referring to a class called javax.servlet.http.NoBodyResponse and sometimes javax.servlet.http.NoBodyOutputStream. I was curious, so I browsed through the javadocs. The odd this is, this class in not mentioned in any of the recent versions of the servlet api. My second guess was that it must be a tomcat specific extension (as many postings mentioned running tomcat), but it's not part of tomcat's javadocs, either. Perhaps any of you guys could enighten me... Thanks Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Need help - Data Source problem
Hi! Mathew wrote: For me it looks like my program is not able to read tags in server.xml to get driver class info. Any help is really appreciated. If sure looks that way, but without further information one can't be sure. It would really help matters if you could post the relevant parts of your server.xml. Perhaps there's just a typo or something. Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: RE : encodeURL / jsessionid
Hi! Jerald Powel wrote: Thanks for that. can you tell me then the purpose of jessionid - (methods encodeURL and getRequestedSessionId)? It seems a bit strange to pass the session around while in the session. As far as I understand, the only purpose of jsessionid and the above methods is to allow clients to keep track of their session id when they are not able to use cookies for one reason or another. Normally, tomcat will set a cookie on login containing the sessionid. That cookie is then presented by the client for each subsequent request for a resource in the given context. If this does not work (for example when the client does not allow cookies to be set or simply does not implement cookies), URL rewriting can be used as an alternative. The client then will append ?jsessionid=whatnot to the URL and tomcat will then recognise the sessionid and remove that parameter before passing on the the webapp. encodeURL() will decide wether the client can use cookies at runtime and of not append the jsessionid parameter. So, if you want your clients to have that option, you have to use that method. As to getRequestedSessonId(), I could only guess why the specs opted to expose the id to the webapp... there might be valid reasons, but it certainly does not hurt. HTH Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to add the class to the tomcat , so that it runs on its own
Hi! Sale Rahul wrote: Dear All Gurus, We need to make one utility class which needs to run on its own in the tomcat.We donot want to make it as servlet or so. Is there any way with which we can do that ? might... But it is very hard to advise you with so little information. What purpose is this class you speak of? How is it supporsed to be used by other parts if the application? What external ressources does the class need? What pieces of application state information does it need access to? Perhaps you could elaborate a little further on this? Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Stopping repeating requests
Hi! Peter Guyatt wrote: I have a problem where a user enters data into a form and then submits this to the server, which in turn wrights this content into a database. The problem I have is that if the user then refreshes the page via F5 then it adds the same data in again. Is there any way to ensure that this does not occur. Not really... to your servlet/jsp processing the HTTP-POST, those two requests are two separate entities that each need to be processed. How should your servlet know if the second request is a reload or another person POSTing from the same machine as the first one? If you have any criteria in the data itself, you could, of course, add some kind of logic to the servlet in order to validate the data first. If, for example, you d not want two database rows that are entirely identical, you could first SELECT the form data and only INSERT if there is no result. HTH Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Stopping repeating requests
Hi! Parsons Technical Services wrote: The better way is to clear the form or send them to another page. That's all client side. Not necessarily. What I do in such situations is this: have a servlet process the form data and then send something else (e.g. an update successfull-page) as response via sendRedirect(). This way, the user _has_ to at least push the back button. If you then add headers to prevent the page containing the form from being cached, even that would give the user a plain empty form all over again. Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Another Try at MySQL Connection Pooling
Hi! Mark Matthews wrote: On most versions of Windows, using JDBC and MySQL with named pipes will give you a 50-60% performance improvement. Which IMO is by no way an intidator of Win's greatness in named pipes but rather of it's bad TCP implementation. Instead of relying on named pipes one should concider switching operation systems on the hosting machine... Just my 2 cent Phil -- And on the seventh day, He exited from append mode. (Book of create(2), line 255) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DBCP and removeAbandoned
Hi! Eric Prévost wrote: I'm using Tomcat 5.0.18 on Linux. My database server is Microsoft SQL Server 2000. I'm using Microsoft's JDBC driver. When I stress-test my application with JMeter, I can see over 80 connections on my database server, and they are not released until I stop tomcat... Is removeAbandoned parameter not supposed to take care of these connections??? I am not entirely sure here, so please correct me, if I'm wrong, but... you are using dbcp, right? So, isn't the pool _supposed_ to reuse open connections instead of closing them and reopening anew for each request? I think what you should do is choose a reasonable max number of connections and then stress-test while look for a dbcp exception indicating that no new connection could be acquired. If you get one, either removeabandoned is not working properly, of (more likely) your application keeps a hold on connections that therefor are not concidered abandoned. If you don't get an exception, you can be quite sure you will never see more connections than you specified. HTH Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Image download?
Hi! I don't know if this will help you, but I use the ImageIO classes for exactly the same purpose. Works great for me. I first create a BufferedImage and then write it to the response. The code looks something like this: BufferedImage bi; //make your BufferedImage from whatever response.setContentType(image/gif); //or whatever ImageIO.write(bi, gif, response.getOutputStream()); response.getOutputStream().flush(); HTH Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OT [was: Re: Starting a different process for each java operation]
Hi! Werner van Mook wrote: Can I continue on this which is OT? Which standard users can start tomcat on port 80? except for root? This very much depends on the platform tomcat runs on. On Linux and most Un*x-like operationg systems, no user except root (i.e. anyone with effective uid 0) may open ports below 1024. Hence, on these platforms, no other user can start tomcat on port 80, at least not without outside help. What native unix-programs (like apache) do is they meddle with the uid they are running under by the means of kernel function calls, dropping their root-privileges after they open port 80 and do other privileged stuff. Since I had no need for this myself, I do not know if there is any solution around that allows java programms to effectively do the same. Phil -- And on the seventh day, He exited from append mode. (Book of create(2), line 255) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Starting a different process for each java operation
Hi! Shapira, Yoav wrote: Can you clarify something for me? You are referring to tomcat starting child processes and not changing the uid, correct? I don't understand what you're asking. I am not entirely sure, either, but I think you two are talking cross-purposes. If I am not mistaken, the OP wanted a way to change the (unix-style) effective uid of a java process running a servlet to _a_specific_value (as if the servlet's VM had been started by that user) to do some privileged native stuff involving shard-memory operations. Since all of tomcat including it's servlets have to run in the same VM, this is not possible by any means short of hacking tomcat itself to spawn a new VM for a servlet to live in. Phil -- And on the seventh day, He exited from append mode. (Book of create(2), line 255) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] avoiding getOutputStream() being called twice
Hi! Robert Priest wrote: How can I pass a byte[] down to my client, without calling response.getOutputStream explicitly? Here is my problem: I want to pass a file down to the client via a jsp page. At first glance, I can't tell you why you get this error, but IMHO you could save yourself a lot of trouble if you used a servlet directly in this case. A JSP is a bad choice here, I think, since a JSP response is presumed to have text (or html rather) content. I think your problem might be that some jsp header information is already sent to the client using the jspwriter when you call the getOutputStream() method. You should decide what you want. If you want the client to display something, send text, if you want to push a file to the client, send bytes, but not both in the same reply. In such cases I use a servlet, that first sends the binary data to the client and then sendRedirect()s the client to a jsp that displays the outcome of the operation. Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: failure notice
Hi! Shapira, Yoav wrote: Howdy, Should be taken care of now. Maybe one or two more circulating, but that's it I hope. Hmm... I still getting those failure notices... at least 5 or so every minute... :-/ Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Error compiling servlet file,help
Hi! Avinash Sridhar wrote: Thanks for the suggestion,I did as you told and echo %CLASSPATH% going into the directory, but still the errors as below. And the result was... what? The compiler errors can be interpreted in only one way: the servlet-api is _not_ in your classlath. Hence there can be only one cause of the problem: you are not adding them correctly. Thsi is clearly a shell issue. /** tomcat.bat */ set classpath=;E/tomcat/tomcat-5/common/lib/servlet-api.jar set classpath=;E/tomcat/tomcat-5/common/lib/jsp-api.jar /** tomcat.bat */ I see three issues here: for one I don't know what that leading ; is about. If it's not a problem, it is definitively not necessary. Secondly, I am not sure if you can use forward slashes in the classpath on Windose machines. And either way, you are missing a : as in E: at the beginning. HTH Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Server.xml content
Hi! Jon Belinfante wrote: Does anyone know how in a Web App one can read parameter info from server.xml. Basically I am looking for a way to read port numbers from the app. Is this possible. ? I presume not - but I ask just in case there is something I may of missed. It is neither possible nor desirable to have a webapp directly read container config files. What exactly do you want your app to do? In general, all information a webapp should need is available through the Servlet API. Perhaps you could elaborate further on your app's needs? Phil -- And on the seventh day, He exited from append mode. (Book of create(2), line 255) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat performance
Hi all! Peter Lin wrote: then I will throw major load at it for 48hrs generating a couple million page views. Just out of curiosity: what is the best way to generate page views for such a benchmark? What tools do you use? Thanks Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Redeployment of War over and over Supported?
Hi! I don't know if this applies to your webapp, but there is an issue with the java compiler having a memory leak which can lead to OOM errors when tomcat has to compile many jsps over and over. A remidy for this is either to use jikes instead of javac entirely or to set the fork attribute of the default servlet to true, thus loosing some speed but preventing the leak. HTH Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Redeployment of War over and over Supported?
Hi! Josh Rehman wrote: Note: This issue has been fixed in Sun JDK 1.4.x. Thanks for pointing out. I thought a fix was implemented only recently in the latest java version. My mistake obviously. Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Reg. server.xml
Hi! Avinash Sridhar wrote: this is regarding a certain problem that I am facing and not able to find an answer to it. As the case is,I am using tomcat 5.0.16 on Windows Xp home edition.I have made a directory as sampleapp in the CATALINA_HOME/webapps directory. the directory structure is as follows,in the sampleapp directory,I have the WEB-INF folder and this contains the classes and the lib directory,in the classes directory I have put the classes files as required. I have writen a web.xml file for the various mappings that need to be done. I havent tried anything with the CATALINA_HOME/conf/server.xml file.I am not sure as to what has to be done. As far as I can see the Context tag is commented and this needs to be changed for sure. I am unable to get a working solution to this problem,any leads would be very helpful. I think the best solution to just get going would be to package your webapp in a .war file using the sdk's jar command and just drop that into tomcat's webapps directory. The auto-deployer will take care of the rest. If you need special configuration for your application or you do not want to use autodeploy, you will have to edit server.xml and add a Context-Element for your application to it. You should refer to the tomcat administration documentation available at the tomcat project homepage. In general, it should look seomthing like this: --8- Context path=where_app_will_be_mapped_relative_to_docroot docBase=/dir_below_webapps_where_the_app_lives reloadable=true or false crossContext=true or false !-- if you want, you can define JNDI resources here, too: -- Resource name=jdbc/example_db auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/example_db parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter nameusername/name valuejspuser/value /parameter parameter namepassword/name valuejsppass/value /parameter parameter namedriverClassName/name valuecom.mysql.jdbc.Driver/value !-- if using MySQL -- /parameter parameter nameurl/name valuejdbc:mysql://localhost:3306/db_warthog_accounts/value /parameter /Context --8- HTH Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JDBC/DBCP problems
Hi! Burgess, Jay S wrote: Thanks for the feedback. Maybe my problem does have something to do with context visibility, but since I'm defining the resource within SERVER.XML's GlobalNamingResources, I was under the impression that these resources were available to all contexts. I had a similar problem. It seems, that if you auto-deploy a context by dropping a .war into tomcat's webapps, this context does not see the JNDI-Resources defined in the GlobalNamingResources section of the server.xml. I had to specify them explicitly in it's own Context section for my webapp. This problem seems to be limited to tomcat 4.x, since it vanished after I upgraded to tomcat5. HTH Phil -- And on the seventh day, He exited from append mode. (Book of create(2), line 255) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JDBC/DBCP problems
Hi! Michael Duffy wrote: I think it's a better idea to make those app resources local instead of global. If your app is the only one that needs that data source, by all means it should not be global. That's the way I prefer to do it. Keep those apps uncoupled and isolated from each other. - MOD Agreed. The problem is that with tomcat4 (at least as far as I have learned), it is not possible to define a Context-Element in server.xml for a webapp that has not yet been deployed. If you want to use auto-deploy, you have to drop the war into the webapps directory, start and then stop tomcat so that the war get's unpacked and the context registered, next you have to add the Context element and finally start tomcat again for those changes to take effect. If you want to define datasources for a webapp that is not yet deployed, you have no choice than to make them global. As I said earlier, this only applies to tomcat4. If I am mistaken here, by all means tell me so, because this bahavior is a pain in the back... Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] installing new java jdk
Hi! Adam Hardy wrote: If I go to my webserver with a linux shell and use Lynx, the download page at java.sun.com gets truncated. wget and curl don't work either because they're not interactive so you can't click on the 'accept terms' submit button. This is a problem I often run into as well. Although there are ways to get the sun download page to work with curl, I have not yet figured them out. Easiest is is fact to download the sdk from another machine and ftp/scp it to your server. There is another way that might work: go to the sun page from your desktop-machine, click your way through past the license terms and then let wget fetch _exactly_ whatever link your browser provides for the download. I have used that one successfully, but only with machines that are NATted through the same router. HTH Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Access to connection pool through tomcat api
Hi! Philipp von dem Bussche wrote: does anybody know, if it's possible, to access information about a tomcat connection pool through the tomcat api. I am looking for a way to ask my container, how much connections are still left. Since pooling is not a feature of the container, this very much depends on the connection pool implementation you are using. The pools I know of do not offer such a feature. If you are sure that your application is not leaking connections, this should hardly be an issue, though. Just choose your pool large enough for your application's needs. If this is not possible, does anybody know, if tomcat is ever going to be extended by this feature ?? I very much doubt it, since connection pooling is not among the features described in the J2EE specifications, let alone for a servlet container. Tomcat is just an implementation of those specs and hence will not provide such an API unless required to. Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Prohibited Content
Hi! Merrill Cornish wrote: In the last day or two, each message I send to this mailing list gets a response with the subject line Symantec Mail Security detected that you sent a message containing prohibited content I initially assumed it thought the XML fragments I was including in my posts were some attempt to insert Trojan code. However, I've also received the same response to a message without any XML. Anyone know what it's objecting to? I got two of those as well although I am 100% sure everything was fine. I assume it was a malfunction / misconfiguration in the scanner. Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Prohibited Content
Ha... just got another one... if complained about my message having different SMTP-To: and MIME-To: headers. I am not sure if that's what you got as well. Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Measuring latency between tomcat instances
Hi! Jeremy Nix wrote: We have an instance where tomcat instance (A) is communicating with tomcat instance (B), where instance (B) is located at another site. Instance (A) formulates a request to instance (B) and instance (B) responds with some valid response. Now, my question is, from a standpoint of instance (B), is it possible to measure latency? If so, how? In order to measure latency between two systems (regardless of the application performing the measurement), you first need a way to synchronise the clocks at both sites. In most cases this brings a certain amount of tolerance you can't overcome. (For instance, synchronizing with an internet time server imposes a tolerance of a few miliseconds du to network packet delays). Since you will only get accurate readings from withing the application (i.e. tomcat) you will then have to make sure that both OS'es system clocks are equally accurate. (For example System.currentTimeMillis() has a range of up to 50ms on Windows9x systems). That said is it simple to write a small servlet that runs on A and makes a request to B including it's current time. A servlet on B then echos that request back to A and adds it's current time as well. Finally the servlet on A generates some kind of user output containing the measured runtimes. HTH Phil -- And on the seventh day, He exited from append mode. (Book of create(2), line 255) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: HTTP tunneling
Hi! Without knowing your setup better, I can't be entirely certain here, but my best guess is that your servlet's attempt to open a connection to the outside world is denied by it's sandbox's security manager. Check the console of your client vm for any security related errors. You might have to tweak the security manager a bit to allow a servlet to open an externa connection. HTH Phil niranjan inamdar wrote: Hello eveybody, I am using tomcat for the first time. Using tomcat , i was able to invoke a simple servlet that shows data acceted by a form but i was unable to invoke a sevlet from an applet. I want to invoke a servlet using Java URL class and OpenConnection method but it doesn't work. The servlet is not invoked , even i don't get any HTTP error message. Can any one tell what is the problem? How can i know what is the exact problem. Do i need to change any configuration options? __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - 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: [maybe OT] - java.lang.UnsatisfiedLinkError in servlet when generating image on the fly
Hi! Simone Chiaretta wrote: the libXp.so lib is a lib from X server... But I'm running the webserver on a just text server, so, no Xfree... I'm wondering if X is needed to use some awt methods (like the Toolkit.getImage())... or JPEGEncoder the piece of code that seems to generate the error is: Image image1 = Toolkit.getDefaultToolkit().getImage(sourceFileName) Indeed many of the image manipulating capabilities of java.awt need a running X-server to connect to. I have not yet used the new headless feature, but afaik all your classes that use awt components but do not need a head have to implement the new headless interface. Have you done that? HTH Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Memory Leaks
Hi! Shapira, Yoav wrote: This is a common misconception: System.gc() is merely a suggestion to the VM to run collection. The VM is not obliged to run it then, i.e. this is not a hard directive. It should never be relied upon. With JDK 1.4, there's a runtime parameter to ignore System.gc() calls and that parameter may be on by default in the future. Also, calling System.gc() is unnecessary in allmost all cases it is used. The VM does a far better job in determining when the gc should run than most programmers could. Only if you know your way around in the internals of the VM and you know that it will not run a gc cycle that would beneficial, you can call System.gc() to politely ask the VM to do so. Still no garantees, though. In any case, although a call to System.cg() will most likely no hurt your performance, you should never ever rely on it. Phil -- And on the seventh day, He exited from append mode. (Book of create(2), line 255) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems finding my JDBC driver for Oracle
Hi! Dor Orgad wrote: Im having a great deal of trouble getting tomcat to see my OracleDriver for the JDBC class. I have tried putting it the file classes.jar in both my tomcat/jakarta-tomcat-4.1.29/common/lib/ directory and my WEB-INF/lib directory in my docroot, and nothing seems to work. It seems to pick up the MySQL drivers just fine, but when I stick in the Oracle Driver is comes up with: Caught in processRequest java.lang.RuntimeException: java.lang.ClassNotFoundException: oracle/jdbc/driver/OracleDriver. From what you are writing, I get the impression that you packed the jdbc driver jar _into_ another jar called classes.jar and placed this second jar in your WEB-INF/lib directory. If this is indeed the case, that's your problem. A setup like this does not work, because the classloader does not see jars inside jars. You have to place the jar file containing the _package_ oracle.jdbc.driver in WEB-INF/lib, not a jar containing that jar. HTH Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat will not run, Class Not Found error
Hi! Robert Bowen wrote: Hello all. I recently had to un-install and re-install Tomcat. Now when I run it (either as a service, or using startup.bat or catalina.bat) it fails with this error: java.lang.NoClassDefFoundError: com/sun/jmx/mbeanserver/GetPropertyAction ... I can't seem to find any info on this class on the net, but I know that JMX is a Jakarta technology. I don't get why a class that I would imagine is included in one of the jars that come with the Tomcat install cannot be found. In fact, JMX is a Sun technology, a framework that applications can use (hence the com.sun package name. Tomcat just uses jmx. Regarding your problem, you most propably shot your classpath when you uninstalled tomcat. Check your classpath settings (set in catalina.bat IIRC) and make sure it includes all jars tomcat needs. Also make sure that the package containing named class is where you think it is. HTH Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tricking the browser with a path
Hi! Justin Walters wrote: http://website.com/subdir/script.jsp/more/pathinfo Currently, it looks like it just assumes script.jsp is another subdirectory, and so this request doesn't work, you get a 404. Is there a way for me to configure Tomcat such that it loads script.jsp? AFAIK this is not possible with tomcat out of the box. You basically have two options here: either use the normal script.jsp?path=/more/pathinfo syntax and use that variable in your jsp or use some kind of URL rewriting. If you are using apache with tomcat, this can be done with mod_rewrite, if you use tomcat standalone, you can write a filter in your webapp to do this. HTH Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat reconnect to database server?
Hi! I don't know MSSQL in particular, but in princible it should be as simple as adding ?autoreconnect=true to the driver URL. Phil Derek Mahar wrote: How can I configure Tomcat 5.0.16 to reconnect to a Microsot SQL Server after a server restart? I have configured Tomcat to use JNDI datasources (through Resource and ResourceParam elements within GlobalNamingResources). I presume that at startup, Tomcat connects to the server and creates a pool of connections for later use. However, when we restart our server, Tomcat loses its connection(s) and does not re-establish these connections. -- And on the seventh day, He exited from append mode. (Book of create(2), line 255) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Browser control thru servlet
Hi! Teja Jo wrote: Hello everyone, Can anyone tell me how the back and forward button of browser be controlled - as disabled for example or specifying the url it should go to - thru the requests made to servlet? Thanks and regards, It is (thankfully) not possible to control a user's browser from the server side. All you can do in this case is include javascript code in the page returned in response to the request. With javascript you can do most of what you describe above. HTH Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat Tuning Memory leak
Hi! David Strupl wrote: I have tomcat 4.1.29, JDK1.4.2. Also my app was completely ok with tomcat 3.x.x. The 100% of processor time occurs in my case only after the OOME. Before the OOME all the threads (both tomcat's and mine) are happy. The processor usage is not too surprising. When your machine runs out of memory and there are still busy processes, most of the cpu time will go into swapping in and out those processes. Still, since most prople are perfectly happy with the tomcat build you are using, there seems to be a problem with your application code. Perhaps you could elaborate a bit further here? And, as we had that subject a few days ago, are you by chance re-using StringBuffer instances ;-) Regards, Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat Tuning Memory leak
Hi again! David Strupl wrote: Also the code was running for several years in tomcat 3.x without any problem. After migrating to tomcat 4.x the nightmare began. Have you changed the JRE as well or are you running the tomcat 4 instance in the same VM as the tomcat 3 before? Just to make sure your problems are not arising from changes made to the JVM in the meantime. Regards, Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: web app prob from a newbie
Hi! FRANCOIS Dufour wrote: win xp home tomcat 4.0 jdk 1.3 i have video chat aplication running but the forum aplication ask mee too set a java home path and cant figure were Perhaps you should ask someone who has a french version of WIN XP available. On an english installation, you go to properties of system, click on advanced and then on the environment button. There you can add and modify environment variables. Just add one named java_home and set it to the path to your java directory. Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: web app prob from a newbie re:damar
Hi! FRANCOIS Dufour wrote: ok in french traducted i got many option there like follow user variable (name of curent user)new,modifie,delete /system variable new, modifie, delete, If you want the java_home to be system wide (for all users) click on new next to system variable, if you want it only to be for the current user (not others), click on new next to the current user. Enter java_home as the name and the path to your java directory as the value. hth Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: another newbie question
Hi! FRANCOIS Dufour wrote: whicht database should i use under tomcat That does not so much depend on tomcat but rather on the needs of your application. Today almost any major RDBMS has a JDBC driver and that's all you need. If you want a database that is simple to administrate but comes with rather limited functionality, you might want to have a look at mysql. If you need more features, postgresql, or sapdb may be what you want. These are all open source. If you want to invest money, there is always M$ SQL or Oracle and the like. hth Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Classes cannot be found
Hi! Jeff Greenland wrote: Thanks, I'll go through and see if anything in here gives me some hints. However, I'm not getting ClassNotFound exceptions -- my files are not even compiling because the compiler Cannot Resolve Symbol. My problem lies in that the compiler (jasper) cannot find my compiled classes, even though the logs seem to show that they are in the classpath. It seems from the snipplets you posted, that you class is not in a package. As I understand it, a package declaration is required for jasper to reference custom classes correctly. Try putting your class in a package. Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Q] Tomcat ZoneAlarm?
Hi! Riaan Oberholzer wrote: This is not a Tomcat issue, but I've tried desperately and could find no answer elsewhere... can someone please tell me how to get Tomcat working with ZoneAlarm (free version) as firewall? In general, it is very advisable to know what a firewall does and how it works before installing one. In general, ZoneAlarm is a (rather simple) packet filter, i.e. a piece of software that examines network packets as they arrive at or depart from the machine and decides on a set of rules to allow or deny them. If you want a so protected machine to run tomcat and access it from beyond the firewall, you need to add a rule that allows requests from external sources directed at port 80 (or whatever you set your tomcat to listen on) on the local machine and also to allow the responses from tomcat to any external host. If you want to use SSL, you will have to allow those request/response-pairs as well. You should, however concider wether you really need a firewall, if your machine is a pure server that does not serve other purposes. In that case, you should just close all ports you don't need. A closed port is no risk and if the listening software has flaws, a firewall wouldn't protect you either. HTH Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Admintool cannot save changes to servers.xml
Hi! [EMAIL PROTECTED] wrote: Question: What do I have to change in order to enable admintool to save changes to server.xml? I am not entirely sure here, but from what I have read so far I recon that the admin webapp is for making changes to the running tomcat instance _only_. If you know in advance what you want, put it in the appropriate config file. You only use the admin tool when you have to make changes on the fly and can't (or don't want to) restart the server. I don't think the admin tool is intended to work that way and I am not sure if I would like if it did. Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Memory comsuption
Hi! Luis Daniel Alvarez wrote: What about the others 50 or 70 java process with 50M of memory comsuption too? You must understand that the java runtime on linux implements java threads by forking separate processes which if the preferred way on un*xes to do things. What you are seeing with top are those forked off processes and the memory listed is just used _once_ not once by thread. If you had started, say, 50 different java commands, the memory would be separate, but here, you don't have a problem. Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
StringBuffer Factory?
Hi! I was just working on a little project of mine when a thought sprang to my mind... In my servlets I often have to assemble Strings like SQL statements and the like. I use StringBuffers for this as they offer much better performance than concat. Now I was wondering: would it make any sense at all to get my StringBuffers from a pool by using JNDI instead of having each servlet create new ones? I am not sure of the runtime cost involved in JNDI lookups. Any thoughts? Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: StringBuffer Factory?
Hi! George Sexton wrote: This is a really bad idea because of the implementation of StringBuffer.toString() and setLength(). Well, Ok. But this is (IMHO correctly) regarded a bug in the current StringBuffer implementation; a bug that, with luck, will be fixed some day. Or you could write your own StringBuffer class. Concider now a StringBuffer that's working properly. What is more expansive in terms of runtime: the JNDI lookup of a pooled instance or the instanciation of a new one? Regards, Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: RES: TCP-FIN problem
Hi! Sebastian Klenk wrote: I didn't do anything ... the only problem I have is that my app. is not very fast, and that is because it has to wait for tomcat to close the connection, but tomcat closes the connection a lot later (ca 1 minute). My question is now if there is a way to tell tomcat that all data has been written an that the connection can be closend!? Your problem is not tomcat, but the application. Tomcat uses a default timeout of 60 seconds on the socket. But what seems to happen in your case is not tomcat causing that timeout, but _experiencing_ it. Your application is not closing the connection properly and tomcat keeps it open until the timeout occurs. Could you perhaps post more information on that application? Is it written in Java as well? Perhaps you could post some code snipplets? Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: RES: TCP-FIN problem
Hi! Sebastian Klenk wrote: actually i thought that tomcat was supposed to close the connection after all data has been send - if not this explains a lot! It does, but TCP handshakes are no one-way street. I can only do wild guesses from here, but what I think is happening is this: after tomcat sends the last chunk of data, your application does not release it's hold on the connection, just like as it wants to send more data toward tomcat. After not doing so for a given time (60 seconds) tomcats assumes that the client on the other side has died and reaps the connection. In your code, what is Receiver? Where do you get it from? Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with database updates using DBCP
Hi! David Ramsey wrote: I've not used DBCP specifically but are you sure you are committing your writes? Most pools will default rollback connections returned to the pool, if I am not mistaken. Isn't there a parameter autocommit in the ConnectionFactory? I am not sure if it's viable to call setAutoCommit() on a connection obtained from the pool. Try specifying autocommit in the DataSource declaration. Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Connection Reset By Peer
Hi! Ferreira, André wrote: Can someone please explain to me what does Connection reset by peer means? Does it mean the server does not recognize the connection attempt from Tomcat or are there some other explanations. Or is there some port not available...:-(. Since TCP is a connection-less protocol, it uses a three-way handshake to simulate a connection. The client sends a packet with only the SYN bit set, the server replies with a SYN ACK packet and the client acknowledges this with a single ACK. After that, server and client have agreed to act as if they were actually connected to each other and they begin to actually exchange data. If now at any time one of the two sends a packet with the RST (reset) bit set, this indicates that the makeshift connection has been disrupted. This can have many reasons. So, connection reset by peer on one end (e.g. the broswer) means, that the other end (in this case the server) closed the connection for reasons unknown. In this case, the server process is running fine and the port is available as well, the server just wouldn't talk to you. Phil -- And on the seventh day, He exited from append mode. (Book of create(2), line 255) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JDBC from TagSupport
Hi! Hart, Justin wrote: Quick question. I see that one can configure a JDBC datasource in their server.xml file and their web.xml file. What does this get you? Every example that I have read tells me that I need to open a JDBC connection just about the same as I would from any other java application. What is the purpose of setting up a JDBC datasource in these files? Is it only good for userdatabaserealm? The main advantage is that you can use a connection pool like jakarta-commons-dbcp which saves you a lot of runtime. The second advantage is that you can configure the connection parameters like db URL, username, password and the like on the fly without editing java sources or redeploying your application. Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5.0.16 DBCP Connection Pool Exhausted Error
Kausik Dey wrote: Hi Guys, Currently I am using 5.0.5 in production. I was trying to upgrade to 5.0.15 or 5.0.16. I made necessary changes to server.xml to create informix DBCP. Unfortunately, I am getting Connection Pool Exhausted error while trying to obtain the connection from Datasource. Is it a bug in these version or I am doing something wrong? Please advise me. Hmm... are you getting the error right away or only after a few requests? Hard to say anything without further information. It is always a good idea to make sure you properly close all Statements, ResultSets anc Connections obtained from the pool. If you ae using commons dbcp, you could also add parameternamelogAbandoned/namevaluetrue/value/parameter parameternameremoveAbandoned/namevaluetrue/value/parameter to your ressource definition. The first should remove any stale connections after they time out, the second should give you a stack trace of the violating code. Hope this helps Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5.0.16 DBCP Connection Pool Exhausted Error
Hi! Kwok Peng Tuck wrote: Isn't removeAbandoned deprecated ? If so is it still usable ? I can't find a word about it being deprecated on http://jakarta.apache.org/commons/dbcp/configuration.html I am using this parameter quite successfully. Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Need some Tomcat Configuration help badly
Hi! Find the default web.xml in $CATALINA_HOME/conf and change the appropriate parameter for the jsp servlet to true. At least in Tomcat5 this file comes with very good documentation. Philipp Taprogge Hi, How do I turn the fork to be true? Regards, Yuval Zantkeren This email message and any attachments hereto are intended only for use by the addressee(s) named above, and may contain legally privileged and/or confidential information. If you are not the intended addressee, you are hereby kindly notified that any dissemination, distribution or copying of this email and any attachments hereto is strictly prohibited. If you have received this email in error, kindly delete it from your computer system, and notify us at the telephone number or email address appearing above. Thank you -Original Message- From: Philipp Taprogge [mailto:[EMAIL PROTECTED] Sent: Sunday, December 14, 2003 3:39 AM To: Tomcat Users List Subject: Re: Need some Tomcat Configuration help badly Hi! Dick Steflik wrote: I'm on W2000, just for the record. With this in mind which way should the fork be set; true ot false. Concidering that this poor excuse for an OS does not even know the meaning of fork(), I'd say you set it to true. W2K should then start a completely new process from scratch. You'll loose some performance of course, since starting the JVM takes time and ressources, but if you don't compile many, many jsps at a time, that should not be too much of a problem. Phil P.S.: No pun intended here ;-) - 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]
/server/lib available to web applications?
Hi! Just a short question (I must admit Im too lazy to try is out). I have noticed that commons-fileupload is in $CATALINA_HOME/server/lib. Are the jars in there available to the webapplications' classloaders or are they only used internally? If they are not, is it save to place the same jar in /common/lib as well? Thanks Philipp Taprogge - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Need some Tomcat Configuration help badly
Hi! Dick Steflik wrote: If you use a different compiler does the problem go away. I think so. I often hear that using jikes instead of javac would get rid of the problem, which, if true, rises the question why tomcat does not use jikes by default... Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Need some Tomcat Configuration help badly
Hi! David Rees wrote: BTW, there is a bug with Tomcat which will cause it to run out of memory after a number of restarts. You will probably run into this with 30 students uploading new classes. You will also want to make sure that the fork attribute for the JspServlet is set to true as well as compiling JSPs will leak memory unless the compiling process is forked. Is this true only for Tomcat4 or for version 5 as well? Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Need some Tomcat Configuration help badly
Hi! Dick Steflik wrote: I'm on W2000, just for the record. With this in mind which way should the fork be set; true ot false. Concidering that this poor excuse for an OS does not even know the meaning of fork(), I'd say you set it to true. W2K should then start a completely new process from scratch. You'll loose some performance of course, since starting the JVM takes time and ressources, but if you don't compile many, many jsps at a time, that should not be too much of a problem. Phil P.S.: No pun intended here ;-) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [WORKAROUND] Re: VERY weird problem with commons-logging and Tomcat5
Hi! Jacob Kjome wrote: You can also use a repository selector. BTW, do you have log4j.jar *and* commons-logging.jar (not commons-logging-api.jar) in WEB-INF/lib? Yes, I do, but I have tried several scenarios with and without either of them in my WEB-INF/lib. Also I tried putting/removing them in common/lib and server/lib. The result was always negative. Hmm... repository selector... never heared of that. Could you kindly point me to some resource about this? Sounds exactly like what I am looking for. Thanks in advance Phil -- And on the seventh day, He exited from append mode. (Book of create(2), line 255) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 4.1.29 war unpacking problems
Hi! In tomcat 4 you have to either restart tomcat after you drop the war in it's webapps directory or manually install the webapp using the tomcat manager (the path to war file should be relative to the webapps dir, so if you drop the war there, you can just enter it's name and press install button). Phil Joe Francis wrote: Possible newbie question, but I have not found any faqs addressing this: I just did a vanilla install of 4.1.29 on a linux box. Connecting to localhost:8080 seems to work fine and I can run the example servlets, etc. In netbeans I made a trivial servlet that just spits back some helloworld html. It works within netbeans' built-in tomcat. I export this as a .war file, and copy it into tomcat's webapps folder (the real tomcat, not the netbeans one). Nothing happens, ie., I cannot access that servlet via tomcat, and examining the webapps/ directory reveals that the war file was not unpacked. I stopped and restarted tomcat - still no love. If I manually inflate the war file inside of webapps/ROOT, then I have a working servlet. I've looked at conf/server.xml and verified that the unpackWARS and autodeploy settings are both lit. Not sure what the next step is, so I thought I'd ask here. The goal is to be able to simply copy a .war into the right place and have a running tomcat deploy the servlet corerctly. cheers, -joe - 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: response.reset() and forward() ... problematic? DBCP related?
Hi! Antonio Fiol Bonnín wrote: My guess: req and res are attributes of the Servlet, like in: public class TestServlet extends HttpServlet { private HttpServletRequest req; private HttpServletResponse res; [...] } So you are calling forward(s) for a request once req and res have been overwritten by another request. Hmm... Im a bit lost here... could anyone perhaps be so kind and post a code snipplet of how a thread safe use of a Servlet's request and response attribute could look like? I have not been working with Servlets for too long and I worried I might run into the same problem. Thanks in advance Phil -- I love deadlines, I love the whooshing noise they make as they go by - Douglas Adams - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat4.1.29 Requested resource not available
Hi! Nadia Kunkov wrote: Thanks. I did http://localhost:8080/manager/install?war=test and got the error: Access to the specified resource has been denied/forbidden. What does that mean? In $Tomcat_Home/conf/tomcat_users.xml I have this: user name = Tomcat password = Tomcat roles = tomcat,manager/ (I'm not logged in to the machine as Tomcat but I thin it has nothing to do with it, right?) When I try to to http://localhost:8080/manager/list I get the same error... Can you give me any idea on what is going on? Im not entirely sure, but this sounds like a permission problem outside tomcat. What platform are you running tomcat on? If it's a Un*x, check whether the user running tomcat has read access to the war file. Have you tried uploading the war from your browser instead? Phil -- I love deadlines, I love the whooshing noise they make as they go by - Douglas Adams - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
VERY weird problem with commons-logging and Tomcat5
Hi! I have a very disgusting problem here... I am developing a webapp which uses commons-logging and log4j. All I do is use the commons' Log and LogFactory in my application and place a log4j.properties file in my WEB-INF/classes. This property file looks like this (w/out the CR in the middle line of course): log4j.rootCategory=DEBUG, warthoglog log4j.appender.warthoglog=org.apache.log4j.RollingFileAppender log4j.appender.warthoglog.layout=org.apache.log4j.PatternLayout log4j.appender.warthoglog.layout.ConversionPattern=%d{ISO8601} [%-15C{1}] %-5p - %m%n log4j.appender.warthoglog.File=${catalina.home}/logs/warthog.log log4j.appender.warthoglog.MaxFileSize=2048KB log4j.appender.warthoglog.MaxBackupIndex=20 log4j.appender.warthoglog.Append=true This works fine, except that I get not only my application's log messages but _ALL_ tomcat debug logging in this file, which firstly slows down my machine (no wonder) and secondly grows the logfile to a few MBs just from startup. What the heck am I doing wrong here? This setup worked perfectly in the last tomcat4. Can anyone advice? Philipp Taprogge -- I love deadlines, I love the whooshing noise they make as they go by - Douglas Adams - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[WORKAROUND] Re: VERY weird problem with commons-logging and Tomcat5
Hi! I still do not know what is causing this behavior, but I found a workaround in case anyone else stumbles upon this problem: In my log4j.properties I left the log4j.rootCategory property alone and only set log4j.category.package.name.of.my.classes properties for each package in my webapp to DEBUG. This way I only get the DEBUG output of my own classes and not ALL debug messages generated by the container. I still wonder why my log4j.properties in /WEB-INF/classes should reconfigure the container's whole logging mechanism. Either this is a major bug or tomcat4's doing it right was one. 'Till later Phil Philipp Taprogge wrote: Hi! I have a very disgusting problem here... I am developing a webapp which uses commons-logging and log4j. All I do is use the commons' Log and LogFactory in my application and place a log4j.properties file in my WEB-INF/classes. This property file looks like this (w/out the CR in the middle line of course): log4j.rootCategory=DEBUG, warthoglog log4j.appender.warthoglog=org.apache.log4j.RollingFileAppender log4j.appender.warthoglog.layout=org.apache.log4j.PatternLayout log4j.appender.warthoglog.layout.ConversionPattern=%d{ISO8601} [%-15C{1}] %-5p - %m%n log4j.appender.warthoglog.File=${catalina.home}/logs/warthog.log log4j.appender.warthoglog.MaxFileSize=2048KB log4j.appender.warthoglog.MaxBackupIndex=20 log4j.appender.warthoglog.Append=true This works fine, except that I get not only my application's log messages but _ALL_ tomcat debug logging in this file, which firstly slows down my machine (no wonder) and secondly grows the logfile to a few MBs just from startup. What the heck am I doing wrong here? This setup worked perfectly in the last tomcat4. Can anyone advice? Philipp Taprogge -- I love deadlines, I love the whooshing noise they make as they go by - Douglas Adams - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem with JNDI mail session and SMTP auth
Hello! Sorry if this has already been discussed, I did not find anything usefull in the archive. I am using Tomcat 5 and have configured an SMTP session ressource for my application as described in the JNDI Ressource HowTo. Since I need to authenticate to my SMTP server, I have added parameters mail.smtp.auth, mail.smtp.user and mail.smtp.password to the definition in server.xml. When I try to send mail from my web application using the example code provieded in above howto, I always get an AuthenticationFailed Exception. Is there anything I am not quite getting here? If needed, I can, of course, provide a complete server.xml or other files. Thanks in advance for any help you have to offer. Philipp Taprogge -- I love deadlines, I love the whooshing noise they make as they go by - Douglas Adams - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]