暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

Oracle Jasper报告打印上的 “无听众” 错误

askTom 2017-07-21
516

问题描述

我正在使用在 “oracle 11.0.2 SE 1” 上运行的 “oracle Apex 5.0.3”,使用 “ords 3.0.6” 配置Apex。我已经在 “apache Tomcat 7.0.75” 中配置了 “jasper报告”。

在我的Oracle Apex应用程序中,当我单击 “打印” 按钮时,出现此错误。

    ORA-29273: HTTP request failed ORA-06512: at "SYS.UTL_HTTP",
    line 1130 ORA-12541: TNS:no listener


下面是我的代码,它正在调用哪个按钮点击。

    BEGIN
             -- call the report and pass parameters
            xlib_jasperreports.set_report_url('http://127.0.0.1:8080/JasperReportsIntegration/report');
            xlib_jasperreports.show_report (p_rep_name          => 'PATH/TO/REPORT_NAME',
                                            p_rep_format        => 'pdf',
                                            p_data_source       => 'default',
                                            p_out_filename      => 'Users_info.pdf',
                                            p_rep_locale        => 'en_US'
                                           );
    
            -- stop rendering of the current APEX page
            apex_application.g_unrecoverable_error := true;
    END;


-----------------------
当我尝试使用SQL开发人员使用此查询进行测试时
select httpuritype('http://127.0.0.1:8080/').getclob() from dual;


我得到以下错误
ORA-29273: HTTP request failed
ORA-06512: at "SYS.UTL_HTTP", line 1819
ORA-29261: bad argument
ORA-06512: at "SYS.HTTPURITYPE", line 34
29273. 00000 -  "HTTP request failed"
*Cause:    The UTL_HTTP package failed to execute the HTTP request.
*Action:   Use get_detailed_sqlerrm to check the detailed error message.
          Fix the error and retry the HTTP request

-----------------------
但是如果我尝试测试以下内容,我就是
select httpuritype('www.google.com').getclob() from dual;


我得到了正确的回应
专家解答 
不幸的是,“ORA-12541: TNS: 无监听器” 是那些通用样式错误之一,这基本上意味着我们无法达到http://127.0.0.1:8080,这当然是由许多原因造成的。

例如,我在我的笔记本电脑 (端口8080) 上启动ORDS,我得到:

SQL> select httpuritype('http://127.0.0.1:8080').getclob() from dual;

HTTPURITYPE('HTTP://127.0.0.1:8080').GETCLOB()
----------------------------------------------------------------------------





但是当我关闭ORDS时,我会看到:


SQL> select httpuritype('http://127.0.0.1:8080').getclob() from dual;
ERROR:
ORA-29273: HTTP request failed
ORA-06512: at "SYS.HTTPURITYPE", line 38
ORA-12541: TNS:no listener
ORA-06512: at "SYS.UTL_HTTP", line 380
ORA-06512: at "SYS.UTL_HTTP", line 1127
ORA-06512: at "SYS.HTTPURITYPE", line 23


所以 * 某物 * 要么没有运行,要么被阻止。

尝试netstat -a以确保某些东西正在监听端口8080,然后尝试来自数据库外部的请求 (例如wget),并确保没有防火墙/代理/等阻碍。


「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论