开发者

Sample EJB 3.0 MDB on Weblogic with Ant script

开发者 https://www.devze.com 2022-12-15 20:58 出处:网络
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.

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!


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).

0

精彩评论

暂无评论...
验证码 换一张
取 消