Discussion:
TestNG ant task throws exception: ava.util.ServiceConfigurationError: org. testng.ITestNGListener: Provider test.serviceloader.TmpSuiteListener not found
Pavel Gouchtchine
2014-07-06 03:00:03 UTC
Permalink
On attempt to run testng tests from ant build file, TestNG throws exception
- see below.
Please help!!

An example project that includes my build.xml and suite file is here:
https://drive.google.com/file/d/0B2Oj5VU5ZPzDQloycTFzX0hVTVk/edit?usp=sharing
(it contains testng 6.8 library i am using)
The command line to execute:

c:\java\verifyanttestng>
c:\java\verifyanttestng>ant -DsuiteName=TestCalculator.xml
Buildfile: c:\java\verifyanttestng\build.xml

init:
[delete] Deleting directory c:\java\verifyanttestng\bin
[mkdir] Created dir: c:\java\verifyanttestng\bin
[delete] Deleting directory c:\java\verifyanttestng\test-output
[mkdir] Created dir: c:\java\verifyanttestng\test-output

compile:
[javac] Compiling 2 source files to c:\java\verifyanttestng\bin

Run_Suite:
[echo] ${browser}
[echo] ./test_suites/TestCalculator.xml
[testng] Exception in thread "main" java.util.ServiceConfigurationError:
org.
testng.ITestNGListener: Provider test.serviceloader.TmpSuiteListener not
found
[testng] at java.util.ServiceLoader.fail(ServiceLoader.java:239)
[testng] at
java.util.ServiceLoader.access$300(ServiceLoader.java:185)
[testng] at
java.util.ServiceLoader$LazyIterator.nextService(ServiceLoade
r.java:372)
[testng] at
java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:
404)
[testng] at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
[testng] at
org.testng.TestNG.addServiceLoaderListeners(TestNG.java:956)
[testng] at
org.testng.TestNG.initializeConfiguration(TestNG.java:891)
[testng] at org.testng.TestNG.run(TestNG.java:1005)
[testng] at org.testng.TestNG.privateMain(TestNG.java:1338)
[testng] at org.testng.TestNG.main(TestNG.java:1307)

BUILD FAILED
c:\java\verifyanttestng\build.xml:43: The tests failed.

Total time: 2 seconds

c:\java\verifyanttestng>
--
You received this message because you are subscribed to the Google Groups "testng-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-dev+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send email to testng-dev-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
Visit this group at http://groups.google.com/group/testng-dev.
For more options, visit https://groups.google.com/d/optout.
Neeraj Lad
2014-10-30 16:11:24 UTC
Permalink
HI ,

Any update on this error ?

following is my ant file

i have replaced "< and >" to "[ and ]"


[project name="TestNGTest" default="run" basedir="."]
[!-- Define [testng] task --]
[taskdef name="testng" classname="org.testng.TestNGAntTask"]
[classpath]
[pathelement location="lib/testng-6.8/testng-6.8.jar"/]
[/classpath]
[/taskdef]
[property name="testdir" location="build" /]
[property name="srcdir" location="src" /]
[property name="libdir" location="lib" /]
[property name="full-compile" value="true" /]
[path id="classpath.base"/]
[path id="classpath.build"]
[fileset dir="${libdir}"]
[include name="**/*.jar" /]
[/fileset]
[pathelement location="${testdir}" /]
[pathelement location="${srcdir}" /]
[path refid="classpath.base" /]
[/path]
[target name="clean" ]
[delete verbose="${full-compile}"]
[fileset dir="${testdir}" includes="**/*.class" /]
[/delete]
[/target]
[target name="compile" depends="clean"]
[javac srcdir="${srcdir}" destdir="${testdir}"
verbose="${full-compile}"]
[classpath refid="classpath.build"/]
[/javac]
[/target]
[target name="run" depends="compile"]
[testng outputdir="${testdir}" classpathref="classpath.build"]
[xmlfileset dir="./suites" includes="AllFlows.xml"/]
[/testng]
[/target]
[/project]

run:
[testng] Exception in thread "main" java.util.ServiceConfigurationError:
org.testng.ITestNGListener: Provider test.serviceloader.TmpSuiteListener
not found
[testng] at java.util.ServiceLoader.fail(Unknown Source)
[testng] at java.util.ServiceLoader.access$300(Unknown Source)
[testng] at java.util.ServiceLoader$LazyIterator.next(Unknown Source)
[testng] at java.util.ServiceLoader$1.next(Unknown Source)
[testng] at
org.testng.TestNG.addServiceLoaderListeners(TestNG.java:961)
[testng] at
org.testng.TestNG.initializeConfiguration(TestNG.java:896)
[testng] at org.testng.TestNG.run(TestNG.java:1031)
[testng] at org.testng.TestNG.privateMain(TestNG.java:1364)
[testng] at org.testng.TestNG.main(TestNG.java:1333)
[testng] The tests failed.

BUILD SUCCESSFUL
Total time: 4 seconds

I tried your sharing build file but got same problem.

Please let me know if any solution you found.

Thanks
Post by Pavel Gouchtchine
On attempt to run testng tests from ant build file, TestNG throws
exception - see below.
Please help!!
https://drive.google.com/file/d/0B2Oj5VU5ZPzDQloycTFzX0hVTVk/edit?usp=sharing
(it contains testng 6.8 library i am using)
c:\java\verifyanttestng>
c:\java\verifyanttestng>ant -DsuiteName=TestCalculator.xml
Buildfile: c:\java\verifyanttestng\build.xml
[delete] Deleting directory c:\java\verifyanttestng\bin
[mkdir] Created dir: c:\java\verifyanttestng\bin
[delete] Deleting directory c:\java\verifyanttestng\test-output
[mkdir] Created dir: c:\java\verifyanttestng\test-output
[javac] Compiling 2 source files to c:\java\verifyanttestng\bin
[echo] ${browser}
[echo] ./test_suites/TestCalculator.xml
[testng] Exception in thread "main"
java.util.ServiceConfigurationError: org.
testng.ITestNGListener: Provider test.serviceloader.TmpSuiteListener not
found
[testng] at java.util.ServiceLoader.fail(ServiceLoader.java:239)
[testng] at
java.util.ServiceLoader.access$300(ServiceLoader.java:185)
[testng] at
java.util.ServiceLoader$LazyIterator.nextService(ServiceLoade
r.java:372)
[testng] at
404)
[testng] at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
[testng] at
org.testng.TestNG.addServiceLoaderListeners(TestNG.java:956)
[testng] at
org.testng.TestNG.initializeConfiguration(TestNG.java:891)
[testng] at org.testng.TestNG.run(TestNG.java:1005)
[testng] at org.testng.TestNG.privateMain(TestNG.java:1338)
[testng] at org.testng.TestNG.main(TestNG.java:1307)
BUILD FAILED
c:\java\verifyanttestng\build.xml:43: The tests failed.
Total time: 2 seconds
c:\java\verifyanttestng>
--
You received this message because you are subscribed to the Google Groups "testng-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-dev+***@googlegroups.com.
To post to this group, send email to testng-***@googlegroups.com.
Visit this group at http://groups.google.com/group/testng-dev.
For more options, visit https://groups.google.com/d/optout.
Scott Babcock
2016-12-14 18:33:43 UTC
Permalink
From the exception, it appears that you've declared a listener
(test.serviceloader.TmpSuiteListener) to be loaded by the ServiceLoader,
but the specified listener class isn't on the class path. Check
out http://testng.org/doc/documentation-main.html#listeners-service-loader
for details.
Post by Pavel Gouchtchine
On attempt to run testng tests from ant build file, TestNG throws
exception - see below.
Please help!!
https://drive.google.com/file/d/0B2Oj5VU5ZPzDQloycTFzX0hVTVk/edit?usp=sharing
(it contains testng 6.8 library i am using)
c:\java\verifyanttestng>
c:\java\verifyanttestng>ant -DsuiteName=TestCalculator.xml
Buildfile: c:\java\verifyanttestng\build.xml
[delete] Deleting directory c:\java\verifyanttestng\bin
[mkdir] Created dir: c:\java\verifyanttestng\bin
[delete] Deleting directory c:\java\verifyanttestng\test-output
[mkdir] Created dir: c:\java\verifyanttestng\test-output
[javac] Compiling 2 source files to c:\java\verifyanttestng\bin
[echo] ${browser}
[echo] ./test_suites/TestCalculator.xml
[testng] Exception in thread "main"
java.util.ServiceConfigurationError: org.
testng.ITestNGListener: Provider test.serviceloader.TmpSuiteListener not
found
[testng] at java.util.ServiceLoader.fail(ServiceLoader.java:239)
[testng] at
java.util.ServiceLoader.access$300(ServiceLoader.java:185)
[testng] at
java.util.ServiceLoader$LazyIterator.nextService(ServiceLoade
r.java:372)
[testng] at
404)
[testng] at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
[testng] at
org.testng.TestNG.addServiceLoaderListeners(TestNG.java:956)
[testng] at
org.testng.TestNG.initializeConfiguration(TestNG.java:891)
[testng] at org.testng.TestNG.run(TestNG.java:1005)
[testng] at org.testng.TestNG.privateMain(TestNG.java:1338)
[testng] at org.testng.TestNG.main(TestNG.java:1307)
BUILD FAILED
c:\java\verifyanttestng\build.xml:43: The tests failed.
Total time: 2 seconds
c:\java\verifyanttestng>
--
You received this message because you are subscribed to the Google Groups "testng-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-dev+***@googlegroups.com.
To post to this group, send email to testng-***@googlegroups.com.
Visit this group at https://groups.google.com/group/testng-dev.
For more options, visit https://groups.google.com/d/optout.
Loading...