I'm trying to use Service POJO bean ( jboss extension of EJB3), but I found
that PersitentUnit was not found!
@Service(name = MyService.SERVICE_NAME)
| @Management(IMyService.class)
| //@PersistenceContext(name="em") not work too
| public class MyService implements IMyService {
| public final static String SERVICE_NAME = "MyService";
| @PersistenceContext()
| private EntityManager em;
| public void create() throws Exception {
| log.info("Ems created");
| }
|
| @TransactionAttribute(TransactionAttributeType.REQUIRED)
| public void start() throws Exception {
| log.info("Ems started");
| //em.xxx this line worked
| new InitialContext().lookup("java:comp/env/em") not work.
| }
| }
ExceptioN:
javax.naming.NameNotFoundException: env not bound
I'm retrieving EnityManager from some util class, that nest called in other
class, it will be great trouble to pass em inside.
Why no Enc in service POJO? any work around?
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4262330#4262330
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4262330
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user