Re: Using reflection to call tcnative methods
Mladen, On 7/8/2011 11:44 PM, Mladen Turk wrote: > On 07/09/2011 04:14 AM, Christopher Schultz wrote: >> All, >> >> I've been working in AprLifecycleListener to add FIPS support. I need to >> make an additional native method call in initializeSSL and I'm wondering >> why all of the native methods are called using reflection instead of >> direct method calls. >> > > Think that originates from the initial code when the java part of > native was not part of tomcat code. > We needed a way to make (at that time a separate .jar) tomcat uses > it without run time dependency. That makes sense. >> If there's no good reason, then all the reflective-call clutter should >> be removed. >> > > +1. > There is absolutely no reason to use the reflection any more. Okay. I have a patch I'd like to make that should be as small as possible in general, so I think I shouldn't change the existing reflective calls, at least not in this patch. Should I therefore code my patch to match the existing code (using reflection) and then write another patch to remove the reflection, or should my initial patch just avoid the reflection and the code will have two different calling strategies until both patches are applied? (I'm more concerned with backporting to TC 6 than my initial patches which are of course targeted towards TC 7). I'll wait for another opinion or two before I make any commits. Thanks, -chris signature.asc Description: OpenPGP digital signature
svn commit: r1144682 - /tomcat/trunk/webapps/docs/changelog.xml
Author: markt Date: Sat Jul 9 15:21:46 2011 New Revision: 1144682 URL: http://svn.apache.org/viewvc?rev=1144682&view=rev Log: Add regression fix to changelog Modified: tomcat/trunk/webapps/docs/changelog.xml Modified: tomcat/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1144682&r1=1144681&r2=1144682&view=diff == --- tomcat/trunk/webapps/docs/changelog.xml (original) +++ tomcat/trunk/webapps/docs/changelog.xml Sat Jul 9 15:21:46 2011 @@ -60,6 +60,10 @@ Various refactorings to reduce code duplication and unnecessary code in the connectors. (markt) + +Correct regression introduced in 7.0.17 that triggered 400 entries in +the AccessLog when using the AJP/BIO connector. (markt) + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1144690 - in /tomcat/trunk: java/org/apache/catalina/startup/Catalina.java java/org/apache/catalina/startup/ClusterRuleSetFactory.java webapps/docs/changelog.xml
Author: markt Date: Sat Jul 9 16:05:42 2011 New Revision: 1144690 URL: http://svn.apache.org/viewvc?rev=1144690&view=rev Log: Remove some more unnecessary code Removed: tomcat/trunk/java/org/apache/catalina/startup/ClusterRuleSetFactory.java Modified: tomcat/trunk/java/org/apache/catalina/startup/Catalina.java tomcat/trunk/webapps/docs/changelog.xml Modified: tomcat/trunk/java/org/apache/catalina/startup/Catalina.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/Catalina.java?rev=1144690&r1=1144689&r2=1144690&view=diff == --- tomcat/trunk/java/org/apache/catalina/startup/Catalina.java (original) +++ tomcat/trunk/java/org/apache/catalina/startup/Catalina.java Sat Jul 9 16:05:42 2011 @@ -36,6 +36,7 @@ import org.apache.catalina.LifecycleExce import org.apache.catalina.LifecycleState; import org.apache.catalina.Server; import org.apache.catalina.core.StandardServer; +import org.apache.catalina.ha.ClusterRuleSet; import org.apache.catalina.security.SecurityConfig; import org.apache.juli.ClassLoaderLogManager; import org.apache.tomcat.util.ExceptionUtils; @@ -373,13 +374,13 @@ public class Catalina { digester.addRuleSet(new EngineRuleSet("Server/Service/")); digester.addRuleSet(new HostRuleSet("Server/Service/Engine/")); digester.addRuleSet(new ContextRuleSet("Server/Service/Engine/Host/")); - digester.addRuleSet(ClusterRuleSetFactory.getClusterRuleSet("Server/Service/Engine/Host/Cluster/")); +digester.addRuleSet(new ClusterRuleSet("Server/Service/Engine/Host/Cluster/")); digester.addRuleSet(new NamingRuleSet("Server/Service/Engine/Host/Context/")); // When the 'engine' is found, set the parentClassLoader. digester.addRule("Server/Service/Engine", new SetParentClassLoaderRule(parentClassLoader)); - digester.addRuleSet(ClusterRuleSetFactory.getClusterRuleSet("Server/Service/Engine/Cluster/")); +digester.addRuleSet(new ClusterRuleSet("Server/Service/Engine/Cluster/")); long t2=System.currentTimeMillis(); if (log.isDebugEnabled()) Modified: tomcat/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1144690&r1=1144689&r2=1144690&view=diff == --- tomcat/trunk/webapps/docs/changelog.xml (original) +++ tomcat/trunk/webapps/docs/changelog.xml Sat Jul 9 16:05:42 2011 @@ -66,6 +66,14 @@ + + + +Remove unnecessary serverl.xml parsing code for old cluster +implementation that does not ship as part of Tomcat 7. (markt) + + + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1144701 - in /tomcat/trunk: build.properties.default webapps/docs/changelog.xml
Author: markt Date: Sat Jul 9 16:38:39 2011 New Revision: 1144701 URL: http://svn.apache.org/viewvc?rev=1144701&view=rev Log: Update to Commons Daemon 1.0.6 Modified: tomcat/trunk/build.properties.default tomcat/trunk/webapps/docs/changelog.xml Modified: tomcat/trunk/build.properties.default URL: http://svn.apache.org/viewvc/tomcat/trunk/build.properties.default?rev=1144701&r1=1144700&r2=1144701&view=diff == --- tomcat/trunk/build.properties.default (original) +++ tomcat/trunk/build.properties.default Sat Jul 9 16:38:39 2011 @@ -158,19 +158,19 @@ nsis.nsisdl.dll=${nsis.home}/Plugins/NSI nsis.loc=${base-sf.loc}/nsis/nsis-2.46.zip # - Commons Daemon, version 1.0-Alpha or later - -commons-daemon.version=1.0.5 +commons-daemon.version=1.0.6 commons-daemon.home=${base.path}/commons-daemon-${commons-daemon.version} commons-daemon.jar=${commons-daemon.home}/commons-daemon-${commons-daemon.version}.jar commons-daemon.native.win.home=${commons-daemon.home}/windows commons-daemon.native.win.mgr.exe=${commons-daemon.native.win.home}/prunmgr.exe commons-daemon.native.src.tgz=${commons-daemon.home}/commons-daemon-${commons-daemon.version}-native-src.tar.gz commons-daemon.native.win.zip=${commons-daemon.home}/commons-daemon-${commons-daemon.version}-bin-windows.zip -commons-daemon.bin.loc.1=${base-commons.loc.1}/daemon/binaries/${commons-daemon.version}/commons-daemon-${commons-daemon.version}-bin.tar.gz -commons-daemon.bin.loc.2=${base-commons.loc.2}/daemon/binaries/${commons-daemon.version}/commons-daemon-${commons-daemon.version}-bin.tar.gz +commons-daemon.bin.loc.1=${base-commons.loc.1}/daemon/binaries/commons-daemon-${commons-daemon.version}-bin.tar.gz +commons-daemon.bin.loc.2=${base-commons.loc.2}/daemon/binaries/commons-daemon-${commons-daemon.version}-bin.tar.gz commons-daemon.native.src.loc.1=${base-commons.loc.1}/daemon/source/commons-daemon-${commons-daemon.version}-native-src.tar.gz commons-daemon.native.src.loc.2=${base-commons.loc.2}/daemon/source/commons-daemon-${commons-daemon.version}-native-src.tar.gz -commons-daemon.native.win.loc.1=${base-commons.loc.1}/daemon/binaries/${commons-daemon.version}/windows/commons-daemon-${commons-daemon.version}-bin-windows.zip -commons-daemon.native.win.loc.2=${base-commons.loc.2}/daemon/binaries/${commons-daemon.version}/windows/commons-daemon-${commons-daemon.version}-bin-windows.zip +commons-daemon.native.win.loc.1=${base-commons.loc.1}/daemon/binaries/windows/commons-daemon-${commons-daemon.version}-bin-windows.zip +commons-daemon.native.win.loc.2=${base-commons.loc.2}/daemon/binaries/windows/commons-daemon-${commons-daemon.version}-bin-windows.zip # - JUnit Unit Test Suite, version 3.7 or later - junit.home=${base.path}/junit3.8.2 Modified: tomcat/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1144701&r1=1144700&r2=1144701&view=diff == --- tomcat/trunk/webapps/docs/changelog.xml (original) +++ tomcat/trunk/webapps/docs/changelog.xml Sat Jul 9 16:38:39 2011 @@ -74,6 +74,13 @@ + + + +Update to Commons Daemon 1.0.6. (markt) + + + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1144706 - in /tomcat/trunk: build.properties.default res/maven/tomcat-jasper.pom webapps/docs/changelog.xml
Author: markt Date: Sat Jul 9 16:56:49 2011 New Revision: 1144706 URL: http://svn.apache.org/viewvc?rev=1144706&view=rev Log: Update to Eclipse JDT Compiler 3.7 Modified: tomcat/trunk/build.properties.default tomcat/trunk/res/maven/tomcat-jasper.pom tomcat/trunk/webapps/docs/changelog.xml Modified: tomcat/trunk/build.properties.default URL: http://svn.apache.org/viewvc/tomcat/trunk/build.properties.default?rev=1144706&r1=1144705&r2=1144706&view=diff == --- tomcat/trunk/build.properties.default (original) +++ tomcat/trunk/build.properties.default Sat Jul 9 16:56:49 2011 @@ -117,8 +117,8 @@ wsdl4j-lib.loc=${base-maven.loc}/wsdl4j/ wsdl4j-lib.jar=${wsdl4j-lib.home}/wsdl4j-${wsdl4j-lib.version}.jar # - Eclipse JDT, version 3.2 or later - -jdt.version=3.6.2 -jdt.release=R-3.6.2-201102101200 +jdt.version=3.7 +jdt.release=R-3.7-201106131736 jdt.home=${base.path}/ecj-${jdt.version} jdt.jar=${jdt.home}/ecj-${jdt.version}.jar # The download will be moved to the archive area eventually. We are taking care of that in advance. Modified: tomcat/trunk/res/maven/tomcat-jasper.pom URL: http://svn.apache.org/viewvc/tomcat/trunk/res/maven/tomcat-jasper.pom?rev=1144706&r1=1144705&r2=1144706&view=diff == --- tomcat/trunk/res/maven/tomcat-jasper.pom (original) +++ tomcat/trunk/res/maven/tomcat-jasper.pom Sat Jul 9 16:56:49 2011 @@ -49,7 +49,7 @@ org.eclipse.jdt.core.compiler ecj - 3.6.2 + 3.7 org.apache.tomcat Modified: tomcat/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1144706&r1=1144705&r2=1144706&view=diff == --- tomcat/trunk/webapps/docs/changelog.xml (original) +++ tomcat/trunk/webapps/docs/changelog.xml Sat Jul 9 16:56:49 2011 @@ -79,6 +79,9 @@ Update to Commons Daemon 1.0.6. (markt) + +Update to Eclipse JDT Compiler 3.7. (markt) + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
DO NOT REPLY [Bug 51487] Consider adding the JAR to to the tomcat.util.scan.DefaultJarScanner.jarsToSkip in CATALINA_BASE/catalina.properties
https://issues.apache.org/bugzilla/show_bug.cgi?id=51487 Mark Thomas changed: What|Removed |Added Status|NEW |RESOLVED Resolution||INVALID --- Comment #1 from Mark Thomas 2011-07-09 20:50:51 UTC --- Bugzilla is not a support forum. Please use the users mailing list. -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: [VOTE] Release Apache Tomcat 7.0.18
2011/7/7 Mark Thomas : > The proposed Apache Tomcat 7.0.18 release is now available for voting. > > It can be obtained from: > http://people.apache.org/~markt/dev/tomcat-7/v7.0.18/ > The svn tag is: > http://svn.apache.org/repos/asf/tomcat/tc7.0.x/tags/TOMCAT_7_0_18/ > > The proposed 7.0.18 release is: > > [x] Broken - do not release > [ ] Alpha - go ahead and release as 7.0.18 Alpha > [ ] Beta - go ahead and release as 7.0.18 Beta > [ ] Stable - go ahead and release as 7.0.18 Stable If IP6 address is used in a connector it fails to start. E.g., set the following attribute on a connector: address="::1" it results in 10.07.2011 4:14:29 org.apache.coyote.AbstractProtocol init SEVERE: Failed to register MBean [null] for ProtocolHandler [http-bio-/0:0:0:0:0:0:0:1-8080] javax.management.MalformedObjectNameException: Invalid character ':' in value part of property at javax.management.ObjectName.construct(Unknown Source) at javax.management.ObjectName.(Unknown Source) at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:347) at org.apache.coyote.http11.AbstractHttp11JsseProtocol.init(AbstractHttp11JsseProtocol.java:119) at org.apache.catalina.connector.Connector.initInternal(Connector.java:910) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:101) at org.apache.catalina.core.StandardService.initInternal(StandardService.java:559) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:101) at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:781) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:101) at org.apache.catalina.startup.Catalina.load(Catalina.java:572) at org.apache.catalina.startup.Catalina.load(Catalina.java:595) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:449) This problem does not exist in 7.0.16 - it starts successfully. The likely cause is r1135088 that has to be reverted. I feel sorry that I did not revert it immediately when I started Re:r1135088 discussion 4 days ago. Best regards, Konstantin Kolinko - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
DO NOT REPLY [Bug 51494] New: NPE in StandardContextValve.invoke() when a webapp is redeployed while a request is still being processed
https://issues.apache.org/bugzilla/show_bug.cgi?id=51494 Bug #: 51494 Summary: NPE in StandardContextValve.invoke() when a webapp is redeployed while a request is still being processed Product: Tomcat 7 Version: 7.0.16 Platform: PC Status: NEW Severity: minor Priority: P2 Component: Catalina AssignedTo: dev@tomcat.apache.org ReportedBy: prei...@web.de Classification: Unclassified Hi, The following applies to Tomcat 7.0.18, but I couldn't select that version. When a request to a Servlet takes a long time to process, and the webapp is redeployed in that time (e.g. by replacing the .war file), the following NPE is thrown in org.apache.catalina.core.StandardContextValve.invoke(): 10.07.2011 03:27:05 org.apache.catalina.connector.CoyoteAdapter service SCHWERWIEGEND: An exception or error occurred in the container during the request processing java.lang.NullPointerException at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:183) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:754) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:404) at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:274) at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:237) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1731) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) This is because "context" attribute in StandardContextValve is null at that time. I could reproduce this behaviour on Windows 7 (32 bit) with Sun/Oracle Java 1.6.0_26, using the Windows x86 binaries of Tomcat 7.0.18 (from http://people.apache.org/~markt/dev/tomcat-7/v7.0.18/) with the included Tomcat Native 1.1.20. To reproduce: 0) Download and install Tomcat 7.0.18 (I used the windows x86 zip binaries). 1) Create a simple webapp with a servlet, that takes a long time to process requests, e.g. by calling Thread.sleep(). For example, I used: @WebServlet("/LongRequest") public class LongRequest extends HttpServlet { protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { PrintWriter out = response.getWriter(); out.println("Start..."); out.flush(); try { Thread.sleep(2); } catch (InterruptedException ex) { out.println(ex.toString()); } out.println("Finished."); out.close(); } } 2) Package the webapp as ".war" file, and make two versions of that file. 3) Deploy the first version to Tomcat by copying the .war file into the "webapps" directory. 4) Open a browser and make a GET request to the above servlet. 5) Now immediately replace the .war file in the webapp directory with the second version, so that Tomcat will undeploy the old version and deploy the new one. 5) After the request finishes, the NPE is thrown. I originally observed a NPE in StandardWrapperValve.invoke() with Tomcat 7.0.16 that I reported on the users list [1], which occured when the webapp was redeployed while a servlet was still processing a request. However, I couldn't reproduce the NPE in StandardWrapperValve.invoke(), but in StandardContextValve.invoke(). [1] http://markmail.org/message/2tumlfipaotkshst -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1144785 - in /tomcat/trunk: java/org/apache/coyote/AbstractProtocol.java test/org/apache/catalina/mbeans/TestRegistration.java webapps/docs/changelog.xml
Author: rjung Date: Sun Jul 10 06:53:36 2011 New Revision: 1144785 URL: http://svn.apache.org/viewvc?rev=1144785&view=rev Log: Fix regression producing invalid MBean names when using IPV6 addresses for connectors. - revert r1135088 - remove the surrounding quotes only when passing the name to the endpoint, so they don't end up in the middle of thread names. The thread names are used as MBean attribute values, but not in MBean names. Modified: tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java tomcat/trunk/test/org/apache/catalina/mbeans/TestRegistration.java tomcat/trunk/webapps/docs/changelog.xml Modified: tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java?rev=1144785&r1=1144784&r2=1144785&view=diff == --- tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java (original) +++ tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java Sun Jul 10 06:53:36 2011 @@ -233,8 +233,7 @@ public abstract class AbstractProtocol i name.append('-'); } name.append(endpoint.getPort()); -String quotedName = ObjectName.quote(name.toString()); -return quotedName.substring(1, quotedName.length()-1); +return ObjectName.quote(name.toString()); } @@ -363,7 +362,8 @@ public abstract class AbstractProtocol i getHandler().getGlobal(), rgOname, null ); } -endpoint.setName(getName()); +String endpointName = getName(); +endpoint.setName(endpointName.substring(1, endpointName.length()-1)); try { endpoint.init(); Modified: tomcat/trunk/test/org/apache/catalina/mbeans/TestRegistration.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/mbeans/TestRegistration.java?rev=1144785&r1=1144784&r2=1144785&view=diff == --- tomcat/trunk/test/org/apache/catalina/mbeans/TestRegistration.java (original) +++ tomcat/trunk/test/org/apache/catalina/mbeans/TestRegistration.java Sun Jul 10 06:53:36 2011 @@ -80,10 +80,10 @@ public class TestRegistration extends To private static String[] connectorMBeanNames(String port, String type) { return new String[] { "Tomcat:type=Connector,port=" + port, -"Tomcat:type=GlobalRequestProcessor,name=http-" + type + "-" + port, +"Tomcat:type=GlobalRequestProcessor,name=\"http-" + type + "-" + port + "\"", "Tomcat:type=Mapper,port=" + port, "Tomcat:type=ProtocolHandler,port=" + port, -"Tomcat:type=ThreadPool,name=http-" + type + "-" + port, +"Tomcat:type=ThreadPool,name=\"http-" + type + "-" + port + "\"", }; } Modified: tomcat/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1144785&r1=1144784&r2=1144785&view=diff == --- tomcat/trunk/webapps/docs/changelog.xml (original) +++ tomcat/trunk/webapps/docs/changelog.xml Sun Jul 10 06:53:36 2011 @@ -64,6 +64,10 @@ Correct regression introduced in 7.0.17 that triggered 400 entries in the AccessLog when using the AJP/BIO connector. (markt) + +Fix regression producing invalid MBean names when using IPV6 +addresses for connectors. (rjung) + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org