Sorry, forgot to quote the XML snippet.
Hopefully I haven't missed something obvious, I've been searching for a few hours for the answer to this, to no avail...
In Spring, I would do this:
<property name="connectionFactory"> <bean class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName"> <value>java:comp/env/jms/ConnectionFactory</value> </property> </bean> </property>
How can I do this in the MC?
Interestingly, it's exactly the same.
See any -jboss-beans.xml, and just copy your snippet properly.
Or you wanna know how to pull something out of JNDI?
There is JNDIKernelRegistryPlugin that does that for you.
You must simply add it as a bean.
Note: it adds some performance penalty as once it's installed, it's included in every bean lookup
Thanks, I was able to get it working with the JNDIKernelRegistryPlugin. I'm not using Spring here, so I prefer the native mechanism.
For those who come looking for a solution, here's what it looks like. In this case, I'm injecting a DataSource that is bound as "java:/MySqlDS":
<bean name="JndiKernelRegistryPlugin" class="org.jboss.kernel.plugins.dependency.JNDIKernelRegistryPlugin"/> <bean name="..." class="..."> <property name="dataSource"> <inject bean="java:MySqlDS"/> </property>