1
votes

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 :-/

1
Is the gwt.xml file located correctly relative to the 'shared' folder? Do you have a <classifier>sources</classifier> dependency in addition to the regular dependency? - wytten
Yes, I have made sure that relative path is correct. But, I don't have that classifier specified. A friend of mine also suggested that I don't have gwt-maven-plugin enabled in my pom.xml so those are two options I need to try. Thanks, I will do that and let you know if it turns out good :) - Jovan Perovic
@wytten I resolved the issue successfully this morning using gwt-maven-plugin. Nevertheless, thank you for the suggestion ;) - Jovan Perovic

1 Answers

1
votes

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 :)