aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes error when running ejbc on my jar file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "error when running ejbc on my jar file" Watch "error when running ejbc on my jar file" New topic
Author

error when running ejbc on my jar file

ludo chatillon
Greenhorn

Joined: Oct 24, 2004
Posts: 1
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,
Vicky Mohan
Ranch Hand

Joined: Oct 14, 2004
Posts: 130
<dbms-column>ordernumber</dbms-column>

Are you sure if the column name is orderNumber of ordernumber as you have in your deployment descriptor ?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: error when running ejbc on my jar file