GWT: Failed to load module

gwt

I wanted to organize my folders my own way but it's not working so far.

This is my directory structure

src

  • com.tutorial.client
    • DictionaryModule
  • com.tutorial.module
    • Tutorial.gwt.xml

Tutorial.gwt.xml:

<module rename-to="tutorial">
  <inherits name='com.google.gwt.user.User'/>
  <inherits name='com.google.gwt.user.theme.standard.Standard'/>
  <entry-point class="com.tutorial.client.DictionaryModule"/>
</module>

DictionaryModule

package com.tutorial.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;

public class DictionaryModule implements EntryPoint {
    HorizontalPanel dictionaryPanel;
    Label wordLabel;

    public DictionaryModule(){
        dictionaryPanel = new HorizontalPanel();
        wordLabel = new Label("Word");
    }
    @Override
    public void onModuleLoad() {
        dictionaryPanel.add(wordLabel);
        RootPanel.get("dictionary").add(dictionaryPanel);
    }   
}

but I get this error:

[ERROR] Unable to find type
'com.tutorial.client.DictionaryModule'
[ERROR] Hint: Previous compiler errors
may have made this type unavailable
[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 [ERROR] Failure
to load module 'tutorial'

Best Solution

I know you must have manage to solve this ages ago but for others, here is how I solved this:

I have a gwt project using Hibernate framework and uses Maven2 for build management.

Goto: Project > Properties > Java Build Path > Order and Export . Now make sure that GWT SDK is above Maven and JRE/JDK libraries.

The reason is since there are multiple class files with the same name in multiple libraries, the compiler has no way to decide which one to give priority to, so we must control this by specifying the Ordering.

Related Question