java - Inject stateful EJB beans in a maven project -
i don't understand 1 thing hope of explain me. have maven enterprise project developed glassfish.
i utilize insert code netbeans function (right click) phone call bean in servlet , in particular annotation
@ejb
i don't understand why when phone call stateful session bean through insert code function in netbeans bean called through jndi. here mean
private bookingbeaninterface lookupbookingbeanlocal() { seek { context c = new initialcontext(); homecoming (bookingbeaninterface) c.lookup("java:global/it.volaconnoi_volaconnoi-webapp-ear_ear_1.0-snapshot/it.volaconnoi_volaconnoi-webapp-ejb_ejb_1.0-snapshot/bookingbean!it.volaconnoi.logic.bookingbeaninterface"); } grab (namingexception ne) { logger.getlogger(getclass().getname()).log(level.severe, "exception caught", ne); throw new runtimeexception(ne); } }`
the above function hasn't been wrote me
i can't inject stateful session bean through ejb?
here solution problem:
as know single servlet instance used handle multiple requests multiple clients stateful ejb should not injected straight in servlet , kept instance property, or face obvious thread-safety related issues. in our case fetching jndi within doget method , storing in http session each user have it's own sateful ejb instance.
java maven java-ee
No comments:
Post a Comment