I can't lookup EJB (3.0) in WebLogic 12 using ENC

I have a simple application divided in 2 modules:
HolaMundo - Servlet component
SimpleEJB - EJB Component
The EJB Component use EJB 3.0. I created a local business interface with one method. A stateless EJB that implement that interface. And I use the ejb-jar.xml for declare it.
And a Servlet that use the EJB.
In Glassfish or Tomee this way for working with EJB works, but i don't understand why it doesn't work in WebLogic 12...
When i try to access to the servlet, i get an error. this is the error:
javax.naming.NameNotFoundException: While trying to look up /app/SimpleEJB/Example!com.edwin.ejb.ExampleLocal in /app/webapp/HolaMundo.war/1051995086.; remaining name '/app/SimpleEJB/Example!com/edwin/ejb/ExampleLocal'
  at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1180)
  at weblogic.jndi.internal.ApplicationNamingNode.lookup(ApplicationNamingNode.java:146)
Servlet:
package servlet;
import java.io.IOException;
import java.io.PrintWriter;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.edwin.ejb.ExampleLocal;
public class EJB extends HttpServlet {
   private static final long serialVersionUID = 1L;
   @Override
   protected void doGet(HttpServletRequest arg0, HttpServletResponse arg1)
   throws ServletException, IOException {
   PrintWriter out = arg1.getWriter();
   ExampleLocal el2;
   try {
  el2 = (ExampleLocal) new InitialContext()
   .lookup("java:app/SimpleEJB/Example!com.edwin.ejb.ExampleLocal");
   out.println("EJBBBB: " + el2.nombre());
   } catch (NamingException e) {
  e.printStackTrace();
Local business interface:
package com.edwin.ejb;
public interface ExampleLocal {
    public String nombre();
EJB Stateless:
package com.edwin.ejb;
public class Example implements ExampleLocal{
    @Override
    public String nombre() {
        return "Edwin";
ejb-jar.xml:
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">
  <display-name>SimpleEJB </display-name>
  <enterprise-beans>
    <session>
        <ejb-name>Example</ejb-name>
        <business-local>com.edwin.ejb.ExampleLocal</business-local>
        <ejb-class>com.edwin.ejb.Example</ejb-class>
        <session-type>Stateless</session-type>
    </session>
  </enterprise-beans>
</ejb-jar>

Both answers did not work. I do not understand why it did not work because in other Java EE Servers it works.
My JNDI Tree (Screenshot):
http://oi58.tinypic.com/vs1jjd.jpg
However, i could get the EJB when i use the Global ENC, but i got a Casting Exception...
Eg:
try {
  ej = (EjLocal) new InitialContext().lookup("java:global.EjemploEJB.Ej!stateless.EjLocal");
  out.print("EJ: "+ej.ej());
} catch (NamingException e) {
  e.printStackTrace();
Output:
java.lang.ClassCastException: stateless.Ej_1aafe_EjLocalImpl cannot be cast to stateless.EjLocal
at servlet.Ejemplo.doGet(Ejemplo.java:33)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731).....
There is a strange value in the EJB's JNDI Tree:
Header 1
Header 2
Binding Name:
java:global.EjemploEJB.Ej!stateless.EjLocal
Class:
stateless.Ej_1aafe_EjLocalImpl
Hash Code:
2021087981
toString Results:
stateless.Ej_1aafe_EjLocalImpl@78775aed

Similar Messages

  • Can not lookup EJB

    11g
    When i run a unit test, and lookup the remote interface. ClassNotFoundException. From JNDI tree, i can find the remote interface. Please find the details trace, thanks for your help.
    at weblogic.ejb.container.internal.RemoteBusinessIntfGenerator.generateRemoteInterface(RemoteBusinessIntfGenerator.java:84)
         at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.readObject(RemoteBusinessIntfProxy.java:211)
         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:597)
         at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)
         at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849)
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
         at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
         at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
         at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:197)
         at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:564)
         at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:193)
         at weblogic.rmi.internal.ObjectIO.readObject(ObjectIO.java:62)
         at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:240)
         at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:348)
         at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:259)
         at weblogic.jndi.internal.ServerNamingNode_1031_WLStub.lookup(Unknown Source)
         at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:400)
         at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:388)
         at javax.naming.InitialContext.lookup(InitialContext.java:392)

    Hi Saleem Mohammad.
               Thank a lot for your post. I got this idea from your link. The below code work fine.
              try {               
                   InitialContext ctx=new InitialContext();
                   Object obj= ctx.lookup("localejbs/sap.com/HelloMan_EAR/HelloManBean");
                    ClassLoader homeCl = obj.getClass().getClassLoader();
                    Class<?> localHome = homeCl.loadClass(HelloManBeanLocalHome.class.getCanonicalName());
                    java.lang.reflect.Method method = localHome.getMethod("create");               
                    Object homeObj = (Object)method.invoke(obj);
                    ClassLoader localCl=homeObj.getClass().getClassLoader();
                    Class<?> local = localCl.loadClass(HelloManBeanLocal.class.getCanonicalName());
                    Class  args[] = {String.class};
                    java.lang.reflect.Method localMethod=local.getMethod("helloMan",args);               
                    Object params[]={"Thongie"};
                    Object localObj = (Object)localMethod.invoke(homeObj,params);
                    lookupText=(String)localObj;               
              } catch (Exception e) {
                   // TODO: handle exception
                   e.printStackTrace(out);

  • Can not lookup EJB from another EAR file, the ClassCastException returned

    Hi,
         I try to call EJB module in A.ear from Servlet in another EAR file(B.ear) the ClassCastException returned on the context.lookup() code . So when i create a Dynamic Web Project(With the same code as Servlet in B.ear) and pack it in A.ear(The same EAR file with EJB module), it work fine. I have no idea. Could you please suggest me.
    The ClassCastException : incompatible with interface ..... return on
    HelloManBeanLocalHome home=(HelloManBeanLocalHome) ctx.lookup("localejbs/sap.com/HelloMan_EAR/HelloManBean");
    The entire code is below :
              try {               
                   InitialContext ctx=new InitialContext();
                   HelloManBeanLocalHome home=(HelloManBeanLocalHome) ctx.lookup("localejbs/sap.com/HelloMan_EAR/HelloManBean");
                   HelloManBeanLocal remote=home.create();
                   lookupText=remote.helloMan("Test");
              } catch (Exception e) {
                   // TODO: handle exception
                   e.printStackTrace(out);
    Many Thanks

    Hi Saleem Mohammad.
               Thank a lot for your post. I got this idea from your link. The below code work fine.
              try {               
                   InitialContext ctx=new InitialContext();
                   Object obj= ctx.lookup("localejbs/sap.com/HelloMan_EAR/HelloManBean");
                    ClassLoader homeCl = obj.getClass().getClassLoader();
                    Class<?> localHome = homeCl.loadClass(HelloManBeanLocalHome.class.getCanonicalName());
                    java.lang.reflect.Method method = localHome.getMethod("create");               
                    Object homeObj = (Object)method.invoke(obj);
                    ClassLoader localCl=homeObj.getClass().getClassLoader();
                    Class<?> local = localCl.loadClass(HelloManBeanLocal.class.getCanonicalName());
                    Class  args[] = {String.class};
                    java.lang.reflect.Method localMethod=local.getMethod("helloMan",args);               
                    Object params[]={"Thongie"};
                    Object localObj = (Object)localMethod.invoke(homeObj,params);
                    lookupText=(String)localObj;               
              } catch (Exception e) {
                   // TODO: handle exception
                   e.printStackTrace(out);

  • How can I lookup the Tiff Image Compression being used on my file?

    I'm trying to figure out where this is stored in the file structure, I've tried a few different options, but I'm stuck. I dumped all the attributes of the file to console, but it's not there.
    Latest I tried this:
    app.activeDocument.TiffSaveOptions)
    I could simply open up each file and do a Save As Which would show me all the settings, but it's more time consuming than writing this to text.
    Also, does anyone have a recommendation for an Object Model Viewer? Is there one? I'd like to learn more about the files and structures themselves, without having to do hours of experimentation, since it can be difficult to figure out where things are nested.

    var compression = -1; // unknown
    var rex = /\<tiff:Compression\>(.+)\<\/tiff:Compression\>/;
    if (app.documents.length > 0) {
      var xmp = String(app.activeDocument.xmpMetadata.rawData);
      var m = xmp.match(rex);
      if (m) {
        compression = Number(m[1]);
    alert(compression);
    Also, does anyone have a recommendation for an Object Model Viewer?
    There is an OMV for JavaScript that comes built in to ESTK.
    There is one PDF for the PS DOM and another for called the JavaScript Tools Guide.
    I'd like to learn more about the files and structures themselves, without having to do hours of experimentation, since it can be difficult to figure out where things are nested.
    There is a Photoshop Files Format PDF, also available on Adobe.com. I've used variants of it since the version that came out for PS6 many years ago.
    But that stuff is not for the faint of heart.

  • How can i lookup a data source v5 in WSAD 5.1?

    Hi all,
    I'm using WSAD 5.1 to developer a web application based on J2EE 1.3 that have a simple java classes. My application uses a data source version 5 to have access the database. I?m using service locator pattern to lookup a JNDI but it dont work properly on stand alone java classes, only on EJB components.
    How can i lookup a data source version 5 from my java class on WSAD 5.1?
    Can anyone help?
    Thanks,

    Oh I did not realize that you were talking about a stand-alone application. You cannot use the server datasources in your stand-alone application.
    You can use the Oracle helper classes to construct a DataSource on the client side.
    http://java.sun.com/j2se/1.4.2/docs/api/javax/sql/DataSource.html and driver specific documentation to achieve this. I will try to send a few links, if I find any.
    In a stand-alone application, you can use some connection pooling mechanism on your own.
    The ideal thing to do is to keep your data access in your middle tier (EJBs) and call the EJB's. This way you can reuse things in multiple client tiers and use the container provided datasource and connection pooling mechanisms.
    Hope this helps.
    Vijay

  • Can't access ejb with more than 1 person at the same time?

    I am using the ejb to access the database using DBConnection Pool that I find in book. The code is as follow:
    The problem is when more than one user access almost at the same time, the one who enter frst can access, but the other one can't and return context lookup error in creating EJB.
    What's the problem of it, is it the ejb concurrent access problem or database concurrent access problem?
    package login.database;
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    import java.util.Date;
    public class DBConnectionManager {
    static private DBConnectionManager instance;
    static private int clients;
    private Vector drivers = new Vector();
    private PrintWriter log;
    private Hashtable pools = new Hashtable();
    static synchronized public DBConnectionManager getInstance() {
    if (instance == null) {
    instance = new DBConnectionManager();
    clients++;
    return instance;
    private DBConnectionManager() {
    init();
    public void freeConnection(String name, Connection con) {
    DBConnectionPool pool = (DBConnectionPool) pools.get(name);
    if (pool != null){
    pool.freeConnection(con);
    public Connection getConnection(String name) {
    DBConnectionPool pool = (DBConnectionPool) pools.get(name);
    if (pool != null) {
    return pool.getConnection();
    return null;
    public Connection getConnection(String name, long time) {
    DBConnectionPool pool = (DBConnectionPool) pools.get(name);
    if (pool != null) {
    return pool.getConnection(time);
    return null;
    public synchronized void release() {
    if (--clients != 0) {
    return;
    Enumeration allPools = pools.elements();
    while (allPools.hasMoreElements()) {
    DBConnectionPool pool = (DBConnectionPool) allPools.nextElement();
    pool.release();
    Enumeration allDrivers = drivers.elements();
    while (allDrivers.hasMoreElements()) {
    Driver driver = (Driver) allDrivers.nextElement();
    try {
    DriverManager.deregisterDriver(driver);
    log("Deregistered JDBC driver " + driver.getClass().getName());
    } catch (SQLException e) {
    log(e, "Can't deregister JDBC driver: " + driver.getClass().getName());
    private void createPools(Properties props) {
    Enumeration propNames = props.propertyNames();
    while (propNames.hasMoreElements()) {
    String name = (String) propNames.nextElement();
    if (name.endsWith(".url")) {
    String poolName = name.substring(0, name.lastIndexOf("."));
    String url = props.getProperty(poolName + ".url");
    if (url == null) {
    log("No URL specified for " + poolName);
    continue;
    String user = props.getProperty(poolName + ".user");
    String password = props.getProperty(poolName + ".password");
    String maxconn = props.getProperty(poolName + ".maxconn", "0");
    int max;
    try {
    max = Integer.valueOf(maxconn).intValue();
    } catch (NumberFormatException e) {
    log("Invalid maxconn value " + maxconn + "for " + poolName);
    max = 0;
    DBConnectionPool pool = new DBConnectionPool(poolName, url, user, password, max);
    pools.put(poolName, pool);
    log("Initialized pool " + poolName);
    private void init(){
    InputStream is = getClass().getResourceAsStream("db.properties");
    Properties dbProps = new Properties();
    try {
    dbProps.load(is);
    } catch (Exception e) {
    System.err.println("Can't read the properties file. " +
    "Make sure db.properties is in the CLASSPATH");
    return;
    String logFile = dbProps.getProperty("logfile","DBConnectionManager.log");
    try {
    log = new PrintWriter(new FileWriter(logFile, true), true);
    } catch (IOException e) {
    System.err.println("Can't open the log file: " + logFile);
    log = new PrintWriter(System.err);
    loadDrivers(dbProps);
    createPools(dbProps);
    private void loadDrivers(Properties props) {
    String driverClasses = props.getProperty("drivers");
    StringTokenizer st = new StringTokenizer(driverClasses);
    while (st.hasMoreElements()) {
    String driverClassName = st.nextToken().trim();
    try {
    Driver driver = (Driver) Class.forName(driverClassName).newInstance();
    DriverManager.registerDriver(driver);
    drivers.addElement(driver);
    log("Registered JDBC driver " + driverClassName);
    } catch (Exception e) {
    log("Can't register JDBC driver: " + driverClassName + ", Exception: " + e);
    private void log(String msg) {
    log.println(new Date() + ": " + msg);
    private void log(Throwable e, String msg) {
    log.println(new Date() + ": " + msg);
    e.printStackTrace(log);
    class DBConnectionPool {
    private int checkedOut;
    private Vector freeConnections = new Vector();
    private int maxConn;
    private String name;
    private String password;
    private String URL;
    private String user;
    public DBConnectionPool(String name, String URL, String user, String password, int maxConn) {
    this.name = name;
    this.URL = URL;
    this.user = user;
    this.password = password;
    this.maxConn = maxConn;
    public synchronized void freeConnection(Connection con) {
    freeConnections.addElement(con);
    checkedOut--;
    notifyAll();
    public synchronized Connection getConnection() {
    Connection con = null;
    if (freeConnections.size() > 0) {
    con = (Connection) freeConnections.firstElement();
    freeConnections.removeElementAt(0);
    try {
    if (con.isClosed()) {
    log("Removed bad connection from " + name);
    con = getConnection();
    } catch (SQLException e) {
    log("Removed bad connection from " + name);
    con = getConnection();
    else if (maxConn == 0 || checkedOut < maxConn) {
    con = newConnection();
    if (con != null) {
    checkedOut++;
    return con;
    public synchronized Connection getConnection(long timeout) {
    long startTime = new Date().getTime();
    Connection con;
    while ((con = getConnection()) == null) {
    try {
    wait(timeout);
    } catch (InterruptedException e) {}
    if ((new Date().getTime() - startTime) >= timeout) {
    return null;
    return con;
    public synchronized void release() {
    Enumeration allConnections = freeConnections.elements();
    while (allConnections.hasMoreElements()) {
    Connection con = (Connection) allConnections.nextElement();
    try {
    con.close();
    log("Closed connection for pool " + name);
    } catch (SQLException e) {
    log(e, "Can't close connection for pool " + name);
    freeConnections.removeAllElements();
    private Connection newConnection() {
    Connection con = null;
    try {
    if (user == null) {
    con = DriverManager.getConnection(URL);
    else {
    con = DriverManager.getConnection(URL, user, password);
    log("Created a new connection in pool " + name);
    } catch (SQLException e) {
    log(e, "Can't create a new connection for " + URL);
    return null;
    return con;

    Hi,
    static synchronized public DBConnectionManager getInstance() {
    The word "synchronized" will allow only one user at a time to access the getInstance() method which returns DBConnectionManager. Suggest u read some stuff on the same
    As I am not sure which App server ur using, u cld do the following
    1. Create a Conection Pool in ur App Server itself (Weblogic/Websphere/Jboss way)
    2. Create a DataSource which maps to this Connection Pool.
    3. Use the DataSource object which handles poolong of Connections to access the database
    4. As mentioned above, Read notes/documents on "Synchronized" and "Vector" before you use this word in any code of EJB. This will solve ur problem. Read topic called "Collection Framework".
    Seetesh

  • Can't access EJB deployed on remote OC4J - what am I doing wrong?

    I'm unable to access an EJB deployed on a remote OC4J instance (ie, part of a 9iAS installation on another machine vs local in JDeveloper).
    I've reverted to a stupid-simple EJB in hopes of getting it going prior to trying my actual code. The EJB works fine in JDev (9.0.3) - I 'run' the EJB to start the local OC4J instance, run my client code (generated via the "New Sample Java Client..." option in the Navigator context popup) and all is well.
    I then create an EAR file via the the "Create EJB Jar Deployment Profile..." context popup of the ejb-jar.xml node, followed by "Deploy to EAR file" from the context popup of the resulting ejb1.deploy node. I next "Deploy EAR File" via the "Oracle Enterprise Manager" that comes with 9iAS (the :1810 port). After successfully deploying, I modify my client code in JDeveloper, specifying the new connection information for the remote machine via the Hashtable constructor of InitialContext and attempt to run it. I've tried a number of Context.PROVIDER_URL forms, including: ormi://registered_pingable_host_name:23791/deployed_application_name
    ormi://registered_pingable_host_name:23791/session_deployment_name (from the <enterprise-beans><session-deployment name="xxx"/></enterprise-beans> section of my orion-ejb-jar.xml file, as per a tip in this forum)
    I've tried prefixing ormi:// with http:, but get no response whatesoever in this case.
    I've also tried it without the port number (this port number matches that in my remote OC4J's <oc4j_instance_home>/config/rmi.xml file).
    On the Context.SECURITY_PRINCIPAL and Context.SECURITY_CREDENTIALS settings, I've tried various values, generally using the 'admin' user, with passwords taken from:
    <oc4j_instance_home>/principals.xml
    <oc4j_instance_home>/application-deployments/application_name/principals.xml
    I've also tried matching the password in the jazn-data.xml, to no avail - this password appears encrypted anyway, but thought I'd give it a try on the off-chance that it was just a randomly-generated password - no go.
    I've also tried SCOTT/TIGER, anonymous, etc. Incidentally, the 'deactivated' attribute of the <user> tag is set to "false" in my principals.xml files.
    No matter what I do, I always get back "javax.naming.NamingException: Lookup error: java.net.ConnectException: Connection refused: connect"
    Additionally, I get this same message when I try to establish an Application Server Connection via JDev.
    Clearly, I'm missing something critical (and probably simple), but I can't for the life of me figure it out.
    Any help would be much appreciated!
    Thanks,
    Jim Stoll

    Ok, well this is a bit strange...
    3103 - 3103 also fails, and some experimentation has led me to find that any time that I specify a range smaller than 6 (3101 - 3106 works, 3101 - 3105, 3101-3101, 3103-3103, etc does not), the OC4J instance will not restart. I get "An error occurred while starting. The opmn request has failed. From opmn: HTTP/1.1 204 No Content Content-Length: 0 Content-Type: text/html Response: 0 of 1 processes started. Check opmn log files such as ipm.log and ons.log for detailed." in the OEM window (I specify the RMI port range, hit Apply, go to the OC4J instance home page, see that the Status is 'Down', hit Start, and get that message.) <ORACLE_HOME>/product/iasinfra/opmn/logs/ipm.log tells me:
    02/12/03 09:41:12 There is no rmi port left for starting an OC4J process. Please check oc4j's port property in OPMN's configuration file.
    02/12/03 09:41:12 start_proc: UID 3719788: failed to build args
    02/12/03 09:41:12 start_proc_req: failed to start a process in GID OC4JJim2, type: 2
    If I bump it up to 3101 - 3106 or higher, it starts right up. Running opmnadmin debug, as suggested by Venky (thanks Venky!), yields:
    PROCESS TABLE
    UID PID FLAGS TYPE STATUS REF HTTP AJP RMI JMS
    3654011 84 00000040 OC4J Alive 1 0 3005 3106 3206
    424987 604 00000000 Apache Alive 1 7777 0 0 0
    2932088 14849 00000000 OC4J Alive 1 0 3003 3103 3203
    3063160 14878 00000000 OC4J Alive 1 0 3001 3101 3201
    3194232 14906 00000000 OC4J Alive 1 0 3000 3105 3205
    3325304 14936 00000000 OC4J Alive 1 0 3002 3102 3202
    3456376 14964 00000000 OC4J Alive 1 0 3004 3104 3204
    Which is what I would expect, given the specified range of 3101-3106. Trying each of these ports in turn, I've found that I can hit the EJB successfully on 3106, but 3101 - 3105 all fail with:
    javax.naming.NamingException: Lookup error: javax.naming.AuthenticationException: No such domain/application: Project7_2; nested exception is:
         javax.naming.AuthenticationException: No such domain/application: Project7_2
         java.lang.Object com.evermind.server.rmi.RMIContext.lookup(java.lang.String)
              RMIContext.java:134
         java.lang.Object javax.naming.InitialContext.lookup(java.lang.String)
              InitialContext.java:350
         void Samplemypackage9.MySessionEJBClient1.main(java.lang.String[])
              MySessionEJBClient1.java:15
    I'm a little concerned about assuming the high-end of the range to be the active port on a regular basis (though thus far, among about 20 - 30 tries spaced over 20 - 30 minutes, it has been...) - I guess I can have my code loop through the range until it finds a good port or exhausts the list, but that seems a bit excessive.
    Can you think of a reason that my OC4J instance won't start with a range size of less than 6? I'm on 9iAS 9.0.2, if that makes any difference.
    Thanks,
    Jim

  • How can i lookup a session bean from the client side

    how can i lookup a session bean from the client side...........i am using sun appserver..............
    this is my code.................[B]
    private final static String JNDI_NAME="ejb/LmsBean";
    private static String url="ldap://localhost:4848";
    Hashtable h=new Hashtable();
    h.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
    h.put(Context.PROVIDER_URL,url);
    System.out.println("Before Loading Context in Delegate");
    Context ctx=new InitialContext(h);
    System.out.println("Loaded Context in Delegate");
    Object obj=ctx.lookup(JNDI_NAME);
    System.out.println("Loaded Object in Delegate");
    System.out.println("Before Loading Home in Delegate");
    LmsHome home = (LmsHome )PortableRemoteObject.narrow(obj,com.parx.lms.controller.LmsHome.class);
    System.out.println("Loaded Home in Delegate");
    lms = home.create();
    System.out.println("Loaded remote in Delegate");
    [B]and i got the exception........
    Inside Client before calling delegate
    Before Loading Context in Delegate
    javax.naming.CommunicationException: Request: 1 cancelled
    javax.naming.CommunicationException: Request: 1 cancelled
    at com.sun.jndi.ldap.LdapRequest.getReplyBer(LdapRequest.java:60)
    at com.sun.jndi.ldap.Connection.readReply(Connection.java:405)
    at com.sun.jndi.ldap.LdapClient.ldapBind(LdapClient.java:340)
    at com.sun.jndi.ldap.LdapClient.authenticate(LdapClient.java:171)
    at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2640)
    at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:290)
    at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:175)
    at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:193
    at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.ja
    va:136)
    at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.jav
    a:66)
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
    62)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243
    at javax.naming.InitialContext.init(InitialContext.java:219)
    at javax.naming.InitialContext.<init>(InitialContext.java:195)
    at com.parx.lms.lmsdelegate.LmsDelegate.getController(LmsDelegate.java:3
    0)
    at com.parx.lms.lmsdelegate.LmsDelegate.addUserDelegate(LmsDelegate.java
    :50)
    at com.parx.lms.client.consoleClient.Client.main(Unknown Source)
    pls go tru the exception and pls help.........

    That url string should be having the server name or ip instead of localhost.

  • HELP!!! How I can call to EJB from another EJB??

    I have two EJBs, for each EJB I have a jar, how I can call to EJB jar to another???
    I have tried the following, in the first EJB I have import the second EJB jar and call it with context, lookup, PortableRemoteObject etc.. but the instruction lookup not find the second EJB reference.
    The name in the lookup instruction is the JNDI name of the second EJB but not find a reference to it.
    Please help me!!! Thanks!!
    The error is:
    javax.naming.NameNotFoundException: Missing node. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound
         at org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundHelper.java:34)
         at org.omg.CosNaming.NamingContextPackage.NotFoundHelper.extract(NotFoundHelper.java:50)
         at org.omg.CosNaming._NamingContextStub.resolve(_NamingContextStub.java:161)
         at com.inprise.j2ee.jndi.java.CorbaContext.resolveName(CorbaContext.java:242)
         at com.inprise.j2ee.jndi.java.CorbaContext.lookup(CorbaContext.java:261)
         at com.inprise.j2ee.jndi.java.javaContext.internal_lookup(javaContext.java:483)
         at com.inprise.j2ee.jndi.java.javaContext.internal_lookup(javaContext.java:493)
         at com.inprise.j2ee.jndi.java.javaContext.internal_lookup(javaContext.java:493)
         at com.inprise.j2ee.jndi.java.javaContext.lookup(javaContext.java:937)
         at com.inprise.j2ee.jndi.java.javaContext.lookup(javaContext.java:942)
         at javax.naming.InitialContext.lookup(InitialContext.java:350)
         at ejbclient.EnterpriseClientBean.addition(EnterpriseClientBean.java:115)
         at ejbclient.EnterpriseClientBean.actionPerformed(EnterpriseClientBean.java:97)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1450)
         at avax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstr

    ok.. Here it goes.. I am writing a sample code..
    public class EJB1LogBean implements SessionBean {
    // test is a method of stateless session beam
    public void test ( TestVal val )
    throws RemoteException{
    try {
    EJB2LogHome ejb2Home= (EJB2LogHome)getHome("java:comp/env/ejb/EJB2LogHome",1);
    EJB2Log ejb2Log = ejb2LogHome.create ( val );
    } catch ( CreateException e ) {
         System.out.println("Create Exception occurred ");
         e.printStackTrace();
         } catch ( RemoteException e ) {
         System.out.println( "RemoteException Occured");
    e.printStackTrace();
         throw new RemoteException () ;
         } catch(Exception ee) {
    ee.printStackTrace();
    private EJBHome getHome(String jndiName,int type) {
    try {
    Context context = new InitialContext();
    Object ref = context.lookup( jndiName );
    switch(type)
    case 1:
    EJB2LogHome ejb2LogHome = ( EJB2LogHome )
    PortableRemoteObject.narrow( ref, EJB2LogHome.class );
    return ejb2LogHome;
    } catch ( Exception e ) {
    e.printStackTrace();
    return null;
    }//EJB1LogBean ends
    Here as you can see, EJB1LogBean(session bean) is calling a second EJB, EJB2LogBean (entity bean). TestVal is a sample value object passed. It is plain java class and can vary from app to app and it has got nothing to do with ejbs.
    "java:comp/env/ejb" is a J2EE standard and while getting a home interface, you have to append the home interface class name to "java:comp/env/ejb". Here I am passing "java:comp/env/ejb/EJB2LogHome" and "1" to getHome method, whose job is to get a reference to a home interface. getHome method is a local method. "1" is passed just to give a flexibility to getHome method as you can have more ejbs to invoked. In that case, you can go on adding different case statements for 2, 3 etc.
    The only thing you have to keep in mind is that your deployment descriptor for EJB1LogBean will contain the entires for both the beans i.e. for EJB1LogBean and EJB2LogBean. This is because EJB2LogBean is wrapped by EJB1LogBean.
    Hope this helps.
    Please let me know if you need anything more.
    - Amit

  • Can't lookup session bean in MBean and ApplicationLifeCyleListener

    Hi,
    i am migrating an application with mbean from OC4J to weblogic 10.3.2.
    as my application don't have a web module. i try to use the ApplicationLifeCycleListener
    to register the mbean (instruction from this oracle document page:
    http://download.oracle.com/docs/cd/E12839_01/web.1111/e13729
    /instmbeans.htm#i1099957).
    i register the mbean in the ApplicationLifeCycleListener.postStart method, but in the
    mbean's method (which is called by a javax.management.timer.Timer, created in the
    MBeanRegistration.postRegister method), i can't lookup the session bean.
    (i try to lookup the session bean in the ApplicationLifeCycleListener.postStart method, it fails too)
    if i register the mbean in a ServletContextListener, there is NO problem that i can
    lookup session bean in the mbean's method.
    why there is inconsistence in registrating mbean by servlet context listerer and by
    applicationlifecyclelistener???
    can anybody tell me the solution???
    is it impossible to call session bean in the MBean's method if the mbean is registered
    in the ApplicationLifeCycleListener ???
    *** i want to call a session bean's method periodically through the timer ***
    thank you very much.

    gimbal2 wrote:
    r035198x wrote:
    I put the interfaces in a separate XX-si-jar file always.
    The implementation jar then depends on that service interface jar which gets deployed on both the client and the server.
    This way I can distribute my si without including implementation which I can change without needing to affect the clients.Yeah, that seems like the only real solution to me. Using Maven it shouldn't be that hard to manage either now that I think about it. Did you ever get into trouble with a client being based on an outdated interface jar? I can imagine that it can be a bit of a release management drama to keep these things synced.Interface changes when they did happen resulted in full redeployments because the client usually has to change anyway to use the changed functionality. Most interactions are through static interfaces so this doesn't arise too much.
    In volatile interactions, a common approach is to define a generic interface EJB whose implementation can delegate the calls to other (potentially future) services. The problem with this is that return types have to be simple.
    >
    It's one of the reasons why I'm not a fan of optional interfaces in 3.1.Well the optional part is optional ;) To me it is a very useful addition since I usually only deal with local interfaces when I use EJB technology. I always found it a bit of a bother to HAVE to create an interface also, I welcome the change.It is handy to be able to roll out an app with a few classes all bundled in one deployment file if there is no requirement for multiple implementations of an interface or for remote invocation support.
    I just feel that it's a lot of flexibility to sacrifice when doing the interfaces is not really a lot of effort with today's development tools.

  • Could not lookup PortalManagerHome in the JNDI tree using EJB reference java:comp/env/ejb/PortalManager

    Hi
    I am just a starter on WLPortal.
    I have created a barebone Application from scratch. I have synchronized it properly
    from EBCC to WLP. But When I am trying to access the home page of my application,
    I am getting from stack trace -
    <Nov 6, 2002 5:37:59 PM IST> <Error> <PortalAppflow> <Could not lookup PortalManagerHome
    in the JNDI tree using EJB reference java:comp/env/ejb/PortalManager.
    javax.naming.NameNotFoundException: Unable to resolve comp/env/ejb/PortalManager
    Resolved: 'comp/env' Unresolved:'ejb' ; remaining name 'PortalManager'
    at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:802)
    at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:209)
    at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:173)
    at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:181)
    at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:181)
    at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:323)
    at weblogic.jndi.factories.java.ReadOnlyContextWrapper.lookup(ReadOnlyContextWrapper.java:36)
    at weblogic.jndi.internal.AbstractURLContext.lookup(AbstractURLContext.java:124)
    at javax.naming.InitialContext.lookup(InitialContext.java:350)
    at com.bea.p13n.util.JndiHelper.lookupNarrow(JndiHelper.java:96)
    at com.bea.portal.appflow.PortalAppflowHelper.<clinit>(PortalAppflowHelper.java:64)
    at com.bea.portal.appflow.servlets.internal.PortalWebflowServlet.init(PortalWebflowServlet.java:78)
    at javax.servlet.GenericServlet.init(GenericServlet.java:258)
    at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:700)
    at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.java:643)
    at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:588)
    at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:368)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:242)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
    at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:215)
    at weblogic.servlet.jsp.PageContextImpl.forward(PageContextImpl.java:112)
    at jsp_servlet.__index._jspService(__index.java:92)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:304)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2459)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2039)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    >
    <Nov 6, 2002 5:37:59 PM IST> <Error> <HTTP> <[WebAppServletContext(19695286,FirstWebApp,/FirstWebApp)]
    Servlet failed with Exception
    java.lang.NullPointerException:
    at com.bea.portal.appflow.PortalAppflowHelper.createPortalManager(PortalAppflowHelper.java:82)
    at com.bea.portal.appflow.servlets.internal.PortalWebflowServlet.setupPortalRequest(PortalWebflowServlet.java:187)
    at com.bea.portal.appflow.servlets.internal.PortalWebflowServlet.doGet(PortalWebflowServlet.java:99)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
    at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:215)
    at weblogic.servlet.jsp.PageContextImpl.forward(PageContextImpl.java:112)
    at jsp_servlet.__index._jspService(__index.java:92)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:304)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2459)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2039)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    When I decompiled the class PortalAppflowHelper, I found a static block in it,
    which was as under-
    static
    debug = Debug.getInstance(com.bea.portal.appflow.PortalAppflowHelper.class);
    try
    if(debug.ON)
    debug.out("Looking up PortalManagerHome using EJB reference java:comp/env/ejb/PortalManager");
    portalManagerHome = (PortalManagerHome)JndiHelper.lookupNarrow("java:comp/env/ejb/PortalManager",
    com.bea.portal.manager.ejb.PortalManagerHome.class);
    if(debug.ON)
    debug.out("Successfully retrieved PortalManagerHome " + portalManagerHome);
    catch(Exception e)
    PortalAppflowLogger.errorFindingPortalManagerHome("java:comp/env/ejb/PortalManager",
    e);
    I have checked the PortalManager's JNDI name on WLConsole. Its ${APPNAME}.BEA_portal.PortalManager.
    Should I change it?
    When I tried to change it, I started getting other weird errors.
    Thanks
    Neeraj Hans

    Neeraj -
    The Portal framework code (including PortalAppflowHelper) uses ejb
    references to find the PortalManager (and other EJBs) from servlets and
    taglibs; that is what is signified by the java:comp/env/... name.
    Since you built your webapp from scratch (instead of using the portal
    wizard), you will need to make sure the you have the appropriate
    <ejb-ref> entries in your web.xml, and the corresponding
    <ejb-reference-description> entries in your weblogic.xml. By default,
    you will need at least mappings for:
    - ejb/PortalManager
    - ejb/UserManager
    - ejb/GroupManager
    - ejb/PipelineExecutor
    - ejb/EventService
    See either the resulting webapp from using the portal wizard or
    BEA_HOME/weblogic700/samples/portal/sampleportalDomain/beaApps/sampleportal/sampleportal/WEB-INF
    for example syntax.
    Greg
    Neeraj Hans wrote:
    Hi
    I am just a starter on WLPortal.
    I have created a barebone Application from scratch. I have
    synchronized it properly
    from EBCC to WLP. But When I am trying to access the home page of my
    application,
    I am getting from stack trace -
    <Nov 6, 2002 5:37:59 PM IST> <Error> <PortalAppflow> <Could not lookup
    PortalManagerHome
    in the JNDI tree using EJB reference java:comp/env/ejb/PortalManager.
    javax.naming.NameNotFoundException: Unable to resolve
    comp/env/ejb/PortalManager
    Resolved: 'comp/env' Unresolved:'ejb' ; remaining name 'PortalManager'
    at <stack trace lines snipped>
    When I decompiled the class PortalAppflowHelper, I found a static
    block in it,
    which was as under-
    static
    debug =
    Debug.getInstance(com.bea.portal.appflow.PortalAppflowHelper.class);
    try
    if(debug.ON)
    debug.out("Looking up PortalManagerHome using EJB
    reference java:comp/env/ejb/PortalManager");
    portalManagerHome =
    (PortalManagerHome)JndiHelper.lookupNarrow("java:comp/env/ejb/PortalManager",
    com.bea.portal.manager.ejb.PortalManagerHome.class);
    if(debug.ON)
    debug.out("Successfully retrieved PortalManagerHome "
    + portalManagerHome);
    catch(Exception e)
    PortalAppflowLogger.errorFindingPortalManagerHome("java:comp/env/ejb/PortalManager",
    e);
    I have checked the PortalManager's JNDI name on WLConsole. Its
    ${APPNAME}.BEA_portal.PortalManager.
    Should I change it?
    When I tried to change it, I started getting other weird errors.
    Thanks
    Neeraj Hans

  • How can I build EJB archive after changing java files?

    hello,
    I changed java beans file, and tried to build jar file again, then the "build EJB archive" context menu is disabled so I can not make EJB jar file!
    So frustrated.. NWDS recognizes the changes in the java files , right? How come there 's no Build menu..
    Is there any pre-requisite to enable the menu?
    I have no idea how I can build jar file..
    Please give me a advice.. Thanks~!

    I think that in order to create a RPM, you'd need to
    use some C.Nope - the RPM is all about packaging and the "magic" x.spec file. You can have anything you want in the RPM, but you have to use RPM tools to build the .rpm file. One of the features is that you can also indicate (via "install" scripts) modifications to other files or the filesystem to support the installation of whatever's in the RPM.

  • Entity Finder mothod takes run time String. How can I specify in CDATA of the weblogic-cmp-ejb-jar.xml

    Hi everyone,
    I have an CMP bean which has findByName(String). During deployment of the ejb
    I tell the bean use the WLQL such as
    (like string%), but I would like to pass the name when the user enter in the text
    box of the .html page then the user click on search, the servlet is called and
    process using ejb technique. If I specified (like Fre%) in the ejb despcriptor
    for one particular case( such as looking for all Fred's), it will not work for
    the user enters smith.
    for example: user enter: Fre in the text box.
    I would like to have the bean do the query for me like:
    --> select * from user where lastName like Fre%
    If I cannot tell in the CDATA field, does that mean I have to use BMP to write
    query that takes the name.
    Please help,
    Thanks in advance.

    Thanks Jim,
    I did exactly like in the example (like Name $0) Name is my cmp field, but this
    time it always returns one entity (same entity )regardless what I entered to search
    by name. So that means it did not take the parameter that defined in <find-param>
    of the weblogic-cmp-rdbm-jar.xml. Do you have any suggestion or idea to overcome
    this problem.
    Thanks Jim,
    Tom
    Jim Weaver <[email protected]> wrote:
    >
    Tom
    You can use like with a String parameter in WLQL. There is an example
    in our
    documentation at
    http://www.weblogic.com/docs51/classdocs/API_ejb/EJB_environment.html#1022700
    Thanks
    Jim
    Tom wrote:
    Hi everyone,
    I have an CMP bean which has findByName(String). During deploymentof the ejb
    I tell the bean use the WLQL such as
    (like string%), but I would like to pass the name when the user enterin the text
    box of the .html page then the user click on search, the servlet iscalled and
    process using ejb technique. If I specified (like Fre%) in the ejbdespcriptor
    for one particular case( such as looking for all Fred's), it will notwork for
    the user enters smith.
    for example: user enter: Fre in the text box.
    I would like to have the bean do the query for me like:
    --> select * from user where lastName like Fre%
    If I cannot tell in the CDATA field, does that mean I have to use BMPto write
    query that takes the name.
    Please help,
    Thanks in advance.Content-Description: Card for Jim Weaver
    begin:vcard
    n:Weaver;Jim
    x-mozilla-html:FALSE
    org:BEA Systems Inc.
    adr:;;.;;;;
    version:2.1
    email;internet:[email protected]
    title:Developer Relations Engineer
    fn:Jim Weaver
    end:vcard

  • HOW can I call EJB with JSP?

    Hi, I'm working with JSP and want to include some EJB. I dont know how can I access EJB through JSP. I dont know if I use the right code in JSP for calling EJB. Did someone know how to use that? Can someone tell me if is the right code in JSP in my example?
    Thanks, Kristjan
    THIS IS THE JSP: (useejb.jsp)
    <%@ taglib uri="http://xmlns.oracle.com/j2ee/jsp/tld/ojsp/ejbtaglib.tld" prefix="EJB" %>
    <%@ page import="mypackage1.MySessionEJB" %>
    <%@ page import="mypackage1.MySessionEJBHome" %>
    <%@ page import="mypackage1.impl.MySessionEJBBean" %>
    <HTML>
    <head><TITLE>USEBEAN</TITLE></head>
    <body>
    <EJB:useHome id="mySessionEJBHome" type="mypackage1.MySessionEJBHome" location="java:comp/env/ejb/mySessionEJB" local="false" />
    <EJB:useBean id="mySessionEJBBean" type="mypackage1.impl.MySessionEJBBean" local="false">
    <EJB:createBean instance="<%=mySessionEJBHome.create() %>" />
    </EJB:useBean>
    <%= mySessionEJBBean.calc() %>
    </body>
    </html>
    THIS IS THE EJB CODE:(MySessionEJBBean.java)
    package mypackage1.impl;
    import javax.ejb.SessionBean;
    import javax.ejb.SessionContext;
    import java.lang.String.*;
    public class MySessionEJBBean implements SessionBean
    public void ejbCreate(){}
    public void ejbActivate(){}
    public void ejbPassivate(){}
    public void ejbRemove(){}
    public void setSessionContext(SessionContext ctx){}
    public String calc(String value)
    return value + value;
    public String zanka(String x)
    return x;
    (MySessionEJB.java)
    package mypackage1;
    import javax.ejb.EJBObject;
    import java.rmi.RemoteException;
    public interface MySessionEJB extends EJBObject
    public String calc(String value) throws RemoteException;
    String zanka(String x) throws RemoteException;
    (MySessionEJBHome.java)
    package mypackage1;
    import javax.ejb.EJBHome;
    import java.rmi.RemoteException;
    import javax.ejb.CreateException;
    public interface MySessionEJBHome extends EJBHome
    public MySessionEJB create() throws RemoteException, CreateException;
    }

    You might want to look at using a Java Bean wrapper, this can be done automically using WebSphere. It creates what is called an access bean which the JSP imports.
    HTH,
    J.Clancey

  • How to lookup EJBs deployed in OC4J from a standalone client application

    Hello all,
    I am trying to lookup an EJB deployed in OC4J 10.1.3 from a standalone client application using the following code:
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
    env.put(Context.PROVIDER_URL, "ormi://localhost:23791");
    env.put(Context.SECURITY_PRINCIPAL, "jazn.com/test");
    env.put(Context.SECURITY_CREDENTIALS, "test");
    Context context = new InitialContext(env);
    Object ref = context.lookup("ejb/Dispatch");
    I get the following error:
    javax.naming.NameNotFoundException: ejb/Dispatch not found
         at com.evermind.server.rmi.RMIClientContext.lookup(RMIClientContext.java:51)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
    For the lookup string I've also tried:
    "java:comp/env/ejb/Dispatch" and "Dispatch"
    For the Context.PROVIDER_URL property I've also tried:
    opmn:ormi://localhost:6003:instance
    The result is always the same.
    I appreciate if someone could help me with this?
    Thanks,
    Georgi

    Georgi,
    Your question has been discussed many times on this forum. Search the forum archives for "RMIInitialContextFactory".
    The PROVIDER_URL needs to include the name of the deployed application that your EJB is part of, for example:
    env.put(Context.PROVIDER_URL, "ormi://localhost:23791/MyApp");The lookup name has to be the value of the "ejb-name" element in your "ejb-jar.xml" descriptor file.
    Your SECURITY_PRINCIPAL value looks strange to me. Personally, I use "principals" (and not JAZN), so I modified the "application.xml" file (in the "j2ee/home/config" subdirectory) to use "principals". Look for the following comment in that file:
    &lt;!-- Comment out the jazn element to use principals.
          When both jazn and principals are present jazn is used  --&gt;Good Luck,
    Avi.
    Message was edited by:
    Avi Abrami

Maybe you are looking for

  • Change language in Creative Media Sourc

    I have CMS5 installed in my computer with Brazilian-Portuguese language, and I would like to change it to English. How can I do this?

  • Microsoft Exchange RPC service manager encountered an unexpected error while starting.

    Exchange 2013 on Server 2013 R2 stopped working after a reboot.  Latest patches were installed and shortly after the reboot this error started.  I have uninstalled the patches to no avail.  Server is at 100% processor and not working.  This is a VM d

  • Record by press of button

    Hello All, t'is me again with yet another stupid question. (sorry but I'm a real bum at labview). Dennis you wrote that : If you want a time stamp only when you click a button, wire the button to a case statement or Select function so that only the T

  • NOKIA formalises when released new firmware for n9...

    NOKIA, you are really ridiculous for how you handled all the holders of a n97/mini before you did pay a lot of euros then you realize that it was a huge **bleep** and have lowered the price so exaggerated now not even have the decency to respond to t

  • Backup 3.1.2

    Does anyone know... I'm currently running Backup, but I can't find any info on whether it backs up for all users on the mac, or do I need to run this on each account? Thanks