-
1. Re: JBoss MDB Beginner Question
dvh75 Sep 11, 2008 12:57 PM (in response to babernat)Don't know if you found your answer or not, but check this out:
http://docs.jboss.org/ejb3/app-server/tutorial/
As described in the injection section, you can do the following:
The @javax.annotation.Resource annotation allows you to inject resources.
@Resource(mappedName="DefaultDS")
private javax.sql.DataSource ds;
If you just need String data, it would look like so:
@Resource(mappedName="MyConfigValue")
private String somevalue;
If you're not using the annotations, just declare a resource in the ejb-jar.xml for you mdb, then do a jndi lookup on it in your bean.
Hope this helps... -
2. Re: JBoss MDB Beginner Question
babernat Jan 2, 2009 5:06 PM (in response to babernat)Thanks dvh75. Let's talk about the String data for a minute because that is exactly what I need to do. The "MyConfigValue" would have to be exposed in JNDI, correct? If so, how do I configure JBoss to place that value in the JNDI directory?
-
3. Re: JBoss MDB Beginner Question
jaikiran Jan 2, 2009 11:40 PM (in response to babernat)You can use the env-entry element in the ejb-jar.xml and corresponding jboss.xml. Those values get bound to java:comp/env namespace of the component in the JNDI. Look for the dtds of ejb-jar.xml and jboss.xml for more details. Let us know, if you are having trouble in configuring them.
-
4. Re: JBoss MDB Beginner Question
babernat Jan 5, 2009 11:06 AM (in response to babernat)jaikiran,
Thanks for the reply. This is exactly what I needed. Thank you very much for the pointer.