Cory Hartford

Ranch Hand
+ Follow
since May 16, 2011
Cory likes ...
Mac Eclipse IDE Ubuntu
Merit badge: grant badges
For More
Loves Park, IL, USA
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
2
Received in last 30 days
0
Total given
3
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Cory Hartford

Thanks K. It turned out it was the driver version. I got a driver and license from a colleague that worked. Not sure where they came from or what the version was but they work.
9 years ago
Hi Everyone,
I am a novice with Websphere and I am stuck trying to get an enterprise application to connect to UDB 9.7. I set up a JDBC Provider using the driver db2jcc.jar, the license and then setup a datasource. The code calling the connection is:




In the logs it looks like the driver is being loaded successfully:



But I keep getting this error when the code trys to get a connection:





I thought maybe it was because the driver was compiled using Java 6 and the JRE for Websphere 6.1 is Java 5, but I downloaded the JDBC 3 driver from IBM and I end up getting the same result. Thanks for any insight folks might be able to provide.
9 years ago
Thanks for the response Claude. I tried that and much to my surprise instead of the name I assigned the component, I ended up getting a canvas name. So yeah it must be a bug. What I ended up doing was just creating individual listeners for each component; for some reasons the listeners persist even though the object is changed/recreated or whatever is happening.
9 years ago
Hi Everyone
I am working with an OSGI device that uses AWT as the GUI API. I've used it extensively but I have run across something that I can't figure out.
I have a component that I add a mouse listener to. I create an inner class that extends off of MouseAdapter to handle the events. In the mousePressed(MouseEvent e) method I use e.getSource() to get the component that fired the event.
I take that object and compare it to the original reference.

If I do this inside of a panel, everything is hunky dory. The objects are equal. However, when I place the same component into a panel that resides within a scroll pane, the objects don't test equal. Here are a couple of debug lines; the first is the source object from the MouseAdapter and the second line is the component object that I store when I instantiate it.

com.canon.meap.ctk.awt.CLabel[canvas23,420,44,67x20]
com.canon.meap.ctk.awt.CLabel[canvas24,420,44,67x20]

You can see that the canvases don't match and essentially I have two different objects. It has got to do with adding it to the panel in the scrollpane, but I don't understand why. It should be the same object; where I place it shouldn't make any difference.

Here are some code snippets that hopefully help illustrate what it is that I have



Build The ScrollPane and add the Panel


Instantiate the component


Handle the event




I guess that somehow adding the component to the panel within the scrollpane is somehow generating a new object and modifying it. That's the way it appears anyway. Just curious if someone can help me understand whats going on here. Thanks
9 years ago
71%. Very happy. Thanks to Paul C. For slapping me around earlier in my career; I learned a lot from our conversations here. Thanks to Bear, Fred, Kathy, Bert, and Cameron for answering my questions and writing books.
Advice I have for folks
-take the associate exam prior to the pp exam, especially if you're relatively early in you career.
- Read the SCJP book back to front. Take all of the end of chapter exams.
- Keep a journal as outlined in the SCJP exam book; note all your wrong answers and all the right answers you got lucky on.
-Spend 20 bucks on the enthuware tool. Invaluable. Test everyday for two weeks prior to the exam. Log all of your results in your journal.
-Using you journal, drill down to topics you're week on in the SCJP book; it's a tome so focus on the areas that are specific to what you missed.

Anyway, very happy. Good luck to folks and thanks again for all of guidance from The Ranchers.

10 years ago

Stefan Evans wrote:You could try the JSTL <c:set> tag.


It may be better to construct the object and then store it into context:
ie finish your scriptlet code with
request.setAttribute("db", db);

The next step would be to refactor that code out of the JSP and into a servlet :-)



Thanks Stefan. This seems like the correct path; well, the correct path is refactoring into a servlet like you said, but I don't have the time in the schedule to refactor all of it. This seems like a good way to try an implement current technology with the legacy stuff.
10 years ago
JSP
That answers my question Paul. The type isn't a primitive, String, or wrapper, so this isn't going to work. It's an object. I'll have to write my logic inside of a scriplet I guess. Thanks for everyone's input.
10 years ago
JSP
I didn't want to resurrect a dead thread, but I haven't found a better answer to this than Ranch Post

I'm trying to get out of writing more scriptlets and using beans instead, but I can't seem to find a way to pass a scriptlet created object to a bean. I was beginning to think you just couldn't do it, but I found the post above, although I am not entirely clear on what "pass the list as parameter of the method of a class". This is what I have tried:




db is a user made POJO, nothing special. I haven't tried implicitly casting db and am going to try that next, but I wanted to post; I think its something simple Im missing.

Thanks
10 years ago
JSP
Thanks very much for the advice Bear.
10 years ago
JSP

Bear Bibeault wrote:What you did not mention is why you need to touch these JSPs. Do you need to add lots of new functionality? Fix minor bugs? Or is it that their mere existence violates your sensibilities?



Well number one; I have to add a fairly significant feature set, but I think its going to be a bunch of small touches in a lot of different areas if that makes any sense. And number two, because I've read enough of the Ranch forums and Uncle Bob's books that it feels like I am doing evil. Blech.
I guess I'll forge ahead and try to implement best practices where I can. By the end I should well versed on what not to do. Kind of like a field trip to a prison; I'll be scared straight.
10 years ago
JSP
Hi Everyone. I have been tasked with maintaining a system that is full of Scriptlets and was first written somewhere around the year 2000. I've worked with SE for quite a while but this is my first professional foray into the presentation layer. I have a very specific feature set to add to a very big system that is written in this way and I wanted some advice on what the right thing to do is. Obviously I have to maintain a schedule and trying to bring everything up to date isn't feasible. I believe a good middle ground is to try and use backing beans and EL (as opposed to trying to move to Struts 2 or Faces) on the areas I am touching. But I am struggling to try and figure out a path forward; I am concerned that I might end up in a refactoring spiral that won't end or breaking something in another area since everything is so tightly coupled. I have read some about preprocessor servlets that can be pointed at the JSP, but given how intertwined all of these scriptlets are I'm not sure that will move me in the right direction. My other option is to try and do the best I can and move forward with well written scriplets. I've read enough of Bear's posts that I know that's not the best way to go, but I'm not sure if I have a choice. Thanks very much for any advice. Here is an excerpt; this is common throughout the system; probably 2 or 300 JSPs written in this fashion.

10 years ago
JSP
Thanks for the reply Peter.
Yep, I have autobuild off, but I build each time I make a change. I can turn autobuild though and see if that changes anything. I do have JBoss Tools installed.
I will see If I can check that ./metdata path to see if I can see the jar there.
11 years ago
Hi Folks. I am new to JBoss and have been trying to deploy an MDB on my server in Eclipse with no luck. If I export the JAR file to the deploy folder of JBOSS server/all directory, I can run the message generator from Eclipse and it works as I expect (consumer onMessage generates a little "Hello" Message in the log). I can work with it this way, but its a hassle to have to stop and restart the server every time I make a change.
The process I was using in eclipse was:
1) Use add/remove to add the project to the JBOSS 5 server in the server view.
2) Select the project in the server view and select "Full Publish".
3) Start the Server


When I'd run the message generator, the server log would show the connection, but the message consumer wasn't being called. The book I am using says that I should see the JAR file for the project generated at that point in the JBOSS server/all directory, but its not being generated.

I'm sure its something in the way I have Eclipse and JBOSS playing together but I'm not sure what.
Thanks!
11 years ago

Jeff Verdegan wrote:

I know that's a lot of information, but it's necessary to show the major pieces to be able to explain what you're seeing in the code you're playing with.




Nope; its perfect. I just need to re-read it and digest it. Thanks for taking the time to explain it.
12 years ago