-
1. Re: Stubs save in infinispan cache (map)
wdfink Oct 27, 2014 12:02 PM (in response to koohkan)There is no EAP version 3.21
What kind of stubs you generate JBoss EJB?
Did the invocation failed from a different host?
Please provide a bit more informations.
-
2. Re: Stubs save in infinispan cache (map)
koohkan Oct 28, 2014 3:21 AM (in response to wdfink)Sorry, it is true EAP 6.2.1.
The following situation:
i have a midleware based auf ejb 3.1 with stateless session beans and JPA .... My Application server is JBoss 7..x
Midleware runs on a server.
The clients run an other server.
clien1 is a GUI runs within jvm1 and client2 a standalone runs within with jvm2.
client1 and clien2 are able to communicate, and
client2 should be able to be called by ejb - container.
For example there are 400 user. each user ist assigned client1 and client2.
My idea:
stub1 for client1 as remote object ,
stub2 for client2 as remote object
user(1) save stub1 and stub2 in ejb-container (Map infinispan: <KEY, VALUE> , <String, stub-object>)
....
user(n) save stub1 and stub2 in ejb-container (Map infinispan: <KEY, VALUE> , <String, stub-object>)
.
client2 for a communication with the client 1, get stub from Map<String, stub> via unique key
.....
often without problems,
communication user(1): client1 communicates with stub2 ... [${IP}:${port}]...
rarely change port and the communication fails on port
java.rmi.ConnectionException; connection refused to host:
I used in JBOSS 5.x jndi context and everything was ok.
-
3. Re: Stubs save in infinispan cache (map)
wdfink Oct 28, 2014 1:00 PM (in response to koohkan)With EAP6 the behavior has changed.
The Proxy/Stub is 'only' a implementation of the interface which use the ejb-client context.
So it is possible to serialize it.
But the real invocation is based on the client environment. How you create and use it at client side? How the code look like?
-
4. Re: Stubs save in infinispan cache (map)
koohkan Oct 29, 2014 9:05 AM (in response to wdfink)public class Client2Impl implements Client2
{
public void bind (Object exportObject, String bindName)
{
// Interface von Remote Session Bean stateless within EJB Container (Server)
jecService.bind (bindName, UnicastRemoteObject.exportObject ((Client) exportObject, 0));
}public static void main (String[] args)
{
..........
}
.....
}
----------
public interface Client2 extends Remote
{
registrereClient1(Client c, String bindName) throws RemoteException ;
.....
}
+++++++++++++++++++++++++++++++++++++
public class Client1Impl implements Client1
{public static void main (String[] args)
{
...
}
public void doWhat (onJecEventOcurred event) throws RemoteException
{
......
}
}public interface Client1 extends Remote, EventListener
{void doWhat (java.util.EventObject evtent) throws RemoteException;
....}
+++++++++++++++++++++++++++++++++++++have very simplified and renamed but technically is the way it is
when the server is restarted is one to two days without fail.
Cache eithin EJB Container as infinispan cache:
Cache <String, Object>
User1: save in cache: <"user1Clien1", stubClient1>
and
<"user1Clien2", stubClient2>
----
User2: save in cache: <"user2Clien1", stubClient1>
and
<"user2Clien2", stubClient2>
----
User3: save in cache: <"user3Clien1", stubClient1>
and
<"user3Clien2", stubClient2>
----
...
User(n): save in cache: <"user(n)Clien1", stubClient1>
and
<"user(n)Clien2", stubClient2>