File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes BEA/Weblogic and the fly likes Calling EJB in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Calling EJB in JSP" Watch "Calling EJB in JSP" New topic

Calling EJB in JSP

raja srinivas

Joined: Jun 22, 2001
Posts: 20
Hi guys,
i am facing trouble in calling my ejb from the jsp's. I think its due to the fact that there is something wrong with the path that i set in the weblogic server in the Weblogic.xml file. Can someone please preovide me the corect syntax of writing the location there. (that is , java:comp/env/ejb... part). Can anyone please explain me that part.
Marcos Maia
Ranch Hand

Joined: Jan 06, 2001
Posts: 977
You should consider that if your jsp is not package in an ear file with the ejb you should package the remote and home interfaces from your ejb in the war file for the jsp, also if your jsp is not in a war file you should provide acces to that interfaces for the jsp otherwise it´┐Żll not find them.
raja srinivas

Joined: Jun 22, 2001
Posts: 20
yeah..but write now i am in the development stage, so i dont want to create a .ear file everytime i add a new jsp. Weblogic says "arrange the resources(JSP's, static files etc) in the prescribed directory format....write web.xml...."
the error i am getting is
" CreateProcess: /bin/javac.exe -classpath C:\bea\wlserver6.0\config\mydomain\applications\DefaultWebApp_myserver;C:\bea\wlserver6.0\.\config\mydomain\applications\DefaultWebApp_myserver\WEB-INF\lib\ejbtags.jar;C:\bea\wlser ver6.0\.\config\mydomain\applications\DefaultWebApp_myserver\WEB-INF\classes;C:\bea\wlserver6.0\.\config\mydomain\applications\DefaultWebApp_myserver\WEB-INF\_tmp_war_myserver_myse rver_DefaultWebApp_myserver;C:\bea\wlserver6.0\config\mydomain\applications\DefaultWebApp_myserver\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp_myserver;C:\bea\jdk130\jre\lib\r t.jar;C:\bea\jdk130\jre\lib\i18n.jar;C:\bea\jdk130\jre\lib\sunrsasign.jar;C:\bea\jdk130\jre\classes;.;.\lib\weblogic_sp.jar;.\lib\weblogic.jar;null -d C:\bea\wlserver6.0\.\config\mydomain\applications\DefaultWebApp_myserver\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp_myserver C:\bea\wlserver6.0\.\config\mydomain\applications\DefaultWebApp_myserver\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp_myserver\jsp_servlet\ error=3D
at java.lang.Win32Process.create(Native Method)
at java.lang.Win32Process.<init>(
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(
at java.lang.Runtime.exec(
at java.lang.Runtime.exec(
at weblogic.utils.Executable.exec(
at weblogic.utils.Executable.exec(
at weblogic.utils.compiler.CompilerInvoker.compileMaybeExit(
at weblogic.utils.compiler.CompilerInvoker.compile(
at weblogic.servlet.jsp.JspStub.compilePage(
at weblogic.servlet.jsp.JspStub.prepareServlet(
at weblogic.servlet.jsp.JspStub.prepareServlet(
at weblogic.servlet.internal.ServletStubImpl.getServlet(
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(
at weblogic.servlet.internal.ServletRequestImpl.execute(
at weblogic.kernel.ExecuteThread.execute(
Any clues ???
Raja Srinivas
Ashwin Gupta

Joined: Mar 05, 2003
Posts: 1
Hi ,
I was also in same trouble...So u take following steps (in WebLogic 7.0)
(1) Add Client Jar of ur EJb in Web Application folder & make a war file(not Deployed).
(2) Now take ejb JAR file of ur EJB & take above war file into EAR file & deploy that EAR file on WLS7.0.
(3) path should be on Browser
http://hostString ort/(Name of WAR file)/(html or JSP page name)
Rahul Mahindrakar
Ranch Hand

Joined: Jul 28, 2000
Posts: 1868
Hi Raja
Could you please provide the JNDI lookup name that you provided in the xml file.
The problem could be that you have not put in the correct jndi name.
I agree. Here's the link:
subject: Calling EJB in JSP
It's not a secret anymore!