473,405 Members | 2,185 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

cannot find accessor getFirstName for CMP field firstName deploytool

oll3i
679 512MB
in deploytool when i go to "cmp database" i get the message "cannot find accessor getFirstName for CMP field firstName"?
Dec 5 '08 #1
7 2224
JosAH
11,448 Expert 8TB
Is that getFirstName() method implemented? That deployment tool doesn't whine for no reason.

kind regards,

Jos
Dec 6 '08 #2
oll3i
679 512MB
yes there is getFirstName method in my bean and in the local interface
but when i click ContactBean and go to "Entity" firstName is not displayed there rest of the fields displays
Dec 6 '08 #3
oll3i
679 512MB
i double ckecked if i have a typo but no no typo
Dec 6 '08 #4
oll3i
679 512MB
my ContactBean code
Expand|Select|Wrap|Line Numbers
  1. package zadanie4;
  2.  
  3. import java.util.ArrayList;
  4. import java.util.Collection;
  5. import java.util.Iterator;
  6. import javax.ejb.CreateException;
  7. import javax.ejb.EntityBean;
  8. import javax.ejb.EntityContext;
  9. import javax.naming.Context;
  10. import javax.naming.InitialContext;
  11.  
  12.  
  13. public abstract class ContactBean  implements EntityBean {
  14.  
  15.      private EntityContext context;
  16.  
  17.      //cmp
  18.       public  abstract String  getEmail();
  19.  
  20.       public abstract String getFirstName();
  21.  
  22.       public abstract String getLastName();
  23.  
  24.       public abstract String getContactID();
  25.  
  26.  
  27.       public abstract void setEmail(String email);
  28.  
  29.       public abstract void setFirstName(String firstName);
  30.  
  31.       public abstract void setLastName(String lastName);
  32.  
  33.       public abstract void setContactID(String conactID);
  34.  
  35.       //cmr
  36.       public abstract Collection getAddresses();
  37.       public abstract void setAddresses (Collection addresses);
  38.  
  39.       public abstract Collection getPhones();
  40.       public abstract void setPhones (Collection phones);
  41.  
  42.  
  43.  
  44.        //business methods
  45.        public ArrayList getAddressList() {
  46.             ArrayList list = new ArrayList();
  47.             Iterator c = getAddresses().iterator();
  48.             while (c.hasNext()) {
  49.                 list.add((LocalAddress)c.next());
  50.             }
  51.             return list;
  52.         }
  53.  
  54.         public ArrayList getPhoneList() {
  55.             ArrayList list = new ArrayList();
  56.             Iterator c = getPhones().iterator();
  57.             while (c.hasNext()) {
  58.                 list.add((LocalPhone)c.next());
  59.             }
  60.             return list;
  61.         }
  62.  
  63.         public void addAddress (LocalAddress address) {
  64.             getAddresses().add(address);
  65.         }
  66.  
  67.         public void addPhone (String id) {
  68.             try {
  69.                 Context ic = new InitialContext();
  70.                 LocalPhoneHome home = (LocalPhoneHome)
  71.                     ic.lookup("java:comp/env/ejb/PhoneRef");
  72.                 LocalPhone phone = 
  73.                 home.findByPrimaryKey(id);
  74.                 addPhone(id);
  75.             } catch (Exception ex) {
  76.                 ex.printStackTrace();
  77.             }
  78.         }
  79.  
  80.         public void addPhone (LocalPhone phone) {
  81.             getPhones().add(phone);
  82.         }
  83.  
  84.  
  85.  
  86.         public String ejbCreate (
  87.                 String contactID,
  88.                 String firstName,
  89.                 String lastName,
  90.                 String email) 
  91.             throws CreateException {
  92.             return create(contactID, firstName, lastName, email);
  93.         }
  94.  
  95.         private String create(
  96.                 String contactID,
  97.                 String firstName,
  98.                 String lastName,
  99.                 String email)
  100.             throws CreateException {
  101.  
  102.             setContactID(contactID);
  103.             setFirstName(firstName);
  104.             setLastName(lastName);
  105.             setEmail(email);
  106.             return contactID;
  107.         }
  108.  
  109.         // other EntityBean methods
  110.  
  111.         public void ejbPostCreate (
  112.                 String contactID,
  113.                 String firstName,
  114.                 String lastName,
  115.                 String email)
  116.             throws CreateException { }
  117.  
  118.         public void setEntityContext(EntityContext ctx) {
  119.             context = ctx;
  120.         }
  121.  
  122.         public void unsetEntityContext() {
  123.             context = null;
  124.         }
  125.  
  126.         public void ejbRemove() { }    
  127.         public void ejbLoad() { }    
  128.         public void ejbStore() { }    
  129.         public void ejbPassivate() { }    
  130.         public void ejbActivate() { }
  131.  
  132.  
  133.  
  134.  
  135.  
  136.     }
  137.  
  138.  
Dec 6 '08 #5
JosAH
11,448 Expert 8TB
@oll3i
You have to start experimenting then:

- maybe your deploy tool wants you to annotate those cmp fields;
- maybe (if you're using remoted interfaces as well) that getter has to be a part of that interface as well.

kind regards,

Jos (just guessing)
Dec 6 '08 #6
oll3i
679 512MB
i created the whole jar again and it doesnt complain now:)
Dec 6 '08 #7
JosAH
11,448 Expert 8TB
@oll3i
Oh great, it was just an old jar issue; may I suggest you do a complete build after you've changed your source code?

kind regards,

Jos
Dec 6 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: cazconv2007 | last post by:
i cant understand why it says cannot find symbol can you guys look thanx i can get it to show john doe but not my next name. class Name { public String firstName ="carl"; private...
5
by: cart1443 | last post by:
So I know I need to add a few more lines somewhere to make this work, but I'm not sure how. // Lab 3: EmployeeTest.java // Application to test class Employee. /* Begin class declaration of...
11
by: sajitk | last post by:
I am new to access and i am trying to build a database for enntering Subscription details of a particular journal. Wat I want is that FirstName field on the form should not be left blank. If the user...
9
lotus18
by: lotus18 | last post by:
Hello World I made a simple program on creating new objects (student1 and student2). I compiled it and it is OK, but when I run it, I don't see results. I tried to insert from Line#4 to Line#36...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.