<style type="text/css">
<!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color

1F497D;}
.MsoChpDefault
{mso-style-type:export-only;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
{page:Section1;}
-->
</style>
Hi Juan,
Which version of Etch are you using? For some time now, Etch
supports the type ‘Datetime’ natively (case sensitive).
You might want to try that instead. Not to say you don’t have a
problem with Extern—but I’m just pointing you in this other direction because
1) it probably makes more sense to just use the Etch native type, and 2) I
haven’t use extern myself and don’t know much about debugging.
Thanks for letting us know about the Etch forum; we’ll check it
out.
Seth
From:etch-bounces@developer.cisco.com mailto:etch-bounces@developer.cisco.com
On
Behalf Of Juan Padilla Julian
Sent: Wednesday, October 08, 2008 6:56 AM
To: etch@developer.cisco.com
Subject: Etch extern date
Hello,
I have finished a RPC system for my java application using Etch.
I think Etch is a powerful RPC system because I have only needed two weeks for
make this work (I'm using exceptions, structs, client calls, timeouts, null
values, etc.)
At this moment all java.util.Date parameters of my service are passed as long
types and now I want change it to 'extern date' but I'm having problems.
I'm using a simple service to do this tests.
This is service definition:
----------------------------------
module com.speedycontrol.testdate.common
@Authorize( true ) @Timeout( 4000 )
service DateTimeService {
//@Extern( java, "java.util.Date", "",
"com.speedycontrol.etch.MyDateSerializer", "" )
@Extern( java, "java.util.Date", "",
"etch.bindings.java.util.DateSerializer", "" )
extern date
date getDateTime()
}
----------------------------------
When I run the client I have this exception:
----------------------------------
Exception in thread "main" java.lang.ExceptionInInitializerError
at
com.speedycontrol.testdate.common.DateTimeServiceHelper.newServer(DateTimeServiceHelper.java:113)
at com.speedycontrol.testdate.client.Main.main(Main.java:21)
Caused by: java.lang.IllegalArgumentException: type
com.speedycontrol.testdate.common.DateTimeService.date(-255586452): class class
java.util.Date is already mapped to type _Etch_Datetime(725183436)
at
etch.bindings.java.support.Class2TypeMap.put(Class2TypeMap.java:55)
at
etch.bindings.java.util.DateSerializer.init(DateSerializer.java:46)
at
com.speedycontrol.testdate.common.ValueFactoryDateTimeService.<clinit>(ValueFactoryDateTimeService.java:82)
... 2 more
----------------------------------
I have tried using 'etch.binding.java.util.DateSerializer' and with my own
serializer (clone of previous).
I see that method etc.binding.java.util.DateSerializer.init() is called two
times.
* First time is called from
etch.bindings.java.support.DefaultValueFactory.init(..)
* Second time from my extern definition (then throws exception).
Only when I remove first call, the client work properly
What must I do ?
I send this message to mailing list because I can't send a new topic in Etch
forum. I tried with IE, Firefox and Chrome last two weeks and I can't send (I
think this page has some problem).
_______________________________________________
Etch mailing list
Etch@developer.cisco.com