Christopher Barham | 25 Jan 03:22
Picon
Favicon

possible Bug report-BaseChannel multiple hosts inconsistency (from r2568 commit)

Hi,
I've just spent some time upgrading my jPos installation and found a
problem resulting from the multi-hosts changes made as part of
subversion r2568.  Basically, I use aChannel.setHost("host") followed by
aChannel.setPort(123456) and am getting NullPointerException deep in the
socket code.  Tracing this through, it seems there is now an
inconsistency in how the host/port setter is carried out depending on
whether you call setHost(String host, int port) or setHost(String host)
followed by setPort(int port) in BaseChannel.

In order to make myself clearer may I present the following jUnit 4 test
exposing the issue, (the test requires use of jUnit 4 from
http://www.junit.org and junit addons from
http://junit-addons.sourceforge.net to get at the private fields) :

Please can you advise as to whether this is intended behaviour?  If not,
may I suggest that BaseChannel be amended so that host and channel are
removed as fields, and the getter/setter will interact with the hosts
and ports arrays, using the first position only?

<CODE>
package org.jpos.iso;

import static org.junit.Assert.assertEquals;
import junit.framework.JUnit4TestAdapter;

import org.junit.Before;
import org.junit.Test;

public class BaseChannelSetterTest {
(Continue reading)

Alejandro Revilla | 25 Jan 15:50

Re: possible Bug report-BaseChannel multiple hosts inconsistency (from r2568 commit)

Thank you for the bug report. Without having a chance to test it yet I'm
sure that you're right, we usually configure the channels using Q2 (you
should consider using it) so we don't get to see these bugs.

Will review and a fix shortly.

On Fri, Jan 25, 2008 at 02:23:27AM -0000, Christopher Barham wrote:
> Hi,
> I've just spent some time upgrading my jPos installation and found a
> problem resulting from the multi-hosts changes made as part of
> subversion r2568.  Basically, I use aChannel.setHost("host") followed by
> aChannel.setPort(123456) and am getting NullPointerException deep in the
> socket code.  Tracing this through, it seems there is now an
> inconsistency in how the host/port setter is carried out depending on
> whether you call setHost(String host, int port) or setHost(String host)
> followed by setPort(int port) in BaseChannel.
> 
> In order to make myself clearer may I present the following jUnit 4 test
> exposing the issue, (the test requires use of jUnit 4 from
> http://www.junit.org and junit addons from
> http://junit-addons.sourceforge.net to get at the private fields) :
> 
> Please can you advise as to whether this is intended behaviour?  If not,
> may I suggest that BaseChannel be amended so that host and channel are
> removed as fields, and the getter/setter will interact with the hosts
> and ports arrays, using the first position only?
> 
> <CODE>
> package org.jpos.iso;
> 
(Continue reading)

Alejandro Revilla | 25 Jan 20:57

Re: possible Bug report-BaseChannel multiple hosts inconsistency (from r2568 commit)

Mr. Barham,

Thank you for the detailed report. I believe we've fixed this in r2595.

Can you confirm if it works for you at your convenience?

 

Gmane