Slicer4J icon indicating copy to clipboard operation
Slicer4J copied to clipboard

Library classes in jar are thrown out during instrumentation

Open Lms24 opened this issue 4 years ago • 2 comments

Hello,

I am currently trying to create dynamic slices from the test cases of this project. The project depends on the following libraries:

<dependencies>
  <dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>servlet-api</artifactId>
    <version>2.5</version>
  </dependency> 
  <dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>4.11</version>
    <scope>test</scope>
  </dependency>
</dependencies>

I've created a fat jar containing the compiled source and test classes, as well as the classes of all libraries.

After instrumenting the jar with SLice4J (mode i), the classes from javax.servlet are all missing in the resulting *_i.jar file! This is a problem as I get exceptions like this one for obvious reasons when I want to trace the execution:

Exception in thread "main" java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletRequest

Is there something I can do as a user of Slicer4J to fix this or is this a problem/bug in the implementation or one of its libraries (soot?)?

Thanks and have a nice day!

Lms24 avatar Nov 05 '21 19:11 Lms24

It seems like a bug. Can you please attach the fat jar?

khaled-e-a avatar Nov 05 '21 21:11 khaled-e-a

Thanks for the quick response.

This is my original fat jar (packed as zip) cors-filter-1.0.2-SNAPSHOT-fat-tests.zip

And just in case you need it, here's the instrumented version from Slicer4J: cors-filter-1.0.2-SNAPSHOT-fat-tests_i.zip

Lms24 avatar Nov 05 '21 21:11 Lms24

Closing this issue since it predates several major bug fixes and improvements to the tool. Please re-open if you still face this issue. Thank you!

khaled-e-a avatar Dec 30 '24 02:12 khaled-e-a