I got this compilation error during my GWT Compilation. I am using this to parse an XML document.
[ERROR] Line 24: No source code is available for type org.w3c.dom.Node; did you forget to inherit a required module?
[ERROR] Line 28: No source code is available for type org.w3c.dom.NodeList; did you forget to inherit a required module?
[ERROR] Aborting compile due to errors in some input files
From whatever research i did regarding this it says the classpath might be missing, but since this will be included by default in gwt-user.jar and JRE7, and i have not included any external jars also, so no case of duplicates ! And you cannot have these type of codes in Client side code since it will be converted to javascript
I have a class which makes use of this Node in my shared folder (GWT Model View Presenter Project structure ), which is basically a model !
- Is moving the code to server side is the only possible solution?
-
If 1 is true, how would i be able to refactor my client side presenters accessing this model without the over head of RPC call everytime ?
-
Are there any alternate approaches to this ?
My GWT config file.
<module rename-to='xxxxx'>
<inherits name='com.google.gwt.user.User'/>
<inherits name='com.google.gwt.user.theme.standard.Standard'/>
<inherits name="com.google.gwt.xml.XML" />
<entry-point class='com.xxxx.xxxxx.gwt.client.ProjectEntry'/>
<source path='client'/>
<source path='shared'/>
</module>
Edit : I have included the xml inherits now ! Its working
somewhere in your code base you are using org.w3c.dom.Node and org.w3c.dom.NodeList these are not white listed. In other words you can not use these classes! see;
https://developers.google.com/web-toolkit/doc/latest/RefJreEmulation
you should use these packages for xml;