• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem Calling EJB from JSP

 
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 429
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
F is for finger. Can you stick your finger in your nose? Doesn't that feel nice? Now try this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic