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 ram <ra...@yahoo.co.in> on 2009/12/04 17:01:24 UTC
java.util.date convertion to UnsignedInt problem
Hi,
I am trying to convert java.util.date to UnsignedInt(). I am getting NumberFormatException
I am fetching the date from database. I am converting unsignedInt() like the following
new UnsignedInt(info.getdate.getTime())
when i print date i am getting 1259937492847. so where do i am doing mistake.
Can any onehelp to fix this issue.
Thanks & Regards,
Ram
The INTERNET now has a personality. YOURS! See your Yahoo! Homepage. http://in.yahoo.com/
Re: java.util.date convertion to UnsignedInt problem
Posted by Andreas Veithen <an...@gmail.com>.
Ram,
You cannot convert the result of Date#getTime() to UnsignedInt because
UnsignedInt is a representation of the XML Schema type called
unsignedInt, and the value space of this type is limited to values
less than or equal to 4294967295 (see my link).
Andreas
On Mon, Dec 28, 2009 at 13:28, ram <ra...@yahoo.co.in> wrote:
>
> Hi,
> Thanks andreas. But the below link could not solve my problem. Any one pls suggest me how to fix this issue
>
> Thanks & Regards,
> Ram
>
>
> --- On Sat, 5/12/09, Andreas Veithen <an...@gmail.com> wrote:
>
> From: Andreas Veithen <an...@gmail.com>
> Subject: Re: java.util.date convertion to UnsignedInt problem
> To: axis-user@ws.apache.org
> Date: Saturday, 5 December, 2009, 4:04 PM
>
> Please have a look at [1].
>
> Andreas
>
> [1] http://www.w3.org/TR/xmlschema-2/#unsignedInt
>
> On Fri, Dec 4, 2009 at 17:13, Anup Mayank <an...@gmail.com> wrote:
> >
> > /** validate the value against the xsd definition */
> > 79 public static boolean isValid(long iValue) {
> > 80 return !((iValue < 0L) || (iValue > 4294967295L));
> > 81 }
> > This is the source code of Unsigned int where it validates if a number is of proper value or not. I am not sure how the particular max number is chosen. But since your date value is out of range it is throwing exception. Axis folks please explain this range?
> >
> > Anup
> > On Fri, Dec 4, 2009 at 8:01 AM, ram <ra...@yahoo.co.in> wrote:
> >>
> >> Hi,
> >> I am trying to convert java.util.date to UnsignedInt(). I am getting NumberFormatException
> >> I am fetching the date from database. I am converting unsignedInt() like the following
> >>
> >> new UnsignedInt(info.getdate.getTime())
> >>
> >> when i print date i am getting 1259937492847. so where do i am doing mistake.
> >> Can any onehelp to fix this issue.
> >>
> >>
> >> Thanks & Regards,
> >> Ram
> >>
> >> ________________________________
> >> The INTERNET now has a personality. YOURS! See your Yahoo! Homepage.
>
> ________________________________
> The INTERNET now has a personality. YOURS! See your Yahoo! Homepage.
Re: java.util.date convertion to UnsignedInt problem
Posted by ram <ra...@yahoo.co.in>.
Hi, Thanks andreas. But the below link could not solve my problem. Any one pls suggest me how to fix this issue
Thanks & Regards,
Ram
--- On Sat, 5/12/09, Andreas Veithen <an...@gmail.com> wrote:
From: Andreas Veithen <an...@gmail.com>
Subject: Re: java.util.date convertion to UnsignedInt problem
To: axis-user@ws.apache.org
Date: Saturday, 5 December, 2009, 4:04 PM
Please have a look at [1].
Andreas
[1] http://www.w3.org/TR/xmlschema-2/#unsignedInt
On Fri, Dec 4, 2009 at 17:13, Anup Mayank <an...@gmail.com> wrote:
>
> /** validate the value against the xsd definition */
> 79 public static boolean isValid(long iValue) {
> 80 return !((iValue < 0L) || (iValue > 4294967295L));
> 81 }
> This is the source code of Unsigned int where it validates if a number is of proper value or not. I am not sure how the particular max number is chosen. But since your date value is out of range it is throwing exception. Axis folks please explain this range?
>
> Anup
> On Fri, Dec 4, 2009 at 8:01 AM, ram <ra...@yahoo.co.in> wrote:
>>
>> Hi,
>> I am trying to convert java.util.date to UnsignedInt(). I am getting NumberFormatException
>> I am fetching the date from database. I am converting unsignedInt() like the following
>>
>> new UnsignedInt(info.getdate.getTime())
>>
>> when i print date i am getting 1259937492847. so where do i am doing mistake.
>> Can any onehelp to fix this issue.
>>
>>
>> Thanks & Regards,
>> Ram
>>
>> ________________________________
>> The INTERNET now has a personality. YOURS! See your Yahoo! Homepage.
The INTERNET now has a personality. YOURS! See your Yahoo! Homepage. http://in.yahoo.com/
Re: java.util.date convertion to UnsignedInt problem
Posted by Andreas Veithen <an...@gmail.com>.
Please have a look at [1].
Andreas
[1] http://www.w3.org/TR/xmlschema-2/#unsignedInt
On Fri, Dec 4, 2009 at 17:13, Anup Mayank <an...@gmail.com> wrote:
>
> /** validate the value against the xsd definition */
> 79 public static boolean isValid(long iValue) {
> 80 return !((iValue < 0L) || (iValue > 4294967295L));
> 81 }
> This is the source code of Unsigned int where it validates if a number is of proper value or not. I am not sure how the particular max number is chosen. But since your date value is out of range it is throwing exception. Axis folks please explain this range?
>
> Anup
> On Fri, Dec 4, 2009 at 8:01 AM, ram <ra...@yahoo.co.in> wrote:
>>
>> Hi,
>> I am trying to convert java.util.date to UnsignedInt(). I am getting NumberFormatException
>> I am fetching the date from database. I am converting unsignedInt() like the following
>>
>> new UnsignedInt(info.getdate.getTime())
>>
>> when i print date i am getting 1259937492847. so where do i am doing mistake.
>> Can any onehelp to fix this issue.
>>
>>
>> Thanks & Regards,
>> Ram
>>
>> ________________________________
>> The INTERNET now has a personality. YOURS! See your Yahoo! Homepage.
Re: java.util.date convertion to UnsignedInt problem
Posted by Anup Mayank <an...@gmail.com>.
use unsigned long
On Fri, Dec 4, 2009 at 11:29 PM, ram <ra...@yahoo.co.in> wrote:
> can any one suggest me how to fix this issue.
>
> Thanks & Regards,
> Ram
>
>
> --- On *Fri, 4/12/09, Anup Mayank <an...@gmail.com>* wrote:
>
>
> From: Anup Mayank <an...@gmail.com>
> Subject: Re: java.util.date convertion to UnsignedInt problem
> To: axis-user@ws.apache.org
> Date: Friday, 4 December, 2009, 9:55 PM
>
>
> Yes you are right about the long values. But it looks like UnsignedInt
> doesn't accept all long values. In java signed int is -2,147,483,648 to
> 2,147,483,647. So UnsignedInt implementation simply accepts something in the
> range of 0-4294967295. We need to understand the basic difference between
> unsigned int and a long value.
>
> Hope it helps.
> Anup
>
> On Fri, Dec 4, 2009 at 8:18 AM, ram <ra...@yahoo.co.in>
> > wrote:
>
>> Hi Anup,
>> thats true, but long datatype range is
>>
>> *long*: The long data type is a 64-bit signed two's complement integer.
>> It has a minimum value of -9,223,372,036,854,775,808 and a maximum value of
>> 9,223,372,036,854,775,807 (inclusive).
>>
>> so its is in the range of long only, new UnsignedInt(long)
>> throwing exception, its little bit strange.
>>
>> Thanks & Regards,
>> Ram
>>
>>
>> --- On *Fri, 4/12/09, Anup Mayank <an...@gmail.com>
>> >* wrote:
>>
>>
>> From: Anup Mayank <an...@gmail.com>
>> >
>> Subject: Re: java.util.date convertion to UnsignedInt problem
>> To: axis-user@ws.apache.org<ht...@ws.apache.org>
>> Date: Friday, 4 December, 2009, 9:43 PM
>>
>>
>> /** validate the value against the xsd definition */ 79 public static
>> boolean isValid(long iValue) { 80 return !((iValue < 0L) || (iValue >
>> 4294967295L)); 81 }
>> This is the source code of Unsigned int where it validates if a number is
>> of proper value or not. I am not sure how the particular max number is
>> chosen. But since your date value is out of range it is throwing exception.
>> Axis folks please explain this range?
>>
>> Anup
>> On Fri, Dec 4, 2009 at 8:01 AM, ram <ra...@yahoo.co.in>
>> > wrote:
>>
>>> Hi,
>>> I am trying to convert java.util.date to UnsignedInt(). I am getting
>>> NumberFormatException
>>> I am fetching the date from database. I am converting unsignedInt()
>>> like the following
>>>
>>> new UnsignedInt(info.getdate.getTime())
>>>
>>> when i print date i am getting 1259937492847. so where do i am
>>> doing mistake.
>>> Can any onehelp to fix this issue.
>>>
>>>
>>> Thanks & Regards,
>>> Ram
>>>
>>> ------------------------------
>>> The INTERNET now has a personality. YOURS! See your Yahoo! Homepage<http://in.rd.yahoo.com/tagline_yyi_1/*http://in.yahoo.com/>
>>> .
>>>
>>
>>
>> ------------------------------
>> The INTERNET now has a personality. YOURS! See your Yahoo! Homepage<http://in.rd.yahoo.com/tagline_yyi_1/*http://in.yahoo.com/>
>> .
>>
>
>
> ------------------------------
> The INTERNET now has a personality. YOURS! See your Yahoo! Homepage<http://in.rd.yahoo.com/tagline_yyi_1/*http://in.yahoo.com/>
> .
>
Re: java.util.date convertion to UnsignedInt problem
Posted by ram <ra...@yahoo.co.in>.
can any one suggest me how to fix this issue.
Thanks & Regards,
Ram
--- On Fri, 4/12/09, Anup Mayank <an...@gmail.com> wrote:
From: Anup Mayank <an...@gmail.com>
Subject: Re: java.util.date convertion to UnsignedInt problem
To: axis-user@ws.apache.org
Date: Friday, 4 December, 2009, 9:55 PM
Yes you are right about the long values. But it looks like UnsignedInt doesn't accept all long values. In java signed int is -2,147,483,648 to
2,147,483,647. So UnsignedInt implementation simply accepts something in the range of 0-4294967295. We need to understand the basic difference between unsigned int and a long value.
Hope it helps.
Anup
On Fri, Dec 4, 2009 at 8:18 AM, ram <ra...@yahoo.co.in> wrote:
Hi Anup,
thats true, but long datatype range is
long: The long data type is a 64-bit signed two's complement integer. It has a minimum value of
-9,223,372,036,854,775,808 and a maximum value of 9,223,372,036,854,775,807 (inclusive).
so its is in the range of long only, new UnsignedInt(long) throwing exception, its little bit strange.
Thanks & Regards,
Ram
--- On Fri, 4/12/09, Anup Mayank <an...@gmail.com> wrote:
From: Anup Mayank <an...@gmail.com>
Subject: Re: java.util.date convertion to UnsignedInt problem
To: axis-user@ws.apache.org
Date: Friday, 4 December, 2009, 9:43 PM
/** validate the value against the xsd definition */
79
public static boolean isValid(long iValue) {
80
return !((iValue < 0L) || (iValue > 4294967295L));
81
}
This is the source code of Unsigned int where it validates if a number is of proper value or not. I am not sure how the particular max number is chosen. But since your date value is out of range it is throwing exception. Axis folks please explain this range?
Anup
On Fri, Dec 4, 2009 at 8:01 AM, ram <ra...@yahoo.co.in> wrote:
Hi,
I am trying to convert java.util.date to UnsignedInt(). I am getting NumberFormatException
I am fetching the date from database. I am converting unsignedInt() like the following
new UnsignedInt(info.getdate.getTime())
when i print date i am getting 1259937492847. so where do i am doing mistake.
Can any onehelp to fix this issue.
Thanks & Regards,
Ram
The INTERNET now has a personality. YOURS! See your Yahoo! Homepage.
The INTERNET now has a personality. YOURS! See your Yahoo! Homepage.
The INTERNET now has a personality. YOURS! See your Yahoo! Homepage. http://in.yahoo.com/
Re: java.util.date convertion to UnsignedInt problem
Posted by Anup Mayank <an...@gmail.com>.
Yes you are right about the long values. But it looks like UnsignedInt
doesn't accept all long values. In java signed int is -2,147,483,648 to
2,147,483,647. So UnsignedInt implementation simply accepts something in the
range of 0-4294967295. We need to understand the basic difference between
unsigned int and a long value.
Hope it helps.
Anup
On Fri, Dec 4, 2009 at 8:18 AM, ram <ra...@yahoo.co.in> wrote:
> Hi Anup,
> thats true, but long datatype range is
>
> *long*: The long data type is a 64-bit signed two's complement integer. It
> has a minimum value of -9,223,372,036,854,775,808 and a maximum value of
> 9,223,372,036,854,775,807 (inclusive).
>
> so its is in the range of long only, new UnsignedInt(long)
> throwing exception, its little bit strange.
>
> Thanks & Regards,
> Ram
>
>
> --- On *Fri, 4/12/09, Anup Mayank <an...@gmail.com>* wrote:
>
>
> From: Anup Mayank <an...@gmail.com>
> Subject: Re: java.util.date convertion to UnsignedInt problem
> To: axis-user@ws.apache.org
> Date: Friday, 4 December, 2009, 9:43 PM
>
>
> /** validate the value against the xsd definition */ 79 public static
> boolean isValid(long iValue) { 80 return !((iValue < 0L) || (iValue >
> 4294967295L)); 81 }
> This is the source code of Unsigned int where it validates if a number is
> of proper value or not. I am not sure how the particular max number is
> chosen. But since your date value is out of range it is throwing exception.
> Axis folks please explain this range?
>
> Anup
> On Fri, Dec 4, 2009 at 8:01 AM, ram <ra...@yahoo.co.in>
> > wrote:
>
>> Hi,
>> I am trying to convert java.util.date to UnsignedInt(). I am getting
>> NumberFormatException
>> I am fetching the date from database. I am converting unsignedInt() like
>> the following
>>
>> new UnsignedInt(info.getdate.getTime())
>>
>> when i print date i am getting 1259937492847. so where do i am
>> doing mistake.
>> Can any onehelp to fix this issue.
>>
>>
>> Thanks & Regards,
>> Ram
>>
>> ------------------------------
>> The INTERNET now has a personality. YOURS! See your Yahoo! Homepage<http://in.rd.yahoo.com/tagline_yyi_1/*http://in.yahoo.com/>
>> .
>>
>
>
> ------------------------------
> The INTERNET now has a personality. YOURS! See your Yahoo! Homepage<http://in.rd.yahoo.com/tagline_yyi_1/*http://in.yahoo.com/>
> .
>
Re: java.util.date convertion to UnsignedInt problem
Posted by ram <ra...@yahoo.co.in>.
Hi Anup,
thats true, but long datatype range is
long: The long data type is a 64-bit signed two's complement integer. It has a minimum value of
-9,223,372,036,854,775,808 and a maximum value of 9,223,372,036,854,775,807 (inclusive).
so its is in the range of long only, new UnsignedInt(long) throwing exception, its little bit strange.
Thanks & Regards,
Ram
--- On Fri, 4/12/09, Anup Mayank <an...@gmail.com> wrote:
From: Anup Mayank <an...@gmail.com>
Subject: Re: java.util.date convertion to UnsignedInt problem
To: axis-user@ws.apache.org
Date: Friday, 4 December, 2009, 9:43 PM
/** validate the value against the xsd definition */
79
public static boolean isValid(long iValue) {
80
return !((iValue < 0L) || (iValue > 4294967295L));
81
}
This is the source code of Unsigned int where it validates if a number is of proper value or not. I am not sure how the particular max number is chosen. But since your date value is out of range it is throwing exception. Axis folks please explain this range?
Anup
On Fri, Dec 4, 2009 at 8:01 AM, ram <ra...@yahoo.co.in> wrote:
Hi,
I am trying to convert java.util.date to UnsignedInt(). I am getting NumberFormatException
I am fetching the date from database. I am converting unsignedInt() like the following
new UnsignedInt(info.getdate.getTime())
when i print date i am getting 1259937492847. so where do i am doing mistake.
Can any onehelp to fix this issue.
Thanks & Regards,
Ram
The INTERNET now has a personality. YOURS! See your Yahoo! Homepage.
The INTERNET now has a personality. YOURS! See your Yahoo! Homepage. http://in.yahoo.com/
Re: java.util.date convertion to UnsignedInt problem
Posted by Anup Mayank <an...@gmail.com>.
/** validate the value against the xsd definition */ 79 public static
boolean isValid(long iValue) { 80 return !((iValue < 0L) || (iValue >
4294967295L)); 81 }
This is the source code of Unsigned int where it validates if a number is of
proper value or not. I am not sure how the particular max number is chosen.
But since your date value is out of range it is throwing exception. Axis
folks please explain this range?
Anup
On Fri, Dec 4, 2009 at 8:01 AM, ram <ra...@yahoo.co.in> wrote:
> Hi,
> I am trying to convert java.util.date to UnsignedInt(). I am getting
> NumberFormatException
> I am fetching the date from database. I am converting unsignedInt() like
> the following
>
> new UnsignedInt(info.getdate.getTime())
>
> when i print date i am getting 1259937492847. so where do i am
> doing mistake.
> Can any onehelp to fix this issue.
>
>
> Thanks & Regards,
> Ram
>
> ------------------------------
> The INTERNET now has a personality. YOURS! See your Yahoo! Homepage<http://in.rd.yahoo.com/tagline_yyi_1/*http://in.yahoo.com/>
> .
>