Home » Eclipse Projects » Riena » How safe is to send two parameters of the same type?
How safe is to send two parameters of the same type? [message #20551] |
Thu, 05 February 2009 13:29 |
Velganesh Subramanian Messages: 69 Registered: July 2009 |
Member |
|
|
Please excuse if this is a classical question w.r.to remote calls.
I have to send two dates to the server. The type is GregorianCalendar. I
programmed as individual parameters as well as wrapped in an object. I
debugged the reflection call and all is well in the client. But on the
server, the second value is overwritten with the first value. What am I
doing wrong? Can you please suggest an alternative?
fromDate
java.util.GregorianCalendar[time=1233837733852,areFieldsSet= true,areAllFieldsSet=true,lenient=true,zone=sun.util.calenda r.ZoneInfo[id= "Asia/Calcutta" ,offset=19800000,dstSavings=0,useDaylight=false,transitions= 6,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,E RA=1,YEAR=2009,MONTH=1,WEEK_OF_YEAR=6,WEEK_OF_MONTH=1,DAY_OF _MONTH=5,DAY_OF_YEAR=36,DAY_OF_WEEK=5,DAY_OF_WEEK_IN_MONTH=1 ,AM_PM=1,HOUR=6,HOUR_OF_DAY=18,MINUTE=12,SECOND=13,MILLISECO ND=852,ZONE_OFFSET=19800000,DST_OFFSET=0]
tillDate
java.util.GregorianCalendar[time=1233837733852,areFieldsSet= true,areAllFieldsSet=true,lenient=true,zone=sun.util.calenda r.ZoneInfo[id= "Asia/Calcutta" ,offset=19800000,dstSavings=0,useDaylight=false,transitions= 6,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,E RA=1,YEAR=2009,MONTH=1,WEEK_OF_YEAR=6,WEEK_OF_MONTH=1,DAY_OF _MONTH=5,DAY_OF_YEAR=36,DAY_OF_WEEK=5,DAY_OF_WEEK_IN_MONTH=1 ,AM_PM=1,HOUR=6,HOUR_OF_DAY=18,MINUTE=12,SECOND=13,MILLISECO ND=852,ZONE_OFFSET=19800000,DST_OFFSET=0]
|
|
|
Re: How safe is to send two parameters of the same type? [message #20561 is a reply to message #20551] |
Fri, 06 February 2009 14:22 |
Christian Campo Messages: 597 Registered: July 2009 |
Senior Member |
|
|
Velganesh Subramanian schrieb:
> Please excuse if this is a classical question w.r.to remote calls.
>
> I have to send two dates to the server. The type is GregorianCalendar. I
> programmed as individual parameters as well as wrapped in an object. I
> debugged the reflection call and all is well in the client. But on the
> server, the second value is overwritten with the first value. What am I
> doing wrong? Can you please suggest an alternative?
>
> fromDate
> java.util.GregorianCalendar[time=1233837733852,areFieldsSet= true,areAllFieldsSet=true,lenient=true,zone=sun.util.calenda r.ZoneInfo[id= "Asia/Calcutta" ,offset=19800000,dstSavings=0,useDaylight=false,transitions= 6,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,E RA=1,YEAR=2009,MONTH=1,WEEK_OF_YEAR=6,WEEK_OF_MONTH=1,DAY_OF _MONTH=5,DAY_OF_YEAR=36,DAY_OF_WEEK=5,DAY_OF_WEEK_IN_MONTH=1 ,AM_PM=1,HOUR=6,HOUR_OF_DAY=18,MINUTE=12,SECOND=13,MILLISECO ND=852,ZONE_OFFSET=19800000,DST_OFFSET=0]
>
>
>
> tillDate
> java.util.GregorianCalendar[time=1233837733852,areFieldsSet= true,areAllFieldsSet=true,lenient=true,zone=sun.util.calenda r.ZoneInfo[id= "Asia/Calcutta" ,offset=19800000,dstSavings=0,useDaylight=false,transitions= 6,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,E RA=1,YEAR=2009,MONTH=1,WEEK_OF_YEAR=6,WEEK_OF_MONTH=1,DAY_OF _MONTH=5,DAY_OF_YEAR=36,DAY_OF_WEEK=5,DAY_OF_WEEK_IN_MONTH=1 ,AM_PM=1,HOUR=6,HOUR_OF_DAY=18,MINUTE=12,SECOND=13,MILLISECO ND=852,ZONE_OFFSET=19800000,DST_OFFSET=0]
>
>
>
The problem does not seem to be that you send two parameters of the same type but the Gregorian Calendar. The Hessian
protocol that is used for Remote Services seems to have an issue with. If you look closer you will find, that
GregorianCalendar instance that you receive is actually not the one you sent but is alway to current date and time no
matter what you send. Thats why they look similar. Specifying a Calendar alone in the signature fails with a NullPointer.
- A workaround is to use Date and/or Time (depending on whether you need the time).
- Open a Bugzilla. Even though its a third party library I think we can fix it. (However since I am before 2 weeks
vacation that might have to wait until after that)
I continue to play around a little but not sure that will have any result before my vacation.
dont forget to open a bugzilla and we fix that as soon as we find the time......
christian
|
|
|
Re: How safe is to send two parameters of the same type? [message #20570 is a reply to message #20561] |
Mon, 09 February 2009 08:36 |
Stefan Liebig Messages: 124 Registered: July 2009 |
Senior Member |
|
|
Christian Campo wrote:
> Velganesh Subramanian schrieb:
>> Please excuse if this is a classical question w.r.to remote calls.
>>
>> I have to send two dates to the server. The type is GregorianCalendar.
>> I programmed as individual parameters as well as wrapped in an object.
>> I debugged the reflection call and all is well in the client. But on
>> the server, the second value is overwritten with the first value. What
>> am I doing wrong? Can you please suggest an alternative?
>>
>> fromDate
>> java.util.GregorianCalendar[time=1233837733852,areFieldsSet= true,areAllFieldsSet=true,lenient=true,zone=sun.util.calenda r.ZoneInfo[id= "Asia/Calcutta" ,offset=19800000,dstSavings=0,useDaylight=false,transitions= 6,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,E RA=1,YEAR=2009,MONTH=1,WEEK_OF_YEAR=6,WEEK_OF_MONTH=1,DAY_OF _MONTH=5,DAY_OF_YEAR=36,DAY_OF_WEEK=5,DAY_OF_WEEK_IN_MONTH=1 ,AM_PM=1,HOUR=6,HOUR_OF_DAY=18,MINUTE=12,SECOND=13,MILLISECO ND=852,ZONE_OFFSET=19800000,DST_OFFSET=0]
>>
>>
>>
>> tillDate
>> java.util.GregorianCalendar[time=1233837733852,areFieldsSet= true,areAllFieldsSet=true,lenient=true,zone=sun.util.calenda r.ZoneInfo[id= "Asia/Calcutta" ,offset=19800000,dstSavings=0,useDaylight=false,transitions= 6,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,E RA=1,YEAR=2009,MONTH=1,WEEK_OF_YEAR=6,WEEK_OF_MONTH=1,DAY_OF _MONTH=5,DAY_OF_YEAR=36,DAY_OF_WEEK=5,DAY_OF_WEEK_IN_MONTH=1 ,AM_PM=1,HOUR=6,HOUR_OF_DAY=18,MINUTE=12,SECOND=13,MILLISECO ND=852,ZONE_OFFSET=19800000,DST_OFFSET=0]
>>
>>
>>
> The problem does not seem to be that you send two parameters of the same
> type but the Gregorian Calendar. The Hessian protocol that is used for
> Remote Services seems to have an issue with. If you look closer you will
> find, that GregorianCalendar instance that you receive is actually not
> the one you sent but is alway to current date and time no matter what
> you send. Thats why they look similar. Specifying a Calendar alone in
> the signature fails with a NullPointer.
>
> - A workaround is to use Date and/or Time (depending on whether you need
> the time).
> - Open a Bugzilla. Even though its a third party library I think we can
> fix it. (However since I am before 2 weeks vacation that might have to
> wait until after that)
>
> I continue to play around a little but not sure that will have any
> result before my vacation.
>
> dont forget to open a bugzilla and we fix that as soon as we find the
> time......
>
> christian
I wrote a GregorianCalendarSerializerFactory that should fix that issue.
You can get it from cvs HEAD
(org.eclipse.riena.internal.communication.factory.hessian.Gr egorianCalendarSerializerFactory).
This factory is contributed within the plugin.xml of the same bundle.
Stefan
|
|
|
Re: How safe is to send two parameters of the same type? [message #578653 is a reply to message #20551] |
Fri, 06 February 2009 14:22 |
Christian Campo Messages: 597 Registered: July 2009 |
Senior Member |
|
|
Velganesh Subramanian schrieb:
> Please excuse if this is a classical question w.r.to remote calls.
>
> I have to send two dates to the server. The type is GregorianCalendar. I
> programmed as individual parameters as well as wrapped in an object. I
> debugged the reflection call and all is well in the client. But on the
> server, the second value is overwritten with the first value. What am I
> doing wrong? Can you please suggest an alternative?
>
> fromDate
> java.util.GregorianCalendar[time=1233837733852,areFieldsSet= true,areAllFieldsSet=true,lenient=true,zone=sun.util.calenda r.ZoneInfo[id= "Asia/Calcutta" ,offset=19800000,dstSavings=0,useDaylight=false,transitions= 6,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,E RA=1,YEAR=2009,MONTH=1,WEEK_OF_YEAR=6,WEEK_OF_MONTH=1,DAY_OF _MONTH=5,DAY_OF_YEAR=36,DAY_OF_WEEK=5,DAY_OF_WEEK_IN_MONTH=1 ,AM_PM=1,HOUR=6,HOUR_OF_DAY=18,MINUTE=12,SECOND=13,MILLISECO ND=852,ZONE_OFFSET=19800000,DST_OFFSET=0]
>
>
>
> tillDate
> java.util.GregorianCalendar[time=1233837733852,areFieldsSet= true,areAllFieldsSet=true,lenient=true,zone=sun.util.calenda r.ZoneInfo[id= "Asia/Calcutta" ,offset=19800000,dstSavings=0,useDaylight=false,transitions= 6,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,E RA=1,YEAR=2009,MONTH=1,WEEK_OF_YEAR=6,WEEK_OF_MONTH=1,DAY_OF _MONTH=5,DAY_OF_YEAR=36,DAY_OF_WEEK=5,DAY_OF_WEEK_IN_MONTH=1 ,AM_PM=1,HOUR=6,HOUR_OF_DAY=18,MINUTE=12,SECOND=13,MILLISECO ND=852,ZONE_OFFSET=19800000,DST_OFFSET=0]
>
>
>
The problem does not seem to be that you send two parameters of the same type but the Gregorian Calendar. The Hessian
protocol that is used for Remote Services seems to have an issue with. If you look closer you will find, that
GregorianCalendar instance that you receive is actually not the one you sent but is alway to current date and time no
matter what you send. Thats why they look similar. Specifying a Calendar alone in the signature fails with a NullPointer.
- A workaround is to use Date and/or Time (depending on whether you need the time).
- Open a Bugzilla. Even though its a third party library I think we can fix it. (However since I am before 2 weeks
vacation that might have to wait until after that)
I continue to play around a little but not sure that will have any result before my vacation.
dont forget to open a bugzilla and we fix that as soon as we find the time......
christian
|
|
|
Re: How safe is to send two parameters of the same type? [message #578665 is a reply to message #20561] |
Mon, 09 February 2009 08:36 |
Stefan Liebig Messages: 124 Registered: July 2009 |
Senior Member |
|
|
Christian Campo wrote:
> Velganesh Subramanian schrieb:
>> Please excuse if this is a classical question w.r.to remote calls.
>>
>> I have to send two dates to the server. The type is GregorianCalendar.
>> I programmed as individual parameters as well as wrapped in an object.
>> I debugged the reflection call and all is well in the client. But on
>> the server, the second value is overwritten with the first value. What
>> am I doing wrong? Can you please suggest an alternative?
>>
>> fromDate
>> java.util.GregorianCalendar[time=1233837733852,areFieldsSet= true,areAllFieldsSet=true,lenient=true,zone=sun.util.calenda r.ZoneInfo[id= "Asia/Calcutta" ,offset=19800000,dstSavings=0,useDaylight=false,transitions= 6,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,E RA=1,YEAR=2009,MONTH=1,WEEK_OF_YEAR=6,WEEK_OF_MONTH=1,DAY_OF _MONTH=5,DAY_OF_YEAR=36,DAY_OF_WEEK=5,DAY_OF_WEEK_IN_MONTH=1 ,AM_PM=1,HOUR=6,HOUR_OF_DAY=18,MINUTE=12,SECOND=13,MILLISECO ND=852,ZONE_OFFSET=19800000,DST_OFFSET=0]
>>
>>
>>
>> tillDate
>> java.util.GregorianCalendar[time=1233837733852,areFieldsSet= true,areAllFieldsSet=true,lenient=true,zone=sun.util.calenda r.ZoneInfo[id= "Asia/Calcutta" ,offset=19800000,dstSavings=0,useDaylight=false,transitions= 6,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,E RA=1,YEAR=2009,MONTH=1,WEEK_OF_YEAR=6,WEEK_OF_MONTH=1,DAY_OF _MONTH=5,DAY_OF_YEAR=36,DAY_OF_WEEK=5,DAY_OF_WEEK_IN_MONTH=1 ,AM_PM=1,HOUR=6,HOUR_OF_DAY=18,MINUTE=12,SECOND=13,MILLISECO ND=852,ZONE_OFFSET=19800000,DST_OFFSET=0]
>>
>>
>>
> The problem does not seem to be that you send two parameters of the same
> type but the Gregorian Calendar. The Hessian protocol that is used for
> Remote Services seems to have an issue with. If you look closer you will
> find, that GregorianCalendar instance that you receive is actually not
> the one you sent but is alway to current date and time no matter what
> you send. Thats why they look similar. Specifying a Calendar alone in
> the signature fails with a NullPointer.
>
> - A workaround is to use Date and/or Time (depending on whether you need
> the time).
> - Open a Bugzilla. Even though its a third party library I think we can
> fix it. (However since I am before 2 weeks vacation that might have to
> wait until after that)
>
> I continue to play around a little but not sure that will have any
> result before my vacation.
>
> dont forget to open a bugzilla and we fix that as soon as we find the
> time......
>
> christian
I wrote a GregorianCalendarSerializerFactory that should fix that issue.
You can get it from cvs HEAD
(org.eclipse.riena.internal.communication.factory.hessian.Gr egorianCalendarSerializerFactory).
This factory is contributed within the plugin.xml of the same bundle.
Stefan
|
|
|
Goto Forum:
Current Time: Fri Sep 13 08:20:55 GMT 2024
Powered by FUDForum. Page generated in 0.04156 seconds
|