From nobody@FreeBSD.org  Wed Apr 11 14:12:05 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id D3845106566C
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 11 Apr 2012 14:12:05 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id BE3008FC12
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 11 Apr 2012 14:12:05 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q3BEC5ql025352
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 11 Apr 2012 14:12:05 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q3BEC5iT025351;
	Wed, 11 Apr 2012 14:12:05 GMT
	(envelope-from nobody)
Message-Id: <201204111412.q3BEC5iT025351@red.freebsd.org>
Date: Wed, 11 Apr 2012 14:12:05 GMT
From: Liang Xu <lxu@sandvine.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: openjdk7 can't open library when remote debug enabled
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         166844
>Category:       java
>Synopsis:       openjdk7 can't open library when remote debug enabled
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    glewis
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Apr 11 14:20:11 UTC 2012
>Closed-Date:    
>Last-Modified:  Fri Feb 28 22:40:00 UTC 2014
>Originator:     Liang Xu
>Release:        FreeBSD8
>Organization:
Sandvine Incorporated
>Environment:
FreeBSD TPC-C1-21.phaedrus.sandvine.com 8.82.0109-RELEASE-p5 FreeBSD 8.82.0109-RELEASE-p5 #111: Tue Feb 28 15:27:17 EST 2012     root@wtllab-bsdbuild-9.phaedrus.sandvine.com:/usr/obj/usr/src/sys/SPB  amd64
>Description:
We upgrade the openjdk on Freebsd8 from 6 to 7. Now when the remote debug is enabled, the JVM cant start and throw following errors:
Apr  5 16:08:56 TPC-D16-14 appsrv[90192]:
Apr  5 16:09:06 TPC-D16-14 appsrv[90192]: Launching a JVM...
Apr  5 16:09:06 TPC-D16-14 appsrv[90192]: JVM exited while loading the application.
Apr  5 16:09:06 TPC-D16-14 appsrv[90192]: NPT ERROR: Cannot open library

It turns out to be on library no found by the JVM. Then, I find a workaround by creating a link under /usr/local/lib/
ln -s /usr/local/openjdk7/jre/lib/amd64/libnpt.so /usr/local/lib/libnpt.so

Thanks. 

>How-To-Repeat:
1. Install openjdk7
ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8-stable/java/openjdk-7.2.13.tbz
2. enable remote debug
wrapper.java.additional.43=-agentlib:jdwp=transport=dt_socket,address=0.0.0.0:8000,server=y,suspend=n
3. java program fail to start
>Fix:


>Release-Note:
>Audit-Trail:

From: Jonathan Chen <jonc@chen.org.nz>
To: bug-followup@FreeBSD.org, lxu@sandvine.com
Cc:  
Subject: Re: java/166844: openjdk7 can&#39;t open library when remote debug enabled
Date: Mon, 25 Jun 2012 19:05:09 +1200

 This also happens on FreeBSD 9-STABLE/amd64.
 -- 
 Jonathan Chen <jonc@chen.org.nz>

From: Lapo Luchini <lapo@lapo.it>
To: bug-followup@FreeBSD.org, lxu@sandvine.com
Cc:  
Subject: Re: java/166844: openjdk7 can&#39;t open library when remote debug
 enabled
Date: Tue, 03 Jul 2012 15:38:18 +0200

 Seems to be that it also happens in latest openjdk6-b25_1.

From: Alexander Yerenkow <yerenkow@gmail.com>
To: bug-followup@FreeBSD.org, lxu@sandvine.com
Cc:  
Subject: Re: java/166844: openjdk7 can't open library when remote debug enabled
Date: Thu, 15 Nov 2012 15:50:56 +0200

 --e89a8fb1f8d2b9133704ce88f079
 Content-Type: text/plain; charset=ISO-8859-1
 
 Actually this should be easily fixed in our javavmwrapper;
 
 tryJavaCommand () {
 ...
 
 should check if we are trying to run openjdk7's java, and simply made:
 
   export LD_LIBRARY_PATH=/usr/local/openjdk7/jre/lib/amd64:$LD_LIBRARY_PATH
 
 
 then all goes well (it seems so).
 
 
 -- 
 Regards,
 Alexander Yerenkow
 
 --e89a8fb1f8d2b9133704ce88f079--
Responsible-Changed-From-To: freebsd-java->glewis 
Responsible-Changed-By: glewis 
Responsible-Changed-When: Tue Jan 1 21:09:05 UTC 2013 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=166844 

From: Mark Linimon <linimon@lonesome.com>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: java/166844: openjdk7 can't open library when remote debug
 enabled
Date: Thu, 8 Aug 2013 20:34:33 -0500

 ----- Forwarded message from Jonathan Chen <jonc@chen.org.nz> -----
 
 Date: Fri, 19 Jul 2013 10:04:25 +1200
 From: Jonathan Chen <jonc@chen.org.nz>
 To: glewis@freebsd.org
 Cc: freebsd-java@freebsd.org
 Subject: java/166844: openjdk7 can't open library when remote debug enabled
 
 Hi Greg,
 
 I noticed that you've picked up this PR (yay!). Would it be too much
 to hope that you've managed to find the cause for it and a possible
 fix? Or is the javavmwrapper work-around the only recourse for now?
 
 Cheers
 --
 Jonathan Chen <jonc@chen.org.nz>
 _______________________________________________
 freebsd-java@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-java
 To unsubscribe, send any mail to "freebsd-java-unsubscribe@freebsd.org"
 
 ----- End forwarded message -----

From: Jonathan Chen <jonc@chen.org.nz>
To: bug-followup@FreeBSD.org, lxu@sandvine.com
Cc:  
Subject: Re: java/166844: openjdk7 can't open library when remote debug enabled
Date: Mon, 23 Dec 2013 18:23:35 +1300

 Hi,
 
 This is now appears to be working with openjdk-7.45.18, on 
 amd-64/9.2-STABLE r258726.
 
 Cheers.
 -- 
 Jonathan Chen <jonc@chen.org.nz>
 ----------------------------------------------------------------------
            "You can get farther with a kind word and a gun
                        than you can with a kind word alone" - Al Capone

From: Tom Judge <tj@freebsd.org>
To: bug-followup@FreeBSD.org, lxu@sandvine.com
Cc:  
Subject: Re: java/166844: openjdk7 can&#39;t open library when remote debug enabled
Date: Fri, 28 Feb 2014 17:38:39 -0500

 --089e0116059c63655404f37f19ca
 Content-Type: text/plain; charset=ISO-8859-1
 
 I just ran into this on 9.2/amd64:
 
 openjdk-7.51.13_1,1            Java Development Kit 7
 javavmwrapper-2.4_3            Wrapper script for various Java Virtual
 Machines
 
 While using maven to build apache tika.
 
 --089e0116059c63655404f37f19ca
 Content-Type: text/html; charset=ISO-8859-1
 Content-Transfer-Encoding: quoted-printable
 
 <div dir=3D"ltr">I just ran into this on 9.2/amd64:<div><br></div><div>open=
 jdk-7.51.13_1,1 =A0 =A0 =A0 =A0 =A0 =A0Java Development Kit 7<br></div><div=
 >javavmwrapper-2.4_3 =A0 =A0 =A0 =A0 =A0 =A0Wrapper script for various Java=
  Virtual Machines<br></div>
 <div><br></div><div>While using maven to build apache tika.</div><div><br><=
 /div></div>
 
 --089e0116059c63655404f37f19ca--
>Unformatted:
