Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 361439 - dev-java/netbeans-platform-7.0_rc1 fails to compile because an annotation processor threw an uncaught exception
Summary: dev-java/netbeans-platform-7.0_rc1 fails to compile because an annotation pro...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords:
: 361467 361545 361577 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-03-31 09:46 UTC by Juergen Rose
Modified: 2011-08-12 10:37 UTC (History)
10 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
/var/tmp/portage/dev-java/netbeans-platform-7.0_rc1/temp/build.log (build.log,272.03 KB, text/x-log)
2011-03-31 09:51 UTC, Juergen Rose
Details
Script to enter chroot (start.sh,1.47 KB, text/plain)
2011-04-10 14:24 UTC, David Carlos Manuelda
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Juergen Rose 2011-03-31 09:46:51 UTC
'emerge netbeans-platform-7.0_rc1' fails with:
...
init:

up-to-date:

compile:
    [mkdir] Created dir: /var/tmp/portage/dev-java/netbeans-platform-7.0_rc1/work/spi.quicksearch/build/classes
 [nb-javac] Compiling 21 source files to /var/tmp/portage/dev-java/netbeans-platform-7.0_rc1/work/spi.quicksearch/build/classes
X11 connection rejected because of wrong authentication.
X11 connection rejected because of wrong authentication.
X11 connection rejected because of wrong authentication.
X11 connection rejected because of wrong authentication.
 [nb-javac] 
 [nb-javac] 
 [nb-javac] An annotation processor threw an uncaught exception.
 [nb-javac] Consult the following stack trace for details.
 [nb-javac] java.lang.InternalError: Can't connect to X11 window server using 'localhost:11.0' as the value of the DISPLAY variable.
 [nb-javac]     at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
 [nb-javac]     at sun.awt.X11GraphicsEnvironment.access$100(X11GraphicsEnvironment.java:52)
...
 [nb-javac]     at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
  [nbmerge] Failed to build target: all-spi.quicksearch

BUILD FAILED
/var/tmp/portage/dev-java/netbeans-platform-7.0_rc1/work/nbbuild/build.xml:1130: The following error occurred while executing this line:
/var/tmp/portage/dev-java/netbeans-platform-7.0_rc1/work/nbbuild/build.xml:430: The following error occurred while executing this line:
/var/tmp/portage/dev-java/netbeans-platform-7.0_rc1/work/nbbuild/templates/common.xml:206: Compile failed; see the compiler error output for details.

Total time: 32 seconds
 * ERROR: dev-java/netbeans-platform-7.0_rc1 failed (compile phase):


Reproducible: Always




root@impala:/root(4)# emerge --info =dev-java/netbeans-platform-7.0_rc1
Portage 2.1.9.45 (default/linux/amd64/10.0, gcc-4.5.2, glibc-2.13-r2, 2.6.38-gentoo x86_64)
=================================================================
                        System Settings
=================================================================
System uname: Linux-2.6.38-gentoo-x86_64-AMD_Phenom-tm-_II_X4_965_Processor-with-gentoo-2.0.2
Timestamp of tree: Thu, 31 Mar 2011 06:30:01 +0000
app-shells/bash:     4.2_p8
dev-java/java-config: 2.1.11-r3
dev-lang/python:     2.7.1-r1, 3.1.3-r1
dev-util/cmake:      2.8.4
sys-apps/baselayout: 2.0.2
sys-apps/openrc:     0.8.0
sys-apps/sandbox:    2.5
sys-devel/autoconf:  2.13, 2.68
sys-devel/automake:  1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.21
sys-devel/gcc:       4.5.2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.4-r1
sys-devel/make:      3.82
virtual/os-headers:  2.6.38 (sys-kernel/linux-headers)
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA PUEL dlj-1.1 skype-eula googleearth AdobeFlash-10.1 cadsoft"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=amdfam10 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.0/conf /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.2/ext-active/ /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.2/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.2/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=amdfam10 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="de fr"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/science /var/lib/layman/x11 /var/lib/layman/sunrise /usr/local/portage /var/lib/cpan /var/lib/g-octave"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext 64bit R X Xaw3d a52 aac abiword accessibility acl acpi admin afs alsa amd64 amrr ao apache2 applet archive arpack asf aspell assistant audacious audiofile automap automount bash-completion berkdb blas blast bluetooth boo boost bzip2 cairo cdda cddb cdf cdio cdparanoia cdr cg cgi chm cli consolekit corba cracklib crypt css cuda cups curl cxx daap db dbase dbi dbm dbus declarative designer devhelp device-mapper dga dia djvu doc dri ds2490 ds9097 ds9097u dv dvb dvd dvdr dvi dynamicplugin eds elf emacs emboss emf empathy encode epiphany evo examples exif expat extensions extra extras fame ffmpeg fftw firefox fits flac fltk fontconfig foomaticdb fortran fortran95 fpx fts3 fuse galago gcj gd gdal gdbm gdu gedit geoip geolocation geos gfortran gif gimp ginac git glade glib gml gmp gmtsuppl gnokii gnome gnome-keyring gnome-print gnuplot gnutls gphoto2 gpm grammar graphics graphtft graphviz grass gs gsl gsm gstreamer gtk guile harness hddtemp hdf hdf5 hdri http httpd hvm iconv icq icu id3 imagemagick imap innodb inotify ipod ipv6 ithreads jabber jadetex java java6 jbig john jpeg jpeg2k kdrive kerberos kpathsea kqemu kvm ladspa lame lapack latex latex3 lcms ldap lensfun libffi libgda libnotify libsamplerate lm_sensors lua lzo mad mail maildir mailwrapper mapnik math matroska mkl mmx mmxext mng modules mono moonlight motif mozilla mp3 mp4 mpeg mpi mplayer mtp mudflap multilib musicbrainz mysql mysqli nautilus ncurses netcdf netpbm network networking networkmanager nfs nls nntp nptl nptlonly nsplugin ntfs ntp numpy obex objc ocaml octave odbc ogdi ogg ole openexr opengl openmp overview pam pcre pda pdf perl plotutils plugins png podcast policykit posix postgres postscript pppd preview-latex proj projectx pstricks pulseaudio pymol python python-bindings q16 q32 qemu qhull qt3support qt4 quicktime readline reiserfs reports rle romio rpc rrdcgi rrdtool samba sasl science sdk sdl secure-delete semantic-desktop server session sip slang slp smbclient smp sms sndfile snmp soup sox speex spell sql sqlite sse sse2 sse4a ssl subtitles subversion suexec svg svm swig sysfs szip t1lib tcl tcpd tex tex4ht texmacs tgif theora threads thunderbird tidy tiff tk tntc tools truetype udev unicode usb userlocales utempter v4l2 video virtualbox vorbis wav webdav webdav-serf webkit wmf wxwidgets xattr xcb xemacs xext xine xml xmlreader xmlrpc xorg xpm xulrunner xv xvid xvmc yaml zlib zvbi" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgid dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="de fr" NETBEANS_MODULES="apisupport cnd dlight enterprise ergonomics groovy gsf harness ide identity j2ee java mobility nb php profiler ruby websvccommon xml" PHP_TARGETS="php5-3" QEMU_SOFTMMU_TARGETS="i386 ppc ppc64 x86_64" QEMU_USER_TARGETS="arm i386 x86_64" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nv nouveau vesa" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS


root@impala:/root(5)# emerge -pqv =dev-java/netbeans-platform-7.0_rc1
[ebuild  N    ] dev-java/netbeans-platform-7.0_rc1
Comment 1 Juergen Rose 2011-03-31 09:51:47 UTC
Created attachment 267961 [details]
/var/tmp/portage/dev-java/netbeans-platform-7.0_rc1/temp/build.log
Comment 2 John Keeping 2011-03-31 10:17:01 UTC
This is caused by the code at openide.util/src/org/openide/util/Utilities.java:1835 which checks for GraphicsEnvironment.isHeadless() before trying to get the menu shortcut mask.  In this case the headless check returns false because DISPLAY is set but when the JVM attempts to connect to X to initialize the AWT toolkit it fails because the build is not running under the same user as the X session.

Unsetting DISPLAY before emerging causes the build to succeed:

$ unset DISPLAY
$ emerge -1 netbeans-platform
Comment 3 Juergen Rose 2011-03-31 11:45:10 UTC
Thanks John,

unsetting DISPLAY solved the issue.
Comment 4 Miroslav Šulc gentoo-dev 2011-03-31 11:58:59 UTC
i fixed the issue by adding -Djava.awt.headless=true to ant command. i fixed that in netbeans-platform-7.0_rc1.ebuild (so no revbump). it should reach mirrors in few tens of minutes. if that would not fix the problem, please reopen this bug.

thanks for reporting and for the investigation of the issue from John.
Comment 5 Serkan Kaba (RETIRED) gentoo-dev 2011-03-31 14:41:14 UTC
*** Bug 361467 has been marked as a duplicate of this bug. ***
Comment 6 Serkan Kaba (RETIRED) gentoo-dev 2011-04-01 05:56:57 UTC
*** Bug 361545 has been marked as a duplicate of this bug. ***
Comment 7 David Carlos Manuelda 2011-04-01 12:45:59 UTC
Should it be raised upstream (or is it already?)
I think it is pointless to connect to Xorg only to compile something.
Comment 8 Miroslav Šulc gentoo-dev 2011-04-01 12:51:16 UTC
i added to the ebuild -Djava.awt.headless=true so it should compile headless. if it does not so then reopen this bug.
Comment 9 David Carlos Manuelda 2011-04-01 15:18:04 UTC
In compiling it inside a chroot, and with changes from comment #8, it still fails:

compile:
    [mkdir] Created dir: /var/tmp/portage/dev-java/netbeans-platform-7.0_rc1/work/spi.quicksearch/build/classes
 [nb-javac] Compiling 21 source files to /var/tmp/portage/dev-java/netbeans-platform-7.0_rc1/work/spi.quicksearch/build/classes
No protocol specified
 [nb-javac] 
 [nb-javac] 
 [nb-javac] An annotation processor threw an uncaught exception.
 [nb-javac] Consult the following stack trace for details.
 [nb-javac] java.lang.InternalError: Can't connect to X11 window server using ':0' as the value of the DISPLAY variable.
 [nb-javac]     at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
 [nb-javac]     at sun.awt.X11GraphicsEnvironment.access$200(X11GraphicsEnvironment.java:62)
 [nb-javac]     at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:178)
 [nb-javac]     at java.security.AccessController.doPrivileged(Native Method)
 [nb-javac]     at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:142)
 [nb-javac]     at java.lang.Class.forName0(Native Method)
 [nb-javac]     at java.lang.Class.forName(Class.java:186)
 [nb-javac]     at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:82)
 [nb-javac]     at sun.awt.X11.XToolkit.<clinit>(XToolkit.java:112)
 [nb-javac]     at java.lang.Class.forName0(Native Method)
 [nb-javac]     at java.lang.Class.forName(Class.java:186)
 [nb-javac]     at java.awt.Toolkit$2.run(Toolkit.java:849)
 [nb-javac]     at java.security.AccessController.doPrivileged(Native Method)
 [nb-javac]     at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:841)
 [nb-javac]     at org.openide.util.Utilities.getMenuShortcutKeyMask(Utilities.java:1835)
 [nb-javac]     at org.openide.util.Utilities.stringToKey(Utilities.java:1769)
 [nb-javac]     at org.openide.util.Utilities.stringToKeys(Utilities.java:1850)
 [nb-javac]     at org.netbeans.modules.openide.awt.ActionProcessor.processReferences(ActionProcessor.java:420)
 [nb-javac]     at org.netbeans.modules.openide.awt.ActionProcessor.handleProcess(ActionProcessor.java:295)
 [nb-javac]     at org.openide.filesystems.annotations.LayerGeneratingProcessor.process(LayerGeneratingProcessor.java:124)
 [nb-javac]     at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:735)
 [nb-javac]     at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:664)
 [nb-javac]     at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:809)
 [nb-javac]     at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1060)
 [nb-javac]     at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:795)
 [nb-javac]     at com.sun.tools.javac.main.Main.compile(Main.java:380)
 [nb-javac]     at com.sun.tools.javac.main.Main.compile(Main.java:306)
 [nb-javac]     at com.sun.tools.javac.main.Main.compile(Main.java:297)
 [nb-javac]     at com.sun.tools.javac.Main.compile(Main.java:82)
 [nb-javac]     at sun.reflect.GeneratedMethodAccessor88.invoke(Unknown Source)
 [nb-javac]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 [nb-javac]     at java.lang.reflect.Method.invoke(Method.java:616)
 [nb-javac]     at org.apache.tools.ant.taskdefs.compilers.Javac13.execute(Javac13.java:56)
 [nb-javac]     at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1097)
 [nb-javac]     at org.netbeans.nbbuild.CustomJavac.compile(CustomJavac.java:105)
 [nb-javac]     at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:906)
 [nb-javac]     at org.netbeans.nbbuild.CustomJavac.execute(CustomJavac.java:86)
 [nb-javac]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
 [nb-javac]     at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
 [nb-javac]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 [nb-javac]     at java.lang.reflect.Method.invoke(Method.java:616)
 [nb-javac]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
 [nb-javac]     at org.apache.tools.ant.Task.perform(Task.java:348)
 [nb-javac]     at org.apache.tools.ant.Target.execute(Target.java:390)
 [nb-javac]     at org.apache.tools.ant.Target.performTasks(Target.java:411)
 [nb-javac]     at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1397)
 [nb-javac]     at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
 [nb-javac]     at org.apache.tools.ant.Project.executeTargets(Project.java:1249)
 [nb-javac]     at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:442)
 [nb-javac]     at sun.reflect.GeneratedMethodAccessor98.invoke(Unknown Source)
 [nb-javac]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 [nb-javac]     at java.lang.reflect.Method.invoke(Method.java:616)
 [nb-javac]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
 [nb-javac]     at org.apache.tools.ant.Task.perform(Task.java:348)
 [nb-javac]     at org.apache.tools.ant.Target.execute(Target.java:390)
 [nb-javac]     at org.netbeans.nbbuild.NbMerge.fixedModulesBuild(NbMerge.java:218)
 [nb-javac]     at org.netbeans.nbbuild.NbMerge.execute(NbMerge.java:299)
 [nb-javac]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
 [nb-javac]     at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
 [nb-javac]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 [nb-javac]     at java.lang.reflect.Method.invoke(Method.java:616)
 [nb-javac]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
 [nb-javac]     at org.apache.tools.ant.Task.perform(Task.java:348)
 [nb-javac]     at org.apache.tools.ant.Target.execute(Target.java:390)
 [nb-javac]     at org.apache.tools.ant.Target.performTasks(Target.java:411)
 [nb-javac]     at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1397)
 [nb-javac]     at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
 [nb-javac]     at org.apache.tools.ant.Project.executeTargets(Project.java:1249)
 [nb-javac]     at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:442)
 [nb-javac]     at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
 [nb-javac]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
 [nb-javac]     at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
 [nb-javac]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 [nb-javac]     at java.lang.reflect.Method.invoke(Method.java:616)
 [nb-javac]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
 [nb-javac]     at org.apache.tools.ant.Task.perform(Task.java:348)
 [nb-javac]     at org.apache.tools.ant.Target.execute(Target.java:390)
 [nb-javac]     at org.apache.tools.ant.Target.performTasks(Target.java:411)
 [nb-javac]     at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1397)
 [nb-javac]     at org.apache.tools.ant.Project.executeTarget(Project.java:1366)
 [nb-javac]     at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
 [nb-javac]     at org.apache.tools.ant.Project.executeTargets(Project.java:1249)
 [nb-javac]     at org.apache.tools.ant.Main.runBuild(Main.java:801)
 [nb-javac]     at org.apache.tools.ant.Main.startAnt(Main.java:218)
 [nb-javac]     at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
 [nb-javac]     at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
  [nbmerge] Failed to build target: all-spi.quicksearch

BUILD FAILED
/var/tmp/portage/dev-java/netbeans-platform-7.0_rc1/work/nbbuild/build.xml:1130: The following error occurred while executing this line:
/var/tmp/portage/dev-java/netbeans-platform-7.0_rc1/work/nbbuild/build.xml:430: The following error occurred while executing this line:
/var/tmp/portage/dev-java/netbeans-platform-7.0_rc1/work/nbbuild/templates/common.xml:206: Compile failed; see the compiler error output for details.

Total time: 49 seconds
 * ERROR: dev-java/netbeans-platform-7.0_rc1 failed (compile phase):
 *   eant failed
 * 
 * Call stack:
 *     ebuild.sh, line   56:  Called src_compile
 *   environment, line 4270:  Called java-pkg-2_src_compile
 *   environment, line 2309:  Called eant 'rebuild-cluster' '-f' 'nbbuild/build.xml' '-Drebuild.cluster.name=nb.cluster.platform' '-Dext.binaries.downloaded=true' '-Djava.awt.headless=true'
 *   environment, line  847:  Called die
 * The specific snippet of code:
 *       ant ${antflags} "${@}" || die "eant failed"
 * 
 * If you need support, post the output of 'emerge --info =dev-java/netbeans-platform-7.0_rc1',
 * the complete build log and the output of 'emerge -pqv =dev-java/netbeans-platform-7.0_rc1'.
!!! When you file a bug report, please include the following information:
GENTOO_VM=icedtea6-bin  CLASSPATH="" JAVA_HOME="/opt/icedtea6-bin-1.9.7"
JAVACFLAGS="-source 1.6 -target 1.6" COMPILER="javac"
and of course, the output of emerge --info
 * The complete build log is located at '/var/log/portage/dev-java:netbeans-platform-7.0_rc1:20110401-151201.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-java/netbeans-platform-7.0_rc1/temp/environment'.
 * S: '/var/tmp/portage/dev-java/netbeans-platform-7.0_rc1/work'
Comment 10 Serkan Kaba (RETIRED) gentoo-dev 2011-04-01 15:49:22 UTC
*** Bug 361577 has been marked as a duplicate of this bug. ***
Comment 11 David Carlos Manuelda 2011-04-01 23:34:47 UTC
Can it be reopened?
It seems that ebuild needs also to unset DISPLAY, or something else, because it can not be compiled in a chroot (for example) since no X access is available there.
Comment 12 muhsin 2011-04-03 10:52:40 UTC
Having the same problem here, and I am not in chrooted or anything.

compile:
    [mkdir] Created dir: /var/tmp/portage/dev-java/netbeans-platform-7.0_rc1/work/spi.quicksearch/build/classes
 [nb-javac] Compiling 21 source files to /var/tmp/portage/dev-java/netbeans-platform-7.0_rc1/work/spi.quicksearch/build/classes
No protocol specified
 [nb-javac] 
 [nb-javac] 
 [nb-javac] An annotation processor threw an uncaught exception.
 [nb-javac] Consult the following stack trace for details.
 [nb-javac] java.lang.InternalError: Can't connect to X11 window server using ':0' as the value of the DISPLAY variable.
Comment 13 Miroslav Šulc gentoo-dev 2011-04-03 10:56:55 UTC
did you try different jvms to compile netbeans-platform to see whether all behave the same?
Comment 14 muhsin 2011-04-03 11:02:58 UTC
As noticed, compiling out of my desktop env seems to work as temp solution.
Comment 15 muhsin 2011-04-03 13:21:36 UTC
As noticed, compiling out of my desktop env seems to work as temp solution.
Comment 16 Navid Zamani 2011-04-04 14:40:32 UTC
I also ran emerge -auDNtv world inside a screen session. And it failed with the same error.

I think it’s definitely a bug that the ebuild cares about the $DISPLAY variable at all.
Comment 17 David Carlos Manuelda 2011-04-04 14:50:15 UTC
Yes, it seems you can't emerge this package from outside a X11 session, which is pointless.
As stated in another comment, unsetting DISPLAY makes you able you to compile it, but I am not sure whether it is an upstream bug.
Comment 18 Navid Zamani 2011-04-04 14:55:32 UTC
(In reply to comment #17)
This *is* a X session. I simply opened Konsole, did “sudo su -”, then “screen -S update”, and “emerge -auDNtv world”. No idea why it retained the $DISPLAY variable.
Comment 19 David Carlos Manuelda 2011-04-04 15:32:25 UTC
(In reply to comment #18)
> (In reply to comment #17)
> This *is* a X session. I simply opened Konsole, did “sudo su -”, then “screen
> -S update”, and “emerge -auDNtv world”. No idea why it retained the $DISPLAY
> variable.

Yes, what I wanted to say with outside an X11 session is "not connected directly to X11 session like with konsole, or a tty, but with chroot, session, ssh, or other indirect access method."
Comment 20 Miroslav Šulc gentoo-dev 2011-04-04 15:44:49 UTC
well, i tried to connect from my laptop to itself using ssh (with X running), but still can't make the compilation fail (no idea if ssh fakes local connections somehow). up to that, the ebuild contains '-Djava.awt.headless=true' as ant extra arg, so the compilation should run headless, unless this setting is not propagated for some reason to the ant process.

i won't fix the bug till we find why '-Djava.awt.headless=true' is ignored. maybe it is jvm dependent, but nobody mentioned what jvm they are using for compilation, and nobody reacted to my request to test more jvms for compilation so atm i have no idea why for some people the compilation fails.
Comment 21 Navid Zamani 2011-04-04 16:06:50 UTC
To be honest, I just did
echo '<=dev-util/netbeans-7.0:7.0' >> etc/portage/package.mask/temp
;)

I’ll put it in here, for anyone who doesn’t want to bother going the hard way.
Comment 22 Miroslav Šulc gentoo-dev 2011-04-04 16:22:32 UTC
that won't help to solve the issue ;-)
Comment 23 Navid Zamani 2011-04-04 16:31:04 UTC
(In reply to comment #22)
> that won't help to solve the issue ;-)

Correct, but my goal is just to be able to merge the other 150 packages that is the KDE nightmare. ;) As apparently portage gives up on the resume list after maybe a dozen NetBeans packages failing.

I assumed by 7.0 final, the bug will be solved, and so it’s solved for me. :P
Comment 24 Juergen Rose 2011-04-09 09:19:50 UTC
Now the same issue happens with dev-java/netbeans-platform-7.0_rc2.
Comment 25 Juergen Rose 2011-04-09 09:21:41 UTC
Unsetting DISPLAY helps again.
Comment 26 Miroslav Šulc gentoo-dev 2011-04-10 09:51:25 UTC
i just turned off X on my laptop and tried to compile netbeans-platform-rc2_p20110609 (from my repo, but generally should behave the same as rc2 in tree) but was not able to reproduce the issue. my laptop is ~amd64. tried to compile with dev-java/icedtea-6.1.10.1 and dev-java/sun-jdk-1.6.0.24 and compiled fine.

up to that, imo -Djava.awt.headless=true should be enough to disable checking for X, which was also confirmed when i looked at jvm sources. so to me, it looks like it is not issue of netbeans-platform but either issue of jvm used or local environment.

can somebody post here steps how to reproduce the issue? i'd like to fix the real issue and not just add a workaround. i also need to know what jvm are you using.
Comment 27 David Carlos Manuelda 2011-04-10 14:24:13 UTC
I have a gentoo tarball unpacked in /data/Gentoo/root, and I use a script to do the bind mounts and chroot.
I'll attach that script. 
Using that script inside a running local X11 session (in my case, in yakuake or konsole), leads to this bug.
Comment 28 David Carlos Manuelda 2011-04-10 14:24:43 UTC
Created attachment 269307 [details]
Script to enter chroot
Comment 29 Miroslav Šulc gentoo-dev 2011-04-10 20:46:12 UTC
(In reply to comment #27)
> I have a gentoo tarball unpacked in /data/Gentoo/root, and I use a script to do
> the bind mounts and chroot.
> I'll attach that script. 
> Using that script inside a running local X11 session (in my case, in yakuake or
> konsole), leads to this bug.

cool, thx, will try that when i find some time.
Comment 30 Claes 2011-05-06 14:31:16 UTC
I get this problem when I have FEATURES="userpriv", but removing that lets it build fine for me.
Comment 31 Richard 2011-05-07 16:24:47 UTC
I managed to workaround this by running a separate X server via "X :1 &" and doing "export DISPLAY=:1" prior to emerging. I took note of the pid and then killed it afterward.
Comment 32 Zac Medico gentoo-dev 2011-07-08 09:48:28 UTC
Here's a persistent workaround:

  mkdir -p /etc/portage/env/dev-java/
  echo "export -n DISPLAY" > /etc/portage/env/dev-java/netbeans-platform
Comment 33 Navid Zamani 2011-07-08 10:12:09 UTC
(In reply to comment #32)
Don’t forget the env-update. ^^
Comment 34 Miroslav Šulc gentoo-dev 2011-08-05 10:43:02 UTC
can someone verify the problem still exists in 7.0.1?
Comment 35 Juergen Rose 2011-08-05 16:59:11 UTC
I just emerged netbeans-7.0.1 without unsetting the DISPLAY variable.
Thanks for the work.
Comment 36 David Carlos Manuelda 2011-08-06 03:32:31 UTC
I still can reproduce with 7.0.1 in the same way I reproduced with 7.0.0rc1 and 7.0.0 (inside a chroot compile invoked in a konsole in a running X session: see attached script to enter chroot used for this test)
Comment 37 Juergen Rose 2011-08-07 15:39:38 UTC
I have to correct Comment 35. I thought, that I have seen, that I could emerge netbeans-7.0.1 on one system, where the DISPLAY variable was set.
Today I see that 'emerge netbeans" fails on three systems, where the DISPLAY variable is set, with:

 [nb-javac] Compiling 21 source files to /var/tmp/portage/dev-java/netbeans-platform-7.0.1/work/spi.quicksearch/build/classes
X11 connection rejected because of wrong authentication.
X11 connection rejected because of wrong authentication.
X11 connection rejected because of wrong authentication.
X11 connection rejected because of wrong authentication.
 [nb-javac] 
 [nb-javac] 
 [nb-javac] An annotation processor threw an uncaught exception.
 [nb-javac] Consult the following stack trace for details.
 [nb-javac] java.lang.InternalError: Can't connect to X11 window server using 'localhost:10.0' as the value of the DISPLAY variable.

After unsetting the DISPLAY variable 'emerge netbeans' works without problems.
Comment 38 Miroslav Šulc gentoo-dev 2011-08-07 17:08:53 UTC
i've fixed the compilation by unsetting DISPLAY variable before compilation:

88a89,93
> src_compile() {
> 	unset DISPLAY
> 	eant -f ${EANT_BUILD_XML} ${EANT_EXTRA_ARGS} ${EANT_BUILD_TARGET} || die "Compilation failed"
> }
> 

if it does not work, please reopen this bug.
Comment 39 Myk Taylor 2011-08-08 17:04:51 UTC
Fixed for me, though netbeans-ide-7.0.1 fails in the same way.