问题描述:

OK, this error started occuring this morning. I have a Maven project called "snmp-jobs" which was previously used only to convey SNMP communication. Due to changes done lately this project now contains DTO classes as well. Also, there are now two main sub-packages: shared and server where first one contains those DTOs and second server-side code. This projects also has .gwt.xml file which specifies:

<source path="shared"/>

Another project, called "mib" references "snmp-jobs" and uses those DTO classes in client code. To be more exact, problematic class is called MibRow.

When I compile the GWT project it reports the error:

No source code is available for type "rs.jp.jobs.shared.MibRow"; did you forget to inherit a required module?

I understand that this is really common error. As far as I understand, GWT cannot find sources for MibRow class and cannot proceed with GWT compilation. Is this true?

I have tried all by-the-book suggestions but none of them have solved the issue so far. Anyone can give me a hint on what to try next?

Thanks a lot!

UPDATE:

I have run compilation from console with -Dgwt.logLevel=DEBUG and there are two lines that stick out:

Loading inherited module 'rs.jp.jobs.Jobs'

[INFO] Module location: USER_DIR/.m2/repository/rs/jp/jobs/snmp-jobs/1.0.4-SNAPSHOT/snmp-jobs-1.0.4-SNAPSHOT.jar!/rs/jp/jobs/Jobs.gwt.xml

and

Errors in 'rs/jp/mib/client/commands/mib/report/DataResponse.java'

[INFO] Line 10: No source code is available for type rs.jp.jobs.shared.MibRow; did you forget to inherit a required module?

Apparently, GWT managed to find the Jobs module but is unaware of shared package :-/

网友答案:

OK, I have managed to resolve this issue. I was missing the following XML block from pom.xml within snmp-jobs project:

<build>
    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>gwt-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

Hope this will be helpful to someone :)

相关阅读:
Top