Re: Shared code but different pages on different virtual hosts? WAS: RE: BOOBIES!
Thomas, It seems more trouble than it is worth. I can think of two ways that make sense to do this: 1) Bundle all the common components in a jar or series of jars, and put them in with each separate webapp, or in /shared/lib, then use separate JSPs for each 2) Have common *everything*, but define the JSPs (or whatever) to have enough logic to present the right data based on the context (that could be webapp context or user context) Harris, Thomas wrote: I wanted to have multiple web applications defined, all using the same core Java code, but each having different JSP and tag file folders. I tried following the example in the Tomcat Wiki at http://wiki.apache.org/tomcat/CreateVirtualHosts, but it assumes all the web apps have the same JSP and tag files, inside a WAR. I would like to package up all of the common code for all the sites in a WAR file, then point each separate web app to private JSP and tag file folders. What I was trying to determine is: 1. Is it even possible? 2. If so, how could it be done? As for the subject line, my previous email sat with the subject Shared code but different pages on different virtual hosts? for two weeks without a single response, and I'm still waiting so that my project can continue down it's path. No offense is meant, and it should be pretty obvious, I think, that I just wanted a little attention for my issue. Sorry for any offense it may have caused. Tom -Original Message- From: Mike Wannamaker [mailto:[EMAIL PROTECTED] Sent: Friday, July 21, 2006 2:09 PM To: 'Tomcat Users List' Subject: RE: BOOBIES! I believe the subject was posted under different subject heading with no response and he's trying to get people looking at it, which I'm sure he will now. That said, some proper netiquette is appreciated in forums. I believe that I'm doing something similar, but using a different approach. I too want to have some common resources that all webapps use. To do this I'm installing my own FileDirContext for web apps which I inject what we call aliases. IE: /basefiles = /home/tomcat/basefiles Thus when someone in the webapp makes a request for /basefiles/common.css it looks it up in /home/tomcat/basefiles, which is outside of any web app context. Is this what you want to do? Mike Wannamaker -Original Message- From: Mead, Jennifer L - VSCM [mailto:[EMAIL PROTECTED] Sent: July 21, 2006 2:01 PM To: Tomcat Users List Subject: RE: BOOBIES! Could this person (inject other undesirable word) please consider the fact that women are in the user's group also. Jennifer -Original Message- From: Harris, Thomas [mailto:[EMAIL PROTECTED] Sent: Friday, July 21, 2006 10:59 AM To: users@tomcat.apache.org Subject: BOOBIES! I have been trying to determine how to configure Tomcat 5.5.17 to have a shared appBase on multiple webapps, but have a different set of JSPs for each web app. I've followed the Wiki's CreateVirtualHosts page to configure multiple webapps that use exactly the same WAR file. But, I would like to share the Java, but supply a different docBase for each site. Is this possible? Reference: http://wiki.apache.org/tomcat/CreateVirtualHosts Thanks! Tom Harris This communication is intended solely for the addressee and is confidential and not for third party unauthorized distribution - 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] This communication is intended solely for the addressee and is confidential and not for third party unauthorized distribution - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- __ Avi Deitcher [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: Shared code but different pages on different virtual hosts? WAS: RE: BOOBIES!
To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This communication is intended solely for the addressee and is confidential and not for third party unauthorized distribution - 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] This communication is intended solely for the addressee and is confidential and not for third party unauthorized distribution - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- __ Avi Deitcher [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: Shared code but different pages on different virtual hosts? W AS: RE: BOOBIES!
To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This communication is intended solely for the addressee and is confidential and not for third party unauthorized distribution - 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] This communication is intended solely for the addressee and is confidential and not for third party unauthorized distribution - 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] -- __ Avi Deitcher [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: Don´t work :(
Did you try explicitly setting the protocol, i.e. http://127.0.0.1:8080/ For an odd reason, some browsers don't automatically assume http when going to localhost. Also, did you check the host configuration for Tomcat? Bernardo Martin wrote: i haven´t any proxy settings :( 2006/7/19, Marcello [EMAIL PROTECTED]: Checked your browser proxy settings yet? Hi. Bernardo Martin wrote: hi list, I have a rarely problem with jakarta-tomcat 5.5.17. I install jdk1.5.0_07 first, httpd 2.2..0 second and jakarta tomcat 5.5.17at the end in suse 9.0, I had edit /etc/profiles when it was necessary but when i do /usr/local/apache/bin/apachectl start (any error) apache work at 127.0.0.1:80 in webbrowser /usr/local//apache-tomcat-5.5.17/bin/startup.sh Using CATALINA_BASE: /usr/local/apache-tomcat-5.5.17 Using CATALINA_HOME: /usr/local/apache-tomcat-5.5.17 Using CATALINA_TMPDIR: /usr/local/apache-tomcat-5.5.17/temp Using JRE_HOME: /usr/lib/java/jre webbrowser can´t connect at 127.0.0.1:8080 The firewall is down. what happend? Thanks - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- __ Avi Deitcher [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 Not An App Server
: [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] -- __ Avi Deitcher [EMAIL PROTECTED]
Re: OT (Mostly)
Marc, Have a look at MirrorJNDI, which creates an in-memory JNDI structure. I use it to test code that should run inside a servlet container and draw anything from JNDI. It has been a real boon to me. It is at http://www.smardec.com/products/jndi.html Marc Farrow wrote: I am using JUNIT to test java code. However, we have a class that pulls the connection pooling from Tomcat's connection pooling facility. If I am running these JUNIT tests outside of the Tomcat container is there a way to grab a connection pool from a running Tomcat instance? -- __ Avi Deitcher [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: Run shell script when web application start/restart
I don't think so. You could, theoretically, have a context listener that then executes a shell script, but that is really messy, and the security manager probably won't even allow it. If I understand correctly, you want to have the following happen on context restart: - JSP pages get rebuilt from some macros or config files I can think of two ways to do this. The not-so-great way is to have a context listener read the config files and generate the pages. The problem is that I don't know when JSP pages are compiled by the Tomcat engine - before or after context listeners are invoked. I believe you can force a re-compilation of the JSP pages at that point, but I am not sure how. The much smarter way is to ask why your JSP pages need to be macro/dynamically generated. JSP includes enough logic tags. Why not refactor your JSP pages so that they read the configuration files and output the appropriate information? This would be much cleaner, and probably wouldn't even require context restart? Tom Potter wrote: Jen, Just to make sure that we both talk about the same events : I don't want to restart the whole tomcat, only one web application, that is, by clicking on the start link(or restart) in on the admin page. I don't see how your suggestion would help me... if I'm missing something please make it clear to me... Rgds Thomas On 7/13/06, Mead, Jennifer L - VSCM [EMAIL PROTECTED] wrote: On my box the start and stop scripts are just that. .sh shell scripts. In your case I would just copy them to a save file and put in an execution string. The start scripts are in tomcat_home/bin. Jen -Original Message- From: Tom Potter [mailto:[EMAIL PROTECTED] Sent: Thursday, July 13, 2006 5:28 AM To: users@tomcat.apache.org Subject: Run shell script when web application start/restart The JSP pages in the Web application I install under Tomcat 4.1.30 are based on some configuration files the user wants to modify, thus I wrote a shell script to rebuild the JSP pages and repopulate the webapps folder. My question is that is there a way to hook up my shell script with the webapp start/stop proces so it would run at every startup, in other words the user would activate my script by restarting the application ? Thanks Thomas - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- __ Avi Deitcher [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: Run shell script when web application start/restart
Well, if you have to, from the shell script, you can probably connect to the tomcat manager URL and tell it to do the right thing. Still, all and all, it is hard to believe it isn't faster to refactor the JSP pages. Tom Potter wrote: The reason for me choosing the first, messy solution was that this had to be a quick fix, rewriting the logic in the JSP pages was out of the question (and way above the allocated budget ;) ). Of course I had the shell scripts and configuration files so it seemed just the right solution to use these tools in the startup process of the webapp. It seems that I can convince the cusomer to just run the shell scripts that modify(actually generate) the JSP pages but then I face an other problem. After generating and copying the JSP pages in the right place how can I tell tomcat (from the shell script) to restart the application (or to recompile the pages) ? Rgds Thomas On 7/13/06, Avi Deitcher [EMAIL PROTECTED] wrote: I don't think so. You could, theoretically, have a context listener that then executes a shell script, but that is really messy, and the security manager probably won't even allow it. If I understand correctly, you want to have the following happen on context restart: - JSP pages get rebuilt from some macros or config files I can think of two ways to do this. The not-so-great way is to have a context listener read the config files and generate the pages. The problem is that I don't know when JSP pages are compiled by the Tomcat engine - before or after context listeners are invoked. I believe you can force a re-compilation of the JSP pages at that point, but I am not sure how. The much smarter way is to ask why your JSP pages need to be macro/dynamically generated. JSP includes enough logic tags. Why not refactor your JSP pages so that they read the configuration files and output the appropriate information? This would be much cleaner, and probably wouldn't even require context restart? Tom Potter wrote: Jen, Just to make sure that we both talk about the same events : I don't want to restart the whole tomcat, only one web application, that is, by clicking on the start link(or restart) in on the admin page. I don't see how your suggestion would help me... if I'm missing something please make it clear to me... Rgds Thomas On 7/13/06, Mead, Jennifer L - VSCM [EMAIL PROTECTED] wrote: On my box the start and stop scripts are just that. .sh shell scripts. In your case I would just copy them to a save file and put in an execution string. The start scripts are in tomcat_home/bin. Jen -Original Message- From: Tom Potter [mailto:[EMAIL PROTECTED] Sent: Thursday, July 13, 2006 5:28 AM To: users@tomcat.apache.org Subject: Run shell script when web application start/restart The JSP pages in the Web application I install under Tomcat 4.1.30 are based on some configuration files the user wants to modify, thus I wrote a shell script to rebuild the JSP pages and repopulate the webapps folder. My question is that is there a way to hook up my shell script with the webapp start/stop proces so it would run at every startup, in other words the user would activate my script by restarting the application ? Thanks Thomas - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- __ Avi Deitcher [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] -- __ Avi Deitcher [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]
JTA?
Does Tomcat have any native JTA support? I know 5.5 has the Transaction tag in the context, which should make it easier (as far as I understand it) to use JTA factories, but does Tomcat have any built-in support, or is it planning? -- __ Avi Deitcher [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: Run shell script when web application start/restart
Richard, I think he is discussing a 2-step process. First the JSP pages are *generated* via some shell script, then they are *compiled* from the JSP source by Tomcat. that is why I suggested inverting it, having the JSPs fully formed, but have them pull config info as necessary. Richard Mixon wrote: Maybe I'm missing something, but if you re-generate the pages, and have Tomcat in development mode, the new pages will automatically be re-compiled the next time they are accessed. -Original Message- From: Tom Potter [mailto:[EMAIL PROTECTED] Sent: Thursday, July 13, 2006 7:59 AM To: Tomcat Users List Subject: Re: Run shell script when web application start/restart The reason for me choosing the first, messy solution was that this had to be a quick fix, rewriting the logic in the JSP pages was out of the question (and way above the allocated budget ;) ). Of course I had the shell scripts and configuration files so it seemed just the right solution to use these tools in the startup process of the webapp. It seems that I can convince the cusomer to just run the shell scripts that modify(actually generate) the JSP pages but then I face an other problem. After generating and copying the JSP pages in the right place how can I tell tomcat (from the shell script) to restart the application (or to recompile the pages) ? Rgds Thomas On 7/13/06, Avi Deitcher [EMAIL PROTECTED] wrote: I don't think so. You could, theoretically, have a context listener that then executes a shell script, but that is really messy, and the security manager probably won't even allow it. If I understand correctly, you want to have the following happen on context restart: - JSP pages get rebuilt from some macros or config files I can think of two ways to do this. The not-so-great way is to have a context listener read the config files and generate the pages. The problem is that I don't know when JSP pages are compiled by the Tomcat engine - before or after context listeners are invoked. I believe you can force a re-compilation of the JSP pages at that point, but I am not sure how. The much smarter way is to ask why your JSP pages need to be macro/dynamically generated. JSP includes enough logic tags. Why not refactor your JSP pages so that they read the configuration files and output the appropriate information? This would be much cleaner, and probably wouldn't even require context restart? Tom Potter wrote: Jen, Just to make sure that we both talk about the same events : I don't want to restart the whole tomcat, only one web application, that is, by clicking on the start link(or restart) in on the admin page. I don't see how your suggestion would help me... if I'm missing something please make it clear to me... Rgds Thomas On 7/13/06, Mead, Jennifer L - VSCM [EMAIL PROTECTED] wrote: On my box the start and stop scripts are just that. .sh shell scripts. In your case I would just copy them to a save file and put in an execution string. The start scripts are in tomcat_home/bin. Jen -Original Message- From: Tom Potter [mailto:[EMAIL PROTECTED] Sent: Thursday, July 13, 2006 5:28 AM To: users@tomcat.apache.org Subject: Run shell script when web application start/restart The JSP pages in the Web application I install under Tomcat 4.1.30 are based on some configuration files the user wants to modify, thus I wrote a shell script to rebuild the JSP pages and repopulate the webapps folder. My question is that is there a way to hook up my shell script with the webapp start/stop proces so it would run at every startup, in other words the user would activate my script by restarting the application ? Thanks Thomas --- -- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- __ Avi Deitcher [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] -- __ Avi Deitcher [EMAIL PROTECTED]
Re: Simple question, but can't figure out answer
Jen, Unless there is a particular reason (e.g. dynamically created images), why are you reading image files directly in Perl, then dumping the output? You should just use CGI to generate HTML that looks like this: img src=/images/some/path.gif/ Even if you want to dynamically *choose* the image, you are better off having CGI/JSP/etc. dynamically fill in the src img src=${some_dynamic}/ or img src=%= someVal %/ rather than actually literally feeding the image. Mead, Jennifer L - VSCM wrote: Hello, I am trying to create some cgi pages for my company. Or I should say I have created some and now just want to add a header graphic in the main page. Nothing fancy. However, I cannot get my image to display, no matter how I embed the darned thing. I can't even get regular html to display from our installation. Is it a configuration thing? Or am I so green I just don't get it? (feel free to flame). Here is the only code I can get running that displays the image: #!/usr/local/bin/perl -w # # use warnings; use CGI qw/:standard/; use CGI::Carp qw( fatalsToBrowser ); use constant BUFFER_SIZE = 4_096; use constant IMAGE_DIRECTORY = /images; $|=1 ; $q = new CGI; print $q-header( -type = image/gif ); binmode STDOUT; my $buff = ; my $image = icc-logo.gif; local *IMAGE; open IMAGE, IMAGE_DIRECTORY . /$image or die cannot open file $image: $!; while ( read( IMAGE, $buff, BUFFER_SIZE ) ) { print $buff; } close IMAGE; All good, it looks fine. However I cannot use this because then I cannot display anything else, or at least I cannot figure out how to. Any help is appreciated. I have been trying all kinds of things, so many I cannot recall half of the things I have tried. Truly frustrated from lack of knowledge. Regards, Jen Jennifer L Mead ICC Operations Sr Sys Engineer Con-way Enterprise Services 503.450.8578 desk 503.550.6589 cell [EMAIL PROTECTED] -- __ Avi Deitcher [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: web app application name
Right, that just returns the display-name, not the actual context name. Wait for Servlet 2.5? asaf.lahav wrote: The only solution I found so far is the following: String webAppName = event.getServletContext().getServletContextName(); It simply retrieving the display name element (display-nameMyAppName/display-name) defined in the web.xml file. I would like to know if anyone has a better idea. Potentially the display name may be changed and not reflect the actual web application name. -Original Message- From: David Delbecq [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 05, 2006 2:19 PM To: Tomcat Users List Subject: Re: web app application name asaf.lahav wrote: How can I obtain the name of the web application name my listener servlet is running under in Java? request.getContextPath(); Greetings. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- __ Avi Deitcher [EMAIL PROTECTED]
Re: webMathematica\Tomcat
I couldn't remember if bash supports export JAVA_HOME= or not. I remember sh does not and ksh does, but bash... Peter Crowther wrote: From: Frank Murray [mailto:[EMAIL PROTECTED] I get the error msg -bash: setenv: command not found Ah, the good old Bourne / csh gotcha - well, one of many :-). export JAVA_HOME=... Or JAVA_HOME=... export JAVA_HOME - 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] -- __ Avi Deitcher [EMAIL PROTECTED]
Re: webMathematica\Tomcat
Frank, See http://www.mcsr.olemiss.edu/unixhelp/environment/env3d.html It has been too many years since I did bash, but if I remember correctly, basically, just to JAVA_HOME=/System/etc; export JAVA_HOME However, why not wrap it up in a sh or ksh script to make your life easier? Frank Murray wrote: Hello, This is a newbie question. I am trying to set up a servlet container using Apache Tomcat. One of the primary steps is setting up the JAVA_HOME environment variable. Unfortunately, when I use: setenv JAVA_HOME /System/Library/Frameworks/JavaVM.Framework/Home I get the error msg -bash: setenv: command not found I am using the bash shell in a terminal window running under Mac OS X. I have also used set and then applied the executable 'Startup.sh' located in the folder Tomcat/bin. This however produces another error msg stating that the JAVA_HOME variable is not defined. Is there a command within the bash shell, similar to setenv that would work? Any information is appreciated. Thank you. fjm - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- __ Avi Deitcher [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 do I fix this error in localhost_log? javax.servlet.ServletException: Error instantiating servlet class org.apache.struts.action.ActionServlet
Carrie, Did you include commons-beanutils in your war distribution? It is required for struts (from what I remember), but it cannot find it. [EMAIL PROTECTED] wrote: This is an excerpt from my localhost_log file: 2006-07-03 12:50:32 StandardContext[/strutsBlank]Marking servlet action as unavailable 2006-07-03 12:50:32 StandardContext[/strutsBlank]Servlet /strutsBlank threw load() exception javax.servlet.ServletException: Error instantiating servlet class org.apache.struts.action.ActionServlet at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1011) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:887) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3959) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4284) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1126) at org.apache.catalina.core.StandardHost.start(StandardHost.java:832) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1126) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:521) at org.apache.catalina.core.StandardService.start(StandardService.java:519) at org.apache.catalina.core.StandardServer.start(StandardServer.java:2345) at org.apache.catalina.startup.Catalina.start(Catalina.java:594) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:297) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:398) - Root Cause - java.lang.NoClassDefFoundError: org/apache/commons/beanutils/Converter at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:1618) Thanks! - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- __ Avi Deitcher [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: log4j in webapp hanging Tomcat?
Bob, Thanks. Unfortunately, I am running it on my laptop (Windows) where I need to keep it for now as a dev environment. I run a small consulting business, this is an on the side product that need to be run whenever I can catch time. I would love to be able to get Tomcat to tell me what it is doing, but I am afraid that enabling logging in Tomcat itself might pollute the environment and make the problem worse. Ironically, Tomcat has neither log4j nor commons-logging in its $TOMCAT_HOME/common/lib nor server/lib, which makes me wonder how it is using commons-logging in its own classes at all Bob Hall wrote: --- Avi Deitcher [EMAIL PROTECTED] wrote: The simple classes (a JSF backing bean and a filter) are set to use either commons-logging or log4j directly (I tried both). In either case, the moment that I uncomment any category line and one of my classes (the filter or the bean) calls log.debug(some message), Tomcat freezes entirely. This is true whether I use log4j directly or commons-logging in my classes, and whether or not I comment or uncomment the first log4j.rootCategory line in log4j.properties. I get some output from the appender matching the pattern, and then freeze. I cannot access any context; I cannot use the manager; the only thing I can do is kill the Tomcat process. I am at wit's end with this; it took literally days to narrow down that it was log4j's activation doing it. Avi, You didn't mention which OS you are using. If it's *nix you may be able use 'truss' to get info on exactly what Tomcat is doing when it freezes. BTW, a google search produced several hits for linux impl's of solaris' truss command. My guess is that you'll find that Tomcat is stuck in a loop. HTH, Bob __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.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] -- __ Avi Deitcher [EMAIL PROTECTED]
Re: log4j in webapp hanging Tomcat?
Boris, Thank you, too. The main issue here is that I *do* want to separate my webapp's logging from Tomcat's, so it can be fully self-contained. Hence, I included log4j.jar and log4j.properties within my own webapp, which should make a lot of sense. In the development case, I am pushing the logs to the console, which end up intermixes with Tomcat's logs, but that is an easy switch in log4j.properties. Also, it appears that x4juli, according to the Website, is not quite ready for production. Any idea why this would cause hanging? Avi Boris Unckel wrote: Hello Avi, Avi Deitcher wrote: Bob, Thanks. Unfortunately, I am running it on my laptop (Windows) where I need to keep it for now as a dev environment. I run a small consulting business, this is an on the side product that need to be run whenever I can catch time. I would love to be able to get Tomcat to tell me what it is doing, but I am afraid that enabling logging in Tomcat itself might pollute the environment and make the problem worse. Ironically, Tomcat has neither log4j nor commons-logging in its $TOMCAT_HOME/common/lib nor server/lib, which makes me wonder how it is using commons-logging in its own classes at all by default the internal logging of Tomcat 5.5 is done via commons-logging to Tomcat-juli, which itself is a java.util.logging implementation. If you remove any direct log4j calls from your webapp and configure apache-tomcat-5.5.16\conf\logging.properties properly, you will use the same system by default. Have a look at: http://tomcat.apache.org/tomcat-5.5-doc/logging.html http://tomcat.apache.org/faq/logging.html http://jakarta.apache.org/commons/logging/ http://jakarta.apache.org/commons/logging/commons-logging-1.1/troubleshooting.html http://wiki.apache.org/jakarta-commons/Logging Maybe you are interested in a more extended version: http://www.x4juli.org Regards Boris - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- __ Avi Deitcher [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: log4j in webapp hanging Tomcat?
Add to the weirdness. Following http://tomcat.apache.org/tomcat-5.5-doc/logging.html I decided to try and enable log4j logging in Tomcat itself via commons/classes/log4j.properties and common/lib/log4j-1.2.8.jar, figuring it would help me narrow it down. This, *too* causes Tomcat to hang, at this point here: .2006-07-02 07:27:08,165 [main] DEBUG org.apache.catalina.loader.WebappClassLoader .loadClass - Loading class from local repository .2006-07-02 07:27:08,165 [main] DEBUG org.apache.catalina.loader.WebappClassLoader .loadClass - loadClass(com.sun.el.ValueExpressionLiteral, false) .2006-07-02 07:27:08,165 [main] DEBUG org.apache.catalina.loader.WebappClassLoader .loadClass - Searching local repositories .2006-07-02 07:27:08,165 [main] DEBUG org.apache.catalina.loader.WebappClassLoader .findClass - findClass(com.sun.el.ValueExpressionLiteral) .2006-07-02 07:27:08,165 [main] DEBUG org.apache.catalina.loader.WebappClassLoader .findClass - findClassInternal(com.sun.el.ValueExpressionLiteral) .2006-07-02 07:27:08,165 [main] DEBUG org.apache.catalina.loader.WebappClassLoader .loadClass - loadClass(java.io.Externalizable, false) .2006-07-02 07:27:08,165 [main] DEBUG org.apache.catalina.loader.WebappClassLoader .findClass - Returning class class com.sun.el.ValueExpressionLiteral .2006-07-02 07:27:08,165 [main] DEBUG org.apache.catalina.loader.WebappClassLoader .findClass - Loaded by WebappClassLoader delegate: false repositories: /WEB-INF/classes/ -- Parent Classloader: [EMAIL PROTECTED] .2006-07-02 07:27:08,175 [main] DEBUG org.apache.catalina.loader.WebappClassLoader .loadClass - Loading class from local repository I note that it occurs during the EL loading, could it be an EL - log4j conflict? Boris Unckel wrote: Hello Avi, Avi Deitcher wrote: Bob, Thanks. Unfortunately, I am running it on my laptop (Windows) where I need to keep it for now as a dev environment. I run a small consulting business, this is an on the side product that need to be run whenever I can catch time. I would love to be able to get Tomcat to tell me what it is doing, but I am afraid that enabling logging in Tomcat itself might pollute the environment and make the problem worse. Ironically, Tomcat has neither log4j nor commons-logging in its $TOMCAT_HOME/common/lib nor server/lib, which makes me wonder how it is using commons-logging in its own classes at all by default the internal logging of Tomcat 5.5 is done via commons-logging to Tomcat-juli, which itself is a java.util.logging implementation. If you remove any direct log4j calls from your webapp and configure apache-tomcat-5.5.16\conf\logging.properties properly, you will use the same system by default. Have a look at: http://tomcat.apache.org/tomcat-5.5-doc/logging.html http://tomcat.apache.org/faq/logging.html http://jakarta.apache.org/commons/logging/ http://jakarta.apache.org/commons/logging/commons-logging-1.1/troubleshooting.html http://wiki.apache.org/jakarta-commons/Logging Maybe you are interested in a more extended version: http://www.x4juli.org Regards Boris - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- __ Avi Deitcher [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: log4j in webapp hanging Tomcat?
Boris, Thank you, I should get to trying it this evening EDT. One other thing I will try it enabling logging in core Tomcat from JDK logging as opposed to log4j, to see if I can get Tomcat to tell me where it is hanging. In the same vein, do you know if there is a truss-like equivalent for WinXP? As for netbeans, I will try it standalone, but to be honest, it is unlikely, since Netbeans starts a separate OS process, and I can actually control the command-line options separately. I believe it is just a convenience method. But I will try it to be sure. I will try all of the above and let you know what I find. Avi Boris Unckel wrote: Hello Avi, Avi Deitcher wrote: Boris, Thank you, too. The main issue here is that I *do* want to separate my webapp's logging from Tomcat's, so it can be fully self-contained. Hence, I included log4j.jar and log4j.properties within my own webapp, which should make a lot of sense. In the development case, I am pushing the logs to the console, which end up intermixes with Tomcat's logs, but that is an easy switch in log4j.properties. Also, it appears that x4juli, according to the Website, is not quite ready for production. Any idea why this would cause hanging? Avi If there is really a conflict between el and logj4j, try out the following to be sure: Please use the highest available version of log4j and commons-logging: http://logging.apache.org/log4j/docs/download.html http://jakarta.apache.org/site/downloads/downloads_commons-logging.cgi Follow the instructions in http://wiki.apache.org/jakarta-commons/Commons_Logging_FUD to separate container commons-logging and webapps commons-logging. Put log4j.jar in $CATALINA_HOME/server/lib and a log4j.properties in $CATALINA_HOME/server/classes Take care to remove any log4j.jar and commons-logging-xx.jar from $CATALINA_HOME/common/lib or $CATALINA_HOME/shared/lib Take care that commons-logging or log4j is not present at system-classpath due to your startup with Netbeans, this may cause the problem. (Does the problem only occur with startup in Netbeans? Does it occur standalone, too?) Put in logj4.jar in WEB-INF/lib and log4j.properties in WEB-INF/classes as you desired with a webapp specific configuration. Regards Boris - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- __ Avi Deitcher [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: log4j in webapp hanging Tomcat?
Not a dumb question at all; isn't it often the obvious? I actually am low on disk space, but not low enough that it should matter. Still, I will clean up an extra 1GB just to see. Pid wrote: Dumb question perhaps, but has your disk got enough space? Avi Deitcher wrote: Boris, Thank you, I should get to trying it this evening EDT. One other thing I will try it enabling logging in core Tomcat from JDK logging as opposed to log4j, to see if I can get Tomcat to tell me where it is hanging. In the same vein, do you know if there is a truss-like equivalent for WinXP? As for netbeans, I will try it standalone, but to be honest, it is unlikely, since Netbeans starts a separate OS process, and I can actually control the command-line options separately. I believe it is just a convenience method. But I will try it to be sure. I will try all of the above and let you know what I find. Avi Boris Unckel wrote: Hello Avi, Avi Deitcher wrote: Boris, Thank you, too. The main issue here is that I *do* want to separate my webapp's logging from Tomcat's, so it can be fully self-contained. Hence, I included log4j.jar and log4j.properties within my own webapp, which should make a lot of sense. In the development case, I am pushing the logs to the console, which end up intermixes with Tomcat's logs, but that is an easy switch in log4j.properties. Also, it appears that x4juli, according to the Website, is not quite ready for production. Any idea why this would cause hanging? Avi If there is really a conflict between el and logj4j, try out the following to be sure: Please use the highest available version of log4j and commons-logging: http://logging.apache.org/log4j/docs/download.html http://jakarta.apache.org/site/downloads/downloads_commons-logging.cgi Follow the instructions in http://wiki.apache.org/jakarta-commons/Commons_Logging_FUD to separate container commons-logging and webapps commons-logging. Put log4j.jar in $CATALINA_HOME/server/lib and a log4j.properties in $CATALINA_HOME/server/classes Take care to remove any log4j.jar and commons-logging-xx.jar from $CATALINA_HOME/common/lib or $CATALINA_HOME/shared/lib Take care that commons-logging or log4j is not present at system-classpath due to your startup with Netbeans, this may cause the problem. (Does the problem only occur with startup in Netbeans? Does it occur standalone, too?) Put in logj4.jar in WEB-INF/lib and log4j.properties in WEB-INF/classes as you desired with a webapp specific configuration. Regards Boris - 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] -- __ Avi Deitcher [EMAIL PROTECTED]
Re: log4j in webapp hanging Tomcat?
I misspoke. Over 2GB free on the disk. Not a ton, but more than enough for logs. Thanks for the suggestion, though. Pid wrote: Dumb question perhaps, but has your disk got enough space? Avi Deitcher wrote: Boris, Thank you, I should get to trying it this evening EDT. One other thing I will try it enabling logging in core Tomcat from JDK logging as opposed to log4j, to see if I can get Tomcat to tell me where it is hanging. In the same vein, do you know if there is a truss-like equivalent for WinXP? As for netbeans, I will try it standalone, but to be honest, it is unlikely, since Netbeans starts a separate OS process, and I can actually control the command-line options separately. I believe it is just a convenience method. But I will try it to be sure. I will try all of the above and let you know what I find. Avi Boris Unckel wrote: Hello Avi, Avi Deitcher wrote: Boris, Thank you, too. The main issue here is that I *do* want to separate my webapp's logging from Tomcat's, so it can be fully self-contained. Hence, I included log4j.jar and log4j.properties within my own webapp, which should make a lot of sense. In the development case, I am pushing the logs to the console, which end up intermixes with Tomcat's logs, but that is an easy switch in log4j.properties. Also, it appears that x4juli, according to the Website, is not quite ready for production. Any idea why this would cause hanging? Avi If there is really a conflict between el and logj4j, try out the following to be sure: Please use the highest available version of log4j and commons-logging: http://logging.apache.org/log4j/docs/download.html http://jakarta.apache.org/site/downloads/downloads_commons-logging.cgi Follow the instructions in http://wiki.apache.org/jakarta-commons/Commons_Logging_FUD to separate container commons-logging and webapps commons-logging. Put log4j.jar in $CATALINA_HOME/server/lib and a log4j.properties in $CATALINA_HOME/server/classes Take care to remove any log4j.jar and commons-logging-xx.jar from $CATALINA_HOME/common/lib or $CATALINA_HOME/shared/lib Take care that commons-logging or log4j is not present at system-classpath due to your startup with Netbeans, this may cause the problem. (Does the problem only occur with startup in Netbeans? Does it occur standalone, too?) Put in logj4.jar in WEB-INF/lib and log4j.properties in WEB-INF/classes as you desired with a webapp specific configuration. Regards Boris - 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] -- __ Avi Deitcher [EMAIL PROTECTED]
Re: log4j in webapp hanging Tomcat?
Hello Boris, Not much luck. I verified that I am running the latest versions of commons-logging and log4j. I kept log4j direct in the webapp to avoid any chance of commons-logging getting confused, as described in the article below. I also removed any reference to log4j or commons-logging from shared/ and common/. I tried something even simpler: a single Web app in its own context with *nothing* but a /index.jsp and a single Filter class. No JSF, no facelets, no EL, nothing in WEB-INF/lib except for log4j-1.2.13.jar, which is the latest and it still hangs. This leaves the unavoidable conclusion that it *must* be some interaction between log4j and Tomcat. I can think of nothing else to try except following the commons-logging FUD page below, but I am unsure how that would impact. Help? :-( Boris Unckel wrote: Hello Avi, Avi Deitcher wrote: Boris, Thank you, too. The main issue here is that I *do* want to separate my webapp's logging from Tomcat's, so it can be fully self-contained. Hence, I included log4j.jar and log4j.properties within my own webapp, which should make a lot of sense. In the development case, I am pushing the logs to the console, which end up intermixes with Tomcat's logs, but that is an easy switch in log4j.properties. Also, it appears that x4juli, according to the Website, is not quite ready for production. Any idea why this would cause hanging? Avi If there is really a conflict between el and logj4j, try out the following to be sure: Please use the highest available version of log4j and commons-logging: http://logging.apache.org/log4j/docs/download.html http://jakarta.apache.org/site/downloads/downloads_commons-logging.cgi Follow the instructions in http://wiki.apache.org/jakarta-commons/Commons_Logging_FUD to separate container commons-logging and webapps commons-logging. Put log4j.jar in $CATALINA_HOME/server/lib and a log4j.properties in $CATALINA_HOME/server/classes Take care to remove any log4j.jar and commons-logging-xx.jar from $CATALINA_HOME/common/lib or $CATALINA_HOME/shared/lib Take care that commons-logging or log4j is not present at system-classpath due to your startup with Netbeans, this may cause the problem. (Does the problem only occur with startup in Netbeans? Does it occur standalone, too?) Put in logj4.jar in WEB-INF/lib and log4j.properties in WEB-INF/classes as you desired with a webapp specific configuration. Regards Boris - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- __ Avi Deitcher [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: log4j in webapp hanging Tomcat?
To add to it: I kept two webapps running and had them System.out.println(logger), where each is in the same category/class, to check that each one is running its own; it is. I then removed every webapp I could and ran it again with just the simple filter + index.jsp to check. Same result. Sigh. Avi Deitcher wrote: Hello Boris, Not much luck. I verified that I am running the latest versions of commons-logging and log4j. I kept log4j direct in the webapp to avoid any chance of commons-logging getting confused, as described in the article below. I also removed any reference to log4j or commons-logging from shared/ and common/. I tried something even simpler: a single Web app in its own context with *nothing* but a /index.jsp and a single Filter class. No JSF, no facelets, no EL, nothing in WEB-INF/lib except for log4j-1.2.13.jar, which is the latest and it still hangs. This leaves the unavoidable conclusion that it *must* be some interaction between log4j and Tomcat. I can think of nothing else to try except following the commons-logging FUD page below, but I am unsure how that would impact. Help? :-( Boris Unckel wrote: Hello Avi, Avi Deitcher wrote: Boris, Thank you, too. The main issue here is that I *do* want to separate my webapp's logging from Tomcat's, so it can be fully self-contained. Hence, I included log4j.jar and log4j.properties within my own webapp, which should make a lot of sense. In the development case, I am pushing the logs to the console, which end up intermixes with Tomcat's logs, but that is an easy switch in log4j.properties. Also, it appears that x4juli, according to the Website, is not quite ready for production. Any idea why this would cause hanging? Avi If there is really a conflict between el and logj4j, try out the following to be sure: Please use the highest available version of log4j and commons-logging: http://logging.apache.org/log4j/docs/download.html http://jakarta.apache.org/site/downloads/downloads_commons-logging.cgi Follow the instructions in http://wiki.apache.org/jakarta-commons/Commons_Logging_FUD to separate container commons-logging and webapps commons-logging. Put log4j.jar in $CATALINA_HOME/server/lib and a log4j.properties in $CATALINA_HOME/server/classes Take care to remove any log4j.jar and commons-logging-xx.jar from $CATALINA_HOME/common/lib or $CATALINA_HOME/shared/lib Take care that commons-logging or log4j is not present at system-classpath due to your startup with Netbeans, this may cause the problem. (Does the problem only occur with startup in Netbeans? Does it occur standalone, too?) Put in logj4.jar in WEB-INF/lib and log4j.properties in WEB-INF/classes as you desired with a webapp specific configuration. Regards Boris - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- __ Avi Deitcher [EMAIL PROTECTED]
Re: log4j in webapp hanging Tomcat?
Wade, Definitely no CPU spin. I also checked for some weird JDK dependency (say, 1.5.0 vs 1.5.0_02 vs 1.5.0_07), but all give the same. I modifed logging.properties in conf/ and had it dump ALL. Here is where it hangs, right after I had it spit out the first logger.debug(some message) in one of my classes in the webapp: // lots before FINE: Loading class from local repository Jul 2, 2006 9:06:16 PM org.apache.catalina.loader.WebappClassLoader loadClass FINE: loadClass(java.util.Stack, false) Jul 2, 2006 9:06:16 PM org.apache.catalina.loader.WebappClassLoader loadClass FINE: loadClass(org.apache.log4j.spi.LocationInfo, false) Jul 2, 2006 9:06:16 PM org.apache.catalina.loader.WebappClassLoader loadClass FINE: Searching local repositories Jul 2, 2006 9:06:16 PM org.apache.catalina.loader.WebappClassLoader findClass FINE: findClass(org.apache.log4j.spi.LocationInfo) Jul 2, 2006 9:06:16 PM org.apache.catalina.loader.WebappClassLoader findClass FINEST: findClassInternal(org.apache.log4j.spi.LocationInfo) Jul 2, 2006 9:06:16 PM org.apache.catalina.loader.WebappClassLoader findClass FINE: Returning class class org.apache.log4j.spi.LocationInfo Jul 2, 2006 9:06:16 PM org.apache.catalina.loader.WebappClassLoader findClass FINE: Loaded by WebappClassLoader delegate: false repositories: /WEB-INF/classes/ -- Parent Classloader: [EMAIL PROTECTED] Jul 2, 2006 9:06:16 PM org.apache.catalina.loader.WebappClassLoader loadClass 2006-07-02 21:06:15,996 [main] DEBUG tester.SessionTestFilter .init - C:\My Documents\proj\utils\Web3\build\web\ SessionTestFilter:Initializing filter FINE: Loading class from local repository . / HERE IS THE HANG!! everything after comes after I kill the process itself ***/ Jul 2, 2006 9:06:16 PM org.apache.catalina.loader.WebappClassLoader loadClass FINE: loadClass(java.io.PrintWriter, false) Jul 2, 2006 9:06:16 PM org.apache.catalina.loader.WebappClassLoader loadClass FINE: loadClass(com.ibm.uvm.tools.DebugSupport, false) Jul 2, 2006 9:06:16 PM org.apache.catalina.loader.WebappClassLoader loadClass FINE: Searching local repositories Jul 2, 2006 9:06:16 PM org.apache.catalina.loader.WebappClassLoader findClass FINE: findClass(com.ibm.uvm.tools.DebugSupport) // lots after There is a *lot* more; if you think it is helpful, I can send it. Wade Chandler wrote: --- Avi Deitcher [EMAIL PROTECTED] wrote: To add to it: I kept two webapps running and had them System.out.println(logger), where each is in the same category/class, to check that each one is running its own; it is. I then removed every webapp I could and ran it again with just the simple filter + index.jsp to check. Same result. Sigh. Try to setup a file appender and see if you get any remotely similar behaviour. If not then my guess would be some kind of monitor is locked and code either in Tomcat or commons logging or log4j is deadlocked. Before setting up the file appender look at the process for Tomcat in the windows Task Manager and see how many CPU cycles it is using at this point. If it is eating up the CPU then it isn't a deadlock and is some infinite recursive loop (more than likely) some where such as your log call keeping on calling another log call some how down the stack or something weird like that. If the CPU isn't really being used at all then my first guess would be a deadlock. Wade - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- __ Avi Deitcher [EMAIL PROTECTED]
Re: log4j in webapp hanging Tomcat?
And Wade Chandler definitely wins the prize! I spent days tracking down, comparing exactly how NetBeans starts it up vs. how I do it from command prompt, and everything is identical. However, NetBeans, when it starts, grabs stdout and pipes it to its own in-memory cache (not sure exactly how). For whatever reason, when log4j within a webapp (and possibly in the internal Tomcat container itself, didn't test it enough) writes to a ConsoleAppender, it hangs. If I switch to a FileAppender, it works beautifully. I am not sure how NB grabs the console when it starts it via a command-prompt, but whatever it is doing is causing the deadlock. I will avoid it for now, but what is the right way to get NB and Tomcat together to figure it out? Wade Chandler wrote: --- Avi Deitcher [EMAIL PROTECTED] wrote: To add to it: I kept two webapps running and had them System.out.println(logger), where each is in the same category/class, to check that each one is running its own; it is. I then removed every webapp I could and ran it again with just the simple filter + index.jsp to check. Same result. Sigh. Try to setup a file appender and see if you get any remotely similar behaviour. If not then my guess would be some kind of monitor is locked and code either in Tomcat or commons logging or log4j is deadlocked. Before setting up the file appender look at the process for Tomcat in the windows Task Manager and see how many CPU cycles it is using at this point. If it is eating up the CPU then it isn't a deadlock and is some infinite recursive loop (more than likely) some where such as your log call keeping on calling another log call some how down the stack or something weird like that. If the CPU isn't really being used at all then my first guess would be a deadlock. Wade - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- __ Avi Deitcher [EMAIL PROTECTED]
log4j in webapp hanging Tomcat?
Has anyone seen this or know how to work around it? I have a webapp deployed on Tomcat 5.5.16 (FWIW, the bundled version that came with Netbeans 5.5). In order to do its own logging, the webapp has log4j-1.2.8.jar deployed in WEB-INF/lib/. and log4j.properties in WEB-INF/classes/. The properties is very simple, as follows below: # log4j configuration file # Set root category priority to ERROR and set its only appender to A1 log4j.rootCategory=ERROR, A1 # here is the A1 appender log4j.appender.A1=org.apache.log4j.ConsoleAppender log4j.appender.A1.layout=org.apache.log4j.PatternLayout log4j.appender.A1.layout.ConversionPattern=%d [%t] %p %c %x.%M - %m%n. # finally, any that are set #log4j.category.tester=DEBUG The simple classes (a JSF backing bean and a filter) are set to use either commons-logging or log4j directly (I tried both). In either case, the moment that I uncomment any category line and one of my classes (the filter or the bean) calls log.debug(some message), Tomcat freezes entirely. This is true whether I use log4j directly or commons-logging in my classes, and whether or not I comment or uncomment the first log4j.rootCategory line in log4j.properties. I get some output from the appender matching the pattern, and then freeze. I cannot access any context; I cannot use the manager; the only thing I can do is kill the Tomcat process. I am at wit's end with this; it took literally days to narrow down that it was log4j's activation doing it. Help? Thanks. -- __ Avi Deitcher [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]