Calling EJB from JSP

Hi - I'm running OC4J 9.0.2 on windows 2000
I have a JSP that accepts user inputs and the call respective Servlets. Before the servlet gets called, I want to log a tracing event with an EJB(Stateless Session Bean).
I have manipulated the "form" values with JavaScript but cannot find any docs on how to call an EJB from JavaScript in a JSP.
The JSP and EJB works fine on there own. How do I get the "form" values into the EJB variables without JavaScript?
The EJB logs fine while still in the "JAVA" part of the JSP but I don't know how to extract these 2 index values.
Tks
Andre
Here is extract of code:
<%@ page language="java" contentType="text/html;charset=windows-1252"%>
<%@ page language="java" import="java.io.*"%>
<%@ page language="java" import="java.util.*"%>
<%@ page language="java" import="javax.naming.*"%>
<%@ page language="java" import="javax.rmi.*"%>
<%@ page language="java" import="WizardEvents.WizEventLog.*"%>
<HTML>
<HEAD>
<BODY background="/wp/Background.gif">
<script language="JavaScript">
// build timer to display at bottom of screen for debugging of screen dumps
function display_time()
var da = new Date();
var dd = da.getDate('DD');
var dm = da.getMonth('MON')+1;
var dy = da.getYear('YYYY');
var h = da.getHours();
var m = da.getMinutes();
if (m < 10)
m = "0" + m;
var t = dy+"\-"+dm+"\-"+dd+" "+h+":"+m;
defaultStatus = t;
setTimeout("display_time()",60000); // one minute
return true;
function registerEvent()
var menuItem = document.selRequest.selCategory.selectedIndex;
var serviceOption = document.selRequest.serviceOption.selectedIndex;
// now invoke EJB to log event
alert("selected menu option is "+menuItem+" and service option "+serviceOption);
return true;
// get the value from the categories and build up list of the options...
function buildItems()
// alert("Building items");
// get the index (starting with 0) of the categories selection
var menuItem = document.selRequest.selCategory.selectedIndex;
// reset the values for the options selection to 0
document.selRequest.serviceOption.length=0;
// define new array to hold options for transfer to selection item
newOptions = new Array;
// Now check which menu option, build list
var newLength = 0;
switch(menuItem)
case 0:
newLength = 1;
newOptions[0] = new Option("No Service Option",0,false,false);
break;
case 1:
newLength = 1;
newOptions[0] = new Option("No Service Option",0,false,false);
break;
case 2:
newLength = 1;
newOptions[0] = new Option("No Service Option",0,false,false);
break;
case 3:
newLength = 1;
newOptions[0] = new Option("No Service Option",0,false,false);
break;
case 4:
newLength = 1;
newOptions[0] = new Option("No Service Option",0,false,false);
break;
case 5:
newLength = 5;
newOptions[0] = new Option("All wallet and airtime balance",0,true,true);
newOptions[1] = new Option("Airtime balance",1,false,false);
newOptions[2] = new Option("SMS-a-lot balance",2,false,false);
newOptions[3] = new Option("Call Extender balance",3,false,false);
newOptions[4] = new Option("Per Second Billing balance",4,false,false);
break;
case 6:
newLength = 2;
newOptions[0] = new Option("Subscriber data - Channel Provisioning Options",8,true,true);
newOptions[1] = new Option("IBS Pending Transaction Inquiry",9,false,false);
break;
default:
newLength = 1;
newOptions[0] = new Option("No Service Option - Default",0,false,false);
break;
var serviceOption = document.selRequest.serviceOption;
// transfer array to select statement
for (var i=0; i < newLength; i++)
serviceOption.options[i] = newOptions;
</script>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<TITLE>Wizard Prepaid Interface</TITLE>
<%----%>
<BODY text="#FFFFFF" bgcolour="#ffffff" bgcolor="#3c698a" onload="display_time();" >
<H2 ALIGN=Center>Wizard Prepaid Interface</H2>
<PRE>
<%
java.util.Enumeration params=request.getParameterNames();
StringBuffer urlBuf = request.getRequestURL();
String urlValue = urlBuf.toString();
int colPos = urlValue.indexOf(":8888");
String serverName = urlValue.substring(0,colPos+5);
String paramValues1[] = request.getParameterValues("event_ref_no");
String eventRefNo = paramValues1[0];
String paramValues2[] = request.getParameterValues("msisdn_no");
String msisdnNo = paramValues2[0];
String paramValues3[] = request.getParameterValues("operator_id");
String operatorId = paramValues3[0];
String paramValues4[] = request.getParameterValues("wizDB");
String wizDB = paramValues4[0].toLowerCase();
// set session values into session object
session.removeAttribute("eventRefNo");
session.removeAttribute("msisdnNo");
session.removeAttribute("operatorId");
session.removeAttribute("wizDB");
session.removeAttribute("serverName");
session.setAttribute("eventRefNo",eventRefNo);
session.setAttribute("msisdnNo",msisdnNo);
session.setAttribute("operatorId",operatorId);
session.setAttribute("wizDB",wizDB);
session.setAttribute("serverName",serverName);
session.setAttribute("eventOpenCount","0");
session.setAttribute("errorString","No errors encountered yet");
// now build ref to lookup event log EJB
WizardEvents.WizEventLog eventBean;
Context ctx = new InitialContext();
Object homeObject=ctx.lookup("WizEventLog");
WizardEvents.WizEventLogHome home =
(WizardEvents.WizEventLogHome)PortableRemoteObject.narrow(homeObject, WizardEvents.WizEventLogHome.class);
eventBean=(WizardEvents.WizEventLog)PortableRemoteObject.narrow(home.create(),
WizardEvents.WizEventLog.class);
int eventRefNoInput = Integer.parseInt(eventRefNo);
int operatorIdInput = Integer.parseInt(operatorId);
long msisdnNoInput = Long.parseLong(msisdnNo);
int callCatCodeInput = 177;
int callCatItemCodeInput = 2;
String machineName = "WEB";
String moduleName = "WIZARDPREPAID.JSP";
String[] resArray = null;
// event logging EJB
resArray = eventBean.setEventDetail(eventRefNoInput,
operatorIdInput,
callCatCodeInput,
callCatItemCodeInput,
machineName,
moduleName,
wizDB);
%>
</PRE>
<%--
// check if data passed is valid
--%>
<jsp:include page="/servlet/CheckValidURL" flush="true"></jsp:include>
<%
if (session.getAttribute("eventOpenCount").equals("1"))
%>
<H3 ALIGN=CENTER>MSISDN = <%=msisdnNo%></H3>
<HR>
<H4 ALIGN=CENTER>Prepaid Query History</H4>
<%--
onclick can empty the service options field
--%>
<TABLE>
<TD>Enter request target :</TD>
<%--action="/wp/servlet/ValidateParamsClass"--%>
<FORM name="selRequest" method="POST" >
<TD><SELECT name="selCategory" onchange="buildItems()" >
<OPTION value="Prepaid Cards Loaded">Prepaid Cards Loaded</OPTION>
<OPTION value="Prepaid Recycle History">Prepaid Recycle History</OPTION>
<OPTION value="Prepaid Failed Recharges">Prepaid Failed Recharges</OPTION>
<OPTION value="Prepaid Access4Life Status">Prepaid Access4Life Status</OPTION>
<OPTION value="Prepaid Number4Life Status">Prepaid Number4Life Status</OPTION>
<OPTION value="IBS Balance Inquiry">IBS Balance Inquiry</OPTION>
<OPTION value="IBS Subscriber Data Inquiry">IBS Subscriber Data Inquiry</OPTION>
</SELECT>
</TD>
</TABLE>
<%--
Build the possible service options for IBS depending on selection
Create selection list and then assign default value of none
--%>
<TABLE>
<TD>Possible Service Options:</TD>
<TD><select name="serviceOption">
<option value="">No option available</option>
<SCRIPT>
// re-build items to cater for FORWARD/BACK buttons, etc
buildItems();
</SCRIPT>
</TD>
</TABLE>
<%--
--%>
<%--
--%>
<INPUT type="submit" value="Query Prepaid Systems" onclick="registerEvent()" >
</FORM>

Hi Christian,
A few questions to clarify where the cause of the problem might be:
1. When you run the JSP app in JDeveloper, are you connecting to the remotely deployed app module, or the local one in your workspace?
2. In your JSP project, there is an appmodule.properties file. This file should specify the connection mode to use to connect to your EJB (ConnectMode=EJB), and should be deployed to a directory on your webserver's classpath, along with the connections.properties file. If the appmodule.properties file contains the wrong connectmode setting, or is not on the classpath for the webserver, this might be the cause.
Let us know.

Similar Messages

  • Calling EJB from JSP in SSL Mode

    Hi,
    I need to call an EJB from JSP in SSL Mode.
    How can i do that.
    Regards,
    S.V.Satish Kumar

    In that case you can refer to the following documents:
    Using JPA: http://help.sap.com/saphelp_nwce711/helpdata/en/44/eba6292f446c30e10000000a114a6b/frameset.htm
    Accessing persistence functionality in EJB 3.0: http://help.sap.com/saphelp_nwce711/helpdata/en/46/307a2a50094f09e10000000a114a6b/frameset.htm
    Tell me, if these documents help you. Otherwise, I will search for more information on the topic.
    Best regards,
    Ekaterina

  • How can I call EJB from JSP/Servlets in iWS?

    Hi!!
    My JSP/Servlets are on iWS, and I deploy EJB on iAS.
    In this case, I don't know how JSP/Servlet call EJb on iAS.
    I'd like to know how I can set JNDI name in JSP/Servlet on iWS.
    I will thank you if you give me a simple example source using JSP/Servlet
    and EJB.
    Thanks in advance!!!
    - Park-

    Park,
    Why Are you running your JSP/Servlets in iWS instead of iAS? For whatever
    reason,
    look at the Converter sample from iAS. You will be doing RMI/IIOP in this
    case and the sample explains in detail what to do.
    hth,
    -robert
    "SungHyun, Park" <[email protected]> wrote in message
    news:9jpfmt$[email protected]..
    Hi!!
    My JSP/Servlets are on iWS, and I deploy EJB on iAS.
    In this case, I don't know how JSP/Servlet call EJb on iAS.
    I'd like to know how I can set JNDI name in JSP/Servlet on iWS.
    I will thank you if you give me a simple example source using JSP/Servlet
    and EJB.
    Thanks in advance!!!
    - Park-

  • Call ejb from browsers

    Hello Developers!
    I deployed my ejb to OAS4081. I call that
    from JDeveloper so it good. But when I try
    to call from applet in IExpl5 I can't
    instantiate the ORB. I've got a com.ms.security.SecurityException : oracle.oas.orb.CORBA.ORB.init
    I coded the CLASSPATH(oasoorb(yoj),client,
    ejbapi...) perfectly, I think.
    If anybody could help, please...
    Thanx!

    Hi there,
              I saw someone on this group had a problem to locate proper classpath
              to call EJB from JSP. I thought if you call EJB from classpath, you are
              calling the bean. But you loss all the EJB functions. To be able to utilize
              EJB features like object pooling. You need to call it from Weblogic server
              using url/jndi, not from the jar directly.
              Any comment? Am I right?
              BTW, my question about calling EJB from JSP means calling through URL,
              not a local path.
              Thank you
              >-------------------------------------------------------------------->
              Jim wrote in message <[email protected]>...
              >Hi there,
              > Can I call EJB from JSP? Is there a particular security setting or
              >concern for Weblogic? Is there an coding example?
              >
              >Thank you
              >
              >
              

  • Calling an EJB from jsp - ServletException

    I am unable to call an EJB from jsp, unless I put the actuall classes of
              the EJB into the classpath. Is this the right way to do it?
              The exception is:
              Servlet failed with ServletException
              javax.servlet.ServletException: Servlet class: 'jsp_servlet._result'
              could not be loaded - the requested class wasn't found in the
              classpath:
              '/local/apps/bea/wlserver6.0/config/gmodomain/applications/.wl_temp_do_not_delete/wl_local_comp34107.war:/local/apps/bea/wlserver6.0/./config/gmodomain/applications/.wl_temp_do_not_delete/WEB-INF/_tmp_war_gmo_gmo_webwar:/local/apps/bea/wlserver6.0/config/gmodomain/applications/.wl_temp_do_not_delete/WEB-INF/_tmp_war_gmo_gmo_webwar'
              at
              weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:532)
              at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:191)
              at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:148)
              at
              weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:306)
              at
              weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:208)
              at
              weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:246)
              at
              weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:1265)
              at
              weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:1622)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              where result.jsp is the jsp page calling the EJB. I did an import of the
              EJB classes in the jsp.
              like i said, it works if I put the bean classes in the classpath. But is
              it right?
              if I have these in the exploded format, do I need to put anything in the
              application web.xml under:
              wlserver6.0/config/gmodomain/applications/DefaultWebApp_gmo/WEB-INF ?
              redhat 6.2, wl6.0sp1
              here are the xml files:
              web.xml:
              <?xml version="1.0"?>
              <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
              2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
              <!--
              $Id: web.xml,v 1.2 2001/03/14 22:23:03 jeff Exp $
              $Source:
              /usr/local/cvsroot/JUnitEE/example/components/web-war/WEB-INF/web.xml,v
              $
              -->
              <web-app>
              <display-name>My Web Application</display-name>
              <description>none</description>
              <ejb-ref>
              <ejb-ref-name>MyWeb</ejb-ref-name>
              <ejb-ref-type>Session</ejb-ref-type>
              <home>com.blah.ejb.myweb.WyWebHome</home>
              <remote>com.blah.ejb.myweb.MyWeb</remote>
              </ejb-ref>
              </web-app>
              weblogic.xml:
              <!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web
              Application 6.0//EN"
              "http://www.bea.com/servers/wls600/dtd/weblogic-web-jar.dtd">
              <weblogic-web-app>
              <jsp-descriptor>
              <jsp-param>
              <param-name>
              pageCheckSeconds
              </param-name>
              <param-value>
              1
              </param-value>
              </jsp-param>
              <jsp-param>
              <param-name>
              verbose
              </param-name>
              <param-value>
              true
              </param-value>
              </jsp-param>
              <jsp-param>
              <param-name>compileCommand</param-name>
              <param-value>/local/apps/jdk1.3.0_02/bin/javac</param-value>
              </jsp-param>
              </jsp-descriptor>
              <reference-descriptor>
              <ejb-reference-description>
              <ejb-ref-name>MyWeb</ejb-ref-name>
              <jndi-name>MyWeb</jndi-name>
              </ejb-reference-description>
              </reference-descriptor>
              </weblogic-web-app>
              thanks,
              Gary
              

    Did you package your JSPs in a WAR and your EJBs in a JAR and package the
              WAR and JAR in an EAR? That is how to do it in 6.0. Works well.
              Peace,
              Cameron Purdy
              Tangosol, Inc.
              http://www.tangosol.com
              +1.617.623.5782
              WebLogic Consulting Available
              "gmo" <[email protected]> wrote in message
              news:[email protected]...
              > I am unable to call an EJB from jsp, unless I put the actuall classes of
              > the EJB into the classpath. Is this the right way to do it?
              > The exception is:
              > Servlet failed with ServletException
              > javax.servlet.ServletException: Servlet class: 'jsp_servlet._result'
              > could not be loaded - the requested class wasn't found in the
              > classpath:
              >
              '/local/apps/bea/wlserver6.0/config/gmodomain/applications/.wl_temp_do_not_d
              elete/wl_local_comp34107.war:/local/apps/bea/wlserver6.0/./config/gmodomain/
              applications/.wl_temp_do_not_delete/WEB-INF/_tmp_war_gmo_gmo_webwar:/local/a
              pps/bea/wlserver6.0/config/gmodomain/applications/.wl_temp_do_not_delete/WEB
              -INF/_tmp_war_gmo_gmo_webwar'
              >
              > at
              >
              weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.jav
              a:532)
              >
              > at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:191)
              >
              > at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:148)
              >
              > at
              >
              weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:30
              6)
              >
              > at
              >
              weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
              :208)
              >
              > at
              >
              weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
              :246)
              >
              > at
              >
              weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
              ntext.java:1265)
              >
              > at
              >
              weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
              :1622)
              >
              > at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
              >
              > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              >
              > where result.jsp is the jsp page calling the EJB. I did an import of the
              > EJB classes in the jsp.
              > like i said, it works if I put the bean classes in the classpath. But is
              > it right?
              > if I have these in the exploded format, do I need to put anything in the
              > application web.xml under:
              > wlserver6.0/config/gmodomain/applications/DefaultWebApp_gmo/WEB-INF ?
              >
              > redhat 6.2, wl6.0sp1
              >
              > here are the xml files:
              > web.xml:
              >
              > <?xml version="1.0"?>
              > <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
              > 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
              >
              > <!--
              > $Id: web.xml,v 1.2 2001/03/14 22:23:03 jeff Exp $
              > $Source:
              > /usr/local/cvsroot/JUnitEE/example/components/web-war/WEB-INF/web.xml,v
              > $
              > -->
              >
              > <web-app>
              > <display-name>My Web Application</display-name>
              > <description>none</description>
              > <ejb-ref>
              > <ejb-ref-name>MyWeb</ejb-ref-name>
              > <ejb-ref-type>Session</ejb-ref-type>
              > <home>com.blah.ejb.myweb.WyWebHome</home>
              > <remote>com.blah.ejb.myweb.MyWeb</remote>
              > </ejb-ref>
              > </web-app>
              >
              > weblogic.xml:
              >
              > <!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web
              > Application 6.0//EN"
              > "http://www.bea.com/servers/wls600/dtd/weblogic-web-jar.dtd">
              > <weblogic-web-app>
              > <jsp-descriptor>
              > <jsp-param>
              > <param-name>
              > pageCheckSeconds
              > </param-name>
              > <param-value>
              > 1
              > </param-value>
              > </jsp-param>
              > <jsp-param>
              > <param-name>
              > verbose
              > </param-name>
              > <param-value>
              > true
              > </param-value>
              > </jsp-param>
              > <jsp-param>
              > <param-name>compileCommand</param-name>
              > <param-value>/local/apps/jdk1.3.0_02/bin/javac</param-value>
              > </jsp-param>
              > </jsp-descriptor>
              > <reference-descriptor>
              > <ejb-reference-description>
              > <ejb-ref-name>MyWeb</ejb-ref-name>
              > <jndi-name>MyWeb</jndi-name>
              > </ejb-reference-description>
              > </reference-descriptor>
              > </weblogic-web-app>
              >
              > thanks,
              >
              > Gary
              >
              >
              

  • Calling EJB from Java Stored Procedures

    Hi,
    I am trying to call an Enterprise Java Bean from stored procedure. This stored procedure calls a java program. As long as it is a simple java program it works fine and loadjava.exe does not give any problem (neither compile-time nor run-time).
    It is not working when I am trying to call EJB from it. It is giving compile-time error.
    If anybody has implemented the same please suggest how to go forward.
    thanks in advance,
    Shashank Agarwal

    I tried the same thing without any luck. I assume you are using OC4J for your EJB ...
    The compiling issue may be because you don't have the classes in your EJB client jar loaded into the database. Once those classes are loaded, you should loadjava without any problem.
    However, you won't be able to call the EJB server because the EJB client (your Java code in the DB) will need the OC4J environment (oc4j.jar). I have tried to load oc4j.jar into the DB as well, and that was a big mess and nothing worked. My DB is 8.1.7, maybe the new 9i have OC4J libs bundled?!?
    I looked around and only found 2 alternatives:
    1. Write a JSP page that acts like an EJB client, then use URLConnection in your DB java code to send params to the JSP for it to invlode the EJB
    2. Replace the JSP with RMI code, and use RMI instead of URLConnection in your DB code to invloke the EJB client.
    If you find any other solution, please share it here.
    Good luck!
    Hi,
    I am trying to call an Enterprise Java Bean from stored procedure. This stored procedure calls a java program. As long as it is a simple java program it works fine and loadjava.exe does not give any problem (neither compile-time nor run-time).
    It is not working when I am trying to call EJB from it. It is giving compile-time error.
    If anybody has implemented the same please suggest how to go forward.
    thanks in advance,
    Shashank Agarwal

  • Updating EJBs from JSPs

    i'm looking for a way to udpdate several entity beans via a stateful session controller.
    I can create references to the ejb controller in the JSP without a problem, but i need to know how to accept data entered into a form, store it temporarly and then call a ejb controller method using the form data as the arguments.
    i have seen the use of javabeans in this type of situation but i have limited time and i'm trying to avoid having to create event logic to signify that the javabeans' properties have been altered.
    ideally i would like to use the data entered into the form as arguments in a direct call to the ejb controller method.
    any advice would be appreciated!!!
    Thanks,
    Student with a deadline!

    Hi,
    You can get the instance of any bean inside the jsp as long as you have the correct url of the application server and ejb jndi name. Once you created the EJb instance, you can pass those form data, which you have to get using getParameter() or from httpsession and call the ejb as if you are calling EJB from normal java program.
    Hope that helps.
    Best Luck!
    Senthil Babu
    Developer Technical Support
    SUN Microsystems
    http://www.sun.com/developers/support/

  • Can't create DeliveryBean when call bpel from jsp

    Can't create DeliveryBean when call bpel from jsp
    /*** code ********************************/
    Properties props = new java.util.Properties();
    java.net.URL url = ClassLoader.getSystemResource("context.properties");
    props.load(url.openStream());
    Locator locator = new Locator(domain, "bpel", props);
    IDeliveryService deliveryService = (IDeliveryService)locator.lookupService(IDeliveryService.SERVICE_NAME);
    NormalizedMessage nm = new NormalizedMessage();
    String convId = GUIDGenerator.generateGUID();
    nm.setProperty(NormalizedMessage.CONVERSATION_ID, convId);
    nm.addPart("payload", xml);
    NormalizedMessage res = deliveryService.request(processID,operationName, nm);
    /*** code ********************************/
    This code works well in java , but when I use it in jsp on tomcat server,
    the following exception ocured:
    Can not create "ejb/collaxa/system/DeliveryBean" bean; exception reported is: "javax.naming.NameNotFoundException: Name ejb is not bound in this Context at org.apache.naming.NamingContext.lookup(NamingContext.java:768) at org.apache.naming.NamingContext.lookup(NamingContext.java:151) at org.apache.naming.SelectorContext.lookup(SelectorContext.java:136) at javax.naming.InitialContext.lookup(InitialContext.java:351) at com.oracle.bpel.client.util.BeanRegistry.lookupDeliveryBean(BeanRegistry.java:279) at com.oracle.bpel.client.delivery.DeliveryService.getDeliveryBean(DeliveryService.java:250) at com.oracle.bpel.client.delivery.DeliveryService.request(DeliveryService.java:83) at com.oracle.bpel.client.delivery.DeliveryService.request(DeliveryService.java:53) at workflow.bpel.BpelProcessHelper.invokeSyncBpel(BpelProcessHelper.java:54) at
    Will anyone to tell me where "ejb/collaxa/system/DeliveryBean" bean is?
    Which jar file is this class in ?
    Thanks

    did you try including bpel/lib/orabpel.jar & bpel/system/server/j2ee/ob_ejb_engine.jar in your tomcat classpath.

  • How to call servlet from jsp

    i m trying to call it from jsp using
    <a href="../purchaseP?orderno=<%=pno%>"><%=pno%></a>
    but its giving error..
    type Status report
    message HTTP method GET is not supported by this URL
    description The specified HTTP method is not allowed for the requested resource (HTTP method GET is not supported by this URL).

    i m trying to call it from jsp using
    <a href="../purchaseP?orderno=<%=pno%>"><%=pno%></a>
    but its giving error..
    type Status report
    message HTTP method GET is not supported by this URL
    description The specified HTTP method is not allowed
    for the requested resource (HTTP method GET is not
    supported by this URL).Are you implementing the doGet or doPost method in your servlet? If you are calling from a hyperlink then it needs to be implementing the GET method. To access the POST method use a html form.

  • Wot all ways are there to call servlet from jsp

    hi all
    i want to know wot all methods are available
    so that i can call servlet from jsp
    the one which i know is using RequestDispatcher
    wot are others ?
    thanx

    hi all
    i want to know wot all methods are available
    so that i can call servlet from jsp
    the one which i know is using RequestDispatcher
    wot are others ?
    thanxhi here are few ways... to call servlet from jsp...
    these are just generic syntax.
    Form:     
    <form action="ServletPath">
    Link:     
    Directives & Action tags :
    <%@ page import="ServletPath" %>
         <%@ taglib uri="ServletPth" %>
         <jsp:include page="ServletPath">
         <jsp:forward page="ServletPath">
         <jsp:useBean class="ServletPath"> (Not sure about this useBean)
    hope you got your answer.
    regards,
    immu

  • Calling JApplet from jsp

    Hi,
    Can any one tell me how to call JApplet from JSP? I am using <jsp:plugin>
    tag but it is not working.

    use the jsp:plugin tag like this in your jsp page..
    <jsp:plugin  type="applet"
         code="appletclsname.class"
         codebase="ourapplets"
         jreversion="1.5"
         width="400px"
         height="200px">
    </jsp:plugin>

  • How to call Servlet from jsp page and how to run this app using tomcat..?

    Hi ,
    I wanted to call servlet from jsp action i.e. on submit button of JSP call LoginServlet.Java file.
    Please tell me how to do this into jsp page..?
    Also i wanted to execute this application using tomcat.
    Please tell me how to do this...? what setting are required for this...? what will be url ..??
    Thanks.

    well....my problem is as follows:
    whenever i type...... http://localhost:8080/appName/
    i am getting 404 error.....it is not calling to login.jsp (default jsp)
    but when i type......http://localhost:8080/appName/login.do........it executes servlet properly.
    Basically this 'login.do' is form action (form action='/login.do').....and i wanted to execute this from login jsp only.(from submit button)
    In short can anyone please tell me how to diaplay jsp page using tomcat 5.5
    plz help me.

  • Calling EJB from other EJB on other J2EE Server

    Can I call EJB from other EJB on other J2EE Server
    Servers - Websphere 5.0
    Do i require home & remote interface of that ejb on client side also
    Help me, please

    the problem is actually i require that is specific to websphere
    for example i want to call a method ion that ejb
    say my ejb name is myejb
    so the normal way i should call is
    InitialContext initialContext = new InitialContext();     
    Object homeObject = initialContext.lookup("ejb/MyEjbHome");
    MyEJBHome myEJBHome =(MYEjbHome )javax.rmi.PortableRemoteObject.narrow(homeObjectMYEjbHome.class);
              myEJB = lSHome.create();
    myEJB.someMethod();
    but here i am having class for home and remote available
    now if other app server i am not having this classes then what to do

  • Calling EJB from from a client app

    Hi all,
    I am trying to call an EJB component from portal. The example EJB I have taken is from SDN Bonus Calculator example - Application Server/Web Dynpro/Samples and Tutorials/Using EJBs (20)
    I deployed the EAR file - no issue
    I wrote the following code in a client app and trying to connect to the EJB remotely.
              try {
                   java.util.Properties properties = new Properties();
                   properties.put(Context.INITIAL_CONTEXT_FACTORY, "com.sap.engine.services.jndi.InitialContextFactoryImpl");
                   properties.put(Context.PROVIDER_URL, "ux0800:55304");
                   InitialContext ctx = new InitialContext(properties);
                   //InitialContext ctx = new InitialContext();
                   // get ejb home
                   home =
                        (BonusCalculatorLocalHome) ctx.lookup(
                             "localejbs/MySessionBean");
                   theCalculator = home.create();
              } catch (Exception namingException) {
                   namingException.printStackTrace();
    I get the following error
    javax.naming.NoInitialContextException: Cannot instantiate class: com.sap.engine.services.jndi.InitialContextFactoryImpl [Root exception is java.lang.ClassNotFoundException: com.sap.engine.services.jndi.InitialContextFactoryImpl]
         at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
         at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
         at javax.naming.InitialContext.init(Unknown Source)
         at javax.naming.InitialContext.<init>(Unknown Source)
         at com.sap.bonus.calculation.sessionBean.MyCommandBean.<init>(MyCommandBean.java:27)
         at com.sap.bonus.calculation.sessionBean.MyCommandBean.main(MyCommandBean.java:68)
    Caused by: java.lang.ClassNotFoundException: com.sap.engine.services.jndi.InitialContextFactoryImpl
         at java.net.URLClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClassInternal(Unknown Source)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Unknown Source)
         at com.sun.naming.internal.VersionHelper12.loadClass(Unknown Source)
    Any clue will be appreciated.
    thnx

    Hi Sabbir,
    Following code works for me in calling EJB from normal java application. Did you added the jar files to your application?. see the required jar files in end of code.
    Create simple java applcation do the following steps:
    Give JNDI name to the EJB(HelloJNDI)->Add the HelloEJB to HelloEAR ->deploy
    Proxy Program to call ejb:
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import com.sample.Hello;
    import com.sample.HelloHome;
    public class HelloTest {
         public static void main(String[] args) {
                       Hello remote = null;
                      try {
                        Context ctx = new InitialContext();
                        HelloHome home = (HelloHome) ctx.lookup("HelloJNDI");
                        remote = home.create();
                        String result = remote.hello();
                        System.out.print("Result:" + result);
                         } catch (Exception e) {
                                System.out.println("Exception:" + e.getLocalizedMessage());
    1. Go To  Run > Java Application ->New->select your project and select your main class(java program from which your going to call EJB)
    2. Click  next tab ->(x)=Arguments
    paste the following code in VM Arguments
    -Djava.naming.factory.initial=com.sap.engine.services.jndi.InitialContextFactoryImpl -Djava.naming.provider.url=localhost:50104
    replace the server IP address with your server IP address where your ejbs are running.
    Under Class path settings for the program put the following jar files.
    You can search for them from net weaver soruce folders
    or copy from D:\usr\sap\J2E\JC01\j2ee\j2eeclient
    ejb20.jar
    logging.jar
    exception.jar
    sapj2eeclient.jar
    Add Corresponding ejb.jar
    and RUN >>>
    this makes testing of your client programs easier, you can find the error trace on which line and saves lot of time.
    Regards, Suresh

  • Calling EJB from app client

    Hello, everybody,
    I'm very new at EJB and I'm trying to learn it.
    I have created Enterprise Application using Netbeans IDE, I have EJB and APP client. What I want is to connect to my MySql database and get some info from table.
    For e.g. Login and Password.
    How can I call EJB from my client app which connects to my database and gets information I need?

    What server you are using?
    if you use jboss AS ,here is a simple Main class how to connect EJB and access ejb methods:
    package com.david.ejb.client;
    import java.util.Properties;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import javax.rmi.PortableRemoteObject;
    import com.david.ejb.domain.Person;
    import com.david.ejb.domain.PersonRemote;
    public class Main {
         public static void main(String[] args) {
              try {
                   Context ctx = getInitialContext();
                   Object obj = ctx.lookup("PersonSessionRemote/remote");
                PersonRemote pr=(PersonRemote)PortableRemoteObject.narrow(obj, PersonRemote.class);
                Person p=new Person();
                p.setName("david");
                pr.addPerson(p);
                pr.findPerson(1);
                   // System.out.print(br.find(pk).getAuthor_name());
              } catch (Exception ex) {
                   ex.printStackTrace();
         private static Context getInitialContext() throws NamingException {
              Properties p = new Properties();
              p.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.NamingContextFactory");
              p.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
              p.setProperty(Context.PROVIDER_URL, "jnp://localhost:1099");
              return new InitialContext(p);
    }Person is ant @Entity and PersonRemote is remote interfaces, to connect database you have to make datasource file at jboss-4.2.3.GA\server\default\deploy
    simle mysql-ds.xml looks like this:
    datasources>
       <local-tx-datasource>
          <jndi-name>some name</jndi-name>
          <connection-url>jdbc:mysql://localhost:3306/dbname</connection-url>
          <driver-class>com.mysql.jdbc.Driver</driver-class>
          <user-name>root</user-name>
          <password>root password</password>
          <min-pool-size>5</min-pool-size>
          <max-pool-size>100</max-pool-size>
          <idle-timeout-minutes>15</idle-timeout-minutes>
          <exception-sorter-class-name>com.mysql.jdbc.integration.jboss.ExtendedMysqlExceptionSorter</exception-sorter-class-name>
          <valid-connection-checker-class-name>com.mysql.jdbc.integration.jboss.MysqlValidConnectionChecker</valid-connection-checker-class-name>
       </local-tx-datasource>
    </datasources>also at resources/META-INF directory you must have persistence.xml like this
    <persistence>
         <persistence-unit name="SimpleEjb">
              <jta-data-source>java:/some name</jta-data-source>
              <properties>
                   <property name="hibernate.hbm2ddl.auto" value="update" />
                   <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
                   <property name="hibernate.show_sql" value="true"/>
                   <property name="hibernate.format_sql" value="true"/>
              </properties>
         </persistence-unit>
    </persistence>

Maybe you are looking for