Avro
  1. Avro
  2. AVRO-282

avroj build broken depending on build order

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3.0
    • Component/s: java
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      If you build avroj without having built the tests, there's no logging framework implementation, and you get

      "Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder"

      when running

      java -jar build/avroj-1.2.0-dev.jar rpcsend '{"protocol":"sleepy","namespace":null,"types":[],"messages":{"sleep":{"request":[{"name":"millis","type":"long"}],"response":"null"}}}' sleep localhost 7002 '{"millis": 203}'

      1. AVRO-282.patch.txt
        3 kB
        Philip Zeyliger

        Activity

        Hide
        Philip Zeyliger added a comment -

        Here's what's going on. The "avroj" target packs up in the jar whatever happens to match in build/lib/*.jar. If you've run "avro test-java" beforehand, that will include slf4j-simple, and everything will be fine. If not, it won't work.

        I'm by no means an Ivy expert. The patch I'm attaching introduces two new ivy configurations: "build" (for build dependencies, like javacc) and "avroj" (for avroj's runtime dependencies). The ivy-retrieve-avroj target will ask ivy to download avroj's dependencies in a separate directory, which gets packaged up during the avroj target. (So, no longer will avroj include random stuff from build/lib. Specifically, it won't include javacc.) Similarly, folks who depend on Avro, shouldn't need to get javacc either.

        I suspect there are still too many dependencies: paranamer pulls in all of ant, which isn't strictly necessary.

        Show
        Philip Zeyliger added a comment - Here's what's going on. The "avroj" target packs up in the jar whatever happens to match in build/lib/*.jar. If you've run "avro test-java" beforehand, that will include slf4j-simple, and everything will be fine. If not, it won't work. I'm by no means an Ivy expert. The patch I'm attaching introduces two new ivy configurations: "build" (for build dependencies, like javacc) and "avroj" (for avroj's runtime dependencies). The ivy-retrieve-avroj target will ask ivy to download avroj's dependencies in a separate directory, which gets packaged up during the avroj target. (So, no longer will avroj include random stuff from build/lib. Specifically, it won't include javacc.) Similarly, folks who depend on Avro, shouldn't need to get javacc either. I suspect there are still too many dependencies: paranamer pulls in all of ant, which isn't strictly necessary.
        Hide
        Doug Cutting added a comment -

        I just committed this. Thanks, Philip!

        Show
        Doug Cutting added a comment - I just committed this. Thanks, Philip!

          People

          • Assignee:
            Philip Zeyliger
            Reporter:
            Philip Zeyliger
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development