Client calling EJB + No object bound eror

Hi,
I am a newbie to oc4j. I have tried to get a client to call a stateless ejb using a bat file outside the server, with no luck. I get NamingException: No object bound for java:comp/env/EmployeeBean when doing a jndi lookup. I have read the doc's, tried the answers in the forum and I even used the example code provided from oracle, but I still get the same error message every time.
Has anyone come across this issue when calling an ejb from a client??
Any help would be greatly appreciated. It’s driving me crazy.
Thanks
David

Hi,
I will check out the link, thank you. I am a newbie to java and oracle, so any help would be great. i wasnt sure which bits of code would be really helpfull, so i just put most of it in, sorry if it is too much info.
i am using oracle9ias release 1.0.2.2a (i dont know if this would make any difference). I deploy all my ears using the enterprise manager. The client-jar is within the ear. i use a bat to run the Client code.
I can get a servlet to call the same ejbs and that works fine.
#batfile
========
i set the classpath which including refernces to oc4j.jar and oc4jclient.jar and my ejb-jar
and then i use
set BigD=-Dorg.omg.CORBA.ORBInitialHost=localhost -Duser.timezone=ECT
java.exe %BigD% -classpath "%classpath%" com.test.client.Client
//Client Code
=============
public class Client {
     public static void main(String[] args) {
          System.out.println("Client started again...");
          try {
               Context context = new InitialContext();
               System.out.println("got context");
               Object homeObject = context.lookup("java:comp/env/ejb/ConsumerRequestSession");
               ConsumerRequestSessionHome home = (ConsumerRequestSessionHome) PortableRemoteObject.narrow(homeObject, ConsumerRequestSessionHome.class);
               System.out.println("got home");
               ConsumerRequestSession remote = (ConsumerRequestSession) PortableRemoteObject.narrow(home.create(), ConsumerRequestSession.class);
               System.out.println("got remote");
               String retValue = remote.getString();
               System.out.println("The retValue from client is : " + retValue);
          }catch(Exception e) {
               e.printStackTrace();
               System.out.println("ERROR in try block of client when creating jndi :" + e.getMessage());
#jndi
====
java.naming.factory.initial=com.evermind.server.ApplicationClientInitialContextFactory
java.naming.provider.url=ormi://localhost/test
java.naming.security.principal=admin     
java.naming.security.credentials=welcome
#application-client.xml
=======================
<application-client>
<display-name>ejb/ConsumerRequestSession</display-name>
     <ejb-ref>
          <ejb-ref-name>ejb/ConsumerRequestSession</ejb-ref-name>
          <ejb-ref-type>Session</ejb-ref-type>
          <home>com.test.ejb.ConsumerRequestSessionHome</home>
          <remote>com.test.ejb.ConsumerRequestSession</remote>
     </ejb-ref>
<!--          <display-name>EmployeeBean</display-name>
     <ejb-ref>
          <ejb-ref-name>EmployeeBean</ejb-ref-name>
          <ejb-ref-type>Session</ejb-ref-type>
          <home>employee.EmployeeHome</home>
          <remote>employee.Employee</remote>
     </ejb-ref>
     -->
</application-client>
#orion-application-client.xml
=============================
<orion-application-client>
     <ejb-ref-mapping location="com/test/ejb/ConsumerRequestSession" name="ejb/ConsumerRequestSession"/>
     <!--<ejb-ref-mapping name="EmployeeBean" location="employee/EmployeeBean" />
          <ejb-ref-mapping name="EmployeeBean" location="employee/EmployeeBean" />-->
</orion-application-client>
#ejb-jar.xml
<ejb-jar>
     <enterprise-beans>
          <session>
               <ejb-name>ejb/ConsumerRequestSession</ejb-name>
               <home>com.test.ejb.ConsumerRequestSessionHome</home>
               <remote>com.test.ejb.ConsumerRequestSession</remote>
               <ejb-class>com.test.ejb.ConsumerRequestSessionEJB</ejb-class>
               <session-type>Stateless</session-type>
               <transaction-type>Container</transaction-type>
          </session>
     </enterprise-beans>
     <assembly-descriptor>
          <container-transaction>
               <method>
                    <ejb-name>ejb/ConsumerRequestSession</ejb-name>
                    <method-name>*</method-name>
               </method>
               <trans-attribute>Required</trans-attribute>
          </container-transaction>
     </assembly-descriptor>
</ejb-jar>
#orion-ejb-jar.xml
==================
<orion-ejb-jar>
     <enterprise-beans>
          <session-deployment location="com/test/ejb/ConsumerRequestSession" name="ejb/ConsumerRequestSession"/>
     </enterprise-beans>
     <assembly-descriptor>
          <default-method-access>
               <security-role-mapping name="<default-ejb-caller-role>" impliesAll="true"/>
          </default-method-access>
     </assembly-descriptor>     
</orion-ejb-jar>
thank you for your help
david.

Similar Messages

  • J2ee sdk client calling ejb

    Folks,
    For looking up an ejb what shud the Context.PROVIDER_URL prperty be set to.
    and what shud be the port number in particular..
    the ejbservice port, the httpservice port (i guess not) or the naming and directory port..???
    TIA

    Hi,
    Before running the client application you need to set the "APPCPATH" environment variable to the path of the client jar file, and the "VMARGS" environment variable to the following value:
    -Dorg.omg.CORBA.ORBInitialHost=<server_name>
    Where <server_name> is the dns or ip of the server.
    Do this in the script that starts the application client, i.e. just before calling "runclient".
    I don't think you need to specify the port unless you are using a non-default value.
    Hope I've been of some assistance.
    Ben New
    [email protected]
    Leftclick Software Development
    http://www.leftclick.com.au/

  • C client calls EJB weblogic 6.1 - Do I need to purchase ORB

    My client is in C.
    The clint calls beans in weblogic 6.1 through IDL corba.
    Does weblogic 6.1 gives all the tools / software needed while developing ?
    while running ?
    Do I need to buy except of the weblogic also an ORB ?
    Thanks,
    Dalia

    Hi,
    You dont need to buy anothere orb untill it meets your requirements. Most of the app server supports rmi-iiop sementics. You should check this with Weblogic instead for more accurate info.
    Cheers
    Ashwani Kalra
    http://www.geocities.com/ashwani_kalra/
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  • How to call a CORBA Object in a 3rd Party ORB from a EJB

    Hello
    I found a few articles on the web how to call EJBs for example from C++.
    However, I want to do the inverse. I want to resolve an Object (implemented in C++, using OmniORB) via COS-Naming and invoke it from a EJB. I can write a simple Java Client which does this without a problem. But as soon as I try to do the same in EJB I get the following:
    [#|2004-11-09T10:48:16.848+0100|WARNING|sun-appserver-pe8.0.0_01|javax.enterprise.resource.corba._DEFAULT_.rpc.transport|_ThreadID=12;|"IOP00710209: (INTERNAL) Unable to create listener thread on the specific port"
    org.omg.CORBA.INTERNAL: vmcid: SUN minor code: 209 completed: No
    at com.sun.corba.ee.impl.logging.ORBUtilSystemException.createListenerFailed(ORBUtilSystemException.java:3142)
    at com.sun.corba.ee.impl.logging.ORBUtilSystemException.createListenerFailed(ORBUtilSystemException.java:3160)
    at com.sun.corba.ee.impl.legacy.connection.SocketFactoryAcceptorImpl.initialize(SocketFactoryAcceptorImpl.java:60)
    at com.sun.corba.ee.impl.transport.CorbaTransportManagerImpl.getAcceptors(CorbaTransportManagerImpl.java:190)
    at com.sun.corba.ee.impl.transport.CorbaTransportManagerImpl.addToIORTemplate(CorbaTransportManagerImpl.java:207)
    at com.sun.corba.ee.spi.oa.ObjectAdapterBase.initializeTemplate(ObjectAdapterBase.java:104)
    I think there is somehow a conflict because the SUN Appserver also uses CORBA. My Code looks like this:
    String[] a = null;
    Properties props = new Properties();
    final String CORBA_HOST = "arcos";
    final String ORB_INITIAL_PORT = "2809";
    props.put("org.omg.CORBA.ORBInitialPort", ORB_INITIAL_PORT);
    props.put("org.omg.CORBA.ORBInitialHost", CORBA_HOST);
    org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(a, props);
    So I thought this might be because there is already a ORB initialised. So I replaced the last line with
    org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init();
    Which should give me an ORB instance. However I get the following exception:
    [#|2004-11-09T11:51:59.206+0100|WARNING|sun-appserver-pe8.0.0_01|javax.enterprise.system.stream.err|_ThreadID=15;|
    org.omg.CORBA.NO_IMPLEMENT: vmcid: SUN minor code: 201 completed: No
    at com.sun.corba.ee.impl.logging.ORBUtilSystemException.genericNoImpl(ORBUtilSystemException.java:7085)
    at com.sun.corba.ee.impl.logging.ORBUtilSystemException.genericNoImpl(ORBUtilSystemException.java:7107)
    at com.sun.corba.ee.impl.orb.ORBSingleton.resolve_initial_references(ORBSingleton.java:311)
    at com.ascom.util.CorbaNaming.resolve(CorbaNaming.java:26)
    at com.ascom.fxm.FileManager.<init>(FileManager.java:46)
    at com.ascom.srv.file.web.FileImporterImpl.importFile(FileImporterImpl.java:146)
    Any ideas? Thank you very much in advance.
    Oliver Jaun

    Perhaps you could take a look at the following document and see if it meets your needs:
    http://java.sun.com/j2se/1.4.2/docs/guide/rmi-iiop/interop.html

  • 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>

  • EJB Java Client to Corba C++ object

    Does BEA have any examples of calling from an EJB java client to a CORBA C++ object
    (please no Tuxedo examples, thank you)?
    I've tried the c++ -> EJB examples, however now I need the other way around.
    thanks,
    Sean

    Andy Piper <[email protected]> wrote:
    "Sean Cloutier" <[email protected]> writes:
    Does BEA have any examples of calling from an EJB java client to aCORBA C++ object
    (please no Tuxedo examples, thank you)? Not that I am aware of. This is just a standard CORBA client scenario.
    andy
    -- Cool, thanks Andy!

  • Can I package and call a java object in the swf? (on the client)

    Hello,
    Can I package and call/execute a java object within the
    swf/adobe flash player?
    I want to embed a java object in my swf, and then whne the
    swf executes have it call the java object......
    E.

    ..... there are few instances where it would be nice to
    develope a single java object that can be used on the server and
    the client..... let's say for the case of server side validation,
    that could also be used by the client application for validation,
    instead of having to maintain 2 sets of validation logic in two
    different languages (java and AS).....

  • 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

  • When a servlet accepts a call from a client, it receives two objects.what??

    hi,
    When a servlet accepts a call from a client, it receives two objects. What are they???

    How will u pass the argument from one servlet to another servlet??Actually, it's dead simple: Just tell servlet #1 that servlet #2 said something nasty about servlet #1's mother and sister, so servlet #1 will head-butt servlet #2 and you have the argument passed along ...

  • WDP calling EJB and passing objects of classes from Java project

    Hi.
    We have <b>Java</b> project which contains some classes common for all projects (like xxx.Version).
    We have <b>EJB</b> project which defines EJB interface using these common classes (like getVersion(String,int): xxx.Version and getCurrency(String,xxx.Version,int):xxx.Currency ).
    We have <b>Web Dynpro</b> project which calls EJB:
    1. Lookup is successful
    2. call to getVersion is successful
    3. call to getCurrency fails with <b>NoSuchMethodException</b>:
    xxx.XXXObjectImpl0.getCurrency(java.lang.String, xxx.Version, int)
         at java.lang.Class.getMethod(Class.java:986)
         at com.sap.engine.services.rmi_p4.reflect.LocalInvocationHandler.invokeInternal(LocalInvocationHandler.java:51)
         at com.sap.engine.services.rmi_p4.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:53)
         at $Proxy346.getCurrency(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.sap.engine.services.ejb.session.stateless_sp5.ObjectStubProxyImpl.invoke(ObjectStubProxyImpl.java:187)
         at $Proxy347.getCurrency(Unknown Source)
         at xxx.XXX.getCurrencyWrapper(XXXXX.java:24)
    How can I set dependencies to get this running?
    Thanks to all
           Volker

    Hi,
    Is it available in the interface you are using..
    If the answer is yes.. you might have probably forgotten to deploy the EJBs ear file after making the changes..
    Rebuild it.. and deploy the EJB s ear file again..
    It will solve the problem.. If that also does not work,it might be a problem with the cache.. restart the server..
    It should work now !
    Regards
    Bharathwaj

  • Calling business delegate object from client

    Hi guys,
    I want to know how can I use Business Delegate Pattern in my client program(e.g JSP for that matter). I would really be thankful if u plz illustrate ur point thru code.
    One more doubt....
    Can a Normal Java Bean be a Business Delegate Object??
    What I am trying to say is,
    In a typical J2EE application architecture which uses MVC design pattern as follows:
    (JSP--->Java Bean--->Session Bean--->Entity Bean-->DB)
    Can I say the java bean used above is acting as a "Business Delegate Object", coz business delegate object lets u to decouple the presentation and business tier, which is what the above java bean is also doing??? Any comments on this????
    Thanx in Advance
    Jam

    Hi buddy,
    Tx for ur response.So as per to the architecture as i have mentioned in my first query(i.e JSP-->Java Bean--->Session Bean--->>Entity Bean-->DB)
    Sould i introduce a Business Delegate Object somewhere in between JavaBean and Session Bean. This business delegate object will be looking for the seesion facade used above, and java bean will be acting as a client for Business Delegate Object. Am i correct here???? Plz clarify.
    Thanx n Regards
    Jam

  • Calling EJB with HTML via SERVLET

    Hi,
    I used a writen example that calls EJB from HTML via SERVLET. Example name is Bonus. The problem I have is that the HTML throw error while calling SERVLET. I dont figure out what seams to be a problem. Someone know?
    I wonder if the problem is in servlet? The EJB is fine!
    christian
    HTML CODE:(bonus.html)
    <HTML>
    <HEAD>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1250"/>
    <TITLE>untitled1</TITLE>
    </HEAD>
    <BODY BGCOLOR = "WHITE">
    <BLOCKQUOTE>
    <H3>Bonus Calculation</H3>
    <FORM METHOD="GET" ACTION="BonusAlias">
    <P>Enter social security Number:<P>
    <INPUT TYPE="TEXT" NAME="SOCSEC"></INPUT>
    </P>
    Enter Multiplier:
    <P>
    <INPUT TYPE="TEXT" NAME="MULTIPLIER"></INPUT>
    </P>
    <INPUT TYPE="SUBMIT" VALUE="Submit">
    <INPUT TYPE="RESET">
    </FORM>
    </BLOCKQUOTE>
    </BODY>
    </HTML>
    SERVLET CODE:(BonusServlet.java)
    package mypackage5;
    import mypackage5.Calc;
    import mypackage5.CalcHome;
    import mypackage5.impl.CalcBean;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import javax.naming.*;
    import javax.rmi.PortableRemoteObject;
    import java.beans.*;
    public class BonusServlet extends HttpServlet {
    CalcHome homecalc;
    public void init(ServletConfig config) throws ServletException{
    //Look up home interface
    try{
    //InitialContext ctx = new InitialContext();
    //Object objref = ctx.lookup("Calc");
    //homecalc = (CalcHome)PortableRemoteObject.narrow(objref, CalcHome.class);
    Context context = new InitialContext();
    CalcHome calcHome = (CalcHome)PortableRemoteObject.narrow(context.lookup("Calc"), CalcHome.class);
    Calc calc;
    catch (Exception NamingException) {
    NamingException.printStackTrace();
    public void doGet (HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    String socsec = null;
    int multiplier = 0;
    double calc = 0.0;
    PrintWriter out;
    response.setContentType("text/html");
    String title = "EJB Example";
    out = response.getWriter();
    out.println("<HTML><HEAD><TITLE>");
    out.println(title);
    out.println("</TITLE></HEAD><BODY>");
    try{
    Calc theCalculation;
    //Get Multiplier and Social Security Information
    String strMult = request.getParameter("MULTIPLIER");
    Integer integerMult = new Integer(strMult);
    multiplier = integerMult.intValue();
    socsec = request.getParameter("SOCSEC");
    //Calculate bonus
    double bonus = 100.00;
    theCalculation = homecalc.create();
    calc = theCalculation.calcBonus(multiplier, bonus);
    catch (Exception CreateException){
    CreateException.printStackTrace();
    //Display Data
    out.println("<H1>Bonus Calculation</H1>");
    out.println("<P>Soc Sec: " + socsec + "<P>");
    out.println("<P>Multiplier: " +
    multiplier + "<P>");
    out.println("<P>Bonus Amount: " + calc + "<P>");
    out.println("</BODY></HTML>");
    out.close();
    public void destroy() {
    System.out.println("Destroy");

    The error is that page cannot be found! When I run only the servlet it works, when I run the HTML page and enter the field throws eror that the page cannot be found!
    thanks
    Christian

  • Call EJB from a XI Javamapping

    I have developed a simple EAR which contains a CMP with local and remote interfaces. This cmp may be successfully called using the remote-interface from a client (j2se) project. Now i like to call the same CMP from within a XI JavaMapping. In the execute method i am using the following code:
              InitialContext ctx;
              MeraConfigurationLocal configLocal = null;
              try {               
                   ctx = new InitialContext();
                   Object obj = ctx.lookup("localejbs/mgb.ch/XIMera_EAR/MeraConfigurationBean");
                   if (trace != null)
                        trace.addInfo("Got object from jndi: "+obj);
                   MeraConfigurationLocalHome configHome =     (MeraConfigurationLocalHome)obj;
                   if (configHome !=null) {
                        if (trace != null)
                             trace.addInfo("ConfigurationLocalHome: "+configHome);                                             
                   configLocal = configHome.create();
              } catch (Exception e) {
                   throw new StreamTransformationException(e.getMessage(), e);
              int port = Integer.parseInt(
                        configLocal.ReadParam(MeraResourcePoolDispatcherService.CFG_GENERAL_LISTENER_PORT));
              if (trace != null)
                   trace.addInfo("Got listenerport from localejbs/mgb.ch/XIMera_EAR/MeraConfigBean: "+port);
    after calling ctx.lookup ... i got the following traceentry in xi:
      <Trace level="1" type="T">*** START APPLICATION TRACE ***</Trace>
      <Trace level="2" type="T">Got object from jndi: [email protected]30</Trace>
      <Trace level="1" type="T">*** END APPLICATION TRACE ***</Trace>
    when i try to cast this obj into a MeraConfigurationLocal the system is throwing a ClassCastException

    Hello.
    Check my wiki article:
    http://wiki.sdn.sap.com/wiki/display/stage/SapNetweaverProcessIntegration.CallEjb3.0methodfromJavaclassmappingPI7.1
    (SapNetweaver Process Integration. Call Ejb 3.0 method from Java class mapping PI 7.1)

  • 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 EJB from an applet in 9iAS Release 2?

    Hello!
    In 9iAS Release 1 it is not so easy to call an EJB from an applet. First the applet needs special privileges and then the applet starts only once. The cause of problem is the implementation of ormi.
    Will 9iAS Rel. 2 support Applets calling EJBs?

    Jeff,
    I am also trying to make an applet client for an EJB deployed to OC4J.
    I modified the java2.policy file as you suggested, but when I tried to run my applet, I
    got the following error:
    java.lang.ExceptionInInitializerError: java.security.AccessControlException: access denied (java.util.PropertyPermission tunneling.shortcut read)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
         at java.lang.System.getProperty(Unknown Source)
         at java.lang.Boolean.getBoolean(Unknown Source)
         at com.evermind.server.rmi.RMIInitialContextFactory.<clinit>(RMIInitialContextFactory.java:34)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Unknown Source)
         at com.sun.naming.internal.VersionHelper12.loadClass(Unknown Source)
         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 its.fnd.ejb.EJBHomeFinder.getHomeObject(Unknown Source)
         at its.fnd.flight.ejb.EJBFlightFactory.<init>(Unknown Source)
         at its.fnd.flight.FlightFactory.<init>(FlightFactory.java:97)
         at EJBApplet.jbInit(EJBApplet.java:47)
         at EJBApplet.init(EJBApplet.java:36)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    I am using OC4J (stand-alone) version 9.0.2.0.0 on Solaris 7 and Microsoft Internet Explorer
    5.0 with the java 1.3.1 plug-in.
    Here is the applet code that I use to lookup the EJB home interface:
    Properties props = new Properties();
    props.put(Context.INITIAL_CONTEXT_FACTORY,"com.evermind.server.rmi.RMIInitialContextFactory");
    props.put(Context.PROVIDER_URL,"ormi://host:6666/app");
    props.put(Context.SECURITY_PRINCIPAL,"admin");
    props.put(Context.SECURITY_CREDENTIALS,"password");
    Context ctxt = new InitialContext(props);
    Object homeObj = ctxt.lookup("my_bean");
    MyBeanHome home = PortableRemoteObject.narrow(homeObj, MyBeanHome.class);
    The HTML page with the <applet> tag is a static HTML page that is part of OC4J's default
    web application. The applet class file is located in a subdirectory of the default-web-app
    directory. Here is the HTML page...
    <HTML>
    <HEAD>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
    <TITLE>
    HTML Test Page
    </TITLE>
    </HEAD>
    <BODY>
    <object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" width="580" height="450" name="EJBApplet" align="middle" alt="Loading EJBApplet ...">
    <param name="java_code" value="EJBApplet">
    <param name="java_codebase" value="/tests">
    <param name="java_archive" value="xerces.jar,ejb.jar,oc4j.jar,jaas.jar"/>
    <param name="java_type" value="application/x-java-applet;version=1.3">
    <param name="java_scriptable" value="true">
    <table cellpadding="1" bgcolor="#FFFFFF" width="580" height="450">
    <tr><td>
    This is a place for an APPLET.<br>Your browser doesn't support the correct applet java plug-in.<br><br>You can install the correct plug-in from here.<br><a target='_blank' onClick='javascript:self.window.close()' href="/classes/3rdparty/j2re-win-plug-in.exe">Click here to install plug-in.</a><br><br>Or if you have an Internet connection you can install the correct plug-in from here.<br><a target='_blank' onClick='javascript:self.window.close()' href="http://java.sun.com/products/plugin/1.3/plugin-install.html">Click here to install plug-in from Internet.</a><br><br>You can call your System Administrator for assistance.</td></tr>
    </table>
    </object>
    </BODY>
    </HTML>
    I have searched the Internet, and the documentation, and tried several, different things,
    but I can't get it to work.
    Any and all help will be greatly appreciated.
    Thanks,
    Sofia.

Maybe you are looking for