Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB access from a JSP in VAJ Test Environment  RSS feed

 
richard marais
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have created a simple session EJB using IBM VisualAge 3.5.3 (Enterprise). I have then created an AccessBean (Java Bean Wraper). Generated the Deployed code. I started the Persistent Name Server, Servlet Engine and the EJB server for the EJB Group.
I then created a JSP in order to access the EJB. However when I try import the AccessBean I get a JSP compilation error:
com.ibm.servlet.engine.webapp.WebAppErrorReport: "Class: com.ory.ejb.SessionOryAccessBean not found".
I have tried to use in import statement as well as the usebean tag, but neither work.
Can anyone tell me how to access an EJB through an access bean by a jsp?
Thanks in advance
 
Tim Holloway
Bartender
Posts: 18704
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
useBean doesn't work for EJBs, only regular JavaBeans. To use an EJB, you have to use JNDI.
As far as the "class not found" error, you have to have the home and remote interfaces in the CLASSPATH that the JSP compiler is using.
 
richard marais
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, that did the trick, I can now call the EJB from a JSP.
However I have created a CMP entity bean with getter & setter methods. When a run the test client it can get & set the data on the database (oracle). But when I call the get or set methods from the JSP it does not talk to the database, it just returns the initialized values. I am calling ejbCreate(int) to try and locate the primary key.
Another Question, how/where do I run SQL statements through the CMP bean?
thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!