JBAS014775:New missing/unsatisfied dependencies JNDI
Пробую разобраться с jndi и ejb. Проблема выходит когда я пытаюсь вызвать из сервлета @Remote бин. Я догадываюсь что не правильный маппинг задаю. Но не понимаю что именно делаю не так. Структура проекта :
Код сервлета :
@WebServlet(value = "/hello")
public class ReverseStringServlet extends HttpServlet {
@EJB(mappedName = "java:global/luvJEECase/luvJEECase-ejb/ReverseStringBean")
ReverseString reverseString;
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
resp.getWriter().write(reverseString.reverseString());
}
}
Код Remote интерфейса :
@Remote
public interface ReverseString {
String reverseString();
}
Код Бина:
@Stateless
@Remote(ReverseString.class)
public class ReverseStringBean implements ReverseString {
public String reverseString() {
return "Hello world!";
}
}
Ошибка: 14:44:08,241 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 2) JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "luvJEECase-web-1.0-SNAPSHOT.war")]) - failure description: {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.naming.context.java.module.\"luvJEECase-web-1.0-SNAPSHOT\".\"luvJEECase-web-1.0-SNAPSHOT\".env.\"com.luv2code.luvJ22Case.ReverseStringServlet\".reverseString is missing [jboss.naming.context.java.app.\"luvJEECase-web-1.0-SNAPSHOT\".luvJEECase-ejb.ReverseStringBean]"]}
14:44:08,241 ERROR [org.jboss.as.server] (management-handler-thread - 2) JBAS015870: Deploy of deployment "luvJEECase-web-1.0-SNAPSHOT.war" was rolled back with the following failure message: {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.naming.context.java.module.\"luvJEECase-web-1.0-SNAPSHOT\".\"luvJEECase-web-1.0-SNAPSHOT\".env.\"com.luv2code.luvJ22Case.ReverseStringServlet\".reverseString is missing [jboss.naming.context.java.app.\"luvJEECase-web-1.0-SNAPSHOT\".luvJEECase-ejb.ReverseStringBean]"]}
Если нужно еще что-то , дайте знать. Благодарю за помощь!
