Skip to content

Guice configuration error #19

@Hapi

Description

@Hapi

Environment

  • Mac OSX 10.6.4
  • Java version: 1.6.0_20
  • Apache Maven 2.2.0 (r788681; 2009-06-26 16:04:01+0300)
  • Eclipse Helios: Build id: 20100917-0705
  • TestNG 5.14.2
  • TesNG Eclipse plugin 5.14.2.9
  • pom.xml (see below)

Issue

Even the simplest project cannot be run because of the Guice configuration error. The same is true no matter are tests run from Eclipse or from command line using Maven. The test class contains a single static method is tested with a single test method (i.e. the simplest possible test configuration).

The latest working version of TestNG on my env is 5.11.

pom.xml

4.0.0 com.hapiware.test testng-tester 1.0-SNAPSHOT
<build>
    <finalName>testng-tester</finalName>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.5</source>
                <target>1.5</target>
            </configuration>
        </plugin>
        <plugin>
            <inherited>true</inherited>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <executions>
                <execution>
                    <id>attach-sources</id>
                    <goals>
                        <goal>jar</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <configuration>
                <archive>
                    <manifest>
                        <mainClass>com.hapiware.test.tester</mainClass>
                    </manifest>
                    <manifestEntries>
                        <Implementation-Title>${build.finalName}</Implementation-Title> 
                        <Implementation-Version>${project.version}</Implementation-Version>
                        <Implementation-Vendor>http://www.hapiware.com</Implementation-Vendor>
                    </manifestEntries>
                </archive>
            </configuration>
        </plugin>
    </plugins>
</build>

<dependencies>
    <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>[5.0,)</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>[4.0,)</version>
        <scope>test</scope>
    </dependency>
</dependencies>

<reporting>
    <outputDirectory>target/site</outputDirectory>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-project-info-reports-plugin</artifactId>
        </plugin>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>jxr-maven-plugin</artifactId>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-pmd-plugin</artifactId>
            <configuration>
                <targetJdk>1.5</targetJdk>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <configuration>
              <maxmemory>1024m</maxmemory>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-report-plugin</artifactId>
        </plugin>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>cobertura-maven-plugin</artifactId>
        </plugin>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>findbugs-maven-plugin</artifactId>
            <configuration>
                <threshold>Normal</threshold>
            </configuration>
        </plugin>
    </plugins>
</reporting>
## Stack trace
Setting connection parameters:127.0.0.1:59020
com.google.inject.CreationException: Guice configuration errors:

1) Error at org.testng.internal.Configuration.m_configurable(Configuration.java:54):
 Binding to org.testng.IConfigurable not found. No bindings to that type were found.

2) Error at org.testng.internal.Configuration.m_hookable(Configuration.java:44):
 Binding to org.testng.IHookable not found. No bindings to that type were found.

3) Error at org.testng.internal.Configuration.m_objectFactory(Configuration.java:10):
 Binding to org.testng.IObjectFactory not found. No bindings to that type were found.

4) Error at org.testng.internal.annotations.JDK15AnnotationFinder.m_transformer(JDK15AnnotationFinder.java:51):
 Binding to org.testng.IAnnotationTransformer not found. No bindings to that type were found.

4 error[s]
    at com.google.inject.BinderImpl.createInjector(BinderImpl.java:277)
    at com.google.inject.Guice.createInjector(Guice.java:79)
    at com.google.inject.Guice.createInjector(Guice.java:53)
    at com.google.inject.Guice.createInjector(Guice.java:43)
    at org.testng.TestNG.initializeInjector(TestNG.java:791)
    at org.testng.TestNG.createSuiteRunner(TestNG.java:1044)
    at org.testng.TestNG.createSuiteRunners(TestNG.java:1031)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:877)
    at org.testng.TestNG.run(TestNG.java:818)
    at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:89)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:144)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions