Accessing the correct iSeries Library [message #763173] |
Fri, 09 December 2011 09:45 |
Bob NIcholson Messages: 62 Registered: December 2011 Location: Seattle |
Member |
|
|
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 09:46] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
Re: Accessing the correct iSeries Library [message #763935 is a reply to message #763928] |
Sat, 10 December 2011 23:46 |
Joe Pluta Messages: 62 Registered: November 2011 |
Member |
|
|
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 #763945 is a reply to message #763939] |
Sun, 11 December 2011 00:20 |
Bob NIcholson Messages: 62 Registered: December 2011 Location: Seattle |
Member |
|
|
Hi, Will
Since it looks like I have 1.6 on my laptop, I think you are probably right.
Since I have have customers running different versions on their iSeries machines, is there a way to compile for the different versions based on deployment targets? Or, should I be compiling for oldest version of java on any of my customer's iSeries? Or should I take 1.6 off my laptop and install 1.5?
[Updated on: Sun, 11 December 2011 01:01] Report message to a moderator
|
|
|
|
|
|
|
Re: Accessing the correct iSeries Library [message #764303 is a reply to message #764226] |
Sun, 11 December 2011 22:11 |
Joe Pluta Messages: 62 Registered: November 2011 |
Member |
|
|
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 #764454 is a reply to message #764382] |
Mon, 12 December 2011 08:03 |
Bob NIcholson Messages: 62 Registered: December 2011 Location: Seattle |
Member |
|
|
Okay, I've done some timings. It looks to me like there is something funny when the sql is run to load the table. I've attached two files showing the timings between running on the iSeries and running on my laptop.
I've marked the timings in question. As you can see, it takes about 20 times longer to get a response from the sql command when running on the iSeries then on the laptop.
I found an info statement in the log on the iSeries that may have a bearing on this but I'm not sure. That statement is:
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the ja
What do you think?
Thanks
Bob
[Updated on: Mon, 12 December 2011 08:09] Report message to a moderator
|
|
|
|
Re: Accessing the correct iSeries Library [message #764746 is a reply to message #764622] |
Mon, 12 December 2011 19:26 |
Bob NIcholson Messages: 62 Registered: December 2011 Location: Seattle |
Member |
|
|
Hi, Joe
Well, this is interesting. In order to eliminate the delete from the equation, I commented out the delete try block. The delay still exists but it has moved to the next sql statement. That is in the addPayment function. So, it appears to be something to do with the set up of the first sql statement. After that it seems to execute the rest of the sql statements quickly.
Since there is no delay in execution of the sql from my laptop, it's like there is a problem when SQL is run iSeries Java to iSeries SQL. From laptop to iSeries I assume is done with some type of tcpip request. Having little experience with this, I'm not sure what goes on under the covers.
I shouldn't think this has anything to do with record locks because there is no delay when running from my laptop. The iSeries seems to respond quicker to that remote access method than locally.
Your thoughts would be apprecieated.
Bob
[Updated on: Mon, 12 December 2011 19:28] Report message to a moderator
|
|
|
Re: Accessing the correct iSeries Library [message #764776 is a reply to message #764746] |
Mon, 12 December 2011 20:37 |
Joe Pluta Messages: 62 Registered: November 2011 |
Member |
|
|
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
|
|
|
|
|
|
|
|
|
|
|