Note that there are some explanatory texts on larger screens.

plurals
  1. POGWT Project doesn't load data from RPC when deployed
    primarykey
    data
    text
    <p>I got a little problem with my GWT project.</p> <p>I have a class A(client) with a List Object L1. When a button in A is clicked files are being read on the serverside and a list is being returned through RPC which is then stored in L1 and then displayed in a table. It all works perfectly fine offline. However if i deploy the app it doesn't seem to work. The strangest thing is: 1 of the files is working and i can display the data of it in the table (the smallest file). If I push an other button though (and thus reading an other file on the serverside) nothing gets displayed on the table. It does seem to read and store it in L1 on A but I'm not quite sure about that. On the log files I get no Errors or Warning so I don't understand why it isn't working. Maybe it isnt running fast enough or something?</p> <p>The only info i get from the logs (only info and not a warning/error): "This request caused a new process to be started for your application, and thus caused your application code to be loaded for the first time. This request may thus take longer and use more CPU than a typical request for your application." It appears randomly when clicking on the buttons (otherwise there is no info at all... just a log that its being pushed) and the latency is really high on the log with the info (3-7k ms) but just fine on the ones without info. The instances it gives me don't exist.</p> <p>This is the class where the Method is called (not the full class):</p> <pre><code>public class DatasetMenu{ private DataImportServiceClientImpl importer; public void historyChangeState(String Abstimmung){ importer.readInput(Abstimmung); } </code></pre> <p>This is the clientside code:</p> <pre><code>public class DataImportServiceClientImpl{ private DataImportServiceAsync service; public DatasetMenu menu; public DataImportServiceClientImpl(String url){ this.service = GWT.create(DataImportService.class); ServiceDefTarget endpoint = (ServiceDefTarget) this.service; endpoint.setServiceEntryPoint(url); this.menu=new DatasetMenu(this); } public void readInput(String Abstimmung){ this.service.readInput(Abstimmung, new DefaultCallback()); } private class DefaultCallback implements AsyncCallback { @Override public void onFailure(Throwable caught) { System.out.println("An Error has occured!"); } @Override public void onSuccess(Object result) { if(result instanceof List&lt;?&gt;){ List&lt;List&lt;Raumeinheit&gt;&gt; temp = (List&lt;List&lt;Raumeinheit&gt;&gt;) result; menu.setData(temp); } } } } </code></pre> <p>This is the code on the server side: </p> <pre><code>public class DataImportServiceImpl extends RemoteServiceServlet implements DataImportService{ @Override public List&lt;List&lt;Raumeinheit&gt;&gt; readInput(String Abstimmung){ List&lt;String&gt; fileList=new ArrayList&lt;String&gt;(); fileList.add("files/" + Abstimmung + ".b.csv"); fileList.add("files/" + Abstimmung + ".k.csv"); System.out.println(fileList.get(0)); List&lt;List &lt;String[]&gt; &gt; total2 = new ArrayList&lt;List &lt;String[]&gt; &gt;(); String[] values; for(int i =0;i&lt;fileList.size();i++){ List&lt;String[]&gt; total = new ArrayList&lt;String[]&gt;(); File file = new File(fileList.get(i)); try{ Scanner inputStream = new Scanner(file); while(inputStream.hasNext()){ String data = inputStream.nextLine(); values = data.split(";"); total.add(values); } inputStream.close(); }catch(FileNotFoundException e){ e.printStackTrace(); } total2.add(total); } List&lt; List&lt;Raumeinheit&gt; &gt; result = new ArrayList&lt;List&lt;Raumeinheit&gt;&gt;(); for(int i = 0;i&lt;total2.size();i++){ List&lt;Raumeinheit&gt; temp = new ArrayList&lt;Raumeinheit&gt;(); for(int j=0;j&lt;total2.get(i).size();j++){ if(i==1){ temp.add(new Raumeinheit(total2.get(i).get(j)[0],Integer.parseInt(total2.get(i).get(j)[1]),Integer.parseInt(total2.get(i).get(j)[2]),Integer.parseInt(total2.get(i).get(j)[3]),Double.parseDouble(total2.get(i).get(j)[4]), Double.parseDouble(total2.get(i).get(j)[5]), Double.parseDouble(total2.get(i).get(j)[6]))); } else{ temp.add(new Raumeinheit(Integer.parseInt(total2.get(i).get(j)[0]),total2.get(i).get(j)[1],Integer.parseInt(total2.get(i).get(j)[2]),Integer.parseInt(total2.get(i).get(j)[3]),Integer.parseInt(total2.get(i).get(j)[4]),Double.parseDouble(total2.get(i).get(j)[5]), Double.parseDouble(total2.get(i).get(j)[6]), Double.parseDouble(total2.get(i).get(j)[7]))); } } result.add(temp); } return result; } } </code></pre> <p>As I said it works perfectly offline so don't worry about the serverside code. Online it only works with 1 file of the 8 we have.</p> <p>The servlets:</p> <pre><code> &lt;servlet&gt; &lt;servlet-name&gt;DataImportServlet&lt;/servlet-name&gt; &lt;servlet-class&gt;com.se.sprint1.server.DataImportServiceImpl&lt;/servlet-class&gt; &lt;/servlet&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;DataImportServlet&lt;/servlet-name&gt; &lt;url-pattern&gt;/sprint1/DataImport&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; </code></pre> <p>Hope you can help me. Thanks in Advance</p> <p>EDIT: Code</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload