wood burning stoves 2.0*
The moose likes Java in General and the fly likes EJB - CMP database connection problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "EJB - CMP database connection problem" Watch "EJB - CMP database connection problem" New topic
Author

EJB - CMP database connection problem

Norman Fung
Greenhorn

Joined: Oct 26, 2004
Posts: 2
CMP - failed to retrieve data from database - but NO exception..

Hi, I've developed this simple CMP to retrieve user Group information from database. It failed to retrieve data from database but no exception is thrown (Yes, I stepped through the code, nothing happenned). And now I'm kind of stuck without any error message to start debuggin with. So, I'm just asking for general advice/direction...

1. CLIENT side
Here's the Strut's action class ** ie. the CLIENT ** (yes, that's where they retrieve local proxy to CMP directly, as opposed to doing it thru a session bean):



2. The CMP GroupBean:



3. SCREEN DUMP


4. mysql-ds.xml

I still haven't been able to get to the bottom of it. The only thing I know is that for sure my CMP "GroupBean" is sending nothing to target database. I used p6spy and intercepted anything to/from database.



5. XDoclet generated "jbosscmp--jdbc.xml" (NOTE: The datasource tag looks correct....)




Any idea? Thanks in advance!
Norman Fung
Greenhorn

Joined: Oct 26, 2004
Posts: 2
First off, found a problem, rectified it, and BUT THE PROBLEM REMAINS:




So this error was rectified (BUT STILL PROBLEM REMAINS - MY BEAN IS SENDING NOTHING TO DATABASE!)



Help!
Olexiy Prokhorenko
Ranch Hand

Joined: Jul 11, 2004
Posts: 97
Originally posted by Norman Fung:




Why are you narrowing Local ???


Instead of that line:

home = (GroupLocalHome)PortableRemoteObject.narrow(ref, GroupLocalHome.class);

you for sure need to have:

home = (GroupLocalHome) ref;

I will not say that this is the ONLY problem, but that definately is a problem! :-)


<a href="http://www.BossTalks.com" target="_blank" rel="nofollow">http://www.BossTalks.com</a><br />Free advices and help for entrepreneurs: from Idea to IPO<br />Software and IT Project Management forum
Olexiy Prokhorenko
Ranch Hand

Joined: Jul 11, 2004
Posts: 97
You can also try to see this article
http://www.developer.com/java/data/article.php/3405781

May be it could help you a bit.
It's exactly dealing about Stateless Session Bean + CMP Entity Bean created and deployed on JBoss. It's working variant, so you can use it to compare with your's.
David Harkness
Ranch Hand

Joined: Aug 07, 2003
Posts: 1646
Originally posted by Norman Fung:
I suspect it's because you've named your bean (not the class/file name) "GruopEJB" instead of "Group". I don't know if the schema tag is supposed to override that (I didn't use it in my XDoclet tags).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EJB - CMP database connection problem