2013/11/25 Mark Thomas <ma...@apache.org>:
> On 24/11/2013 22:07, kkoli...@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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to