Oracle APEX 中 UTL_HTTP 包的问题
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4638634/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Problem with UTL_HTTP Package in Oracle APEX
提问by Haniball
I have a problem with APEX. We have two servers. One (with running Oracle APEX) is the university server, which we have only access to the workspace. The other is my Linux Computer at home, which acts as a server (running Tomcat with Jasperreports container). I want to send a UTL_HTTP request from the APEX machine to the Jasperreports machine. There is a button, which triggers a process with following code:
我的 APEX 有问题。我们有两台服务器。一个(运行 Oracle APEX)是大学服务器,我们只能访问工作区。另一个是我家里的 Linux 计算机,它充当服务器(运行带有 Jasperreports 容器的 Tomcat)。我想从 APEX 机器向 Jasperreports 机器发送一个 UTL_HTTP 请求。有一个按钮,它使用以下代码触发一个过程:
begin xlib_jasperreports.set_report_url('http://X.X.X.X:8080/JasperReportsIntegration/report'); xlib_jasperreports.show_report (p_rep_name => :p5_rep_name, p_rep_format => :p5_rep_format, p_data_source => :p5_data_source, p_out_filename => :p5_out_filename, p_rep_locale => :p5_rep_locale, p_rep_encoding => :p5_rep_encoding, p_additional_params => :p5_additional_params); -- stop rendering of the current APEX page apex_application.g_unrecoverable_error := true; end;
After 20 to 30 seconds after I pushed the triggering button I get following errormessage:
按下触发按钮 20 到 30 秒后,我收到以下错误消息:
ORA-29273: HTTP request failed ORA-06512: at "SYS.UTL_HTTP", line 1029 ORA-12535: TNS:operation timed out
ORA-29273:HTTP 请求失败 ORA-06512:在“SYS.UTL_HTTP”,第 1029 行 ORA-12535:TNS:操作超时
I checked the set_report_url function by setting a common url . And it worked. Does anyone have a clue?
我通过设置一个 common url 检查了 set_report_url 函数。它奏效了。有人有线索吗?
Thanks in advance, Haniball
提前致谢,Haniball
采纳答案by Gary Myers
The latter version of Oracle have Network ACL security, so it might be that the schema owner doesn't have privileges to access that particular URL. However I'd expect a security violation for that.
后一版本的 Oracle 具有网络 ACL 安全性,因此架构所有者可能没有访问该特定 URL 的权限。但是,我希望这样做会违反安全规定。
Another alternative is that it is being blocked by a firewall between the database server and your home machine. It is possible (likely) that the database server machine has been set up to only allow a small list of sites to be accessed (or none at all). You may also have a firewall on your home machine that prevents access from machines not on a list of IP addresses/ranges.
另一种选择是它被数据库服务器和您的家用计算机之间的防火墙阻止。有可能(很可能)已将数据库服务器机器设置为仅允许访问一小部分站点(或根本不允许访问)。您的家用机器上也可能有防火墙,以防止来自不在 IP 地址/范围列表中的机器的访问。
Try some basic UTL_HTTP actions against a variety of sites (eg the google.com home page), and see what response you get.
尝试针对各种站点(例如 google.com 主页)执行一些基本的 UTL_HTTP 操作,然后查看您得到的响应。
Missed the obvious UTL_HTTP.set_transfer_timeout. It may be that the job takes a bit too long at the home server.
错过了明显的 UTL_HTTP.set_transfer_timeout。可能是家庭服务器上的作业花费的时间太长。