Wednesday, July 30, 2014

Error: Unable to find class *_FieldSerializer

Hello,

I have some problems executing GWT Tests. I need to store an object (called DatabaseConnection) in my test. I have some input fields consisting of a list box, which is filled with all of these objects, which are currently stored in the database. So I have to store the object first, to test the input fields afterwards.

I have serveral tests, which needs to store a DatabaseConnection. If I execute each of these alone, everything works fine. But when I execute all my GWT test, I get the following error messeage, when I try to save the object:

java.lang.RuntimeException: Unable to find class DatabaseConnection_FieldSerializer

It seems to me, that the error comes before the object is actually stored.
My Test looks this:

public void test() {
   
TestHelper.resetDatabaseSync();


   
DatabaseConnection dbConnection = new DatabaseConnection();
   
TestHelper.storeDatabaseConnection(dbConnection, new AsyncCallback<Long>() {
     
@Override
     
public void onFailure(Throwable caught) {
       
// Here the test fails!
       
System.out.println(caught.getMessage());
        fail
();
     
}
     
@Override
     
public void onSuccess(Long id) {
     
}
   
});


   
Timer timer = new Timer() {
     
@Override
     
public void run() {
       
// create a input field and do some validataion


       
TestHelper.resetDatabaseSync();
        finishTest
();
     
}
   
};


   
// Waiting for asynchronous calls to finish.
    timer
.schedule(4000);


    delayTestFinish
(5000);
 
}


My DatabaseConnection implements Serializable and the TestHelper executes methods implemented in a RemoteServiceServlet.

Does anyone know why my test are depending on each other? I am clearing my test database before and after each test.

Thanks for your help!

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment