3 Replies Latest reply on May 27, 2009 4:35 PM by George Kokkinos

    Do not start long-running conversations in direct calls to EJBs

    Ulrike Newbie

      I've implemented a WebService much like seambay-example.


      I tried to restrict a method in AuctionSearchAction using



      @Restrict("#{identity.loggedIn}")




      and everything worked fine.


      Then i tried the same in my own WebService and it works without the restriction, but when i add the line to the method in the Action class all I get is an Exception:



      java.lang.IllegalStateException: Do not start long-running conversations in direct calls to EJBs

      But I don't have any conversations - the method should be in scope of EVENT just like ChangePasswordAction or something like that.

        • 1. Re: Do not start long-running conversations in direct calls to EJBs
          Ulrike Newbie

          code snippets...


          @Name("myAction")
          @Scope(ScopeType.EVENT)
          public class MyAction implements Serializable {
               private static final long serialVersionUID = -5117712464229825663L;
               
               @Restrict("#{identity.loggedIn}")
               public String test() {
                    return "OK";
               }
               
          }




          @Name("myService")
          @Stateless
          @WebService(name="myService", serviceName="MyService")
          public class MyServiceImpl implements MyService {
          
               @WebMethod
               public boolean login(String username, String password) {
                    Identity.instance().setUsername(username);
                    Identity.instance().setPassword(password);
                    Identity.instance().login();
                    return Identity.instance().isLoggedIn();
               }
          
               @WebMethod
               public boolean logout() {
                    Identity.instance().logout();
                    return !Identity.instance().isLoggedIn();
               }
          
               @WebMethod
               public String test() {
                    return getMyAction().test();
               }
          
               private MyAction getMyAction() {
                    return (MyAction)Component.getInstance(MyAction.class, true);
               }
          
               ...
          
          }


          • 2. Re: Do not start long-running conversations in direct calls to EJBs
            Ulrike Newbie

            Solved...
            Moved the standard-jaxws-endpoint-config.xml from ear/META-INF to ear/jar/META-INF and now it works...

            • 3. Re: Do not start long-running conversations in direct calls to EJBs
              George Kokkinos Newbie

              Can you please tell me to which jar you placed the standard-jaxws-endpoint-config.xml file??
              was it the ejb jar?
              And what version of seam are you using??


              Thank you!