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.

Bug 10264 - Problem with security manager and InetAddress
Summary: Problem with security manager and InetAddress
Status: CLOSED WORKSFORME
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-03-13 22:42 UTC by Scott Stark
Modified: 2007-09-26 09:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
system/ide.log (13.82 KB, text/plain)
2001-07-20 20:40 UTC, Scott Stark
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Scott Stark 2001-03-13 22:42:56 UTC
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"
Comment 1 Scott Stark 2001-03-13 22:43:33 UTC
Created attachment 778 [details]
system/ide.log
Comment 2 Jesse Glick 2001-03-14 14:35:01 UTC
You're positive that (1) you are using External Execution and (2) you are not
setting any environment variables (in Expert tab of executor)?
Comment 3 Scott Stark 2001-03-14 18:22:18 UTC
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.
Comment 4 Svata Dedic 2001-03-26 15:32:37 UTC
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 ?
Comment 5 Scott Stark 2001-03-26 21:47:51 UTC
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.
Comment 6 Svata Dedic 2001-03-27 07:30:28 UTC
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 :-(
Comment 7 Quality Engineering 2003-07-01 13:11:12 UTC
Resolved for 3.3.x or earlier, no new info since then -> closing.
Comment 8 Quality Engineering 2003-07-01 13:15:09 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.