From owner-freebsd-java@freebsd.org Mon Jun 29 18:59:43 2020 Return-Path: Delivered-To: freebsd-java@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 065FE3524A2 for ; Mon, 29 Jun 2020 18:59:43 +0000 (UTC) (envelope-from aryeh.friedman@gmail.com) Received: from mail-io1-xd2b.google.com (mail-io1-xd2b.google.com [IPv6:2607:f8b0:4864:20::d2b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49wcHK6FWKz4Dym for ; Mon, 29 Jun 2020 18:59:41 +0000 (UTC) (envelope-from aryeh.friedman@gmail.com) Received: by mail-io1-xd2b.google.com with SMTP id c16so18326190ioi.9 for ; Mon, 29 Jun 2020 11:59:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bskPD4bgqVfLc3kB7kZvoeyjr34U5D6fIIVnSBY0Wj0=; b=WS89/VmzZ38Qx8u1hsg1McjuiY5ZhI5ak/KyHFHgPyyXamzqMJbvmvYWx4D1F6pokz b1yj3/FGdd5RaLueHOOteEzQL5SeXPPVI3hIiHPBQnON3n+gWiQbaf8HEqW1H0ECpdDK kVIwotw1LJAsxm8Rf8BtF5P1pzyskWElslrszLREY+ykg/tuVBzq5i33d6i+4YsMA9DK pID6Y6kUH0oo49yOTdi4bC6HGyYvR+G4LH7obXapTPm+9MltcOoW5NTHcHthdw/VJTOi 0GbYOpLVBAnGY30TnrklbAI2hYHKEOv79G8yswZUajWfFYQ03hjK/FNWPYtMyCJx8Ivc 7JAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bskPD4bgqVfLc3kB7kZvoeyjr34U5D6fIIVnSBY0Wj0=; b=RGDWBoeKOC5G128LTKiEKmG3HyPyrvJ75woB0bv3hgDTdSbRwR2EU1cp3w/2EHOrxy UvxaARnxowi2eFUvwg6Tl8tCWgbHH7EP9wQBccpLfXAdQ23rNZ1b3LJUY+XJW+oPPfoX n42oimQqsM3sJEpJr9FD1C1LBMiY4twIqe+yPhhOM//dzylOUX7NS4impPgiY7rohE5s leWj8VVLCnWdD++k/rYYsT0t3R3ZAXFptZX+pUm3q2gSaLIwh8UYdb2htnxLklwjghYp FIkRs8YFHNHAkD2ygp7GW/RkC9udYywiRhGT2u1Q7HXTqiKGx4plGm+Q1BMUeHu856un qbtw== X-Gm-Message-State: AOAM530VLkheZ7Mg4hRAcABz9bDBHKoRqOI+m8eWRIZe7DJonL0GCQuw kyeoiXONuXTlFJL4UMe0pdCk734QadmMrbnRPLJIiGU19MQ= X-Google-Smtp-Source: ABdhPJxVBThii3XzYmKCxIb8AkW0u34vsnwEC0qWCYCmDa2fUXUHLkiTjQQ8hej/wdekPf/jE/PTJbbmfPU262cEzWw= X-Received: by 2002:a6b:e617:: with SMTP id g23mr18314501ioh.103.1593457180807; Mon, 29 Jun 2020 11:59:40 -0700 (PDT) MIME-Version: 1.0 References: <417840b4-1acc-ac20-2127-0754bce1fd68@gmx.net> In-Reply-To: <417840b4-1acc-ac20-2127-0754bce1fd68@gmx.net> From: Aryeh Friedman Date: Mon, 29 Jun 2020 14:59:29 -0400 Message-ID: Subject: Re: Min. ports needed for headless AWT/Swing To: Michael Osipov <1983-01-06@gmx.net> Cc: freebsd-java@freebsd.org X-Rspamd-Queue-Id: 49wcHK6FWKz4Dym X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=WS89/Vmz; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of aryehfriedman@gmail.com designates 2607:f8b0:4864:20::d2b as permitted sender) smtp.mailfrom=aryehfriedman@gmail.com X-Spamd-Result: default: False [-3.40 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.05)[-1.051]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-java@freebsd.org]; NEURAL_HAM_LONG(-1.02)[-1.019]; NEURAL_HAM_SHORT(-0.33)[-0.330]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::d2b:from]; FREEMAIL_TO(0.00)[gmx.net]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jun 2020 18:59:43 -0000 On Mon, Jun 29, 2020 at 2:28 PM Michael Osipov <1983-01-06@gmx.net> wrote: > Am 2020-06-29 um 17:43 schrieb Aryeh Friedman: > > I have a java application that works fine with setenv DISPLAY :0.0 on my > > desktop FreeBSD 12.1 (amd64) [with Xfce4] but when I attempt to run the > > same app on a VM that has the minimum ports needed to install OpenJDK 8 > and > > Tomcat I get an exception saying that it can't connect to the X server > even > > though I did setenv DISPLAY desktop:0.0 (and xhost + on the desktop). > > Note it is the same user on both machines (NIS/NFS password DB/home dirs) > > doing the running on both machines but is a different user then the one > > logged in at the console (I do all my development in a separate account) > > Are you look for "-Djava.awt.headless=true"? > Since this is a screen capture/recording program (which I am the developer) I need to be able to capture the console (running X) that I am currently on. So the question is what is the minimum set of ports/packages I need to install on the VM to make it see and X server? It should be noted the program has no GUI but does use java.awt.Robot#createScreenCapture (using the full screen resolution as it's bounds) individual frames of the longer video. Here is the specific exception I am attempting to fix: On desktop (192.168.11.20) % xhost + On VM (192.168.11.4): % setenv DISPLAY 192.168.11.20:0.0 % java -javaagent:/usr/local/share/java/classes/jacocoagent.jar=destfile=/usr/home/aryeh/fnwe-scap-1a1.C036/jacoco.exec,jmx=true,excludes=thistest/*:test/* -cp /usr/home/aryeh/fnwe-scap-1a1.C036/scrap/www/WEB-INF/lib/fnwe-scap-1a1.jar:/usr/local/share/java/classes/thisTest.jar:/usr/local/share/java/classes/pcCommon.jar:/usr/local/share/java/classes/pcUtil.jar test.TestMain Result of the jvm invocation on the VM (not it works no problem su(do)'ing to another account on the desktop if I do setenv DISPLAY :0.0): Caused by: java.awt.AWTError: Can't connect to X11 window server using '192.168.11.20:0.0' as the value of the DISPLAY variable. at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method) at sun.awt.X11GraphicsEnvironment.access$200(X11GraphicsEnvironment.java:65) at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:115) at java.security.AccessController.doPrivileged(Native Method) at sun.awt.X11GraphicsEnvironment.(X11GraphicsEnvironment.java:74) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:103) at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:82) at test.scap.TestVideoFrame.testCaptureFrame(TestVideoFrame.java:76) _______________________________________________ > freebsd-java@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-java > To unsubscribe, send any mail to "freebsd-java-unsubscribe@freebsd.org" > -- Aryeh M. Friedman, Lead Developer, http://www.PetiteCloud.org