I have had a working jsp web applicationg for the last 2 months.
All of a sudden, the application was not allowing users to log into it.
After monitoring the logs upon a manual restart of glassfish, I saw the log output below:

[#|2011-06-25T15:58:55.376+0300|WARNING|glassfish3.0.1||_ThreadID=26;_ThreadName=Thread-1;|Error sending syslog packet
java.net.SocketException: Too many open files
at java.net.PlainDatagramSocketImpl.datagramSocketCreate(Native Method)
at java.net.PlainDatagramSocketImpl.create(PlainDatagramSocketImpl.java:73)
at java.net.DatagramSocket.createImpl(DatagramSocket.java:318)
at java.net.DatagramSocket.<init>(DatagramSocket.java:159)
at com.sun.enterprise.server.logging.Syslog.log(Syslog.java:77)
at com.sun.enterprise.server.logging.SyslogHandler.log(SyslogHandler.java:156)
at com.sun.enterprise.server.logging.SyslogHandler$1.run(SyslogHandler.java:103)
|#]

Can anyone please tell me why this is happening and suggest action that would eradicate this problem comprehensively.
Mind you, no changes in code have been effected.
Thanks

Recommended Answers

All 3 Replies

The system makes differntiation from an open file handle and an open socket handle. What seems to be happening here is that you are probably making a new socket connection for every communication transaction you are doing and then not closing them properly.

Guys, everything is a lot easier ) for every user and process pair linux has several restrictions(open files, pipe size, cpu time etc.) So open files limit is not big enough in your case.
to check your parameters use ulimit -a command. To change quantity of open files use ulimit -n wishedNumber command )
Good Luck!

Guys, everything is a lot easier ) for every user and process pair linux has several restrictions(open files, pipe size, cpu time etc.) So open files limit is not big enough in your case.
to check your parameters use ulimit -a command. To change quantity of open files use ulimit -n wishedNumber command )
Good Luck!

So? Too many open files? Then why is the error

"java.net.SocketException: Too many open files"

Notice that "net"? Notice that "SocketException"?

Edit: As I said, file handles apply to sockets and files, and just because you can increase limits, it doesn't mean you should.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.