You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Matthew Phillips (JIRA)" <ji...@apache.org> on 2007/09/07 05:12:28 UTC

[jira] Created: (DIRMINA-435) NullPointerException in IoServiceListenerSupport

NullPointerException in IoServiceListenerSupport
------------------------------------------------

                 Key: DIRMINA-435
                 URL: https://issues.apache.org/jira/browse/DIRMINA-435
             Project: MINA
          Issue Type: Bug
          Components: Core
    Affects Versions: 1.1.2
         Environment: WinXP SP 2
java version "1.5.0_11"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode, sharing)
            Reporter: Matthew Phillips


This is an odd one, since it occurs on WinXP and not on Mac OS X. The error was seen under 1.5, but also occurs on 1.6. I see the following NPE :

-----
Exception trace:
java.lang.NullPointerException
	at java.util.concurrent.ConcurrentHashMap.hash(Unknown Source)
	at java.util.concurrent.ConcurrentHashMap.putIfAbsent(Unknown Source)
	at org.apache.mina.common.support.IoServiceListenerSupport.fireSessionCreated(IoServiceListenerSupport.java:152)
	at org.apache.mina.transport.socket.nio.SocketIoProcessor.doAddNew(SocketIoProcessor.java:135)
	at org.apache.mina.transport.socket.nio.SocketIoProcessor.access$300(SocketIoProcessor.java:44)
	at org.apache.mina.transport.socket.nio.SocketIoProcessor$Worker.run(SocketIoProcessor.java:444)
	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:39)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
------

The NPE is being caused by IoSession.getServiceAddress () returning null, which then bombs the attempt to use it as a key in the map (IoServiceListenerSupport:151):

       SocketAddress serviceAddress = session.getServiceAddress(); // null

        // Get the session set.
        Set<IoSession> s = new IdentityHashSet<IoSession>();
        Set<IoSession> sessions = managedSessions.putIfAbsent(serviceAddress,
                Collections.synchronizedSet(s));

This has me stumped. Can anyone help?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (DIRMINA-435) NullPointerException in IoServiceListenerSupport

Posted by "Trustin Lee (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRMINA-435?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Trustin Lee resolved DIRMINA-435.
---------------------------------

    Resolution: Fixed

> NullPointerException in IoServiceListenerSupport
> ------------------------------------------------
>
>                 Key: DIRMINA-435
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-435
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.1.0, 1.0.4, 1.1.1, 1.0.5, 1.1.2, 1.0.6, 1.1.3, 1.0.7, 1.1.4, 1.0.8, 1.1.5
>         Environment: WinXP SP 2
> java version "1.5.0_11"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
> Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode, sharing)
>            Reporter: Matthew Phillips
>            Assignee: Trustin Lee
>             Fix For: 1.0.9, 1.1.6
>
>         Attachments: mina.patch
>
>
> This is an odd one, since it occurs on WinXP and not on Mac OS X. The error was seen under 1.5, but also occurs on 1.6. I see the following NPE :
> -----
> Exception trace:
> java.lang.NullPointerException
> 	at java.util.concurrent.ConcurrentHashMap.hash(Unknown Source)
> 	at java.util.concurrent.ConcurrentHashMap.putIfAbsent(Unknown Source)
> 	at org.apache.mina.common.support.IoServiceListenerSupport.fireSessionCreated(IoServiceListenerSupport.java:152)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor.doAddNew(SocketIoProcessor.java:135)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor.access$300(SocketIoProcessor.java:44)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor$Worker.run(SocketIoProcessor.java:444)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:39)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> 	at java.lang.Thread.run(Unknown Source)
> ------
> The NPE is being caused by IoSession.getServiceAddress () returning null, which then bombs the attempt to use it as a key in the map (IoServiceListenerSupport:151):
>        SocketAddress serviceAddress = session.getServiceAddress(); // null
>         // Get the session set.
>         Set<IoSession> s = new IdentityHashSet<IoSession>();
>         Set<IoSession> sessions = managedSessions.putIfAbsent(serviceAddress,
>                 Collections.synchronizedSet(s));
> This has me stumped. Can anyone help?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-435) NullPointerException in IoServiceListenerSupport

Posted by "Matthew Phillips (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-435?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12527680 ] 

Matthew Phillips commented on DIRMINA-435:
------------------------------------------

Actually, a better way to do this would be to run just the test that I'm seeing fail.

If you do an svn update and run "cd java/server && ant test-federation" (note directory has changed since last time) and see what happens.


> NullPointerException in IoServiceListenerSupport
> ------------------------------------------------
>
>                 Key: DIRMINA-435
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-435
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.1.2
>         Environment: WinXP SP 2
> java version "1.5.0_11"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
> Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode, sharing)
>            Reporter: Matthew Phillips
>
> This is an odd one, since it occurs on WinXP and not on Mac OS X. The error was seen under 1.5, but also occurs on 1.6. I see the following NPE :
> -----
> Exception trace:
> java.lang.NullPointerException
> 	at java.util.concurrent.ConcurrentHashMap.hash(Unknown Source)
> 	at java.util.concurrent.ConcurrentHashMap.putIfAbsent(Unknown Source)
> 	at org.apache.mina.common.support.IoServiceListenerSupport.fireSessionCreated(IoServiceListenerSupport.java:152)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor.doAddNew(SocketIoProcessor.java:135)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor.access$300(SocketIoProcessor.java:44)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor$Worker.run(SocketIoProcessor.java:444)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:39)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> 	at java.lang.Thread.run(Unknown Source)
> ------
> The NPE is being caused by IoSession.getServiceAddress () returning null, which then bombs the attempt to use it as a key in the map (IoServiceListenerSupport:151):
>        SocketAddress serviceAddress = session.getServiceAddress(); // null
>         // Get the session set.
>         Set<IoSession> s = new IdentityHashSet<IoSession>();
>         Set<IoSession> sessions = managedSessions.putIfAbsent(serviceAddress,
>                 Collections.synchronizedSet(s));
> This has me stumped. Can anyone help?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-435) NullPointerException in IoServiceListenerSupport

Posted by "Trustin Lee (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-435?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12548460 ] 

Trustin Lee commented on DIRMINA-435:
-------------------------------------

That's great!  Thanks again for your help.

> NullPointerException in IoServiceListenerSupport
> ------------------------------------------------
>
>                 Key: DIRMINA-435
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-435
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.1.0, 1.0.4, 1.1.1, 1.0.5, 1.1.2, 1.0.6, 1.1.3, 1.0.7, 1.1.4, 1.0.8, 1.1.5
>         Environment: WinXP SP 2
> java version "1.5.0_11"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
> Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode, sharing)
>            Reporter: Matthew Phillips
>            Assignee: Trustin Lee
>             Fix For: 1.0.9, 1.1.6
>
>         Attachments: mina.patch
>
>
> This is an odd one, since it occurs on WinXP and not on Mac OS X. The error was seen under 1.5, but also occurs on 1.6. I see the following NPE :
> -----
> Exception trace:
> java.lang.NullPointerException
> 	at java.util.concurrent.ConcurrentHashMap.hash(Unknown Source)
> 	at java.util.concurrent.ConcurrentHashMap.putIfAbsent(Unknown Source)
> 	at org.apache.mina.common.support.IoServiceListenerSupport.fireSessionCreated(IoServiceListenerSupport.java:152)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor.doAddNew(SocketIoProcessor.java:135)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor.access$300(SocketIoProcessor.java:44)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor$Worker.run(SocketIoProcessor.java:444)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:39)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> 	at java.lang.Thread.run(Unknown Source)
> ------
> The NPE is being caused by IoSession.getServiceAddress () returning null, which then bombs the attempt to use it as a key in the map (IoServiceListenerSupport:151):
>        SocketAddress serviceAddress = session.getServiceAddress(); // null
>         // Get the session set.
>         Set<IoSession> s = new IdentityHashSet<IoSession>();
>         Set<IoSession> sessions = managedSessions.putIfAbsent(serviceAddress,
>                 Collections.synchronizedSet(s));
> This has me stumped. Can anyone help?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DIRMINA-435) NullPointerException in IoServiceListenerSupport

Posted by "Trustin Lee (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRMINA-435?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Trustin Lee updated DIRMINA-435:
--------------------------------

        Fix Version/s: 1.1.6
                       1.0.9
             Assignee: Trustin Lee
    Affects Version/s: 1.0.0
                       1.0.1
                       1.0.2
                       1.0.3
                       1.1.0
                       1.0.4
                       1.1.1
                       1.0.5
                       1.0.6
                       1.1.3
                       1.0.7
                       1.1.4
                       1.0.8
                       1.1.5

> NullPointerException in IoServiceListenerSupport
> ------------------------------------------------
>
>                 Key: DIRMINA-435
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-435
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.1.0, 1.0.4, 1.1.1, 1.0.5, 1.1.2, 1.0.6, 1.1.3, 1.0.7, 1.1.4, 1.0.8, 1.1.5
>         Environment: WinXP SP 2
> java version "1.5.0_11"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
> Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode, sharing)
>            Reporter: Matthew Phillips
>            Assignee: Trustin Lee
>             Fix For: 1.0.9, 1.1.6
>
>         Attachments: mina.patch
>
>
> This is an odd one, since it occurs on WinXP and not on Mac OS X. The error was seen under 1.5, but also occurs on 1.6. I see the following NPE :
> -----
> Exception trace:
> java.lang.NullPointerException
> 	at java.util.concurrent.ConcurrentHashMap.hash(Unknown Source)
> 	at java.util.concurrent.ConcurrentHashMap.putIfAbsent(Unknown Source)
> 	at org.apache.mina.common.support.IoServiceListenerSupport.fireSessionCreated(IoServiceListenerSupport.java:152)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor.doAddNew(SocketIoProcessor.java:135)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor.access$300(SocketIoProcessor.java:44)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor$Worker.run(SocketIoProcessor.java:444)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:39)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> 	at java.lang.Thread.run(Unknown Source)
> ------
> The NPE is being caused by IoSession.getServiceAddress () returning null, which then bombs the attempt to use it as a key in the map (IoServiceListenerSupport:151):
>        SocketAddress serviceAddress = session.getServiceAddress(); // null
>         // Get the session set.
>         Set<IoSession> s = new IdentityHashSet<IoSession>();
>         Set<IoSession> sessions = managedSessions.putIfAbsent(serviceAddress,
>                 Collections.synchronizedSet(s));
> This has me stumped. Can anyone help?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-435) NullPointerException in IoServiceListenerSupport

Posted by "Matthew Phillips (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-435?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12527062 ] 

Matthew Phillips commented on DIRMINA-435:
------------------------------------------

Sorry, it seems I've broken the tests, I'm seeing that intermittently too. Let me see if I can fix those first.

I was under the impression the NPE was being caused by using a null key in the hash map: calling hash () on that was causing the exception. Since there are no line numbers, that was only my best guess though. You think it was something else?

> NullPointerException in IoServiceListenerSupport
> ------------------------------------------------
>
>                 Key: DIRMINA-435
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-435
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.1.2
>         Environment: WinXP SP 2
> java version "1.5.0_11"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
> Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode, sharing)
>            Reporter: Matthew Phillips
>
> This is an odd one, since it occurs on WinXP and not on Mac OS X. The error was seen under 1.5, but also occurs on 1.6. I see the following NPE :
> -----
> Exception trace:
> java.lang.NullPointerException
> 	at java.util.concurrent.ConcurrentHashMap.hash(Unknown Source)
> 	at java.util.concurrent.ConcurrentHashMap.putIfAbsent(Unknown Source)
> 	at org.apache.mina.common.support.IoServiceListenerSupport.fireSessionCreated(IoServiceListenerSupport.java:152)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor.doAddNew(SocketIoProcessor.java:135)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor.access$300(SocketIoProcessor.java:44)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor$Worker.run(SocketIoProcessor.java:444)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:39)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> 	at java.lang.Thread.run(Unknown Source)
> ------
> The NPE is being caused by IoSession.getServiceAddress () returning null, which then bombs the attempt to use it as a key in the map (IoServiceListenerSupport:151):
>        SocketAddress serviceAddress = session.getServiceAddress(); // null
>         // Get the session set.
>         Set<IoSession> s = new IdentityHashSet<IoSession>();
>         Set<IoSession> sessions = managedSessions.putIfAbsent(serviceAddress,
>                 Collections.synchronizedSet(s));
> This has me stumped. Can anyone help?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-435) NullPointerException in IoServiceListenerSupport

Posted by "Matthew Phillips (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-435?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12525636 ] 

Matthew Phillips commented on DIRMINA-435:
------------------------------------------

It is reproducible, and happens all the time, no significant load.

I don't even know where to begin trying to create a test case, but if you're willing to grab the project from SVN at https://avis.svn.sourceforge.net/svnroot/avis/trunk and run the test case in server/src/test/org/avis/federation/JUTestFederation.java  (JUnit 4.1), you should find it fails on WinXP. If you have ant 1.7, "cd server && ant tests" will do it (I'm running it in JUnit under Eclipse).

I've run the exact same test on Mac OS X on both a G4 Powerbook and an Intel Mac Pro, and it runs fine there. It also runs on an (old'ish) FC3 Linux box.

Like I said, very odd.

> NullPointerException in IoServiceListenerSupport
> ------------------------------------------------
>
>                 Key: DIRMINA-435
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-435
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.1.2
>         Environment: WinXP SP 2
> java version "1.5.0_11"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
> Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode, sharing)
>            Reporter: Matthew Phillips
>
> This is an odd one, since it occurs on WinXP and not on Mac OS X. The error was seen under 1.5, but also occurs on 1.6. I see the following NPE :
> -----
> Exception trace:
> java.lang.NullPointerException
> 	at java.util.concurrent.ConcurrentHashMap.hash(Unknown Source)
> 	at java.util.concurrent.ConcurrentHashMap.putIfAbsent(Unknown Source)
> 	at org.apache.mina.common.support.IoServiceListenerSupport.fireSessionCreated(IoServiceListenerSupport.java:152)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor.doAddNew(SocketIoProcessor.java:135)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor.access$300(SocketIoProcessor.java:44)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor$Worker.run(SocketIoProcessor.java:444)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:39)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> 	at java.lang.Thread.run(Unknown Source)
> ------
> The NPE is being caused by IoSession.getServiceAddress () returning null, which then bombs the attempt to use it as a key in the map (IoServiceListenerSupport:151):
>        SocketAddress serviceAddress = session.getServiceAddress(); // null
>         // Get the session set.
>         Set<IoSession> s = new IdentityHashSet<IoSession>();
>         Set<IoSession> sessions = managedSessions.putIfAbsent(serviceAddress,
>                 Collections.synchronizedSet(s));
> This has me stumped. Can anyone help?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-435) NullPointerException in IoServiceListenerSupport

Posted by "Trustin Lee (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-435?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12527048 ] 

Trustin Lee commented on DIRMINA-435:
-------------------------------------

What's really odd is that the NPE is thrown from ConcurrentHashMap.hash().  The hash() method has nowhere to throw such an exception because its purely an arithmetic function.  If the returned IoSession is null, the NPE should be thrown from putIfAbsent() method.

Could you try to upgrade the JRE?  Let me run the tests too soon.





> NullPointerException in IoServiceListenerSupport
> ------------------------------------------------
>
>                 Key: DIRMINA-435
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-435
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.1.2
>         Environment: WinXP SP 2
> java version "1.5.0_11"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
> Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode, sharing)
>            Reporter: Matthew Phillips
>
> This is an odd one, since it occurs on WinXP and not on Mac OS X. The error was seen under 1.5, but also occurs on 1.6. I see the following NPE :
> -----
> Exception trace:
> java.lang.NullPointerException
> 	at java.util.concurrent.ConcurrentHashMap.hash(Unknown Source)
> 	at java.util.concurrent.ConcurrentHashMap.putIfAbsent(Unknown Source)
> 	at org.apache.mina.common.support.IoServiceListenerSupport.fireSessionCreated(IoServiceListenerSupport.java:152)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor.doAddNew(SocketIoProcessor.java:135)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor.access$300(SocketIoProcessor.java:44)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor$Worker.run(SocketIoProcessor.java:444)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:39)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> 	at java.lang.Thread.run(Unknown Source)
> ------
> The NPE is being caused by IoSession.getServiceAddress () returning null, which then bombs the attempt to use it as a key in the map (IoServiceListenerSupport:151):
>        SocketAddress serviceAddress = session.getServiceAddress(); // null
>         // Get the session set.
>         Set<IoSession> s = new IdentityHashSet<IoSession>();
>         Set<IoSession> sessions = managedSessions.putIfAbsent(serviceAddress,
>                 Collections.synchronizedSet(s));
> This has me stumped. Can anyone help?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DIRMINA-435) NullPointerException in IoServiceListenerSupport

Posted by "Matthew Phillips (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRMINA-435?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matthew Phillips updated DIRMINA-435:
-------------------------------------

    Attachment: mina.patch

Patch to fix SocketConnector.

> NullPointerException in IoServiceListenerSupport
> ------------------------------------------------
>
>                 Key: DIRMINA-435
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-435
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.1.2
>         Environment: WinXP SP 2
> java version "1.5.0_11"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
> Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode, sharing)
>            Reporter: Matthew Phillips
>         Attachments: mina.patch
>
>
> This is an odd one, since it occurs on WinXP and not on Mac OS X. The error was seen under 1.5, but also occurs on 1.6. I see the following NPE :
> -----
> Exception trace:
> java.lang.NullPointerException
> 	at java.util.concurrent.ConcurrentHashMap.hash(Unknown Source)
> 	at java.util.concurrent.ConcurrentHashMap.putIfAbsent(Unknown Source)
> 	at org.apache.mina.common.support.IoServiceListenerSupport.fireSessionCreated(IoServiceListenerSupport.java:152)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor.doAddNew(SocketIoProcessor.java:135)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor.access$300(SocketIoProcessor.java:44)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor$Worker.run(SocketIoProcessor.java:444)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:39)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> 	at java.lang.Thread.run(Unknown Source)
> ------
> The NPE is being caused by IoSession.getServiceAddress () returning null, which then bombs the attempt to use it as a key in the map (IoServiceListenerSupport:151):
>        SocketAddress serviceAddress = session.getServiceAddress(); // null
>         // Get the session set.
>         Set<IoSession> s = new IdentityHashSet<IoSession>();
>         Set<IoSession> sessions = managedSessions.putIfAbsent(serviceAddress,
>                 Collections.synchronizedSet(s));
> This has me stumped. Can anyone help?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (DIRMINA-435) NullPointerException in IoServiceListenerSupport

Posted by "Trustin Lee (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRMINA-435?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Trustin Lee closed DIRMINA-435.
-------------------------------


> NullPointerException in IoServiceListenerSupport
> ------------------------------------------------
>
>                 Key: DIRMINA-435
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-435
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.1.0, 1.0.4, 1.1.1, 1.0.5, 1.1.2, 1.0.6, 1.1.3, 1.0.7, 1.1.4, 1.0.8, 1.1.5
>         Environment: WinXP SP 2
> java version "1.5.0_11"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
> Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode, sharing)
>            Reporter: Matthew Phillips
>            Assignee: Trustin Lee
>             Fix For: 1.0.9, 1.1.6
>
>         Attachments: mina.patch
>
>
> This is an odd one, since it occurs on WinXP and not on Mac OS X. The error was seen under 1.5, but also occurs on 1.6. I see the following NPE :
> -----
> Exception trace:
> java.lang.NullPointerException
> 	at java.util.concurrent.ConcurrentHashMap.hash(Unknown Source)
> 	at java.util.concurrent.ConcurrentHashMap.putIfAbsent(Unknown Source)
> 	at org.apache.mina.common.support.IoServiceListenerSupport.fireSessionCreated(IoServiceListenerSupport.java:152)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor.doAddNew(SocketIoProcessor.java:135)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor.access$300(SocketIoProcessor.java:44)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor$Worker.run(SocketIoProcessor.java:444)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:39)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> 	at java.lang.Thread.run(Unknown Source)
> ------
> The NPE is being caused by IoSession.getServiceAddress () returning null, which then bombs the attempt to use it as a key in the map (IoServiceListenerSupport:151):
>        SocketAddress serviceAddress = session.getServiceAddress(); // null
>         // Get the session set.
>         Set<IoSession> s = new IdentityHashSet<IoSession>();
>         Set<IoSession> sessions = managedSessions.putIfAbsent(serviceAddress,
>                 Collections.synchronizedSet(s));
> This has me stumped. Can anyone help?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-435) NullPointerException in IoServiceListenerSupport

Posted by "Matthew Phillips (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-435?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12548459 ] 

Matthew Phillips commented on DIRMINA-435:
------------------------------------------

Thanks Trustin, the fix in the 1.1 branch works fine.

> NullPointerException in IoServiceListenerSupport
> ------------------------------------------------
>
>                 Key: DIRMINA-435
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-435
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.1.0, 1.0.4, 1.1.1, 1.0.5, 1.1.2, 1.0.6, 1.1.3, 1.0.7, 1.1.4, 1.0.8, 1.1.5
>         Environment: WinXP SP 2
> java version "1.5.0_11"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
> Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode, sharing)
>            Reporter: Matthew Phillips
>            Assignee: Trustin Lee
>             Fix For: 1.0.9, 1.1.6
>
>         Attachments: mina.patch
>
>
> This is an odd one, since it occurs on WinXP and not on Mac OS X. The error was seen under 1.5, but also occurs on 1.6. I see the following NPE :
> -----
> Exception trace:
> java.lang.NullPointerException
> 	at java.util.concurrent.ConcurrentHashMap.hash(Unknown Source)
> 	at java.util.concurrent.ConcurrentHashMap.putIfAbsent(Unknown Source)
> 	at org.apache.mina.common.support.IoServiceListenerSupport.fireSessionCreated(IoServiceListenerSupport.java:152)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor.doAddNew(SocketIoProcessor.java:135)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor.access$300(SocketIoProcessor.java:44)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor$Worker.run(SocketIoProcessor.java:444)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:39)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> 	at java.lang.Thread.run(Unknown Source)
> ------
> The NPE is being caused by IoSession.getServiceAddress () returning null, which then bombs the attempt to use it as a key in the map (IoServiceListenerSupport:151):
>        SocketAddress serviceAddress = session.getServiceAddress(); // null
>         // Get the session set.
>         Set<IoSession> s = new IdentityHashSet<IoSession>();
>         Set<IoSession> sessions = managedSessions.putIfAbsent(serviceAddress,
>                 Collections.synchronizedSet(s));
> This has me stumped. Can anyone help?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-435) NullPointerException in IoServiceListenerSupport

Posted by "Trustin Lee (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-435?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12548147 ] 

Trustin Lee commented on DIRMINA-435:
-------------------------------------

Hi Matthew, thanks for tracking down this problem for us.  I really appreciate it.  I have made some change in SocketConnector so it doesn't create a session as long as finishConnect() returns false.  Please check out the latest source code, give it a try and let me know if it fixes your problem or not, because my fix is different from yours.

> NullPointerException in IoServiceListenerSupport
> ------------------------------------------------
>
>                 Key: DIRMINA-435
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-435
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.1.2
>         Environment: WinXP SP 2
> java version "1.5.0_11"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
> Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode, sharing)
>            Reporter: Matthew Phillips
>         Attachments: mina.patch
>
>
> This is an odd one, since it occurs on WinXP and not on Mac OS X. The error was seen under 1.5, but also occurs on 1.6. I see the following NPE :
> -----
> Exception trace:
> java.lang.NullPointerException
> 	at java.util.concurrent.ConcurrentHashMap.hash(Unknown Source)
> 	at java.util.concurrent.ConcurrentHashMap.putIfAbsent(Unknown Source)
> 	at org.apache.mina.common.support.IoServiceListenerSupport.fireSessionCreated(IoServiceListenerSupport.java:152)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor.doAddNew(SocketIoProcessor.java:135)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor.access$300(SocketIoProcessor.java:44)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor$Worker.run(SocketIoProcessor.java:444)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:39)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> 	at java.lang.Thread.run(Unknown Source)
> ------
> The NPE is being caused by IoSession.getServiceAddress () returning null, which then bombs the attempt to use it as a key in the map (IoServiceListenerSupport:151):
>        SocketAddress serviceAddress = session.getServiceAddress(); // null
>         // Get the session set.
>         Set<IoSession> s = new IdentityHashSet<IoSession>();
>         Set<IoSession> sessions = managedSessions.putIfAbsent(serviceAddress,
>                 Collections.synchronizedSet(s));
> This has me stumped. Can anyone help?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-435) NullPointerException in IoServiceListenerSupport

Posted by "Trustin Lee (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-435?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12527054 ] 

Trustin Lee commented on DIRMINA-435:
-------------------------------------

I can't reproduce the problem due to some test problem.  

trustin@primary:~/workspace/checkout/avis/java/server$ ant testsBuildfile: build.xml

compile:

compile:

compile-main:

compile-tests:

compile:

compile-main:

compile-tests:

compile:

tests:

tests:
    [junit] Running org.avis.config.JUTestOptions
    [junit] Testsuite: org.avis.config.JUTestOptions
    [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.036 sec
    [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.036 sec
    [junit] 
    [junit] Testcase: basic took 0.013 sec
    [junit] Testcase: caseIndependence took 0.001 sec
    [junit] Testcase: units took 0.001 sec
    [junit] Testcase: multipleInherit took 0.001 sec
    [junit] Running org.avis.federation.JUTestAstXdrCoding
    [junit] Testsuite: org.avis.federation.JUTestAstXdrCoding
    [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.075 sec
    [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.075 sec
    [junit] 
    [junit] Testcase: astIO took 0.059 sec
    [junit] Running org.avis.federation.JUTestFederation
    [junit] Testsuite: org.avis.federation.JUTestFederation
    [junit] Tests run: 7, Failures: 0, Errors: 5, Time elapsed: 1.54 sec
    [junit] Tests run: 7, Failures: 0, Errors: 5, Time elapsed: 1.54 sec
    [junit] ------------- Standard Output ---------------
    [junit] 오후 6:59:28: Info: Federation incoming link established with "primary/127.0.0.1", remote server domain "server1", federation class "null"
    [junit] 오후 6:59:28: Info: Federation outgoing link for ewaf://localhost:29171 established with "primary/127.0.0.1", remote server domain "server2"
    [junit] 오후 6:59:28: Info: Federation link for ewaf://localhost:29171 with "primary/127.0.0.1" disconnected
    [junit] 오후 6:59:28: Info: Federation link with "primary/127.0.0.1" disconnected
    [junit] ------------- ---------------- ---------------
    [junit] 
    [junit] Testcase: security took 1.455 sec
    [junit] Testcase: connectTimeout took 0.006 sec
    [junit]     Caused an ERROR
    [junit] Address already in use
    [junit] java.net.BindException: Address already in use
    [junit]     at sun.nio.ch.Net.bind(Native Method)
    [junit]     at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:119)
    [junit]     at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
    [junit]     at org.apache.mina.transport.socket.nio.SocketAcceptor.registerNew(SocketAcceptor.java:400)
    [junit]     at org.apache.mina.transport.socket.nio.SocketAcceptor.access$900(SocketAcceptor.java:55)
    [junit]     at org.apache.mina.transport.socket.nio.SocketAcceptor$Worker.run(SocketAcceptor.java:235)
    [junit]     at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:43)
    [junit]     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
    [junit]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    [junit]     at java.lang.Thread.run(Thread.java:619)
    [junit] 
    [junit] Testcase: uri took 0.013 sec
    [junit] Testcase: basic took 0.005 sec
    [junit]     Caused an ERROR
    [junit] Address already in use
    [junit] java.net.BindException: Address already in use
    [junit]     at sun.nio.ch.Net.bind(Native Method)
    [junit]     at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:119)
    [junit]     at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
    [junit]     at org.apache.mina.transport.socket.nio.SocketAcceptor.registerNew(SocketAcceptor.java:400)
    [junit]     at org.apache.mina.transport.socket.nio.SocketAcceptor.access$900(SocketAcceptor.java:55)
    [junit]     at org.apache.mina.transport.socket.nio.SocketAcceptor$Worker.run(SocketAcceptor.java:235)
    [junit]     at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:43)
    [junit]     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
    [junit]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    [junit]     at java.lang.Thread.run(Thread.java:619)
    [junit] 
    [junit] Testcase: addAttributes took 0.007 sec
    [junit]     Caused an ERROR
    [junit] Address already in use
    [junit] java.net.BindException: Address already in use
    [junit]     at sun.nio.ch.Net.bind(Native Method)
    [junit]     at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:119)
    [junit]     at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
    [junit]     at org.apache.mina.transport.socket.nio.SocketAcceptor.registerNew(SocketAcceptor.java:400)
    [junit]     at org.apache.mina.transport.socket.nio.SocketAcceptor.access$900(SocketAcceptor.java:55)
    [junit]     at org.apache.mina.transport.socket.nio.SocketAcceptor$Worker.run(SocketAcceptor.java:235)
    [junit]     at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:43)
    [junit]     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
    [junit]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    [junit]     at java.lang.Thread.run(Thread.java:619)
    [junit] 
    [junit] Testcase: reconnect took 0.004 sec
    [junit]     Caused an ERROR
    [junit] Address already in use
    [junit] java.net.BindException: Address already in use
    [junit]     at sun.nio.ch.Net.bind(Native Method)
    [junit]     at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:119)
    [junit]     at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
    [junit]     at org.apache.mina.transport.socket.nio.SocketAcceptor.registerNew(SocketAcceptor.java:400)
    [junit]     at org.apache.mina.transport.socket.nio.SocketAcceptor.access$900(SocketAcceptor.java:55)
    [junit]     at org.apache.mina.transport.socket.nio.SocketAcceptor$Worker.run(SocketAcceptor.java:235)
    [junit]     at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:43)
    [junit]     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
    [junit]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    [junit]     at java.lang.Thread.run(Thread.java:619)
    [junit] 
    [junit] Testcase: liveness took 0.004 sec
    [junit]     Caused an ERROR
    [junit] Address already in use
    [junit] java.net.BindException: Address already in use
    [junit]     at sun.nio.ch.Net.bind(Native Method)
    [junit]     at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:119)
    [junit]     at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
    [junit]     at org.apache.mina.transport.socket.nio.SocketAcceptor.registerNew(SocketAcceptor.java:400)
    [junit]     at org.apache.mina.transport.socket.nio.SocketAcceptor.access$900(SocketAcceptor.java:55)
    [junit]     at org.apache.mina.transport.socket.nio.SocketAcceptor$Worker.run(SocketAcceptor.java:235)
    [junit]     at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:43)
    [junit]     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
    [junit]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    [junit]     at java.lang.Thread.run(Thread.java:619)
    [junit] 

BUILD FAILED
/home/trustin/workspace/checkout/avis/java/server/build.xml:79: The following error occurred while executing this line:
/home/trustin/workspace/checkout/avis/java/common/build-common.xml:46: Test org.avis.federation.JUTestFederation failed

Total time: 3 seconds
trustin@primary:~/workspace/checkout/avis/java/server$

> NullPointerException in IoServiceListenerSupport
> ------------------------------------------------
>
>                 Key: DIRMINA-435
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-435
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.1.2
>         Environment: WinXP SP 2
> java version "1.5.0_11"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
> Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode, sharing)
>            Reporter: Matthew Phillips
>
> This is an odd one, since it occurs on WinXP and not on Mac OS X. The error was seen under 1.5, but also occurs on 1.6. I see the following NPE :
> -----
> Exception trace:
> java.lang.NullPointerException
> 	at java.util.concurrent.ConcurrentHashMap.hash(Unknown Source)
> 	at java.util.concurrent.ConcurrentHashMap.putIfAbsent(Unknown Source)
> 	at org.apache.mina.common.support.IoServiceListenerSupport.fireSessionCreated(IoServiceListenerSupport.java:152)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor.doAddNew(SocketIoProcessor.java:135)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor.access$300(SocketIoProcessor.java:44)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor$Worker.run(SocketIoProcessor.java:444)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:39)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> 	at java.lang.Thread.run(Unknown Source)
> ------
> The NPE is being caused by IoSession.getServiceAddress () returning null, which then bombs the attempt to use it as a key in the map (IoServiceListenerSupport:151):
>        SocketAddress serviceAddress = session.getServiceAddress(); // null
>         // Get the session set.
>         Set<IoSession> s = new IdentityHashSet<IoSession>();
>         Set<IoSession> sessions = managedSessions.putIfAbsent(serviceAddress,
>                 Collections.synchronizedSet(s));
> This has me stumped. Can anyone help?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-435) NullPointerException in IoServiceListenerSupport

Posted by "Matthew Phillips (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-435?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12548063 ] 

Matthew Phillips commented on DIRMINA-435:
------------------------------------------

This problem just bit me again, so I embarked on on some tracing. It happens on WinXP when trying to connect to an overseas host, so it may be triggered by the extra latency (the same code works fine for most other cases).

What seems to be causing it is MINA's SocketConnector class assuming that SocketChannel.finishConnect () will always return true, i.e. return when the connection is established. This is false in my case, resulting in a null remote address (SocketChannel.socket().getRemoteSocketAddress(), see line 334), which triggers the NPE in the worker.

Using the changes in the  patch I'll attach shortly fixes this and established a connection successfully. These changes effectively poll finishConnect() for up to 10 seconds, throwing an exception if it ultimately failed.


> NullPointerException in IoServiceListenerSupport
> ------------------------------------------------
>
>                 Key: DIRMINA-435
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-435
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.1.2
>         Environment: WinXP SP 2
> java version "1.5.0_11"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
> Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode, sharing)
>            Reporter: Matthew Phillips
>
> This is an odd one, since it occurs on WinXP and not on Mac OS X. The error was seen under 1.5, but also occurs on 1.6. I see the following NPE :
> -----
> Exception trace:
> java.lang.NullPointerException
> 	at java.util.concurrent.ConcurrentHashMap.hash(Unknown Source)
> 	at java.util.concurrent.ConcurrentHashMap.putIfAbsent(Unknown Source)
> 	at org.apache.mina.common.support.IoServiceListenerSupport.fireSessionCreated(IoServiceListenerSupport.java:152)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor.doAddNew(SocketIoProcessor.java:135)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor.access$300(SocketIoProcessor.java:44)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor$Worker.run(SocketIoProcessor.java:444)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:39)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> 	at java.lang.Thread.run(Unknown Source)
> ------
> The NPE is being caused by IoSession.getServiceAddress () returning null, which then bombs the attempt to use it as a key in the map (IoServiceListenerSupport:151):
>        SocketAddress serviceAddress = session.getServiceAddress(); // null
>         // Get the session set.
>         Set<IoSession> s = new IdentityHashSet<IoSession>();
>         Set<IoSession> sessions = managedSessions.putIfAbsent(serviceAddress,
>                 Collections.synchronizedSet(s));
> This has me stumped. Can anyone help?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-435) NullPointerException in IoServiceListenerSupport

Posted by "Maarten Bosteels (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-435?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12525630 ] 

Maarten Bosteels commented on DIRMINA-435:
------------------------------------------

Is this reproducible ?
If so, could you provide us with a simple TestCase ?

Does it only occur under high load ?


> NullPointerException in IoServiceListenerSupport
> ------------------------------------------------
>
>                 Key: DIRMINA-435
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-435
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.1.2
>         Environment: WinXP SP 2
> java version "1.5.0_11"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
> Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode, sharing)
>            Reporter: Matthew Phillips
>
> This is an odd one, since it occurs on WinXP and not on Mac OS X. The error was seen under 1.5, but also occurs on 1.6. I see the following NPE :
> -----
> Exception trace:
> java.lang.NullPointerException
> 	at java.util.concurrent.ConcurrentHashMap.hash(Unknown Source)
> 	at java.util.concurrent.ConcurrentHashMap.putIfAbsent(Unknown Source)
> 	at org.apache.mina.common.support.IoServiceListenerSupport.fireSessionCreated(IoServiceListenerSupport.java:152)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor.doAddNew(SocketIoProcessor.java:135)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor.access$300(SocketIoProcessor.java:44)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor$Worker.run(SocketIoProcessor.java:444)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:39)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> 	at java.lang.Thread.run(Unknown Source)
> ------
> The NPE is being caused by IoSession.getServiceAddress () returning null, which then bombs the attempt to use it as a key in the map (IoServiceListenerSupport:151):
>        SocketAddress serviceAddress = session.getServiceAddress(); // null
>         // Get the session set.
>         Set<IoSession> s = new IdentityHashSet<IoSession>();
>         Set<IoSession> sessions = managedSessions.putIfAbsent(serviceAddress,
>                 Collections.synchronizedSet(s));
> This has me stumped. Can anyone help?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-435) NullPointerException in IoServiceListenerSupport

Posted by "Trustin Lee (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-435?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12530729 ] 

Trustin Lee commented on DIRMINA-435:
-------------------------------------

I am still getting Address already in use error.  Could you try to run the test in Linux?

> NullPointerException in IoServiceListenerSupport
> ------------------------------------------------
>
>                 Key: DIRMINA-435
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-435
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.1.2
>         Environment: WinXP SP 2
> java version "1.5.0_11"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
> Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode, sharing)
>            Reporter: Matthew Phillips
>
> This is an odd one, since it occurs on WinXP and not on Mac OS X. The error was seen under 1.5, but also occurs on 1.6. I see the following NPE :
> -----
> Exception trace:
> java.lang.NullPointerException
> 	at java.util.concurrent.ConcurrentHashMap.hash(Unknown Source)
> 	at java.util.concurrent.ConcurrentHashMap.putIfAbsent(Unknown Source)
> 	at org.apache.mina.common.support.IoServiceListenerSupport.fireSessionCreated(IoServiceListenerSupport.java:152)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor.doAddNew(SocketIoProcessor.java:135)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor.access$300(SocketIoProcessor.java:44)
> 	at org.apache.mina.transport.socket.nio.SocketIoProcessor$Worker.run(SocketIoProcessor.java:444)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:39)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> 	at java.lang.Thread.run(Unknown Source)
> ------
> The NPE is being caused by IoSession.getServiceAddress () returning null, which then bombs the attempt to use it as a key in the map (IoServiceListenerSupport:151):
>        SocketAddress serviceAddress = session.getServiceAddress(); // null
>         // Get the session set.
>         Set<IoSession> s = new IdentityHashSet<IoSession>();
>         Set<IoSession> sessions = managedSessions.putIfAbsent(serviceAddress,
>                 Collections.synchronizedSet(s));
> This has me stumped. Can anyone help?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.