3 Replies Latest reply on Jan 2, 2008 1:22 PM by pmuir

    ejb + seam from swing gui

    kruno

      We've made an application with jsf +seam +ejb and it works great, I am so pleased, but I think it would be nice if I could be able to use the same ejb beans (application logic) from client such as swing or anything else.
      I did try an it partially works, injections work, entity manager controlled by seam also work.
      Our application uses long running conversations and transactions are controlled by seam also flushmode is manual.
      So I need to start conversation manually and set flushMode.Manual.
      I tried it like this but it does not work
      This is method from ejb which should start conversation

       @Begin(flushMode=FlushModeType.MANUAL)
       public String pocetak() {
      
       return "OK";
       }
      


      This is part of client swing application
      ref = jndiContext.lookup("java:kadrovska/ObradaTestBean/remote");
       ObradaTest obrada = (ObradaTest) ref;
      
       obrada.pocetak();
      ......
      

      I get this error:
      Exception in thread "main" javax.ejb.EJBException: java.lang.IllegalStateException: Do not start long-running conversations in direct calls to EJBs
       at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:63)
       at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
       at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:83)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
       at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.stateful.StatefulContainer.dynamicInvoke(StatefulContainer.java:335)
       at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
       at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
       at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:769)
       at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:573)
       at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:373)
       at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:166)
       at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:163)
       at org.jboss.remoting.Client.invoke(Client.java:1634)
       at org.jboss.remoting.Client.invoke(Client.java:548)
      .......
      


      Please help.
      Thanks in advance Kruno.

        • 1. Re: ejb + seam from swing gui
          pmuir

          Simply, there is no support for long running conversations when you do calls from EJBs rather than JSF. I guess you could open a feature request in JIRA for this, and we can see if its popular. If it is, we can look at implementing it.

          • 2. Re: ejb + seam from swing gui
            cavani

            This feature should be very similar with WebServices implementation, is it not?

            just my two cents...

            • 3. Re: ejb + seam from swing gui
              pmuir

              Yes - it just needs implementing.

              We need to formalise the API for hooking in clients (thus meaning all the client needs to is provide a conversation id to propagate conversations).