"adver11" wrote : In EJB 3.0 RC5
| javabean code:
| public class Examples {
| | @EJB
| | MyStateless mystateless;
| |
| | public void process() {
| | System.out.println(mystateless.getString());
| | }
| | }
|
| another java bean code:
| ...........
| | Examples es = new Examples();
| | es.process();
| | ...........
|
| another EJB code:
| @Stateless
| | @Local(TestEjb.class)
| | public class TestEjbBean implements TestEjb {
| | ........
| |
| | public dosomething() {
| | Examples es = new Examples();
| | es.process();
| | }
| |
| | ........
| | }
|
| I found @EJB in the class Examples, not working. mystateless is null.
| Can uesing @EJB in java bean?
Works for me. How is @EJB returning nulll? If your module is really getting
deployed by the EJB3 deployer than it will tell you (i.e. barf with an
exception) if it can't find an instance of MyStateless. I suspect that your
module is not really getting deployed (make sure MyStateless is in your JNDI
namespce by using the JMX-Console).
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3931583#3931583
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3931583
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user