[GUMP@vmgump]: Project tomcat-tc7.0.x-test (in module tomcat-7.0.x) failed
To whom it may engage... This is an automated request, but not an unsolicited one. For more information please visit http://gump.apache.org/nagged.html, and/or contact the folk at gene...@gump.apache.org. Project tomcat-tc7.0.x-test has an issue affecting its community integration. This issue affects 1 projects, and has been outstanding for 16 runs. The current state of this project is 'Failed', with reason 'Build Failed'. For reference only, the following projects are affected by this: - tomcat-tc7.0.x-test : Tomcat 7.x, a web server implementing Java Servlet 3.0, ... Full details are available at: http://vmgump.apache.org/gump/public/tomcat-7.0.x/tomcat-tc7.0.x-test/index.html That said, some information snippets are provided here. The following annotations (debug/informational/warning/error messages) were provided: -DEBUG- Dependency on tomcat-tc7.0.x-dbcp exists, no need to add for property tomcat-dbcp-src.jar. -DEBUG- Dependency on commons-daemon exists, no need to add for property commons-daemon.native.src.tgz. -DEBUG- Dependency on commons-daemon exists, no need to add for property tomcat-native.tar.gz. -DEBUG- Dependency on tomcat-tc7.0.x-dbcp exists, no need to add for property tomcat-dbcp.home. -INFO- Failed with reason build failed -INFO- Project Reports in: /srv/gump/public/workspace/tomcat-7.0.x/output/build/logs The following work was performed: http://vmgump.apache.org/gump/public/tomcat-7.0.x/tomcat-tc7.0.x-test/gump_work/build_tomcat-7.0.x_tomcat-tc7.0.x-test.html Work Name: build_tomcat-7.0.x_tomcat-tc7.0.x-test (Type: Build) Work ended in a state of : Failed Elapsed: 29 mins 17 secs Command Line: /usr/lib/jvm/java-6-openjdk/bin/java -Djava.awt.headless=true -Dbuild.sysclasspath=only org.apache.tools.ant.Main -Dgump.merge=/srv/gump/public/gump/work/merge.xml -Djunit.jar=/srv/gump/public/workspace/junit/dist/junit-19092011.jar -Dcommons-daemon.native.src.tgz=/srv/gump/public/workspace/apache-commons/daemon/dist/bin/commons-daemon-19092011-native-src.tar.gz -Dtomcat-native.tar.gz=/srv/gump/public/workspace/apache-commons/daemon/dist/bin/commons-daemon-19092011-native-src.tar.gz -Dexamples.sources.skip=true -Dtomcat-dbcp.home=/srv/gump/public/workspace/tomcat-7.0.x/tomcat-deps -Djdt.jar=/srv/gump/packages/eclipse/plugins/org.eclipse.jdt.core_3.4.2/jdtcore.jar -Dcommons-daemon.jar=/srv/gump/public/workspace/apache-commons/daemon/dist/commons-daemon-19092011.jar -Dtomcat-dbcp-src.jar=/srv/gump/public/workspace/tomcat-7.0.x/tomcat-deps/tomcat-dbcp-src.jar -Dcommons-pool.home=/srv/gump/public/workspace/commons-pool-1.x -Dcommons-dbcp.home=/srv/gump/public/worksp ace/commons-dbcp-1.x -Dtomcat-dbcp.jar=/srv/gump/public/workspace/tomcat-7.0.x/tomcat-deps/tomcat-dbcp-19092011.jar test [Working Directory: /srv/gump/public/workspace/tomcat-7.0.x] CLASSPATH: /usr/lib/jvm/java-6-openjdk/lib/tools.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/webapps/examples/WEB-INF/classes:/srv/gump/public/workspace/tomcat-7.0.x/output/testclasses:/srv/gump/public/workspace/ant/dist/lib/ant.jar:/srv/gump/public/workspace/ant/dist/lib/ant-launcher.jar:/srv/gump/public/workspace/ant/dist/lib/ant-jmf.jar:/srv/gump/public/workspace/ant/dist/lib/ant-junit.jar:/srv/gump/public/workspace/ant/dist/lib/ant-swing.jar:/srv/gump/public/workspace/ant/dist/lib/ant-apache-resolver.jar:/srv/gump/public/workspace/ant/dist/lib/ant-apache-xalan2.jar:/srv/gump/public/workspace/xml-commons/java/build/resolver.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/bin/bootstrap.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/bin/tomcat-juli.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/annotations-api.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/servlet-api.jar:/srv/gump/public/workspace/tomcat-7.0.x/outp ut/build/lib/jsp-api.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/el-api.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/catalina.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/catalina-ant.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/tomcat-coyote.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/jasper.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/jasper-el.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/catalina-tribes.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/catalina-ha.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/tomcat-api.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/tomcat-util.jar:/srv/gump/packages/javamail-1.4/mail.jar:/srv/gump/packages/javamail-1.4/lib/mailapi.jar:/srv/gump/packages/jaf-1.1ea/activation.jar:/srv/gump/packages/eclipse/plugins/org.eclipse.jdt.core_3.4.2/jdtcore.jar:/srv/gump/public/workspace/tomcat-7. 0.x/tomcat-deps/tomcat-dbcp-19092011.jar:/srv/gump/public/workspace/apache-commons/daemon/dist/commons-daemon-19092011.jar:/srv/gump/public/works
svn commit: r1172546 - /tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java
Author: markt Date: Mon Sep 19 10:00:04 2011 New Revision: 1172546 URL: http://svn.apache.org/viewvc?rev=1172546&view=rev Log: Prevent NPE if JNDI is disabled. Modified: tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java Modified: tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java?rev=1172546&r1=1172545&r2=1172546&view=diff == --- tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java Mon Sep 19 10:00:04 2011 @@ -179,13 +179,15 @@ public class DefaultInstanceManager impl // At the end the postconstruct annotated // method is invoked List annotations = annotationCache.get(clazz); -for (AnnotationCacheEntry entry : annotations) { -if (entry.getType() == AnnotationCacheEntryType.POST_CONSTRUCT) { -Method postConstruct = (Method) entry.getAccessibleObject(); -boolean accessibility = postConstruct.isAccessible(); -postConstruct.setAccessible(true); -postConstruct.invoke(instance); -postConstruct.setAccessible(accessibility); +if (annotations != null) { +for (AnnotationCacheEntry entry : annotations) { +if (entry.getType() == AnnotationCacheEntryType.POST_CONSTRUCT) { +Method postConstruct = (Method) entry.getAccessibleObject(); +boolean accessibility = postConstruct.isAccessible(); +postConstruct.setAccessible(true); +postConstruct.invoke(instance); +postConstruct.setAccessible(accessibility); +} } } } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1172550 - /tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java
Author: markt Date: Mon Sep 19 10:04:37 2011 New Revision: 1172550 URL: http://svn.apache.org/viewvc?rev=1172550&view=rev Log: Revert previous commit (r1172546). Need to fix cause rather than symptom. Modified: tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java Modified: tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java?rev=1172550&r1=1172549&r2=1172550&view=diff == --- tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java Mon Sep 19 10:04:37 2011 @@ -179,15 +179,13 @@ public class DefaultInstanceManager impl // At the end the postconstruct annotated // method is invoked List annotations = annotationCache.get(clazz); -if (annotations != null) { -for (AnnotationCacheEntry entry : annotations) { -if (entry.getType() == AnnotationCacheEntryType.POST_CONSTRUCT) { -Method postConstruct = (Method) entry.getAccessibleObject(); -boolean accessibility = postConstruct.isAccessible(); -postConstruct.setAccessible(true); -postConstruct.invoke(instance); -postConstruct.setAccessible(accessibility); -} +for (AnnotationCacheEntry entry : annotations) { +if (entry.getType() == AnnotationCacheEntryType.POST_CONSTRUCT) { +Method postConstruct = (Method) entry.getAccessibleObject(); +boolean accessibility = postConstruct.isAccessible(); +postConstruct.setAccessible(true); +postConstruct.invoke(instance); +postConstruct.setAccessible(accessibility); } } } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[GUMP@vmgump]: Project tomcat-trunk-test (in module tomcat-trunk) failed
To whom it may engage... This is an automated request, but not an unsolicited one. For more information please visit http://gump.apache.org/nagged.html, and/or contact the folk at gene...@gump.apache.org. Project tomcat-trunk-test has an issue affecting its community integration. This issue affects 1 projects, and has been outstanding for 16 runs. The current state of this project is 'Failed', with reason 'Build Failed'. For reference only, the following projects are affected by this: - tomcat-trunk-test : Tomcat 8.x, a web server implementing Java Servlet 3.1, ... Full details are available at: http://vmgump.apache.org/gump/public/tomcat-trunk/tomcat-trunk-test/index.html That said, some information snippets are provided here. The following annotations (debug/informational/warning/error messages) were provided: -DEBUG- Dependency on tomcat-trunk-dbcp exists, no need to add for property tomcat-dbcp-src.jar. -DEBUG- Dependency on commons-daemon exists, no need to add for property commons-daemon.native.src.tgz. -DEBUG- Dependency on commons-daemon exists, no need to add for property tomcat-native.tar.gz. -DEBUG- Dependency on tomcat-trunk-dbcp exists, no need to add for property tomcat-dbcp.home. -INFO- Failed with reason build failed -INFO- Project Reports in: /srv/gump/public/workspace/tomcat-trunk/output/build/logs The following work was performed: http://vmgump.apache.org/gump/public/tomcat-trunk/tomcat-trunk-test/gump_work/build_tomcat-trunk_tomcat-trunk-test.html Work Name: build_tomcat-trunk_tomcat-trunk-test (Type: Build) Work ended in a state of : Failed Elapsed: 29 mins 6 secs Command Line: /usr/lib/jvm/java-6-openjdk/bin/java -Djava.awt.headless=true -Dbuild.sysclasspath=only org.apache.tools.ant.Main -Dgump.merge=/srv/gump/public/gump/work/merge.xml -Djunit.jar=/srv/gump/public/workspace/junit/dist/junit-19092011.jar -Dcommons-daemon.native.src.tgz=/srv/gump/public/workspace/apache-commons/daemon/dist/bin/commons-daemon-19092011-native-src.tar.gz -Dtomcat-native.tar.gz=/srv/gump/public/workspace/apache-commons/daemon/dist/bin/commons-daemon-19092011-native-src.tar.gz -Dexamples.sources.skip=true -Dtomcat-dbcp.home=/srv/gump/public/workspace/tomcat-trunk/tomcat-deps -Djdt.jar=/srv/gump/packages/eclipse/plugins/org.eclipse.jdt.core_3.4.2/jdtcore.jar -Dcommons-daemon.jar=/srv/gump/public/workspace/apache-commons/daemon/dist/commons-daemon-19092011.jar -Dtomcat-dbcp-src.jar=/srv/gump/public/workspace/tomcat-trunk/tomcat-deps/tomcat-dbcp-src.jar -Dcommons-pool.home=/srv/gump/public/workspace/commons-pool-1.x -Dcommons-dbcp.home=/srv/gump/public/worksp ace/commons-dbcp-1.x -Dtomcat-dbcp.jar=/srv/gump/public/workspace/tomcat-trunk/tomcat-deps/tomcat-dbcp-19092011.jar test [Working Directory: /srv/gump/public/workspace/tomcat-trunk] CLASSPATH: /usr/lib/jvm/java-6-openjdk/lib/tools.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/webapps/examples/WEB-INF/classes:/srv/gump/public/workspace/tomcat-trunk/output/testclasses:/srv/gump/public/workspace/ant/dist/lib/ant.jar:/srv/gump/public/workspace/ant/dist/lib/ant-launcher.jar:/srv/gump/public/workspace/ant/dist/lib/ant-jmf.jar:/srv/gump/public/workspace/ant/dist/lib/ant-junit.jar:/srv/gump/public/workspace/ant/dist/lib/ant-swing.jar:/srv/gump/public/workspace/ant/dist/lib/ant-apache-resolver.jar:/srv/gump/public/workspace/ant/dist/lib/ant-apache-xalan2.jar:/srv/gump/public/workspace/xml-commons/java/build/resolver.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/bin/bootstrap.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/bin/tomcat-juli.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/annotations-api.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/servlet-api.jar:/srv/gump/public/workspace/tomcat-trunk/outp ut/build/lib/jsp-api.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/el-api.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/catalina.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/catalina-ant.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/tomcat-coyote.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/jasper.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/jasper-el.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/catalina-tribes.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/catalina-ha.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/tomcat-api.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/tomcat-util.jar:/srv/gump/packages/javamail-1.4/mail.jar:/srv/gump/packages/javamail-1.4/lib/mailapi.jar:/srv/gump/packages/jaf-1.1ea/activation.jar:/srv/gump/packages/eclipse/plugins/org.eclipse.jdt.core_3.4.2/jdtcore.jar:/srv/gump/public/workspace/tomcat-tr unk/tomcat-deps/tomcat-dbcp-19092011.jar:/srv/gump/public/workspace/apache-commons/daemon/dist/commons-daemon-19092011.jar:/srv/gump/public/workspace/junit/dist/j
svn commit: r1172556 - /tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java
Author: markt Date: Mon Sep 19 10:11:44 2011 New Revision: 1172556 URL: http://svn.apache.org/viewvc?rev=1172556&view=rev Log: Always process postConstruct / preDestroy annotations but only process resource annotations if JNDI is enabled. Modified: tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java Modified: tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java?rev=1172556&r1=1172555&r2=1172556&view=diff == --- tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java Mon Sep 19 10:11:44 2011 @@ -242,62 +242,61 @@ public class DefaultInstanceManager impl Map injections) throws IllegalAccessException, InvocationTargetException, NamingException { -if (context == null) { -// No resource injection -return; -} - while (clazz != null) { List annotations = annotationCache.get(clazz); if (annotations == null) { annotations = new ArrayList(); -// Initialize fields annotations -Field[] fields = null; -if (Globals.IS_SECURITY_ENABLED) { -final Class clazz2 = clazz; -fields = AccessController.doPrivileged( -new PrivilegedAction(){ -@Override -public Field[] run(){ -return clazz2.getDeclaredFields(); + +if (context != null) { +// Initialize fields annotations for resource injection if +// JNDI is enabled +Field[] fields = null; +if (Globals.IS_SECURITY_ENABLED) { +final Class clazz2 = clazz; +fields = AccessController.doPrivileged( +new PrivilegedAction(){ +@Override +public Field[] run(){ +return clazz2.getDeclaredFields(); +} +}); +} else { +fields = clazz.getDeclaredFields(); +} +for (Field field : fields) { +if (injections != null && injections.containsKey(field.getName())) { +annotations.add(new AnnotationCacheEntry(field, +injections.get(field.getName()), +AnnotationCacheEntryType.FIELD)); +} else if (field.isAnnotationPresent(Resource.class)) { +Resource annotation = field.getAnnotation(Resource.class); +annotations.add(new AnnotationCacheEntry(field, +annotation.name(), +AnnotationCacheEntryType.FIELD)); +} else if (field.isAnnotationPresent(EJB.class)) { +EJB annotation = field.getAnnotation(EJB.class); +annotations.add(new AnnotationCacheEntry(field, +annotation.name(), +AnnotationCacheEntryType.FIELD)); +} else if (field.isAnnotationPresent(WebServiceRef.class)) { +WebServiceRef annotation = +field.getAnnotation(WebServiceRef.class); +annotations.add(new AnnotationCacheEntry(field, +annotation.name(), +AnnotationCacheEntryType.FIELD)); +} else if (field.isAnnotationPresent(PersistenceContext.class)) { +PersistenceContext annotation = + field.getAnnotation(PersistenceContext.class); +annotations.add(new AnnotationCacheEntry(field, +annotation.name(), +AnnotationCacheEntryType.FIELD)); +} else if (field.isAnnotationPresent(PersistenceUnit.class)) { +PersistenceUnit annotation = +field.getAnnotation(PersistenceUnit.class); +annotations.add(new AnnotationCacheEntry(field, +annotation.name(), +AnnotationCacheEntryType.FIELD)); } -}); -} el
[Tomcat Wiki] Update of "PoweredBy" by BjoernHahnefeld
Dear Wiki user, You have subscribed to a wiki page or wiki category on "Tomcat Wiki" for change notification. The "PoweredBy" page has been changed by BjoernHahnefeld: http://wiki.apache.org/tomcat/PoweredBy?action=diff&rev1=363&rev2=364 [[http://www.webappcabaret.com/|WebAppCabaret]] is the oldest JAVA Web hosting provider. Features include one-click installation of many versions of Tomcat. === björn hahnefeld IT TC_Framework === - {{http://www.hahnefeld.de/images/archive/small.jpg}} "björn hahnefeld IT TC_Framework" [[http://www.hahnefeld.de|björn hahnefeld IT]] runs on Tomcat. It is a Framework for the ATOSS employee portal with runs on Tomcat too. Hosting-Plans for the "björn hahnefeld IT TC_Framework" can be booked under [[http://www.hahnefeld.de/internet-services_server.html|Tomcat Co-Location and Serverhousing]]. The "björn hahnefeld IT TC_Framework" for project and time control is live in action in seven companies at the moment: [[http://www.schoen-alarm.at|Dallmeier]], Shop for [[http://www.video-security-solutions.eu/dallmeier-recorder/dallmeier-hybrid-recorder-videonetbox.html|VideoNetBox]] / [[http://www.video-security-solutions.eu|Dallmeier]], [[http://www.konstruktionsbuero-dos.de|Konstruktionsbüro DOS]], [[http://www.brot-und-wein.eu|Wein Shop]], [[http://www.video-security-solutions.at|EverFocus]], [[http://www.more-passion.com|Potenzmittel]] and , [[http://www.bdsm-passion.com|Orgasmuskontrolle]]. + {{http://www.hahnefeld.de/images/archive/logo.png}} "björn hahnefeld IT TC_Framework" [[http://www.hahnefeld.de|björn hahnefeld IT]] runs on Tomcat. It is a Framework for the ATOSS employee portal with runs on Tomcat too. Hosting-Plans for the "björn hahnefeld IT TC_Framework" can be booked under [[http://www.hahnefeld.de/internet-services_server.html|Tomcat Co-Location and Serverhousing]]. The "björn hahnefeld IT TC_Framework" for project and time control is live in action in seven companies at the moment: [[http://www.schoen-alarm.at|Dallmeier]], Shop for [[http://www.video-security-solutions.eu/recorder/hybrid-recorder-videonetbox|VideoNetBox]] / [[http://www.video-security-solutions.eu|Dallmeier]], [[http://www.schmuckmuschel.de|Design Schmuck]], [[http://www.brot-und-wein.eu|Wein Shop]], [[http://www.video-security-solutions.at|EverFocus]], [[http://www.more-passion.com|Potenzmittel]] and [[http://www.bdsm-passion.com|Orgasmuskontrolle]]. === Bodhost.com === [[http://www.bodhost.com/|BODHost]] - Proud to be Apache Tomcat Hosting Provider - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: svn commit: r1166290 - /tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java
On 12/09/2011 12:15, Konstantin Kolinko wrote: > 2011/9/7 Mark Thomas : >> On 07/09/2011 19:49, Konstantin Kolinko wrote: >>> 2011/9/7 : Author: markt Date: Wed Sep 7 18:11:20 2011 New Revision: 1166290 URL: http://svn.apache.org/viewvc?rev=1166290&view=rev Log: Add a simple annotation cache to improve performance for applications that use lots of non-poolable tags. >>> 2. I wonder when the cache is cleared. E.g. if we are in development >>> mode or have enabled unloading unused JSPs in JspServlet >>> configuration. If I understand correctly it accumulates references to >>> Class objects but never releases them. >> >> When the context is stopped. > > This issue is still pending. > Though I think it concerns only development mode, and benefits of this > cache out-weight the resource leak. As written, it makes the maxLoadedJsps Jasper option useless. I have given this some thought this morning and I plan on looking at a WeakHashMap (plus synchronisation to handle the concurrency) based solution. > 3. Regarding the instances not created through the instance manager: > http://svn.apache.org/viewvc?rev=1166775&view=rev > > The code is now skipping annotations in those classes. > The old code would scan them for preDestroy annotations. > I have not looked what behaviour is required by the specs here, but I > think that the old behaviour was more correct. I tend to the view that if the InstanceManager didn't create the object, it isn't responsible for destroying it. That isn't the old behaviour and I am +0 if you want to change the current code back to the old behaviour. > 4. There is code that calls setAccessible() for Method, e.g.: > > Method postConstruct = (Method) entry.getAccessibleObject(); > boolean accessibility = postConstruct.isAccessible(); > postConstruct.setAccessible(true); > postConstruct.invoke(instance); > postConstruct.setAccessible(accessibility); > > There will be a race condition if several threads are changing > (setting or restoring) the method accessibility flag on the same > Method right before invoke() or isAccessible() calls. I'll try and address this along with the WeakHashMap changes since I'll be adding some syncs already. Mark - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: [VOTE] Release Tomcat 5.5.34 Build
On Sep 18, 2011, at 3:51 PM, Jim Jagielski wrote: > The builds for Tomcat 5.5.34 are ready for testing and approval. > The candidates binaries are available here: > > http://people.apache.org/~jim/tomcat-5.5/ > > According to the release process, the 5.5.34 build corresponding to the > tag TOMCAT_5_5_34 [1] is: > > [ ] Broken > [ ] Alpha > [ ] Beta > [X] Stable > +++ > My vote :) - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1172610 - in /tomcat/trunk/java/org/apache/jasper: compiler/JspRuntimeContext.java util/FastRemovalDequeue.java
Author: markt Date: Mon Sep 19 13:19:27 2011 New Revision: 1172610 URL: http://svn.apache.org/viewvc?rev=1172610&view=rev Log: JSP unloading code was retaining a reference to the unloaded JSP preventing the associated class from being unloaded until the JSP that replaced it was unloaded. Modified: tomcat/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java tomcat/trunk/java/org/apache/jasper/util/FastRemovalDequeue.java Modified: tomcat/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java?rev=1172610&r1=1172609&r2=1172610&view=diff == --- tomcat/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java (original) +++ tomcat/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java Mon Sep 19 13:19:27 2011 @@ -250,6 +250,7 @@ public final class JspRuntimeContext { replaced.getJspUri(), context.getContextPath())); } unloadJspServletWrapper(replaced); +entry.clearReplaced(); } return entry; } Modified: tomcat/trunk/java/org/apache/jasper/util/FastRemovalDequeue.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/util/FastRemovalDequeue.java?rev=1172610&r1=1172609&r2=1172610&view=diff == --- tomcat/trunk/java/org/apache/jasper/util/FastRemovalDequeue.java (original) +++ tomcat/trunk/java/org/apache/jasper/util/FastRemovalDequeue.java Mon Sep 19 13:19:27 2011 @@ -284,6 +284,10 @@ public class FastRemovalDequeue { this.replaced = replaced; } +public final void clearReplaced() { +this.replaced = null; +} + private final Entry getNext() { return next; } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Attribute qualified names must be unique within an element
Sep 19, 2011 6:12:21 AM org.apache.catalina.core.ApplicationDispatcher invoke SEVERE: Servlet.service() for servlet jsp threw exception org.apache.jasper.JasperException: /jsp/includes/topLogo.jsp (line: 65, column: 50) Attribute qualified names must be unique within an element at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42) at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:408) at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:89) at org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:171) at org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:153) at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1236) at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1450) at org.apache.jasper.compiler.Parser.parseBody(Parser.java:1662) at org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1002) at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1274) at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1450) at org.apache.jasper.compiler.Parser.parse(Parser.java:138) at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:242) at org.apache.jasper.compiler.ParserController.parse(ParserController.java:102) at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:198) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:373) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:353) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:340) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:644) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:358) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:593) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:530) at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:927) at org.apache.jasper.runtime.PageContextImpl.doInclude(PageContextImpl.java:684) at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:678) 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:597) at org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:129) at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:152) at org.apache.struts.tiles.taglib.InsertTag.doInclude(InsertTag.java:764) at org.apache.struts.tiles.taglib.InsertTag$InsertHandler.doEndTag(InsertTag.java:896) at org.apache.struts.tiles.taglib.InsertTag.doEndTag(InsertTag.java:465) at org.apache.jsp.jsp.layout.userHome_jsp._jspx_meth_tiles_005finsert_005f0(userHome_jsp.java:340) at org.apache.jsp.jsp.layout.userHome_jsp._jspService(userHome_jsp.java:141) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:433) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:593) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:530) at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:927) at org.apache.jasper.runtime.PageContextImpl.doInclude(PageContextImpl.java:684)
svn commit: r1172614 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/jasper/compiler/JspRuntimeContext.java java/org/apache/jasper/util/FastRemovalDequeue.java webapps/docs/changelog.xml
Author: markt Date: Mon Sep 19 13:24:10 2011 New Revision: 1172614 URL: http://svn.apache.org/viewvc?rev=1172614&view=rev Log: JSP unloading code was retaining a reference to the unloaded JSP preventing the associated class from being unloaded until the JSP that replaced it was unloaded. Modified: tomcat/tc7.0.x/trunk/ (props changed) tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java tomcat/tc7.0.x/trunk/java/org/apache/jasper/util/FastRemovalDequeue.java tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Propchange: tomcat/tc7.0.x/trunk/ -- --- svn:mergeinfo (original) +++ svn:mergeinfo Mon Sep 19 13:24:10 2011 @@ -1 +1 @@ -/tomcat/trunk:1156171,1156276,1156304,1156530,1156602,1157015,1157018,1157151,1157198,1157204,1157810,1157832,1157834,1157847,1157908,1157939,1158155,1158160,1158176,1158195,1158198-1158199,1158227,1158331,1158334-1158335,1158426,1160347,1160592,1160611,1160619,1160626,1160639,1160652,1160720-1160721,1160772,1160774,1160776,1161303,1161310,1161322,1161339,1161486,1161540,1161549,1161584,1162082,1162149,1162169,1162721,1162769,1162836,1162932,1163630,1164419,1164438,1164469,1164480,1164567,1165234,1165247-1165248,1165253,1165273,1165282,1165309,1165331,1165338,1165347,1165360-1165361,1165367-1165368,1165602,1165608,1165677,1165693,1165721,1165723,1165728,1165730,1165738,1165746,1165765,1165777,1165918,1165921,1166077,1166150-1166151,1166290,1166366,1166620,1166686,1166752,1166757,1167368,1167394,1169447,1171692,1172233-1172234,1172236,1172269,1172278,1172282 +/tomcat/trunk:1156171,1156276,1156304,1156530,1156602,1157015,1157018,1157151,1157198,1157204,1157810,1157832,1157834,1157847,1157908,1157939,1158155,1158160,1158176,1158195,1158198-1158199,1158227,1158331,1158334-1158335,1158426,1160347,1160592,1160611,1160619,1160626,1160639,1160652,1160720-1160721,1160772,1160774,1160776,1161303,1161310,1161322,1161339,1161486,1161540,1161549,1161584,1162082,1162149,1162169,1162721,1162769,1162836,1162932,1163630,1164419,1164438,1164469,1164480,1164567,1165234,1165247-1165248,1165253,1165273,1165282,1165309,1165331,1165338,1165347,1165360-1165361,1165367-1165368,1165602,1165608,1165677,1165693,1165721,1165723,1165728,1165730,1165738,1165746,1165765,1165777,1165918,1165921,1166077,1166150-1166151,1166290,1166366,1166620,1166686,1166752,1166757,1167368,1167394,1169447,1171692,1172233-1172234,1172236,1172269,1172278,1172282,1172610 Modified: tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java?rev=1172614&r1=1172613&r2=1172614&view=diff == --- tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java Mon Sep 19 13:24:10 2011 @@ -250,6 +250,7 @@ public final class JspRuntimeContext { replaced.getJspUri(), context.getContextPath())); } unloadJspServletWrapper(replaced); +entry.clearReplaced(); } return entry; } Modified: tomcat/tc7.0.x/trunk/java/org/apache/jasper/util/FastRemovalDequeue.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/jasper/util/FastRemovalDequeue.java?rev=1172614&r1=1172613&r2=1172614&view=diff == --- tomcat/tc7.0.x/trunk/java/org/apache/jasper/util/FastRemovalDequeue.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/jasper/util/FastRemovalDequeue.java Mon Sep 19 13:24:10 2011 @@ -284,6 +284,10 @@ public class FastRemovalDequeue { this.replaced = replaced; } +public final void clearReplaced() { +this.replaced = null; +} + private final Entry getNext() { return next; } Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1172614&r1=1172613&r2=1172614&view=diff == --- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Mon Sep 19 13:24:10 2011 @@ -133,6 +133,17 @@ + + + +When unloading JSPs due to configuration of the +maxLoadedJsps initialisation parameter, the unloading code +was retaining a reference to the to the unloaded JSP preventing the +associated class from being unloaded until the JSP that replaced it was +itself unloaded. (markt) + + +
Re: Attribute qualified names must be unique within an element
On 19/09/2011 14:23, stsivaraj wrote: > > > Sep 19, 2011 6:12:21 AM org.apache.catalina.core.ApplicationDispatcher > invoke > SEVERE: Servlet.service() for servlet jsp threw exception > org.apache.jasper.JasperException: /jsp/includes/topLogo.jsp (line: 65, > column: 50) Attribute qualified names must be unique within an element > I am facing this problem. Some what i know, it happen by CSS problem. What > are the ways to find this problem? This question belongs on the users list, not the dev list. Mark - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1172616 - /tomcat/tc6.0.x/trunk/STATUS.txt
Author: markt Date: Mon Sep 19 13:30:32 2011 New Revision: 1172616 URL: http://svn.apache.org/viewvc?rev=1172616&view=rev Log: Add a comment Modified: tomcat/tc6.0.x/trunk/STATUS.txt Modified: tomcat/tc6.0.x/trunk/STATUS.txt URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=1172616&r1=1172615&r2=1172616&view=diff == --- tomcat/tc6.0.x/trunk/STATUS.txt (original) +++ tomcat/tc6.0.x/trunk/STATUS.txt Mon Sep 19 13:30:32 2011 @@ -110,5 +110,7 @@ PATCHES/ISSUES THAT ARE STALLED rjung: I started a discussion about JSPs and memory on the dev list. The updated patch fixes a race condition. We can stall this item until we get some feedback about 7.0.5. + markt - r1172614 needs to be included in this proposal. With that patch, + my testing shows that the unloading works as designed -1: - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1172661 - /tomcat/tc6.0.x/trunk/STATUS.txt
Author: fhanik Date: Mon Sep 19 15:30:06 2011 New Revision: 1172661 URL: http://svn.apache.org/viewvc?rev=1172661&view=rev Log: votes Modified: tomcat/tc6.0.x/trunk/STATUS.txt Modified: tomcat/tc6.0.x/trunk/STATUS.txt URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=1172661&r1=1172660&r2=1172661&view=diff == --- tomcat/tc6.0.x/trunk/STATUS.txt (original) +++ tomcat/tc6.0.x/trunk/STATUS.txt Mon Sep 19 15:30:06 2011 @@ -72,14 +72,14 @@ PATCHES PROPOSED TO BACKPORT: * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51550 Display error page rather than an empty response for an IllegalStateException https://issues.apache.org/bugzilla/attachment.cgi?id=27434 - +1: markt, kkolinko + +1: markt, kkolinko, fhanik -1: * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51758 Correct logger names used by Tomcat-internal copy of Commons Digester It is backport of r1164567, r1167394. https://issues.apache.org/bugzilla/attachment.cgi?id=27479 - +1: kkolinko, rjung + +1: kkolinko, rjung, fhanik -1: * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51794 - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1172664 - in /tomcat/trunk: java/org/apache/catalina/core/DefaultInstanceManager.java test/org/apache/catalina/core/TestDefaultInstanceManager.java test/webapp-3.0/annotations.jsp
Author: markt Date: Mon Sep 19 15:31:43 2011 New Revision: 1172664 URL: http://svn.apache.org/viewvc?rev=1172664&view=rev Log: Fix resource leak in annotations cache that prevented unloading of resources that used annotations Added: tomcat/trunk/test/org/apache/catalina/core/TestDefaultInstanceManager.java (with props) tomcat/trunk/test/webapp-3.0/annotations.jsp (with props) Modified: tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java Modified: tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java?rev=1172664&r1=1172663&r2=1172664&view=diff == --- tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java Mon Sep 19 15:31:43 2011 @@ -21,6 +21,7 @@ package org.apache.catalina.core; import java.io.IOException; import java.io.InputStream; +import java.lang.ref.WeakReference; import java.lang.reflect.AccessibleObject; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; @@ -35,7 +36,7 @@ import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Properties; -import java.util.concurrent.ConcurrentHashMap; +import java.util.WeakHashMap; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; @@ -70,8 +71,8 @@ public class DefaultInstanceManager impl private Properties restrictedFilters = new Properties(); private Properties restrictedListeners = new Properties(); private Properties restrictedServlets = new Properties(); -private Map,List> annotationCache = -new ConcurrentHashMap, List>(); +private final Map,WeakReference>> annotationCache = +new WeakHashMap, WeakReference>>(); public DefaultInstanceManager(Context context, Map> injectionMap, org.apache.catalina.Context catalinaContext, ClassLoader containerClassLoader) { classLoader = catalinaContext.getLoader().getClassLoader(); @@ -178,7 +179,10 @@ public class DefaultInstanceManager impl // At the end the postconstruct annotated // method is invoked -List annotations = annotationCache.get(clazz); +List annotations; +synchronized (annotationCache) { +annotations = annotationCache.get(clazz).get(); +} for (AnnotationCacheEntry entry : annotations) { if (entry.getType() == AnnotationCacheEntryType.POST_CONSTRUCT) { Method postConstruct = (Method) entry.getAccessibleObject(); @@ -209,7 +213,14 @@ public class DefaultInstanceManager impl // At the end the postconstruct annotated // method is invoked -List annotations = annotationCache.get(clazz); +List annotations = null; +synchronized (annotationCache) { +WeakReference> ref = +annotationCache.get(clazz); +if (ref != null) { +annotations = ref.get(); +} +} if (annotations == null) { // instance not created through the instance manager return; @@ -243,7 +254,14 @@ public class DefaultInstanceManager impl InvocationTargetException, NamingException { while (clazz != null) { -List annotations = annotationCache.get(clazz); +List annotations = null; +synchronized (annotationCache) { +WeakReference> ref = +annotationCache.get(clazz); +if (ref != null) { +annotations = ref.get(); +} +} if (annotations == null) { annotations = new ArrayList(); @@ -396,7 +414,11 @@ public class DefaultInstanceManager impl // Use common empty list to save memory annotations = Collections.emptyList(); } -annotationCache.put(clazz, annotations); +synchronized (annotationCache) { +annotationCache.put(clazz, +new WeakReference>( +annotations)); +} } else { // If the annotations for this class have been cached, the // annotations for all the super classes will have been cachced @@ -429,7 +451,10 @@ public class DefaultInstanceManager impl Class clazz = instance.getClass(); while (clazz != null) { -List annotations = annotationCache.get(clazz); +List annotations; +synchronized (annotationCache) { +annotations = annotationCache.get(clazz).get(); +} for (AnnotationCac
svn commit: r1172689 - /tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java
Author: markt Date: Mon Sep 19 16:30:36 2011 New Revision: 1172689 URL: http://svn.apache.org/viewvc?rev=1172689&view=rev Log: Fix threading issue with changing visibility of methods and fields Modified: tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java Modified: tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java?rev=1172689&r1=1172688&r2=1172689&view=diff == --- tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java Mon Sep 19 16:30:36 2011 @@ -187,9 +187,11 @@ public class DefaultInstanceManager impl if (entry.getType() == AnnotationCacheEntryType.POST_CONSTRUCT) { Method postConstruct = (Method) entry.getAccessibleObject(); boolean accessibility = postConstruct.isAccessible(); -postConstruct.setAccessible(true); -postConstruct.invoke(instance); -postConstruct.setAccessible(accessibility); +synchronized (postConstruct) { +postConstruct.setAccessible(true); +postConstruct.invoke(instance); +postConstruct.setAccessible(accessibility); +} } } } @@ -229,9 +231,11 @@ public class DefaultInstanceManager impl if (entry.getType() == AnnotationCacheEntryType.PRE_DESTROY) { Method preDestroy = (Method) entry.getAccessibleObject(); boolean accessibility = preDestroy.isAccessible(); -preDestroy.setAccessible(true); -preDestroy.invoke(instance); -preDestroy.setAccessible(accessibility); +synchronized (preDestroy) { +preDestroy.setAccessible(true); +preDestroy.invoke(instance); +preDestroy.setAccessible(accessibility); +} } } } @@ -572,9 +576,11 @@ public class DefaultInstanceManager impl } accessibility = field.isAccessible(); -field.setAccessible(true); -field.set(instance, lookedupResource); -field.setAccessible(accessibility); +synchronized (field) { +field.setAccessible(true); +field.set(instance, lookedupResource); +field.setAccessible(accessibility); +} } /** @@ -614,9 +620,11 @@ public class DefaultInstanceManager impl } accessibility = method.isAccessible(); -method.setAccessible(true); -method.invoke(instance, lookedupResource); -method.setAccessible(accessibility); +synchronized (method) { +method.setAccessible(true); +method.invoke(instance, lookedupResource); +method.setAccessible(accessibility); +} } public static String getName(Method setter) { - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1172696 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/core/DefaultInstanceManager.java test/org/apache/catalina/core/TestDefaultInstanceManager.java test/webapp-3.0/annotations.
Author: markt Date: Mon Sep 19 16:47:03 2011 New Revision: 1172696 URL: http://svn.apache.org/viewvc?rev=1172696&view=rev Log: Fix resource leak in annotations cache that prevented unloading of resources that used annotations Added: tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestDefaultInstanceManager.java - copied unchanged from r1172664, tomcat/trunk/test/org/apache/catalina/core/TestDefaultInstanceManager.java tomcat/tc7.0.x/trunk/test/webapp-3.0/annotations.jsp - copied unchanged from r1172664, tomcat/trunk/test/webapp-3.0/annotations.jsp Modified: tomcat/tc7.0.x/trunk/ (props changed) tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java Propchange: tomcat/tc7.0.x/trunk/ -- --- svn:mergeinfo (original) +++ svn:mergeinfo Mon Sep 19 16:47:03 2011 @@ -1 +1 @@ -/tomcat/trunk:1156171,1156276,1156304,1156530,1156602,1157015,1157018,1157151,1157198,1157204,1157810,1157832,1157834,1157847,1157908,1157939,1158155,1158160,1158176,1158195,1158198-1158199,1158227,1158331,1158334-1158335,1158426,1160347,1160592,1160611,1160619,1160626,1160639,1160652,1160720-1160721,1160772,1160774,1160776,1161303,1161310,1161322,1161339,1161486,1161540,1161549,1161584,1162082,1162149,1162169,1162721,1162769,1162836,1162932,1163630,1164419,1164438,1164469,1164480,1164567,1165234,1165247-1165248,1165253,1165273,1165282,1165309,1165331,1165338,1165347,1165360-1165361,1165367-1165368,1165602,1165608,1165677,1165693,1165721,1165723,1165728,1165730,1165738,1165746,1165765,1165777,1165918,1165921,1166077,1166150-1166151,1166290,1166366,1166620,1166686,1166752,1166757,1167368,1167394,1169447,1171692,1172233-1172234,1172236,1172269,1172278,1172282,1172610 +/tomcat/trunk:1156171,1156276,1156304,1156530,1156602,1157015,1157018,1157151,1157198,1157204,1157810,1157832,1157834,1157847,1157908,1157939,1158155,1158160,1158176,1158195,1158198-1158199,1158227,1158331,1158334-1158335,1158426,1160347,1160592,1160611,1160619,1160626,1160639,1160652,1160720-1160721,1160772,1160774,1160776,1161303,1161310,1161322,1161339,1161486,1161540,1161549,1161584,1162082,1162149,1162169,1162721,1162769,1162836,1162932,1163630,1164419,1164438,1164469,1164480,1164567,1165234,1165247-1165248,1165253,1165273,1165282,1165309,1165331,1165338,1165347,1165360-1165361,1165367-1165368,1165602,1165608,1165677,1165693,1165721,1165723,1165728,1165730,1165738,1165746,1165765,1165777,1165918,1165921,1166077,1166150-1166151,1166290,1166366,1166620,1166686,1166752,1166757,1167368,1167394,1169447,1171692,1172233-1172234,1172236,1172269,1172278,1172282,1172610,1172664 Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java?rev=1172696&r1=1172695&r2=1172696&view=diff == --- tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java Mon Sep 19 16:47:03 2011 @@ -21,6 +21,7 @@ package org.apache.catalina.core; import java.io.IOException; import java.io.InputStream; +import java.lang.ref.WeakReference; import java.lang.reflect.AccessibleObject; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; @@ -35,7 +36,7 @@ import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Properties; -import java.util.concurrent.ConcurrentHashMap; +import java.util.WeakHashMap; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; @@ -70,8 +71,8 @@ public class DefaultInstanceManager impl private Properties restrictedFilters = new Properties(); private Properties restrictedListeners = new Properties(); private Properties restrictedServlets = new Properties(); -private Map,List> annotationCache = -new ConcurrentHashMap, List>(); +private final Map,WeakReference>> annotationCache = +new WeakHashMap, WeakReference>>(); public DefaultInstanceManager(Context context, Map> injectionMap, org.apache.catalina.Context catalinaContext, ClassLoader containerClassLoader) { classLoader = catalinaContext.getLoader().getClassLoader(); @@ -178,7 +179,10 @@ public class DefaultInstanceManager impl // At the end the postconstruct annotated // method is invoked -List annotations = annotationCache.get(clazz); +List annotations; +synchronized (annotationCache) { +annotations = annotationCache.get(clazz).get(); +} for (AnnotationCacheEntry entry : annotations) { if (entry.getType() == AnnotationCacheEntryType.POST_CONSTRUCT) { Method postConstruct = (Method) entry.getAccessibleObject(); @@ -
svn commit: r1172697 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/core/DefaultInstanceManager.java
Author: markt Date: Mon Sep 19 16:48:24 2011 New Revision: 1172697 URL: http://svn.apache.org/viewvc?rev=1172697&view=rev Log: Fix threading issue with changing visibility of methods and fields Modified: tomcat/tc7.0.x/trunk/ (props changed) tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java Propchange: tomcat/tc7.0.x/trunk/ -- --- svn:mergeinfo (original) +++ svn:mergeinfo Mon Sep 19 16:48:24 2011 @@ -1 +1 @@ -/tomcat/trunk:1156171,1156276,1156304,1156530,1156602,1157015,1157018,1157151,1157198,1157204,1157810,1157832,1157834,1157847,1157908,1157939,1158155,1158160,1158176,1158195,1158198-1158199,1158227,1158331,1158334-1158335,1158426,1160347,1160592,1160611,1160619,1160626,1160639,1160652,1160720-1160721,1160772,1160774,1160776,1161303,1161310,1161322,1161339,1161486,1161540,1161549,1161584,1162082,1162149,1162169,1162721,1162769,1162836,1162932,1163630,1164419,1164438,1164469,1164480,1164567,1165234,1165247-1165248,1165253,1165273,1165282,1165309,1165331,1165338,1165347,1165360-1165361,1165367-1165368,1165602,1165608,1165677,1165693,1165721,1165723,1165728,1165730,1165738,1165746,1165765,1165777,1165918,1165921,1166077,1166150-1166151,1166290,1166366,1166620,1166686,1166752,1166757,1167368,1167394,1169447,1171692,1172233-1172234,1172236,1172269,1172278,1172282,1172610,1172664 +/tomcat/trunk:1156171,1156276,1156304,1156530,1156602,1157015,1157018,1157151,1157198,1157204,1157810,1157832,1157834,1157847,1157908,1157939,1158155,1158160,1158176,1158195,1158198-1158199,1158227,1158331,1158334-1158335,1158426,1160347,1160592,1160611,1160619,1160626,1160639,1160652,1160720-1160721,1160772,1160774,1160776,1161303,1161310,1161322,1161339,1161486,1161540,1161549,1161584,1162082,1162149,1162169,1162721,1162769,1162836,1162932,1163630,1164419,1164438,1164469,1164480,1164567,1165234,1165247-1165248,1165253,1165273,1165282,1165309,1165331,1165338,1165347,1165360-1165361,1165367-1165368,1165602,1165608,1165677,1165693,1165721,1165723,1165728,1165730,1165738,1165746,1165765,1165777,1165918,1165921,1166077,1166150-1166151,1166290,1166366,1166620,1166686,1166752,1166757,1167368,1167394,1169447,1171692,1172233-1172234,1172236,1172269,1172278,1172282,1172610,1172664,1172689 Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java?rev=1172697&r1=1172696&r2=1172697&view=diff == --- tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java Mon Sep 19 16:48:24 2011 @@ -187,9 +187,11 @@ public class DefaultInstanceManager impl if (entry.getType() == AnnotationCacheEntryType.POST_CONSTRUCT) { Method postConstruct = (Method) entry.getAccessibleObject(); boolean accessibility = postConstruct.isAccessible(); -postConstruct.setAccessible(true); -postConstruct.invoke(instance); -postConstruct.setAccessible(accessibility); +synchronized (postConstruct) { +postConstruct.setAccessible(true); +postConstruct.invoke(instance); +postConstruct.setAccessible(accessibility); +} } } } @@ -229,9 +231,11 @@ public class DefaultInstanceManager impl if (entry.getType() == AnnotationCacheEntryType.PRE_DESTROY) { Method preDestroy = (Method) entry.getAccessibleObject(); boolean accessibility = preDestroy.isAccessible(); -preDestroy.setAccessible(true); -preDestroy.invoke(instance); -preDestroy.setAccessible(accessibility); +synchronized (preDestroy) { +preDestroy.setAccessible(true); +preDestroy.invoke(instance); +preDestroy.setAccessible(accessibility); +} } } } @@ -570,9 +574,11 @@ public class DefaultInstanceManager impl } accessibility = field.isAccessible(); -field.setAccessible(true); -field.set(instance, lookedupResource); -field.setAccessible(accessibility); +synchronized (field) { +field.setAccessible(true); +field.set(instance, lookedupResource); +field.setAccessible(accessibility); +} } /** @@ -612,9 +618,11 @@ public class DefaultInstanceManager impl } accessibility = method.isAccessible(); -method.setAccessible(true); -method.invoke(instance, lookedupResource); -method.setAccessible(accessibility); +synchroni
Re: svn commit: r1166290 - /tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java
On 19/09/2011 12:12, Mark Thomas wrote: > On 12/09/2011 12:15, Konstantin Kolinko wrote: >> 2011/9/7 Mark Thomas : >>> On 07/09/2011 19:49, Konstantin Kolinko wrote: 2011/9/7 : > Author: markt > Date: Wed Sep 7 18:11:20 2011 > New Revision: 1166290 > > URL: http://svn.apache.org/viewvc?rev=1166290&view=rev > Log: > Add a simple annotation cache to improve performance for applications > that use lots of non-poolable tags. > > > 2. I wonder when the cache is cleared. E.g. if we are in development mode or have enabled unloading unused JSPs in JspServlet configuration. If I understand correctly it accumulates references to Class objects but never releases them. >>> >>> When the context is stopped. >> >> This issue is still pending. >> Though I think it concerns only development mode, and benefits of this >> cache out-weight the resource leak. > > As written, it makes the maxLoadedJsps Jasper option useless. > > I have given this some thought this morning and I plan on looking at a > WeakHashMap (plus synchronisation to handle the concurrency) based solution. Fixed in r1172664. >> 4. There is code that calls setAccessible() for Method, e.g.: >> >> Method postConstruct = (Method) entry.getAccessibleObject(); >> boolean accessibility = postConstruct.isAccessible(); >> postConstruct.setAccessible(true); >> postConstruct.invoke(instance); >> postConstruct.setAccessible(accessibility); >> >> There will be a race condition if several threads are changing >> (setting or restoring) the method accessibility flag on the same >> Method right before invoke() or isAccessible() calls. > > I'll try and address this along with the WeakHashMap changes since I'll > be adding some syncs already. Fixed in r1172689. The changes have also been back-ported to 7.0.x. Mark - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1172711 - /tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
Author: markt Date: Mon Sep 19 17:14:10 2011 New Revision: 1172711 URL: http://svn.apache.org/viewvc?rev=1172711&view=rev Log: Don't add to Poller when socket is closing to prevent NPEs. Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java?rev=1172711&r1=1172710&r2=1172711&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java Mon Sep 19 17:14:10 2011 @@ -215,7 +215,7 @@ public class Http11AprProtocol extends A boolean addToPoller) { processor.recycle(); recycledProcessors.offer(processor); -if (addToPoller) { +if (addToPoller && proto.endpoint.isRunning()) { ((AprEndpoint)proto.endpoint).getPoller().add( socket.getSocket().longValue(), true); } @@ -234,7 +234,7 @@ public class Http11AprProtocol extends A if (processor.isAsync()) { socket.setAsync(true); -} else if (processor.comet) { +} else if (processor.comet && proto.endpoint.isRunning()) { ((AprEndpoint) proto.endpoint).getCometPoller().add( socket.getSocket().longValue(), false); } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: svn commit: r1172616 - /tomcat/tc6.0.x/trunk/STATUS.txt
On 19.09.2011 15:30, ma...@apache.org wrote: > Author: markt > Date: Mon Sep 19 13:30:32 2011 > New Revision: 1172616 > > URL: http://svn.apache.org/viewvc?rev=1172616&view=rev > Log: > Add a comment > > Modified: > tomcat/tc6.0.x/trunk/STATUS.txt > > Modified: tomcat/tc6.0.x/trunk/STATUS.txt > URL: > http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=1172616&r1=1172615&r2=1172616&view=diff > == > --- tomcat/tc6.0.x/trunk/STATUS.txt (original) > +++ tomcat/tc6.0.x/trunk/STATUS.txt Mon Sep 19 13:30:32 2011 > @@ -110,5 +110,7 @@ PATCHES/ISSUES THAT ARE STALLED >rjung: I started a discussion about JSPs and memory on the dev list. >The updated patch fixes a race condition. >We can stall this item until we get some feedback about 7.0.5. > + markt - r1172614 needs to be included in this proposal. With that > patch, > + my testing shows that the unloading works as designed >-1: Thanks Mark. Obviously my tests were to trivial, namely continuously replacing the same (small) set of JSPs. Regards, Rainer - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: svn commit: r1172689 - /tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java
On 19 September 2011 17:30, wrote: > Author: markt > Date: Mon Sep 19 16:30:36 2011 > New Revision: 1172689 > > URL: http://svn.apache.org/viewvc?rev=1172689&view=rev > Log: > Fix threading issue with changing visibility of methods and fields > > Modified: > tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java > > Modified: > tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java > URL: > http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java?rev=1172689&r1=1172688&r2=1172689&view=diff > == > --- tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java > (original) > +++ tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java > Mon Sep 19 16:30:36 2011 > @@ -187,9 +187,11 @@ public class DefaultInstanceManager impl > if (entry.getType() == AnnotationCacheEntryType.POST_CONSTRUCT) { > Method postConstruct = (Method) entry.getAccessibleObject(); > boolean accessibility = postConstruct.isAccessible(); > - postConstruct.setAccessible(true); > - postConstruct.invoke(instance); > - postConstruct.setAccessible(accessibility); > + synchronized (postConstruct) { > + postConstruct.setAccessible(true); > + postConstruct.invoke(instance); > + postConstruct.setAccessible(accessibility); > + } Could skip the synch. block and two method calls if the field is already accessible: if (accessibility) { postConstruct.invoke(instance); } else { synchronized (postConstruct) { postConstruct.setAccessible(true); postConstruct.invoke(instance); postConstruct.setAccessible(accessibility); } } Similarly for the other synch. blocks below. > } > } > } > @@ -229,9 +231,11 @@ public class DefaultInstanceManager impl > if (entry.getType() == AnnotationCacheEntryType.PRE_DESTROY) { > Method preDestroy = (Method) entry.getAccessibleObject(); > boolean accessibility = preDestroy.isAccessible(); > - preDestroy.setAccessible(true); > - preDestroy.invoke(instance); > - preDestroy.setAccessible(accessibility); > + synchronized (preDestroy) { > + preDestroy.setAccessible(true); > + preDestroy.invoke(instance); > + preDestroy.setAccessible(accessibility); > + } > } > } > } > @@ -572,9 +576,11 @@ public class DefaultInstanceManager impl > } > > accessibility = field.isAccessible(); > - field.setAccessible(true); > - field.set(instance, lookedupResource); > - field.setAccessible(accessibility); > + synchronized (field) { > + field.setAccessible(true); > + field.set(instance, lookedupResource); > + field.setAccessible(accessibility); > + } > } > > /** > @@ -614,9 +620,11 @@ public class DefaultInstanceManager impl > } > > accessibility = method.isAccessible(); > - method.setAccessible(true); > - method.invoke(instance, lookedupResource); > - method.setAccessible(accessibility); > + synchronized (method) { > + method.setAccessible(true); > + method.invoke(instance, lookedupResource); > + method.setAccessible(accessibility); > + } > } > > public static String getName(Method setter) { > > > > - > To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org > For additional commands, e-mail: dev-h...@tomcat.apache.org > > - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org