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 balaji hari <to...@gmail.com> on 2008/08/14 19:02:35 UTC

NullPointerException org.apache.axis2.databinding.typemapping.SimpleTypeMapper

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://www.nabble.com/NullPointerException-org.apache.axis2.databinding.typemapping.SimpleTypeMapper-tp18985650p18985650.html
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: NullPointerException org.apache.axis2.databinding.typemapping.SimpleTypeMapper

Posted by "shirol.vasant" <sh...@gmail.com>.
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.

RE: Code generation and camelback notation

Posted by "Hutchinson, Greg" <Gr...@fcc-fac.ca>.
This is not spam.
Thanks, 
... Greg ...

-----Original Message-----
From: balaji hari [mailto:to.haribalaji@gmail.com] 
Sent: Thursday, August 14, 2008 1:36 PM
To: axis-user@ws.apache.org
Subject: Re: Code generation and camelback notation


Surprised by what the follow up message I got on this issue?

Is this a spam?



Hutchinson, Greg wrote:
> 
> 
> 
> When generating a client for synchronous and asynchronous invocations of a
> web service, I get the following methods created.
> 
> 
> public  void createCustomer() {
> 	...
> }
> 
> public  void startcreateCustomer() {	//lowercase (c)reate
> 	...
> }
> 
> where I was expecting to get 
> 
> public  void startCreateCustomer() { //Proper camelback notation
> 	...
> }
> 
> Is there any plans to fix this, or is there some option to turn on?
> 
> Thanks,
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/NullPointerException-org.apache.axis2.databinding.typemapping.SimpleTypeMapper-tp18985650p18988234.html
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Code generation and camelback notation

Posted by balaji hari <to...@gmail.com>.
Surprised by what the follow up message I got on this issue?

Is this a spam?



Hutchinson, Greg wrote:
> 
> 
> 
> When generating a client for synchronous and asynchronous invocations of a
> web service, I get the following methods created.
> 
> 
> public  void createCustomer() {
> 	...
> }
> 
> public  void startcreateCustomer() {	//lowercase (c)reate
> 	...
> }
> 
> where I was expecting to get 
> 
> public  void startCreateCustomer() { //Proper camelback notation
> 	...
> }
> 
> Is there any plans to fix this, or is there some option to turn on?
> 
> Thanks,
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/NullPointerException-org.apache.axis2.databinding.typemapping.SimpleTypeMapper-tp18985650p18988234.html
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Code generation and camelback notation

Posted by "Hutchinson, Greg" <Gr...@fcc-fac.ca>.

When generating a client for synchronous and asynchronous invocations of a web service, I get the following methods created.


public  void createCustomer() {
	...
}

public  void startcreateCustomer() {	//lowercase (c)reate
	...
}

where I was expecting to get 

public  void startCreateCustomer() { //Proper camelback notation
	...
}

Is there any plans to fix this, or is there some option to turn on?

Thanks,

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: NullPointerException org.apache.axis2.databinding.typemapping.SimpleTypeMapper

Posted by balaji hari <to...@gmail.com>.
Or can you provide us a patch for 

https://issues.apache.org/jira/browse/AXIS2-3864?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

on top of Axis2 1.4 base line?

-Balaji



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://www.nabble.com/NullPointerException-org.apache.axis2.databinding.typemapping.SimpleTypeMapper-tp18985650p18986514.html
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org