8 Replies Latest reply on Aug 6, 2012 4:58 AM by Stephan Windmüller

    Unable to setup more EJB receivers: "Too many open files"

    Stephan Windmüller Newbie

      Hello!

       

      My EJB client application uses a lookup similar to this posting: https://community.jboss.org/message/732900#732900. It connects with a few hundred different users to a JBoss server (7.1.1-final). Unfortunately, after about 1,000 connections, this stops working on the client side:

       

      WARN  [main] ConfigBasedEJBClientContextSelector   - EJB client context org.jboss.ejb.client.EJBClientContext@16db431a will have no EJB receivers due to an error setting up EJB receivers

      java.io.IOException: Too many open files

                at sun.nio.ch.IOUtil.initPipe(Native Method)

                at sun.nio.ch.EPollSelectorImpl.<init>(EPollSelectorImpl.java:49)

                at sun.nio.ch.EPollSelectorProvider.openSelector(EPollSelectorProvider.java:18)

                at java.nio.channels.Selector.open(Selector.java:209)

                at org.xnio.nio.NioXnioWorker.<init>(NioXnioWorker.java:120)

                at org.xnio.nio.NioXnio.createWorker(NioXnio.java:126)

                at org.jboss.remoting3.EndpointImpl.construct(EndpointImpl.java:137)

                at org.jboss.remoting3.Remoting.createEndpoint(Remoting.java:60)

                at org.jboss.remoting3.Remoting.createEndpoint(Remoting.java:73)

                at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.setupEJBReceivers(ConfigBasedEJBClientContextSelector.java:94)

                at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.<init>(ConfigBasedEJBClientContextSelector.java:77)

       

      It seems like the connections are never closed. Is there a way to do this? I found this posting with a connection handling example

       

      https://community.jboss.org/message/724714#724714

       

      but this does not work with the currect client library: ThreadLocalContextSelector.setCurrent(context) is not public.