Skip to content

我想在flink环境中使用ForestClient,注解上的@MethodLifeCycle没有正常工作 #251

@Moouna

Description

@Moouna

依赖环境:

Java: 8
Forest: 1.8.0
Backend: okhttp

问题简述:

我使用的时候使用了@MethodLifeCycle 本地java环境测试有效但是flink没生效

如何复现:

private transient Client myClient;

@OverRide
public void open(FunctionContext context) throws Exception {
super.open(context);
this.entInfoHttpClient = Forest.client(Client.class);
}

预期结果:

响应正常

实际结果:

org.apache.flink.util.SerializedThrowable: com.dtflys.forest.exceptions.ForestNetworkException:at com.dtflys.forest.reflection.MethodLifeCycleHandler.handleError(MethodLifeCycleHandler.java:204) ~[forest-core-1.8.0.jar:1.8.0]
at com.dtflys.forest.reflection.MethodLifeCycleHandler.handleSyncWithException(MethodLifeCycleHandler.java:91) ~[forest-core-1.8.0.jar:1.8.0]
at com.dtflys.forest.reflection.MethodLifeCycleHandler.handleSync(MethodLifeCycleHandler.java:62) ~[forest-core-1.8.0.jar:1.8.0]
at com.dtflys.forest.backend.ResponseHandler.handleSync(ResponseHandler.java:39) ~[forest-core-1.8.0.jar:1.8.0]
at com.dtflys.forest.backend.httpclient.response.HttpclientResponseHandler.handleSync(HttpclientResponseHandler.java:29) ~[forest-core-1.8.0.jar:1.8.0]
at com.dtflys.forest.backend.httpclient.request.SyncHttpclientRequestSender.sendRequest(SyncHttpclientRequestSender.java:135) ~[forest-core-1.8.0.jar:1.8.0]
at com.dtflys.forest.backend.httpclient.executor.HttpclientExecutor.execute(HttpclientExecutor.java:119) ~[forest-core-1.8.0.jar:1.8.0]
at com.dtflys.forest.http.ForestRequest.execute(ForestRequest.java:5583) ~[forest-core-1.8.0.jar:1.8.0]
at com.dtflys.forest.reflection.ForestMethod.invoke(ForestMethod.java:1590) ~[forest-core-1.8.0.jar:1.8.0]
at com.dtflys.forest.proxy.InterfaceProxyHandler.invoke(InterfaceProxyHandler.java:238) ~[forest-core-1.8.0.jar:1.8.0]
at com.sun.proxy.$Proxy50.queryForKestrel(Unknown Source) ~[?:?]
at com.zhaopin.kestrel.flink.function.entinfo.EntInfoCustomerQueryFunction.eval(EntInfoCustomerQueryFunction.java:37) ~[kestrel-flink-runtime-0.0.3-SNAPSHOT.jar:?]
at StreamExecCalc$53.processElement_split1(Unknown Source) ~[?:?]
at StreamExecCalc$53.processElement(Unknown Source) ~[?:?]
at org.apache.flink.streaming.runtime.tasks.CopyingChainingOutput.pushToOperator(CopyingChainingOutput.java:75)

截图或视频:

No response

最小可复现代码:

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions