Thanks for your reply Joe. I found a solution, although I'm not sure
why the change I made fixes the problem.
I read Robert Hanson's GWT In Action book and followed the
recommendation in Chapter 11 about using the Facade pattern to
simplify working with RPC. A pared down example from our code base
is:
// ChAOService.java
@RemoteServiceRelativePath("chao")
public interface ChAOService extends RemoteService {
public List<NotesData> getNotes(String projectName, String
entityName, boolean topLevel);
}
// ChAOServiceAsync.java
public interface ChAOServiceAsync {
void getNotes(String projectName, String entityName, boolean
topLevel, AsyncCallback<List<NotesData>> cb);
}
// ChAOServiceManager.java
public class ChAOServiceManager {
private static ChAOServiceAsync proxy;
private static ChAOServiceManager instance;
private ChAOServiceManager() {
proxy = (ChAOServiceAsync) GWT.create(ChAOService.class);
}
public static ChAOServiceManager getInstance() {
if (instance == null) {
instance = new ChAOServiceManager();
}
return instance;
}
public void getNotes(String projectName, String entityName,
boolean topLevel, AsyncCallback<List<NotesData>> cb) {
proxy.getNotes(projectName, entityName, topLevel, cb);
}
}
In my client code, if I separate my calls into two lines like this:
ChAOServiceManager chaoServiceManager = ChAOServiceManager.getInstance
();
chaoServiceManager.getNotes(...);
... my app works. But, if I use one line of Java code like this:
ChAOServiceManager.getInstance().getNotes(...);
... my app fails with the exception I reported yesterday.
Kind of confused by this, but glad my app is working now.
Thanks,
Jennifer
On Sep 9, 8:55 am, Joe Cole <[email protected]> wrote:
> I remember something like this happening once on 1.5.
> From memory (I couldn't find it in our tracker) it was to do with not
> implementing RemoteService or something similar to that like not
> implementing Serializable.
> This may be completely wrong as it was about 1000 tickets ago :) - but
> is worth a shot.
>
> On Sep 9, 12:14 pm, Jennifer Vendetti <[email protected]>
> wrote:
>
>
>
> > Hi,
>
> > I'm developing with GWT (version 1.7.0) and having trouble figuring
> > out the source of a runtime exception. My application compiles, runs,
> > and behaves as expected in hosted mode (on both Windows and Linux).
> > In browser mode (also on Windows and Linux), I get a runtime
> > exception:
>
> > 'com_google_gwt_user_client_rpc_impl_RemoteServiceProxy_s...' is null
> > or not an object
>
> > The generated javascript where the exception occurs is:
>
> > function com_google_gwt_user_client_rpc_impl_RemoteServiceProxy_
> > $createStreamWriter__Lcom_google_gwt_user_client_rpc_impl_RemoteServiceProx
> > y_2
> > (this$static){
> > var clientSerializationStreamWriter;
> > clientSerializationStreamWriter =
> > com_google_gwt_user_client_rpc_impl_ClientSerializationStreamWriter_
> > $ClientSerializationStreamWriter__Lcom_google_gwt_user_client_rpc_impl_Clie
> > ntSerializationStreamWriter_2Lcom_google_gwt_user_client_rpc_impl_Serialize
> > r_2Ljava_lang_String_2Ljava_lang_String_2
> > (new
> > com_google_gwt_user_client_rpc_impl_ClientSerializationStreamWriter(),
> > this
> > $static.com_google_gwt_user_client_rpc_impl_RemoteServiceProxy_serializer,
> > this
> > $static.com_google_gwt_user_client_rpc_impl_RemoteServiceProxy_moduleBaseUR
> > L,
> > this
> > $static.com_google_gwt_user_client_rpc_impl_RemoteServiceProxy_serializatio
> > nPolicyName);
>
> > clientSerializationStreamWriter.com_google_gwt_user_client_rpc_impl_Abstrac
> > tSerializationStreamWriter_objectCount
> > = 0;
> > java_util_AbstractHashMap_$clearImpl__Ljava_util_AbstractHashMap_2
> > (clientSerializationStreamWriter.com_google_gwt_user_client_rpc_impl_Abstra
> > ctSerializationStreamWriter_objectMap);
>
> > clientSerializationStreamWriter.com_google_gwt_user_client_rpc_impl_Abstrac
> > tSerializationStreamWriter_stringMap.clear__
> > ();
> > java_util_ArrayList_$clear__Ljava_util_ArrayList_2
> > (clientSerializationStreamWriter.com_google_gwt_user_client_rpc_impl_Abstra
> > ctSerializationStreamWriter_stringTable);
>
> > clientSerializationStreamWriter.com_google_gwt_user_client_rpc_impl_ClientS
> > erializationStreamWriter_encodeBuffer
> > = java_lang_StringBuffer_$StringBuffer__Ljava_lang_StringBuffer_2(new
> > java_lang_StringBuffer());
>
> > com_google_gwt_user_client_rpc_impl_AbstractSerializationStreamWriter_
> > $writeString__Lcom_google_gwt_user_client_rpc_impl_AbstractSerializationStr
> > eamWriter_2Ljava_lang_String_2
> > (clientSerializationStreamWriter,
> > clientSerializationStreamWriter.com_google_gwt_user_client_rpc_impl_ClientS
> > erializationStreamWriter_moduleBaseURL);
>
> > com_google_gwt_user_client_rpc_impl_AbstractSerializationStreamWriter_
> > $writeString__Lcom_google_gwt_user_client_rpc_impl_AbstractSerializationStr
> > eamWriter_2Ljava_lang_String_2
> > (clientSerializationStreamWriter,
> > clientSerializationStreamWriter.com_google_gwt_user_client_rpc_impl_ClientS
> > erializationStreamWriter_serializationPolicyStrongName);
> > return clientSerializationStreamWriter;
>
> > }
>
> > The browser's script debugger reports that "this$static" is null, but
> > I don't know what could be causing this.
>
> > Can anyone give suggestions here?
>
> > Thank you,
> > Jennifer
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---