Re: FileOutputStream for the Null-Device throws FileNotFoundException
Jeroen Frijters <[email protected]>
| Newsgroups | gmane.comp.java.ikvm.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Christian, Hmm. Opening devices is not supported by .NET, so that's why it fails. Arguably, the XNIO code is broken, because it should just swallow the FileNotFoundException. The code is there to deal with the fact that NULL_FILE_CHANNEL might be null. You could use the ikvmc -remap option to patch out the org.xnio.channels.Channels$4.run() method to simply return null. I couldn't find the XNIO jar, so I couldn't try it. Regards, Jeroen > -----Original Message----- > From: Christian Wegener [mailto:[email protected]] > Sent: Wednesday, May 7, 2014 15:21 > To: [email protected] > Subject: [Ikvm-developers] FileOutputStream for the Null-Device throws > FileNotFoundException > > Hello together, > > at first thank for this great project! :-) I'm using IKVM as JAVA-.NET- > Bridge for client/server-communication in a J2EE/.NET-Project. The > client is written in VB.NET and communicates via IKVM with a J2EE > server. In the past it worked very good with JBoss 6.1. But now I want > to migrate my application to a newer version of JBoss --> WildFly 8.1. > > Because the client/server-communication of WildFly has changed, I also > have to adapt the .NET client. > Here I get a exception in the XNIO 3.0 module of WildFly. It crashes > because IKVM cannot open a FileOutputStream for the Null-Device. > > Here is a very short test: > > public class ChannelTest { > public static void main(String args[]) throws FileNotFoundException{ > new FileOutputStream("NUL:").getChannel(); > System.out.println("No Exception!"); > } > } > > In "java" I get "No Exception!" and in "IKVM" (Version 7.2.4630.5) I get > this exception: > > Exception in thread "main" java.io.IOError: > java.io.FileNotFoundException: FileStream ÷ffnet keine Win32-Gerõte, > z.B. Datentrõgerpartitionen oder Bandlaufwerke. > "\\.\" darf im Pfad nicht verwendet werden. > at org.xnio.channels.Channels$4.run(Channels.java:997) > at org.xnio.channels.Channels$4.run(Channels.java:987) > at > java.security.AccessController.doPrivileged(AccessController.java:277) > at > java.security.AccessController.doPrivileged(AccessController.java:322) > at org.xnio.channels.Channels.<clinit>(Channels.java:987) > at > SimpleHelloWorldBlockingClient.main(SimpleHelloWorldBlockingClient.java: > 28) > Caused by: java.io.FileNotFoundException: FileStream ÷ffnet keine Win32- > Gerõte, z.B. Datentrõgerpartitionen oder Bandlaufwerke. "\\.\" darf im > Pfad nicht verwen det werden. > at java.io.FileDescriptor.open(FileDescriptor.java:332) > at java.io.FileDescriptor.openWriteOnly(FileDescriptor.java:291) > at java.io.FileOutputStream.open(FileOutputStream.java:267) > at java.io.FileOutputStream.<init>(FileOutputStream.java:213) > at java.io.FileOutputStream.<init>(FileOutputStream.java:105) > at org.xnio.channels.Channels$4.run(Channels.java:992) > at org.xnio.channels.Channels$4.run(Channels.java:987) > at > java.security.AccessController.doPrivileged(AccessController.java:277) > at > java.security.AccessController.doPrivileged(AccessController.java:322) > at org.xnio.channels.Channels.<clinit>(Channels.java:987) > at org.xnio.channels.Channels.writeBlocking(Channels.java) > ... 1 more > > Is there anyone who can help me? > > Thanks a lot > Christian Wegener > > > ------------------------------------------------------------------------------ Is your legacy SCM system holding you back? Join Perforce May 7 to find out: • 3 signs your SCM is hindering your productivity • Requirements for releasing software faster • Expert tips and advice for migrating your SCM now http://p.sf.net/sfu/perforce _______________________________________________ Ikvm-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ikvm-developers