You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicemix.apache.org by freeman fang <fr...@gmail.com> on 2006/05/24 08:48:06 UTC

NullPointerException of retrieveInterfaceFromSUDescriptor in EndpointRegistry.java

Hi,

I just develop my ServiceEngine Component and Service Unit demo and try to
develop it into ServiceMix. I am using the latest nightly binary kit which
is incubating-servicemix-3.0-SNAPSHOT.zip.
But I get NullPointerException when I try to start service assembly.

The exception was thrown at line ****  *****

if (services != null) {
                Provides[] provides = services.getProvides();
************ for (int j = 0; j < provides.length; j++) { *************

The problem is that variable "provides" was not checked null or not. In
fact, this variable would be null always since services.setProvides() method
is never called in the whole code base.
I modify Services.java a little bit which can make my demo works with
ServiceMix


codebase:
private Provides[] provides;
private Consumes[] consumes;

my change:

private Provides[] provides = new Provides[0];
private Consumes[] consumes = new Consumes[0];

Just makesure provides is not null.

Does my change make sense? Any suggestion is appreciated.

Thanks very much

Freeman

Re: NullPointerException of retrieveInterfaceFromSUDescriptor in EndpointRegistry.java

Posted by Guillaume Nodet <gn...@gmail.com>.
Thanks, I have just fixed that.

Cheers,
Guillaume Nodet

On 5/24/06, freeman fang <fr...@gmail.com> wrote:
>
> Hi,
>
> I just develop my ServiceEngine Component and Service Unit demo and try to
> develop it into ServiceMix. I am using the latest nightly binary kit which
> is incubating-servicemix-3.0-SNAPSHOT.zip.
> But I get NullPointerException when I try to start service assembly.
>
> The exception was thrown at line ****  *****
>
> if (services != null) {
>                 Provides[] provides = services.getProvides();
> ************ for (int j = 0; j < provides.length; j++) { *************
>
> The problem is that variable "provides" was not checked null or not. In
> fact, this variable would be null always since services.setProvides()
> method
> is never called in the whole code base.
> I modify Services.java a little bit which can make my demo works with
> ServiceMix
>
>
> codebase:
> private Provides[] provides;
> private Consumes[] consumes;
>
> my change:
>
> private Provides[] provides = new Provides[0];
> private Consumes[] consumes = new Consumes[0];
>
> Just makesure provides is not null.
>
> Does my change make sense? Any suggestion is appreciated.
>
> Thanks very much
>
> Freeman
>
>


-- 
Cheers,
Guillaume Nodet