Hi Baojun,

 

At first glance  the code snippet provided seem to be ok, you can compare 
it to this example on Github 
<https://github.com/greghaskins/googleappengine/blob/master/java/src/main/com/google/appengine/tools/remoteapi/RemoteApiInstaller.java>
 
to troubleshoot it.

 

As I understand the issue you are facing is intermittent so are you sure 
you are not sharing instances of the class RemoteApiInstaller across threads 
<https://cloud.google.com/appengine/docs/standard/java/tools/remoteapi#configuring_remote_api_on_an_app_engine_client>
?

 

Also as your issue seems to be a specific technical issue you would have 
better assistance from the community by posting in StackOverflow 
<https://stackoverflow.com/questions/tagged/google-app-engine> as Google 
Groups is intended for general discussion


On Friday, June 28, 2019 at 5:22:52 AM UTC-4, Baojun Xu wrote:
>
> Hi Please look at the following code snippet:
>
> ****
>       if (ApiProxy.getCurrentEnvironment() == null) {
>         RemoteApiInstaller installer = new RemoteApiInstaller();
>         try {
>           installer.install(remoteApiOptions);
>         } catch (IOException e) {
>           ...
>         }
>       }
> ****
>
>
> What it should do is to install the remoteApiOptions for the current 
> thread if it's not already installed. We check 
> ApiProxy.getCurrentEnvironment() == null to see if the current thread has 
> remote api installed.
>
> However this does not work all the time. Sometimes we still have errors 
> saying the remote api is not installed. Are we doing something wrong here?
>
> Thanks
> Baojun
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/02084ba9-7fec-4bb4-ae53-2bbebe118c8d%40googlegroups.com.
  • [google-ap... Baojun Xu
    • [goog... 'Nicolas (Google Cloud Platform Support)' via Google App Engine

Reply via email to