views:

964

answers:

1

I'm struggling to find a simple example that builds and deploys a message driven bean onto Oracle Middleware 11g (i.e., Weblogic). I'm using dependency injection.

It seems there should be a simple Ant task provided by Oracle to simply compile and deploy the MDB.

import javax.jms.MessageListener;

@MessageDriven(messageListenerInterface=MessageListener.class)

public class SimpleMDB implements MessageListener {
    public void onMessage(Message msg) {
        System.out.println("Inside AdapterMDB.onMessage()");
    }
}

Any help would be greatly appreciated!

A: 

WebLogic has indeed several ant tasks. Quoting Introduction to Ant-Driven Development and Testing of Oracle WebLogic Server Apps in Eclipse (you may find the whole article interesting BTW):

WebLogic Server offers several useful ant tasks: wlserver, wldeploy, wlcompile, wlpackage, and wlconfig. wlcompile invokes the javac compiler to compile your application's Java files in a split development directory structure. wlpackage packages your split development directory application as a traditional EAR file that can be deployed to WebLogic Server. These two tasks provide an alternative way of generating the war and ear files generated by the examples presented here. (...)

In your case, I'd package my MDB in a ejb-jar and then in an ear using the traditional jar and ear ant tasks and only use wldeploy (its documentation has some Sample build.xml Files for wldeploy).

Pascal Thivent
Thanks for the answer, Pascal. I apologize for the delayed acceptance.
Chris Reitter