File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes JBoss and MDB (configuration question) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "JBoss and MDB (configuration question)" Watch "JBoss and MDB (configuration question)" New topic
Author

JBoss and MDB (configuration question)

Mihai Radulescu
Ranch Hand

Joined: Sep 18, 2003
Posts: 916

Hi

I want to implement a MDB example for JBoss. Until now I use glassfish and here I use the admin console to define the resources (connection factory and the destination topic), under jBoss this look different and I try to figure it out but I get stack in a lot of xml files. My question is simple :
Which files I need to change(provide) for a simple ptp MDB example ?
Until now I try to change the jboss.xml and ejb-jar.xml but it seams that this is not enough, do I need to add the connection factory and the destination source like MBeans in a XXXX-service.xml ?

Maybe this topic belongs to the JBoss forum, but I also think that it has relevance here.

Regards,
Mihai


SCJP, SCJD, SCWCD, OCPJBCD
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9315
    
109

These tutorials might help:

MDBs using annotation

MDBs using deployment descriptors

Also, the entire tutorial source code including config files is available for download here

If you need more details, feel free to ask.

[My Blog] [JavaRanch Journal]
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9315
    
109

By the way, those are all for JBossAS-5.x since i assumed that's the version you might be using.
Mihai Radulescu
Ranch Hand

Joined: Sep 18, 2003
Posts: 916

Thanks for your answer, for the moment I use jBoss-4.2.3 (the project requires this).
As far as I understand I use I can configure the MDB with annotation and with the ejb-jar.xml. I chose the first version, the annotation - in this case I don't need the ejb-jar.xml.

My (new) question is : Do I still need the jboss.xml (to change the jboss.xml) ?
My second question is regards the queue-example-service.xml : From where I can get this file ?

In the mean time I found this http://www.jboss.org/ejb3/docs/tutorial/mdb_deployment_descriptor/mdb.html. This are examples for 4.x.

Regards,
Mihai
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9315
    
109

Mihai Radulescu wrote:

My (new) question is : Do I still need the jboss.xml (to change the jboss.xml) ?

If you are using annotations, then you need not use jboss.xml.

Mihai Radulescu wrote:
My second question is regards the queue-example-service.xml : From where I can get this file ?

If you are asking about that exact file used in the tutorial, then you will have to download the tutorial source (the link to which i provided in my earlier reply). However, if you are looking for queue configuration example files for AS-4.x then you can find them in your JBOSS_HOME/server/default/deploy/jms/*-destinations-service.xml.

Mihai Radulescu wrote:
In the mean time I found this http://www.jboss.org/ejb3/docs/tutorial/mdb_deployment_descriptor/mdb.html. This are examples for 4.x.



Yes, those are the tutorials for AS-4.x version.
Mihai Radulescu
Ranch Hand

Joined: Sep 18, 2003
Posts: 916

I have a -service.xml file, deployed in the Jboss/deploy directory its content look like :

my mdb bean look like :


but with all of this I get this exception when the jBoss starts :

[ServiceController] Problem starting service jboss.j2ee:ear=KiWi.ear,jar=ceq-ejb.jar,name=DataManipulatorMessageConsumerBean,service=EJB3
org.jboss.deployment.DeploymentException: Required config property RequiredConfigPropertyMetaData@4980c2b4[name=destination descriptions=[DescriptionMetaData@7d15936c[language=en]]] for messagingType 'javax.jms.MessageListener' not found in activation config [ActivationConfigProperty(destinationType=javax.jms.Topic), ActivationConfigProperty(acknowledgeMode=Auto-acknowledge), ActivationConfigProperty(subscriptionDurability=Durable), ActivationConfigProperty(clientId=DataManipulatorMessageConsumerBean), ActivationConfigProperty(subscriptionName=DataManipulatorMessageConsumerBean)] ra=jboss.jca:service=RARDeployment,name='jms-ra.rar'

I can not see any error, what I am doing wrong.

Regards,
Mihai
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9315
    
109

You haven't specified the mandatory "destination" activation property which would point to the topic that you created. Something like:



Mihai Radulescu
Ranch Hand

Joined: Sep 18, 2003
Posts: 916

Thanks

for the tip, you was right.
But I still have a question, why do think/sustain that the destination activation property is mandatory.
I search this in the specs but I don't find anything like this. I also start to reread the EJB 3.0 (form O'Reilly) - the Message Driven Chapter but I can not fins anything. Can you please point me to your (documentation) source .

Regards,
Miahi
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9315
    
109

Mihai Radulescu wrote:Thanks


But I still have a question, why do think/sustain that the destination activation property is mandatory.
I search this in the specs but I don't find anything like this. I also start to reread the EJB 3.0 (form O'Reilly) - the Message Driven Chapter but I can not fins anything. Can you please point me to your (documentation) source .

You will actually find that in the JCA spec. But here's the doc which also mentions about this mandatory activation property. Check for the mandatory column in the table listed there.

Let's for a moment, forget about which documentation mentions this as mandatory. Let's consider the case of the MDB. A MDB listens to a destination (queue/topic). There can be multiple destinations for a destination type within an application server. So without knowing the exact destination on which it has to listen to, the MDB definition is incomplete. Hence the destination is a mandatory property.

If you have any further questions, feel free to post them.

Mihai Radulescu
Ranch Hand

Joined: Sep 18, 2003
Posts: 916

Everything is now clear now but I still have a question :
the cod above works with glassfish, that mean the glassfish has a "something" which allows to associate the MDB with a destination. How is this possible ?
It must do this mapping in other files (like sun-resources.xml).

What do you think ?

Regards,
Mihai
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9315
    
109

I haven't worked on glassfish so don't really know where this association is done. Probably through server specific xml files or maybe even admin console?
subodh axe
Greenhorn

Joined: Jun 22, 2011
Posts: 2
Jaikiran Pai wrote:By the way, those are all for JBossAS-5.x since i assumed that's the version you might be using.


I am using jbossAS-5.1.0; I am not able to find the files (ejb-jar.xml and jboss.xml) in my server that are mentioned in "Configuring Message Driven Beans through deployment descriptors". Also I am not clear where should i put the name of my MDB (eg. myMdb.java) and what is the puprose of <!-- Uncomment to use JMS message inflow from jmsra.rar --> <invoker-proxy-binding> in standardJboss.xml

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JBoss and MDB (configuration question)
 
Similar Threads
Deploy MDB on Glassfish
how to configure jboss for jms
Weblogic 7 and MQ series Topics
JNDI lookup error in MDB
Jboss Remote Connection JMS