Publish and Host XML Data Using Tomcat – The Easy Way


Why I missed this easy solution beats me, however, as my team mate Freddy points out in his (e-mail) answer to my comment on his blog about HTTP Filtered Value Sets it is even easier to publish XML data – or any other data – on Tomcat than by creating a web application as described in my last post.

* Update *: See Publishing XML and Other Data With the WAS Liberty Profile for how to do this with the WAS Liberty Profile.

Solution

Basically what you have to do is to publish it in the folder $CATALINA_HOME/webapps/ROOT/. In the context of a Jazz Team Server that is the folder <InstallDir>/server/tomcat/webapps/ROOT/. If you have a file test.xml you want to publish on your Tomcat server you can copy it directly into that folder or into a sub folder structure.

Example

To publish the given file makers.xml from the last post as  https://localhost:9443/PEWEnactmentData/makers.xml, assuming a standard Jazz Tomcat deployment.

  • Create a folder PEWEnactmentData in the folder <InstallDir>/server/tomcat/webapps/ROOT/
  • Copy the file makers.xml into the newly created folder

The File is now accessible as https://localhost:9443/PEWEnactmentData/makers.xml as intended. Replace localhost with your fully qualified hostname in your deployment.

Note: Please make sure that your Folder Name does not conflict with the context root of any web application you have deployed on Tomcat.

Summary

Given this approach it is as easy to use Tomcat to maintain your data for HTTP Filtered value providers as using Apache.

This is also a good example how hard it can be to find information in the Internet. I tried to search for publishing XML on Tomcat with what I learned from Freddy, and I did not find an answer to the question really. All the discussions are around deploying applications.

Advertisements

About rsjazz

Hi, my name is Ralph. I work for IBM and help colleagues and customers with adopting the Jazz technologies.
This entry was posted in Jazz, RTC, RTC Process Customization and tagged , , , , , , . Bookmark the permalink.

4 Responses to Publish and Host XML Data Using Tomcat – The Easy Way

  1. Akshay says:

    Hi Ralph,
    I have deployed the XML file as described above and i can access it in browser with the URL

    http://localhost:8888/example_data/makers.xml

    But when i use this same URL in value set i give me error as “Problems accessing ‘http://localhost:8888/example_data/makers.xml’: Connection to http://localhost:8888 refused”

    Any advice on this please ?

    Thanks
    Akshay

    • rsjazz says:

      I would try http:/localhost:8888/example_data/makers.xml

      I would also consider to have a domain name for the server and not localhost.

      • Akshay says:

        Hi Ralph,

        Thanks for the reply i tried with http:/localhost:8888/example_data/makers.xml as suggested but it gave below error-

        Problems accessing ‘http:/localhost:8888/example_data/makers.xml’: URI does not specify a valid host name: http:/localhost:8888/example_data/makers.xml

        Yes, i tried to map localhost to domain name but for that i need to amend the windows host file for which i do not have access. 😦

      • rsjazz says:

        I can’t tell you what the problem is. If you can access the file using a browser. Check the security settings. You sure the protocol is http and not HTTPS?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s