gpt4 book ai didi

com.twilio.sdk.AppEngineClientConnection.flush 处的 java.lang.reflect.InvocationTargetException(AppEngineClientConnection.java :204)

转载 作者:塔克拉玛干 更新时间:2023-11-03 05:24:23 27 4
gpt4 key购买 nike

我运行这段代码:

    private void notify(String date, int space) throws IOException {

String ACCOUNT_SID = "dddddd";
String AUTH_TOKEN = "ggggggg";
String TWILIO_PHONE = "+my twilio project";
String ELAD_PHONE = "+my real number";

TwilioRestClient client;
client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

// Build a filter for the CallList
Map<String, String> params = new HashMap<String, String>();
params.put("Url", "http://demo.twilio.com/docs/voice.xml");
params.put("To", ELAD_PHONE);
params.put("From", TWILIO_PHONE);


CallFactory callFactory = client.getAccount().getCallFactory();
Call call;
try {
call = callFactory.create(params);
call.getSid();
} catch (TwilioRestException e) {
String a = e.toString();
// log("******** Failed to call", e);
}

当我运行这一行时:

call = callFactory.create(params);

我得到这个异常:

 java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.twilio.sdk.AppEngineClientConnection.flush(AppEngineClientConnection.java:204)
at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:258)
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:123)
at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:645)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:464)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:754)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:732)
at com.twilio.sdk.TwilioRestClient.request(TwilioRestClient.java:404)
at com.twilio.sdk.TwilioRestClient.safeRequest(TwilioRestClient.java:534)
at com.twilio.sdk.resource.list.CallList.create(CallList.java:68)
at Runner.notify(Runner.java:152)
at Runner.run(Runner.java:40)
at Runner.main(Runner.java:25)
Caused by: com.google.apphosting.api.ApiProxy$CallNotFoundException: The API package 'urlfetch' or call 'Fetch()' was not found.
at com.google.apphosting.api.ApiProxy.makeSyncCall(ApiProxy.java:109)
at com.google.appengine.api.urlfetch.URLFetchServiceImpl.fetch(URLFetchServiceImpl.java:38)
... 18 more
Oct 01, 2016 2:39:43 PM org.apache.http.impl.client.DefaultRequestDirector tryExecute
INFO: I/O exception (java.io.IOException) caught when processing request: Error flushing content in Google App Engine fetch
Oct 01, 2016 2:39:43 PM org.apache.http.impl.client.DefaultRequestDirector tryExecute
INFO: Retrying request
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.twilio.sdk.AppEngineClientConnection.flush(AppEngineClientConnection.java:204)
at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:258)

最佳答案

我得到的回答是:

It looks like you are trying to test from your local dev environment.

With Google App Engine, if you want to test in local dev environment, I think you need to use App Engine SDK for Java. This should work when deployed to Google App Engine. Let me know if this solves this issue!

关于com.twilio.sdk.AppEngineClientConnection.flush 处的 java.lang.reflect.InvocationTargetException(AppEngineClientConnection.java :204),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39806227/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com