Hi Saneth,

This improvement was made for a support issue on doing a secure call inside
a tenant webapp. You can access your service with,

CarbonContext.getThreadLocalCarbonContext().getOSGiService(<Class-name>.class);

We have improved getOSGiService() method to get properties as a parameter
in 4.3.0 release. I will debug further and let you know, AFAIR we didn't
test with non-secured service calls. According to the error above this may
be an issue with the createFilter () method added later.

Thanks,
Nipuni

On Mon, Jan 5, 2015 at 6:49 PM, Saneth Dharmakeerthi <sane...@wso2.com>
wrote:

> Hi All
>
> I am getting NullPointerException when executing the following line in a
> web-app running on wso2as-6.0.0-SNAPSHOT server.
>
>         Map<String, ConfigurationContext> tenantConfigContexts =
>                (Map<String, ConfigurationContext>)
> TenantAxisUtils.getTenantConfigurationContexts( (ConfigurationContext)
>
> *PrivilegedCarbonContext.getThreadLocalCarbonContext().getOSGiService(TenantMgtServiceComponent.class,null));*
>
> Exception:
>
> java.lang.NullPointerException
>       
> org.wso2.carbon.context.CarbonContext.createFilter(CarbonContext.java:418)*   
>   
> org.wso2.carbon.context.PrivilegedCarbonContext.getOSGiService(PrivilegedCarbonContext.java:362)*
>       org.wso2.qqa.tenant.TenantInfoService.getItem(TenantInfoService.java:31)
>       sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>       
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>       java.lang.reflect.Method.invoke(Method.java:597)
>       
> com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
>       
> com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
>       
> com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
>       
> com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)
>       
> com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
>       
> com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
>       
> com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
>       
> com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
>       
> com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)
>       
> com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)
>       
> com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)
>       
> com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)
>       
> com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
>       
> com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537)
>       
> com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:699)
>       javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
>
> I also added the carboncontext-osgi-services.properties  as following
>
> *osgi.service.1 = 
> org.wso2.carbon.tenant.mgt.internal.TenantMgtServiceComponent*
>
> Appreciate your thoughts on what could have made this gone wrong?
>
>
>
> Thanks and Best Regards,
>
> Saneth Dharmakeerthi
> Senior Software Engineer
> WSO2, Inc.
> Mobile: +94772325511
>
> _______________________________________________
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Nipuni Perera
Software Engineer; WSO2 Inc.; http://wso2.com
Email: nip...@wso2.com
Git hub profile: https://github.com/nipuni
Mobile: +94 (71) 5626680
<http://wso2.com>
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to