You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by Michael Weissenbacher <mw...@dermichi.com> on 2007/09/27 17:47:52 UTC

Exception opening socket: null

Hi List,
today one of my JAMES installations developed an interesting (and annoying!)
behavior. It works perfectly for hours, but suddendly this stack trace appears
in the smtpserver log file:
**********
27/09/07 15:24:53 INFO  smtpserver: Connection from nospamv3.net4you.at (127.0.0.1)
27/09/07 15:24:53 ERROR smtpserver: Exception opening socket: null
java.lang.NullPointerException
        at java.io.SequenceInputStream.read(SequenceInputStream.java)
        at java.io.SequenceInputStream.read(SequenceInputStream.java:152)
        at
org.apache.james.core.MimeMessageInputStreamSource.<init>(MimeMessageInputStreamSource.java:78)
        at org.apache.james.core.MailImpl.<init>(MailImpl.java:181)
        at
org.apache.james.smtpserver.DataCmdHandler.processMail(DataCmdHandler.java:266)
        at
org.apache.james.smtpserver.DataCmdHandler.doDATA(DataCmdHandler.java:133)
        at
org.apache.james.smtpserver.DataCmdHandler.onCommand(DataCmdHandler.java:81)
        at
org.apache.james.smtpserver.SMTPHandler.handleConnection(SMTPHandler.java:393)
        at
org.apache.james.util.connection.ServerConnection$ClientConnectionRunner.run(ServerConnection.java:432)
        at
org.apache.excalibur.thread.impl.ExecutableRunnable.execute(ExecutableRunnable.java:55)
        at org.apache.excalibur.thread.impl.WorkerThread.run(WorkerThread.java:116)
**********

>From this moment no more mail gets spooled or delivered. JAMES still listens on
port 25 and accepts mails but it closes the connection prematurely. At the
moment i have no other option as to constantly check for the exception and
restart JAMES afterwards. Then it works fine again. Sadly, I haven't yet found a
pattern or a reproducable test case.

At this point I don't have a clue what could cause this problem. Maybe there are
just too many sockets open? I am using JAMES 2.3.1 and I never had this problem
with 2.3.0. This doesn't mean that it wouldn't also occur with 2.3.0, but this
is a productive system and I don't like the idea of downgrading just for testing
things out.

I can provide more background information if needed.

Maybe someone can point me in the right direction?

many thanks,
Michael

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Exception opening socket: null

Posted by Michael Weissenbacher <mw...@dermichi.com>.
Hi,
> I've seen something like this before but I can't remember if I did
> anything to fix it or if the sending side just gave up after awhile.  It
> may be trying to send a huge message and the JVM is running out of
> memory.  I have:
> 
> PHOENIX_JVM_OPTS="-Xms512m -Xmx512m"
> export PHOENIX_JVM_OPTS
Well, I have -Xmx1024M and java used like 200MB when this happened.

> I really don't know anything about net4you (do you receive a lot of mail
> from them?) but you could block it's ip for a while until it gives up
> with something like:
Well, since this is net4you's mail server that wouldn't be such a great idea :)

Michael

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Exception opening socket: null

Posted by Bud Bach <ww...@ameritech.net>.
I've seen something like this before but I can't remember if I did 
anything to fix it or if the sending side just gave up after awhile.  It 
may be trying to send a huge message and the JVM is running out of 
memory.  I have:

PHOENIX_JVM_OPTS="-Xms512m -Xmx512m"
export PHOENIX_JVM_OPTS

in my james startup file to increase the JVM memory.  If that doesn't 
work...

I really don't know anything about net4you (do you receive a lot of mail 
from them?) but you could block it's ip for a while until it gives up 
with something like:

# route add $IP lo

where $IP is the IP of the host you want to block.  Unblock it later 
with something like:

# route del $IP lo

-- Bud

Michael Weissenbacher wrote:
> Hi List,
> today one of my JAMES installations developed an interesting (and annoying!)
> behavior. It works perfectly for hours, but suddendly this stack trace appears
> in the smtpserver log file:
> **********
> 27/09/07 15:24:53 INFO  smtpserver: Connection from nospamv3.net4you.at (127.0.0.1)
> 27/09/07 15:24:53 ERROR smtpserver: Exception opening socket: null
> java.lang.NullPointerException
>         at java.io.SequenceInputStream.read(SequenceInputStream.java)
>         at java.io.SequenceInputStream.read(SequenceInputStream.java:152)
>         at
> org.apache.james.core.MimeMessageInputStreamSource.<init>(MimeMessageInputStreamSource.java:78)
>         at org.apache.james.core.MailImpl.<init>(MailImpl.java:181)
>         at
> org.apache.james.smtpserver.DataCmdHandler.processMail(DataCmdHandler.java:266)
>         at
> org.apache.james.smtpserver.DataCmdHandler.doDATA(DataCmdHandler.java:133)
>         at
> org.apache.james.smtpserver.DataCmdHandler.onCommand(DataCmdHandler.java:81)
>         at
> org.apache.james.smtpserver.SMTPHandler.handleConnection(SMTPHandler.java:393)
>         at
> org.apache.james.util.connection.ServerConnection$ClientConnectionRunner.run(ServerConnection.java:432)
>         at
> org.apache.excalibur.thread.impl.ExecutableRunnable.execute(ExecutableRunnable.java:55)
>         at org.apache.excalibur.thread.impl.WorkerThread.run(WorkerThread.java:116)
> **********
>
> >From this moment no more mail gets spooled or delivered. JAMES still listens on
> port 25 and accepts mails but it closes the connection prematurely. At the
> moment i have no other option as to constantly check for the exception and
> restart JAMES afterwards. Then it works fine again. Sadly, I haven't yet found a
> pattern or a reproducable test case.
>
> At this point I don't have a clue what could cause this problem. Maybe there are
> just too many sockets open? I am using JAMES 2.3.1 and I never had this problem
> with 2.3.0. This doesn't mean that it wouldn't also occur with 2.3.0, but this
> is a productive system and I don't like the idea of downgrading just for testing
> things out.
>
> I can provide more background information if needed.
>
> Maybe someone can point me in the right direction?
>
> many thanks,
> Michael
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
>
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: J need some help about the file config.xml

Posted by ka...@laposte.net.
???
----- Original Message ----- 
From: <ka...@laposte.net>
To: "James Users List" <se...@james.apache.org>
Sent: Thursday, September 27, 2007 3:57 PM
Subject: J need some help about the file config.xml


hello,

J need some help about the file config.xml

and i dont know who i can get this !

please would you help me ?

thanks

Raymond Teissier



---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


J need some help about the file config.xml

Posted by ka...@laposte.net.
hello,

J need some help about the file config.xml

and i dont know who i can get this !

please would you help me ?

thanks

Raymond Teissier

Re: Exception opening socket: null

Posted by Stefano Bagnara <ap...@bago.org>.
Michael Weissenbacher ha scritto:
> Hi Stefano,
> another thing i just noticed: From the moment when JAMES stops working it starts
> leaving temp files behind, all with the size of 1 byte and with an "R" in it:
> -rw-r--r--  1 james james    1 2007-10-02 10:58 Mail1191315491538-1106053225.m64
> -rw-r--r--  1 james james    1 2007-10-02 10:58 Mail1191315494014-1106153226.m64
> -rw-r--r--  1 james james    1 2007-10-02 10:58 Mail1191315494842-1106253227.m64
> -rw-r--r--  1 james james    1 2007-10-02 10:58 Mail1191315495126-1106353228.m64
> -rw-r--r--  1 james james    1 2007-10-02 10:58 Mail1191315497469-1106453229.m64
> -rw-r--r--  1 james james    1 2007-10-02 10:58 Mail1191315497764-1106553230.m64
> -rw-r--r--  1 james james    1 2007-10-02 10:58 Mail1191315500399-1106653231.m64
> -rw-r--r--  1 james james    1 2007-10-02 10:58 Mail1191315504333-1106753232.m64
> -rw-r--r--  1 james james    1 2007-10-02 10:58 Mail1191315505194-1106853233.m64
> ...
> 
> # cat Mail1191315491538-1106053225.m64
> R
> 
> 
> What could this mean?

The "R" is probably the first letter that should be written to the
stream (the first letter of "Received").

Why this letter is succesfully written before the failure is a mistery
to me, yet.

Stefano

> thanks,
> Michael



---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Exception opening socket: null

Posted by Michael Weissenbacher <mw...@dermichi.com>.
Hi Stefano,
another thing i just noticed: From the moment when JAMES stops working it starts
leaving temp files behind, all with the size of 1 byte and with an "R" in it:
-rw-r--r--  1 james james    1 2007-10-02 10:58 Mail1191315491538-1106053225.m64
-rw-r--r--  1 james james    1 2007-10-02 10:58 Mail1191315494014-1106153226.m64
-rw-r--r--  1 james james    1 2007-10-02 10:58 Mail1191315494842-1106253227.m64
-rw-r--r--  1 james james    1 2007-10-02 10:58 Mail1191315495126-1106353228.m64
-rw-r--r--  1 james james    1 2007-10-02 10:58 Mail1191315497469-1106453229.m64
-rw-r--r--  1 james james    1 2007-10-02 10:58 Mail1191315497764-1106553230.m64
-rw-r--r--  1 james james    1 2007-10-02 10:58 Mail1191315500399-1106653231.m64
-rw-r--r--  1 james james    1 2007-10-02 10:58 Mail1191315504333-1106753232.m64
-rw-r--r--  1 james james    1 2007-10-02 10:58 Mail1191315505194-1106853233.m64
...

# cat Mail1191315491538-1106053225.m64
R


What could this mean?
thanks,
Michael

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Exception opening socket: null

Posted by Michael Weissenbacher <mw...@dermichi.com>.
Hi Stefano,
> this happens when the SMTP server receive a new mail from a remote
> client. When the DATA command is received the SMTP server opens a
> temporary file and start streaming the mail content to this file.
> 
> The "Exception opening socket: null" probably happens because the
> connection is no more available in the mean time
Just a guess: Maybe the problem is that JAMES can't open the temporary file.
Maybe somewhere files are left open until it hits some system limit?

Well, I tried delivering a mail manually with telnet. The connection is
definately closed prematurely by JAMES. Here is what happened:
*** snip ***
# telnet localhost 10025
Trying 127.0.0.1...
Connected to nospamv3.net4you.at.
Escape character is '^]'.
220 nospamv3 SMTP Server (JAMES SMTP Server 2.3.1) ready Fri, 28 Sep 2007
09:50:02 +0200 (CEST)
ehlo localhost
250-nospamv3 Hello localhost (nospamv3.net4you.at [127.0.0.1])
250-PIPELINING
250 ENHANCEDSTATUSCODES
mail from: <mw...@net4you.at>
250 2.1.0 Sender <mw...@net4you.at> OK
rcpt to: <mw...@net4you.at>
250 2.1.5 Recipient <mw...@net4you.at> OK
data
354 Ok Send data ending with <CRLF>.<CRLF>
subject: testing 123

testing
Connection closed by foreign host.
*** snip ***

> Often this kind of error is caused by something else going wrong, and it
> is difficult to track if nothing else can be found.
Well, i looked over the log files and couldn't find anything particularly
interesting (besides the exception). I can send them over to you privately if
you wanna analyze them yourself.

> From your message I understand that once James Server starts throwing
> this exception the only solution is to restart it because every
> connection ends in this exception raised, right?
Correct. After restarting everything is fine again.

> Can you run a "netstat -n" and a "jstack <jamespid>" when it happens, to
> understand what the server is doing and what are the active connections?
Will do this next time when the problem happens. I'll report back to the list then.

thanks,
Michael

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Exception opening socket: null

Posted by Michael Weissenbacher <mw...@dermichi.com>.
Hi,
> 
> Please tell us if the Sun JDK solved the issue or if you have the jstack
> output. I cannot think of anything else looking at the stacktrace and
> the netstat output...
Well, i switched to Sun JDK 1.5.0_13-b05 two days ago and the problem didnt't
happen again yet. If it does, I'm gonna post the jstack output. If it runs for
more than 1 week I guess it was a JVM specific problem.

thanks,
Michael

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Exception opening socket: null

Posted by Stefano Bagnara <ap...@bago.org>.
Michael Weissenbacher ha scritto:
> Unfortunately I cannot run jstack, since I'm using IBM JDK. I will now switch to
> Sun JDK and report back if i can get a jstack output.

Please tell us if the Sun JDK solved the issue or if you have the jstack
output. I cannot think of anything else looking at the stacktrace and
the netstat output...

Maybe you should investigate specific bugs in your JDK/OS (switching JDK
to SUN is a first step to be tried), before investigating further on the
code itself.

Stefano


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Exception opening socket: null

Posted by Michael Weissenbacher <mw...@dermichi.com>.
Hi Stefano,
> Can you run a "netstat -n" and a "jstack <jamespid>" when it happens, to
> understand what the server is doing and what are the active connections?
here is the netstat output:
*** snip ***
# netstat -nap|grep 10025
tcp        0      0 ::ffff:127.0.0.1:10025  :::*                    LISTEN
31286/java
tcp        0      0 ::ffff:127.0.0.1:10025  ::ffff:127.0.0.1:53498  TIME_WAIT
-
tcp        0      0 ::ffff:127.0.0.1:10025  ::ffff:127.0.0.1:53496  TIME_WAIT
-
*** snip ***

trying to deliver a mail to JAMES
*** snip ***
# telnet localhost 10025
Trying 127.0.0.1...
Connected to nospamv3.net4you.at.
Escape character is '^]'.
220 nospamv3 SMTP Server (JAMES SMTP Server 2.3.1) ready Tue, 2 Oct 2007
11:10:38 +0200 (CEST)
EHLO localhost
250-nospamv3 Hello localhost (nospamv3.net4you.at [127.0.0.1])
250-PIPELINING
250 ENHANCEDSTATUSCODES
MAIL FROM: <mw...@net4you.at>
250 2.1.0 Sender <mw...@net4you.at> OK
RCPT TO: <mw...@net4you.at>
250 2.1.5 Recipient <mw...@net4you.at> OK
DATA
354 Ok Send data ending with <CRLF>.<CRLF>
subject: testing 123

.
Connection closed by foreign host.
*** snip ***

accompaning log entry:
*** snip ***
02/10/07 11:11:39 INFO  smtpserver: Connection from nospamv3.net4you.at (127.0.0.1)
02/10/07 11:11:39 ERROR smtpserver: Exception opening socket: null
java.lang.NullPointerException
        at java.io.SequenceInputStream.read(SequenceInputStream.java)
        at java.io.SequenceInputStream.read(SequenceInputStream.java:152)
        at
org.apache.james.core.MimeMessageInputStreamSource.<init>(MimeMessageInputStreamSource.java:78)
        at org.apache.james.core.MailImpl.<init>(MailImpl.java:181)
        at
org.apache.james.smtpserver.DataCmdHandler.processMail(DataCmdHandler.java:266)
        at
org.apache.james.smtpserver.DataCmdHandler.doDATA(DataCmdHandler.java:133)
        at
org.apache.james.smtpserver.DataCmdHandler.onCommand(DataCmdHandler.java:81)
        at
org.apache.james.smtpserver.SMTPHandler.handleConnection(SMTPHandler.java:393)
        at
org.apache.james.util.connection.ServerConnection$ClientConnectionRunner.run(ServerConnection.java:432)
        at
org.apache.excalibur.thread.impl.ExecutableRunnable.execute(ExecutableRunnable.java:55)
        at org.apache.excalibur.thread.impl.WorkerThread.run(WorkerThread.java:116)
*** snip ***

Unfortunately I cannot run jstack, since I'm using IBM JDK. I will now switch to
Sun JDK and report back if i can get a jstack output.

thanks,
Michael

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Exception opening socket: null

Posted by Stefano Bagnara <ap...@bago.org>.
Hi Michael,

this happens when the SMTP server receive a new mail from a remote
client. When the DATA command is received the SMTP server opens a
temporary file and start streaming the mail content to this file.

The "Exception opening socket: null" probably happens because the
connection is no more available in the mean time.

Often this kind of error is caused by something else going wrong, and it
is difficult to track if nothing else can be found.

>From your message I understand that once James Server starts throwing
this exception the only solution is to restart it because every
connection ends in this exception raised, right?

Can you run a "netstat -n" and a "jstack <jamespid>" when it happens, to
understand what the server is doing and what are the active connections?

Stefano

Michael Weissenbacher ha scritto:
> Hi List,
> today one of my JAMES installations developed an interesting (and annoying!)
> behavior. It works perfectly for hours, but suddendly this stack trace appears
> in the smtpserver log file:
> **********
> 27/09/07 15:24:53 INFO  smtpserver: Connection from nospamv3.net4you.at (127.0.0.1)
> 27/09/07 15:24:53 ERROR smtpserver: Exception opening socket: null
> java.lang.NullPointerException
>         at java.io.SequenceInputStream.read(SequenceInputStream.java)
>         at java.io.SequenceInputStream.read(SequenceInputStream.java:152)
>         at
> org.apache.james.core.MimeMessageInputStreamSource.<init>(MimeMessageInputStreamSource.java:78)
>         at org.apache.james.core.MailImpl.<init>(MailImpl.java:181)
>         at
> org.apache.james.smtpserver.DataCmdHandler.processMail(DataCmdHandler.java:266)
>         at
> org.apache.james.smtpserver.DataCmdHandler.doDATA(DataCmdHandler.java:133)
>         at
> org.apache.james.smtpserver.DataCmdHandler.onCommand(DataCmdHandler.java:81)
>         at
> org.apache.james.smtpserver.SMTPHandler.handleConnection(SMTPHandler.java:393)
>         at
> org.apache.james.util.connection.ServerConnection$ClientConnectionRunner.run(ServerConnection.java:432)
>         at
> org.apache.excalibur.thread.impl.ExecutableRunnable.execute(ExecutableRunnable.java:55)
>         at org.apache.excalibur.thread.impl.WorkerThread.run(WorkerThread.java:116)
> **********
> 
>>>From this moment no more mail gets spooled or delivered. JAMES still listens on
> port 25 and accepts mails but it closes the connection prematurely. At the
> moment i have no other option as to constantly check for the exception and
> restart JAMES afterwards. Then it works fine again. Sadly, I haven't yet found a
> pattern or a reproducable test case.
> 
> At this point I don't have a clue what could cause this problem. Maybe there are
> just too many sockets open? I am using JAMES 2.3.1 and I never had this problem
> with 2.3.0. This doesn't mean that it wouldn't also occur with 2.3.0, but this
> is a productive system and I don't like the idea of downgrading just for testing
> things out.
> 
> I can provide more background information if needed.
> 
> Maybe someone can point me in the right direction?
> 
> many thanks,
> Michael



---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org