Jul 27

Rather then inventing an example to discuss and illustrate the use of the Oracle JCA Adapter let’s build a solutions that uses the Oracle JCA Adapter and shows additional Java CAPS 6 facilities of interest.

Let’s take the example from the “Java CAPS Basics: Implementing Common EAI Patterns Companion CD” book, ISBN: 0-13-713071-6, Chapter 11 “Scalability and Resilience”, Section 11.2 “Exception Handling”, subsection 11.2.1 “Exceptions in Java Collaborations”, “JMS-Triggered Java Collaborations”. The book from which this section comes is available on the Companion CD. Let’s re-work this example using Java CAPS 6 JCA Adapters.

This example illustrates exception handling involving a JMS-triggered JCA Message-Driven Bean.
The MDB is designed to receive a JMS message, update a field in a database table row with the value of the text message, write the text message, together with the timestamp, to a file and finish.

The complete Note is provided in 06JMSTriggeredJCAwithOracle.pdf

Update: Thanks to Dao Tien Tran for pointing out a typo on page 5. I corrected the typo and uploaded the corrected document.  Change is marked in color and with a change bar.

9 Responses to “Java CAPS 6, JCA, Note 6, JMS-Triggered JCA with Oracle and Batch Local File – Exploration of transactionality”

  1. Dave Derry says:

    Having worked with JCAPS5.1.3 for the past 6 months or so, we are in the process of moving to JCAPS6. Your tutorials are the best resource I have found for getting a feel for working with CAPS6. But I’m still having problems. I am trying to create a prototype application to read a DB table and print the results to a file. Following this note I discovered that in order to get the wizard you show in Sec 6 (pg 7) I had to install the Oracle adaptor, and the Oracle OTD wizard modules from the Adapter pack. But when I get to the part on page 15, where I drag the Oracle JCA icon to the receive method, and select the otd that I created (under Source Packages it shows up as otds.oracle/otdTpaConfig.otd) I get a new parameter of type otdTpaConfig.OtdTpaConfigOTD. As you mentioned the variable is named with OTD appended to the name I specified. However, I am getting a compile error that ‘package otdTpaConfig does not exist’. I was also getting the same error on package com.stc.util until I added the OTD library to the ‘Libraries’ branch.

    I can’t figure out what I am missing so that the otdTpaConfig package is visible. Any ideas?

  2. Dave Derry says:

    Well I managed to solve that problem, but it seems like an unnecessary step to me. Inspection of my file system turned up lib\otds\oracle\otdTpaConfig.jar under the project folder for this project. Back in Netbeans I right clicked on the ‘Libraries’ element and added this jar. The problem went away. But since this jar was generated because I defined the OTD in the project I would expect it to automatically be included.

  3. Suchitra says:

    Thanks a lot Michael for all the information that you have provided regarding JCAPS 6 via your blogs.

    We are just trying out some Proof Of Concepts using JCAPS 6.0 and all the material you have posted are very useful.

    I have used the JDBC Otd wizard instead of the Oracle and have managed to create the OTD from the Netbeans EJB Module.

    However there do not be any provisions for modifying the otd e.g:- adding a new prepared statement, or none that i can see. I tried right-clicking on the otd and selected Edit but that only brings up the XML editor and not any wizard.

    Can you please let me know if there is any way to achieve this in the new JCAPS 6.0 non-repository based projects?


  4. Michael Czapski says:

    Hello, Suchitra.

    I am glad my blogs proved useful. Thank you for the good word.
    I am not sure I follow the description of what you did. Could you, please, email me the project to which you are referring? My eMail address is Michael DOT Czapski AT sun DOT com



  5. Manish Jain says:

    Hey Michael,
    While looking for some literature on Oracle OTD wizard, I found this post. The problem I am looking solution for is editing a OTD which was created using Oracle OTD Wizard. In Repository based approach, we can refresh (edit) an oracle OTD to reflect the changes in the corresponding DB tables. I am not seeing similar option in OTDs created using OTD wizard.
    Let me if it is the limitation of wizard.


  6. Michael Czapski says:

    Hello, Manish.

    The method described in the Note is not supported in Java CAPS 6. Please use the method wherein you create an Oracle OTD in the Repository-based project then use the OTDImporter to import it import it for use in your project. When importing you will be given an opportunity to specify whether to refresh on build, refresh on clean or refresh on create. Choosing the correct option, for example refresh on clean, will give you the ability to modify the OTD in the repository-based project then do a "clean" on your EJB Project and have the changes incorporated. As a side-effect you will have a supported method of doing this. The Note is fairly old. I may not be able to update it.



  7. Bill says:

    Where do we find the OTDImporter in Netbeans. I can find a placeholder for the docs http://developers.sun.com/docs/javacaps/designing/dotddbadptr.dsgn_otd-importer_t.html but no real documentation. I found "About CAPS OTD Importer" in the Netbeans Help – but it doesn’t tell me where or how to launch the importer. I found the "Constructs OTD object" in the OTD Palette which tells me to "Please import OTD," but nothing tells me HOW to import the OTD.


  8. Bill says:

    Found it:

    File->New File->CAPS->OTD Importer

  9. Rushi says:

    Hi Michael,

    I am referring this tutorial to implement Service Activator pattern using JCA MDB in netbeans mentioned in Prentice Halls Core J2EE Patterns Best Practices and Design Strategies 2nd Edition, can be found at http://java-patterns.info.
    I am really having a hard time figuring out the implementation in JCA.. Can you suggest me some approach or reference excercise which I can use to implement MDB Service Activator Strategy using JCA MDB in netbeans.


Leave a Reply

preload preload preload