DO NOT REPLY [Bug 37262] - JDBC datasources are never released
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=37262. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=37262 [EMAIL PROTECTED] changed: What|Removed |Added Status|REOPENED|RESOLVED Resolution||WONTFIX --- Additional Comments From [EMAIL PROTECTED] 2005-10-27 15:50 --- You don't have to reopen and waste my time for others to see your comment. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 37269] New: - A
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=37269. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=37269 Summary: A Product: Tomcat 5 Version: 5.5.9 Platform: Other OS/Version: other Status: NEW Severity: normal Priority: P2 Component: Native:JK AssignedTo: tomcat-dev@jakarta.apache.org ReportedBy: [EMAIL PROTECTED] Hi, I don't know if this is the right place, maybe it's a bug in mod_jk, maybe in Tomcat, or maybe there's no bug at all... I have configured a mod_jk loadbalancer on Apache 2. I have two tomcats running on two differents servers. I don't have activated the cluster element in server.xml. Both tomcats are running the same webapp. In the title of every jsp I write the name of the server so that I can check that sticky session works. And it doesn't. Here is my workers.properties : -- worker.list=loadbalancer,status worker.node1.port=8009 worker.node1.host=noeud_1 worker.node1.type=ajp13 worker.node1.lbfactor=1 worker.node2.port=8009 worker.node2.host=noeud_2 worker.node2.type=ajp13 worker.node2.lbfactor=1 worker.loadbalancer.type=lb worker.loadbalancer.sticky_session=true worker.loadbalancer.balance_workers=node1, node2 # Status worker for managing load balancer worker.status.type=status -- noeud_1 and noeud_2 are the tomcat servers. In each tomcats I've added the jvmRoute attribute : -- Engine name=Catalina defaultHost=localhost jvmRoute=noeud_1 Of course on the noeud_2 server I wrote jvmRoute=noeud_2... Here is my jk.load file : --- JkWorkersFile /etc/apache2/workers.properties JkLogFile /var/log/apache2/mod_jk.log JkLogLevel info JkLogStampFormat [%a %b %d %H:%M:%S %Y] # JkOptions indicates to send SSK KEY SIZE #JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories JkRequestLogFormat %w %V %T JkMount /* loadbalancer JkMount /jkstatus status JkShmFile /var/log/apache2/jk.shm Location /jkstatus/ JkMount status Order deny,allow Deny from all Allow from all /Location And finally here is the way I write the server name in jsps : title% java.net.InetAddress local = java.net.InetAddress.getLocalHost();out.print(local.getHostName()); %/title Now the test : I open http://MY_SERVER/ in firefox : I see noeud_1 in the title. I have a JSESSIONIN in HTTP Headers. I press F5 to reload I see noeud_2 in the title. I still have the same JSESSIONID... So is it normal ? I think that the point of sticky session is to always redirect to the same server right ? Did I forgot something in some config files ? -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 37262] - JDBC datasources are never released
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=37262. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=37262 --- Additional Comments From [EMAIL PROTECTED] 2005-10-27 17:54 --- (In reply to comment #7) If the Tomcat team decides that DBCP is a proprietary external library that does not deserve proper integration and furthermore connections leaks are something totally acceptable, than the documentation at http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html should be updated to reflect this position. Funny enough, the doc guides the users how not to leak connections, but when tomcat does it, it's OK :-( Hmmm...is the responsibility of Tomcat to just release DBCP when it is no longer needed (by any webapp it is hosting), or DBCP's connections as well when just one webapp no longer needs it? Interesting question--the latter may be too granular for it. At any rate, please check the Servlet 2.4 Specification, the very small section SRV.10.2.2 -- for the example given, it appears to indicate that the Developer (that's you ;) should create a servlet context listener class in order to close database connection(s). If so, the only issue appears to be then, does Tomcat give you access to the DBCP object(s) necessary to do such connection closing? Glen -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 37273] - Under stress, tomcat generates multiple threads/processors for the same request
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=37273. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=37273 [EMAIL PROTECTED] changed: What|Removed |Added Status|NEW |RESOLVED Resolution||INVALID --- Additional Comments From [EMAIL PROTECTED] 2005-10-27 17:59 --- You will need to provide a hard proof of this, or investigate more. I think the thread pool code is explicit enough. I recommend you use users@tomcat.apache.org to debug this. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[Fwd: JSP Precompilation vs. JSR-45 Debugging]
Is this a more appropriate question for the dev list? -- Jess Holle ---BeginMessage--- I have noticed that when I use an Ant script based on that documented in the Tomcat docs to precompile all my JSPs the resulting JSPs do not support source-level (JSR-45) debugging. I thought I was doing something wrong so I looked through the JspC source code and I can't see how I could feed it anything more information. As an added complication I have an extra directory that I need in the compilation classpath. I have extended the web app classloader to handle this and added a line to the javac classpath in the Ant script. Thus things work fine in that respect but I need that to keep working -- I just want to have an option to do source-level JSP debugging as well. What am I missing? -- Jess Holle - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ---End Message--- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 37186] - Add path/filename of xml config file that failed parsing at catalina startup
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=37186. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=37186 [EMAIL PROTECTED] changed: What|Removed |Added Severity|enhancement |normal --- Additional Comments From [EMAIL PROTECTED] 2005-10-27 19:13 --- I have been bitten by similar er... problems in the past and would agree with the OP that his point #1 is a very significant one. Yes, as Markus pointed out, XML has strict well-formedness rules. But the purpose of those rules is to make syntax errors/inconsistencies stand out early, so they can be fixed. Reporting ill-formed XML without reporting the file it occurred in falls far short of this purpose. I have spent valuable time trying to track down Tomcat's reported XML parsing problems in the past, and eventually gave up. I propose changing the severity of this issue from enhancement to normal or at least minor. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 37277] New: - long delay in Tomcat startup
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=37277. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=37277 Summary: long delay in Tomcat startup Product: Tomcat 5 Version: 5.5.12 Platform: PC URL: http://forum.java.sun.com/thread.jspa?messageID=3951945 OS/Version: Windows 2000 Status: NEW Severity: normal Priority: P2 Component: Connector:Coyote AssignedTo: tomcat-dev@jakarta.apache.org ReportedBy: [EMAIL PROTECTED] I'm using Tomcat 5.5.9, but I see from http://forum.java.sun.com/thread.jspa?messageID=3951945 that it's still an issue in 5.5.12. JDK1.5 When Tomcat starts without webapps, it starts quickly: within a few seconds I can type http://localhost/manager/html/list in a browser and get a response. But when I put webapps in (either with a Context in server.xml or by dropping them in the webapps folder), Tomcat can take 14 min, 24 min, or even longer to start up. During that time, browser requests are met with an endlessly circling throbber. The webapp I'm using is Cocoon, but others (see above link) have reported the same problem with other webapps. The problem has been intermittent for us, but right now on our production server, it is happening every time. There are no errors in the Cocoon logs. An excerpt from the Tomcat stderr log shows where it took over 24 minutes to get from Oct 27, 2005 10:21:59 AM org.apache.catalina.core.StandardHost start INFO: XML validation disabled to Oct 27, 2005 10:46:06 AM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8080 Oct 27, 2005 10:21:58 AM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 Oct 27, 2005 10:21:58 AM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 1031 ms Oct 27, 2005 10:21:59 AM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Oct 27, 2005 10:21:59 AM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/5.5.9 Oct 27, 2005 10:21:59 AM org.apache.catalina.core.StandardHost start INFO: XML validation disabled Oct 27, 2005 10:46:06 AM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8080 Oct 27, 2005 10:46:06 AM org.apache.jk.common.ChannelSocket init INFO: JK: ajp13 listening on /0.0.0.0:8009 Oct 27, 2005 10:46:06 AM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=0/46 config=null Oct 27, 2005 10:46:06 AM org.apache.catalina.storeconfig.StoreLoader load INFO: Find registry server-registry.xml at classpath resource Oct 27, 2005 10:46:06 AM org.apache.catalina.startup.Catalina start INFO: Server startup in 1448022 ms Thinking the delay might be caused by the XML parser trying to chase down DTD urls in XML config files, I removed such DOCTYPE declarations where I could find them. But it didn't help. I really don't know if this is a Tomcat bug, but it's a serious problem. Incidentally, we upped our Java memory settings to 512MB (init) and 1024MB (max), but that didn't help. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 37277] - long delay in Tomcat startup
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=37277. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=37277 --- Additional Comments From [EMAIL PROTECTED] 2005-10-27 21:19 --- A couple of other details in case they should help... 1) The server where this problem occurs is in the DMZ. 2) We did not see this problem happening under Tomcat 5.0.27 on this server (though I couldn't guarantee that we had things configured the same way as we do under Tomcat 5.5.9). -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 37277] - long delay in Tomcat startup
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=37277. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=37277 --- Additional Comments From [EMAIL PROTECTED] 2005-10-27 22:34 --- Created an attachment (id=16823) -- (http://issues.apache.org/bugzilla/attachment.cgi?id=16823action=view) Patch for tc5.5.x/container/webapps/docs/config/context.xml Minor addition to the docs for processTlds based on Tim's comment #3. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 37284] New: - guess JDK location on Mac OS X
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=37284. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=37284 Summary: guess JDK location on Mac OS X Product: Tomcat 5 Version: Unknown Platform: Macintosh OS/Version: Mac OS X 10.4 Status: NEW Severity: trivial Priority: P2 Component: Native:Packaging AssignedTo: tomcat-dev@jakarta.apache.org ReportedBy: [EMAIL PROTECTED] Under Mac OS X there is defined standard JDK location. JDK 1.5 shipped by Apple is always installed to /System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home. Simple patch checks whether this JDK exists if JAVA_HOME and JRE_HOME are unset. === --- ./catalina.sh.orig 2005-10-28 01:12:12.0 +0400 +++ ./catalina.sh 2005-10-28 01:11:38.0 +0400 @@ -45,9 +45,11 @@ # OS specific support. $var _must_ be set to either true or false. cygwin=false os400=false +darwin=false case `uname` in CYGWIN*) cygwin=true;; OS400*) os400=true;; +Darwin*) darwin=true;; esac # resolve links - $0 may be a softlink --- ./setclasspath.sh.orig 2005-10-28 01:10:05.0 +0400 +++ ./setclasspath.sh 2005-10-28 01:19:52.0 +0400 @@ -10,9 +10,13 @@ # Make sure prerequisite environment variables are set if [ -z $JAVA_HOME -a -z $JRE_HOME ]; then - echo Neither the JAVA_HOME nor the JRE_HOME environment variable is defined - echo At least one of these environment variable is needed to run this program - exit 1 + if $darwin [ -d /System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home ]; then +export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home + else +echo Neither the JAVA_HOME nor the JRE_HOME environment variable is defined +echo At least one of these environment variable is needed to run this program +exit 1 + fi fi if [ -z $JAVA_HOME -a $1 = debug ]; then echo JAVA_HOME should point to a JDK in order to run in debug mode. --- ./startup.sh.orig 2005-10-28 01:10:30.0 +0400 +++ ./startup.sh2005-10-28 01:11:01.0 +0400 @@ -7,9 +7,11 @@ # Better OS/400 detection: see Bugzilla 31132 os400=false +darwin=false case `uname` in CYGWIN*) cygwin=true;; OS400*) os400=true;; +Darwin*) darwin=true;; esac # resolve links - $0 may be a softlink === -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 37285] New: - POST of document through CGI
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=37285. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=37285 Summary: POST of document through CGI Product: Tomcat 5 Version: 5.5.12 Platform: All OS/Version: Linux Status: NEW Severity: major Priority: P2 Component: Servlets:CGI AssignedTo: tomcat-dev@jakarta.apache.org ReportedBy: [EMAIL PROTECTED] If an XML document is posted through CGI the CGIServlet is prepending the content with the query parameters from the URL. Since the content is expected to be well formed XML (as specified by specifying Content-Type: text/xml) the prepended query parameters cause the XML parsing to fail. Assuming a test.sh script has been configured for Tomcat which contains: java test 0 test.out where test.java simply echoes the input (there is probably an easier way to do this) as follows: public class test { public static void main(String[] args) { try { int c = System.in.read(); while(c 0) { System.out.print((char)c); c = System.in.read(); } } catch(Exception e) {e.printStackTrace();} } } Then exercise the Tomcat server by launching a telnet session for the Tomcat host and port, such as telnet localhost 8080, and enter the following: POST /test/cgi-bin/test.sh?a=123b=xyz HTTP/1.1 Host: localhost:8080 Content-type: text/xml; charset=UTF-8 Content-length: 250 Connection: close ?xml version=1.0 encoding=UTF-8 ? Root Date2005-10-27 00:00:00/Date /Root The resulting test.out file will contain the submitted XML document prepended with a line containing the query parameters (a=123b=xyz). Unfortunately the XML parser that is recieving this data is expecting XML data and the query parameters cause an exception (since they are invalid XML). Note also that since the query parameters are included their size is also counted against the provided Content-length value which results in truncating the document when the Content-length is specified as the size of the XML document. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 37262] - JDBC datasources are never released
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=37262. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=37262 --- Additional Comments From [EMAIL PROTECTED] 2005-10-28 00:16 --- I'm not talking about resources from server.xml but rather context.xml which are not shared with other webapps. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tomcat source / eclipse project
hasssip satang wrote: Hi, I'm trying to setup a tomcat eclipse project. Looking through the list archive I've seen that some of you have been sharing their .project and .classpath files. If you could send me these files as well (or point me to a resource where I can download them) that would be really helpful. Setting it up from scratch seems like a really time consuming task. Eclipse obviously does not find all source trees and jars correctly after setting up new projects as stated in http://tomcat.apache.org/tomcat-5.5-doc/building.html . I get tons of error messages. Try to use http://svn.apache.org/repos/asf/tomcat/build/tc5.5.x/resources/build.xml (it worked for me with ant but I have not yet tried it with eclipse). If that helps, I will the build.xml in web site. Also is there a build.xml which is working on the subversion repository already? For my first tests I used the one mentioned in the article found under the link above. This, however, is working on the 'old' CVS repository. Thanks, Thomas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r329043 - /tomcat/connectors/trunk/jni/native/os/unix/system.c
Author: costin Date: Thu Oct 27 19:32:35 2005 New Revision: 329043 URL: http://svn.apache.org/viewcvs?rev=329043view=rev Log: On some systems, LOG_WARN doesn't exist - it is called LOG_WARNING. ( for example - current versions of Suse, Redhat ) Modified: tomcat/connectors/trunk/jni/native/os/unix/system.c Modified: tomcat/connectors/trunk/jni/native/os/unix/system.c URL: http://svn.apache.org/viewcvs/tomcat/connectors/trunk/jni/native/os/unix/system.c?rev=329043r1=329042r2=329043view=diff == --- tomcat/connectors/trunk/jni/native/os/unix/system.c (original) +++ tomcat/connectors/trunk/jni/native/os/unix/system.c Thu Oct 27 19:32:35 2005 @@ -38,6 +38,10 @@ #include syslog.h #include stdarg.h +#ifndef LOG_WARN +#define LOG_WARN LOG_WARNING +#endif + #if defined(sun) #define MAX_PROC_PATH_LEN 64 #define MAX_CPUS 512 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r329053 - in /tomcat/sandbox/java: ./ org/ org/apache/ org/apache/commons/ org/apache/commons/logging/
Author: costin Date: Thu Oct 27 19:55:08 2005 New Revision: 329053 URL: http://svn.apache.org/viewcvs?rev=329053view=rev Log: Implementation of commons-logging that doesn't use any discovery or tricks, just plain java.util.logging. There is a trick actually - at startup it'll try to load a different handler ( without 2-lines logs ) and a different config ( from classpath like log4j ). I'll probably remove this later, but I can't stand the default handler and behavior Added: tomcat/sandbox/java/ tomcat/sandbox/java/org/ tomcat/sandbox/java/org/apache/ tomcat/sandbox/java/org/apache/commons/ tomcat/sandbox/java/org/apache/commons/logging/ tomcat/sandbox/java/org/apache/commons/logging/DirectJDKLog.java tomcat/sandbox/java/org/apache/commons/logging/Log.java tomcat/sandbox/java/org/apache/commons/logging/LogConfigurationException.java tomcat/sandbox/java/org/apache/commons/logging/LogFactory.java Added: tomcat/sandbox/java/org/apache/commons/logging/DirectJDKLog.java URL: http://svn.apache.org/viewcvs/tomcat/sandbox/java/org/apache/commons/logging/DirectJDKLog.java?rev=329053view=auto == --- tomcat/sandbox/java/org/apache/commons/logging/DirectJDKLog.java (added) +++ tomcat/sandbox/java/org/apache/commons/logging/DirectJDKLog.java Thu Oct 27 19:55:08 2005 @@ -0,0 +1,185 @@ +/* + * Copyright 2001-2004 The Apache Software Foundation. + * Copyright 2004 Costin Manolache + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.commons.logging; + +import java.util.logging.ConsoleHandler; +import java.util.logging.Formatter; +import java.util.logging.Handler; +import java.util.logging.Level; +import java.util.logging.Logger; + + +/** + * Hardcoded java.util.logging commons-logging implementation. + * + * In addition, it curr + * + */ +class DirectJDKLog implements Log { +// no reason to hide this - but good reasons to not hide +public Logger logger; + +/** Alternate config reader and console format + */ +private static final String SIMPLE_FMT=org.apache.tomcat.util.log.JdkLoggerFormatter; +private static final String SIMPLE_CFG=org.apache.tomcat.util.log.JdkLoggerConfig; + +static { +if( System.getProperty(java.util.logging.config.class) ==null +System.getProperty(java.util.logging.config.file) ==null ) { +// default configuration - it sucks. Let's override at least the +// formatter for the console +try { +Class.forName(SIMPLE_CFG).newInstance(); +} catch( Throwable t ) { +} +try { +Formatter fmt=(Formatter)Class.forName(SIMPLE_FMT).newInstance(); +// it is also possible that the user modifed jre/lib/logging.properties - +// but that's really stupid in most cases +Logger root=Logger.getLogger(); +Handler handlers[]=root.getHandlers(); +for( int i=0; i handlers.length; i++ ) { +// I only care about console - that's what's used in default config anyway +if( handlers[i] instanceof ConsoleHandler ) { +handlers[i].setFormatter(fmt); +} +} +} catch( Throwable t ) { +// maybe it wasn't included - the ugly default will be used. +t.printStackTrace(); +} + +} else { +System.out.println(System.getProperties()); +} +} + +public DirectJDKLog(String name ) { +logger=Logger.getLogger(name); +} + +public final boolean isErrorEnabled() { +return logger.isLoggable(Level.SEVERE); +} + +public final boolean isWarnEnabled() { +return logger.isLoggable(Level.WARNING); +} + +public final boolean isInfoEnabled() { +return logger.isLoggable(Level.INFO); +} + +public final boolean isDebugEnabled() { +return logger.isLoggable(Level.FINE); +} + +public final boolean isFatalEnabled() { +return logger.isLoggable(Level.SEVERE); +} + +public final boolean isTraceEnabled() { +return logger.isLoggable(Level.FINER); +} + +public final void debug(Object message) { +
svn commit: r329054 - in /tomcat/sandbox/java/org/apache/tomcat: ./ util/ util/log/ util/log/JdkLoggerConfig.java util/log/JdkLoggerFormatter.java
Author: costin Date: Thu Oct 27 19:56:34 2005 New Revision: 329054 URL: http://svn.apache.org/viewcvs?rev=329054view=rev Log: Handler and config for java.util.logging. Added: tomcat/sandbox/java/org/apache/tomcat/ tomcat/sandbox/java/org/apache/tomcat/util/ tomcat/sandbox/java/org/apache/tomcat/util/log/ tomcat/sandbox/java/org/apache/tomcat/util/log/JdkLoggerConfig.java tomcat/sandbox/java/org/apache/tomcat/util/log/JdkLoggerFormatter.java Added: tomcat/sandbox/java/org/apache/tomcat/util/log/JdkLoggerConfig.java URL: http://svn.apache.org/viewcvs/tomcat/sandbox/java/org/apache/tomcat/util/log/JdkLoggerConfig.java?rev=329054view=auto == --- tomcat/sandbox/java/org/apache/tomcat/util/log/JdkLoggerConfig.java (added) +++ tomcat/sandbox/java/org/apache/tomcat/util/log/JdkLoggerConfig.java Thu Oct 27 19:56:34 2005 @@ -0,0 +1,108 @@ +/* + * Copyright 2001-2004 The Apache Software Foundation. + * Copyright 2004 Costin Manolache + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.tomcat.util.log; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.util.logging.LogManager; + +/** + */ +public class JdkLoggerConfig { + +public JdkLoggerConfig() { +InputStream is=getConfig( logging ); +if( is!=null ) { +try { +LogManager.getLogManager().readConfiguration(is); +} catch (SecurityException e) { +e.printStackTrace(); +} catch (IOException e) { +e.printStackTrace(); +} +} +} + +/** Locate a config stream: + * + * Uses: + * - logging.configuration system property + * - ./logging.properties file + * - conf/logging.properties + * - logging.properties in classpath + * + * @return + */ +public static InputStream getConfig(String base) { +//String base=logging; // log4j +// Initialize: +// 1. Find config file name +String confF=System.getProperty(base + .configuration); +if( confF!=null ) { +// Check if it is a path +} else { +confF=base + .properties; +} + +// URL +try { +URL url=new URL( confF ); +InputStream is=url.openStream(); +if( is!=null ) return is; +} catch( Throwable t ) { + +} + +// 2. Try to get the config from a file ( or conf/ ) +File f=new File( confF ); +if( ! f.exists() ) { +f=new File( conf/ + confF ); +} + +if( f.exists() ) { +try { +return new FileInputStream( f ); +} catch (FileNotFoundException e) { +// ignore +} +} + +// 3. Load it from CLASSPATH +InputStream is=JdkLoggerConfig.class.getResourceAsStream( confF ); + +//No thread class loader +if( is!= null ) return is; + +f=new File( System.getProperty(java.home)); +f=new File( f, lib/logging.properties); +if( f.exists() ) { +try { +return new FileInputStream(f); +} catch (FileNotFoundException e) { +//e.printStackTrace(); +} +} +System.err.println(default logging doesn't exists + f); + +return null; +} +} Added: tomcat/sandbox/java/org/apache/tomcat/util/log/JdkLoggerFormatter.java URL: http://svn.apache.org/viewcvs/tomcat/sandbox/java/org/apache/tomcat/util/log/JdkLoggerFormatter.java?rev=329054view=auto == --- tomcat/sandbox/java/org/apache/tomcat/util/log/JdkLoggerFormatter.java (added) +++ tomcat/sandbox/java/org/apache/tomcat/util/log/JdkLoggerFormatter.java Thu Oct 27 19:56:34 2005 @@ -0,0 +1,109 @@ +/* + * Copyright 2001-2004 The Apache Software Foundation. + * Copyright 2004 Costin Manolache + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + *
svn commit: r329055 - /tomcat/sandbox/README.txt
Author: costin Date: Thu Oct 27 20:01:20 2005 New Revision: 329055 URL: http://svn.apache.org/viewcvs?rev=329055view=rev Log: A small comment on source organization. Modified: tomcat/sandbox/README.txt Modified: tomcat/sandbox/README.txt URL: http://svn.apache.org/viewcvs/tomcat/sandbox/README.txt?rev=329055r1=329054r2=329055view=diff == --- tomcat/sandbox/README.txt (original) +++ tomcat/sandbox/README.txt Thu Oct 27 20:01:20 2005 @@ -33,6 +33,16 @@ svn mkdir https://svn.apache.org/repos/asf/tomcat/sandbox/component/branches svn mkdir https://svn.apache.org/repos/asf/tomcat/sandbox/component/tags +Alternatively, you can use the java/ directory. If possible: +1. create a new package ( or few ) for each module +2. if you have an external dependency for an optional component - create a new package. +3. Update the top level build.xml file with targets for your module - use include patterns instead +of exclude. + +The single tree may help increase visibility of the source code. We are in 2005 ( or more ), build tools +and IDEs have very good support for include/exclude patterns, we have tools to find dependencies between +packages, and we have a single community, so we don't need fragmented source trees and more, at least in +sandbox. Releases - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]