Skip to content
This repository has been archived by the owner on May 3, 2022. It is now read-only.

build error libhttp-hjar.jar #31

Open
VitaliKaiser opened this issue Sep 20, 2018 · 3 comments
Open

build error libhttp-hjar.jar #31

VitaliKaiser opened this issue Sep 20, 2018 · 3 comments

Comments

@VitaliKaiser
Copy link

Hi,

when I run
bazel build greeter_tensorboard

I get the following error:

external/io_bazel_rules_closure/java/io/bazel/rules/closure/http/BUILD:17:1: Compiling Java headers external/io_bazel_rules_closure/java/io/bazel/rules/closure/http/libhttp-hjar.jar (10 files) and running annotation processors (ComponentProcessor) failed (Exit 1)
java.lang.RuntimeException: java.lang.NoClassDefFoundError: javax/annotation/Generated
	at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(JavacTaskImpl.java:158)
	at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:96)
	at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:90)
	at com.google.devtools.build.java.turbine.javac.JavacTurbineCompiler.compile(JavacTurbineCompiler.java:100)
	at com.google.devtools.build.java.turbine.javac.JavacTurbine.compile(JavacTurbine.java:145)
	at com.google.devtools.build.java.turbine.javac.JavacTurbine.compile(JavacTurbine.java:87)
	at com.google.devtools.build.java.turbine.javac.JavacTurbine.compile(JavacTurbine.java:80)
	at com.google.devtools.build.java.turbine.Turbine.compile(Turbine.java:119)
	at com.google.devtools.build.java.turbine.Turbine.compile(Turbine.java:69)
	at com.google.devtools.build.java.turbine.Turbine.main(Turbine.java:46)
Caused by: java.lang.NoClassDefFoundError: javax/annotation/Generated
	at dagger.internal.codegen.SourceFileGenerator.<clinit>(SourceFileGenerator.java:43)
	at dagger.internal.codegen.ComponentProcessor.initSteps(ComponentProcessor.java:119)
	at dagger.shaded.auto.common.BasicAnnotationProcessor.init(BasicAnnotationProcessor.java:119)
	at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$ProcessorState.<init>(JavacProcessingEnvironment.java:675)
	at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$DiscoveredProcessors$ProcessorStateIterator.next(JavacProcessingEnvironment.java:774)
	at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:869)
	at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.access$2200(JavacProcessingEnvironment.java:108)
	at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1206)
	at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1315)
	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1246)
	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:922)
	at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:100)
	at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(JavacTaskImpl.java:142)
	... 9 more
Caused by: java.lang.ClassNotFoundException: javax.annotation.Generated
	at java.base/java.net.URLClassLoader.findClass(Unknown Source)
	at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
	at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
	... 22 more
Target //greeter_tensorboard:greeter_tensorboard failed to build

compiling the current tensorboard source works out of the box.

I dont have to much experience with bazel, so maybe you could give me a hint?

Best,
Vitali

@nfelt
Copy link
Contributor

nfelt commented Sep 20, 2018

Can you provide the output of bazel version and java -version?

I'm guessing this is an issue with rules_closure, maybe this one: bazelbuild/rules_closure#275

Since TensorBoard builds today, it's possible this is fixed by updating rules_closure. Could you try, in your version of the plugin-example repo's WORKSPACE file, replacing the rules_closure http_archive here

http_archive(
name = "io_bazel_rules_closure",
sha256 = "6691c58a2cd30a86776dd9bb34898b041e37136f2dc7e24cadaeaf599c95c657",
strip_prefix = "rules_closure-08039ba8ca59f64248bb3b6ae016460fe9c9914f",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_closure/archive/08039ba8ca59f64248bb3b6ae016460fe9c9914f.tar.gz",
"https://github.com/bazelbuild/rules_closure/archive/08039ba8ca59f64248bb3b6ae016460fe9c9914f.tar.gz", # 2018-01-16
],
)

with the TensorBoard version here:
https://github.com/tensorflow/tensorboard/blob/2370c4803f5d5e68f7c3190267316259e259d3bf/WORKSPACE#L3-L11

@VitaliKaiser
Copy link
Author

Hi,

sorry for the late response!
I tried to to replace "io_bazel_rules_closure" but getting a new error 🙈

ERROR: /external/org_tensorflow_tensorboard/tensorboard/defs/web.bzl:25:1: file '@io_bazel_rules_closure//closure/private:defs.bzl' does not contain symbol 'CLOSURE_LIBRARY_DEPS_ATTR' (did you mean 'CLOSURE_LIBRARY_BASE_ATTR'?)
ERROR: /external/org_tensorflow_tensorboard/tensorboard/defs/web.bzl:418:34: Traceback (most recent call last):
	File "/external/org_tensorflow_tensorboard/tensorboard/defs/web.bzl", line 382
		rule(implementation = _tf_web_library, <3 more arguments>)
	File "/external/org_tensorflow_tensorboard/tensorboard/defs/web.bzl", line 385, in rule
		dict((CLUTZ_ATTRIBUTES.items() + {"pa...()))
	File "external/org_tensorflow_tensorboard/tensorboard/defs/web.bzl", line 385, in dict
		{"path": attr.string(), "srcs": attr.label_list(allow_files = True), "deps": attr.label_list(aspects = [web_aspect, clutz_aspect, legacy_js]), "exports": attr.label_list(), "data": attr.label_list(cfg = "data", allow_files = True), "suppress": attr.string_list(), "strip_prefix": attr.string(), "external_assets": attr.string_dict(default = {"/_/runfiles": "."}), "clutz_entry_points": attr.string_list(), "_execrooter": attr.label(default = Label("//tensorboard/scripts:execrooter"), executable = True, cfg = "host"), "_tsc": attr.label(default = Label("@com_microsoft_typescript//:tsc"), allow_files = True, executable = True, cfg = "host"), "_default_typings": attr.label(default = Label("//tensorboard:tf_web_library_default_typings"), allow_files = True), "_WebfilesServer": attr.label(default = Label("@io_bazel_rules_closure//java/io/bazel/rules/closure/webfiles/server:WebfilesServer"), executable = True, cfg = "host"), "_ClosureWorker": _CLOSURE_WORKER, "_closure_library_base": CLOSURE_LIBRARY_BASE_ATTR, "_closure_library_deps": CLOSURE_LIBRARY_DEPS_ATTR}.items()
	File "./external/org_tensorflow_tensorboard/tensorboard/defs/web.bzl", line 418, in {"path": attr.string
		CLOSURE_LIBRARY_DEPS_ATTR
name 'CLOSURE_LIBRARY_DEPS_ATTR' is not defined (did you mean 'CLOSURE_LIBRARY_BASE_ATTR'?)
ERROR: Skipping 'greeter_tensorboard': error loading package 'greeter_tensorboard': Extension file 'tensorboard/defs/web.bzl' has errors
WARNING: Target pattern parsing failed.

bazel version:
Build label: 0.17.1

java -version
java version "1.8.0_162"

Best,
Vitali

@vmayoral
Copy link

To me the suggestion from @nfelt did it. Here's the patch I used:

--- WORKSPACE	2018-12-15 15:28:23.319897000 +0000
+++ ../WORKSPACE	2018-12-15 15:28:17.178279000 +0000
@@ -13,11 +13,11 @@

 http_archive(
     name = "io_bazel_rules_closure",
-    sha256 = "a80acb69c63d5f6437b099c111480a4493bad4592015af2127a2f49fb7512d8d",
-    strip_prefix = "rules_closure-0.7.0",
+    sha256 = "b29a8bc2cb10513c864cb1084d6f38613ef14a143797cea0af0f91cd385f5e8c",
+    strip_prefix = "rules_closure-0.8.0",
     urls = [
-        "https://mirror.bazel.build/github.com/bazelbuild/rules_closure/archive/0.7.0.tar.gz",
-        "https://github.com/bazelbuild/rules_closure/archive/0.7.0.tar.gz",  # 2018-05-09
+        "https://mirror.bazel.build/github.com/bazelbuild/rules_closure/archive/0.8.0.tar.gz",
+        "https://github.com/bazelbuild/rules_closure/archive/0.8.0.tar.gz",  # 2018-08-03
     ],
 )
 

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants