ok,
    finaly got my mdb working, it took me ten minutes to write and a whole day to deploy.  You gotta love j2ee.  So here is my little tidbit of knowledge for all of you that are currently feeling what was my frustration about an hour ago. 
 
Steps to deploy message driven been in orion1.5.2
  1. in your code for your mdb make sure that your class only implements MessageDrivenBean and does not implement MessageListener. This was a tough one to figure out but you have to remember that these guys built this container before the ejb2.0 spec was final.  I still don't think that it is completely finialized.
  2. Now compile your code into a ejb-jar making sure to use the ejb.jar file from you orion directory and not the j2sdkee1.3 j2ee.jar file.  Your ejb-jar.xml file should look like the xml snipit at the bottom of this posting.
  3. After you have deployed your mdb in orion browse to the application-deployments directory and choose the folder with the name of your application.  Then browse to the folder with the name of your mdb bean.  Open the orion-ejb-jar.xml file in that directory.  most of the node orion has already generated for you but you will have to make some modifications in order to tell orion what connection factory to use and what topic or queue for it to look at.  You will need to add a cache-timeout, connection-factory-location, destination-location, max-instances, min-instances, and name attributes to the message-driven-deployment node.  I am not sure if order is important here or not but to be on the safe side and avoid a lot of agrivation I would follow the above order since it is the order given on the orion site. I have provided an example of my orion-ejb-jar.xml file at the bottom of this post.
  4. Finaly make sure that you have added the topicConnectionFactory's that you specify in your deployment descriptors to the jms.xml file located  in the config directory of orion.  the names sould be exact, that means that they are case sensitive so watch out for that mistake.  And be sure to uncomment the jms-config node located in the sever.xml file in your orion config directory.  I have also included my jms.xml file at the bottom of this post.
I hope that this will clear some things up for some of you.  Hopefully those of you getting ready to try this for the first time will make good use of this knowledge and not spend all day just trying to get the mdb's to work.
 
As a quick test I would recomend modifing the jmschat example to connect to the topic your mdb is listening to using the connection factory you have created.  And put a System.out.println("This is my onMessage() method"); tag into your onMessage(Message msg) method in your mdb then when you use the modified jmschat example to send a message you should see this output on your screen then you will know that your mdb is working properly.
 
 
// ========================================================= //
// This is my jms.xml file                                                                                  //
// ========================================================= //
 

<jms-server host="10.1.100.3" port="9127">

<!-- ================================================================= -->

<!-- Topic Connection Factory bindings, these will be used to obtain -->

<!-- JNDI names for administered objects -->

<!-- Quick note use an ip address for the topic-connection-factory host attribute when possible -->

<!-- if you will be using a remote client to connect to your orion jms server it will need to be set to -->

<!-- whatever your server's ip address is and not to 'localhost' or '127.0.0.1'  otherwize it will not-->

<!-- allow you to connect -->

<!-- ================================================================= -->

<topic-connection-factory host="xxx.xxx.xxx.xxx" location="jms/PrimaryTCF"

password="exim00" port="9127" username="admin" />

<!-- ================================================================= -->

<!-- Queue bindings, these queues will be bound to their respective -->

<!-- JNDI path for later retrieval -->

<!-- ================================================================= -->

<queue name="Demo Queue" location="jms/demoQueue">

<description>A dummy queue</description>

</queue>

<!-- ================================================================= -->

<!-- Topic bindings, these topic will be bound to their respective -->

<!-- JNDI path for later retrieval -->

<!-- ================================================================= -->

<topic name="Demo Topic" location="jms/demoTopic">

<description>A dummy topic</description>

</topic>

<topic location="jms/IncomingTopic" name="IncomingTopic" >

<description>Topic for incoming messages</description>

</topic>

<!-- ================================================================= -->

<!-- path to the log-file where JMS-events/errors are stored -->

<!-- ================================================================= -->

<log>

<file path="../log/jms.log" />

</log>

</jms-server>

 
// ========================================================= //
// This is an excert from my orion-ejb-jar.xml file                                                 //
// ========================================================= //
 

<orion-ejb-jar deployment-version="1.5.2" deployment-time="e75c25427e">

<enterprise-beans>

<message-driven-deployment

            cache-timeout="never" connection-factory-location="jms/PrimaryTCF"

            destination-location="jms/IncomingTopic"

            max-instances="50"

            min-instances="5"

            name="com.eximtechnologies.xmd.message.reciept.ejb.MessageReciept"

/>

</enterprise-beans>

<assembly-descriptor>

         <security-role-mapping name="users">

         </security-role-mapping>

         <default-method-access>

                  <security-role-mapping name="&lt;default-ejb-caller-role&gt;" impliesAll="true" />

         </default-method-access>

</assembly-descriptor>

</orion-ejb-jar>

// ========================================================= //
// This is an excert from my ejb-jar.xml file                                                         //
// ========================================================= //
               

<enterprise-beans>

<message-driven>

<description>My message driven bean</description>

<ejb-name>this is just my name</ejb-name>

<ejb-class>com.eximtechnologies.xmd.message.reciept.ejb.MessageReciept</ejb-class>

<transaction-type>Container</transaction-type>

<message-driven-destination>

<destination-type>javax.jms.Topic</destination-type>

</message-driven-destination>

</message-driven>

</enterprise-beans>

 

----- Original Message -----
From: Tim Pouyer
Sent: Wednesday, June 27, 2001 2:15 PM
Subject: MDB in orion 1.5.2

hey all,
        I have been trying to get mdb to work in orion1.5.2 I have sucessfully created and deployed my bean and have set up the orion specific orion-ejb-jar.xml file to look at my 'jms/IncomingTopic'  topic and 'jms/PrimaryTCF' topicConnectionFactory from my jms.xml file.  I put a couple of system.out.prinln() tags in my mdb to see when orion calls the setMessageDrivenContext and ejbCreate and it calls them sucessfully 5 times which is the value from my min-instances tag in the orion-ejb-jar.xml file so I know that it is reading it correctly.  But when I set up an applicationClient to use orion's jms broker and publish to that same IncomingTopic my mdb does not output the system.out.println() tag that I placed in the onMessage() method.  I have set up some test application clients to try to use those topicConnectionFactories and Topics and they work fine so I do not know what is wrong.  If someone has ever set up an used a mdb in orion sucessfully could you please post your ejb-jar.xml, orion-ejb-jar.xml, and your jms.xml files so that I can figure out what I am doing wrong. 
 
thanks.
 

Reply via email to