IBM / JTOpen

IBM Toolbox for Java, an IBM i communications library
https://ibm.github.io/JTOpen/
Other
64 stars 28 forks source link

Query: Java job hang for dataarea read #214

Open anson2416 opened 1 month ago

anson2416 commented 1 month ago

Hi all, I hit a critical issue when I run performance testing for a Java app.

the Java app use jt400 v20.0.7 in iSeries and it is started with runjva command. The app will read the value from a dataarea every 5s (I hit some logic here for easy understanding ).

In the submitted job log (wrkjvmjob) I can see the main thread is working with: my method - checkDataStatus -> as400lib function read, retrieveAttributes, retrieve, retrieve, retrieveDataAreaContents, runProgramOffThread, sendAndReceive, receive, waitImpl(Java/lang/Object).

after checking I suspect it is due to I construct the AS400 instance with credentials as the the data area read function implementation is DataAreaImplRemote. Looks like the connection is through jdbc. Anyone could confirm this???

The job is submitted with an application owner and its password is set *NONE.

So I try to remove the credentials and try different combination with localhost etc when create AS400 instance. But failed: AS400SecurityException: Password is *NONE.:ABCOWNER

This is the error stack: CurrentUser.getUserInfo AS400ImplRemote.get password AS400ImplRemote.signon AS400.sendSignonRequest AS400.signon AS400.connectService Dataarea.chisel CharacterDataAre.read checkDataStatus (My app function)

Thank you in advance!

nadiramra commented 1 month ago

I am unclear what the problem is, but in order to establish host server connection using password authentication scheme, password must be specified. Alternatively, you can use profile tokens, but in order to create one you need authority to the user profile you want to create a profile token for - that is, at lease USE authority). If you have USE, you can create a profile token with no password as long as you are running the Java app on the IBM i system.

jeber-ibm commented 1 month ago

If the user profile that is being used doesn't have a password, then you need to use a profile token as Nadir suggests or use jt400Native.jar. When jt400.jar is used, connections are always be made to a host server. Internally this is done by getting a substitute password from the operating system for the current user and then using that substitute password to connect to a host server. This connection mechanism will not work if the userid doesn't have a password.