Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

maven-2

gwt

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?

like image 427
pbhle Avatar asked Jan 08 '13 13:01

pbhle


2 Answers

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.

like image 161
appbootup Avatar answered Sep 20 '22 02:09

appbootup


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"

like image 29
emery Avatar answered Sep 19 '22 02:09

emery