You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Trustin Lee (JIRA)" <ji...@apache.org> on 2008/04/20 07:16:21 UTC

[jira] Resolved: (DIRMINA-570) NullPointerException in NioProcessor.transferFile

     [ https://issues.apache.org/jira/browse/DIRMINA-570?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Trustin Lee resolved DIRMINA-570.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0.0-M2
         Assignee: Trustin Lee

Resolved.  My patch is somewhat different from yours but it should work without a problem.

> NullPointerException in NioProcessor.transferFile
> -------------------------------------------------
>
>                 Key: DIRMINA-570
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-570
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.0-M1
>         Environment: Linux 2.6.21.6 #1 SMP Wed Jul 25 20:22:10 MST 2007 x86_64 Intel(R) Xeon(R) CPU
>  
> java version "1.6.0_03"
> Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
> Java HotSpot(TM) 64-Bit Server VM (build 1.6.0_03-b05, mixed mode)
> MINA trunk
>            Reporter: Geoff Cadien
>            Assignee: Trustin Lee
>             Fix For: 2.0.0-M2
>
>
> A NullPointerException exception is thrown from NioProcessor.transferFile when an IOException thrown from transferTo and for some reason Exception.getMessage() returns null so when attempting e.getMessage().contains("Resource temporarily unavailable") a NullPointerException is thrown.  Patch is below:
> Index: NioProcessor.java
> ===================================================================
> --- NioProcessor.java   (revision 648768)
> +++ NioProcessor.java   (working copy)
> @@ -192,7 +192,7 @@
>              return (int) region.getFileChannel().transferTo(region.getPosition(), length, session.getChannel());
>          } catch (IOException e) {
>              // Check to see if the IOException is being thrown due to http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5103988
> -            if (e.getMessage().contains("Resource temporarily unavailable")) {
> +           if ("Resource temporarily unavailable".equals(e.getMessage())) {
>                  return 0;
>              } else {
>                  throw e;

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