Skip to Main Content

Java Programming

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!

Generating PDF via XSLT File

AkitasNov 25 2020 — edited Nov 26 2020

Hello everyone,
I need to generate a PDF(Invoice) via XSLT File. I have a XML file which contains our data. I have to use this xml and customer's xslt file for generate our PDF. Problem is I never do this kind of thing before. Is there any workaround, Basic Tutorial or any helpful document? If there is some it would be really helpful. I made some search and I found Apache FOP(2.5) but I can't use that because there is an error.
Best Regards,
Yunus Emre

Comments

Udo
Hi Tammy,

I found out that there seems to be a bug in the listenerAdmin concerning the proper initialization for the config file. If you start the application and try to run listenerAdmin or listenerConfigure, the Listener seems to default to the tmpdir without regarding any other location.
I can now refine my previous post on what exactly has to be done with the current listener to take a config file from a location different that the default tmpdir:

1. create an apex-config.xml
2. place it into the desired directory
3. start the webapp
4. NOT run listenerAdmin, but /apex right away. Only in that part of the Listener there seems to be the proper initialization for the config file. Once you started in /apex, you'll (hopefully) see in your log that the Listener chose the right config file
5. if needed edit the config via listenerAdmin afterwards.

Note that the listenerAdmin still considers itself as unconfigured, though APEX might already be running successfully if the provided config file has the correct parameters.
As soon as you save that configuration (not necessarily changing anything), the Listener stores the "new" configuration (and probably some state information) and from that point on it will always accept that configuration file. If you call listenerAdmin again afterwards, you'll not be able to change the login credentials any more, which would have been possible in the first run.

Quite weird workaround, but it works for me.

-Udo
589721
This workaround works for me - thank you so much. One note that might save some time for others...if you change the default root from apex (or use a different name than apex.war), the URLs provided in the WLS testing page will not work. Just add "/apex" to the end of these URLs. For example: http://host:port/apex_db1/apex

I hope that the process of deploying multiple listeners will be simplified with future releases. I would like the capability to specify different configuration file names, i.e. apex-config-db1.xml, apex-config-db2.xml and to be able to specify these through the listenerAdmin instead of in the web.xml.
Udo
Hi Tammy,

I'm glad you have it working now!
I think, the ease of use for the configuration file already hits for a single instance. But configuring the applications config-file via the application itself might be a bit difficult. Since the Listener is supposed to support multiple J2EE containers: Where would you store the information for the config-file location if not in the web.xml or another (proprietary) static file in the applications context?

-Udo
Arndt Binninger
Hi Udo,

I followed your steps and were able to bring up Listener with correct config location. But when I try to change the database connection parameters via listenerAdmin the fields were greyed out so I'm not able to change them.

Any idea?

Regards,
Arndt
Igor Kortchnoï
Apparently, when one changes the default apex-config.xml location to another one, listenerAdmin's DB connection section (user, password, host, port & SID/service name) becomes protected, but not other sections.
Udo
Hi Anrdt,

it seems that this is the intended behaviour: database configuration is treated as a once-and-forever item. You can of course change the parameters in the config file itself, but the listenerAdmin is never able to edit that part at runtime. I guess this is due to the fact that once you've configured the connection parameters, you have a living connection pool you'd have to reset. This might cause more trouble as this reset might be seen as an invisible side-effect and may not even be supported without application restart on some platforms.

So, if you intentionally want to reconfigure, change the file (or even delete it) or redeploy using another config location.

-Udo
1 - 6

Post Details

Added on Nov 25 2020
2 comments
351 views