geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lasantha Ranaweera <lasan...@opensource.lk>
Subject Re: Failure when looking up an EJB consecutively
Date Tue, 26 Sep 2006 09:32:52 GMT
Hi Vimalan,

I just tried to re generate your error in my machine with the attached 
sample application. Check out is it the same scenario as yours. But I 
couldn't regenerate your problem. It looks the Exception is a network 
related one. Also I would like to add some comments to this scenario too.

1. The spec says you should narrow, but when using the 
org.openejb.client.RemoteInitialContextFactory, you never have to.  We 
use dynamic proxies which don't require narrowing.
2. You might be able to escape from this Exception if you take property 
initialization to the out side of for loop.  I would think it would be 
more practical scenario.

Regards,
Lasantha Ranaweera

Arunanthisivam Vimalathithen wrote:
> Hi Lasantha,
>  
> I had a look at your example and it differs in the following. Setting 
> up the initial context and lookup, narrowing, creation as well as the 
> remote bean method invocation are all within the same loop, and also 
> the home object is narrowed using PortableRemoteObject.narrow. I am 
> providing you with some sample code below. I suggest you modify your 
> code as below to reproduce this error. (if it works the first time 
> which I doubt, please run again it will throw up the error). We are 
> currently testing this on Geronimo 1.1.1.
>  
>      for(int i=0;i<1000;i++){
>      Properties properties = new Properties();
>      
> properties.setProperty("java.naming.factory.initial","org.openejb.client.RemoteInitialContextFactory");
>         
> properties.setProperty("java.naming.provider.url","127.0.0.1:4201 
> <http://127.0.0.1:4201>");
>         
> properties.setProperty("java.naming.security.principal","system");
>         
> properties.setProperty("java.naming.security.credentials","manager");
>         try {
>             InitialContext ic = new InitialContext(properties);
>             Object o = ic.lookup ("SessionTestBean");
>             SessionTestRemoteHome sessionTestRemoteHome =  
> (SessionTestRemoteHome)PortableRemoteObject.narrow(o,SessionTestRemoteHome.class);
>             SessionTestRemote sessionTestRemote = 
> sessionTestRemoteHome.create();
>             sessionTestRemote.display();
>         }catch(NamingException e) {
>             e.printStackTrace();
>         } catch (RemoteException e) {
>             e.printStackTrace ();
>         } catch (CreateException e) {
>             e.printStackTrace();
>         }
>      }
>
>
> On 9/26/06, *Lasantha Ranaweera* <lasantha@opensource.lk 
> <mailto:lasantha@opensource.lk>> wrote:
>
>     Hi Vimalan,
>
>     I tested this problem with a 2000 consecutive requests in Geronimo
>     v 1.1.1. But it doesn't happen to me at all. You can test it with
>     the EJB samples application in
>     http://cwiki.apache.org/GMOxDOC11/ejb-sample-application.html
>     replacing following files. We might able to help you if you are
>     more specific and share your code with us.
>
>     Regards,
>     Lasantha Ranaweera
>
>
>     Arunanthisivam Vimalathithen wrote:
>>     Hi,
>>      
>>     I am having a problem in an application I am trying to port to
>>     WebSphere community edition which basically uses Geronimo 1.0
>>     (This problem exists in the latest version of Geronimo (1.1.1) as
>>     well). The client I am using looks up the service numerous times
>>     consecutively and invokes the services. The problem happens when
>>     this has gone past more than 630 times, the client simply fails
>>     to look up and produces the following error:
>>      
>>     _java.rmi.RemoteException_: Cannot access server:
>>     /127.0.0.1:_4201_ Exception: ; nested exception is: _
>>     java.io.IOException_: Cannot access server: /127.0.0.1:4201
>>     _Exception_: _java.net.BindException_ : Address already in use:
>>     connect
>>      
>>     The same error can be produced by looking up and invoking a
>>     simple hello world EJB in a loop of 700 times. This happens in
>>     the latest release of Geronimo (sometimes the loop might need to
>>     be increased to 1000). Any work arounds to this?
>>      
>>     Thanks and regards,
>>      
>>     Vimalan
>
>
>
>


Mime
View raw message