-
15. Re: Configure MQ Resource Adapter for MDB - JBoss 7.1
jaikiran Feb 8, 2012 8:02 AM (in response to pauld1119)1 of 1 people found this helpfulPaul DuBon wrote:
However I had also seen an example of this in the following thread and based on the responses, I assume it worked:
https://community.jboss.org/wiki/HowToConfigureEJB3MDBsForIBMWebsphereMQ
The example there just sets additional (default) ActivationConfigProperties for the MDB in addition to what's specified on the MDB via annotations. So it isn't really too different (except for it's externalized as a AOP construct) from what you are doing via annotations.
By the way, if you are just looking to get rid of the annotations and instead use xml, then you can do that via ejb-jar.xml. The activation-config-properties element in the message-driven-element is what you have to configure.
-
16. Re: Configure MQ Resource Adapter for MDB - JBoss 7.1
pauld1119 Feb 8, 2012 8:20 AM (in response to jaikiran)Jaikiran,
I was looking to go with an all annotation based approach and drop the descriptor file, but looks like that will not be an option.
Thank you for your input!
-
17. Re: Configure MQ Resource Adapter for MDB - JBoss 7.1
pauld1119 Feb 22, 2012 7:47 AM (in response to jaikiran)Jaikiran,
Please let me know how to utilize a particular resource adapter with an MDB, using only xml in JBoss 7.1
If we go the route of just using the ejb-jar.xml descriptor file, how do we specify the resource adapter to use (wmq.jmsra.rar). I tried doing it via @ResourceAdapter and it doesn't seem to be picking that up. But I'd also like to consider not utilizing that annotation if possible, that way no code changes are required (as another option).
-
18. Re: Configure MQ Resource Adapter for MDB - JBoss 7.1
jbertram Feb 22, 2012 9:31 AM (in response to pauld1119)Can you paste the code (including annotations) you are trying to use with @ResourceAdapter? This should work.
Also, you should be able to specify the resource adapter with jboss-ejb3.xml as illustrated here.
Lastly, you should also be able to define outflow connection factories and admin objects in standalone*.xml just like you did previously in *-ds.xml (albeit with a different syntax). Check out this section of the IronJacamar documentation (you'll need to download the latest IJ alpha to use these tools). I think will help you with your migration.
-
19. Re: Configure MQ Resource Adapter for MDB - JBoss 7.1
pauld1119 Feb 22, 2012 9:44 AM (in response to jbertram)Thanks Justin, As I'm tyring to get this working without make code changes and hence relying on the descriptor files, what you suggested is what I've been trying to track down. I did notice that jboss-ejb3.xml was valid descriptor file, but I can't find the schema for it and when I try a sample based on the example that you provided , I get the following ClassCastException:
Caused by: java.lang.ClassCastException: org.jboss.metadata.ejb.spec.MessageDrivenBean31MetaData cannot be cast to org.jboss.metadata.ejb.jboss.ejb3.JBossGenericBeanMetaData
-
20. Re: Configure MQ Resource Adapter for MDB - JBoss 7.1
stighenriksen Feb 22, 2012 9:48 AM (in response to pauld1119)The ClassCastException thing looks like a bug that has been fixed in 7.1.0.Final, so try upgrading in case you're not already on that version.
-
21. Re: Configure MQ Resource Adapter for MDB - JBoss 7.1
pauld1119 Feb 22, 2012 10:01 AM (in response to stighenriksen)That fixed that problem! Thanks Stig. Hopefully one last issue to work through. Again, sorry can't find a schema file online for jboss-ejb3.xml. Is there a way to set the transaction attribute in this file? I need to set the transaction attribute type to not supported.
-
22. Re: Configure MQ Resource Adapter for MDB - JBoss 7.1
pauld1119 Feb 22, 2012 10:08 AM (in response to pauld1119)I think I figured it out. I added the following to my ejb-jar.xml:
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>MDBSample</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>NotSupported</trans-attribute>
</container-transaction>
</assembly-descriptor>No startup errors!!!!
-
23. Re: Configure MQ Resource Adapter for MDB - JBoss 7.1
jaikiran Feb 22, 2012 10:12 AM (in response to pauld1119)Paul DuBon wrote:
Again, sorry can't find a schema file online for jboss-ejb3.xml.
It's not published online yet. But it's available in your distribution at JBOSS_HOME/docs/schema and is named jboss-ejb3-spec-2_0.xsd. The jboss-ejb3.xml is meant for JBoss specific configuration for your EJBs (like the resource-adapter name for the MDBs). For the rest of the spec compliant configurations (like transaction attribute) you can use the ejb-jar.xml.
-
24. Re: Configure MQ Resource Adapter for MDB - JBoss 7.1
pauld1119 Feb 22, 2012 10:31 AM (in response to jaikiran)Thanks to everyone for their input. I've this this working using just deployment descriptors. I've attached some sample files for reference.
-
jboss-ejb3.xml 515 bytes
-
ejb-jar.xml 3.1 KB
-
-
25. Re: Configure MQ Resource Adapter for MDB - JBoss 7.1
rathm1 Mar 7, 2012 12:06 PM (in response to pauld1119)Hi Paul,
So it looks like in the end you still had to hard code all the MQ properties into the ejb-jar.xml or did you since find a way to externalize those?
I have a similar question posted here:
https://community.jboss.org/message/721230#721230
Where I used to be able to use ${...} to get the properties in jboss.xml in both jboss 4.2.3 and jboss 6.1.0.
-
26. Re: Configure MQ Resource Adapter for MDB - JBoss 7.1
jbertram Mar 7, 2012 12:11 PM (in response to rathm1)See the reply on your thread.
-
27. Re: Configure MQ Resource Adapter for MDB - JBoss 7.1
pauld1119 Mar 7, 2012 12:38 PM (in response to rathm1)We're going to look at tokenzing the environment specific values and use our build scripts to relace those tokens. It's not ideal, as we'll have to build for each environment, but that's all we've come up with so far.
-
28. Re: Configure MQ Resource Adapter for MDB - JBoss 7.1
jaikiran May 30, 2012 3:38 AM (in response to pauld1119)Paul (and others), could you take a look at this post and see if that's what you are wanting to have as a feature in AS7 https://community.jboss.org/message/738670#738670?
-
29. Re: Configure MQ Resource Adapter for MDB - JBoss 7.1
pauld1119 May 30, 2012 8:42 AM (in response to jaikiran)Yes Jaikiran, that's inline with what I was trying to solve. For now we've had our build team replace the ejb-jar.xml at staging time with the environment specific properties needed to connect to the queues. Utilizing AOP or JNDI (prefered) would be a better solution IMO.