Hi, I am trying to build a BMP entity bean with local and remote interfaces.
When using ejbc i have the following error:
ERROR: Error from ejbc:
In
EJB dipl.PersonBMPBean, the throws clause for ejbCreate method ejbCreate(java.lang.String,java.lang.String,java.lang.String,
java.
lang.Integer,java.lang.Integer) contains exceptions which are NOT in the throws clause of the corresponding local home interface method.
ERROR: ejbc found errors
I don't know what to do with this error. The only exception I don't have in method signature is the RemoteException, which doesn't apply to my LOCAL home interface.
Here the method:
- The localhome interface:
public PersonBMPLocal create(
String id, String name,String birthday, Integer size, Integer height)
throws CreateException;
- The bean class:
public String ejbCreate(String id, String name,String birthday, Integer size, Integer height) throws RemoteException, CreateException {
PreparedStatement ps = null;
try {
con = getConnection();
ps = con.prepareStatement(
"insert into persons values (?,?,?,?,?)");
ps.setString(1, id);
ps.setString(2, name);
ps.setString(3, birthday);
ps.setInt(4, size.intValue());
ps.setInt(5, height.intValue());
if (ps.executeUpdate() != 1) {
System.out.println(
"Unable to insert new persion with ID "+id+" and name "+name);
}
return id;
}catch (SQLException e) {
e.printStackTrace();}
try {
ps.close();
con.close();
con=null;
} catch (Exception e) {}
return "Unable to insert new persion with ID "+id+" and name "+name;
}