[jboss-user] [EJB 3.0] - env-entry injection in a @Service EJB
rene@xinit.org
do-not-reply at jboss.com
Wed Jul 19 04:53:34 EDT 2006
Hi,
I would ask how I can do an env-entry injection into an jboss @Service EJB? There are many examples how this can be done with session beans and also message driven bean. But I could not find anything how to inject a primary type resource into a @Service EJB.
I have the following test service:
| @Service
| public class MyTestServiceBean implements MyTestService {
|
| @Resource(name = "maxValue") public int maxValue = 10;
|
| public MyTestServiceBean() {
| System.out.println("MAX_VALUE: " + maxValue);
| }
|
| public void test() {
| // ...
| }
|
| }
|
In ejb-jar.xml I tried something like this (which I didn't really expected to work)
| <ejb-jar>
| <enterprise-beans>
| <env-entry>
| <env-entry-name>maxValue</env-entry-name>
| <env-entry-type>java.lang.Integer</env-entry-type>
| <env-entry-value>1000</env-entry-value>
| </env-entry>
| </enterprise-beans>
| </ejb-jar>
|
I also tried many variations with <injection-target> and setting this stuff in jboss.xml. But nothing worked so far.
Thanks in advance,
René
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3959049#3959049
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3959049
More information about the jboss-user
mailing list