geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arunanthisivam Vimalathithen" <vimalathit...@gmail.com>
Subject Re: Failure when looking up an EJB consecutively
Date Tue, 26 Sep 2006 09:46:05 GMT
Hi Lasantha,

I might be able to escape the initialization in an example as I have
mentioned below, but in a production environment scenario where there is a
factory which invokes the client class that does the property initialization
within it and provides access to the EJB this will not be practical at all.
I also need the narrow because this application should run on other
application servers other than Geronimo as well. This sample secenario works
well without any errors in the other application servers. Is there any other
way to avoid this?

Thanks and regards,

Vimalan


On 9/26/06, Lasantha Ranaweera <lasantha@opensource.lk> wrote:
>
> 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
> ");
>         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> 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