Hi Kasun,

On Sun, Feb 12, 2012 at 3:30 PM, KasunG Gajasinghe <[email protected]> wrote:

> Hi,
>
> I believe ResponseTimeCalculator might not be the reason for this, because
> it isn't the root cause most of the time in cases like this. The stacktrace
> for the real cause has been swallowed by someone.
>

Yes, exactly! AFAIS the reason is Axis2 dispatchers can't find the correct
operation mapping (mobile -> addMobileNumber), hence there's a null in
message context object for axis operation.



>
> Saying that, I tried the very service in AS trunk pack standalone version.
> It worked as expected though.
>

Oh...


> ie. [1] worked as it should, and [2] worked fine too to my surprise.
>

[2] should work fine, it's SOAP based invocation!


> But the same error you posted generated for me when there was ANOTHER user
> with the same "user" id. So, that might be the case of you. Have you tried
> with different users and see how it behave?
>

I tried with different users, still the same issue. Anyhow if that's the
case I should get that same error when using [2], but I didn't.


> Since whttp:location="mobile" is defined as the location
> for ref="tns:addMobileNumber", [1] is the correct POST url.
>

Not really, both are correct! [1] for REST based invocations!

>
> [1] curl --data "user=test5&mobileNumber=1234" -X POST
> https://127.0.0.1:9443/services/MobileDirectoryService/mobile -k
>
> [2] curl --data "user=test10&mobileNumber=1234" -X POST
> https://127.0.0.1:9443/services/MobileDirectoryService/addMobileNumber -k
>
> Regards.
> --KasunG
>
> On Sun, Feb 12, 2012 at 11:10 AM, Hiranya Jayathilaka <[email protected]>wrote:
>
>> Have you tried debugging into the  ResponseTimeCalculator? Should be
>> pretty easy to figure out what's wrong.
>>
>> Thanks,
>> Hiranya
>>
>> On Sun, Feb 12, 2012 at 10:21 AM, Nirmal Fernando <[email protected]>wrote:
>>
>>> Hi All,
>>>
>>> I'm having a trouble to make work a RESTfull Axis2 Service ( which is
>>> worked a month back [1] ), in a trunk version and even in Axis2 1.6.1
>>> binary distribution.
>>> Related scenario is pasted at [2].
>>>
>>> Wonder what's wrong! Any help is highly appreciated.
>>>
>>> You can find the service attached at [1].
>>>
>>> [1] https://wso2.org/jira/browse/STRATOS-1971
>>>
>>> [2]
>>>
>>> nirmal@nirmal:/media/wso2/new-autoscaler$ curl --data
>>> "user=nirmal&mobileNumber=1234" -X POST
>>> https://127.0.0.1:9443/services/MobileDirectoryService/mobile -k
>>> <html><head><title>Apache Tomcat/7.0.14 - Error
>>> report</title><style><!--H1
>>> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
>>> H2
>>> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;}
>>> H3
>>> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;}
>>> BODY
>>> {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B
>>> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;}
>>> P
>>> {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A
>>> {color : black;}A.name {color : black;}HR {color : #525D76;}--></style>
>>> </head><body><h1>HTTP Status 500 - </h1><HR size="1"
>>> noshade="noshade"><p><b>type</b> Exception report</p><p><b>message</b>
>>> <u></u></p><p><b>description</b> <u>The server encountered an internal
>>> error () that prevented it from fulfilling this
>>> request.</u></p><p><b>exception</b> <pre>java.lang.NullPointerException
>>>
>>> org.wso2.carbon.statistics.internal.ResponseTimeCalculator.updateCurrentInvocationStatistic(ResponseTimeCalculator.java:120)
>>>
>>> org.wso2.carbon.statistics.internal.ResponseTimeCalculator.calculateResponseTimes(ResponseTimeCalculator.java:61)
>>>
>>> org.wso2.carbon.statistics.module.FaultHandler.updateStatistics(FaultHandler.java:151)
>>>
>>> org.wso2.carbon.statistics.module.FaultHandler.invoke(FaultHandler.java:50)
>>>     org.apache.axis2.engine.Phase.invokeHandler(Phase.java:340)
>>>     org.apache.axis2.engine.Phase.invoke(Phase.java:313)
>>>     org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:262)
>>>     org.apache.axis2.engine.AxisEngine.sendFault(AxisEngine.java:516)
>>>
>>> org.apache.axis2.transport.http.AxisServlet.handleFault(AxisServlet.java:433)
>>>
>>> org.apache.axis2.transport.http.AxisServlet.processAxisFault(AxisServlet.java:398)
>>>
>>> org.apache.axis2.transport.http.AxisServlet$RestRequestProcessor.processFault(AxisServlet.java:857)
>>>
>>> org.apache.axis2.transport.http.AxisServlet$RestRequestProcessor.processXMLRequest(AxisServlet.java:830)
>>>
>>> org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:227)
>>>
>>> org.wso2.carbon.core.transports.CarbonServlet.doPost(CarbonServlet.java:206)
>>>     javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
>>>     javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
>>>
>>> org.eclipse.equinox.http.servlet.internal.ServletRegistration.handleRequest(ServletRegistration.java:90)
>>>
>>> org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:111)
>>>
>>> org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:67)
>>>     javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
>>>     org.wso2.carbon.bridge.BridgeServlet.service(BridgeServlet.java:164)
>>>     javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
>>> </pre></p><p><b>note</b> <u>The full stack trace of the root cause is
>>> available in the Apache Tomcat/7.0.14 logs.</u></p><HR size="1"
>>> noshade="noshade"><h3>Apache Tomcat/7.0.14</h3></body></html>
>>>
>>>
>>> nirmal@nirmal:/media/wso2/new-autoscaler$ curl --data
>>> "user=nirmal&mobileNumber=1234" -X POST
>>> https://127.0.0.1:9443/services/MobileDirectoryService/addMobileNumber-k
>>> <ns:addMobileNumberResponse xmlns:ns="http://axis2.apache.org
>>> "><ns:return>
>>> http://127.0.0.1:9763/services/MobileDirectoryService/mobile/nirmal
>>> </ns:return></ns:addMobileNumberResponse>
>>>
>>>
>>> nirmal@nirmal:/media/wso2/new-autoscaler$ curl -X GET
>>> http://127.0.0.1:9763/services/MobileDirectoryService/mobile/nirmal -k
>>> <html><head><title>Apache Tomcat/7.0.14 - Error
>>> report</title><style><!--H1
>>> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
>>> H2
>>> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;}
>>> H3
>>> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;}
>>> BODY
>>> {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B
>>> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;}
>>> P
>>> {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A
>>> {color : black;}A.name {color : black;}HR {color : #525D76;}--></style>
>>> </head><body><h1>HTTP Status 500 - </h1><HR size="1"
>>> noshade="noshade"><p><b>type</b> Exception report</p><p><b>message</b>
>>> <u></u></p><p><b>description</b> <u>The server encountered an internal
>>> error () that prevented it from fulfilling this
>>> request.</u></p><p><b>exception</b> <pre>org.apache.axis2.AxisFault
>>>     org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
>>>
>>> org.wso2.carbon.core.transports.CarbonServlet.doGet(CarbonServlet.java:134)
>>>     javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
>>>     javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
>>>
>>> org.eclipse.equinox.http.servlet.internal.ServletRegistration.handleRequest(ServletRegistration.java:90)
>>>
>>> org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:111)
>>>
>>> org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:67)
>>>     javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
>>>     org.wso2.carbon.bridge.BridgeServlet.service(BridgeServlet.java:164)
>>>     javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
>>> </pre></p><p><b>root cause</b> <pre>java.lang.NullPointerException
>>>
>>> org.wso2.carbon.statistics.internal.ResponseTimeCalculator.updateCurrentInvocationStatistic(ResponseTimeCalculator.java:120)
>>>
>>> org.wso2.carbon.statistics.internal.ResponseTimeCalculator.calculateResponseTimes(ResponseTimeCalculator.java:61)
>>>
>>> org.wso2.carbon.statistics.module.FaultHandler.updateStatistics(FaultHandler.java:151)
>>>
>>> org.wso2.carbon.statistics.module.FaultHandler.invoke(FaultHandler.java:50)
>>>     org.apache.axis2.engine.Phase.invokeHandler(Phase.java:340)
>>>     org.apache.axis2.engine.Phase.invoke(Phase.java:313)
>>>     org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:262)
>>>     org.apache.axis2.engine.AxisEngine.sendFault(AxisEngine.java:516)
>>>
>>> org.apache.axis2.transport.http.AxisServlet.handleFault(AxisServlet.java:433)
>>>
>>> org.apache.axis2.transport.http.AxisServlet.processAxisFault(AxisServlet.java:398)
>>>
>>> org.apache.axis2.transport.http.AxisServlet$RestRequestProcessor.processFault(AxisServlet.java:857)
>>>
>>> org.apache.axis2.transport.http.AxisServlet$RestRequestProcessor.processURLRequest(AxisServlet.java:842)
>>>
>>> org.wso2.carbon.core.transports.CarbonServlet.handleRestRequest(CarbonServlet.java:233)
>>>
>>> org.wso2.carbon.core.transports.CarbonServlet.doGet(CarbonServlet.java:131)
>>>     javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
>>>     javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
>>>
>>> org.eclipse.equinox.http.servlet.internal.ServletRegistration.handleRequest(ServletRegistration.java:90)
>>>
>>> org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:111)
>>>
>>> org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:67)
>>>     javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
>>>     org.wso2.carbon.bridge.BridgeServlet.service(BridgeServlet.java:164)
>>>     javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
>>> </pre></p><p><b>note</b> <u>The full stack trace of the root cause is
>>> available in the Apache Tomcat/7.0.14 logs.</u></p><HR size="1"
>>> noshade="noshade"><h3>Apache Tomcat/7.0.14</h3></body></html>
>>>
>>>
>>> nirmal@nirmal:/media/wso2/new-autoscaler$ curl -X GET
>>> http://127.0.0.1:9763/services/MobileDirectoryService/getMobileNumber?user=nirmal-k
>>> <ns:getMobileNumberResponse xmlns:ns="http://axis2.apache.org
>>> "><ns:return>1234</ns:return></ns:getMobileNumberResponse>
>>>
>>> --
>>>
>>> Thanks & regards,
>>> Nirmal
>>>
>>> Software Engineer- Platform Technologies Team, WSO2 Inc.
>>> Mobile: +94715779733
>>> Blog: http://nirmalfdo.blogspot.com/
>>>
>>> _______________________________________________
>>> Carbon-dev mailing list
>>> [email protected]
>>> http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
>>>
>>>
>>
>>
>> --
>> Hiranya Jayathilaka
>> Associate Technical Lead;
>> WSO2 Inc.;  http://wso2.org
>> E-mail: [email protected];  Mobile: +94 77 633 3491
>> Blog: http://techfeast-hiranya.blogspot.com
>>
>> _______________________________________________
>> Carbon-dev mailing list
>> [email protected]
>> http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
>>
>>
>
>
> --
> *Kasun Gajasinghe*
> Software Engineer; WSO2 Inc.; http://wso2.com
>
> ,
> *email: **kasung AT spamfree wso2.com** cell: **+94 (77) 678-0813*
> *blog: **http://blog.kasunbg.org* <http://blog.kasunbg.org>
>
> *
> twitter: **http://twitter.com/kasunbg* <http://twitter.com/kasunbg>
>
> *
> *
>
>
> _______________________________________________
> Carbon-dev mailing list
> [email protected]
> http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
>
>


-- 

Thanks & regards,
Nirmal

Software Engineer- Platform Technologies Team, WSO2 Inc.
Mobile: +94715779733
Blog: http://nirmalfdo.blogspot.com/
_______________________________________________
Carbon-dev mailing list
[email protected]
http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev

Reply via email to