I’ve learned 3 tricky issue solutions today, of GXT, credit to genius Kevin.
This error is because, when GWT compiling Java source code into javascript, it needs the java code source code. If you in a GWT application, use a class which doesn’t in a GWT application, GXT can’t find the source code of this class. So, you need to refactor this class, move it into a GWT application.
Basically, it means, there should be a ${project_name}.gwt.xml config file in your root source folder of your app.
Running in a hosted mode is fast and easy, but if you find some tricky issue which gives you very little log info, you should switch to server mode, under this mode, it will give you log information.
MarginCallDto extends the class BaseModelData. Basically it doesn't contain any fields, it will ask its base class to do the read/store actions. Also this class must be serialisable. I use a Enum class, which effectively can’t be serialized.
Solution to this is to add a dummyEnumVariable, just to let MarginCallDto know that, it will use this class. So, when GWT compiles this class, it will add the Enum staff.
/**
* This field is never used but it is required so that the GWT
* compiler is aware that this class uses BigDecimal and MarginCallType.
*/
@SuppressWarnings("unused")
private BigDecimal dummyBigDecimal;
@SuppressWarnings("unused")
private MarginCallType dummyMarginCallType;