Hi all,

when we are trying to get JSON response in tenant mode, exception will
occur. Therefore I have done some changes to fix the issue.

   - set the tenantOutMsgContext's AxisOperation to mainOutMsgContext in
   MultitenantMessageReceiver.java (line# 415-421)


   - in JsonFormatter.java, I have retrieve the schemas from
   outMsgCtxt.getAxisOperation().getAxisService().getSchema()   (line# 90)


I have able to fix the issue doing above changes, But when I try to build
the carbon-kernel-patch0010 with test cases. Json related test cases are
failing.

In test cases, the schema is set to the AxisService and the AxisService is
set to MessageContext. therefore null pointer exception will occur. because
AxisService can't retrieve by getAxisOperation.getAxisService method.

Also I have tried to set the AxisService to mainOutMsgContext in
MultitenantMessageReceiver.java then I found null pointer exception in
org.wso2.carbon.statistics.module.InOutMEPHandler. I have attached the null
pointer exception also


as per offline chat with Jayanga, He also couldn't find any wrong in these
changes, but He told me to check that, why we need to set AxisOperation,
because without setting the AxisOperation, we can't retrieve the
elementQname in (JsonFormatter.java -line# 87).

and also I couldn't find any setAxisOperation method calls in
MessageContext.java file as well.


Jayanga mentioned about some life cycles for these AxisOperations and
AxisServices, I have no idea about those life cycles.
Do these changes will effect those life cycles ?

applying above mentioned changes json response works fine, but still Json
related test cases are failing.


Thanks,

Madhawa.
-- 
*Madhawa Gunasekara*
Software Engineer
WSO2 Inc.; http://wso2.com
lean.enterprise.middleware

mobile: +94 719411002 <+94+719411002>
blog: *http://madhawa-gunasekara.blogspot.com
<http://madhawa-gunasekara.blogspot.com>*
linkedin: *http://lk.linkedin.com/in/mgunasekara
<http://lk.linkedin.com/in/mgunasekara>*
[2015-05-25 10:27:53,865] ERROR 
{org.wso2.carbon.statistics.module.InOutMEPHandler} -  Could not call 
InOutMEPHandler.invoke
java.lang.NullPointerException
        at 
org.wso2.carbon.statistics.internal.ResponseTimeCalculator.calculateResponseTimes(ResponseTimeCalculator.java:86)
        at 
org.wso2.carbon.statistics.module.InOutMEPHandler.updateStatistics(InOutMEPHandler.java:119)
        at 
org.wso2.carbon.statistics.module.InOutMEPHandler.invoke(InOutMEPHandler.java:97)
        at org.apache.axis2.engine.Phase.invokeHandler(Phase.java:340)
        at org.apache.axis2.engine.Phase.invoke(Phase.java:313)
        at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:261)
        at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:426)
        at 
org.wso2.carbon.core.multitenancy.MultitenantMessageReceiver.doServletRest(MultitenantMessageReceiver.java:423)
        at 
org.wso2.carbon.core.multitenancy.MultitenantMessageReceiver.doREST(MultitenantMessageReceiver.java:350)
        at 
org.wso2.carbon.core.multitenancy.MultitenantMessageReceiver.processRequest(MultitenantMessageReceiver.java:212)
        at 
org.wso2.carbon.core.multitenancy.MultitenantMessageReceiver.receive(MultitenantMessageReceiver.java:79)
        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
        at 
org.apache.axis2.transport.http.util.RESTUtil.invokeAxisEngine(RESTUtil.java:144)
        at 
org.apache.axis2.transport.http.util.RESTUtil.processURLRequest(RESTUtil.java:139)
        at 
org.apache.axis2.transport.http.AxisServlet$RestRequestProcessor.processURLRequest(AxisServlet.java:837)
        at 
org.wso2.carbon.core.transports.CarbonServlet.handleRestRequest(CarbonServlet.java:303)
        at 
org.wso2.carbon.core.transports.CarbonServlet.doGet(CarbonServlet.java:152)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:735)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
        at 
org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
        at 
org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:128)
        at 
org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:68)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
        at 
org.wso2.carbon.tomcat.ext.servlet.DelegationServlet.service(DelegationServlet.java:68)
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at 
org.wso2.carbon.tomcat.ext.filter.CharacterSetFilter.doFilter(CharacterSetFilter.java:61)
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
        at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
        at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
        at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
        at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
        at 
org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(CompositeValve.java:178)
        at 
org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(TomcatValveContainer.java:49)
        at 
org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:141)
        at 
org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:156)
        at 
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
        at 
org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:52)
        at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
        at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
        at 
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
        at 
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
        at 
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1653)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
        at java.lang.Thread.run(Thread.java:662)

_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to