Re: Cannot load applet on web browser
Oh my. Ok, you need to get some basic familiarity with Tomcat before you leap into that. First, your applet.class file should not be in WEB-INF. Second, don't do this as a servlet. Make a simple static HTML page work, with the applet, first. Disregard WEB-INF entirely. Getting an applet to work in a static HTML page in Tomcat is just the same as getting it to work in a static page in Apache Httpd for example. After you have done that, try out some JSPs. You shouldn't usually generate HTML by hand in a Servlet these days. Even JSP is sort of on its way out, being replaced by JSF / Facelets. Get your own web address. Have a HUGE year through Yahoo! Small Business. http://smallbusiness.yahoo.com/domains/?p=BESTDEAL - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Cannot load applet on web browser
Hi, I have created programs under the following directory: servlet program: jakarta-tomcat-4.1.31/webapps/myapp/WEB-INF/classes/AppletLogin.class applet program: jakarta-tomcat-4.1.31/webapps/myapp/applets/LoginApplet.class deployment descriptor: myapp/WEB-INF/web.xml The servlet creates an HTML page that will present an applet that gathers the username and password. This servlet will also validate the input and redirect the applet as necessary. Following is part of the servlet code: . . . out.println(""); out.println(""); out.println("Login"); out.println("Welcome! Please login"); out.println(""); out.println(""); out.println(""); out.println(""); out.println(""); . . . The text Welcome! Please login appears in the web browser but the applet is not loaded in the web browser giving a message Applet LoginApplet notinited. I think that there is something wrong with the way I write the codebase and code statement as above. I tried many times modifying the codebase and code statement but still the LoginApplet cannot be loaded. Can anyone tell me the correct way to write the codebase and code statement? Please help me! Thank you. Yours Sincerely, TEH NORANIS - 8:00? 8:25? 8:40? Find a flick in no time with theYahoo! Search movie showtime shortcut.
tomcat in the embedded device
Hi I am trying to solve a problem in a different way, or may be you have already solved it. And I want to know pros and cons Today, all the embedded devices like VPN, Firewall devices have a cli, httpd and configd daemons. These are all control pane daemons. They are all in C/C++. Now I want to use tomcat in place of httpd and confid. First is it a good way to go in that direction. I have to figure out a way to hook cli to communicate to tomcat. The reason why I want to use tomcat is the ease of development. I can use JSF for the EMS. or do u guys think I am better of some httpd, and configd implemented in C. I appreciate your responses.. thanks - Don't pick lemons. See all the new 2007 cars at Yahoo! Autos.
Re: No logging (or System.out) when I activate virtual hosts
"But unless you've changed your environment, you're not using the logging facilities of Tomcat - you're using those of JBoss. We always get the full stack traces under either. Are you sure you haven't disabled logging in whichever you're actually using?" I'm sure what's happening is there is a console logger set up for the "localhost" application, but my two applications are on other hosts. These host defs are set up in the tomcat server.xml. Perhaps JBoss's logging system is doing something with them. Obviously I am totally confused about something. One would hope that JBoss would not silently drop all exceptions coming from apps when virt. hosting is involved, but that is apparently what it is designed to do. I did a grep for "localhost" in the entire JBoss tree and found nothing that would indicate special logging for "localhost". I'm not sure where else to look for this. I know that localhost works, and the problem only happens with virtual host applications. And yes I'm pretty sure that JBoss uses its own built-in log4j for everything. This is just so frustrating. I've spend about two full days working on getting log messages to work. I am 60% there with my console logging hack but I would love to get the remaining 40%, which is exceptions. Bored stiff? Loosen up... Download and play hundreds of games for free on Yahoo! Games. http://games.yahoo.com/games/front - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: No logging (or System.out) when I activate virtual hosts
More progress: it looks like System.out and System.err are being captured by classes in org.apache.tomcat.util.log. I could probably recompile those classes to NOT do anything. Alternatively, if I could find out where in Tomcat those are being instantiated, that might be under configurable control somewhere... Don't get soaked. Take a quick peak at the forecast with the Yahoo! Search weather shortcut. http://tools.search.yahoo.com/shortcuts/#loc_weather - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: No logging (or System.out) when I activate virtual hosts
> From: Vacuum Joe [mailto:[EMAIL PROTECTED] > Subject: Re: No logging (or System.out) when I activate virtual hosts > > Is some system of "dump all exceptions to the console" > possible in Tomcat? But unless you've changed your environment, you're not using the logging facilities of Tomcat - you're using those of JBoss. We always get the full stack traces under either. Are you sure you haven't disabled logging in whichever you're actually using? - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: No logging (or System.out) when I activate virtual hosts
I found a partial solution (requires Java 6): I wrote my own class: class MyLogger { public static void log(String message) { if(System.console() != null) System.console().printf("consoleLogger: %s\n", message); } } This has the unique advantage of working, unlike System.out. It still has the disadvantage that I can't see unchecked exceptions. It is workable, though, because I can put in a series of points: MyLogger.log("I'm at step 12"); // do something MyLogger.log("I'm at step 13"); and if it never gets to step 13, I know to put a try { } catch { } block in there and then I can print the exception to console. But this is all crazy. There must be some more modern way of achieving this: sending log messages (either to console or a file) and logging exceptions (either to a file or console). Is some system of "dump all exceptions to the console" possible in Tomcat? Don't get soaked. Take a quick peak at the forecast with the Yahoo! Search weather shortcut. http://tools.search.yahoo.com/shortcuts/#loc_weather - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to enable log4 for use with Tomcat?
> From: Lisa [mailto:[EMAIL PROTECTED] > Subject: RE: How to enable log4 for use with Tomcat? > > yes, but there is no mention about log4j.xml. What config > file in tomcat do I edit to point to a log4j.xml file and > have it use that for config instead of the .properties file. Look at the Default Initialization Procedure and Example Configurations sections here: http://logging.apache.org/log4j/docs/manual.html (about 3/4 of the way down). If you don't want to use the .properties format, remove (or rename) the tomcat-juli.jar from Tomcat's bin directory, then specify the location of the .xml file in CATALINA_OPTS or JAVA_OPTS (or as a -D parameter if running as a Windows service) per the above doc. However, note this comment in the Tomcat docs for log4j: "Note that there are known issues with using this naming convention (with square brackets) in log4j XML based configuration files, so we recommend you use a properties file as described until a future version of log4j allows this convention." - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat 5.5.x with JDK6
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Subject: Tomcat 5.5.x with JDK6 > > I would like to run Tomcat 5.5.x on JDK6. Is this supported? > If not, are there obvious red flags with this combination? Works for me right out of the box, although admittedly I haven't done anything extensive with that combination. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5.5.x with JDK6
"I would like to run Tomcat 5.5.x on JDK6. Is this supported? If not, are there obvious red flags with this combination?" I've been using it with JDK6 for a while now and it is fine. I don't think I had to change anything at all. Java 6 is a good improvement, too. Yahoo! Music Unlimited Access over 1 million songs. http://music.yahoo.com/unlimited - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to enable log4 for use with Tomcat?
yes, but there is no mention about log4j.xml. What config file in tomcat do I edit to point to a log4j.xml file and have it use that for config instead of the .properties file. thanks Lisa Caldarale, Charles R wrote: > >> From: Lisa [mailto:[EMAIL PROTECTED] >> Subject: How to enable log4 for use with Tomcat? >> >> Now how do I tell Tomcat to use this jar and to specifiy a >> log4j.xml file to use for the configuration? > > Have you looked at the relevant doc? > http://tomcat.apache.org/tomcat-5.5-doc/logging.html#log4j > > - Chuck > > > THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY > MATERIAL and is thus for use only by the intended recipient. If you > received this in error, please contact the sender and delete the e-mail > and its attachments from all computers. > > - > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/How-to-enable-log4-for-use-with-Tomcat--tf3018241.html#a8384901 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat 5.5.x with JDK6
Hello... I would like to run Tomcat 5.5.x on JDK6. Is this supported? If not, are there obvious red flags with this combination? Thanks, U - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: No logging (or System.out) when I activate virtual hosts
"What a curious thing to say. I'm running JULI in standalone Tomcat 5.5.20 with multiple hosts with all expected log files created and log entries made." It's what I'm observing and it's totally reproducible. For all my apps that are not on virtual hosts, logging works fine. For apps that are on virtual hosts, there is NO logging, period. Not even when the app deploys. Nothing. In my mind, the most fundamental programming tool is a logging system, often as simple as System.out.println() or equivalent. Second most fundamental would be something that actually shows me exceptions that were thrown. When I'm using virtual hosts in JBoss 4.0.5, I get none of the above. Even System.out.println() no longer works. No matter what the other virtues may be, it's useless if all exceptions are unreported. "Unless things have changed dramatically since JBoss 4.0.2, the embedded Tomcat does not have its own logging mechanism; it uses the JBoss logging configuration, located here: server\[mode]\conf\log4j.xml" But nothing in that makes it clear that something different should happen when I'm using virt. hosts The funny thing about debuggig logging is that you really have nowhere to start. When System.out.println() no longer works I have no idea what to do. This is all on a recent release of Linux btw. "Note that it uses log4j, not JULI." Hmm, ok. I have no idea, other than, it is completely broken and I've spent the last two days trying to get a simple log message to show up, anywhere, on console, in a file, in sky writing, I don't care. I can't get anything done if all exceptions are silently dropped. Any suggestions for how to force it to show me some log messages would be greatly appreciated. Get your own web address. Have a HUGE year through Yahoo! Small Business. http://smallbusiness.yahoo.com/domains/?p=BESTDEAL - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to enable log4 for use with Tomcat?
> From: Lisa [mailto:[EMAIL PROTECTED] > Subject: How to enable log4 for use with Tomcat? > > Now how do I tell Tomcat to use this jar and to specifiy a > log4j.xml file to use for the configuration? Have you looked at the relevant doc? http://tomcat.apache.org/tomcat-5.5-doc/logging.html#log4j - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: No logging (or System.out) when I activate virtual hosts
> From: Vacuum Joe [mailto:[EMAIL PROTECTED] > Subject: Re: No logging (or System.out) when I activate virtual hosts > > I'm running Tomcat, embedded within JBoss. > > I think this relates to JULI, a terrible mistake that > happened around Tomcat 5.5.9. It is fragile junk which > results in no log entries whenever virtual hosting is used. What a curious thing to say. I'm running JULI in standalone Tomcat 5.5.20 with multiple hosts with all expected log files created and log entries made. Unless things have changed dramatically since JBoss 4.0.2, the embedded Tomcat does not have its own logging mechanism; it uses the JBoss logging configuration, located here: server\[mode]\conf\log4j.xml Note that it uses log4j, not JULI. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: No logging (or System.out) when I activate virtual hosts
I'm tracking down part of the problem. I think this relates to JULI, a terrible mistake that happened around Tomcat 5.5.9. It is fragile junk which results in no log entries whenever virtual hosting is used. I can't figure out how to get it to do anything more sophisticated than "silently drop all log entries". No need to miss a message. Get email on-the-go with Yahoo! Mail for Mobile. Get started. http://mobile.yahoo.com/mail - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Keeping the server side object alive !!!
I attach an example for you. MigrationUtil is a helper class that needs initialisation when the webapp started and needs cleaning when the webapp stopped On 1/16/07, Luis Rivera <[EMAIL PROTECTED]> wrote: Dear Leon, Thanks for the info, I am reading about Contexts, but I am not sure if they are created as soon as tomcat starts. This listener seems to be event based, as long as an event is auto generated after Tomcat has started, it would work, or if there is another mechanism that can be used to generate the event that is automatic and that does not require a request from the client, I think it might work. Thanks in advance, --Luis R. On 1/15/07, Leon Rosenberg <[EMAIL PROTECTED]> wrote: > > I think what you need is a ContextListener. With it, you will be > notified when the context (webapp) starts and can perform > initialization, and when the context is destroyed you can perform > de-initialization (stop your threads, cleanup ressources and such). > > regards > Leon > > On 1/15/07, Luis Rivera <[EMAIL PROTECTED]> wrote: > >Hi, > > > > I would like to know how could I jump start my web service in tomcat > before > > any call from the client is made. My first version only needed to be > > stateless and that worked fine, since I noticed that each call from the > > client creates a new object in the server. However, now I would like to > > create some threads because I have a custom administration module > > (session/security/database). > > > > I can create them when the first call is made (using statics), but I > would > > like to get rid of the overhead in the first call by somehow jump > starting > > the application to do the loading and initialization that the > application > > threads need to do, so that the when the first call is made, there is no > > overhead to pay. > > > > I am not sure. Is this possible? I am probably not understanding fully > the > > servlet model or how tomcat/axis is supposed to be stateful at the > server > > side. > > > > I guess, if there is a smarter way to do this without using > threads/statics > > I would like to know where I could find an example. > > > >Thanks in advance, > >--Luis R. > > > > > > - > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- -Andre- People see things the way they are and say "why ?" I see things that never were and say "Why not ?"
Re: Help loading XML config file via Init Servlet
Robert, The problem with the getRealPath() is that I have the undeployWars set to false in server.xml and getRealPath() is just for raw File I / O, it can't be used to read from a jar file... Thanks for the suggestion, nonetheless! Sincerely, James Dekker On Jan 15, 2007, at 4:54 AM, robert lazarski wrote: On 1/14/07, James Dekker <[EMAIL PROTECTED]> wrote: Hello there, I am using the Apache Commons Digester to load an XML config file via a servlet with init params... I keep getting this error when I start Tomcat 5.5.9 and have deployed the war file via my build script: INFO: Deploying web application archive coffeebreak.war 2007-01-14 03:10:33,050 WARN [org.coffeebreak.logging.Log4jInitServlet] - Loaded: log4j.properties file attributes-config.xml not found, /Developer/JavaTools/tomcat/jakarta- tomcat-5.5.9/bin/WEB-INF/classes/org/coffeebreak/config/attributes- config.xml Try using getRealPath() . Here's some code a wrote a while back: /** * Load log4j * * @web.servlet * display-name="log4j-init" * load-on-startup="1" * name="com.infoseg.mr.xtutil.Log4jInit" * * @web.servlet-init-param name="log4j-init-file" * value="WEB-INF/properties/log4j.properties" * */ public class Log4jInit extends HttpServlet { public void init() { String prefix = getServletContext().getRealPath("/"); String file = getInitParameter("log4j-init-file"); // if the log4j-init-file is not set, then no point in trying if(file != null) { PropertyConfigurator.configure(prefix+file); } else { throw new RuntimeException("Cannot load InitParameter from web.xml: log4j-init-file"); } } public void doGet(HttpServletRequest req, HttpServletResponse res) {} HTH, Robert - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: HTTP Error 505
We should probably report this as a bug, in case we can retrace the error? I believe it should have been 404 File Not Found -Rashmi - Original Message From: Martin Gainty <[EMAIL PROTECTED]> To: Tomcat Users List Sent: Monday, January 15, 2007 8:56:56 PM Subject: Re: HTTP Error 505 Rashmi is correct HTTP 303 is Resource not found HTTP 505 is Version not supported There is more work to determine the cause of the 505 Martin -- --- This e-mail message (including attachments, if any) is intended for the use of the individual or entity to which it is addressed and may contain information that is privileged, proprietary , confidential and exempt from disclosure. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this communication is strictly prohibited. --- Le présent message électronique (y compris les pièces qui y sont annexées, le cas échéant) s'adresse au destinataire indiqué et peut contenir des renseignements de caractère privé ou confidentiel. Si vous n'êtes pas le destinataire de ce document, nous vous signalons qu'il est strictement interdit de le diffuser, de le distribuer ou de le reproduire. - Original Message - From: "Jeanna Geier" <[EMAIL PROTECTED]> To: "Tomcat Users List" Sent: Monday, January 15, 2007 8:39 PM Subject: RE: HTTP Error 505 > OK, I got this; looks like somewhere during the database RESTORE on the > laptop, the iconurl field got messed up, and the '/files/' portion of the > url was deleted, so that explains why it couldn't find the files...didn't > really have anything to do with the version of the browser, but, oh well, > live and learn, right?!?? > > Thanks for your time!! Hope it wasn't a waste... > -Jeanna > > -Original Message- > From: Jeanna Geier [mailto:[EMAIL PROTECTED] > Sent: Monday, January 15, 2007 7:04 PM > To: Tomcat Users List > Subject: RE: HTTP Error 505 > > > Thanks for the reply Rashmi. > > I've been searching and saw that page as well; both the desktop and laptop > are running Mozilla Firefox v.2.0.0.1 and Tomcat v.5.0.28 as well. > > Unfortunately, that bit o' information is all our program is returning on > the error... > > -Original Message- > From: Rashmi Rubdi [mailto:[EMAIL PROTECTED] > Sent: Monday, January 15, 2007 6:53 PM > To: Tomcat Users List > Subject: Re: HTTP Error 505 > > > Hello Jeanna, > > A quick search gave me this page: > http://www.checkupdown.com/status/E505.html which explains the 505 error in > detail > > They recommend upgrading one's browser. > > What browser are you using on your Laptop, and what is the version of that > browser? If it is too old then it's time to upgrade it. > > The cause of the error could be something else too, but first lets rule out > the browser. > > Do you have more details about the 505 error message, it might help? > > -Rashmi > > - Original Message > From: Jeanna Geier <[EMAIL PROTECTED]> > To: Tomcat Users List > Sent: Monday, January 15, 2007 7:26:27 PM > Subject: HTTP Error 505 > > > Hello List- > > I'm seeing some odd behavior that I'm wondering if someone out there can > help me with... > > I have the same exact configuration on a desktop and a laptop; our program > uses icons stored on a slide server at > https://localhost:8443/slide/files/APT_Icons. > > On the desktop, I can run the program and access these without any problem; > however, when we start the program on the laptop and attempt to access the > icons, it's throwing a java io Exception: > > HTTP Server 505: Error loading icon: > https://localhost:8443/slide/files/APT_Icons/.svg. > > > Any ideas why I'm getting this on one machine and not the other??? > > > Thanks- > -Jeanna Be a PS3 game guru. Get your game face on with the latest PS3 news and previews at Yahoo! Games. http://videogames.yahoo.com/platform?platform=120121 - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Keeping the server side object alive !!!
I attach an example for you. MigrationUtil is a helper class that needs initialisation when the webapp started and needs cleaning when the webapp stopped On 1/16/07, Luis Rivera <[EMAIL PROTECTED]> wrote: Dear Leon, Thanks for the info, I am reading about Contexts, but I am not sure if they are created as soon as tomcat starts. This listener seems to be event based, as long as an event is auto generated after Tomcat has started, it would work, or if there is another mechanism that can be used to generate the event that is automatic and that does not require a request from the client, I think it might work. Thanks in advance, --Luis R. On 1/15/07, Leon Rosenberg <[EMAIL PROTECTED]> wrote: > > I think what you need is a ContextListener. With it, you will be > notified when the context (webapp) starts and can perform > initialization, and when the context is destroyed you can perform > de-initialization (stop your threads, cleanup ressources and such). > > regards > Leon > > On 1/15/07, Luis Rivera <[EMAIL PROTECTED]> wrote: > >Hi, > > > > I would like to know how could I jump start my web service in tomcat > before > > any call from the client is made. My first version only needed to be > > stateless and that worked fine, since I noticed that each call from the > > client creates a new object in the server. However, now I would like to > > create some threads because I have a custom administration module > > (session/security/database). > > > > I can create them when the first call is made (using statics), but I > would > > like to get rid of the overhead in the first call by somehow jump > starting > > the application to do the loading and initialization that the > application > > threads need to do, so that the when the first call is made, there is no > > overhead to pay. > > > > I am not sure. Is this possible? I am probably not understanding fully > the > > servlet model or how tomcat/axis is supposed to be stateful at the > server > > side. > > > > I guess, if there is a smarter way to do this without using > threads/statics > > I would like to know where I could find an example. > > > >Thanks in advance, > >--Luis R. > > > > > > - > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- -Andre- People see things the way they are and say "why ?" I see things that never were and say "Why not ?" package com.ricochet.j2ee; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; import org.apache.log4j.PropertyConfigurator; import com.ricochet.util.MigrationUtil; /** * This class available for migration purpose only * for use together with MigrationUtil * * @author andre * @see MigrationUtil */ public class MigrationListener implements ServletContextListener { public void contextDestroyed(ServletContextEvent arg0) { MigrationUtil.close(); } public void contextInitialized(ServletContextEvent arg0) { // We only have linux servers so lets forget about windows flexibility PropertyConfigurator.configure("/opt/gateway/config/generic.lcf"); MigrationUtil.init(); } } - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Runtime.getRuntime.exec() problem
Mike Quilleash wrote: Process is a fiddly class to work with at the best of times. I can't say I've ever come across the exec of a Process not returning, when I've used it it will return immediatly from the exec() and you have to use Process.waitFor() if you want to wait for the program to terminate. A common problem doing this is that the standard output stream from the process fills up and blocks the waitFor() from ever returning as the process will not terminate until it's standard output is consumed. To do this I fork a separate thread just before calling waitFor() to read the standard output and error streams. This fixes the problem for me. Another not-so amusing problem is that if you don't explicitly close the input/output/error streams that Process returns they will get left hanging around and eventually you'll blow the OS limit on open file handles, so remember to close them. My code looks something like the following (I use a ProcessBuilder), needs a bit of work with try/finally to close the streams in all cases. If you need the output the external program generates then have the StreamGobbler store the output in a StringBuilder or something. You should also read this article which I where I got some of my info from originally. http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html HTH // create and start the process - redirect stderr to stdout ProcessBuilder processBuilder = new ProcessBuilder( commands ); processBuilder.redirectErrorStream( true ); // this call does not block Process process = processBuilder.start(); // create the gobbler to read the stdout/stderr from the process StreamGobbler outputGobbler = new StreamGobbler( process.getInputStream() ); // kick off the separate stream gobbler thread outputGobbler.start(); // wait for the process to terminate - blocks int exitCode = process.waitFor(); // wait for the gobbler to terminate - blocks outputGobbler.join(); // close all the process IO streams try { process.getInputStream().close(); } catch ( IOException e ) { // ignore error } try { process.getOutputStream().close(); } catch ( IOException e ) { // ignore error } try { process.getErrorStream().close(); } catch ( IOException e ) { // ignore error } return exitCode; -Original Message- From: Zack Grafton [mailto:[EMAIL PROTECTED] Sent: 15 January 2007 05:39 To: Tomcat Users List Subject: Re: Runtime.getRuntime.exec() problem hui zhang wrote: Zack Grafton wrote: hui zhang wrote: Zack Grafton wrote: hui zhang wrote: Hi Everybody, Now I am trying to launch an external application, for example, "top" ,in my web application, and killing it by PID after a while. But when I execute Runtime.getRuntime.exec("top") in my JSP page or Servlet, Tomcat is stuck in that page and do not display anything because it can not stop running until that "commnad" is terminated, which means it waiting for the response from Runtime.getRuntime.exec("top"). It seems that it will run forever. Is there any solution to solve this problem? I mean that JSP page can execute the following code no matter if it finish the process is done. BTW, I do not use System.exit() in my program. It may cause Security Manager problem. Thanks and best regards, Hui -- --- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Hey, I'm new to the list and all, but you might want to try executing "top" in batch mode. The command line option is -b on my gentoo linux box. Also, be careful of executing commands from applets and such. Another thing might be user permissions as well. You could try executing the command and redirecting the output to a file and parsing the file instead. Zack Grafton --- -- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Hi, "TOP" is only an example in this case. Actually I am running some program which can not stop running until terminating it by "Control + C". In this case, Tomcat can not run the following code if the external application does not stop. I need a solution to make my webapp running in this case. Thank you. Regards, Hui - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail
Re: HTTP Error 505
I'm glad your problem is solved. My time's not wasted I learned something new HTTP 505. :) -Rashmi - Original Message From: Jeanna Geier <[EMAIL PROTECTED]> To: Tomcat Users List Sent: Monday, January 15, 2007 8:39:43 PM Subject: RE: HTTP Error 505 OK, I got this; looks like somewhere during the database RESTORE on the laptop, the iconurl field got messed up, and the '/files/' portion of the url was deleted, so that explains why it couldn't find the files...didn't really have anything to do with the version of the browser, but, oh well, live and learn, right?!?? Thanks for your time!! Hope it wasn't a waste... -Jeanna -Original Message- From: Jeanna Geier [mailto:[EMAIL PROTECTED] Sent: Monday, January 15, 2007 7:04 PM To: Tomcat Users List Subject: RE: HTTP Error 505 Thanks for the reply Rashmi. I've been searching and saw that page as well; both the desktop and laptop are running Mozilla Firefox v.2.0.0.1 and Tomcat v.5.0.28 as well. Unfortunately, that bit o' information is all our program is returning on the error... -Original Message- From: Rashmi Rubdi [mailto:[EMAIL PROTECTED] Sent: Monday, January 15, 2007 6:53 PM To: Tomcat Users List Subject: Re: HTTP Error 505 Hello Jeanna, A quick search gave me this page: http://www.checkupdown.com/status/E505.html which explains the 505 error in detail They recommend upgrading one's browser. What browser are you using on your Laptop, and what is the version of that browser? If it is too old then it's time to upgrade it. The cause of the error could be something else too, but first lets rule out the browser. Do you have more details about the 505 error message, it might help? -Rashmi - Original Message From: Jeanna Geier <[EMAIL PROTECTED]> To: Tomcat Users List Sent: Monday, January 15, 2007 7:26:27 PM Subject: HTTP Error 505 Hello List- I'm seeing some odd behavior that I'm wondering if someone out there can help me with... I have the same exact configuration on a desktop and a laptop; our program uses icons stored on a slide server at https://localhost:8443/slide/files/APT_Icons. On the desktop, I can run the program and access these without any problem; however, when we start the program on the laptop and attempt to access the icons, it's throwing a java io Exception: HTTP Server 505: Error loading icon: https://localhost:8443/slide/files/APT_Icons/.svg. Any ideas why I'm getting this on one machine and not the other??? Thanks- -Jeanna - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Now that's room service! Choose from over 150,000 hotels in 45,000 destinations on Yahoo! Travel to find your fit. http://farechase.yahoo.com/promo-generic-14795097 - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Any questions? Get answers on any topic at www.Answers.yahoo.com. Try it now. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: HTTP Error 505
I should have said this earlier, sorry about too many e-mails. Firefox's LiveHTTPHeaders extension allows one to examine the details of a request and response. After you install that extension, check the request/response details of the page in question. It should look something like this REQUEST GET/HTTP/1.1 RESPONSE HTTP/1.1 200 OK If either request or response show a different http version then, it'll help in investigating this further. -Rashmi - Original Message From: Rashmi Rubdi <[EMAIL PROTECTED]> To: Tomcat Users List Sent: Monday, January 15, 2007 8:34:45 PM Subject: Re: HTTP Error 505 Both FF2.0 and Tomcat 5.0 support HTTP 1.1 , so that's definitely not the issue. I don't know if you ruled this one out: Is the laptop connected to some sort of a proxy server? Another site http://www.btinternet.com/~wildfire/reference/httpstatus/500.htm , suggests that the proxy server may be using an older version when it sends the request. I doubt if firewalls also need to be considered. -Rashmi - Original Message From: Jeanna Geier <[EMAIL PROTECTED]> To: Tomcat Users List Sent: Monday, January 15, 2007 8:03:45 PM Subject: RE: HTTP Error 505 Thanks for the reply Rashmi. I've been searching and saw that page as well; both the desktop and laptop are running Mozilla Firefox v.2.0.0.1 and Tomcat v.5.0.28 as well. Unfortunately, that bit o' information is all our program is returning on the error... -Original Message- From: Rashmi Rubdi [mailto:[EMAIL PROTECTED] Sent: Monday, January 15, 2007 6:53 PM To: Tomcat Users List Subject: Re: HTTP Error 505 Hello Jeanna, A quick search gave me this page: http://www.checkupdown.com/status/E505.html which explains the 505 error in detail They recommend upgrading one's browser. What browser are you using on your Laptop, and what is the version of that browser? If it is too old then it's time to upgrade it. The cause of the error could be something else too, but first lets rule out the browser. Do you have more details about the 505 error message, it might help? -Rashmi - Original Message From: Jeanna Geier <[EMAIL PROTECTED]> To: Tomcat Users List Sent: Monday, January 15, 2007 7:26:27 PM Subject: HTTP Error 505 Hello List- I'm seeing some odd behavior that I'm wondering if someone out there can help me with... I have the same exact configuration on a desktop and a laptop; our program uses icons stored on a slide server at https://localhost:8443/slide/files/APT_Icons. On the desktop, I can run the program and access these without any problem; however, when we start the program on the laptop and attempt to access the icons, it's throwing a java io Exception: HTTP Server 505: Error loading icon: https://localhost:8443/slide/files/APT_Icons/.svg. Any ideas why I'm getting this on one machine and not the other??? Thanks- -Jeanna Don't get soaked. Take a quick peak at the forecast with the Yahoo! Search weather shortcut. http://tools.search.yahoo.com/shortcuts/#loc_weather - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Finding fabulous fares is fun. Let Yahoo! FareChase search your favorite travel sites to find flight and hotel bargains. http://farechase.yahoo.com/promo-generic-14795097 - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: HTTP Error 505
Rashmi is correct HTTP 303 is Resource not found HTTP 505 is Version not supported There is more work to determine the cause of the 505 Martin -- --- This e-mail message (including attachments, if any) is intended for the use of the individual or entity to which it is addressed and may contain information that is privileged, proprietary , confidential and exempt from disclosure. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this communication is strictly prohibited. --- Le présent message électronique (y compris les pièces qui y sont annexées, le cas échéant) s'adresse au destinataire indiqué et peut contenir des renseignements de caractère privé ou confidentiel. Si vous n'êtes pas le destinataire de ce document, nous vous signalons qu'il est strictement interdit de le diffuser, de le distribuer ou de le reproduire. - Original Message - From: "Jeanna Geier" <[EMAIL PROTECTED]> To: "Tomcat Users List" Sent: Monday, January 15, 2007 8:39 PM Subject: RE: HTTP Error 505 > OK, I got this; looks like somewhere during the database RESTORE on the > laptop, the iconurl field got messed up, and the '/files/' portion of the > url was deleted, so that explains why it couldn't find the files...didn't > really have anything to do with the version of the browser, but, oh well, > live and learn, right?!?? > > Thanks for your time!! Hope it wasn't a waste... > -Jeanna > > -Original Message- > From: Jeanna Geier [mailto:[EMAIL PROTECTED] > Sent: Monday, January 15, 2007 7:04 PM > To: Tomcat Users List > Subject: RE: HTTP Error 505 > > > Thanks for the reply Rashmi. > > I've been searching and saw that page as well; both the desktop and laptop > are running Mozilla Firefox v.2.0.0.1 and Tomcat v.5.0.28 as well. > > Unfortunately, that bit o' information is all our program is returning on > the error... > > -Original Message- > From: Rashmi Rubdi [mailto:[EMAIL PROTECTED] > Sent: Monday, January 15, 2007 6:53 PM > To: Tomcat Users List > Subject: Re: HTTP Error 505 > > > Hello Jeanna, > > A quick search gave me this page: > http://www.checkupdown.com/status/E505.html which explains the 505 error in > detail > > They recommend upgrading one's browser. > > What browser are you using on your Laptop, and what is the version of that > browser? If it is too old then it's time to upgrade it. > > The cause of the error could be something else too, but first lets rule out > the browser. > > Do you have more details about the 505 error message, it might help? > > -Rashmi > > - Original Message > From: Jeanna Geier <[EMAIL PROTECTED]> > To: Tomcat Users List > Sent: Monday, January 15, 2007 7:26:27 PM > Subject: HTTP Error 505 > > > Hello List- > > I'm seeing some odd behavior that I'm wondering if someone out there can > help me with... > > I have the same exact configuration on a desktop and a laptop; our program > uses icons stored on a slide server at > https://localhost:8443/slide/files/APT_Icons. > > On the desktop, I can run the program and access these without any problem; > however, when we start the program on the laptop and attempt to access the > icons, it's throwing a java io Exception: > > HTTP Server 505: Error loading icon: > https://localhost:8443/slide/files/APT_Icons/.svg. > > > Any ideas why I'm getting this on one machine and not the other??? > > > Thanks- > -Jeanna > > > - > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > Now that's room service! Choose from over 150,000 hotels > in 45,000 destinations on Yahoo! Travel to find your fit. > http://farechase.yahoo.com/promo-generic-14795097 > > - > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > - > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > - > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
RE: HTTP Error 505
OK, I got this; looks like somewhere during the database RESTORE on the laptop, the iconurl field got messed up, and the '/files/' portion of the url was deleted, so that explains why it couldn't find the files...didn't really have anything to do with the version of the browser, but, oh well, live and learn, right?!?? Thanks for your time!! Hope it wasn't a waste... -Jeanna -Original Message- From: Jeanna Geier [mailto:[EMAIL PROTECTED] Sent: Monday, January 15, 2007 7:04 PM To: Tomcat Users List Subject: RE: HTTP Error 505 Thanks for the reply Rashmi. I've been searching and saw that page as well; both the desktop and laptop are running Mozilla Firefox v.2.0.0.1 and Tomcat v.5.0.28 as well. Unfortunately, that bit o' information is all our program is returning on the error... -Original Message- From: Rashmi Rubdi [mailto:[EMAIL PROTECTED] Sent: Monday, January 15, 2007 6:53 PM To: Tomcat Users List Subject: Re: HTTP Error 505 Hello Jeanna, A quick search gave me this page: http://www.checkupdown.com/status/E505.html which explains the 505 error in detail They recommend upgrading one's browser. What browser are you using on your Laptop, and what is the version of that browser? If it is too old then it's time to upgrade it. The cause of the error could be something else too, but first lets rule out the browser. Do you have more details about the 505 error message, it might help? -Rashmi - Original Message From: Jeanna Geier <[EMAIL PROTECTED]> To: Tomcat Users List Sent: Monday, January 15, 2007 7:26:27 PM Subject: HTTP Error 505 Hello List- I'm seeing some odd behavior that I'm wondering if someone out there can help me with... I have the same exact configuration on a desktop and a laptop; our program uses icons stored on a slide server at https://localhost:8443/slide/files/APT_Icons. On the desktop, I can run the program and access these without any problem; however, when we start the program on the laptop and attempt to access the icons, it's throwing a java io Exception: HTTP Server 505: Error loading icon: https://localhost:8443/slide/files/APT_Icons/.svg. Any ideas why I'm getting this on one machine and not the other??? Thanks- -Jeanna - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Now that's room service! Choose from over 150,000 hotels in 45,000 destinations on Yahoo! Travel to find your fit. http://farechase.yahoo.com/promo-generic-14795097 - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: HTTP Error 505
Both FF2.0 and Tomcat 5.0 support HTTP 1.1 , so that's definitely not the issue. I don't know if you ruled this one out: Is the laptop connected to some sort of a proxy server? Another site http://www.btinternet.com/~wildfire/reference/httpstatus/500.htm , suggests that the proxy server may be using an older version when it sends the request. I doubt if firewalls also need to be considered. -Rashmi - Original Message From: Jeanna Geier <[EMAIL PROTECTED]> To: Tomcat Users List Sent: Monday, January 15, 2007 8:03:45 PM Subject: RE: HTTP Error 505 Thanks for the reply Rashmi. I've been searching and saw that page as well; both the desktop and laptop are running Mozilla Firefox v.2.0.0.1 and Tomcat v.5.0.28 as well. Unfortunately, that bit o' information is all our program is returning on the error... -Original Message- From: Rashmi Rubdi [mailto:[EMAIL PROTECTED] Sent: Monday, January 15, 2007 6:53 PM To: Tomcat Users List Subject: Re: HTTP Error 505 Hello Jeanna, A quick search gave me this page: http://www.checkupdown.com/status/E505.html which explains the 505 error in detail They recommend upgrading one's browser. What browser are you using on your Laptop, and what is the version of that browser? If it is too old then it's time to upgrade it. The cause of the error could be something else too, but first lets rule out the browser. Do you have more details about the 505 error message, it might help? -Rashmi - Original Message From: Jeanna Geier <[EMAIL PROTECTED]> To: Tomcat Users List Sent: Monday, January 15, 2007 7:26:27 PM Subject: HTTP Error 505 Hello List- I'm seeing some odd behavior that I'm wondering if someone out there can help me with... I have the same exact configuration on a desktop and a laptop; our program uses icons stored on a slide server at https://localhost:8443/slide/files/APT_Icons. On the desktop, I can run the program and access these without any problem; however, when we start the program on the laptop and attempt to access the icons, it's throwing a java io Exception: HTTP Server 505: Error loading icon: https://localhost:8443/slide/files/APT_Icons/.svg. Any ideas why I'm getting this on one machine and not the other??? Thanks- -Jeanna Don't get soaked. Take a quick peak at the forecast with the Yahoo! Search weather shortcut. http://tools.search.yahoo.com/shortcuts/#loc_weather - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: HTTP Error 505
Thanks for the reply Rashmi. I've been searching and saw that page as well; both the desktop and laptop are running Mozilla Firefox v.2.0.0.1 and Tomcat v.5.0.28 as well. Unfortunately, that bit o' information is all our program is returning on the error... -Original Message- From: Rashmi Rubdi [mailto:[EMAIL PROTECTED] Sent: Monday, January 15, 2007 6:53 PM To: Tomcat Users List Subject: Re: HTTP Error 505 Hello Jeanna, A quick search gave me this page: http://www.checkupdown.com/status/E505.html which explains the 505 error in detail They recommend upgrading one's browser. What browser are you using on your Laptop, and what is the version of that browser? If it is too old then it's time to upgrade it. The cause of the error could be something else too, but first lets rule out the browser. Do you have more details about the 505 error message, it might help? -Rashmi - Original Message From: Jeanna Geier <[EMAIL PROTECTED]> To: Tomcat Users List Sent: Monday, January 15, 2007 7:26:27 PM Subject: HTTP Error 505 Hello List- I'm seeing some odd behavior that I'm wondering if someone out there can help me with... I have the same exact configuration on a desktop and a laptop; our program uses icons stored on a slide server at https://localhost:8443/slide/files/APT_Icons. On the desktop, I can run the program and access these without any problem; however, when we start the program on the laptop and attempt to access the icons, it's throwing a java io Exception: HTTP Server 505: Error loading icon: https://localhost:8443/slide/files/APT_Icons/.svg. Any ideas why I'm getting this on one machine and not the other??? Thanks- -Jeanna - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Now that's room service! Choose from over 150,000 hotels in 45,000 destinations on Yahoo! Travel to find your fit. http://farechase.yahoo.com/promo-generic-14795097 - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: HTTP Error 505
Also what version of Tomcat/ Web Server are you using? - Original Message From: Rashmi Rubdi <[EMAIL PROTECTED]> To: Tomcat Users List Sent: Monday, January 15, 2007 7:53:25 PM Subject: Re: HTTP Error 505 Hello Jeanna, A quick search gave me this page: http://www.checkupdown.com/status/E505.html which explains the 505 error in detail They recommend upgrading one's browser. What browser are you using on your Laptop, and what is the version of that browser? If it is too old then it's time to upgrade it. The cause of the error could be something else too, but first lets rule out the browser. Do you have more details about the 505 error message, it might help? -Rashmi - Original Message From: Jeanna Geier <[EMAIL PROTECTED]> To: Tomcat Users List Sent: Monday, January 15, 2007 7:26:27 PM Subject: HTTP Error 505 Hello List- I'm seeing some odd behavior that I'm wondering if someone out there can help me with... I have the same exact configuration on a desktop and a laptop; our program uses icons stored on a slide server at https://localhost:8443/slide/files/APT_Icons. On the desktop, I can run the program and access these without any problem; however, when we start the program on the laptop and attempt to access the icons, it's throwing a java io Exception: HTTP Server 505: Error loading icon: https://localhost:8443/slide/files/APT_Icons/.svg. Any ideas why I'm getting this on one machine and not the other??? Thanks- -Jeanna Any questions? Get answers on any topic at www.Answers.yahoo.com. Try it now. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
No logging (or System.out) when I activate virtual hosts
Here's a very strange problem: I'm running Tomcat, embedded within JBoss. This is the latest version (5.5.20 I believe) of TC. When I run this application on my office computer here, which has no virt. hosts, console log messages show up as expected. When I then move it over to my production server, where the applications are running in virtual hosts, there are NO log messages of any kind. ZERO. I've tried using the Servlet.log() method, java.util.logging.Logger.severe(), and good old System.out.println(). Nothing shows up anything. And it only happens when virtual hosts are a factor. What's happening? Is there some way to having both virtual hosts AND logging? Or is it an either-or thing? Have a burning question? Go to www.Answers.yahoo.com and get answers from real people who know. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: HTTP Error 505
Hello Jeanna, A quick search gave me this page: http://www.checkupdown.com/status/E505.html which explains the 505 error in detail They recommend upgrading one's browser. What browser are you using on your Laptop, and what is the version of that browser? If it is too old then it's time to upgrade it. The cause of the error could be something else too, but first lets rule out the browser. Do you have more details about the 505 error message, it might help? -Rashmi - Original Message From: Jeanna Geier <[EMAIL PROTECTED]> To: Tomcat Users List Sent: Monday, January 15, 2007 7:26:27 PM Subject: HTTP Error 505 Hello List- I'm seeing some odd behavior that I'm wondering if someone out there can help me with... I have the same exact configuration on a desktop and a laptop; our program uses icons stored on a slide server at https://localhost:8443/slide/files/APT_Icons. On the desktop, I can run the program and access these without any problem; however, when we start the program on the laptop and attempt to access the icons, it's throwing a java io Exception: HTTP Server 505: Error loading icon: https://localhost:8443/slide/files/APT_Icons/.svg. Any ideas why I'm getting this on one machine and not the other??? Thanks- -Jeanna - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Now that's room service! Choose from over 150,000 hotels in 45,000 destinations on Yahoo! Travel to find your fit. http://farechase.yahoo.com/promo-generic-14795097 - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to enable log4 for use with Tomcat?
I have tomcat 5.5.16 and have just downloaded log4j-1.2.14.jar and put it in common/lib. Now how do I tell Tomcat to use this jar and to specifiy a log4j.xml file to use for the configuration? I see conf/logging.properties but I want to use log4j.xml instead of a .properties file. Thanks Lisa -- View this message in context: http://www.nabble.com/How-to-enable-log4-for-use-with-Tomcat--tf3018241.html#a8382422 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
HTTP Error 505
Hello List- I'm seeing some odd behavior that I'm wondering if someone out there can help me with... I have the same exact configuration on a desktop and a laptop; our program uses icons stored on a slide server at https://localhost:8443/slide/files/APT_Icons. On the desktop, I can run the program and access these without any problem; however, when we start the program on the laptop and attempt to access the icons, it's throwing a java io Exception: HTTP Server 505: Error loading icon: https://localhost:8443/slide/files/APT_Icons/.svg. Any ideas why I'm getting this on one machine and not the other??? Thanks- -Jeanna - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Adding a virtual host in Tomcat 5.5
Hi, as I have now spend several hours trying to get this work, I am asking for your support guys. But please dare with me as I am a complete newbie to Tomcat. Basically I installed Tomcat 5.5 and mod_jk 1.2.20 as decribed in http://gentoo-wiki.com/HOWTO_Apache2_and_Tomcat5 and it works fine (the samples work fine when I access them via http://localhost/index.jsp and http://localhost:8080. Now for one of my customers wants to use Tomcat in his Apache virtual host and run .jsp files. Therefore I added the following lines to my httpd.conf: LoadModule jk_modulemodules/mod_jk.so JkWorkersFile conf/jk-workers.properties JkLogFile logs/mod_jk.log JkLogLevel info JkLogStampFormat "[%a %b %d %H:%M:%S %Y] " JkRequestLogFormat "%w %V %T" jkAutoAlias /var/lib/tomcat-5/default/webapps/ jkMount /*.jsp ajp13 Now, my jk-workers.properties file contains: worker.list=ajp13 worker.ajp13.port=8009 worker.ajp13.host=localhost worker.ajp13.type=ajp13 worker.ajp13.lbfactor=1 worker.ajp13.cachesize=10 Finally here is my server.xml with the new Host section: www.mydomain.com Then I created the following "hello world" .jsp file in the htdocs directory of my user (/home/username/htdocs) as defined above: Hello World Hello World Today is: <%= new java.util.Date().toString() %> Now the problem is that after restarting both Apache and Tomcat, accessing this file results in a blank page being displayed by the browser (with no content whatsoever). But Tomcat is listening on the ports as defined: # netstat -tunap | grep java tcp0 0 127.0.0.1:8009 0.0.0.0:* LISTEN 17179/java tcp0 0 127.0.0.1:8010 0.0.0.0:* LISTEN 17179/java And even the log is not really helpful: (Tomcat log) 15.01.2007 17:58:35 org.apache.catalina.core.StandardHost start INFO: XML validation disabled 15.01.2007 17:58:35 org.apache.catalina.realm.JAASRealm setContainer INFO: Set JAAS app name Catalina 15.01.2007 17:58:36 org.apache.jk.common.ChannelSocket init INFO: JK: ajp13 listening on /127.0.0.1:8009 15.01.2007 17:58:36 org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=0/83 config=null 15.01.2007 17:58:36 org.apache.catalina.startup.Catalina start INFO: Server startup in 1397 ms Is there anything more I need to do to get this working? What are the mistakes that I made? I have found so much documentation online about Tomcat, but the more I read, the more confused I got. So maybe you guys can shed some light on this... Thank you very much. Best regards, Werner - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Trailing slash added
I was talking about what the browser does when you click on a link in a web page. Suppose you have a web page called http://www.example.com/directory/page1.html and it contains this hyperlink: Page 2 When you click on that link, the browser has to figure out what "page2.html" refers to. It's relative to the current page, so the browser will request http://www.example.com/directory/page2.html. Now suppose the page containing that link is "http://www.example.com/directory/";. The trailing "/" means that this is logically a directory so when you click on that link the browser requests http://www.example.com/directory/page2.html (same as before). Now remove the trailing slash, so the web page's URL is "http://www.example.com/directory";. To the browser, this looks like a file called "directory" in the directory "/". So when you click on the Page 2 link you'll get http://www.example.com/page2.html which is wrong. That's why web servers don't treat http://www.example.com/directory/ and http://www.example.com/directory as the same thing - if they did, relative links would sometimes fail, depending how you typed the URL into the browser. Instead, as a convenience for those of us who are too lazy to type the trailing "/", the web server will make sure the URL ends with a "/" by sending a redirect response to force the browser to fetch the correct URL. -- Len On 1/15/07, lightbulb432 <[EMAIL PROTECTED]> wrote: Could anyone please expand a little more on what's meant by the two statements below? Len Popp wrote: > > It doesn't matter if it's done by URLRewriteFilter or some other > method because it's the browser that interprets the relative URLs, not > the server. > > If the containing page's URL looks like a file when it's > really a directory, the browser will get them wrong. > -- View this message in context: http://www.nabble.com/Trailing-slash-added-tf2970832.html#a8378938 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Keeping the server side object alive !!!
On 1/15/07, Luis Rivera <[EMAIL PROTECTED]> wrote: Dear Leon, Thanks for the info, I am reading about Contexts, but I am not sure if they are created as soon as tomcat starts. As soon as tomcat deploys your webapp which is effectively the same (depends on your settings like autodeploy etc, but in most cases the same). This listener seems to be event based, as long as an event is auto generated after Tomcat has started, it would work, or if there is another mechanism that can be used to generate the event that is automatic and that does not require a request from the client, I think it might work. i think it's considered 'best practice' to perform initialization in the context listener. at least its smooth :-) regards Leon Thanks in advance, --Luis R. On 1/15/07, Leon Rosenberg <[EMAIL PROTECTED]> wrote: > > I think what you need is a ContextListener. With it, you will be > notified when the context (webapp) starts and can perform > initialization, and when the context is destroyed you can perform > de-initialization (stop your threads, cleanup ressources and such). > > regards > Leon > > On 1/15/07, Luis Rivera <[EMAIL PROTECTED]> wrote: > >Hi, > > > > I would like to know how could I jump start my web service in tomcat > before > > any call from the client is made. My first version only needed to be > > stateless and that worked fine, since I noticed that each call from the > > client creates a new object in the server. However, now I would like to > > create some threads because I have a custom administration module > > (session/security/database). > > > > I can create them when the first call is made (using statics), but I > would > > like to get rid of the overhead in the first call by somehow jump > starting > > the application to do the loading and initialization that the > application > > threads need to do, so that the when the first call is made, there is no > > overhead to pay. > > > > I am not sure. Is this possible? I am probably not understanding fully > the > > servlet model or how tomcat/axis is supposed to be stateful at the > server > > side. > > > > I guess, if there is a smarter way to do this without using > threads/statics > > I would like to know where I could find an example. > > > >Thanks in advance, > >--Luis R. > > > > > > - > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Keeping the server side object alive !!!
Dear Leon, Thanks for the info, I am reading about Contexts, but I am not sure if they are created as soon as tomcat starts. This listener seems to be event based, as long as an event is auto generated after Tomcat has started, it would work, or if there is another mechanism that can be used to generate the event that is automatic and that does not require a request from the client, I think it might work. Thanks in advance, --Luis R. On 1/15/07, Leon Rosenberg <[EMAIL PROTECTED]> wrote: I think what you need is a ContextListener. With it, you will be notified when the context (webapp) starts and can perform initialization, and when the context is destroyed you can perform de-initialization (stop your threads, cleanup ressources and such). regards Leon On 1/15/07, Luis Rivera <[EMAIL PROTECTED]> wrote: >Hi, > > I would like to know how could I jump start my web service in tomcat before > any call from the client is made. My first version only needed to be > stateless and that worked fine, since I noticed that each call from the > client creates a new object in the server. However, now I would like to > create some threads because I have a custom administration module > (session/security/database). > > I can create them when the first call is made (using statics), but I would > like to get rid of the overhead in the first call by somehow jump starting > the application to do the loading and initialization that the application > threads need to do, so that the when the first call is made, there is no > overhead to pay. > > I am not sure. Is this possible? I am probably not understanding fully the > servlet model or how tomcat/axis is supposed to be stateful at the server > side. > > I guess, if there is a smarter way to do this without using threads/statics > I would like to know where I could find an example. > >Thanks in advance, >--Luis R. > > - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Issue with Changing sessionid values -- please help...
Chris, Thanks for the thinking -- I'm aware of the client IP issues with AOL, and we checked that, but it appears that the IP is staying consistent for our testing -- but our sessionid still gets changed... We are not doing URL rewriting with sessionid, it's saving as a cookie... and we can see the cookie too on the user machine we tested with. Not sure how the sessionid is determined ... by Tomcat or Apache -- we have multiple servers and session sharing occurring with Tomcat, so we are appending the server ID (worker.id) to the sessionid variable, which Tomcat manaages, but I'm not sure how Apache and/or Tomcat determine the sessionid... do you know how that happens? thanks, Kim :-) On 1/10/07, Christopher Schultz <[EMAIL PROTECTED]> wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Kim, Kim Albee wrote: > Client Config: > AOL Version 9 web browser. How are you managing sessions? Is the container doing it for you, or are you doing them yourself? Cookies or URL rewriting? Is the server and/or session configuration sensitive to the remote (client) IP address? I notice you are using AOL, which plays games with the remote (client) IP address, so if you are requiring the IP address of the user to stay the same, it's not going to work for AOL users. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFpWtn9CaO5/Lv0PARAkF5AJ47hQ9Q19JpEY2nxHwTFzw/DCVA7gCghYzf HbZlVI6Q0H7QHq/RKHEOQTE= =jsKf -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Trailing slash added
Could you explain to us, why you want to get rid of the trailing slash ? >Could anyone please expand a little more on what's meant by the two >statements below? >>Len Popp wrote: >> >> It doesn't matter if it's done by URLRewriteFilter or some other >> method because it's the browser that interprets the relative URLs, not >> the server. >> URLRewriteFilter is an application that allows you to rewrite URLs, that means, for example if you have a URL like http://localhost:8080/page.jsp?param1=499¶m2=333 , with URL rewriting you can represent it anyway you want with a regular expession pattern that means you can represent it like this http://localhost:8080/page/499/333/ , or any other pattern. But what Len is saying (and I verified that he's right), is that URL Rewriting will not help in eliminating the trailing slash because it's the browser that does the URL translation. I tried URL rewriting with this pattern to test your case: Testing trailing slash. (.*)/ (.*) When I tried http://localhost:8080 , instead of http://localhost:8080/ it didn't work, just showed a blank screen. I had to delete the URL rewriting rule, only after that it worked. > If the containing page's URL looks like a file when it's > really a directory, the browser will get them wrong. > -- Now that's room service! Choose from over 150,000 hotels in 45,000 destinations on Yahoo! Travel to find your fit. http://farechase.yahoo.com/promo-generic-14795097 - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Keeping the server side object alive !!!
I think what you need is a ContextListener. With it, you will be notified when the context (webapp) starts and can perform initialization, and when the context is destroyed you can perform de-initialization (stop your threads, cleanup ressources and such). regards Leon On 1/15/07, Luis Rivera <[EMAIL PROTECTED]> wrote: Hi, I would like to know how could I jump start my web service in tomcat before any call from the client is made. My first version only needed to be stateless and that worked fine, since I noticed that each call from the client creates a new object in the server. However, now I would like to create some threads because I have a custom administration module (session/security/database). I can create them when the first call is made (using statics), but I would like to get rid of the overhead in the first call by somehow jump starting the application to do the loading and initialization that the application threads need to do, so that the when the first call is made, there is no overhead to pay. I am not sure. Is this possible? I am probably not understanding fully the servlet model or how tomcat/axis is supposed to be stateful at the server side. I guess, if there is a smarter way to do this without using threads/statics I would like to know where I could find an example. Thanks in advance, --Luis R. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Trailing slash added
Could anyone please expand a little more on what's meant by the two statements below? Len Popp wrote: > > It doesn't matter if it's done by URLRewriteFilter or some other > method because it's the browser that interprets the relative URLs, not > the server. > > If the containing page's URL looks like a file when it's > really a directory, the browser will get them wrong. > -- View this message in context: http://www.nabble.com/Trailing-slash-added-tf2970832.html#a8378938 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat Session Replication via Database Problem
Hello, we have a problem replicating sessions using Tomcat. We are using two servers which are load-balanced using Apache. We want to achieve session preservation over multiple requests of the same user (he might be forwarded to different servers for those requests). What we tried to set up until now is database replication of the sessions using Tomcat's PersistentManager and the JDBCStore with a MySQL database. But if we request a page on one server only it takes about 10-60 seconds until the session is written to the database. Of course, the other server does not know about the session during this time and will create another session, if the second request goes to this server. Is this a known problem of the PersistentManager or might there be a misconfiguration? The problem is actually not the replication but the delayed writing of the PersistentManager to the database. This is what we put into server.xml: We read on Tomcat's website that the PersistentManager should be considered "experimental". Might that be the problem or can anyone suggest another solution for session replication? Thank you for your help, Nino Ulsamer
Keeping the server side object alive !!!
Hi, I would like to know how could I jump start my web service in tomcat before any call from the client is made. My first version only needed to be stateless and that worked fine, since I noticed that each call from the client creates a new object in the server. However, now I would like to create some threads because I have a custom administration module (session/security/database). I can create them when the first call is made (using statics), but I would like to get rid of the overhead in the first call by somehow jump starting the application to do the loading and initialization that the application threads need to do, so that the when the first call is made, there is no overhead to pay. I am not sure. Is this possible? I am probably not understanding fully the servlet model or how tomcat/axis is supposed to be stateful at the server side. I guess, if there is a smarter way to do this without using threads/statics I would like to know where I could find an example. Thanks in advance, --Luis R.
[OT] Trailing slash added
- Original Message From: Len Popp <[EMAIL PROTECTED]> To: Tomcat Users List Sent: Monday, January 15, 2007 12:06:09 PM Subject: Re: Trailing slash added >>If you move a file you will have to fix some links, no matter what >>sort of URLs you use. If nothing else, the links that referred to the >>moved file will be broken. Yes >>But regardless, there are many web sites >>that do use relative URLs, and that would be a problem in this case. Yes, there's nothing wrong with using relative URLs. But using context relative URLs minimizes the amount of changes that need to be made to the *file that contains them*, as opposed to just relative URLs mentioned inside a file. Consider index.jsp with this directory structure: /folder1/folder2/index.jsp And the code in index.jsp with relative URLs Link Text Page 2 If index.jsp is moved from /folder1/folder2/index.jsp , to /folder1/index.jsp then because there are relative URLs inside index.jsp, they need to be changed as follows: Link Text Page 2 But, if all URLs inside index.jsp were context relative as follows: Link Text Page 2 Then, no matter how many times you move index.jsp the code inside index.jsp that refers to context relative URLs won't change. The amount of code that needs to change appears small in this case but it can save a lot of work, typing and debugging (if the IDE doesn't take care of the changes) on larger projects. But whatever code is refering to index.jsp itself will have to change - that's unavoidable - but at least you've minimized amount of code that needs to be changed *inside index.jsp itself*. >>It doesn't matter if it's done by URLRewriteFilter or some other >>method because it's the browser that interprets the relative URLs, not >>the server. If the containing page's URL looks like a file when it's >>really a directory, the browser will get them wrong. That's why the >>usual behaviour for servers is to use a re-direct to add "/" or >>"/index.html" or something. The only other correct response to a >>"bare" directory name would be to return an error, which is >>inconvenient for users. I don't really understand why one would want to get rid of the trailing slash. -Rashmi Want to start your own business? Learn how on Yahoo! Small Business. http://smallbusiness.yahoo.com/r-index - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: different version of java
> From: Pid [mailto:[EMAIL PROTECTED] > Subject: Re: different version of java > > if the OP wants to run the 1.4 jvm, he'll need the compatibility pack > for 5.5 and therefore 2 separate installations, i think(?). This is getting rather esoteric, but since each Tomcat instance would use its own conf directory, the catalina.properties file for the 1.5 version could be modified to not look in common/endorsed (where the compatibility jars go). The time would be much better spent verifying the older app on 1.5. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: different version of java
yes, quite agree. but unless i read something wrong, both 1.5 and the servlet specs are backward compatible - so testing should be the route we encourage in this case, if the OP is able to take that route. note that he's running tomcat 5.5, and was enquiring about the 1.4 and 1.5 jvms. if the OP wants to run the 1.4 jvm, he'll need the compatibility pack for 5.5 and therefore 2 separate installations, i think(?). in all likelyhood, if testing has been completed in 1.4 for the one webapp, he ought to be testing again to deploy it on 5.5, regardless of the jvm. (which is why I asked the OP why he thought he wanted two jvms, rather than speculative reasons why it might be a requirement) David Kerber wrote: It's not the code port that is time-consuming; it's the testing and verification of correct operation of every function in that code. fausto mancini wrote: The problem is for 'which' servlet specification your applications are designed for... I do not see too much effort in porting a J2EE application in a new JEE compliant web-container (TOMCAT included)... On Mon, 15 Jan 2007, Raffaele Viola wrote: Date: Mon, 15 Jan 2007 17:31:43 +0100 From: Raffaele Viola <[EMAIL PROTECTED]> Reply-To: Tomcat Users List To: Tomcat Users List Subject: Re: different version of java Pid wrote: > can you explain why you need different versions of java, Raffaele? He might have an application that has been fully tested in one environment (1.4?) and not in the latest (1.5). I have apps that are stuck running in Tomcat 4.1 because migration testing takes a /long/ time. Yes this is the problem. I've installed two different tomcat, one using the java1.4 and the other using the java1.5 because I have two application one tested for 1.4 and one tested for 1.5. And I want to know if I can use only one installation of tomcat. Regards Raffo - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How can I get the unparsed URI from inside a servlet
HttpServletRequest.getRequestURI() does not provide the unparsed URI. 1) It does not include the query string 2) You cannot tell if the URL has a question mark in it, if there is no query string (e.g. http://foo/bar? And http://foo/bar look the same). 3) You cannot tell if the session ID came from the URL or a cookie. Thanks, - Marc Tim Funk wrote: > What about HttpServletRequest.getRequestURI()? > > -Tim > [EMAIL PROTECTED] wrote: > > Is it possible to get the unparsed URI from inside the service method > > of an HttpServlet? I am using tomcat 5.5.9. > > > > I notice that the HttpServletRequest parameter to this method is > > - implemented by org.apache.catalina.connector.RequestFacade, > > - which contains a org.apache.catalina.connector.RequestFacade object, > > - which contains a org.apache.coyote.Request object, > > - which as a field called unparsedURIMB, which is the data that I want. > > > > In other words, I can see the information in the debugger, but there > > is no way that I can find to access it. > > > > In case anyone is interested, the reason I need this data is that I am > > writing a proxy server that gets its results by looking up URLs in a > > previously populated database, rather than fetching them. Unless the > > URL matches exactly, it will not be found. Being semantically > > equivalent (such as the URL returned by > > HttpServletRequest.getRequestURL) is not a good enough match. > > > > A way to get this data through proper APIs would be nice, but a hack > > would be useful too. -- This message was sent from a MailNull anti-spam account. You can get your free account and take control over your email by visiting the following URL. http://mailnull.com/ - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
About using encryption with Mod_jk
Hi everyone! First of all, thanks in advance. I was searching the web in the way to find if it's possible to enable or activate any kind of encryption, this is SSL or some kind of hash, trough my Apache webserver (which faces the outdoor intenet side) and my Tomcat5 server, on the inside of my network, using Mod_jk stantards. The graphic of this may be: INET <---SSL---> Apache <--- Mod_jk (I need encryption here) --->Tomcat5 Unfortunatelly I couldn't find any related stuff from version 3.2 up to date. Does this exists? Again, thanks in advance. Greetings, Debianito. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: different version of java
It's not the code port that is time-consuming; it's the testing and verification of correct operation of every function in that code. fausto mancini wrote: The problem is for 'which' servlet specification your applications are designed for... I do not see too much effort in porting a J2EE application in a new JEE compliant web-container (TOMCAT included)... On Mon, 15 Jan 2007, Raffaele Viola wrote: Date: Mon, 15 Jan 2007 17:31:43 +0100 From: Raffaele Viola <[EMAIL PROTECTED]> Reply-To: Tomcat Users List To: Tomcat Users List Subject: Re: different version of java Pid wrote: > can you explain why you need different versions of java, Raffaele? He might have an application that has been fully tested in one environment (1.4?) and not in the latest (1.5). I have apps that are stuck running in Tomcat 4.1 because migration testing takes a /long/ time. Yes this is the problem. I've installed two different tomcat, one using the java1.4 and the other using the java1.5 because I have two application one tested for 1.4 and one tested for 1.5. And I want to know if I can use only one installation of tomcat. Regards Raffo - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: different version of java
> From: Leon Rosenberg [mailto:[EMAIL PROTECTED] > yes, but you can't run them both at the same time. Can we distinguish *installation* and *instance*? Leon, you're reading 'instance' and assuming 'installation'; Chris, you're reading 'installation' and (sometimes implicitly) assuming 'instance'. On this machine I have one Tomcat 5.0 *installation* in c:\java\tomcat50, but multiple *instances* in c:\cattery\xxx, c:\cattery\yyy (names changed to protect the projects concerned). The instances each have their own conf, logs, temp, webapps and work directories, plus a convenience script to start each one. The installation contains the rest. With this approach I can run multiple instances at one time, each on their own ports, from one installation. - Peter - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: different version of java
> From: Leon Rosenberg [mailto:[EMAIL PROTECTED] > Subject: Re: different version of java > > yes, but you can't run them both at the same time. Well, you can, but it would be ugly. You could have the secondary Tomcat configured with different ports, and a dummy secondary app in the primary Tomcat that redirects to the real secondary app in the secondary Tomcat. More trouble than it's worth. I'd spend my time verifying the 1.4 app on 1.5. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: different version of java
The problem is for 'which' servlet specification your applications are designed for... I do not see too much effort in porting a J2EE application in a new JEE compliant web-container (TOMCAT included)... On Mon, 15 Jan 2007, Raffaele Viola wrote: Date: Mon, 15 Jan 2007 17:31:43 +0100 From: Raffaele Viola <[EMAIL PROTECTED]> Reply-To: Tomcat Users List To: Tomcat Users List Subject: Re: different version of java Pid wrote: > can you explain why you need different versions of java, Raffaele? He might have an application that has been fully tested in one environment (1.4?) and not in the latest (1.5). I have apps that are stuck running in Tomcat 4.1 because migration testing takes a /long/ time. Yes this is the problem. I've installed two different tomcat, one using the java1.4 and the other using the java1.5 because I have two application one tested for 1.4 and one tested for 1.5. And I want to know if I can use only one installation of tomcat. Regards Raffo - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Trailing slash added
If you move a file you will have to fix some links, no matter what sort of URLs you use. If nothing else, the links that referred to the moved file will be broken. But regardless, there are many web sites that do use relative URLs, and that would be a problem in this case. It doesn't matter if it's done by URLRewriteFilter or some other method because it's the browser that interprets the relative URLs, not the server. If the containing page's URL looks like a file when it's really a directory, the browser will get them wrong. That's why the usual behaviour for servers is to use a re-direct to add "/" or "/index.html" or something. The only other correct response to a "bare" directory name would be to return an error, which is inconvenient for users. -- Len On 1/14/07, Rashmi Rubdi <[EMAIL PROTECTED]> wrote: Instead of relative URLs, it's better to use context relative URLs. With context relative URLs if the page containing the context relative links is moved to a different folder the code won't have to change. Context relative URLs always begin with / and start from the root folder of your app, for example /root_folder/somefile.jsp But, if you use relative URLs then every time you move your file to a different folder the URLs in that file will also have to change depending on the depth of the new folder. Relative URLs never begin with a / , and they look something like somefolder/somefile.jsp, or ../somefolder/somefile.jsp I haven't tested the effect of URL Rewriting on the trailing slash on context relative URLs. But with URL Rewriting may of Apache's features, become available on Tomcat as well. For example you can rewrite http://www.domainname.com to http://domainname.com -Rashmi - Original Message From: Len Popp <[EMAIL PROTECTED]> To: Tomcat Users List Sent: Sunday, January 14, 2007 7:41:03 PM Subject: Re: Trailing slash added Note that if you allow the browser to refer to directories without the trailing slash, you will break the handling of relative URLs on those pages. When the user clicks on a link with a relative URL, the browser has to convert that to an absolute URL. If the browser doesn't know that the current page is a directory it will calculate the absolute URL incorrectly. -- Len On 1/14/07, Rashmi Rubdi <[EMAIL PROTECTED]> wrote: > I think you can customize it with URL Rewriting Filters. > > Google URLRewriteFilter to find pre-built packages, or you can write your own. > > -Rashmi > > - Original Message > From: Tim Funk <[EMAIL PROTECTED]> > To: Tomcat Users List > Sent: Sunday, January 14, 2007 12:26:39 PM > Subject: Re: Trailing slash added > > > There is no way to customize this behavior other than overriding the > default servlet with your own implementation. > > -Tim > > lightbulb432 wrote: > > I noticed that Tomcat adds a trailing slash automatically when it detects > > that the requested resource points to an existing directory. While I know > > that Apache web server offers plenty of configuration options to control and > > customize this behavior, I'm unfamiliar with similar customization > > capability within Tomcat. (Where is this trailing slash behavior specified > > for Tomcat? Or is it a compiled-in setting function that cannot be changed?) > > > > How can I customize this and other Apache-like settings? Is the only option > > to front Tomcat with Apache? > Sucker-punch spam with award-winning protection. Try the free Yahoo! Mail Beta. http://advision.webevents.yahoo.com/mailbeta/features_spam.html - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: different version of java
yes, but you can't run them both at the same time. regards Leon On 1/15/07, Christopher Schultz <[EMAIL PROTECTED]> wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Leon, Leon Rosenberg wrote: > Aehm... and how exactly you suppose to run one tomcat instance in two > different jvms at the same time? :-) You said two separate installations. You can use the same install with multiple JVMs by using TOMCAT_HOME, CATALINA_BASE, and JAVA_HOME environment variables set. One installation, but you can choose your VM, etc. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFq7KX9CaO5/Lv0PARAuYPAKDAVUK6vpeQLHkdmw5PvnfQnsIW8QCbBwEs MhTOq8s0O6kO2qCnCaK+2YM= =B1Hl -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: different version of java
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Leon, Leon Rosenberg wrote: > Aehm... and how exactly you suppose to run one tomcat instance in two > different jvms at the same time? :-) You said two separate installations. You can use the same install with multiple JVMs by using TOMCAT_HOME, CATALINA_BASE, and JAVA_HOME environment variables set. One installation, but you can choose your VM, etc. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFq7KX9CaO5/Lv0PARAuYPAKDAVUK6vpeQLHkdmw5PvnfQnsIW8QCbBwEs MhTOq8s0O6kO2qCnCaK+2YM= =B1Hl -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using tomcat as client application
After some trouble starting embedded tomcat I manage to use it for what I want. Except one thing. When I start it like application it's ok but when I start it from within my signed applet it doesnt work at all. It looks like some ClassLoader's issues. I also have similar ClassLoader issues when I start that same application within Eclipse. Is there any way to manage it to work in that case. Leon Rosenberg wrote: The probably easiest way for you is to build a mini container-application which contains embedded tomcat with your app. At least I would give it a try. regards Leon On 1/12/07, Danilo Cubrovic <[EMAIL PROTECTED]> wrote: Hi all. I seen this thing I need exists for php years ago but not sure is anyone make this with tomcat. I have web application (java jsf+xml) that works fine on tomcat. I also have some significant numebr of users that use client version of this program (java applet+xml) In most of the part this is sthe same code except for the presentation layer. Well , ass you all know, this is pain in the a.. when you have to work parallel on two version plus web version is much better in many ways. What I'm intersting is next thing. Can I pack somehow web application and tomcat and install it on user client pc. (I will create setup.exe and send iton cd like client they use now) So when client click on shortcut on his/her pc (all of them are windows operated) he gets this application started via tomcat. Well there is trick. In order to work with all firewalls dont want to start tomcat as classic webserver but to use it as background application to handle requests and generate pages ... Is there some tomcat solution that can work like this? Danilo Cubrovic - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: different version of java
On 1/15/07, Christopher Schultz <[EMAIL PROTECTED]> wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Leon, Leon Rosenberg wrote: > no. > you need two separate tomcat installations. Technically, Raffo can use a single Tomcat installation but he must use two different instances of his JVMs in order to do this. There's also the "1.4 compatibility library" monkey-wrench thrown in that makes this a challenge, and just having two separate installs might have everything easaier. Aehm... and how exactly you suppose to run one tomcat instance in two different jvms at the same time? :-) Leon - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFq6fs9CaO5/Lv0PARAtwYAJ44W4Ns0sDIfKmAFlRN5wlESkNYxACgo6tT GehnvGt52ST23TjekFFp0WI= =cXYP -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat unexpectedly shuts down
> From: Nelson, Tracy M. [mailto:[EMAIL PROTECTED] > Subject: RE: Tomcat unexpectedly shuts down > > Anyhill doesn't call System.exit(), does it? If so, that'll > take Tomcat down. Ant itself calls System.exit() when errors are detected, so unless it's running in a separate process, that might be the cause. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: different version of java
Pid wrote: > can you explain why you need different versions of java, Raffaele? He might have an application that has been fully tested in one environment (1.4?) and not in the latest (1.5). I have apps that are stuck running in Tomcat 4.1 because migration testing takes a /long/ time. Yes this is the problem. I've installed two different tomcat, one using the java1.4 and the other using the java1.5 because I have two application one tested for 1.4 and one tested for 1.5. And I want to know if I can use only one installation of tomcat. Regards Raffo
RE: Tomcat unexpectedly shuts down
| From: Brown, Carlton [mailto:[EMAIL PROTECTED] | Sent: Thursday, 11 January, 2007 16:49 | | In catalina.out I see the Anthill application going through a shutdown | sequence right before the time Tomcat dies. So my assumption, maybe | invalid, is that it's shutting down because Tomcat instructed it to do | so. Anyhill doesn't call System.exit(), does it? If so, that'll take Tomcat down. - The information contained in this message is confidential proprietary property of Nelnet, Inc. and its affiliated companies (Nelnet) and is intended for the recipient only. Any reproduction, forwarding, or copying without the express permission of Nelnet is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to this e-mail. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: different version of java
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Pid, Pid wrote: > can you explain why you need different versions of java, Raffaele? He might have an application that has been fully tested in one environment (1.4?) and not in the latest (1.5). I have apps that are stuck running in Tomcat 4.1 because migration testing takes a /long/ time. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFq6g69CaO5/Lv0PARAlSDAJ9jwD62x0hUDsjFKLd2UaHgYwjKkACgpj+V vjT6f1+OiGMM4QUWSHlnLGU= =D8s/ -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: different version of java
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Leon, Leon Rosenberg wrote: > no. > you need two separate tomcat installations. Technically, Raffo can use a single Tomcat installation but he must use two different instances of his JVMs in order to do this. There's also the "1.4 compatibility library" monkey-wrench thrown in that makes this a challenge, and just having two separate installs might have everything easaier. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFq6fs9CaO5/Lv0PARAtwYAJ44W4Ns0sDIfKmAFlRN5wlESkNYxACgo6tT GehnvGt52ST23TjekFFp0WI= =cXYP -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Runtime.getRuntime.exec() problem
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hui, hui zhang wrote: > "TOP" is only an example in this case. Actually I am running some > program which can not stop running until terminating it by "Control + > C". In this case, Tomcat can not run the following code if the external > application does not stop. I need a solution to make my webapp running > in this case. Thank you. Please post the code for your servlet. There is no reason that spawning another process should stall your servlet unless you are explicitly waiting for that process to exit. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFq6Z49CaO5/Lv0PARAk6LAJ9QmM6uhmacn3bM9RF9OzV/ryGZ4gCfWK25 9IlIku8nTfZtu8ZAteYakjw= =BHtQ -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to display chinese chars in JSP / encoding UTF-8 without <@page encoding> tag
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 John, John McPeek wrote: > Why are you using UTF8 in stead on UTF16. With UTF8 you have to escape > all the characters, right? UTF16 will always use 2-byte characters even when it's not necessary. For instance, all of your HTML markup will be 2-byte characters, increasing the data size by a factor of 2. Is there a compelling reason to use UTF16 instead of UTF8? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFq6Xn9CaO5/Lv0PARAq1bAJ9axlDWYF0h9DO8cdDQ4/OJuAUsWACgvuSD Ml5omji6HB7fGZC1cOsqU6Q= =q4BC -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to display chinese chars in JSP / encoding UTF-8 without <@page encoding> tag
Thank you for your answers. After some tests, i have upgraded my Tomcat server from 4.x to 5.5, and i have done the same thing with my web application from servlet 2.3 to servlet 2.4. Now i can use the xml element jsp-config and *.jsp UTF-8 It works fine, and i don't have to define in each jsp the encoding. For the question of which UTF has to be used : 8 or 16, i 'm using UTF-8 because the size of the page. With UTF-16, the jsp pages are twice heavier than with UTF-8. JP -Message d'origine- De : John McPeek [mailto:[EMAIL PROTECTED] Envoyé : dimanche 14 janvier 2007 20:46 À : Tomcat Users List Objet : Re: How to display chinese chars in JSP / encoding UTF-8 without <@page encoding> tag Why are you using UTF8 in stead on UTF16. With UTF8 you have to escape all the characters, right? I was on a project for a Japanese site once and we used UTF16. It was a lot easier to work with. Eclipse will show it to you just like normal text(Chinese). All you have to do is set the encoding to be UTF16 in the files properties. You still need the <%@ page contentType="text/html; charset=UTF-16"%> line, but it is a lot easier to read and maintain. John >>From: Pulkit Singhal [mailto:[EMAIL PROTECTED] >>Subject: Re: How to display chinese chars in JSP / encoding >>UTF-8 without <@page encoding> tag >> >>I think you can set the -DFileEncoding flag or something >>to be UTF-8 in the java options of the script you use to >>start tomcat. >> >> > >It's -Dfile.encoding=UTF-8 (or UTF8; either is acceptable). > > - Chuck > > >THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY >MATERIAL and is thus for use only by the intended recipient. If you >received this in error, please contact the sender and delete the e-mail >and its attachments from all computers. > >- >To start a new topic, e-mail: users@tomcat.apache.org >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > > > > ** Ce message et ses pièces jointes sont confidentiels et établis a l'intention exclusive de ses destinataires. Tout message électronique est susceptible d'altération. SOGITEC décline toute responsabilité au titre de ce message s'il a été altéré, déformé ou falsifié. Si vous n'êtes pas destinataire de ce message, merci de le détruire immédiatement. ** - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help loading XML config file via Init Servlet
On 1/14/07, James Dekker <[EMAIL PROTECTED]> wrote: Hello there, I am using the Apache Commons Digester to load an XML config file via a servlet with init params... I keep getting this error when I start Tomcat 5.5.9 and have deployed the war file via my build script: INFO: Deploying web application archive coffeebreak.war 2007-01-14 03:10:33,050 WARN [org.coffeebreak.logging.Log4jInitServlet] - Loaded: log4j.properties file attributes-config.xml not found, /Developer/JavaTools/tomcat/jakarta- tomcat-5.5.9/bin/WEB-INF/classes/org/coffeebreak/config/attributes- config.xml Try using getRealPath() . Here's some code a wrote a while back: /** * Load log4j * * @web.servlet * display-name="log4j-init" * load-on-startup="1" * name="com.infoseg.mr.xtutil.Log4jInit" * * @web.servlet-init-param name="log4j-init-file" * value="WEB-INF/properties/log4j.properties" * */ public class Log4jInit extends HttpServlet { public void init() { String prefix = getServletContext().getRealPath("/"); String file = getInitParameter("log4j-init-file"); // if the log4j-init-file is not set, then no point in trying if(file != null) { PropertyConfigurator.configure(prefix+file); } else { throw new RuntimeException("Cannot load InitParameter from web.xml: log4j-init-file"); } } public void doGet(HttpServletRequest req, HttpServletResponse res) {} HTH, Robert - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Questions about JSP programming
Thanks Rashmi, Zack, and Pid Sorry it's my fault. <%@ include file="request.getParameter("f") %> should not be compiled successfully. I fisrt tested , it works, TOMCAT translated and generated the .java and .class file, then I just modified the same jsp file with <%@ ... %>, TOMCAT compiled it failed. TOMCAT deleted the .java file, but kept the .class. When I load tested the URL again, Some requests will get 500 error, while most are still get the right response! Now I understood the two include difference. Thanks again. Thx, Xuekun On 1/15/07, Pid <[EMAIL PROTECTED]> wrote: Firstly, all directives of the following form are executed at compile time: <%@ ... %> This means that URL request parameters are not available (yet) to the JSP. If the OP was using an include file directive containing the string 'request.getParameter("f")' it is unlikely that it ever worked as expected. The JSTL approach below is likely to work - though I can't think of a good or safe reason for allowing JSPs to load file system paths. (if you're on a unix-like system, try loading '/etc/passwd') Secondly, operates at *request time* and may therefore be more pertinent to the case here. OP should google for 'JSP directive tutorials', the top result was enlightening when I checked. Lastly, the OP should report on which tool (if any) he was using to load test the URL. It may simply be the case (assuming the above error is corrected) that the excessive load caused the machine to run out of memory. The normal approach is to examine the logs to determine the source of the 500 error, the list will likely provide more advice on receipt of this information. p Rashmi Rubdi wrote: > Zack, > > I don't think it's the include directive alone causing a memory error. I'm guessing that there might be a lot of processes in his application running on Tomcat, eventually causing an out of memory error or may be the system does not have minimum required memory to run Tomcat. > > With Tomcat 5.5, and about 2GB RAM I'm not getting an OutOfMemory error while running 3 applications simultaneously on Tomcat, when I tried his example of include directives, I got the error on the screen and it was logged in Tomcat's logs as well. > > I ran my test as follows: http://practice:8080/p/test2/test2.jsp?f=page.html , and test2.jsp had <%@ include file="request.getParameter("f")" %> (which I believe won't work) > > Here's parts of the error, if it helps him: > > HTTP Status 500 - > type Exception report > message > description The server encountered an internal error () that prevented it from fulfilling this request. > exception > org.apache.jasper.JasperException: Unable to load class for JSP > org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:598) > org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:137) > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305) > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) > javax.servlet.http.HttpServlet.service(HttpServlet.java:802) > root cause > java.lang.ClassNotFoundException: org.apache.jsp.p.test2.test2_jsp > java.net.URLClassLoader$1.run(URLClassLoader.java:200) > java.security.AccessController.doPrivileged(Native Method) > java.net.URLClassLoader.findClass(URLClassLoader.java:188) > org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:133) > org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:65) > org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:596) > org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:137) > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305) > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) > javax.servlet.http.HttpServlet.service(HttpServlet.java:802) > > > Also, if he sets up JSTL1.1 correctly, the following will also work: > > <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"; %> > > > Where param.f , is the equivalent of request.getParameter("f") > > -Rashmi > > > Rashmi, > > I'm curious as to why his second approach causes the memory error that > he gets, would you have any insight as to why it's happening? I've > checked out the docs and they don't indicate anything about the way the > include directive uses memory. I'm thinking we might actually have a > bug to report. > > Zack > > > > > The fish are biting. > Get more visitors on your site using Yahoo! Search Marketing. > http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php > > - > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail:
Re: Questions about Apache Portable Runtime on Tomcat 5.5.x
Allen Young wrote: > First, how can I use APR on a windows install version of tomcat 5.5.x. I've > found several tutorials about setting APR, all of which are about adding > something in catalina.bat. As you can see, windows install version doesn't > have that file but do contains a tcnative-1.dll file in the "bin" > directory. So how can I use APR on a windows install version? Or it has > been > automatically used already? tcnative-1.dll in Tomcat's bin directory should be enough to make Tomcat use it. If you're not sure whether or not the native DLL is actually loaded, look at catalina.out. If Tomcat couldn't find the DLL it will log a message similar to 29.12.2006 16:31:10 org.apache.catalina.core.AprLifecycleListener lifecycleEvent INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [...] (if you didn't comment the AprLifecycleListener in server.xml). Moreover, the class names for the Protocol handlers differ between APR and non-APR. Without APR loaded you'll see something like 29.12.2006 16:31:10 org.apache.coyote.http11.Http11BaseProtocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 in catalina.out. With APR this will look like 23.07.2006 15:34:47 org.apache.coyote.http11.Http11AprProtocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 Regards mks - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: different version of java
of course, if the question is actually "can i use jars compiled for 1.4 in a webapp on a tomcat 5.5 installation" then the answer is 'yes'. can you explain why you need different versions of java, Raffaele? p Leon Rosenberg wrote: no. you need two separate tomcat installations. regards Leon On 1/15/07, Raffaele Viola <[EMAIL PROTECTED]> wrote: Hi all, I have two different web application under tomcat 5.5.17. Can I use a different version of java for each of application. In example: webapps1 -> java1.4 webapps2 -> java 1.5 Thanks all Raffo - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: different version of java
no. you need two separate tomcat installations. regards Leon On 1/15/07, Raffaele Viola <[EMAIL PROTECTED]> wrote: Hi all, I have two different web application under tomcat 5.5.17. Can I use a different version of java for each of application. In example: webapps1 -> java1.4 webapps2 -> java 1.5 Thanks all Raffo - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Questions about JSP programming
Firstly, all directives of the following form are executed at compile time: <%@ ... %> This means that URL request parameters are not available (yet) to the JSP. If the OP was using an include file directive containing the string 'request.getParameter("f")' it is unlikely that it ever worked as expected. The JSTL approach below is likely to work - though I can't think of a good or safe reason for allowing JSPs to load file system paths. (if you're on a unix-like system, try loading '/etc/passwd') Secondly, operates at *request time* and may therefore be more pertinent to the case here. OP should google for 'JSP directive tutorials', the top result was enlightening when I checked. Lastly, the OP should report on which tool (if any) he was using to load test the URL. It may simply be the case (assuming the above error is corrected) that the excessive load caused the machine to run out of memory. The normal approach is to examine the logs to determine the source of the 500 error, the list will likely provide more advice on receipt of this information. p Rashmi Rubdi wrote: Zack, I don't think it's the include directive alone causing a memory error. I'm guessing that there might be a lot of processes in his application running on Tomcat, eventually causing an out of memory error or may be the system does not have minimum required memory to run Tomcat. With Tomcat 5.5, and about 2GB RAM I'm not getting an OutOfMemory error while running 3 applications simultaneously on Tomcat, when I tried his example of include directives, I got the error on the screen and it was logged in Tomcat's logs as well. I ran my test as follows: http://practice:8080/p/test2/test2.jsp?f=page.html , and test2.jsp had <%@ include file="request.getParameter("f")" %> (which I believe won't work) Here's parts of the error, if it helps him: HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: Unable to load class for JSP org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:598) org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:137) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) root cause java.lang.ClassNotFoundException: org.apache.jsp.p.test2.test2_jsp java.net.URLClassLoader$1.run(URLClassLoader.java:200) java.security.AccessController.doPrivileged(Native Method) java.net.URLClassLoader.findClass(URLClassLoader.java:188) org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:133) org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:65) org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:596) org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:137) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) Also, if he sets up JSTL1.1 correctly, the following will also work: <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"; %> Where param.f , is the equivalent of request.getParameter("f") -Rashmi Rashmi, I'm curious as to why his second approach causes the memory error that he gets, would you have any insight as to why it's happening? I've checked out the docs and they don't indicate anything about the way the include directive uses memory. I'm thinking we might actually have a bug to report. Zack The fish are biting. Get more visitors on your site using Yahoo! Search Marketing. http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JSTL c:if statements
Hi! I hade some similar strange problems when I had a very old xml jars. (like xml-api.jar etc) Check your jars for xml and update them. /Regards Per Jonsson -Original Message- From: rotvang [mailto:[EMAIL PROTECTED] Sent: den 12 januari 2007 06:32 To: users@tomcat.apache.org Subject: JSTL c:if statements I have Tomcat version 5.0.28, and I am trying to use the JSTL tags in my webapp. I have placed the 2 required JSTL jar files, "standard.jar" and "jstl.jar" into my WEB-INF/lib directory. The bizarre thing is that some of the JSTL standard tags work, and some don't! Even stranger, it doesn't break down by taglib--in other words, half of the "core" tags work, and half don't. Half of the "fmt" tags work, and half don't. Most importantly, works just fine, and with the EL, properly. However, none of the selection or conditional tags work: http://www.nabble.com/JSTL-c%3Aif--statements-tf2963977.html#a8292740 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail and the information it contains may be privileged and/or confidential. It is for the intended addressee(s) only. The unauthorised use, disclosure or copying of this e-mail, or any information it contains, is prohibited. If you are not an intended recipient, please contact the sender and delete the material from your computer. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
different version of java
Hi all, I have two different web application under tomcat 5.5.17. Can I use a different version of java for each of application. In example: webapps1 -> java1.4 webapps2 -> java 1.5 Thanks all Raffo
RE: Runtime.getRuntime.exec() problem
Process is a fiddly class to work with at the best of times. I can't say I've ever come across the exec of a Process not returning, when I've used it it will return immediatly from the exec() and you have to use Process.waitFor() if you want to wait for the program to terminate. A common problem doing this is that the standard output stream from the process fills up and blocks the waitFor() from ever returning as the process will not terminate until it's standard output is consumed. To do this I fork a separate thread just before calling waitFor() to read the standard output and error streams. This fixes the problem for me. Another not-so amusing problem is that if you don't explicitly close the input/output/error streams that Process returns they will get left hanging around and eventually you'll blow the OS limit on open file handles, so remember to close them. My code looks something like the following (I use a ProcessBuilder), needs a bit of work with try/finally to close the streams in all cases. If you need the output the external program generates then have the StreamGobbler store the output in a StringBuilder or something. You should also read this article which I where I got some of my info from originally. http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html HTH // create and start the process - redirect stderr to stdout ProcessBuilder processBuilder = new ProcessBuilder( commands ); processBuilder.redirectErrorStream( true ); // this call does not block Process process = processBuilder.start(); // create the gobbler to read the stdout/stderr from the process StreamGobbler outputGobbler = new StreamGobbler( process.getInputStream() ); // kick off the separate stream gobbler thread outputGobbler.start(); // wait for the process to terminate - blocks int exitCode = process.waitFor(); // wait for the gobbler to terminate - blocks outputGobbler.join(); // close all the process IO streams try { process.getInputStream().close(); } catch ( IOException e ) { // ignore error } try { process.getOutputStream().close(); } catch ( IOException e ) { // ignore error } try { process.getErrorStream().close(); } catch ( IOException e ) { // ignore error } return exitCode; -Original Message- From: Zack Grafton [mailto:[EMAIL PROTECTED] Sent: 15 January 2007 05:39 To: Tomcat Users List Subject: Re: Runtime.getRuntime.exec() problem hui zhang wrote: > Zack Grafton wrote: >> hui zhang wrote: >>> Zack Grafton wrote: hui zhang wrote: > Hi Everybody, > > Now I am trying to launch an external application, for example, > "top" ,in my web application, and killing it by PID after a while. > But when I execute Runtime.getRuntime.exec("top") in my JSP page > or Servlet, Tomcat is stuck in that page and do not display > anything because it can not stop running until that "commnad" is > terminated, which means it waiting for the response from > Runtime.getRuntime.exec("top"). It seems that it will run forever. > Is there any solution to solve this problem? I mean that JSP page > can execute the following code no matter if it finish the process > is done. > > BTW, I do not use System.exit() in my program. It may cause > Security Manager problem. > Thanks and best regards, > > Hui > > -- > --- To start a new topic, e-mail: users@tomcat.apache.org To > unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > Hey, I'm new to the list and all, but you might want to try executing "top" in batch mode. The command line option is -b on my gentoo linux box. Also, be careful of executing commands from applets and such. Another thing might be user permissions as well. You could try executing the command and redirecting the output to a file and parsing the file instead. Zack Grafton --- -- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] >>> Hi, >>> >>> "TOP" is only an example in this case. Actually I am running some >>> program which can not stop running until terminating it by "Control >>> + C". In this case, Tomcat can not run the following code if the >>> external application does not stop. I need a solution to make my >>> webapp running in this case. Thank you. >>> >>> Regards, >>> >>
Re: Questions about JSP programming
Zack, I don't think it's the include directive alone causing a memory error. I'm guessing that there might be a lot of processes in his application running on Tomcat, eventually causing an out of memory error or may be the system does not have minimum required memory to run Tomcat. With Tomcat 5.5, and about 2GB RAM I'm not getting an OutOfMemory error while running 3 applications simultaneously on Tomcat, when I tried his example of include directives, I got the error on the screen and it was logged in Tomcat's logs as well. I ran my test as follows: http://practice:8080/p/test2/test2.jsp?f=page.html , and test2.jsp had <%@ include file="request.getParameter("f")" %> (which I believe won't work) Here's parts of the error, if it helps him: HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: Unable to load class for JSP org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:598) org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:137) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) root cause java.lang.ClassNotFoundException: org.apache.jsp.p.test2.test2_jsp java.net.URLClassLoader$1.run(URLClassLoader.java:200) java.security.AccessController.doPrivileged(Native Method) java.net.URLClassLoader.findClass(URLClassLoader.java:188) org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:133) org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:65) org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:596) org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:137) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) Also, if he sets up JSTL1.1 correctly, the following will also work: <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"; %> Where param.f , is the equivalent of request.getParameter("f") -Rashmi Rashmi, I'm curious as to why his second approach causes the memory error that he gets, would you have any insight as to why it's happening? I've checked out the docs and they don't indicate anything about the way the include directive uses memory. I'm thinking we might actually have a bug to report. Zack The fish are biting. Get more visitors on your site using Yahoo! Search Marketing. http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Questions about JSP programming
Rashmi Rubdi wrote: I replied about the same time Zack replied, didn't know he was taking care of this. From you recent reply, by compilation do you mean JSPC pre-compilation? Or on the fly compile? Because I do get this error with on the fly compile (didn't try JSPC): org.apache.jasper.JasperException: Unable to load class for JSP org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:598) java.lang.ClassNotFoundException: org.apache.jsp.p.test2.test2_jsp java.net.URLClassLoader$1.run(URLClassLoader.java:200) -Rashmi - Original Message From: Xuekun Hu <[EMAIL PROTECTED]> To: Tomcat Users List Sent: Monday, January 15, 2007 2:28:00 AM Subject: Re: Questions about JSP programming Hi, Rashmi, thanks for replying. On 1/15/07, Rashmi Rubdi <[EMAIL PROTECTED]> wrote: I recommend SDN's JSP forum : http://forum.java.sun.com/forum.jspa?forumID=45 And for JSP Tag Libraries this mailing list : http://jakarta.apache.org/taglibs/#MailingLists Great. Thanks again. :-) 1) I tested your jsp: include, both files returned the same size when tested with Firefox's page size extension tool. I got 19KBs in both cases. But if you just look at the size of test.jsp *before* it translates and processes the request, it's size is 0.1 KB because of the code it contains. I fixed it in another reply. 2) This syntax <%@ include file="request.getParameter("f")" %> , is not correct. The correct syntax only allows a URL in the file attribute as shown here: http://java.sun.com/products/jsp/syntax/2.0/syntaxref209.html#1003408 , since the include is a directive and not a JSP action. Yes, I know it's not very syntax correct. however, there is no error in compilation. So I wonder maybe there is a deeper reason that it doesn't work. Thx, Xuekun - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Need Mail bonding? Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users. http://answers.yahoo.com/dir/?link=list&sid=396546091 - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Rashmi, I'm curious as to why his second approach causes the memory error that he gets, would you have any insight as to why it's happening? I've checked out the docs and they don't indicate anything about the way the include directive uses memory. I'm thinking we might actually have a bug to report. Zack - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]