Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

"EJB" Monson-Haefel JBoss Example ex06_3

 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have just tried the example ex06_3 in Richard Monson-Haefel's EJB JBoss Workbook. I'm using jboss3.2.2-RC4. It failed to deploy until I created the CustomerHomeLocal and CustomerLocal interfaces.
Anybody have any idea why, for this simple CMP example, these two interfaces are now required in addition to the AddressHomeLocal and AddressLocal interfaces? The relationship is "Customer has an Address" not "Address has a Customer".
Thanks,
-Barry
[ October 31, 2003: Message edited by: Barry Gaunt ]
 
Peter Otto
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, to get this prgram to work you need to add
1.) com.titan.customer.CustomerHomeLocal defined as follows....
public interface CustomerHomeLocal extends EJBLocalHome {
public CustomerLocal create(Integer id)
throws CreateException,EJBException;
public CustomerLocal findByPrimaryKey(Integer pk)
throws FinderException, EJBException;
}
2.)Also you need com.titan.customer.CustomerLocal defined as follows.....
public interface CustomerLocal extends EJBLocalObject {
public AddressLocal getHomeAddress();
public void setHomeAddress(AddressLocal address);
}
3.)Third and lastly, you need to edit the ejb-jar.xml file and ADD two line as follows...
<local-home>com.titan.customer.CustomerHomeLocal</local-home>
<local>com.titan.customer.CustomerLocal</local>
---------------------------------------------------------------
You are right. I have no idea why we need to do this. It just doesn't make sense. Do you think this problem is only for JBoss? I looked at their docs off their web site. (Downloaded it for $10, definelty worth it) and I found no help there as of yet.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic