× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Did you get a reply?  Here are a few thoughts.

   1. To be secure the Toolbox classes will not connect to the server
   unless it has a valid userid and password.  To be totally accurate, the
   server will not accept a connection unless the client supplies a userid
   and password.  If the userid is disabled, or the password is expired, is
   *NONE or is wrong, the Toolbox cannot connect to the server.

   2. As a convenience when running on the iSeries, the Toolbox can use the
   userid and password of the job's current thread instead of having them
   supplied by the application.  This does not, however, override the first
   consideration.  If the thread's password is *NONE or expired, the
   connection will not work.

   3. Starting with V5R1, the Toolbox can avoid the server and directly
   carry out the request in the current job on the current thread.  The
   identity of the thread is used so no further authentication is needed.

In your case option 3 may work.  If you create an AS400 using the default
c'tor and indicate the command is thread safe, the command server will be
skipped and the command will be carried out using the thread's identity.
For example,
      AS400 system = new AS400();
      CommandCall cc = new CommandCall(system);
      cc.setThreadSafe(true);
      cc.run("myCommand");

(1) You must not specify a user profile when creating the AS400 object.  If
you specify a profile the Toolbox will do authentication.  (2) The command
must be tagged thread safe.  If not, the Toolbox assumes the command is not
thread safe and will use the command server (a single-threaded job) to run
it.  (3) Don't do system.connectService().  This will force a connection to
the server.  Just run the command.

Hope this helps,

David Wall
Toolbox for Java
iSeries ODBC Driver for Linux




                      Attila_Halasz@qui
                      xtar.com                 To:       JAVA400-L@midrange.com
                      Sent by:                 cc:
                      java400-l-admin@m        Subject:  Submit a RUNJVA job 
with different userID
                      idrange.com


                      03/28/2002 09:26
                      AM
                      Please respond to
                      java400-l





Hello,

we are developing a Java batch process on the AS400, which is reading XML
messages from MQSeries, calls existing RPG programs to process the request
and submits the response XML message back to MQSeries. Due security reasons
the Java process has to run with a specific userID. This userID can not
signon to the system, it is only used to run different batch processes. (
this user is specified on SBMJOB command).   By doing so, we are receiving
java.io.Exception.

Is there a way to allow the JAVA program to have the capability to call
AS/400 RPG programs without logging on to the system?

Here is the JAVA code used to connect to the AS/400:

     String as400Name = "MyAS400";
     as400 = new AS400(as400Name);
     as400.connectService(AS400.COMMAND);

Here is the log from our JAVA job:

java.io.IOException
      com/ibm/as400/access/SocketContainerUnix.getSubstPassword([B[B)[B+8
(SocketContainerUnix.java:97)
      com/ibm/as400/access/CurrentUser.getUserInfo([B[B)[B+16
(CurrentUser.java:73)
      com/ibm/as400/access/AS400ImplRemote.getPassword([B[B)[B+34
(AS400ImplRemote.java:918)

com/ibm/as400/access/AS400ImplRemote.getConnection(IZ)Lcom/ibm/as400/access/AS400Server;


267 (AS400ImplRemote.java:859)
      com/ibm/as400/access/AS400ImplRemote.connect(I)V+13
(AS400ImplRemote.java:342)
      com/ibm/as400/access/AS400.connectService(I)V+87 (AS400.java:703)
      com/quixtar/oms/si/NMN8UPR.initialise(Ljava/util/Properties;)Z+0
(NMN8UPR.java:112)
      com/quixtar/oms/si/MQThread.<init>(Lcom/quixtar/oms/si/MQJob;I)V+0
(MQThread.java:16)
      com/quixtar/oms/si/MQJob.<init>([Ljava/lang/String;)V+0
(MQJob.java:74)
      com/quixtar/oms/si/MQJob.main([Ljava/lang/String;)V+0 (MQJob.java:36)


Thanks,

Attila

_______________________________________________
This is the Java Programming on and around the iSeries / AS400 (JAVA400-L)
mailing list
To post a message email: JAVA400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/java400-l
or email: JAVA400-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/java400-l.







As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.