facebook

Using XDoclet with MDBs -JBoss [Closed]?

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #204935 Reply

    Brice Ruth
    Member

    When 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.Topic

    My 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!

    #204937 Reply

    Brice Ruth
    Member

    I’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?

    #204946 Reply

    nosrema
    Member

    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.

    #204947 Reply

    Hey,

    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.

    #204953 Reply

    Brice Ruth
    Member

    Excellent! Thanks for the quick advice, that seems to have done the trick!

    #256834 Reply

    benzy
    Member

    @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?

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: Using XDoclet with MDBs -JBoss [Closed]?

You must be logged in to post in the forum log in