Chris Roper

Greenhorn
+ Follow
since Nov 25, 2002
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Chris Roper

Hi
I'm trying to get an old application (previously running on Websphere 4) running in Websphere Studio Enterprise Developer, with a view to changing it and then getting it running on Websphere 5.
I've created a new project, and imported all the appropriate JSPs, Java source etc. Once of the jars it references is the IBM jt400.jar. I've added this to the classpath and the source compiles fine.
I'm trying to run it in the Websphere 5 test evironment. The first JSP shows fine, and calls the login servlet fine. However, it then falls over with a ClassDefNotFound error, because it can't find a class that is within jt400.jar
I don't understand how it can find it when compiling, but not in the test environment. It looks as if the test environment has a different class path or something?
Any help gratefully received.
Cheers.
18 years ago
Hi
I will shortly be starting development on an order entry web application. I've got pretty much everything sorted out, but there is one requirement that I don't know how to address.
We need to know which users are logged onto the system at anyone time. If a user exits the system by simply closing their browser, we need to know about it!
Any information gratefully received! I will be developing for Websphere 5, if that is of any use.
Cheers,
Chris
18 years ago
We have written an application that is running on WAS 4.0.4
As the week goes on, it gets slower and slower, the performance gets worse and worse.
If we reset Websphere, the application runs quickly again.
I doubt that Websphere is to blame, so I guess our application is leaving something lying around each time it is closed.
Can anyone offer any hints as to what kind of things I should be looking for?
Cheers.
18 years ago
Hi
I have taken over development of a web application, that is currently running on WAS 4.0.4. This application takes data from an AS/400.
We shipped this application to a customer for a demo, but we had a problem because of the set up of their AS/400 files. It turned out I need to add a property 'translate binary=true'.
Now, I tried adding this via websphere. Adding it was fine, but in the logs I was getting the message that the property wasn't recognised.
I looked at adding it to the code but I couldn't see how to do it.
I have managed to get it to work by changing the connection code. The driver used by this new code allowed the use of parameters, and I was able to get the application working. However, I think I'm no longer using connection pooling will be a problem in the long run.
CONNECTION POOLING CODE:
private javax.sql.DataSource ds = null
Hashtable parms = new Hashtable();
parms.put(Context.INITIAL_CONTEXT_FACTORY, ("com.ibm.websphere.naming.WsnInitialContextFactory"));
ds = (javax.sql.DataSource) ctx.lookup("jdbc/" + propDataSource);
connection = ds.getConnection(propUserID, propPassword);

With this code, the ds.getConnection() method does not allow a parameter of 'properties'. Basically I was stumped as to how to add the property. Things I tried:
1) Adding to the properties of the datasource via the WAS Admin console.
2) Adding the property to the URL in the datasource.
Neither worked (should they have?)
In the end I used this code:
java.util.Properties p = new Properties();
p.put("translate binary", "true");
AS400JDBCDriver d = new AS400JDBCDriver();
AS400 o = new AS400(propAS400, propUserID, propPassword);
conn = d.connect(o, p, null);
With this code, the d.connect() method allows me to put parameters in, hence achieving my aim.

So, I have 2 questions:
1) Is my code less efficient than it was before (I suspect it is), if so is this because I am no longer using connection pooling?
2) How do I add a property to the connetion pooling code?

Any help greatly appreciated.
Cheers,
Chris
19 years ago
Thanks for the help Simon.
I couldn't get the code I had to work. But I changed the way the connection was being made. The code was getting a datasource from WAS and using this to make the connection, but I changed it to get a connection using an IP address stored in a properties file. This was using different drivers, and I was quite easily able to add the property to it. The facility to at properties just didn't seem to be available when using the datasource.
And I'm aware I typed 'convert' instead of 'translate' - that was just in this posting, not in the code.
So I've got it working, but aren't 100% happy that I had to change all the connection code (the application was written by somebody who has since left our company).
This application is just a demo for a customer, so the fact that it works is fine for now. However, I think my code doesn't use connection pooling and will cause the application to be less efficient.

Cheers,
Chris
[ January 29, 2003: Message edited by: Chris Roper ]
19 years ago

Originally posted by Simon Song:
Add it as an property to the datasource.


I already tried that - I get the old "Could not find the property convert binary on class..." error message. From what I've seen on various lists looking around on the internet, 'convert binary' isn't a valid property.
Am I missing something?
19 years ago
Hi
I'm hitting the problem where data taken from the AS/400 is displayed as hex/garbage because the file on the AS/400 has a CCSID of 65535.
I've looked around on the net and found a solution, although I've been unable to get it working.
The solution is to basically add a property 'convert binary=true' on to the end of the database URL.
I've tried just adding it to the AS/400 IP address in by WAS datasource, but I can't get a connection.
I've set up a datasource in WAS(4.0.4), and my java code uses this datasource to get the connection. I need to specify the 'convert binary=true' property but don't know how to do it.
Any help greatly appreciated!
Cheers,
Chris
19 years ago
Cheers Simon, took me all morning, but it did the trick!
19 years ago
Hi guys.
So, I managed to get our old app running on Websphere 4.0. I've put quite a few modifications in.
However, I get an occasional crash (it seems every 15 minutes or so of testing). I get a little window saying java.exe has crashed, and the logs point me to a file which starts as follows:
Exception code: C0000005 ACCESS_VIOLATION
Fault address: 709798EB 01:000688EB C:\WebSphere\AppServer\java\jre\bin\jitc.dll
The file is massive and contains all sorts of crap. I've searched the net endlessly and found references to the error, but usually caused by some other application that I'm not using (Oracle for example).
I don't think it's anything to do with my code, as it happens at different stages of the application each time, there's no pattern. Plus it seems like a low-level system thing which purely bad java code couldn't cause!
Anyone any ideas?
Cheers,
Chris
19 years ago
Thanks for all the help guys.
I eventually figured it out.
The .html files were referring to the .gifs as "../images/pic.gif". This was fine when accessing the html straight from the desktop, but wouldn't work in the application.
However, I changed them all to "images/pic.gif" and moved the images folder and now it's all fine. Now, I don't know if this is the best solution or whatever, but it worked so I'm happy....
I'm getting there!
19 years ago
Thanks for the help. I have managed to get my .properties file found.
But I'm still having problems with the images.
In my .war, I have (amongst others) the following directories:
JSP
Images
Includes
Now, my JSPs import html from Includes - this happens no problem. The html in Includes imports images from Images. However, they are never found.... I've tried everything I can think of - putting them in http/htdocs didn't work either.
If I open the html from the desktop, the gifs are all present and correct, it's just the JSPs can't find them when accessed via Websphere.
Cheers,
Chris
19 years ago
Well I solved this eventually - it was so obvious in the end that I felt like a bit of a fool.
Ah well, a little further up that learning curve!
19 years ago
Hi
Not sure if I can help at all, but I've just managed to get an as/400 connection from my Websphere application.
I didn't have exactly the same errors you described, but I did get a "ClassNotFound: com.ibm.as400.access.AS400JDBCConnectionPoolDataSource". I resolved this, eventually, by setting the Server Class Path on the JDBC driver to jt400.jar, which I obtained from the IBM Toolbox.
Apologies if I'm telling you stuff you already know!
Cheers.
19 years ago
Hi
I'm trying to configure a connection from a servlet running in Websphere to our as/400. This for an application we have running on 3.5, but are trying to install on 4.0
I've defined my datasource. When I run the application, I get a login box requesting user ID / password. However, the system it's trying to connect to is 'MyServer'. This is defined within the datasource, and can be accessed with the 'Properties' button. However, I cannot change the serverName value to anything else without getting an error. I can't see where to enter the system name of my as400.
Any help greatly appreciated.
Cheers,
Chris
19 years ago
Well, it appears these errors were caused by lack of disk space.. Silly of me not to notice I guess, but I freed some up and now the problems have stopped.
19 years ago