You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by kk...@apache.org on 2013/11/24 23:07:08 UTC

svn commit: r1545084 - /tomcat/trunk/build.xml

Author: kkolinko
Date: Sun Nov 24 22:07:08 2013
New Revision: 1545084

URL: http://svn.apache.org/r1545084
Log:
Exclude AprSocket class from instrumentation.

Cobertura fails to instrument it, because it causes loading jni.socket.AprSocketContext and jni.Library
which fails when tcnative library is absent in java.library.path.

No need to backport, as this class is absent in Tomcat 7.

Modified:
    tomcat/trunk/build.xml

Modified: tomcat/trunk/build.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/build.xml?rev=1545084&r1=1545083&r2=1545084&view=diff
==============================================================================
--- tomcat/trunk/build.xml (original)
+++ tomcat/trunk/build.xml Sun Nov 24 22:07:08 2013
@@ -1386,6 +1386,8 @@
         <exclude name="**/OneLineFormatter*.class"/>
         <exclude name="**/DateFormatCache.class"/>
         <exclude name="**/DateFormatCache*.class"/>
+        <!-- This class cannot be instrumented when tcnative library is not in java.library.path -->
+        <exclude name="**/jni/socket/AprSocket.class"/>
       </fileset>
       <auxClasspath path="${jdt.jar}" />
     </cobertura-instrument>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: svn commit: r1545084 - /tomcat/trunk/build.xml

Posted by Konstantin Kolinko <kn...@gmail.com>.
2013/11/25 Mark Thomas <ma...@apache.org>:
> On 24/11/2013 22:07, kkolinko@apache.org wrote:
>> Author: kkolinko
>> Date: Sun Nov 24 22:07:08 2013
>> New Revision: 1545084
>>
>> URL: http://svn.apache.org/r1545084
>> Log:
>> Exclude AprSocket class from instrumentation.
>>
>> Cobertura fails to instrument it, because it causes loading jni.socket.AprSocketContext and jni.Library
>> which fails when tcnative library is absent in java.library.path.
>
> Rather than always excluding this class, shouldn't it be excluded only
> when the tcnative library is absent?
>

I think it as a temporary workaround against an issue in Cobertura itself.

Though I have not reported it nor searched their issue tracker.

When Cobertura tries to instrument this class,  it causes loading of
AprSocketContext. The latter fails because static code in that class
calls Library.initialize() and tcnative binary is missing.

Note that it has no problem instrumenting Library and AprSocketContext
classes themselves. It is just this one class that fails.

1). I see no good reason to allow Cobertura to load tcnative.
Note that one would need to explicitly configure java.library.path,
like we already do when running junit.

2). I do not want to introduce a conditional exclude here, because
instrumented classes are earlier on the classpath than regular ones.
Conditionally skipping instrumentation for some classes may result in
a stale class being used.

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: svn commit: r1545084 - /tomcat/trunk/build.xml

Posted by Mark Thomas <ma...@apache.org>.
On 24/11/2013 22:07, kkolinko@apache.org wrote:
> Author: kkolinko
> Date: Sun Nov 24 22:07:08 2013
> New Revision: 1545084
> 
> URL: http://svn.apache.org/r1545084
> Log:
> Exclude AprSocket class from instrumentation.
> 
> Cobertura fails to instrument it, because it causes loading jni.socket.AprSocketContext and jni.Library
> which fails when tcnative library is absent in java.library.path.

Rather than always excluding this class, shouldn't it be excluded only
when the tcnative library is absent?

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org