2 Replies Latest reply on Mar 21, 2019 3:24 AM by Oleg Burakov

    Can I access the EJB only inside the block or stream in which I addressed (created the link) to the EJB?

    Oleg Burakov Newbie

      Good day!

      Tell me please.

       

       

      Can I access the EJB only inside the block or stream in which I addressed (created the link) to the EJB?

       

      {
      AuthenticationConfiguration common22 = AuthenticationConfiguration.empty();
      AuthenticationConfiguration igAuthUser22 = common22.useName("IG").usePassword("ol87");
      final AuthenticationContext authCtx122 = AuthenticationContext.empty().with(MatchRule.ALL, igAuthUser22);
      
      String[] p2 = {"g2","g1"};
       authCtx122.runConsumer(printer, p2);
      
      ejb33222277777.getVersion(); // JBREM000308: Authentication failed (no mechanisms left), tried: 
              }
      
      Consumer<string[]> printer = x -> {
      try {
      Context context22 = getInitialContext();
      ejb33222277777 = (EJBAccessRemote) context22.lookup(
      "ejb:/ejb-security-jaas/EJBAccess!org.jboss.as.quickstarts.ejb_security_jaas.EJBAccessRemote?stateful");
      tttt=ejb33222277777.getVersion();  // OK
      } catch (NamingException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      }