TestNG ServiceLoader load method cannot be invoked

35 views
Skip to first unread message

Gergő Nagy

unread,
Jun 28, 2015, 6:12:04 PM6/28/15
to testng...@googlegroups.com
Hi,

I created an IInvokedMethodListener and added it to as service (described on TestNG's doc)

When I run the test in it does not load this listener however with @Listeners annotation it does.

I debug TestNG in eclipse and it turned out that it is not able to load ServiceLoader.load properly. It means that it throws an exception:
RemoteTestNG starting
java.lang.NoSuchMethodException: java.util.ServiceLoader.load()
    at java.lang.Class.getMethod(Class.java:1786)
    at org.testng.TestNG.addServiceLoaderListeners(TestNG.java:916)
    at org.testng.TestNG.initializeConfiguration(TestNG.java:859)
    at org.testng.TestNG.run(TestNG.java:973)
    at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:203)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:174)

java -version
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

TestNG version 6.1.1

Any idea?

Cédric Beust ♔

unread,
Jun 28, 2015, 6:15:24 PM6/28/15
to testng...@googlegroups.com
First of all, can you try with the latest version, e.g. 6.9.4?

-- 
Cédric


--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users...@googlegroups.com.
To post to this group, send email to testng...@googlegroups.com.
Visit this group at http://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages