title: JSNI : GWT :No source code is available for type java.io.RandomAccessFile
body: <p>I am n00b in GWT.
  I want to use RandomAccessFile to read from file and display on the webpage.</p>
  
  <p>I figured out that RandomAccessFile is not supported in GWT client and to call java functions we have to use JSNI.</p>
  
  <p>I have a JSNI function that calls the function which has RandomAccessFile code.
  When I run the web project I am getting below error but the page is loaded and I am able to see the file content in textbox.</p>
  
  <p><strong>Error : 
  14:58:43.854 [ERROR] [monitoringactivity] Line 14 No source code is available for type java.io.RandomAccessFile; did you forget to inherit a required module?</strong></p>
  
  <p>Can anyone help me to fix this error.</p>
  
  <p>Implementation of this RandomAccessFile code is in a different java file in same package as client. Do I have to add anything in gwt.xml file?</p>
  
  <p>Code:</p>
  
  <pre><code>package com.monitor.client;
  
  import java.io.RandomAccessFile;
  
  public class JsniExample {
  
  static String res;
  
  public  static String testRandomAccessFile()
          {
  
  
          try {
              // Connect 
              RandomAccessFile pWrite = new RandomAccessFile("/tmp/file1", "rw");
              String echoText = "Hello World\n";
              System.out.println("Write \n");
              // write 
              pWrite.write ( echoText.getBytes() );
              pWrite.close();
  
              RandomAccessFile pRead = new RandomAccessFile("/tmp/file2", "rw");
              System.out.println("read\n");
              // read response
              res = pRead.readLine();
              System.out.println("Response: " + res );
              pRead.close();
  
              } catch (Exception e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
              }
          return res;
      }
  
  
  
           public  static native String jsniCode()
           /*-{
                  var res =  @com.monitor.client.JsniExample::testRandomAccessFile()();   
                      return res.toString();
  
          }-*/;
  
      }
  </code></pre>
  
  <p>From onModuleLOad I am calling: res = JsniExample.jsniCode();</p>