RE: MDB in orion 1.5.2 using Queue
On Fri, 2001-10-19 at 02:38, Romen Law wrote: I did find two things though: 1. someone posted before saying that in Orion you should not make MDB implement MessageListener, otherwise it will not work. I found that to be false. Cool. Sorry for the false info. I was referring to this previous post: http://www.mail-archive.com/orion-interest%40orionserver.com/msg14877.html Obviously one needs onMessage() to receive the messages...But it compiles and deploys fine without the MessageListener declaration. oh well. cheers, - Renaud -- Renaud Bruyeron [EMAIL PROTECTED] Fullsix London - http://www.fullsix.com/
RE: MDB in orion 1.5.2 using Queue
Hi Romen, did you specify the admin security credentials? its -Djava.naming.security.credentials=admin password If you don't give this, it pops up a textbox asking for the password. Maybe you are tabbing off this before it pops up? Did you enable jms from server.xml by uncommenting the jms-config node? I did not have to do anything to orion-ejb-jar.xml. I configured my ejb-jar.xml as follows: ejb-jar descriptionMessage Driven Bean/description enterprise-beans message-driven ejb-nameMyMDB/ejb-name ejb-classpackage.MyMDB/ejb-class transaction-typeContainer/transaction-type acknowledge-modeauto-acknowledge/acknowledge-mode message-driven-destination destination-typejavax.jms.Queue/destination-type subscription-durabilitydurable/subscription-durability /message-driven-destination resource-ref res-ref-namejms/QueueConnectionFactory/res-ref-name res-typejavax.jms.QueueConnectionFactory/res-type res-authContainer/res-auth /resource-ref resource-env-ref resource-env-ref-namejms/theQueue/resource-env-ref-name resource-env-ref-typejavax.jms.Queue/resource-env-ref-type /resource-env-ref /message-driven Hope that helps, Justin -Original Message- From: Romen Law [mailto:[EMAIL PROTECTED]] Sent: 18 October 2001 01:05 To: Orion-Interest Subject: MDB in orion 1.5.2 using Queue ello, I tested MDB using topic and it worked fine. What I did was to deploy the MDB using the 'jms/theTopic' as the destination-location in orion-ejb-jar.xml. Then I ran the sample jmschat.jar and saw that my MDB got called. But I could not repeat the same using Queue as the destination. I deployed the same MDB using destination-typejavax.jms.Queue/destination-type in ejb-jar.xml and destination-location=jms/theQueue in orion-ejb-jar.xml. Then I ran the coffeemaker.jar sample using the -order flag. My bean did not get called. Did I do something wrong? Has anyone tried using MDB with Queue? Any clues? cheers romen
RE: MDB in orion 1.5.2 using Queue
ello, Thanks for all the replies. I must apologise: my MDB using Queue was working all along. It's just that I was using System.out.println() for logging so I couldn't see it on the console. But after using log4j I could see it. Well, there is first time for everything. I did find two things though: 1. someone posted before saying that in Orion you should not make MDB implement MessageListener, otherwise it will not work. I found that to be false. 2. I still do need to modify the destination-location in orion-ejb-jar.xml. If I don't it still works provided that I only have one Queue or Topic defined in jms.xml. Orion seems to use that one disregarding the queue name you specify in the sender. cheers romen
Re: MDB in orion 1.5.2
Hey mike, No I don't mind at all. I am glad that you guys found it useful. I am just trying to share the love here, you know. thanks, tim - Original Message - From: Mike Cannon-Brookes To: Orion-Interest Sent: Thursday, June 28, 2001 1:59 AM Subject: RE: MDB in orion 1.5.2 Tim, Do you mind if we take this document and put it up on OrionSupport.com ? We'll gladly attribute you / your company as the author. Cheers, Mike Mike Cannon-Brookes - Founder, Core DeveloperOpenSymphony - http://www.opensymphony.com"The Open Source J2EE Component Project" Latest News- Cache in on faster, more reliable JSPshttp://www.javaworld.com/javaworld/jw-05-2001/jw-0504-cache.html -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Tim PouyerSent: Thursday, June 28, 2001 9:53 AMTo: Orion-InterestSubject: Re: MDB in orion 1.5.2 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 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. 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. 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. 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
RE: MDB in orion 1.5.2
Hi, All: Do you guys have any suggestion to integrate 3rd party JMS server (except OpenJMS which desn't suppport MDB) with Orion by using MESSAGE-DRIVEN BEANS? Thanks in advance! Rob -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Mike Cannon-BrookesSent: Wednesday, June 27, 2001 11:00 PMTo: Orion-InterestSubject: RE: MDB in orion 1.5.2 Tim, Do you mind if we take this document and put it up on OrionSupport.com ? We'll gladly attribute you / your company as the author. Cheers, Mike Mike Cannon-Brookes - Founder, Core DeveloperOpenSymphony - http://www.opensymphony.com"The Open Source J2EE Component Project" Latest News- Cache in on faster, more reliable JSPshttp://www.javaworld.com/javaworld/jw-05-2001/jw-0504-cache.html -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Tim PouyerSent: Thursday, June 28, 2001 9:53 AMTo: Orion-InterestSubject: Re: MDB in orion 1.5.2 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 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. 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. 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. 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
RE: MDB in orion 1.5.2
Look at bug 512. Your orion-ejb-jar.xml is being overwritten by orion because of a double-deploy issue with some ejb's. Look at the orion-ejb-jar.xml in the deployment directory, make sure it is the one you put in the ejb.jar. This doesn't seem to be a problem with version 1.5.1 and earlier. There is no workaround except to use an earlier version. Regards, the elephantwalker. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Tim Pouyer Sent: Wednesday, June 27, 2001 11:15 AM To: Orion-Interest 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.
Re: MDB in orion 1.5.2
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 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. 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. 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. 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" descriptionA 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" descriptionA dummy topic/description /topic topic location="jms/IncomingTopic" name="IncomingTopic" descriptionTopic for incoming messages/description /topic !--
RE: MDB in orion 1.5.2
Tim, Do you mind if we take this document and put it up on OrionSupport.com ? We'll gladly attribute you / your company as the author. Cheers, Mike Mike Cannon-Brookes - Founder, Core DeveloperOpenSymphony - http://www.opensymphony.com"The Open Source J2EE Component Project" Latest News- Cache in on faster, more reliable JSPshttp://www.javaworld.com/javaworld/jw-05-2001/jw-0504-cache.html -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Tim PouyerSent: Thursday, June 28, 2001 9:53 AMTo: Orion-InterestSubject: Re: MDB in orion 1.5.2 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 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. 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. 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. 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