How to use Apache Tattletale to analyze duplicate Jar/APIs used in class path

1.9k views Asked by At

In my project they have used more than 225+ jar files which causing memory issue, while searching on net i come to know Apache Tattletale will analyze and give a report of duplicate classes and JAR/APIs used by the application (Classpath). So i have refereed following links

1) how to use JBoss Tattletale tool

2) Uncover JBoss client jar list with Tattletale

3) Jboss official Documentation

but i didn't get how to execute and run the Tattletale Jar file and my application is not based on maven so i am not using Maven.

I have downloaded tattletale-1.2.0.Beta2.jar file along with jboss-seam-2.3.0.CR1-dist file and used following command

java -Xmx512m -jar tattletale.jar /Java/workspaces/mycoolprojects/projectX output-projectx

but getting following exception

Exception in thread "main" java.lang.NoClassDefFoundError: javassist/NotFoundException
        at org.jboss.tattletale.analyzers.Analyzer.getScanner(Analyzer.java:49)
        at org.jboss.tattletale.Main.execute(Main.java:608)
        at org.jboss.tattletale.Main.main(Main.java:1099)
Caused by: java.lang.ClassNotFoundException: javassist.NotFoundException
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 3 more

More over i didn't get what is the use of jboss-seam-2.3.0.CR1-dist file. Meaning i can see lot of jar files and lot of code in there but i don't know how does it help to use tattletale.

In the official documentation they have mentioned jboss-tattletale.properties and how can i set/use that.

3

There are 3 answers

0
Diptendu Dutta On

I was having the same problem and this solution worked for me too. (downloaded the latest javaassist jar)

Interestingly, tattletale itself suggests that the tattletale jar contains the javaassist jar

enter image description here

0
user944849 On

I inherited an old Maven project configured to use this plugin and got the same javassist errors. The plugin dependencies may be adjusted as shown to make the errors stop.

<plugin>
    <groupId>org.jboss.tattletale</groupId>
    <artifactId>tattletale-maven</artifactId>
    <version>1.2.0.Beta2</version>
    <executions>
        <execution>
            <goals>
                <goal>report</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <!-- This is the location which will be scanned for generating tattletale reports -->
        <source>${project.build.directory}/${project.artifactId}/WEB-INF/lib</source>
        <!-- This is where the reports will be generated -->
        <destination>${project.build.directory}/site/tattletale</destination>
    </configuration>
    <dependencies>
        <dependency>
            <groupId>org.javassist</groupId>
            <artifactId>javassist</artifactId>
            <version>3.27.0-GA</version>
        </dependency>
    </dependencies>
</plugin>
0
Rajat Srivastava On

The below steps worked for me:

  1. download jboss-javassist-javassist-rel_3_22_0_cr1-2-g6a9079a.zip from http://jboss-javassist.github.io/javassist/
  2. extract it to a location
  3. go to that location and copy javassist.jar
  4. go to location where your tattletale-1.2.0.Beta2.jar is present
  5. paste javassist.jar here
  6. open command prompt at this path
  7. run command java -jar tattletale-1.2.0.Beta2.jar path_to_application_archive output_path