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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to