Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Not able to refer EJB Session Bean methods

 
Mamata Roy
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,

I am trying to call session bean methods through a delegate in my action class . Although the session object is getting created the methods are not getting called . I am not getting any error either.

The are the classes i refer

Session :

public interface TestSession extends EJBObject
{
public void insertIAFile( HashMap dataForDao, String loginId) throws SQLException,FileNotFoundException,RemoteException;
}

SessionBean;

public class TestSessionBean implements SessionBean {



public void ejbCreate()
{
}

public void ejbActivate()
{
}

public void ejbPassivate()
{
}

public void ejbRemove()
{
}

public void setSessionContext(SessionContext ctx)
{
}
public void insertIAFile(HashMap dataForDao, String loginId) throws SQLException,FileNotFoundException,RemoteException
{

try{

System.out.println("In insertIAFile of TestSessionBean");
InvAdvDao invDao = new InvAdvDao();
invDao.insertIAFile(dataForDao,loginId);

} catch...... (Not copying the exception trace)

}


Session Home :

public interface TestSessionHome extends EJBHome
{
TestSession create() throws RemoteException, CreateException;
}



Using a delegate in my action class :


invDel.insertIAFile(dataForDao,loginId);


But it doesnot go inside the bean method (marked in red).
But it does not give any error also




Please help.





 
K. Tsang
Bartender
Posts: 3526
16
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

Why is your TestSessionBean class "implements SessionBean"? Shouldn't it be "implements TestSession"?
 
Mamata Roy
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to implement methods of SessionBean



public void ejbCreate()
{
}

public void ejbActivate()
{
}

public void ejbPassivate()
{
}

public void ejbRemove()
{
}

public void setSessionContext(SessionContext ctx)
{
}
 
Mamata Roy
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any solution to this?
 
K. Tsang
Bartender
Posts: 3526
16
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using EJB3? If so you don't need to "implement SessionBean" interface.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic