Accessing the correct iSeries Library [message #763173] |
Fri, 09 December 2011 04:45  |
Eclipse User |
|
|
|
I'm doing the EDT:Tutorial: RUI With Database tutorial. I seem to have it working except that it is trying to access the file in the wrong iSeries library. The user ID is BOB. The library containing the PaymentRec is BNLIB.
I receive the following error:
Exception: SQLService, addPayment, SQLSTATE = 42704, message = [SQL0204] PAYMENT in BOB type *FILE not found.: [sqlstate:42704][sqlcode:-204]
So it is looking for library BOB which does not exist.
In RBD, all I did was qualify the table name with the correct library. I've tried that here but it makes no difference.
I have multiple client machines installed and each will have files in multiple libraries for production,testing and development. All customers run the exact same version of the software package so I don't want to have a project for each customer's environment. It would be nice if there is an environment variable somewhere that can control the file/library combinations for each implementation.
How should this be handled? I'm assuming I can have multiple deployment descriptor files for each client emplimentation to point to the right machine address, but I'm not sure.
Thanks
Bob
[Updated on: Fri, 09 December 2011 04:46] by Moderator
|
|
|
|
|
|
|
|
|
|
Re: Accessing the correct iSeries Library [message #763935 is a reply to message #763928] |
Sat, 10 December 2011 18:46   |
Eclipse User |
|
|
|
Hi Bob! You seem to have a couple of different issues here, let's do one at a time. The first log looks like it's from your local machine (I assume that's your PC). The key error there is the java.lang.UnsupportedClassVersionError. This almost always means you are using a version of Java that is too old for the application that you are running. Even if you have installed the latest Java, it might not be running by default. You need to get to a command line, do two things and report back:
1. echo $JAVA_HOME
2. java -version
The first tells us where applications like Tomcat (usually) will find the version of Java that they will load. The second is to determine what the PC thinks it has as its default. It really helps when these two match. Okay, that's it for the Java version.
Second, it looks like the IBM i version is starting up just fine. It's using the 32-bit version of JDK 5.0, which is a good, fast version that works nicely with Tomcat. Your only problem there is the fact that it's trying to find your file in library BOB. That's because by default JDBC uses SQL naming convention and SQL naming convention uses a single schema. A schema is what we think of as a library, and the schema it uses is the one with the same name as the user profile. So any unqualified database fetches go to library BOB.
There are a number of ways to fix that, but I would start by qualifying the library name, just to make sure we're on the same page. You said you were trying that; did you try using the table name BNLIB.PAYMENT? In SQL, the qualifier is a dot, not a slash.
Try those and let us know if it gets you any farther.
Joe
|
|
|
|
|
|
|
|
|
|
Re: Accessing the correct iSeries Library [message #764303 is a reply to message #764226] |
Sun, 11 December 2011 17:11   |
Eclipse User |
|
|
|
Well, let's take a look at this. You say you have applications running on Tomcat 5 on Java 5 and they run fine, but you have problems with EGL running on Tomcat 6 on Java 6. Perhaps to take one of the variables out of the equation, you could run one of your existing applications by installing the WAR file on your Tomcat 6 environment and compare the performance. If it performs well, then that would indicate an issue with EGL. If not, then it's more likely a problem with your Tomcat 6 setup.
Running multiple Tomcat environments should be pretty simple. The iSeries easily supports multiple IP addresses, so just add another IP address and make sure your Tomcat configurations each listen to a different IP address. Yes, you can use ports, but I prefer IP addresses.
Just so I have a clearer understanding - are you running Tomcat with an Apache front end, or just running Tomcat standalone? If you're running standalone on a machine with multiple IP addresses, you can bind Tomcat to a specific IP address easily by adding an address="my.ip.addr.ess" on every connector tag in your server.xml file.
Keep updating us on your progress!
Joe
|
|
|
|
|
|
|
|
Re: Accessing the correct iSeries Library [message #764776 is a reply to message #764746] |
Mon, 12 December 2011 15:37   |
Eclipse User |
|
|
|
Hmmm... the plot thickens! Okay, while I'm no expert on all the intricacies, I can make a few broad statements and hopefully a few IBMers can chime in as well.
Generally speaking, database requests from Java to DB2 all go through the same basic JDBC mechanism. There are various ways in which a database connection can be configured, but at the end of the day you will be using a database connection resource. Database resources are configured in the deployment descriptor, which can in turn point to workspace-wide database connections that you can configure using the Database Development Perspective.
The point is that at some point you should find a database driver URL, and it should look something like this:
jdbc:as400:MYISERIES;prompt=false
There are a number of different syntax possibilities, but this is one I use. I guess the next step would be for you to find that URL and let us see it. It could be a strange routing problem that's affecting you. I am surprised, though, that your log doesn't say that you're connecting to the database, with messages like this:
DSRA8203I: Database product name : DB2 UDB for AS/400
DSRA8204I: Database product version : 07.01.0000 V7R1m0
DSRA8205I: JDBC driver name : AS/400 Toolbox for Java JDBC Driver
DSRA8206I: JDBC driver version : 8.2
Joe
|
|
|
|
|
|
|
|
|
|
|