You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicemix.apache.org by "Lars Heinemann (JIRA)" <ji...@apache.org> on 2009/02/06 09:39:59 UTC

[jira] Assigned: (SMX4-204) Unable to retrieve endpoint for a given service QName

     [ https://issues.apache.org/activemq/browse/SMX4-204?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lars Heinemann reassigned SMX4-204:
-----------------------------------

    Assignee: Lars Heinemann

> Unable to retrieve endpoint for a given service QName
> -----------------------------------------------------
>
>                 Key: SMX4-204
>                 URL: https://issues.apache.org/activemq/browse/SMX4-204
>             Project: ServiceMix 4
>          Issue Type: Bug
>    Affects Versions: 4.0-m2
>            Reporter: Lars Heinemann
>            Assignee: Lars Heinemann
>             Fix For: 4.0-m2
>
>
> I got the following helper function which used to work in older SMX 3 and 4 versions (latest known of SMX4 is 28th of january?).
> Today in the morning I built the latest trunk and the function doesn't work any longer.
> {code}
>     /**
>      * checks whether the given service is available in the nmr or not
>      * 
>      * @param context   the component context
>      * @param service   the service to check for
>      * @return          true if at least one endpoint is available for the 
>      *                  given service, otherwise false
>      */
>     public static final boolean isServiceAvailable(ComponentContext context, QName service) {
>         ServiceEndpoint[] eps = context.getEndpointsForService(service);
>         return (eps != null && eps.length > 0);
>      }
> {code}
> I tried to extend this function that in case there is no such service registered, I call the method context.getEndpoints(null) to retrieve all registered
> endpoints (like API Doc says) but it ends up in a NPE which is not JBI compliant.
> {noformat}
> java.lang.NullPointerException
> 	at org.apache.servicemix.nmr.core.EndpointRegistryImpl.internalQuery(EndpointRegistryImpl.java:271)
> 	at org.apache.servicemix.nmr.core.EndpointRegistryImpl.query(EndpointRegistryImpl.java:188)
> 	at org.apache.servicemix.jbi.osgi.RegistryWrapper.query(RegistryWrapper.java:67)
> 	at org.apache.servicemix.jbi.runtime.impl.AbstractComponentContext.internalQueryEndpoints(AbstractComponentContext.java:114)
> 	at org.apache.servicemix.jbi.runtime.impl.AbstractComponentContext.getEndpoints(AbstractComponentContext.java:110)
> 	at org.apache.servicemix.common.EndpointComponentContext.getEndpoints(EndpointComponentContext.java:94)
> 	at net.compart.jbi.shared.CpEsbUtils.isServiceAvailable(CpEsbUtils.java:389)
> {noformat}
> Any thoughts on that? It must have been broken withing the last few days.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.