Talend tRest 组件导致编译问题
Talend tRest component causing compilation problems
我正在尝试在 Talend 中调用一个简单的 REST API。我尝试了 tRestClient 组件,但 运行 遇到了问题 ()。现在我正在尝试使用 tRest 组件,但出现了不同的错误。
计算错误
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
com.sun.jersey cannot be resolved to a type
com.sun.jersey cannot be resolved to a type
com.sun.jersey.client cannot be resolved to a variable
com.sun.jersey cannot be resolved to a type
com.sun.jersey cannot be resolved to a type
com.sun.jersey.api.client.Client cannot be resolved to a type
com.sun.jersey cannot be resolved to a type
com.sun.jersey cannot be resolved to a type
com.sun.jersey cannot be resolved to a type
com.sun.jersey cannot be resolved to a type
我的 Talend 作业只是将 tRest 转换为 tLogRow。 tRest 组件配置了 API 调用 URL、HTTP 方法 GET,并且我添加了 HTTP Headers "Accept" "application/*****.1.0+json",它们是指定的值API。我可以从其他软件在我的 PC 上调用 API,我得到了成功响应。
我已经从 here 安装了最新的 jar 文件,并尝试使用 tLibraryLoad 在 tRest 客户端之前加载这个 jar,但出现了同样的错误。
有什么想法吗?
我相信您没有使用正确版本的 jersey 核心库;这是 tREST
第一次使用时的样子:
它会提示您安装缺少的 jar(不是由 Talend 分发),它们是:
jersey-client-1.4.jar
jersey-core-1.4.jar
此时您只需单击 "Download and install all modules available",它就会为您安装它们。
您不需要使用 tLibraryLoad
组件,只需删除可能存在于以下位置的这些 jar 的所有版本,重新启动您的工作室,您应该会收到重新安装它们的提示(如上图所示):
<Talend root folder>\configuration\.m2\repository\org\talend\libraries
<Talend root folder>\lib\java
问题已通过用同事 PC 上的版本覆盖 jersey-client-1.4-6.0.0.jar 和 jersey-client-1.4-6.0.0.jar 得到解决。
我正在尝试在 Talend 中调用一个简单的 REST API。我尝试了 tRestClient 组件,但 运行 遇到了问题 (
计算错误
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
com.sun.jersey cannot be resolved to a type
com.sun.jersey cannot be resolved to a type
com.sun.jersey.client cannot be resolved to a variable
com.sun.jersey cannot be resolved to a type
com.sun.jersey cannot be resolved to a type
com.sun.jersey.api.client.Client cannot be resolved to a type
com.sun.jersey cannot be resolved to a type
com.sun.jersey cannot be resolved to a type
com.sun.jersey cannot be resolved to a type
com.sun.jersey cannot be resolved to a type
我的 Talend 作业只是将 tRest 转换为 tLogRow。 tRest 组件配置了 API 调用 URL、HTTP 方法 GET,并且我添加了 HTTP Headers "Accept" "application/*****.1.0+json",它们是指定的值API。我可以从其他软件在我的 PC 上调用 API,我得到了成功响应。
我已经从 here 安装了最新的 jar 文件,并尝试使用 tLibraryLoad 在 tRest 客户端之前加载这个 jar,但出现了同样的错误。
有什么想法吗?
我相信您没有使用正确版本的 jersey 核心库;这是 tREST
第一次使用时的样子:
它会提示您安装缺少的 jar(不是由 Talend 分发),它们是:
jersey-client-1.4.jar
jersey-core-1.4.jar
此时您只需单击 "Download and install all modules available",它就会为您安装它们。
您不需要使用 tLibraryLoad
组件,只需删除可能存在于以下位置的这些 jar 的所有版本,重新启动您的工作室,您应该会收到重新安装它们的提示(如上图所示):
<Talend root folder>\configuration\.m2\repository\org\talend\libraries
<Talend root folder>\lib\java
问题已通过用同事 PC 上的版本覆盖 jersey-client-1.4-6.0.0.jar 和 jersey-client-1.4-6.0.0.jar 得到解决。