Check the inheritance chain from module; it may not be inheriting a required module or a module may not be adding its source path entries properly

11,677

Solution 1

Note 1 - When using gwt standard approach your folder structure

    src/main/java/showcase/web/gwt/yourmodule/yourmodule.gwt.xml
    src/main/java/showcase/web/gwt/yourmodule/client 
    src/main/java/showcase/web/gwt/yourmodule/public 

Your pom references 
    <module>showcase.web.gwt.addressbook.AddressBook</module>
    <module>showcase.web.gwt.uploadservice.UploadService</module>

Your .gwt.xml file location
    src/main/java/showcase/web/gwt/addressbook/AddressBook.gwt.xml
    src/main/java/showcase/web/gwt/uploadservice/UploadService.gwt.xml

Note 2 - <lifecycleMappingMetadata> is for your m2e = maven eclipse plugin. For clear example of GWT MAVEN POM example - http://code.google.com/p/google-web-toolkit/source/browse/trunk/samples/validation/pom.xml

Note 3 - Exactly follow the extremely simple example of gwt maven sample project - http://code.google.com/p/google-web-toolkit/source/browse/trunk/samples/validation/

DO NOT CHANGE FOLDER LOCATION. *FOLLOW THE NAMING CONVENTION.* even folder names like public, client are picked by "name" in GWT.

Solution 2

If this error occurs upon loading the entry point, you may need to change the tags in your *.gwt.xml file.

After changing my package structure, I was able to successfully fix the error, "Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly".

  • In your .gwt.xml file, find the source tags near the bottom of the file.
  • revert to an earlier working commit, or open a known working project
  • take note of the pattern that the working source tags follow relative to the package structure of your working project.
  • roll forward to the broken commit
  • modify your source tag(s) to correspond to the current package structure, following the same pattern.


In addition, you should check to make sure you have the appropriate inherits tags in your .gwt.xml file. For example, you will get a similar error if you attempt to use SmartGWT without the tag inherits name="com.smartgwt.SmartGWt"

Share:
11,677
pbhle
Author by

pbhle

Updated on June 13, 2022

Comments

  • pbhle
    pbhle almost 2 years

    I want to create a gwt maven project with multiple gwt modules. some of them are just utility modules means they have no entry point. Basically I have already a gwt project with multiple gwt modules in it and I have converted it to maven but while compilation its giving me following exception :

    [ERROR] Unable to find type 'in.appops.showcase.web.gwt.uploadservice.client.UploadService' [INFO] [ERROR] Hint: Previous compiler errors may have made this type unavailable [INFO] [ERROR] Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly

    My project has core and dispath modules which are utility modules without entry point and other uploadservice module which has entry point which is inheriting the core module .

    So I put core.gwt.xml ,dispatch.get.xml in their packages i.e in src/main/java itself and uploadservice.gwt.xml in resources folder of maven. also in pom.xml I am providing the modules to compile:

    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.codehaus.mojo</groupId>
                                        <artifactId>gwt-maven-plugin</artifactId>
                                        <version>2.4.0</version>
                                        <goals>
                                            <goal>clean</goal>
                                            <goal>resources</goal>
                                            <goal>compile</goal>
                                            <goal>i18n</goal>
                                            <goal>generateAsync</goal>
                                        </goals>
                                        <configuration>
                                            <runTarget>Index.html</runTarget>
                                            <hostedWebapp>${webappDirectory}</hostedWebapp>
                                             <modules>
                                                <!-- <module>platform.bindings.web.gwt.dispatch.Dispatch</module>
                                                 <module>platform.core.Core</module>   -->
                                                <module>showcase.web.gwt.addressbook.AddressBook</module>
                                                <module>showcase.web.gwt.uploadservice.UploadService</module>
                                            </modules> 
                                        </configuration>
                                    </pluginExecutionFilter>
                                    <action>
                                        <execute />
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
    

    can anybody help me to get out of this exception. Is it neccessary that I need to provide the order to compile the modules or anything else?

  • pbhle
    pbhle over 11 years
    but is it neccessary that all the gwt.xml needs to be in resources folder or as you have mentioned in java folder.I am getting little confused. And if while creating gwt-maven project there i want to specify 4 gwt modules like we add param module and value gwtmodule name. then what wil be the steps?
  • appbootup
    appbootup over 11 years
    I prefer google teams way of pushing .gwt.xml into java folder. Even small changes in that mean extra effort for maintaining it, documenting and making others understand it. If your code has clear package modularity you should opt for splitting the project into several maven "sub-modules"
  • pbhle
    pbhle over 11 years
    if I use your approch my project is running but folder structure needs to be mentained instead we can directly use it in java folder. Thanks for your help.
  • pbhle
    pbhle about 11 years
    You can put .gwt.xml files in java folder but other .properies or .xml files needs to be in their respective src/main/resources folder because when we package it, it may give you problem because bydefault it will not include these resources in war,ear file. o.w need to specify it in pom.xml