Why not simply do a Service Locator:
[code]
public class Locator {
public static SysPropServiceLocal lookupSysPropServiceBean() {
try {
Context c = new InitialContext();
return (SysPropServiceLocal ) c.lookup("java:comp/env/ejb/SysPropServiceBean");
} catch(NamingException ne) {
throw new RuntimeException(ne);
}
}
}
[/code]
Then:
[code]
public class TxExecutor {
SysPropServiceLocal serviceBean;
public TxExecutor() {
serviceBean = Locator.lookupSysPropServiceBean();
}
...
}
[/code]
Then make sure in any session bean that uses TxExecutor, you need to add:
[code]
@EJB(name = "ejb/SysPropServiceBean", beanName = "SysPropServiceBean")
SysPropServiceLocal serviceBean;
[/code]
This ensures that the bean is mapped in to the local JNDI context properly.
[Message sent by forum member 'whartung' (whartung)]
http://forums.java.net/jive/thread.jspa?messageID=274082