[ 
https://issues.apache.org/jira/browse/AVRO-2177?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16740324#comment-16740324
 ] 

Jonathan Beckman commented on AVRO-2177:
----------------------------------------

[[email protected]],

I'm also facing this issue, both with external proto files as well as my 
internal ones. It'd be very helpful if you could update the ticket with the fix.

 

Cheers

> avro-protobuf not honouring java_multiple_files option
> ------------------------------------------------------
>
>                 Key: AVRO-2177
>                 URL: https://issues.apache.org/jira/browse/AVRO-2177
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.8.2
>            Reporter: Mahesh Mudi
>            Priority: Major
>
> Using avro-protobuf for google protobuf timestamp models fails to extract 
> schema due to invalid namespace resolution.
>   
>  Proto model for timestamp has following options defined. 
> {code:java}
> option java_outer_classname = "TimestampProto";
> option java_multiple_files = true; 
> {code}
>  
>  That would mean that the generated code for Timestamp will be at 
> "com.google.protobuf.Timestamp" rather than 
> "com.google.protobuf.TimestampProto$Timestamp". 
>   
>  However, when I try to derive an avro schema from a proto model using google 
> timestamp, avro-protobuf is not honouring the java_multiple_files option and 
> tries to look for timestamp class at 
> "com.google.protobuf.TimestampProto$Timestamp"
>   
> {code:java}
> Caused by: java.lang.ClassNotFoundException: Failed to load 
> classcom.google.protobuf.TimestampProto$Timestamp
>  at org.apache.avro.util.ClassUtils.forName(ClassUtils.java:60)
>  at org.apache.avro.util.ClassUtils.forName(ClassUtils.java:36)
>  at 
> org.apache.avro.protobuf.ProtobufData.newRecord(ProtobufData.java:137){code}
>  
>  "getNamespace" of org.apache.avro.protobuf.ProtobufData ins't honouring 
> multiple files option there by breaking models that import google proto 
> definitions. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to