- This topic has 5 replies, 4 voices, and was last updated 18 years, 3 months ago by benzy.
-
AuthorPosts
-
Brice RuthMemberWhen I create an EJB using the message-driven bean template (following the Help guide) and configure my project’s XDoclet properties (selecting all targets, and adding the jBoss target), when my project is deployed to jBoss, I get output like:
16:20:15,377 WARN [JMSContainerInvoker] No message-driven-destination given; using; guessing type
16:20:15,377 WARN [JMSContainerInvoker] Could not determine destination type, defaults to: javax.jms.TopicMy ejb.bean properties for XDoclet are:
* display-name = “MessageWriterBean”
* description = “MessageWriterBean EJB”
* jndi-name = “jms/OutputWriterQueue
* destination-type = “javax.jms.Queue”
* acknowledge-mode = “Auto-acknowledge”But, most of these properties don’t actually seem to appear in any of the files created by XDoclet.
I’m just getting into EJBs and I have a need for message-driven beans at the moment. Any guidance/help would be appreciated!
Brice RuthMemberI’ve tracked down what XML isn’t being generated, by looking at some of the J2EE 1.3 tutorial code .. apparently, the following snippet is required in ejb-jar.xml:
<message-driven-destination>
<destination-type>javax.jms.Queue</destination-type>
</message-driven-destination>This is contained within the <message-driven> node (within <enterprise-beans>)
How do I get XDoclet to pick this up from the destination-type declaration in the ejb.bean property?
nosremaMemberbdruth,
The jndi-name element of @ejb.bean tag is only applicable to remote session and entity beans. If you take that out of the @ejb.bean tag xdoclet will generate the <message-driven-destination>… snippet in ejb-jar.xml. XDoclet must be ignoring the rest of the items after jndi-name since it wasn’t expecting it for MDB. But obviously you would like to declare a jndi name for the MDB. Since you are using jboss you can add a @jboss.destination-jndi-name tag for that.
* @ejb.bean * display-name = "MessageWriterBean" * description = "MessageWriterBean EJB" * destination-type = "javax.jms.Queue" * acknowledge-mode = "Auto-acknowledge" * * @jboss.destination-jndi-name * name = "jms/OutputWriterQueue"
I think that will do what you are wanting, but I’m no expert on MDB’s.
Valentijn Van der HaegenMemberHey,
I’ve been using Message Driven Beans some time now and I’m using XDoclet to generate my stuff. I use Weblogic 8.1 to deploy them to, but it should be quite similar for JBoss…
Have a look at http://xdoclet.sourceforge.net/tags/jboss-tags.html for more information, in particular the
@jboss.destination-jndi-name (0..1) section as described above.Regards,
Les.
Brice RuthMemberExcellent! Thanks for the quick advice, that seems to have done the trick!
benzyMember@nosrema wrote:
bdruth,
The jndi-name element of @ejb.bean tag is only applicable to remote session and entity beans. If you take that out of the @ejb.bean tag xdoclet will generate the <message-driven-destination>… snippet in ejb-jar.xml. XDoclet must be ignoring the rest of the items after jndi-name since it wasn’t expecting it for MDB. But obviously you would like to declare a jndi name for the MDB. Since you are using jboss you can add a @jboss.destination-jndi-name tag for that.
* @ejb.bean * display-name = "MessageWriterBean" * description = "MessageWriterBean EJB" * destination-type = "javax.jms.Queue" * acknowledge-mode = "Auto-acknowledge" * * @jboss.destination-jndi-name * name = "jms/OutputWriterQueue"
I think that will do what you are wanting, but I’m no expert on MDB’s.
This is exactly what I need. Is there any way to do this by way of configuration in MyEclipse?
-
AuthorPosts