Question: Has anyone had good experiences of talking direct to RPG programs running on a V5R4 iSeries machine from Java? If so, what are the recommendations of the community, and what pitfalls should I try to avoid?

From the various pieces of literature and spike solutions I have attempted it looks as though we can use ProgramCallBeans (either through PCML or xPCML), talking to the DataQueues (for asynchronous comms), or even JNI.

I'm looking for something that's robust, performant, quick to develop, easy to maintain, and easy to test (aren't we all!?!).

Answer: 
It is quite simple to call java methods directly from RPG. I am not sure exactly what you are trying to do, I have made calls directly to java methods several times.

For an example of how this is done. Take a look at [RPGMail](http://mowyourlawn.com/html/RPGMail.php). You can look at the source and see how Aaron used RPG to connect to JavaMail.
Hmm, I'm new here and would vote KC Baltz answer up, but cannot yet. Stored procedures are the way to go. I've used JT open to call programs natively and found issues with the number of parms that could be passed, issues with data types, etc. Once you have an SQL procedure wrapper around your program you'll find the Java support for SQL to be far superior than the java support for native 400 calls.