Error "java.lang.NoClassDefFoundError: com/google/inject/internal/Lists" when using rg.testng.LoggingAssert;

2,672 views
Skip to first unread message

Roman Hiden

unread,
Aug 8, 2012, 11:43:33 AM8/8/12
to testng...@googlegroups.com
I am using TestNG eclipse plugin 6.7.0.20120802_0752 version.


When using
import org.testng.LoggingAssert;

I get the following error:
java.lang.NoClassDefFoundError: com/google/inject/internal/Lists

I know that there have been such issues before. I thought this might be new issue

Could you please suggest what can be wrong?

Roman Hiden

unread,
Aug 8, 2012, 11:50:10 AM8/8/12
to testng...@googlegroups.com
I have just reproduce the same issue with testng beta 6.8

Full stack trace
FAILED: test1
java.lang.NoClassDefFoundError: com/google/inject/internal/Lists
    at org.testng.LoggingAssert.<init>(LoggingAssert.java:9)
    at com.tda.automation.SystematicWithdrawals.TestNgTest.test1(TestNgTest.java:32)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
    at org.testng.internal.Invoker.invokeMethod(Invoker.java:715)
    at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:907)
    at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1237)
    at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
    at org.testng.TestRunner.privateRun(TestRunner.java:767)
    at org.testng.TestRunner.run(TestRunner.java:617)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
    at org.testng.SuiteRunner.run(SuiteRunner.java:240)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1197)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1122)
    at org.testng.TestNG.run(TestNG.java:1030)
    at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)

SUBRAMANYESWARA RAO BHAVIRISETTY

unread,
Aug 8, 2012, 11:55:07 AM8/8/12
to testng...@googlegroups.com
Hi Roman,

 Can you please check if you have guice jar installed.

We also faced similar issue and we fixed it by installing guice jar. ( http://code.google.com/p/google-guice/downloads/list )

~Subramanyam

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/testng-users/-/IaGmW3DKpNYJ.

To post to this group, send email to testng...@googlegroups.com.
To unsubscribe from this group, send email to testng-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.



--
Subramanyam

Cédric Beust ♔

unread,
Aug 8, 2012, 12:01:26 PM8/8/12
to testng...@googlegroups.com
Hi Roman,

You're not doing anything wrong, it was a problem with the beta. I just fixed it and also pushed a new Eclipse plug-in, can you update and report back?

Thanks.

-- 
Cédric




On Wed, Aug 8, 2012 at 8:50 AM, Roman Hiden <rome...@gmail.com> wrote:

--
You received this message because you are subscribed to the Google Groups "testng-users" group.

Cédric Beust ♔

unread,
Aug 8, 2012, 12:02:20 PM8/8/12
to testng...@googlegroups.com
Hi Subramanyam,

In this case, it was a problem with TestNG itself, no need to install Guice.

-- 
Cédric

Roman Hiden

unread,
Aug 8, 2012, 12:13:17 PM8/8/12
to testng...@googlegroups.com, ced...@beust.com
Updated eclipse plugin
using this version now C:/Program Files/eclipse/plugins/org.testng.eclipse_6.7.0.20120808_0858/lib/testng-sources.jar



FAILED: test1
java.lang.NoClassDefFoundError: com/google/inject/internal/Lists
    at org.testng.LoggingAssert.<init>(LoggingAssert.java:9)
    at com.tda.automation.SystematicWithdrawals.TestNgTest.test1(TestNgTest.java:37)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
    at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
    at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
    at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)

Cédric Beust ♔

unread,
Aug 8, 2012, 12:20:29 PM8/8/12
to Roman Hiden, testng...@googlegroups.com
I'll look into it tonight, sorry for the trouble.

-- 
Cédric

Roman Hiden

unread,
Aug 8, 2012, 12:27:07 PM8/8/12
to testng...@googlegroups.com, Roman Hiden, ced...@beust.com
np.

Let me know if you need smaller example reproducing this issue

SUBRAMANYESWARA RAO BHAVIRISETTY

unread,
Aug 8, 2012, 12:30:50 PM8/8/12
to testng...@googlegroups.com
Thanks Cedric for the clarification.

~Subramanyam
--
Subramanyam

Cédric Beust ♔

unread,
Aug 8, 2012, 9:21:43 PM8/8/12
to testng...@googlegroups.com
I just tried the current Eclipse plug-in (6.7.0.20120802_0752) and it seems to work for me:

  private LoggingAssert m_a = new LoggingAssert();

  @Test
  public void btest1() {
    System.out.println("B.btest1");
    m_a.assertTrue(false, "boom");
  }

Inline image 1

How are you testing?

-- 
Cédric

Screen shot 2012-08-08 at 6.21.13 PM.png

Roman Hiden

unread,
Aug 9, 2012, 9:06:09 AM8/9/12
to testng...@googlegroups.com, ced...@beust.com
this is how I am using it

public class TestNgTest {

    private String instanceName;
   
    public TestNgTest(String instanceName) {
        this.instanceName = instanceName;


    }

    @Test
    public void test1() {
        System.out.println("test1 says " + this.instanceName);
        this.instanceName = this.instanceName + "test1";
        FlexibleAssert f = new FlexibleAssert();
   
        f.assertEquals(true, true);
       
        LoggingAssert s = new LoggingAssert();
        s.assertEquals(true, true);
       
       
       
    }

    @Test(dependsOnMethods = { "test1" })
    public void test2() {
        System.out.println("test2 says " + this.instanceName);
        this.instanceName = this.instanceName + "test2";
    }

    @Test(dependsOnMethods = { "test2" })
    public void test3() {
        System.out.println("test3 says " + this.instanceName);
    }

    // The factory will get the values using which a test class has to be
    // initialized and then
    // provides testng with instances of them, so that testng can invoke them.
    @Factory(dataProvider = "dataFeeder")
    public static Object[] getInstance(String instanceName) {
        return new Object[] { new TestNgTest(instanceName) };
    }

    // This will read values from an external data source and pass it to the
    // factory.
    @DataProvider(name = "dataFeeder")
    public Object[][] dataFeeder() {
        return new Object[][] { { "Krishnan" }, { "Mahadevan" } };

Cédric Beust ♔

unread,
Aug 9, 2012, 9:56:54 AM8/9/12
to Roman Hiden, testng...@googlegroups.com
If you are using FlexibleAssert, then I think you're using an older version of the plug-in (and of testng.jar). Can you check the version of the TestNG plug-in in the About Eclipse dialog?

-- 
Cédric

Roman Hiden

unread,
Aug 17, 2012, 4:30:51 PM8/17/12
to testng...@googlegroups.com, Roman Hiden, ced...@beust.com
Thanks for help. issue solved
Reply all
Reply to author
Forward
0 new messages