Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add --add-opens option to solve InaccessibleObjectException #101

Closed
wants to merge 11 commits into from

Conversation

KengoTODA
Copy link
Member

New Java9 package oracle-java9-installer=9b149+9b149arm-1~webupd8~0 was released at Jan/4th, and it introduced a build error to spotbugs.

This pull-request solves it by adding --add-opens option to GRADLE_OPTS envvar.

@KengoTODA
Copy link
Member Author

This pull-request is still unstable, we have another build failure as follows.
Currently I cannot set up Java9 environment in local due to network instability. If you have time, please try to reproduce this problem to find solution.

FAILURE: Build failed with an exception.

* What went wrong:
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at https://docs.gradle.org/3.2.1/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------

FAILURE: Build failed with an exception.

* What went wrong:
java.lang.ExceptionInInitializerError (no error message)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.


* Try:
Run with --info or --debug option to get more log output.

* Exception is:
org.gradle.api.GradleException: Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at https://docs.gradle.org/3.2.1/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------

FAILURE: Build failed with an exception.

* What went wrong:
java.lang.ExceptionInInitializerError (no error message)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

	at org.gradle.launcher.daemon.bootstrap.DaemonGreeter.parseDaemonOutput(DaemonGreeter.java:34)
	at org.gradle.launcher.daemon.client.DefaultDaemonStarter.startProcess(DefaultDaemonStarter.java:151)
	at org.gradle.launcher.daemon.client.DefaultDaemonStarter.startDaemon(DefaultDaemonStarter.java:134)
	at org.gradle.launcher.daemon.client.DefaultDaemonConnector.startDaemon(DefaultDaemonConnector.java:203)
	at org.gradle.launcher.daemon.client.DefaultDaemonConnector.connect(DefaultDaemonConnector.java:125)
	at org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.java:127)
	at org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.java:81)
	at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:51)
	at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:173)
	at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:244)
	at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:217)
	at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:33)
	at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
	at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
	at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
	at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:210)
	at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:174)
	at org.gradle.launcher.Main.doAction(Main.java:33)
	at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:538)
	at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:60)
	at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:37)
	at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:538)
	at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:31)
	at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:108)
	at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)

@KengoTODA
Copy link
Member Author


install:
- mkdir -p deps
- if [[ ! -e deps/eclipse.tar.gz ]]; then wget http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops/R-3.6.2-201102101200/eclipse-SDK-3.6.2-linux-gtk-x86_64.tar.gz -O deps/eclipse.tar.gz; fi
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3.6.2 is now 404 not found again...

@KengoTODA
Copy link
Member Author

KengoTODA commented Jan 14, 2017

I fixed one of known problems, however Java9 still have another problems. I'll continue investigation to solve.

@KengoTODA KengoTODA self-assigned this Jan 14, 2017
@KengoTODA
Copy link
Member Author

This is the current problem:

FAILURE: Build failed with an exception.
* Where:
Settings file '/home/travis/build/spotbugs/spotbugs/settings.gradle' line: 2
* What went wrong:
A problem occurred evaluating settings 'spotbugs'.
> No signature of method: java.io.File.exists() is applicable for argument types: () values: []
  Possible solutions: wait(), equals(java.lang.Object), wait(long), is(java.lang.Object), with(groovy.lang.Closure), print(java.io.PrintWriter)

I guess jigsaw makes java.io.File inaccessible.

@KengoTODA
Copy link
Member Author

Next problem is that, eclipse command exists with exit value 136.
I confirmed that all of Eclipse 3.6 ~ 4.2 have the same problem. I also confirmed that non-container based environment has the same problem.

:eclipsePlugin:generateCandidateP2MetadataJava 
HotSpot(TM) 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
(Eclipse:4647): GLib-GObject-WARNING **: invalid (NULL) pointer instance
(Eclipse:4647): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
(Eclipse:4647): Gtk-CRITICAL **: IA__gtk_settings_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed
(Eclipse:4647): GLib-GObject-CRITICAL **: g_object_get: assertion 'G_IS_OBJECT (object)' failed
(Eclipse:4647): GLib-GObject-WARNING **: value "TRUE" of type 'gboolean' is invalid or out of range for property 'visible' of type 'gboolean'
(Eclipse:4647): Gtk-CRITICAL **: IA__gtk_settings_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed
(Eclipse:4647): GLib-GObject-CRITICAL **: g_object_get: assertion 'G_IS_OBJECT (object)' failed
(Eclipse:4647): Gtk-WARNING **: Screen for GtkWindow not set; you must always set
a screen for a GtkWindow before using the window
(Eclipse:4647): Gdk-CRITICAL **: IA__gdk_pango_context_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed
(Eclipse:4647): Pango-CRITICAL **: pango_context_set_font_description: assertion 'context != NULL' failed
(Eclipse:4647): Pango-CRITICAL **: pango_context_set_base_dir: assertion 'context != NULL' failed
(Eclipse:4647): Pango-CRITICAL **: pango_context_set_language: assertion 'context != NULL' failed
(Eclipse:4647): Pango-CRITICAL **: pango_layout_new: assertion 'context != NULL' failed
(Eclipse:4647): Pango-CRITICAL **: pango_layout_set_text: assertion 'layout != NULL' failed
(Eclipse:4647): Pango-CRITICAL **: pango_layout_set_attributes: assertion 'layout != NULL' failed
(Eclipse:4647): Pango-CRITICAL **: pango_layout_set_alignment: assertion 'layout != NULL' failed
(Eclipse:4647): Pango-CRITICAL **: pango_layout_set_ellipsize: assertion 'PANGO_IS_LAYOUT (layout)' failed
(Eclipse:4647): Pango-CRITICAL **: pango_layout_set_single_paragraph_mode: assertion 'PANGO_IS_LAYOUT (layout)' failed
(Eclipse:4647): Pango-CRITICAL **: pango_layout_set_width: assertion 'layout != NULL' failed
(Eclipse:4647): Pango-CRITICAL **: pango_layout_get_extents: assertion 'layout != NULL' failed
(Eclipse:4647): Gtk-CRITICAL **: IA__gtk_icon_theme_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed
(Eclipse:4647): Gtk-CRITICAL **: IA__gtk_settings_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed
(Eclipse:4647): Gtk-CRITICAL **: IA__gtk_icon_size_lookup_for_settings: assertion 'GTK_IS_SETTINGS (settings)' failed
(Eclipse:4647): Gtk-WARNING **: Invalid icon size 6
(Eclipse:4647): Gtk-CRITICAL **: IA__gtk_icon_theme_load_icon: assertion 'GTK_IS_ICON_THEME (icon_theme)' failed
(Eclipse:4647): Gtk-WARNING **: Error loading theme icon 'dialog-error' for stock: 
(Eclipse:4647): Gtk-CRITICAL **: IA__gtk_icon_size_lookup_for_settings: assertion 'GTK_IS_SETTINGS (settings)' failed
(Eclipse:4647): Gtk-WARNING **: /build/gtk+2.0-KsZSEA/gtk+2.0-2.24.23/gtk/gtkstyle.c:2358: invalid icon size '6'
(Eclipse:4647): Gtk-CRITICAL **: IA__gtk_style_render_icon: assertion 'pixbuf != NULL' failed
(Eclipse:4647): GLib-GObject-CRITICAL **: g_object_ref: assertion 'G_IS_OBJECT (object)' failed
(Eclipse:4647): Gdk-CRITICAL **: IA__gdk_pango_context_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed
(Eclipse:4647): Pango-CRITICAL **: pango_context_set_font_description: assertion 'context != NULL' failed
(Eclipse:4647): Pango-CRITICAL **: pango_context_set_base_dir: assertion 'context != NULL' failed
(Eclipse:4647): Pango-CRITICAL **: pango_context_set_language: assertion 'context != NULL' failed
(Eclipse:4647): Pango-CRITICAL **: pango_layout_new: assertion 'context != NULL' failed
(Eclipse:4647): Pango-CRITICAL **: pango_layout_set_text: assertion 'layout != NULL' failed
(Eclipse:4647): Pango-CRITICAL **: pango_layout_set_alignment: assertion 'layout != NULL' failed
(Eclipse:4647): Pango-CRITICAL **: pango_layout_set_ellipsize: assertion 'PANGO_IS_LAYOUT (layout)' failed
(Eclipse:4647): Pango-CRITICAL **: pango_layout_set_single_paragraph_mode: assertion 'PANGO_IS_LAYOUT (layout)' failed
(Eclipse:4647): Pango-CRITICAL **: pango_layout_set_wrap: assertion 'PANGO_IS_LAYOUT (layout)' failed
(Eclipse:4647): Pango-CRITICAL **: pango_layout_set_width: assertion 'layout != NULL' failed
(Eclipse:4647): Pango-CRITICAL **: pango_layout_get_extents: assertion 'layout != NULL' failed
(Eclipse:4647): Gdk-CRITICAL **: IA__gdk_pango_context_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed
(Eclipse:4647): Pango-CRITICAL **: pango_context_set_font_description: assertion 'context != NULL' failed
(Eclipse:4647): Pango-CRITICAL **: pango_context_set_base_dir: assertion 'context != NULL' failed
(Eclipse:4647): Pango-CRITICAL **: pango_context_set_language: assertion 'context != NULL' failed
(Eclipse:4647): Pango-CRITICAL **: pango_layout_new: assertion 'context != NULL' failed
(Eclipse:4647): Pango-CRITICAL **: pango_layout_set_text: assertion 'layout != NULL' failed
(Eclipse:4647): Pango-CRITICAL **: pango_layout_get_extents: assertion 'layout != NULL' failed
(Eclipse:4647): GLib-GObject-CRITICAL **: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
(Eclipse:4647): Gdk-CRITICAL **: IA__gdk_screen_get_width: assertion 'GDK_IS_SCREEN (screen)' failed
(Eclipse:4647): Gdk-CRITICAL **: IA__gdk_screen_get_width: assertion 'GDK_IS_SCREEN (screen)' failed
(Eclipse:4647): Pango-CRITICAL **: pango_layout_set_width: assertion 'layout != NULL' failed
(Eclipse:4647): Pango-CRITICAL **: pango_layout_get_extents: assertion 'layout != NULL' failed
(Eclipse:4647): Pango-CRITICAL **: pango_layout_get_line_count: assertion 'layout != NULL' failed
FAILED

@KengoTODA
Copy link
Member Author

I enabled Xvfb, it can solve warnings & errors but it faced build timeout.

I think it's better to use oraclejdk8 to build & kick eclipse, and use oraclejdk9 only to run tests.

@KengoTODA
Copy link
Member Author

Current problem: we cannot load java/lang/Object.class by class loader in findbugs/src/main/java/edu/umd/cs/findbugs/classfile/impl/ClassPathBuilder.java due to: http://openjdk.java.net/projects/jigsaw/spec/issues/#ClassFilesAsResources

Above spec page says that this problem is already resolved, but I found no solution for now (I added following JVM arguments as trial).

      '--add-exports', 'java.base/java.lang=ALL-UNNAMED',
      '--add-reads', 'java.base=ALL-UNNAMED'

@henrik242
Copy link
Contributor

henrik242 commented Jan 21, 2017

I have forced using an older jdk9 to make it build again in #105, while we try to figure out how to solve this.

@KengoTODA KengoTODA mentioned this pull request Sep 19, 2017
@KengoTODA
Copy link
Member Author

Use #393 to build with JDK 9.

@KengoTODA KengoTODA closed this Sep 21, 2017
@KengoTODA KengoTODA deleted the fix-java9-error branch September 21, 2017 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants