I was looking for hours now, but I can't find what I'm looking for. I know java.io.File is not supported in the GWT client package. I want to use it inside the server package. When I compile the app i get the following error:
Compiling module com.xxx.yyy.GWTApp
Validating units:
[ERROR] Errors in 'file:/.../workspace/GWTApp/src/com/xxx/yyy/server/Class1.java'
[ERROR] Line 26: No source code is available for type java.io.File; did you forget to inherit a required module?
[ERROR] Errors in 'file:/.../workspace/GWTApp/src/com/xxx/yyy/server/Class2.java'
[ERROR] Line 104: No source code is available for type java.io.BufferedReader; did you forget to inherit a required module?
[ERROR] Line 104: No source code is available for type java.io.FileReader; did you forget to inherit a required module?
...
Any Ideas what could be wrong?
Edit *.gwt.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.5.1//EN"
"http://google-web-toolkit.googlecode.com/svn/tags/2.5.1/distro-source/core/src/gwt-module.dtd">
<module rename-to='yyy'>
<inherits name='com.google.gwt.user.User'/>
<inherits name='com.google.gwt.user.theme.clean.Clean'/>
<entry-point class='com.xxx.yyy.client.Yyy'/>
<source path='client'/>
<source path='shared'/>
<source path='server'/>
<inherits name="com.smartgwt.SmartGwt"/>
</module>
Remove this line from your *.gwt.xml
:
<source path='server'/>
The source tag is used to identify the packages that need to be compiled to javascript. Server packages should not be included.