Hello,

I have a jboss-client which shows a swing-UI and thus performs calls to 
the application server in a separate thread. My only busines-logic call 
is handleEvent(aEvent) and I have the following code in run():

--------8<------8<------------
Collection changedModels = null;
synchronized(controller) {
     ClientController cc = controller.getClientController();
     changedModels = cc.handleEvent(event);
}
--------8<------8<------------

The variable controller is a static one and checked for != null. I tried 
  to synchronize on cc too, but no help. I tried to synchronize the 
whole handleEvent() method on both client and server side, no change. 
Every time I get an exception like this:

--------8<------8<------------
[junit] java.rmi.ServerException: RemoteException occurred in server 
thread; nested exception is:
[junit]     java.rmi.RemoteException: Application Error: no concurrent 
calls on stateful beans
[junit] java.rmi.RemoteException: Application Error: no concurrent calls 
on stateful beans
[junit]     at 
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:245)
[junit]     at 
sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220)
[junit]     at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
[junit]     at 
org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker_Stub.invoke(Unknown 
Source)
[junit]     at 
org.jboss.ejb.plugins.jrmp.interfaces.GenericProxy.invokeContainer(GenericProxy.java:357)
[junit]     at 
org.jboss.ejb.plugins.jrmp.interfaces.StatefulSessionProxy.invoke(StatefulSessionProxy.java:136)
[junit]     at $Proxy1.handleEvent(Unknown Source)
[junit]     at 
com.lambdalogic.messeinfo.control.application.HandleEventThread.run(HandleEventThread.java:83)
--------8<------8<------------


On creating the thread I even have a method to ensure only one thread is 
created and running (so I get only the advantage of a GUI update if the 
server is called):

--------8<------8<------------
         if (eventThread != null && eventThread.isAlive()) {
             try {
                 eventThread.join();
             } catch (InterruptedException e) {
                 log.error("handleEvent()",e);
             }
             // the thread is dead here, e.g. all events are handled
         }
         eventThread = HandleEventThread.queueEvent(event,null);
         eventThread.start();
--------8<------8<------------

Here is the queueEvent function:

--------8<------8<------------
static HandleEventThread queueEvent(MIEvent pEvent, 
                                                    EventHandlerCallback pCallback) {
   HandleEventThread newEvent = new HandleEventThread(pEvent,pCallback);
   return newEvent;
}
--------8<------8<------------

BTW: if i put the two handleEvent() calls one after each other, 
everything is fine. This is not a very useful way for me, because the 
GUI may start some nasty action every time, thus issuing a new event for 
the server...

Anybody out there with ideas?

Thanks a lot,

Frank



_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to