This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Pipeline as Code and have Mohamed Labouardy on-line!
See this thread for details.
Win a copy of Pipeline as Code this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

EJB - CMP database connection problem

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
And then the entire population worshiped me like unto a god. Well, me and this tiny ad:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic