I have wanted to use a HashMap that maps a value of type String using a key of type Integer. This is the definition:
HashMap <String, Integer> dict = new HashMap <String,Integer>();
I don’t get any compiling errors. However, when I am debugging I get the error bellow when running that line:
com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract java.lang.String myProject.client.ProjectService.state(java.lang.String) throws java.lang.IllegalArgumentException' threw an unexpected exception: java.lang.NoClassDefFoundError: com/google/gwt/dev/util/collect/HashMap
at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:385)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:588)
at ................
Any help?
Check your import statements. Make sure you are importing “java.util.HashMap”.
(I think you imported “com.google.gwt.dev.util.collect.HashMap” )