Problem migrating NIO channel to iSeries

I am having a problem with some Java NIO code running in the iSeries kernel (JDK 1.5). Basically, the code breaks the file into fragments of a part of the file into other smaller files. The same code has been running in other iSeries mailboxes for some time without any problems. Here's the code snippet:

//copy original data file content to temp file
long startPos = dataFile.length() - remaining;
long transferSize = maxSizeBytes - size;
size += inChannel.transferTo(startPos, transferSize, outChannel); //exception here
remaining -= size;

Here's the stack trace:

Caused by: java.io.IOException: Operation not supported. Map failed
 at java.lang.Throwable.<init>(Throwable.java:196)
 at java.lang.Exception.<init>(Exception.java:41)
 at java.io.IOException.<init>(IOException.java:40)
 at sun.nio.ch.FileChannelImpl.map0(Native Method)
 at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:742)
at sun.nio.ch.FileChannelImpl.transferToTrustedChannel(FileChannelImpl.java:448)
at sun.nio.ch.FileChannelImpl.transferTo(FileChannelImpl.java:521)

... 11 more

I did some investigation and the reasons so far (access rights to the parent directory, from memory, QSHRMEMCTL shared memory management are disabled, use of SAN) have all been unsuccessful.

Does anyone have experience with this particular problem?

Thanks, Brad.

+3
source share
3 answers

, , JVM.

, . ulimit , . (, , JVM, .) /, , .

+1

( NIO), .

0

, : ? viables . , .

1: long startPos = dataFile.length() - remaining;
2: long transferSize = maxSizeBytes - size;
3: size += inChannel.transferTo(startPos, transferSize, outChannel); //exception here
4: remaining -= size;
  • remaining dataFile.length() ? , .
  • size bytesTransfered. , .
  • remaining size.
  • maxSizeBytes <= dataFile.length()
  • startPos, transferSize dataFile.length()? , ,
    • transferSize dataFile.length()
    • startPos dataFile.length()
0

Source: https://habr.com/ru/post/1722125/


All Articles