You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "shirol.vasant" <sh...@gmail.com> on 2010/03/01 12:31:43 UTC
Re: NullPointerException
org.apache.axis2.databinding.typemapping.SimpleTypeMapper
Hi Balaji,
I am also facing the same issue with Axis2-1.5.1 version. Where in my case
object is of instace Date and it throws the below same exception:, Please
let me know if you have any work around for this issue.
java.lang.NullPointerException
at
org.apache.axis2.databinding.typemapping.SimpleTypeMapper.getStringValue(SimpleTypeMapper.java:297)
at
org.apache.axis2.databinding.utils.BeanUtil.getPropertyQnameList(BeanUtil.java:154)
at
org.apache.axis2.databinding.utils.BeanUtil.getPullParser(BeanUtil.java:67)
Thanks in advance,
Vasant
balaji hari wrote:
>
> We tried using the latest snapshot of AXIS2
>
> http://builder.wso2.org/browse/AXIS2-NIGHTLY-114
>
> which has fix for
>
> https://issues.apache.org/jira/browse/AXIS2-3864?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
>
> This introduced another issue when invoking service from client side.
>
> org.apache.axis2.databinding.typemapping.SimpleTypeMapper in handling
> java.util.Date.
>
> java.lang.NullPointerException
> at
> org.apache.axis2.databinding.typemapping.SimpleTypeMapper.getStringValue(SimpleTypeMapper.java:284)
> at
> org.apache.axis2.databinding.utils.BeanUtil.getOMElement(BeanUtil.java:776)
> at
> org.apache.axis2.rpc.client.RPCServiceClient.invokeBlocking(RPCServiceClient.java:97)
> at
> com.bmc.bcan.ws.client.SpanActionServiceStub.invokeCall(SpanActionServiceStub.java:246)
> at
> com.bmc.bcan.ws.client.SpanActionServiceStub.doMarkAsTrustedByConfigDate(SpanActionServiceStub.java:220)
> at
> com.bmc.bcan.ws.SpanActionServiceTest.testDoMarkAsTrustedByConfigDate(SpanActionServiceTest.java:405)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>
>
>
>
> This is the comparison of AXIS2.1.4 src and AXIS2-NIGHTLY-114 of
> getStringValue(Object obj) in SimpleTypeMapper
>
> 2.1.4 : else if (obj instanceof Calendar) {
> SimpleDateFormat zulu = new
> SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
> zulu.setTimeZone(TimeZone.getTimeZone("GMT"));
> return zulu.format(((Calendar)obj).getTime());
> } else if (obj instanceof Date) {
> SimpleDateFormat zulu = new
> SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
> zulu.setTimeZone(TimeZone.getTimeZone("GMT"));
> return zulu.format(obj);
> }
>
> NIGHTLY-114 : else if (obj instanceof Calendar) {
> SimpleDateFormat zulu = new
> SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
> zulu.setTimeZone(TimeZone.getTimeZone("GMT"));
> return zulu.format(((Calendar)obj).getTime());
> } else if (obj instanceof Date) {
> SimpleDateFormat zulu = new SimpleDateFormat("yyyy-MM-dd");
>
> MessageContext messageContext =
> MessageContext.getCurrentMessageContext();
> AxisService axisServce = messageContext.getAxisService();
> // if the user has given a pirticualr timezone we use it.
> if (axisServce.getParameter("TimeZone") != null){
>
> zulu.setTimeZone(TimeZone.getTimeZone((String)axisServce.getParameter("TimeZone").getValue()));
> }
>
> return zulu.format(obj);
> }
>
>
> We need a fix for this issue.
>
>
> Thanks in advance.
> Balaji
>
>
>
>
--
View this message in context: http://old.nabble.com/NullPointerException-org.apache.axis2.databinding.typemapping.SimpleTypeMapper-tp18985650p27742375.html
Sent from the Axis - User mailing list archive at Nabble.com.