small medium large xlarge

Generic-user-small
21 May 2017, 20:05
Yavor Nikolov (2 posts)

Out of the box the book example fails with Guice 4.0 and 4.1.0 (while it works fine with version 3.0).

     com.google.inject.ProvisionException: Unable to provision, see the following errors:
      
      1) Error injecting constructor, java.lang.RuntimeException: Unable to find a free port
        at support.MyWebDriver.<init>(MyWebDriver.java:11)
        at support.MyWebDriver.class(MyWebDriver.java:11)
        while locating support.MyWebDriver
          for the 1st parameter of support.AtmUserInterface.<init>(AtmUserInterface.java:18)
        at support.AtmUserInterface.class(AtmUserInterface.java:18)
        while locating support.AtmUserInterface
          for the 1st parameter of nicebank.TellerSteps.<init>(TellerSteps.java:17)
        at nicebank.TellerSteps.class(TellerSteps.java:17)
        while locating nicebank.TellerSteps

An explicit dependency reference to recent version of Guava seems to solve that problem:

        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>${guava.version}</version>
        </dependency>
Generic-user-small
01 Jun 2017, 16:59
Seb Rose (21 posts)

Thanks for letting us know, Yavor.

You must be logged in to comment