8 Replies Latest reply on Aug 5, 2011 9:08 AM by spallai

    Too many open files exception JBOSS 4.2

    Ajay Kumar Newbie

      I am testing an EJB3.0 application ih JBOSS hosted in Linux machine
      It simply calls a business method 100 times.
      The business method simply inserts some JMS messages in the well defined queues.
      The MDB is attached with each queue and each MDB call a local business method which simply update the database table based on the input passed to it.
      My problem is that everything going fine but JBOSS starts throwing exception after few minutes of starting of the my J2EE application with following error message:-
      “ Failed to setup client connection
      java.net.SocketException: Too many open files�

      when such exception occurs, The EJB deployed in the sever is stopped to take any new request from client and same exception "Too many open files" is thrown in JBOSS console .
      Is there some configuration is requited at OS or JBOOS level to execute heavy J2EE application in the JBOSS.
      Can any help me to guide what I need to configure to avoid " too many open files exception" in the JBOSS.

        • 1. Re:  Too many open files exception JBOSS 4.2
          jaikiran pai Master

          Post the entire exception stacktrace. Which exact version of JBoss do you use (JBoss 4.2.1 or JBoss 4.2.2)? Which version and vendor of Java do you use?

          • 2. Re:  Too many open files exception JBOSS 4.2
            Ajay Kumar Newbie

            Hello JaiKiran,
            Thanks for the reply.
            I am using JDK1.5 of SunMicrosystem and the version of JBOSS I have used is 4.2.2.GA.
            The following are the stack trace for the exception I have got:-

            11:10:22,744 WARN [UILServerILService] Failed to setup client connection
            java.net.SocketException: Too many open files
            at java.net.PlainSocketImpl.socketAccept(Native Method)
            at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)
            at java.net.ServerSocket.implAccept(ServerSocket.java:450)
            at java.net.ServerSocket.accept(ServerSocket.java:421)
            at org.jboss.mq.il.uil2.UILServerILService.run(UILServerILService.java:159)
            at java.lang.Thread.run(Thread.java:595)
            11:10:22,747 INFO [STDOUT] exception:Cannot authenticate user; - nested throwable: (java.io.EOFException)

            11:10:22,750 WARN [UILServerILService] Failed to setup client connection
            java.net.SocketException: Too many open files
            at java.net.PlainSocketImpl.socketAccept(Native Method)
            at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)
            at java.net.ServerSocket.implAccept(ServerSocket.java:450)
            at java.net.ServerSocket.accept(ServerSocket.java:421)
            at org.jboss.mq.il.uil2.UILServerILService.run(UILServerILService.java:159)
            at java.lang.Thread.run(Thread.java:595)
            11:10:22,751 INFO [STDOUT] exception:Cannot authenticate user; - nested throwable: (java.io.EOFException)

            I have found after getting above error the AS statas throwing same error whenever client tries to call EJB deployed in JBOSS.

            I think there is some configuration issue either at OS level or JBOOS level
            like how many file/ports can be opened by the J2EE application.

            Thanks to give me solution of my problem.

            with regards,
            Ajay Kumar
            Technical Leader,
            STMicroelctronics.


            • 4. Re:  Too many open files exception JBOSS 4.2
              Doal Miller Newbie

              Was there any resolution to this? We are seeing the same problem. We are front ending JBoss with Apache 2.2.6 and using JBoss 4.2.2GA. We are on Linux FC6. After some time it runs into the Too many open files problem. This is under a heavy test load, but we still expect it to recover and we didn't see this issue with Apache 2.2.0 and JBoss 4.0.3.

              I've seen various issues listing this same error but I haven't seen any solutions. Our max file handles per user is 1024 which would see sufficient and the total max is very large.

              We see many open sockets on the 8009 port which is the port that JBoss users to listen to the Apache AJP connector. I believe they connections get into a CLOSE_WAIT state and seem to stay there.

              Anyone figure a way out of this. Just bumping up the number of max connections will just put the problem off till later.

              • 5. Re:  Too many open files exception JBOSS 4.2
                Georges Goebel Newbie

                Hi,

                I had the same problem with the "close_wait" connections. I managed to solve the problem with the workaround of using the jbossnative 2.0.3 library

                Georges

                • 6. Re:  Too many open files exception JBOSS 4.2
                  Andrew Sazhin Newbie

                  Georges,

                  Could you explain me how you solved "CLOSE_WAIT" problem by jbossnative?
                  We're using Apache(front-end)+JBoss(RedHat) too and we have "CLOSE_WAIT" problem on AJP connector too. As result "CLOSE_WAIT" problem causes "too many open files".

                  Andrew

                  • 7. Re:  Too many open files exception JBOSS 4.2
                    Joshua Tharp Newbie

                    What was the solution to this?

                    • 8. Re:  Too many open files exception JBOSS 4.2
                      spallai Newbie

                      I am facing with a similar situation with java1.6.0_17 and JBoss [Zion] 4.0.3SP1. The stacktrace is as below

                       

                      0:51:58,601 ERROR [MainDeployer] Could not make local copy for file:/export/home/jboss/server/insight/deploy/ormGsxUpgradeIntf.jar
                      java.io.FileNotFoundException: /export/home/jboss/server/insight/tmp/deploy/tmp1896466099165637966ormGsxUpgradeIntf.jar (Too many open files)
                      at java.io.FileOutputStream.open(Native Method)
                      at java.io.FileOutputStream.<init>(Unknown Source)
                      at java.io.FileOutputStream.<init>(Unknown Source)
                      at org.jboss.deployment.MainDeployer.copy(MainDeployer.java:1206)
                      at org.jboss.deployment.MainDeployer.makeLocalCopy(MainDeployer.java:1151)
                      at org.jboss.deployment.MainDeployer.init(MainDeployer.java:822)
                      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:780)
                      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:753)
                      at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                      at java.lang.reflect.Method.invoke(Unknown Source)
                      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
                      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
                      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
                      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
                      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
                      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
                      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
                      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
                      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
                      at $Proxy9.deploy(Unknown Source)
                      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:319)
                      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:507)
                      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:192)
                      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:203)
                      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:182)
                      10:51:58,604 WARN  [JARDeployer] Failed to add deployable jar:

                       

                       

                      Any idea ...