Using the Oracle WebLogic Technology Adapters with custom Java – Message Driven Bean (MDB) triggered by File Adapter (part of the story)

Oracle’s product portfolio contains the Technology Adapters. A set of JCA Connectors that provide a bridge between various technologies – such as JMS, AQ, Database (SQL and PL/SQL), FTP and File System – on the one hand and the world of JEE on the other. The SOA Suite 11g and Oracle Service Bus leverage these adapters to connect to and from these technologies. For example: through the adapters, instances of composite applications can be instantiated through the appearance of a file on the file system or a new record in a database table. And, in the outbound direction: OSB and SOA Suite can call out to PL/SQL procedures, send messages to JMS Topics or an AQ queue and write files to an FTP server.

The technology adapters comply with the JEE standard specification of JCA (Java Connector Architecture). They are deployed as a special type of resource – JCA Adapter – on WebLogic Server. And they can be connected to custom Java components – in addition to their better known usage with SOA Suite and Oracle Service Bus.

I have tried to use the File Adapter in an inbound fashion to trigger a Message Driven Bean when a new file is received in a specific directory. This article describes my findings. And I have to warning: the story is not yet complete(ly successful).

JCA Connectors can deliver their inbound messages to message driven beans (MDBs). Starting with the EJB 2.1 specification, MDBs can have a JCA Resource Adapter configured as their source of messages, instead of a JMS Topic or Queue. In addition to a reference to JCA Adapter, the MDB should be accompanied by the configuration of the Activation Configuration for the Resource Adapter. This is the set of property values that determine the behavior of the Adapter on behalf of the Message Driven Bean:


In this example, the FileAdapterClientMDBBean is configured in the ejb-jar.xml file. The activation-config element contains a collection of activation-config-properties. These properties are described in the documentation for the File Adapter ( and they correspond with the bean properties for the class FileActivationSpec that can be found in the RAR file MW_HOME\soa\connectors\FileAdapter.rar that is used to deploy the File Adapter:


The rar file contains the fileAdapter.jar file that contains the FileActivationSpec class:

This class has the following bean properties:


These properties can be set – presumably at least, because I have not been able to try it out successfully or find confirmation anywhere – in the ejb-jar.xml file as shown above – and below.

<?xml version = '1.0' encoding = 'windows-1252'?>
<ejb-jar xmlns:xsi=""
         version="3.0" xmlns="">
                  <description>EJB 3.0 Message Driven Bean (MDB) that acts as client for the File Adapter</description>

The class that implement the Message Driven Bean is referenced in this ejb-jar.xml through the ejb-class property: nl.amis.jca.FileAdapterListener. This class is just a regular MDB – at this point without any useful functionality, just logging of the messages that get received.

package nl.amis.jca;
import java.util.logging.Logger;

import javax.ejb.ActivationConfigProperty;
import javax.ejb.MessageDriven;
import javax.resource.cci.MessageListener;
import javax.resource.cci.Record;

 * EJB 3.0 Message Driven Bean (MDB) that acts as client for the File Adapter JCA Resource
 * Adapter.
 * @author Lucas Jellema (heavily leaning on Ronald van Luttikhuizen)

@MessageDriven(activationConfig = {
  @ActivationConfigProperty(propertyName = "resourceAdapterJndiName", propertyValue = "eis/FileAdapter")
  }, mappedName = "weblogic.wsee.DefaultQueue")
public class FileAdapterListener implements MessageListener {

     * Logger.
    private Logger logger = Logger.getLogger(FileAdapterListener.class.getName());

     * Default constructor.
    public FileAdapterListener() {
        System.out.println("File Adapter Listener started");"[START] FileAdapterListener()");
        // Do nothing"[END] FileAdapterListener()");

     * @see javax.resource.cci.MessageListener#onMessage(javax.resource.cci.Record)
    public Record onMessage(Record record) {
        System.out.println("File Adapter Listener received record!!!");"[START] onMessage()");"\t" + "New record: " + record);
        // JCA record information"\t" + "Record name: " + record.getRecordName());"\t" + "Record short description: " + record.getRecordShortDescription());"[END] onMessage()");

        return record;

Note how the class has annotations that contain the reference to the JCA Resource Adapter that is the source of messages for the MDB:


Instead of using this EJB 3.0 annotation, the application can also use a WebLogic Server specific deployment descriptor file – weblogic-ejb-jar.xml – with the identification of the Message Driven Bean and the descriptor with the resource-adapter-jndi-name property:


<?xml version = '1.0' encoding = 'windows-1252'?>
<weblogic-ejb-jar xmlns:xsi=""

Note: since the thing is not working right now, I cannot be sure that my reference to eis/FileAdapter is the correct one. However, when checking the WebLogic Server Administration Console for the File Adapter deployment, this seems the correct JNDI name:


Note that this same name is used in the JCA configuration files created in SOA Composite applications that make use of the File Adapter.

Deployment Challenges

After I completed the application – MDB and ejb-jar.xml file – I defined an EAR deployment profile and tried to build and deploy it (to WebLogic Server 10.3.4, aka 11g PS3). Unfortunately, deployment failed with the following output:


This message: “The ResourceAdapterJNDIName configuration attributes cannot be mixed with any of the following settings:” does not seem justified, because only the ResourceAdapterJNDIName property is set and none of the other properties mentioned is available in either the MDB itself or any of the associated descriptors. Even the code described by Ronald van Luttikhuizen – apparently successfully tested – does not deploy successfully on my local WLS instance.

I have thusfar not been able to resolve the problem. Googling with the messages in the console resulted in a promising hit:


Unfortunately, Oracle’s Discussion Forums (OTN) are down because of maintenance:


I am stuck for the moment. It feels like I have done what one should do in order to have one’s Message Driven Beans triggered by the File Adapter.

Right now, I will quit and hope for the Forums to come available again or some helpful and knowledgeable reader to post a comments that helps me out. Note: I will complement this article with the solution when I have found one.


Documentation: Fusion Middleware User’s Guide for Technology Adapters
11g Release 1 ( –

Article on OTN by Ronald van Luttikhuizen on the development and deployment of a custom (inbound) JCA Resource Adapter and the creation and deployment of a Java Client to be triggered by the adapter –

The OTN Discussion Forum thread that hopefully provides an answers to my problem:

Develop inbound connectors with JCA 1.5 (Article on JavaWorld, 2005) –

Fusion Middleware Programming Message-Driven Beans for Oracle WebLogic Server 11g Release 1 (10.3.4) -Deployment Elements and Annotations for MDBs


  1. Yun April 19, 2012
  2. Lucas Jellema February 1, 2012
  3. Michel Schildmeijer February 1, 2012