You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Olivier Voutat <ol...@gmail.com> on 2006/03/26 18:44:08 UTC

Message-Driven-Bean (JBoss to Geronimo)

Hi everybody,

Neubie, bothering u all again. Situation: I have a Message-Driven-Bean model
for JBoss that I would like to transform to the Geronimo way. These are my
xml's:

<ejb-jar>
    <enterprise-beans>
    <message-driven>
        <ejb-name>Log</ejb-name>
        <ejb-class>examples.LogBean</ejb-class>
        <transaction-type>Container</transaction-type>
        <message-driven-destination>
            <destination-type>javax.jms.Topic</destination-type>
        </message-driven-destination>
    </message-driven>
    </enterprise-beans>
 </ejb-jar>

<jboss>
    <enterprise-beans>
        <message-driven>
            <ejb-name>Log</ejb-name>

<destination-jndi-name>topic/testTopic</destination-jndi-name>
        </message-driven>
    </enterprise-beans>
</jboss>

Could you please give me how they should be adapted to the Geronimo way (
ejb-jar.xml and openejb-jar.xml) ? Looked some articles but I'm quite
confused by them.

Thanks a lot,

--
Olivier Voutat
Rua Praia de Muriú, 9188
Cep 59092-390 / Natal - RN
Tel: (84) 3219-0427 Cel: (84) 9977-3917

Re: Message-Driven-Bean (JBoss to Geronimo)

Posted by Olivier Voutat <ol...@gmail.com>.
Thank you very much for your answers Aaron and Hernan.

I think I'm in the right road to get it running but I have some extras
questions. You see, I'm using eclipse with wtp and the geronimo plugin and
when I create a message driven bean with it, I get a base ejb-jar.xml and a
naked openejb-jar.xml.

First, I'm trying to do a Topic Message Driven Bean. (Sounds stupid but I
didn't really get which is the difference). Second, when I create it, I get
in the ejb-jar.xml this model:

<message-driven id="MessageDriven_1">
         <description><![CDATA[<!-- begin-xdoclet-definition
-->]]></description>

         <ejb-name>Log</ejb-name>

         <ejb-class>br.cefetrn.LogMdb</ejb-class>

         <messaging-type>javax.jms.MessageListener</messaging-type>
         <transaction-type>Container</transaction-type>
         <message-destination-type>javax.jms.Topic
</message-destination-type>
         <activation-config>
           <activation-config-property>

<activation-config-property-name>destinationType</activation-config-property-name>
             <activation-config-property-value>javax.jms.Topic
</activation-config-property-value>
           </activation-config-property>
           <activation-config-property>

<activation-config-property-name>acknowledgeMode</activation-config-property-name>

<activation-config-property-value>Auto-acknowledge</activation-config-property-value>
           </activation-config-property>
           <activation-config-property>

<activation-config-property-name>subscriptionDurability</activation-config-property-name>

<activation-config-property-value>NonDurable</activation-config-property-value>
           </activation-config-property>
         </activation-config>

      </message-driven>

So, as you can see, I don't have a destination, only a destinationType.

And beeing aware that I can be considered as a big fool, what is this
ResourceAdapterName ? The only thing that I have in my config related to JMS
is the DefaultActiveMQConnectionFactory (on my JMS service)
ActiveMQ (on my JMS Server Manager)

Sorry to all who really think that those are silly questions, but I'm really
a big noobie... :)

Best Regards,
Olivier Voutat




On 3/27/06, Aaron Mulder <am...@alumni.princeton.edu> wrote:
>
> Here's an example using J2EE 1.4 syntax:
>
> excerpt from ejb-jar.xml
> ---------------
> <enterprise-beans>
>   <message-driven>
>     <ejb-name>MyMDB</ejb-name>
>     <ejb-class>....MessageDrivenBean</ejb-class>
>     <transaction-type>Container</transaction-type>
>     <message-destination-type>javax.jms.Queue</message-destination-type>
>     <message-destination-link>QueueName</message-destination-link>
>   </message-driven>
> </enterprise-beans>
> <assembly-descriptor>
>   <message-destination>
>     <message-destination-name>QueueName</message-destination-name>
>   </message-destination>
> </assembly-descriptor>
>
> excerpt from openejb-jar.xml
> -----------------------
> <enterprise-beans>
>   <message-driven>
>     <ejb-name>OrderProcessor</ejb-name>
>     <naming:resource-adapter>
>       <naming:resource-link>ResourceAdapterName</naming:resource-link>
>     </naming:resource-adapter>
>     <activation-config>
>       <activation-config-property>
>
>         <activation-config-property-name>destination</activation-config-property-name>
>
>         <activation-config-property-value>QueueName</activation-config-property-value>
>       </activation-config-property>
>       <activation-config-property>
>
>         <activation-config-property-name>destinationType</activation-config-property-name>
>         <activation-config-property-value>javax.jms.Queue
> </activation-config-property-value>
>       </activation-config-property>
>     </activation-config>
>   </message-driven>
> </enterprise-beans>
>
> The ResourceAdapterName in that snippet should point to the
> resourceadapter-name used when the JMS resources were deployed.  The
> destinationType and destination have to be specified in openejb-jar
> even if, as here, they're already specified in ejb-jar.xml.
>
> Thanks,
>      Aaron
>
> On 3/26/06, Olivier Voutat <ol...@gmail.com> wrote:
> > Hi everybody,
> >
> > Neubie, bothering u all again. Situation: I have a Message-Driven-Bean
> model
> > for JBoss that I would like to transform to the Geronimo way. These are
> my
> > xml's:
> >
> > <ejb-jar>
> >     <enterprise-beans>
> >     <message-driven>
> >         <ejb-name>Log</ejb-name>
> >         <ejb-class>examples.LogBean</ejb-class>
> >         <transaction-type>Container</transaction-type>
> >         <message-driven-destination>
> >             <destination-type>javax.jms.Topic</destination-type>
> >         </message-driven-destination>
> >     </message-driven>
> >     </enterprise-beans>
> >  </ejb-jar>
> >
> > <jboss>
> >     <enterprise-beans>
> >         <message-driven>
> >             <ejb-name>Log</ejb-name>
> >
> > <destination-jndi-name>topic/testTopic</destination-jndi-name>
> >         </message-driven>
> >     </enterprise-beans>
> > </jboss>
> >
> > Could you please give me how they should be adapted to the Geronimo way
> > (ejb-jar.xml and openejb-jar.xml) ? Looked some articles but I'm quite
> > confused by them.
> >
> > Thanks a lot,
> >
> > --
> > Olivier Voutat
> > Rua Praia de Muriú, 9188
> > Cep 59092-390 / Natal - RN
> > Tel: (84) 3219-0427 Cel: (84) 9977-3917
>



--
Olivier & Cidiane Voutat
Rua Praia de Muriú, 9188
Cep 59092-390 / Natal - RN
Tel: (84) 3219-0427 Cel: (84) 9977-3917

Re: Message-Driven-Bean (JBoss to Geronimo)

Posted by Aaron Mulder <am...@alumni.princeton.edu>.
Here's an example using J2EE 1.4 syntax:

excerpt from ejb-jar.xml
---------------
<enterprise-beans>
  <message-driven>
    <ejb-name>MyMDB</ejb-name>
    <ejb-class>....MessageDrivenBean</ejb-class>
    <transaction-type>Container</transaction-type>
    <message-destination-type>javax.jms.Queue</message-destination-type>
    <message-destination-link>QueueName</message-destination-link>
  </message-driven>
</enterprise-beans>
<assembly-descriptor>
  <message-destination>
    <message-destination-name>QueueName</message-destination-name>
  </message-destination>
</assembly-descriptor>

excerpt from openejb-jar.xml
-----------------------
<enterprise-beans>
  <message-driven>
    <ejb-name>OrderProcessor</ejb-name>
    <naming:resource-adapter>
      <naming:resource-link>ResourceAdapterName</naming:resource-link>
    </naming:resource-adapter>
    <activation-config>
      <activation-config-property>
        <activation-config-property-name>destination</activation-config-property-name>
        <activation-config-property-value>QueueName</activation-config-property-value>
      </activation-config-property>
      <activation-config-property>
        <activation-config-property-name>destinationType</activation-config-property-name>
        <activation-config-property-value>javax.jms.Queue</activation-config-property-value>
      </activation-config-property>
    </activation-config>
  </message-driven>
</enterprise-beans>

The ResourceAdapterName in that snippet should point to the
resourceadapter-name used when the JMS resources were deployed.  The
destinationType and destination have to be specified in openejb-jar
even if, as here, they're already specified in ejb-jar.xml.

Thanks,
     Aaron

On 3/26/06, Olivier Voutat <ol...@gmail.com> wrote:
> Hi everybody,
>
> Neubie, bothering u all again. Situation: I have a Message-Driven-Bean model
> for JBoss that I would like to transform to the Geronimo way. These are my
> xml's:
>
> <ejb-jar>
>     <enterprise-beans>
>     <message-driven>
>         <ejb-name>Log</ejb-name>
>         <ejb-class>examples.LogBean</ejb-class>
>         <transaction-type>Container</transaction-type>
>         <message-driven-destination>
>             <destination-type>javax.jms.Topic</destination-type>
>         </message-driven-destination>
>     </message-driven>
>     </enterprise-beans>
>  </ejb-jar>
>
> <jboss>
>     <enterprise-beans>
>         <message-driven>
>             <ejb-name>Log</ejb-name>
>
> <destination-jndi-name>topic/testTopic</destination-jndi-name>
>         </message-driven>
>     </enterprise-beans>
> </jboss>
>
> Could you please give me how they should be adapted to the Geronimo way
> (ejb-jar.xml and openejb-jar.xml) ? Looked some articles but I'm quite
> confused by them.
>
> Thanks a lot,
>
> --
> Olivier Voutat
> Rua Praia de Muriú, 9188
> Cep 59092-390 / Natal - RN
> Tel: (84) 3219-0427 Cel: (84) 9977-3917

Re: Message-Driven-Bean (JBoss to Geronimo)

Posted by Hernan Cunico <hc...@gmail.com>.
Hi Oliver,
Have you checked out these articles about migration from JBoss to Geronimo?

http://opensource.atlassian.com/confluence/oss/display/GERONIMO/Migrating+to+Apache+Geronimo

The one on MDB is still for Geronimo M5 not v1.0 but you still should be able to migrate. I still 
need to update a few articles there but for this case I think the only change you would have to do 
in addition to the steps in the article is to remove the *parentId=""* tag from the geronimo-web.xml

HTH

Cheers!
Hernan


Olivier Voutat wrote:
> Hi everybody,
> 
> Neubie, bothering u all again. Situation: I have a Message-Driven-Bean 
> model for JBoss that I would like to transform to the Geronimo way. 
> These are my xml's:
> 
> <ejb-jar>
>     <enterprise-beans>
>     <message-driven>
>         <ejb-name>Log</ejb-name>
>         <ejb-class>examples.LogBean</ejb-class>
>         <transaction-type>Container</transaction-type>
>         <message-driven-destination>
>             <destination-type>javax.jms.Topic</destination-type>
>         </message-driven-destination>
>     </message-driven>
>     </enterprise-beans>
>  </ejb-jar>
> 
> <jboss>
>     <enterprise-beans>
>         <message-driven>
>             <ejb-name>Log</ejb-name>
>                 
> <destination-jndi-name>topic/testTopic</destination-jndi-name>
>         </message-driven>
>     </enterprise-beans>
> </jboss>
> 
> Could you please give me how they should be adapted to the Geronimo way 
> (ejb-jar.xml and openejb-jar.xml) ? Looked some articles but I'm quite 
> confused by them.
> 
> Thanks a lot,
> 
> -- 
> Olivier Voutat
> Rua Praia de Muriú, 9188
> Cep 59092-390 / Natal - RN
> Tel: (84) 3219-0427 Cel: (84) 9977-3917

Fwd: Message-Driven-Bean (JBoss to Geronimo)

Posted by Olivier Voutat <ol...@gmail.com>.
Or at least indicate some place where I can look simple model for this type
of Bean ?

Thanks,
Olivier Voutat

---------- Forwarded message ----------
From: Olivier Voutat <ol...@gmail.com>
Date: Mar 26, 2006 1:44 PM
Subject: Message-Driven-Bean (JBoss to Geronimo)
To: Geronimo <us...@geronimo.apache.org>

Hi everybody,

Neubie, bothering u all again. Situation: I have a Message-Driven-Bean model
for JBoss that I would like to transform to the Geronimo way. These are my
xml's:

<ejb-jar>
    <enterprise-beans>
    <message-driven>
        <ejb-name>Log</ejb-name>
        <ejb-class>examples.LogBean</ejb-class>
        <transaction-type>Container</transaction-type>
        <message-driven-destination>
            <destination-type>javax.jms.Topic</destination-type>
        </message-driven-destination>
    </message-driven>
    </enterprise-beans>
 </ejb-jar>

<jboss>
    <enterprise-beans>
        <message-driven>
            <ejb-name>Log</ejb-name>

<destination-jndi-name>topic/testTopic</destination-jndi-name>
        </message-driven>
    </enterprise-beans>
</jboss>

Could you please give me how they should be adapted to the Geronimo way (
ejb-jar.xml and openejb-jar.xml) ? Looked some articles but I'm quite
confused by them.

Thanks a lot,

--
Olivier Voutat
Rua Praia de Muriú, 9188
Cep 59092-390 / Natal - RN
Tel: (84) 3219-0427 Cel: (84) 9977-3917


--
Olivier & Cidiane Voutat
Rua Praia de Muriú, 9188
Cep 59092-390 / Natal - RN
Tel: (84) 3219-0427 Cel: (84) 9977-3917