Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB - CMP database connection problem

 
Norman Fung
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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! :-)
 
Olexiy Prokhorenko
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1646
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic