-
1. Re: Standalone to remote EJB reconnect issues..
jaikiran Feb 20, 2012 11:02 AM (in response to markus78)1 of 1 people found this helpfulmarkus78 wrote:
Is this the intended behavior?
The re-connection logic was added to take care of broken connections which were already functional at some point. It doesn't take into account connections which never happened in first place. Let me think a bit whether it's a good idea to include even those connections for reconnection (want to make sure it doesn't introduce any unexpected problems).
-
2. Re: Standalone to remote EJB reconnect issues..
markus78 Feb 20, 2012 11:55 AM (in response to jaikiran)Thanks,
One more question in this area, if i dont create a new initialcontext it seems the reconnect does not work either, so the reconnect logic needs initialcontext to be instantiated to be triggered? I noticed this since we have servicelocator classes that only initialises the context once during init, and when restarting the server the client world not reconnect again since initial context was already created.
-
3. Re: Standalone to remote EJB reconnect issues..
jaikiran Feb 20, 2012 12:55 PM (in response to markus78)markus78 wrote:
Thanks,
One more question in this area, if i dont create a new initialcontext it seems the reconnect does not work either, so the reconnect logic needs initialcontext to be instantiated to be triggered?
It isn't really related to InitialContext. What exact does your client code look like?
-
4. Re: Standalone to remote EJB reconnect issues..
markus78 Feb 21, 2012 2:46 AM (in response to jaikiran)You are correct, I could not reproduce the behavior I wrote about earlier ( the new initialcontext stuff ).
I still think its a good idea for the client to try to connect to its specified hosts at every try as long as no bean can be found in the "working" hosts, perhaps it can be made into an option in the jboss-ejb-client.property file.
BR
/Markus
-
5. Re: Standalone to remote EJB reconnect issues..
jaikiran Feb 21, 2012 6:10 AM (in response to markus78)https://issues.jboss.org/browse/EJBCLIENT-26
perhaps it can be made into an option in the jboss-ejb-client.property file.
I don't think we need to create another option for that.
-
6. Re: Standalone to remote EJB reconnect issues..
markus78 Feb 23, 2012 9:07 AM (in response to jaikiran)Jakirian I noticed that you resolved the issue so I rushed to test your solution in my project (building ejb-client from source) , but it does not quite work ( or I'm not quite using it right )
my scenario
2 servers defined i property file serverA and serverB
1. stop serverA only serverB is still running
2. restart standalone client
3. start serverA
4. standalone client invokes on bean that lives on serverA , this fails and no reconnect is attempted on serverA ( serverB is still registered and thus a no such ejb exception is thrown )
If I do the same thing but with only 1 server it works.
/Markus
-
7. Re: Standalone to remote EJB reconnect issues..
jaikiran Feb 23, 2012 9:13 AM (in response to markus78)4. standalone client invokes on bean that lives on serverA , this fails and no reconnect is attempted on serverA ( serverB is still registered and thus a no such ejb exception is thrown )
You mean you see some errors? Can you get me the logs? Also what exact repo and branch did you use to build this?
-
8. Re: Standalone to remote EJB reconnect issues..
jaikiran Feb 23, 2012 9:15 AM (in response to jaikiran)By the way, I've added a testcase to make sure this is working https://github.com/jbossas/jboss-ejb-client/blob/1.0/src/test/java/org/jboss/ejb/client/test/reconnect/ReconnectTestCase.java. That one's passing.
Make sure you have the right version of jboss-ejb-client jar in the client classpath.
-
9. Re: Standalone to remote EJB reconnect issues..
markus78 Feb 23, 2012 10:01 AM (in response to jaikiran)No error, just the "No such EJB" exception since the serverA is not reconnected to.
I'm going to check tomorrow which exact branch I used but I'm pretty sure ejbclient-26 was implemented in it.
The problem for me is that 1 of the 2 servers I have listed in the property file is up and running when i start the standalone client, thus one server is added as a ejb receiver and then the reconnect on the other not yet started server seems to never happened, I'm not sure that your testcase covers that?
/Markus
-
10. Re: Standalone to remote EJB reconnect issues..
jaikiran Feb 23, 2012 10:15 AM (in response to markus78)markus78 wrote:
The problem for me is that 1 of the 2 servers I have listed in the property file is up and running when i start the standalone client, thus one server is added as a ejb receiver and then the reconnect on the other not yet started server seems to never happened,
/Markus
It won't reconnect if the first server is capable of serving/handling the deployment. That's because there's no use of creating another receiver when server 1 can already handle that deployment. Did I understand your usecase right?
-
11. Re: Standalone to remote EJB reconnect issues..
jaikiran Feb 23, 2012 10:16 AM (in response to jaikiran)By the way, you shouldn't see the No such EJB exception if the server 1 is able to handle the deployment. If it isn't then the reconnect should happen and server 2 will be given a chance to handle it if it can.
-
12. Re: Standalone to remote EJB reconnect issues..
markus78 Feb 23, 2012 10:20 AM (in response to jaikiran)No the servers have different ear's deployed
ServerA has , lets say, ear_A , and serverB has , ear_B deployed.
But no reconnect attempt is made toward ServerA when invoking on bean ejb:ear_A/......
This is when ServerA is down, and serverB is up during start of standalone client, and first invoke attempt on ejb:ear_A naturally fails ( since ServerA is not online )
But then when i start ServerA and try to invoke again it does not reconnect.
The exact same exercise but without ServerB involved works flawlessly.
-
13. Re: Standalone to remote EJB reconnect issues..
jaikiran Feb 23, 2012 11:13 AM (in response to markus78)Okay, I think I know what's going on. I'll take a look at this tomorrow and add one more test for this. Thanks for the details.
-
14. Re: Standalone to remote EJB reconnect issues..
jaikiran Feb 24, 2012 9:35 AM (in response to jaikiran)I've deployed a snapshot https://repository.jboss.org/nexus/content/repositories/snapshots/org/jboss/jboss-ejb-client/1.0.3.Final-SNAPSHOT/jboss-ejb-client-1.0.3.Final-20120224.143355-2.jar which I believe should fix this issue for you. Give it a try and let us know.