avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Casadio Phaedra <Phaedra.Casa...@datamanagementpa.it>
Subject java.util.Date RPC AvroRuntimeException
Date Thu, 12 Feb 2015 10:48:51 GMT
Hi, I'm trying to pass a date object trough avro IPC, but I'm caught in this situation:

Exception without union

  record Movement {
    @java-class("java.util.Date") string dtStart;
  }

2015-02-12 11:42:32,510 WARN  org.apache.avro.ipc.Responder.warn(363) system error
java.lang.ClassCastException: java.util.Date cannot be cast to java.lang.CharSequence
               at org.apache.avro.generic.GenericDatumWriter.writeString(GenericDatumWriter.java:213)
               at org.apache.avro.specific.SpecificDatumWriter.writeString(SpecificDatumWriter.java:69)
               at org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:76)
               at org.apache.avro.generic.GenericDatumWriter.writeField(GenericDatumWriter.java:114)
               at org.apache.avro.generic.GenericDatumWriter.writeRecord(GenericDatumWriter.java:104)
               at org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:66)
               at org.apache.avro.generic.GenericDatumWriter.writeArray(GenericDatumWriter.java:138)
               at org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:68)
               at org.apache.avro.generic.GenericDatumWriter.writeField(GenericDatumWriter.java:114)
               at org.apache.avro.generic.GenericDatumWriter.writeRecord(GenericDatumWriter.java:104)
               at org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:66)
               at org.apache.avro.generic.GenericDatumWriter.writeArray(GenericDatumWriter.java:138)
               at org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:68)
               at org.apache.avro.generic.GenericDatumWriter.writeField(GenericDatumWriter.java:114)
               at org.apache.avro.generic.GenericDatumWriter.writeRecord(GenericDatumWriter.java:104)
               at org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:66)
               at org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:58)
               at org.apache.avro.ipc.generic.GenericResponder.writeResponse(GenericResponder.java:68)
               at org.apache.avro.ipc.Responder.respond(Responder.java:166)
               at org.apache.avro.ipc.Responder.respond(Responder.java:99)
               at org.apache.avro.ipc.ResponderServlet.doPost(ResponderServlet.java:48)
               at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
               at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
               at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
               at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
               at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
               at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
               at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
               at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
               at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
               at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
               at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
               at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
               at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
               at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
               at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
               at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
               at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
               at java.lang.Thread.run(Thread.java:744)

Exception with union:

  record Movement {
    union(null, @java-class("java.util.Date") string) dtStart;
  }

2015-02-12 11:15:03,009 WARN  org.apache.avro.ipc.Responder.warn(363) system error
org.apache.avro.AvroRuntimeException: Unknown datum type java.util.Date: Fri Nov 14 13:54:16
CET 2014
               at org.apache.avro.generic.GenericData.getSchemaName(GenericData.java:636)
               at org.apache.avro.specific.SpecificData.getSchemaName(SpecificData.java:265)
               at org.apache.avro.generic.GenericData.resolveUnion(GenericData.java:601)
               at org.apache.avro.generic.GenericDatumWriter.resolveUnion(GenericDatumWriter.java:151)
               at org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:71)
               at org.apache.avro.generic.GenericDatumWriter.writeField(GenericDatumWriter.java:114)
               at org.apache.avro.generic.GenericDatumWriter.writeRecord(GenericDatumWriter.java:104)
               at org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:66)
               at org.apache.avro.generic.GenericDatumWriter.writeArray(GenericDatumWriter.java:138)
               at org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:68)
               at org.apache.avro.generic.GenericDatumWriter.writeField(GenericDatumWriter.java:114)
               at org.apache.avro.generic.GenericDatumWriter.writeRecord(GenericDatumWriter.java:104)
               at org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:66)
               at org.apache.avro.generic.GenericDatumWriter.writeArray(GenericDatumWriter.java:138)
               at org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:68)
               at org.apache.avro.generic.GenericDatumWriter.writeField(GenericDatumWriter.java:114)
               at org.apache.avro.generic.GenericDatumWriter.writeRecord(GenericDatumWriter.java:104)
               at org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:66)
               at org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:58)
               at org.apache.avro.ipc.generic.GenericResponder.writeResponse(GenericResponder.java:68)
               at org.apache.avro.ipc.Responder.respond(Responder.java:166)
               at org.apache.avro.ipc.Responder.respond(Responder.java:99)
               at org.apache.avro.ipc.ResponderServlet.doPost(ResponderServlet.java:48)
               at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
               at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
               at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
               at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
               at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
               at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
               at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
               at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
               at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
               at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
               at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
               at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
               at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
               at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
               at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
               at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
               at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
               at java.lang.Thread.run(Thread.java:744)



Mime
View raw message