Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem Calling EJB from JSP

 
Sivaraman Lakshmanan
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,
I am new to EJB. I was trying to execute a Adder EJB example. I am using weblogic 8.1 as the App server. I deployed the bean and accessed the EJB from a Java Class everything is executed fine.

I want to make the client as a Web Client so I wrote a JSP with the same code that I used in the Java Class.

I packed the JSP in as a war file. The files in the WAR are
index.jsp
WEB-INF/web.xml

I deployed this WAR file in the server. When I accessed the JSP thro the URL http://localhost:7001/AdderClient/index.jsp I am getting JSP errors
My JSP Code is as Fllows



The JSP is not able to find any of the packages in the import statement. I have kept everything in the classpath.

The error I get in the JSP are as follows



Where should I keep all the jar files so that the JSP can see.

Any help on this is much appreciated.

Thanks in Advance

Regards,
Sivaraman.L
 
Sivaraman Lakshmanan
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
I kept the jar file which contains all the Interface and bean in
the WEB-INF/lib directory of the client war file. Packed the WAR file redeployed it. When I called the JSP it worked.
If this is the case then why do we need all these EJB way of doing things. I guess I am doing something wrong. As per the EJB architechture the business logic and beans are deployed seperately in the server and client which access this application is deployed seperately, The client will call the EJB only thro the JNDI (Please correct me if I am wrong).
Please expalin me how to call the EJB correctly.

Thanks in advance

Regards,
Sivaraman.L
 
Yuriy Zilbergleyt
Ranch Hand
Posts: 429
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As I understand it, you always need to import the Home and Remote interface classes in your web-client so it knows how to use the bean. The actual bean implementation class is only needed on the server where it is deployed though. I have no idea why your JSP wasn't finding the javax.naming packages though.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!