This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
When trying to run this simple program within release 3.2 I am seeing and UnknownHostException for localhost when the execution settings include -Djava.security.manager and -Djava.security.policy=/tmp/tst.policy. The attached log shows the rull command line. Without these settings the program runs fine. The program runs fine with these settings outside of NB. --- TstAddr.java package org.jboss.test.naming; import java.net.InetAddress; /** * * @author Scott_Stark@displayscape.com * @version */ public class TstAddr { public static void main(String[] args) throws Exception { InetAddress addr = InetAddress.getByName("localhost"); System.out.println(addr); } } java.net.UnknownHostException: localhost at java.net.InetAddress.getAllByName0(InetAddress.java:571) at java.net.InetAddress.getAllByName0(InetAddress.java:540) at java.net.InetAddress.getByName(InetAddress.java:449) at org.jboss.test.naming.TstAddr.main(TstAddr.java:14) Exception in thread "main"
Created attachment 778 [details] system/ide.log
You're positive that (1) you are using External Execution and (2) you are not setting any environment variables (in Expert tab of executor)?
I have created a copy of the "External Execution" setting and added the security variables so that the "External Process" property looks like: -Djava.security.manager -Djava.security.policy=/tmp/tst.policy -cp {filesystems} {:}{classpath}{:}{library} {classname} {arguments} This is the only change over the "External Execution" setting.
It seems that the parameters were passed correctly to the other VM (looking at the log file). Isn't something wrong with your setup ? I assume you are using Windows (from the path to the java executable). Why do you specify the security policy pathname using UNIX notation (and without dirve specification) ? Could this be the problem ?
I just retried the setup with 3.2build12 and this is now working. I made sure that the policy was actually being read so something has changed and this is now working. As for the path style, a unix style file path without a drive spec works on every win32 system I have used as long as the drive is the system drive.
I'm closing it as worksforme, although I am not convinced that the bug is really fixed. AFAIK there were no changes in execution code in NetBeans for some time now and the attached log shows that correct parameters in the correct order were passed to the launched VM :-(
Resolved for 3.3.x or earlier, no new info since then -> closing.
Resolved for 3.4.x or earlier, no new info since then -> closing.