1

our problem is the following:

We have to connect to an ISeries with the JT400 and read a file in the IFS. One requirement is the job is running in the QBatch with a user without password. Our code is the following:

  //This wy we connect to the Iseries with the job credentials in this case 
   //user withou password
 AS400 as400 = new AS400(); 
 IFSFile file = new IFSFile(system, path);

  //This line throws the AS400SecurityException
 IFSFileInputStream fis = new IFSFileInputStream(file,IFSFileInputStream.SHARE_NONE);

The last line throws this exception: com.ibm.as400.access.AS400SecurityException: Password is not set

We searched on internet but couldn´t find anyone with same problem

Thank you for reading our question

Juan
  • 229
  • 2
  • 6
  • 20
  • 1
    AFAIK, I don't see how that would be possible with jt400, without an user / password, you have no access to the iSeries server. Some reading: http://www.ibm.com/developerworks/ibmi/library/i-ifs/ One option could be to access it using an open network share, but that's unsafe and needs some setup on the iSeries –  Nov 04 '15 at 18:23
  • 1
    I'm confused...you say you need **to connect to an iSeries** and that **the job is running in QBATCH** So is your java app running on one IBM i and connecting to another? – Charles Nov 04 '15 at 19:31
  • If you are accessing IFS on the same system, you can just use the standard Java IFSFileInputStream. – jweberhard Nov 05 '15 at 12:07
  • Thnk u ver much for all your comments, Charles, the java app is running on the Iseries, i get to connect using the job credentials but i get the exception when I use IFSFileInputStream fis = new IFSFileInputStream(file,IFSFileInputStream.SHARE_NONE); because job credentials have no password. – Juan Nov 05 '15 at 17:45
  • jweberhard I am already using IFSFileInputStream as whown in the question – Juan Nov 05 '15 at 17:46
  • What is `system` in your `IFSFile()` function? You create `as400`. Also, you don't supply a filename for IFSFile(). – user2338816 Dec 23 '15 at 02:16

1 Answers1

-1

Try connecting to the host using

AS400 as400 = new AS400("localhost","*CURRENT","*CURRENT");

See http://javadoc.midrange.com/jtopen/com/ibm/as400/access/AS400.html#AS400(java.lang.String,%20java.lang.String,%20java.lang.String)

David G
  • 3,940
  • 1
  • 22
  • 30