views:

17

answers:

2

My ANT script runs without issue on my linux machine and on some xp VMs. When another engineer tries to kick it off locally, TestNG throws [testng] Caused by: java.lang.ClassNotFoundException: com.google.inject.internal.asm.util.TraceClassVisitor not found in (my libraries are all in here)

I've never seen this class before and don't know what is causing this to only happen on his machine. I've tried importing asm-util-3.1.jar but it doesn't find it since it looks in com.google.internal.asm.util and not org.objcetweb.asm.util.

A: 

It does look like an issue related to either Guice or Asm. Are you using TestNG with Maven or the jar file downloaded directly from http://testng.org ?

The Maven version only contains the TestNG classes and lets Maven download all the other dependencies.

The jar file contains all the dependencies, including guice.jar, so this might cause a conflict if you are already using a different version of Guice in your environment.

Cedric Beust
Using the jar file from testng.org, other machines are running this fine. He hasn't used Java in a long time on his machine, don't think he has Guice installed purposefully. Where else could it be coming from on his machine.
dhackner
This class is not part of the Guice that's included in testng-5.12.1.jar, so we have two things to investigate:1) Why it works on your machine (maybe you have another Guice on your classpath that contains this class?)2) Why it doesn't work on your coworker's. I suggest launching the virtual machine with -v and try to figure out what leads to this ClassNotFoundException
Cedric Beust
A: 

Turns out that while he had the proper version of Java installed and pointed to by his environment, deep down within the depths of Java's .conf file there was a reference (JVM_ROOT) to an old 1.5 install. Thanks for the help Cedric!

dhackner