Edit the pom.xml file in the root of your project, there add the next dependency inside the <dependencies> part:
<dependency>
<groupId>net.sf.jt400</groupId>
<artifactId>jt400</artifactId>
<version>20.0.8</version>
<classifier>java8</classifier>
</dependency>
Maybe the above code is already in your pom.xml but commented, in that case just uncomment it.<Resource name="jdbc/MyAppDS" auth="Container"
type="javax.sql.DataSource"
maxTotal="100" maxIdle="20" maxWaitMillis="10000"
username="java" password="ao49fmsk"
driverClassName="com.ibm.as400.access.AS400JDBCDriver"
url="jdbc:as400:192.168.1.8/mylib"/>
CRTJRNRCV JRNRCV(MYLIB/MYRCV) THRESHOLD(5000)
CRTJRN JRN(MYLIB/MYJRN) JRNRCV(MYLIB/MYRCV) MNGRCV(*SYSTEM)
CHGJRN JRN(MYLIB/MYJRN) JRNRCV(*GEN) DLTRCV(*YES)
STRJRNPF FILE(MYLIB/*ALL) JRN(MYLIB/MYJRN) IMAGES(*BOTH) OMTJRNE(*OPNCLO)
STRJRNPF FILE(MYLIB/MYTABLE) JRN(MYLIB/MYJRN)
After the changes you have to rebuild your project. In OpenXava Studio click with right mouse button on your project an choose Run As > Maven install, thus:
Or if you have Maven installed in your computer and you prefer to use command line:
$ cd myapp
$ mvn install
Optimization note: Instead of a mvn install, that do a complete Maven build, you can use mvn war:exploded, enough to apply the above changes for development. You can run mvn war:exploded from OpenXava Studio with Run As > Maven build... and typing war:exploded for goal.
Run your application, it should work nicely against your IBM i. If it fails, verify that the user and password in context.xml are correct, that the server IP is correct. Also verify that the journal has been created and the tables added to it, as explained above.
If it still fails ask us in the OpenXava Help forum. Include the content of your persistence.xml, context.xml (remove the passwords) and specially the stacktrace produced, you can find the trace in the Console tab of OpenXava Studio.
If your Java application is running on a Windows Server and you are experiencing performance issues, it may not necessarily be an issue with the AS/400 but rather a network configuration problem on the Windows Server. Don't worry, the problem is easy to fix, simply add the parameter tcp no delay=true to the database connection URL. That is, the definition of the data source in the context.xml could be:
<Resource name="jdbc/MyAppDS" auth="Container"
type="javax.sql.DataSource"
maxTotal="100" maxIdle="20" maxWaitMillis="10000"
username="java" password="ao49fmsk"
driverClassName="com.ibm.as400.access.AS400JDBCDriver"
url="jdbc:as400:192.168.1.8/mylib;tcp no delay=true"/>
Note the tcp no delay=true at the end of the URL.