Hi Thorbjørn,
Offhand, it seems to me the best solution is to keep the application
versions identical. I'd do that by adding jt400.jar to WebSphere's
classpath or Java's lib/ext directory in your dev environment. Then you'd
never have to add or remove the jar from the WAR. You could also write
something with the zip classes to verify and remove unneeded object, but
what a lot of work.
But, if you need to check where the class is coming from, you should be
able to use java.lang.Class.getResource() for jt400Native.jar and also for
the class you're using (AS400Object for example) and check the returned
URL's. If you still have jt400.jar in WEB-INF/lib, then the AS400Object URL
should have "WEB-INF/lib" in there somewhere. Otherwise, it should start
with the jt400Native.jar URL. Obviously, the jt400Native.jar URL should be
null on your dev box.
For the os.name property (and the other) return value, see:
http://publib.boulder.ibm.com/infocenter/iseries/v5r3/topic/rzaha/sysprop2.htm
Joe Sam
Joe Sam Shirah -
http://www.conceptgo.com
conceptGO - Consulting/Development/Outsourcing
Java Filter Forum:
http://www.ibm.com/developerworks/java/
Just the JDBC FAQs:
http://www.jguru.com/faq/JDBC
Going International?
http://www.jguru.com/faq/I18N
Que Java400?
http://www.jguru.com/faq/Java400
----- Original Message -----
From: "Thorbjørn Ravn Andersen" <thunderaxiom@xxxxxxxxx>
To: "Java Programming on and around the iSeries / AS400"
<java400-l@xxxxxxxxxxxx>
Sent: Thursday, November 01, 2007 7:47 AM
Subject: Detect using non-native jt400.jar when on AS/400?
Hi.
I am developing web applications on my PC and deploying them to
AS/400's, which requires that I use the jtopen version of jt400.jar on
the PC and the native jt400.jar on the iSeries, as only the latter seems
to support the *CURRENT, *CURRENT default login values.
This is not a problem as such, except that I occasionally forget to
remove jt400.jar from my WAR file before deploying, which then gives
login failures.
I'd like to know if there is a programmatic way I can see if I'm using
the opensource version of jtopen, and a way to determine definitively if
I'm running on an AS/400, so I can deliberately check for this in my code?
We are using version jtopen 5.0 internally.
Best regards,
As an Amazon Associate we earn from qualifying purchases.