Hi guys,

Forwarding this to the list as I've just tested with SableVM 1.11.3 and
I get the same problem so this might be present in more VMs...

---- previous jamvm bug report ----
I have code that uses getClass().getResourceAsStream(name) in the
bootclasspath (the named file exists). The bug causes classpath to try
using the ftp provider to open the stream :)

This bug shows up easily when looking for a resource outside of a jar...
but I identified it first because it also showed before I expanded my
jars.

Here's a test case to make things easier to debug:

mkdir testdir
touch testdir/foo
./bin/jamvm -Xbootclasspath/p:testdir -cp . ResourceTest
java.lang.IllegalArgumentException: address is unresolved: testdir:21
  at gnu.java.net.PlainSocketImpl.connect (PlainSocketImpl.java:243)
  at java.net.Socket.connect (Socket.java:439)
  at java.net.Socket.connect (Socket.java:397)
  at gnu.java.net.protocol.ftp.FTPConnection.<init> (FTPConnection.java:253)
  at gnu.java.net.protocol.ftp.FTPConnection.<init> (FTPConnection.java:221)
  at gnu.java.net.protocol.ftp.FTPURLConnection.connect 
(FTPURLConnection.java:123)
  at gnu.java.net.protocol.ftp.FTPURLConnection.getInputStream 
(FTPURLConnection.java:167)
  at java.net.URL.openStream (URL.java:683)
  at java.lang.ClassLoader.getResourceAsStream (ClassLoader.java:711)
  at java.lang.Class.getResourceAsStream (Class.java:944)
  at ResourceTest.<init> (ResourceTest.java:7)
  at ResourceTest.main (ResourceTest.java:3)

Cheers!

Steph

-- 
================================================================
Stephane Meslin-Weber         Email: [EMAIL PROTECTED]
Senior Software Engineer      Web: http://odonata.tangency.co.uk
================================================================
public class ResourceTest {
  public static void main(String[] args) {
    new ResourceTest();
  }
  public ResourceTest() {
    String name = "foo";
    System.err.println("getResourceAsStream()=="+getClass().getResourceAsStream(name)); 
    System.err.println("getSystemResourceAsStream()=="+ClassLoader.getSystemResourceAsStream(name)); 
  }
}

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Classpath mailing list
Classpath@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath

Reply via email to