• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

JBoss and MDB (configuration question)

 
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You haven't specified the mandatory "destination" activation property which would point to the topic that you created. Something like:



 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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

 
Yeah, but is it art? What do you think tiny ad?
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic