Search code examples
seedstack

com.google.inject.ProvisionException: Unable to provision


I have created simple seedstack web project through guideline mentioned on http://seedstack.org/docs/basics/

Undertow is also started with seedstack:run.

However, while accessing "hello" resource undertow throws below exception:

ERROR 2018-07-25 21:37:34,468 XNIO-1 task-2 io.undertow.request
UT005023: Exception handling request to /api/seed-w20/application/configuration

null returned by binding at org.seedstack.w20.internal.W20Module.configure(W20Module.java:51) (via modules: com.google.inject.util.Modules$OverrideModule -> io.nuun.kernel.core.internal.injection.KernelGuiceModuleInternal -> org.seedstack.w20.internal.W20Module) but the 3rd parameter of org.seedstack.w20.internal.FragmentManagerImpl.(FragmentManagerImpl.java:32) is not @Nullable at org.seedstack.w20.internal.W20Module.configure(W20Module.java:51) (via modules: com.google.inject.util.Modules$OverrideModule -> io.nuun.kernel.core.internal.injection.KernelGuiceModuleInternal -> org.seedstack.w20.internal.W20Module) while locating org.seedstack.w20.internal.ConfiguredApplication for the 3rd parameter of org.seedstack.w20.internal.FragmentManagerImpl.(FragmentManagerImpl.java:32) while locating org.seedstack.w20.internal.FragmentManagerImpl while locating org.seedstack.w20.FragmentManager for field at org.seedstack.w20.internal.rest.application.ApplicationConfigurationResource.fragmentManager(ApplicationConfigurationResource.java:38) while locating org.seedstack.w20.internal.rest.application.ApplicationConfigurationResource

Any help please?


Solution

  • This is a bug introduced recently into the w20-bridge, which occurs when no w20.app.json configuration file is present.

    You can workaround it by creating an empty-object w20.app.json file at the root of the classpath:

    {}
    

    You can also update the version of all w20-bridge dependencies to 3.2.4 which has a fix for it. This can be done by using the dependencyManagement section of your POM:

    <dependencyManagement>
            <dependencies>
                <dependency>
                    <groupId>org.seedstack</groupId>
                    <artifactId>seedstack-bom</artifactId>
                    <version>18.4.3</version>
                    <type>pom</type>
                    <scope>import</scope>
                </dependency>
                <dependency>
                    <groupId>org.seedstack.addons.w20</groupId>
                    <artifactId>w20-bridge-web</artifactId>
                    <version>3.2.4</version>
                </dependency>
                <dependency>
                    <groupId>org.seedstack.addons.w20</groupId>
                    <artifactId>w20-bridge-web-bootstrap-3</artifactId>
                    <version>3.2.4</version>
                </dependency>
                <dependency>
                    <groupId>org.seedstack.addons.w20</groupId>
                    <artifactId>w20-bridge-web-business-theme</artifactId>
                    <version>3.2.4</version>
                </dependency>
                <dependency>
                    <groupId>org.seedstack.addons.w20</groupId>
                    <artifactId>w20-bridge-web-components</artifactId>
                    <version>3.2.4</version>
                </dependency>
                <dependency>
                    <groupId>org.seedstack.addons.w20</groupId>
                    <artifactId>w20-bridge-rest</artifactId>
                    <version>3.2.4</version>
                </dependency>
                <dependency>
                    <groupId>org.seedstack.addons.w20</groupId>
                    <artifactId>w20-bridge-specs</artifactId>
                    <version>3.2.4</version>
                </dependency>                                   
            </dependencies>
    </dependencyManagement>
    

    This fix will be included in the upcoming SeedStack 18.7.