-1

Why does the class generated by protoc generates the following compile errors?

Description Resource Path Location Type Cannot override the final method
from GeneratedMessage AddressBookProtos.java
/monitor/src/main/resources/com/example/tutorial line 102 Java Problem
Cannot override the final method from GeneratedMessage
AddressBookProtos.java /monitor/src/main/resources/com/example/tutorial
line 339 Java Problem Cannot override the final method from
GeneratedMessage AddressBookProtos.java

and my pom.xml::

<dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.7.6</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>1.7.6</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-mapper-asl</artifactId>
            <version>1.9.13</version>
        </dependency>
        <dependency>
            <groupId>com.google.protobuf</groupId>
            <artifactId>protobuf-java</artifactId>
            <version>2.4.1</version>
        </dependency>
    </dependencies>
Anthon
  • 69,918
  • 32
  • 186
  • 246
topCoder
  • 95
  • 8

1 Answers1

-1

I don't think that your pom file is relevant here. The error messages are quite clear: you cannot override the final method. The word final is used for the methods to avoid overriding, so removing final should help, otherwise include the code.

Rufi
  • 2,529
  • 1
  • 20
  • 41