You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hivemind.apache.org by hi...@jakarta.apache.org on 2004/09/28 02:59:31 UTC

[jira] Created: (HIVEMIND-60) ServiceObjectProvider passes null ServiceInterface parameter when retrieving Service

Message:

  A new issue has been created in JIRA.

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/HIVEMIND-60

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: HIVEMIND-60
    Summary: ServiceObjectProvider passes null ServiceInterface parameter when retrieving Service 
       Type: Bug

     Status: Unassigned
   Priority: Major

    Project: HiveMind
 Components: 
             framework
   Versions:
             1.0

   Assignee: 
   Reporter: Trent McClenahan

    Created: Mon, 27 Sep 2004 5:59 PM
    Updated: Mon, 27 Sep 2004 5:59 PM

Description:
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. 
 



---------------------------------------------------------------------
JIRA INFORMATION:
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: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org


[jira] Resolved: (HIVEMIND-60) ServiceObjectProvider passes null ServiceInterface parameter when retrieving Service

Posted by "Knut Wannheden (JIRA)" <hi...@jakarta.apache.org>.
     [ 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: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org