[ http://issues.apache.org/jira/browse/HIVEMIND-60?page=history ]
     
Knut Wannheden resolved HIVEMIND-60:
------------------------------------

     Resolution: Fixed
    Fix Version: 1.1

> ServiceObjectProvider passes null ServiceInterface parameter when retrieving 
> Service
> ------------------------------------------------------------------------------------
>
>          Key: HIVEMIND-60
>          URL: http://issues.apache.org/jira/browse/HIVEMIND-60
>      Project: HiveMind
>         Type: Bug
>   Components: framework
>     Versions: 1.0
>     Reporter: Trent McClenahan
>      Fix For: 1.1

>
> I raised this bug before, however it was closed, but the bug still exists in 
> release 1.0.  I can work around this by providing my own service provider, 
> but this seems like a pretty serious bug, basically it means that the service 
> object provider always fails.  I'm adding some extra description...
> This bug means that the service object provider throws NullPointerExceptions! 
>   Here is the stack where the error is occuring:
> Caused by: java.lang.NullPointerException
>       at 
> org.apache.hivemind.impl.ServicePointImpl.getService(ServicePointImpl.java:186)
>       at 
> org.apache.hivemind.impl.RegistryImpl.getService(RegistryImpl.java:151)
>       at org.apache.hivemind.impl.ModuleImpl.getService(ModuleImpl.java:60)
>       at 
> org.apache.hivemind.service.impl.ServiceObjectProvider.provideObject(ServiceObjectProvider.java:39)
> As you can see from line 186 in ServicePointImpl, serviceInterface is null:
> 186        if (!serviceInterface.isAssignableFrom(result.getClass()))
> Its a pretty easy fix, currently the ServiceObjectProvider returns: 
>         return contributingModule.getService(locator, propertyType); 
> However, propertyType is null, and therefore causes a NullPointerException to 
> be raised when the service retrieved is checked for assignment compatibility 
> against its service interface. 
> The fix is to do as the ServiceTranslator does: 
>         return contributingModule.getService( 
>             inputValue, 
>             propertyType == null ? Object.class : propertyType); 
> This ensures that no null service interface is passed through. 
> Cheers, 
> Trent. 
>  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to