I try to use JNDI to get a new state session bean in the servlet (as a local variable) I am doing My doGet ()
method has the following:
Bean Bean = (Bean) New Initial Concert (). Lookup ("surname");
I have tried java: comp / env
but all my efforts have inspired naming exceptions.
I am trying to use What I needed to do was use the Then look at the @Stateful (name = "beanName")
and @Stateful (mappedName = "beanName"), using different estimates such as
@Stateful
@EJB
annotation at the class level on the servlet, as follows:
@EJB (name =" biennam "); Bean Interface = Bean. Category)
@EJB
by the name binding by annotation May Ewa method:
Bean Bean instance = (Bean) new initial Contaks (). Lookup ("java: comp / env / beanName"); In addition to the plain
@Stateful
annotation, there is no need to do anything in the Bean Class.
Comments
Post a Comment