Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

JMS over HTTP, HTTP tunneling, imqhttp, Glassfish, Open MQ

947482Jul 4 2012 — edited Jul 5 2012
Hi,

I want to run JMS over HTTP, because of firewalls.

My environment:

- Windows 7 64 bits
- Java EE 6 SDK (Glassfish 3, installer java_ee_sdk-6u4-jdk7-windows-x64.exe)

Following instructions (Oracle GlassFish Server Message Queue Administration Guide, HTTP/HTTPS Support), I have done as follows:

1.- modified default.properties (in my case file D:\usr\Glassfish3\mq\lib\props\broker\default.properties) by adding "httpjms" to imq.service.activelist, so I have:

# List of active services, started at startup
imq.service.activelist=jms,admin,httpjms

2.- modified server.policy file (in my case D:\usr\Glassfish3\glassfish\domains\domain1\config\server.policy) by adding at the end:

grant codeBase "file:${com.sun.aas.installRoot}/glassfish/domains/domain1/applications/imqhttp/-" {

permission java.net.SocketPermission "*",
"connect,accept,resolve";

};

3.- I then, using the Glassfish Admin Console (listening on port 4848), deployed the application packaged in the imqhttp.war WAR file (this WAR file taken from D:\usr\Glassfish3\mq\lib), using "imqhttp" as Context Root name.

4.- I then invoke URL http://127.0.0.1:8080/imqhttp/tunnel and get the following return:

HTTP tunneling servlet ready.
Servlet Start Time : Wed Jul 04 19:28:01 CEST 2012
Accepting TCP connections from brokers on port : 7675
Total available brokers = 1
Broker List :
ANTEC:imqbroker

Importantly: I had to reboot everything, including Windows to get the broker listed in the broker list.

...uh !!???!! ...it just shows that posting to discussion groups and sharing is great... yesterday, I could not get this working, I had nothing in my Broker list, and a bunch of exceptions when trying to publish a message... I swear I re-started Glassfish many times... now it's working all right, and the only thing I've done meantime is to reboot the PC...

In any case, I keep the post, it might be of help to someone.

Later

Varus
This post has been answered by 800561 on Jul 5 2012
Jump to Answer

Comments

InoL

Without displaying the HTML content on the report.
If it is a hidden column, the output is not available for your JavaScript function.

Depending on your database version, you can run the same JavaScript in the database:
https://blogs.oracle.com/java/post/multilingual-engine-executing-javascript-in-oracle%C2%A0database
Maybe you can use html2pdf directly in the database to convert the output of your FUNCTION_RETURNING_HTML.

Another option is open source pdf packages, e.g.:
GitHub - lee-lindley/PdfGen: A PL/SQL PDF report generator providing some of the column, column break and header capabilities of sqlplus reports. Built on as_pdf3 from Anton Scheffer (included). (0 Bytes)Instead of FUNCTION_RETURNING_HTML, create a function FUNCTION_RETURNING_PDF.

Adnan3114

@inol Thanks for the suggestions.
Our live software is running on 11g database and APEX 5.1, but we are migrating it to 19.0c database with APEX 22.1. So we can't actually run the Javascript code from database.
We already have set up the reports as function that returns HTML so it would be really time consuming (which we can't afford at this moment) to convert those to be able to use PL/SQL PDF gen feature.
I am trying to download the hidden div but I am unable to make it work. I even tried to push the div out of displayable regions using CSS but that too was no use.

Adnan3114
Answer

I have managed to find a solution.
Turns out changing Region header type to hidden and setting the WHOLE REPORT on the region header seems to work and downloads the report in PDF.
Here are the steps:
In the APEX page I have created a region (name: reg_1) which has these attributes: Header - Hidden, Style - Remove UI Decoration, Remove Body Padding. This region will only serve for us to download the PDF and nothing else.
Now in the reg_1 region's header, I have added this HTML: <div id="content"></div>
Created a page item :PX_PK_ID.
Then, created a Dynamic action change event for :PX_PK_ID that has 2 true actions. This dynamic action's scope should be set to Dynamic.
Action 1- SQL Statement Set Value: select FNC_RETURN_HTML(:PX_PK_ID) from dual; and for jQuery Selector #content (ID of the header HTML in step-2).
Action 2- Execute Javascript Function that is down_pdf() which will download the elements in #content div using html2pdf.js library after Action 1 is complete.
Finally, create the classic report region: SELECT PRIMARY_KEY, col1, col2, "DOWNLOAD" as DOWNLOAD from TABLE and for the DOWNLOAD column, change its type to link and set the link to URL like this: javascript:$s("PX_PK_ID",#PRIMARY_KEY#);
Voila! It works like a charm!

Marked as Answer by Adnan3114 · Aug 3 2022
1 - 3
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Aug 2 2012
Added on Jul 4 2012
2 comments
2,350 views