Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

error when running ejbc on my jar file

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I try to run ejbc on my jar file I got the following error :

Error from ejbc: For cmp-field 'orderNumber' of bean 'Address', we expected to find a corresponding 'getOrderNumber' method in the abstract bean class. Compilation cannot continue without this 'get' method

--------------------------------------------------------------------------
Here's my code:

import javax.ejb.*;
import au.edu.uts.it.aip.*;

public abstract class AddressBean implements EntityBean
{

private EntityContext entityContext;
public void setEntityContext (EntityContext ec)
{
this.entityContext = ec;
}
public void unsetEntityContext ()
{
this.entityContext = null;
}

public String ejbCreate(String orderNumber, int unitNumber, String street,
String state, String suburb, String postCode, String country)
throws CreateException
{
setOrderNumber(orderNumber);
setUnitNumber(unitNumber);
setStreet(street);
setState(state);
setSuburb(suburb);
setPostCode(postCode);
setCountry(country);
return null;
}

public void ejbPostCreate(String orderNumber, int unitNumber, String street, String state, String suburb, String postCode, String country)
throws CreateException
{}

public void ejbRemove() throws RemoveException { }
public void ejbActivate() { }
public void ejbPassivate() { }
public void ejbLoad() { }
public void ejbStore() { }

abstract public String getOrderNumber();
abstract public void setOrderNumber(String orderNumber);

abstract public int getUnitNumber();
abstract public void setUnitNumber (int unitNumber);

abstract public String getStreet ();
abstract public void setStreet(String street);

abstract public String getState();
abstract public void setState (String state);

abstract public String getSuburb ();
abstract public void setSuburb (String suburb);

abstract public String getPostCode ();
abstract public void setPostCode (String postCode);

abstract public String getCountry ();
abstract public void setCountry (String country);
}
---------------------------------------------------------------------------

my deployment descriptors files:
ejb.jar.xml:
<entity>
<ejb-name>Address</ejb-name>
<home>au.edu.uts.it.ejb.AddressHome</home>
<remote>au.edu.uts.it.ejb.Address</remote>
<ejb-class>au.edu.uts.it.ejb.AddressBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.String</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>AddressBean</abstract-schema-name>
<cmp-field>
<field-name>orderNumber</field-name>
</cmp-field>
<cmp-field>
<field-name>unitNumber</field-name>
</cmp-field>
<cmp-field>
<field-name>street</field-name>
</cmp-field>
<cmp-field>
<field-name>state</field-name>
</cmp-field>
<cmp-field>
<field-name>suburb</field-name>
</cmp-field>
<cmp-field>
<field-name>postCode</field-name>
</cmp-field>
<cmp-field>
<field-name>country</field-name>
</cmp-field>
<primkey-field>orderNumber</primkey-field>
<query>
<query-method>
<method-name>findAll</method-name>
<method-params></method-params>
</query-method>
<ejb-ql>
<![CDATA[SELECT OBJECT(a) FROM AddressBean AS a ]]>
</ejb-ql>
</query>
</entity>

weblogic-cmp-rdbms-jar.xml:
<weblogic-rdbms-bean>
<ejb-name>Address</ejb-name>
<data-source-name>thinOracleDataSource</data-source-name>
<table-name>order</table-name>

<field-map>
<cmp-field>orderNumber</cmp-field>
<dbms-column>ordernumber</dbms-column>
</field-map>
<field-map>
<cmp-field>unitNumber</cmp-field>
<dbms-column>unitNumber</dbms-column>
</field-map>
<field-map>
<cmp-field>street</cmp-field>
<dbms-column>address</dbms-column>
</field-map>
<field-map>
<cmp-field>state</cmp-field>
<dbms-column>state</dbms-column>
</field-map>
<field-map>
<cmp-field>suburb</cmp-field>
<dbms-column>suburb</dbms-column>
</field-map>
<field-map>
<cmp-field>postCode</cmp-field>
<dbms-column>postCode</dbms-column>
</field-map>
<field-map>
<cmp-field>country</cmp-field>
<dbms-column>country</dbms-column>
</field-map>
</weblogic-rdbms-bean>
-------------------------------------------------------------------------

Thanks a lot,
 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<dbms-column>ordernumber</dbms-column>

Are you sure if the column name is orderNumber of ordernumber as you have in your deployment descriptor ?
 
Live ordinary life in an extraordinary way. Details embedded in this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic