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

Christophe Le Saec commented on AVRO-2177:
------------------------------------------

Hello;
Is this issue is now resolved by AVRO-2332 ? (As the [associated 
PR|https://github.com/apache/avro/pull/466/files#diff-e0c32eab6af2fb00c992cc4b4e7da398fb7c520e10fc2519b345f91ec56f4ea5]
 changed ProtobufData.getNamespace method)

> 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
(v8.20.10#820010)

Reply via email to