| Biebel 2004-03-19, 8:45 pm |
| Hello,
I've a stateful session bean. In the ejbCreate I construct an object. The
problem is that the constructor isn't found.
Here are the classes.
Session bean:
public class yComboDataBean implements SessionBean
{
SessionContext sessionContext;
yServerCtx serverCtx;
public void ejbCreate(yUserProfile userProfile) throws CreateException
{
try
{
serverCtx = new yServerCtx( userProfile );
}
catch(Exception e)
{
throw new CreateException("Could not make database connection in
HistorySessionBean");
}
}
public void ejbRemove()
{
try
{
serverCtx.disconnect();
}
catch(java.sql.SQLException e) {}
finally
{
serverCtx = null;
}
}
public void ejbActivate() {}
public void ejbPassivate() {}
public void setSessionContext(SessionContext sessionContext)
{
this.sessionContext = sessionContext;
}
}
public class yServerCtx
{
private yUserProfile userProfile;
public DatabaseOps dbOps = new DatabaseOps();
public static final BigDecimal zero = new BigDecimal(0);
public yServerCtx(yUserProfile userProfile) throws
javax.naming.NamingException, java.sql.SQLException
{
this.userProfile = userProfile;
}
public void disconnect() throws java.sql.SQLException
{
dbOps.disconnect();
dbOps = null;
userProfile = null;
}
}
I've deployed everything on a JBoss app server. The error message I got is:
10:56:01,459 ERROR [LogInterceptor] Unexpected Error:
java.lang.NoSuchMethodError:
yTools.Server.yServerCtx.<init>(LyTools/yUserProfile;)V
at yToolsBeans.yComboDataBean.ejbCreate(yComboDataBean.java:25)
...
Has anyone a clue,
thanks
Bart
|