JNDI lookups of home interface

JNDI lookups are expensive timewise. Our question is ... would it be
pratical to lookup all our EJB Home interfaces once at startup and store
these references in a global class accessible to all clients? These home
interfaces then become readily available factories for acquiring instances
of remote interfaces. Is there anything wrong with this picture? Is this a
problem because these home stubs are not reentrant and may be accessed
concurrently by more than one client? Is there a problem with have one home
reference create multiple remote references of an ejb?
Any light that can be shed on this question wouls be appreciated.
Thanks.
tiffany
San Diego

I'm using a Singleton class to cache HomeInterfaces. The first time a
HomeInterface is requested, the JNDI lookup is done, after that, all
requests to that HomeInterface are handled by the cache. Works great, no
problems. AFAIK there are no problems with storing the HomeInterface
reference and reusing it.
Hope that helps,
Nils
Tiffany wrote:
>
JNDI lookups are expensive timewise. Our question is ... would it be
pratical to lookup all our EJB Home interfaces once at startup and store
these references in a global class accessible to all clients? These home
interfaces then become readily available factories for acquiring instances
of remote interfaces. Is there anything wrong with this picture? Is this a
problem because these home stubs are not reentrant and may be accessed
concurrently by more than one client? Is there a problem with have one home
reference create multiple remote references of an ejb?
Any light that can be shed on this question wouls be appreciated.
Thanks.
tiffany
San Diego--
============================
[email protected]

Similar Messages

  • Lookup for local home interface

    Hi!
    I am using the j2eesdk and there is a thing I cannot find anywhere:
    When I use a local interface for a bean and define an EJB Ref on that bean in the 'deploytool', I cannot specify a JNDI name (only a bean name). Therefore I cannot map the coded name in my Context-lookup() call in the code to any JNDI name on the applications 'JNDI Names' tab.
    My question is:
    - how do I lookup local home interfaces?
    - if this is done via JNDI, how do I do this in the deploytool?
    Kind Regards
    Ralf

    Hi
    The point u all should understand is you use a jndi name in your programs
    say
    public static void main(String[] args)
    InitalContext ctx = new IntialContext();
    ctx=(Context)ctx.lookup("java:comp/env");
    DemoLocalHome home = ctx.lookup("ejb/DemoBean");
    in the above program you use "ejb/DemoBean" as a reference name, but actually there won't be a Bean registered with that name. so, when u deploy the appclient u should map the reference name with the actual JNDI name ( if it's a remote interface) or with the class name (Local interface)
    so, when u deploy the appclient in the "ejb ref " tab, u specify that it uses Local interfaces and in the end u don't map the refernce name to a JNDI name( because it's a local interface) and rather u speciy the class name.
    that's how u map the references for Remote and Local home interfaces.....
    thank's for listening to that......
    for more suggestions mail me at [email protected]

  • JNDI lookup, uncheked bean and LoginModule

    Hi people!
    I have stateless session bean with uncheked method permissions.My application use custom login module. When I try to lookup it home interface the container invoke my login module. Why it do so? This is incorrect behaviour, I think. Why container authenticate any jndi-lookup? How can I to get out this behaviour?
    Thanks.

    There are two steps since your ejb client is not a managed bean.
    1) Define an ejb-local-ref in web.xml or a class-level @EJB in some managed class within
    the same .war.
    2) Lookup the dependency by ejb-ref-name or @EJB(name) relative to java:comp/env
    Our EJB FAQ has more detail :
    https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html#POJOLocalEJB

  • ClassCastException on ejb jndi lookup

    Hello,
    I try to get an standalone remote client to to connect to my stateless session bean:
    java.util.Properties props = new java.util.Properties();
    props.put("java.naming.provider.url", "181.205.12.19:50004");
    props.put("java.naming.factory.initial", "com.sap.engine.services.jndi.InitialContextFactoryImpl" );
    props.put("java.naming.security.authentication", "simple");
    props.put("java.naming.security.principal", "j2ee_admin");
    props.put("java.naming.security.credentials", "*****");
    jndiContext = new InitialContext(props);
    fetching of jndi context is fine, but once I try to lookup my home interface I get a class cast exception:
    home = (ToEdifactConverterHome) PortableRemoteObject.narrow(jndiContext.lookup ("sap.com/EdifactEar/ToEdifactConverterBean"), ToEdifactConverterHome.class);
    java.lang.ClassCastException
         at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:293)
         at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
         at test.cceag.transform.TransformTester.setUp(TransformTester.java:74)
         at test.cceag.transform.TransformTester.main(TransformTester.java:48)
    The jndi lookup seems to return the bean implementation object, but not the home interface itself.
    Thanks for any hints
    Matthias

    Hi Matthias,
    i think the   guide
    "How to...EJB: Accessing EJB Applications Using JNDI"
    will help you to solve the ejb lookup problem:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/0736159e-0301-0010-9ea4-c63d83d0797b
    good luck, Katharina

  • Home Interface Load Balancing with user transactions

    Hi
              Im running the following Client scenario:
              * gets initial context
              * lookup for Home Interface.
              * save the Home Interface.
              * Begin User Transaction
              * Home.findByPrimaryKey(pk)
              * activate some business method
              * Commit transaction.
              * close context
              now repeat but use the saved home interface
              * gets initial context
              * get saved Home Interface.
              * Begin User Transaction
              * Home.findByPrimaryKey(pk)
              * activate some business method
              * Commit transaction.
              * close context
              It seems that once i use the Home finder under a transaction the home
              interface will stick to the first server and load balancing won't work
              (doesn't matter if its round-robin or random).
              that means that in both cases the EjbObject i use is on the same server.
              please correct me if im wrong.
              but if im right is this a weblogic bug? or maybe a feature?
              thanks
              Dror Last
              

    You will find that most engineers at BEA strong recommend NOT using UserTxns, unless you've got some
              complex nest transaction modeling that can't be done with BMT.
              From your case, it looks as if you should use a Session-bean facade between your servlets and entity
              beans; this way you set the session bean BMT attribute to whatever you wanted using
              UserTransaction; try this out and see what happens with load-balancing... we use BMT in clustered
              servers and load-balancing works great.
              Gene
              "Dror Last" <[email protected]> wrote in message news:[email protected]...
              > Im using Weblogic 5.1 / SP8
              >
              > <home-is-clusterable> set to TRUE on all beans.....
              >
              >
              > I have a big Question Mark if weblogic clustering does have load balancing
              > while the client (Servlet Engine in my case) Uses User Transactions.
              >
              > thanks
              > Dror Last
              >
              >
              > "Gene Chuang" <[email protected]> wrote in message
              > news:[email protected]...
              > > What WL version are u using, and what do you have <home-is-clusterable>
              > set to?
              > >
              > > Gene
              > >
              > > "Dror Last" <[email protected]> wrote in message
              > news:[email protected]...
              > > > Hi
              > > >
              > > > Im running the following Client scenario:
              > > >
              > > > * gets initial context
              > > > * lookup for Home Interface.
              > > > * save the Home Interface.
              > > > * Begin User Transaction
              > > > * Home.findByPrimaryKey(pk)
              > > > * activate some business method
              > > > * Commit transaction.
              > > > * close context
              > > >
              > > > now repeat but use the saved home interface
              > > >
              > > > * gets initial context
              > > > * get saved Home Interface.
              > > > * Begin User Transaction
              > > > * Home.findByPrimaryKey(pk)
              > > > * activate some business method
              > > > * Commit transaction.
              > > > * close context
              > > >
              > > > It seems that once i use the Home finder under a transaction the home
              > > > interface will stick to the first server and load balancing won't work
              > > > (doesn't matter if its round-robin or random).
              > > >
              > > > that means that in both cases the EjbObject i use is on the same server.
              > > >
              > > > please correct me if im wrong.
              > > >
              > > > but if im right is this a weblogic bug? or maybe a feature?
              > > >
              > > > thanks
              > > > Dror Last
              > > >
              > > >
              > >
              > >
              >
              >
              

  • Taking a long time to do JNDI lookup

    Hi,
    I have something like this for my JNDI lookup:
    myEJBHome home = (myEJBHome) PortableRemoteObject.narrow(context.lookup("mybean")          ,myEJBHome.class);
    and
    myEJB session = (myEJB)home.create();
    Recently it's taking an EXTREMELY long time to do these 2 operations (before it took milliseconds, now it's like 10 minutes...but I haven't changed anything at all).
    Any idea why?
    Thanks

    If the bean is in another machine more than likely the connection or firewall issue?
    PC

  • Unable to lookup ejb local home interface after moving to wls 7.0

    I'm getting an exception trying to lookup an ejb's local home interface
    which I believe was deployed correctly. On startup I get the message:
    EJB Deployed EJB with JNDI name
    com.logistics.basedata.ejb.shipperspecificfveb.ShipperSpecificFVDOLocalHome.
    However, when I try to do a lookup using this jndi name, I get the
    following exception:
    javax.naming.LinkException: . Root exception is
    javax.naming.NameNotFoundException: Unable to resolve
    'app/ejb/ShipperSpecificFVDO.jar#com.logistics.basedata.ejb.shipperspecificfveb/local-home'
    Resolved: 'app/ejb'
    Unresolved:'ShipperSpecificFVDO.jar#com.logistics.basedata.ejb.shipperspecificfveb'
    ; remaining name
    'ShipperSpecificFVDO.jar#com.logistics.basedata.ejb.shipperspecificfveb/local-home'
    The name it can't resolve is different than the name I was trying to
    look up. I can see
    com.logistics.basedata.ejb.shipperspecificfveb.ShipperSpecificFVDOLocalHome
    in the jndi tree through the admin console, but the attributes Object
    Class, Object Hash Code, and Object To String are blank.
    This worked with weblogic 6.1 sp3. Is there something I missed in the
    migration to 7.0?
    Any help would be appreciated. Thanks in advance,
    -Brad

    That explains it - in 7.0 (unlike 6.1 - then the only factor was
    classloaders arrangement) client has to be
    in the same application (ear) - note JNDI links used to be able to lookup
    local homes.
    "Brad Geddes" <[email protected]> wrote in message
    news:[email protected]...
    I'm looking it up from a web application. I did notice a message on thistopic
    from last thursday (subject: "Pls Help! Failed to access local Sessionbean in
    7.0!"). In it, the individual said he had to add ejb-local-ref elementsin the
    web.xml. I tried this but can't seem to get it to work.
    javax.naming.NameNotFoundException: Unable to resolve ejb-link.
    ShipperSpecificFVDO.jar#com.logistics.basedata.ejb.shipperspecificfveb isnot in
    the context. The context includes the following link bindings: {} Makesure the
    link reference is relative to the URI of the referencing module.
    Also, I don't have a war or ear in the environment I'm working in; theejb's are
    all deployed separately in jar files, and the web app is in explodedformat.
    >
    -Brad
    "Dimitri I. Rakitine" wrote:
    Are you looking up the local home from outside of an application ?
    "Brad Geddes" <[email protected]> wrote in message
    news:[email protected]...
    I'm getting an exception trying to lookup an ejb's local home
    interface
    which I believe was deployed correctly. On startup I get the message:
    EJB Deployed EJB with JNDI name
    com.logistics.basedata.ejb.shipperspecificfveb.ShipperSpecificFVDOLocalHome.
    >>>
    However, when I try to do a lookup using this jndi name, I get the
    following exception:
    javax.naming.LinkException: . Root exception is
    javax.naming.NameNotFoundException: Unable to resolve
    'app/ejb/ShipperSpecificFVDO.jar#com.logistics.basedata.ejb.shipperspecificf
    veb/local-home'
    Resolved: 'app/ejb'
    Unresolved:'ShipperSpecificFVDO.jar#com.logistics.basedata.ejb.shipperspecif
    icfveb'
    ; remaining name
    'ShipperSpecificFVDO.jar#com.logistics.basedata.ejb.shipperspecificfveb/loca
    l-home'
    The name it can't resolve is different than the name I was trying to
    look up. I can see
    com.logistics.basedata.ejb.shipperspecificfveb.ShipperSpecificFVDOLocalHome
    in the jndi tree through the admin console, but the attributes Object
    Class, Object Hash Code, and Object To String are blank.
    This worked with weblogic 6.1 sp3. Is there something I missed in the
    migration to 7.0?
    Any help would be appreciated. Thanks in advance,
    -Brad
    Dimitri--
    Dimitri

  • ClassNotFound while narrowing JNDI ref to ejb home interface

    Hello everybody
    I'm quite new to BEA WebLogic. I deployed Jasmine application on Bea WLS7 (example
    app from Mastering EJB 2). But when i tried to use login servlet, it threw an
    exception ClassNotFound when narrowing ejb home interface (obtained via JNDI).
    EJBs are in .jar file, and web files are in the .war file, maybe this is the problem.
    Should I copy ejb classes to .war file, or make some tricks with CLASSPATH, or
    maybe there is better way to make it work (maybe via J2EE references or something
    like this).
    Thanks in advance

    Strange. And you do not have any application classes in the system
    classpath?
    Konrad R. <[email protected]> wrote:
    "Dimitri I. Rakitine" <[email protected]> wrote:
    Did you deploy ejbs and war in the same ear?
    Yes, both were packed up into one .ear archive>>
    Konrad R. <[email protected]> wrote:
    Hello everybody
    I'm quite new to BEA WebLogic. I deployed Jasmine application on BeaWLS7 (example
    app from Mastering EJB 2). But when i tried to use login servlet, itthrew an
    exception ClassNotFound when narrowing ejb home interface (obtainedvia JNDI).
    EJBs are in .jar file, and web files are in the .war file, maybe thisis the problem.
    Should I copy ejb classes to .war file, or make some tricks with CLASSPATH,or
    maybe there is better way to make it work (maybe via J2EE referencesor something
    like this).
    Thanks in advance--
    Dimitri

  • Unable to bind EJB Home Interface to the JNDI name

    Why do I get this error?? What is the jndi-name in weblogic-ejb-jar.xml
    Unable to deploy EJB: OrganizationEJB from sempire_bc.jar:
    Unable to bind EJB Home Interface to the JNDI name:
    com.sempire.builder.business
    _component.Organization. The error was:
    javax.naming.NameAlreadyBoundException: Organization is already bound;
    remaining
    name 'com.sempire.builder.business_component'
    <<no stack trace available>>

    Slava,
    In case I change the name of the jndi name to a unique name. I still get the same
    problem. I checked for multiple occurences, but there aren't any.
    My web.xml file is:
    <ejb-local-ref>
    <description>
    Reference EJB resources in Weblogic Resources
    </description>
    <ejb-ref-name>GangsterEJB</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <local-home>com.sempire.builder.business_component.GangsterHome</local-home>
    <local>com.sempire.builder.business_component.Gangster</local>
    </ejb-local-ref>
    My weblogic-ejb-jar.xml file is:
    <weblogic-enterprise-bean>
    <ejb-name>GangsterEJB</ejb-name>
    <entity-descriptor>
    <persistence>
    <persistence-type>
    <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
    <type-version>6.0</type-version>
    <type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
    </persistence-type>
    <persistence-use>
    <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
    <type-version>6.0</type-version>
    </persistence-use>
    </persistence>
    </entity-descriptor>
    <reference-descriptor>
    <resource-description>
    <res-ref-name>jdbc/GangsterDB</res-ref-name>
    <jndi-name>oraclePool</jndi-name>
    </resource-description>
    </reference-descriptor>
    <local-jndi-name>Gangster_test</local-jndi-name>
    </weblogic-enterprise-bean>
    I do not get the problem.
    Thank you
    Ronak Parekh
    "Slava Imeshev" <[email protected]> wrote:
    Hi Ronak,
    This exception means that you already have a bean
    with the same JNDI name. Search your weblogic-ejb-jar.xml files
    for multiple occurrences of the name and fix the problem.
    Regards,
    Slava Imeshev
    "Ronak Parekh" <[email protected]> wrote in message
    news:[email protected]...
    Why do I get this error?? What is the jndi-name in weblogic-ejb-jar.xml
    Unable to deploy EJB: OrganizationEJB from sempire_bc.jar:
    Unable to bind EJB Home Interface to the JNDI name:
    com.sempire.builder.business
    _component.Organization. The error was:
    javax.naming.NameAlreadyBoundException: Organization is already bound;
    remaining
    name 'com.sempire.builder.business_component'
    <<no stack trace available>>

  • ClassCastException - While type casting Home object after EJB JNDI Lookup

    Sun One Application Server throws a ClassCastException when I try to type cast Home object to it's respective interface type.
    Here is the code ---
    ==============================================
    Object obj = PortableRemoteObject.narrow( context.lookup( jndiName ), homeClass);
    System.out.println("Remote Object - obj : "+obj);
    if (obj != null) {
       System.out.println("obj.getClass().getName() : "+obj.getClass().getName());
       System.out.println("obj.getClass().getSuperclass() : "+obj.getClass().getSuperclass());
       Class[] interfaces = obj.getClass().getInterfaces();
       if (interfaces != null) {
          for (int count = 0; count < interfaces.length; count++) {
             System.out.println("interfaces[ " + count + " ].getName() : " + interfaces[ count ].getName());
    }==============================================
    The class name is dislpayed as the Stub class name.
    While displaying the interfaces, the Home Interface name is displayed.
    But later when I try to type cast it into Home Interface type, it throws a ClassCastException.
    Can somebody please check this?

    Please post the stack trace. Also, take a look at our EJB FAQ to make sure you're doing the
    recommended lookup :
    https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html

  • Getting JNDI Home Interface Hangs

    Can someone help.
    We ported an application successfully from weblogic 6 months ago. We are now trying to port a later version of the application. We are using OC4J v9.0.3.0 as the application server this starts ok and we have a class wrapped up in a client-module which makes a bean call and this works ok as well
    But our frontend runs on tomcat 4.0.4 and any attempt to access the JNDI Service such as a bean lookup just results in it hanging. I have also written a test java application that tries to to do JNDI lookup and this also hangs.
    In each (working and none-working)case we construct hashtable in the same way
    env.put(Context.SECURITY_AUTHENTICATION, "simple");
         env.put(Context.SECURITY_PRINCIPAL, userName);
         env.put(Context.SECURITY_CREDENTIALS, userPassword);
         env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.ApplicationClientInitialContextFactory");
              env.put(Context.PROVIDER_URL,"ormi://localhost:23791/symularity");
    (We are using jdk1.4.1_01 for both server & client and have replaced tools.jar with the corresponding version because code now relies on some jdk1.4 features)
    Has anyone had this problem

    FYI:Solved problem my client was using a a version of the oc4j.jar and oc4jclient.jar libraries that came with v9.0.3.0 BETA rather than released version. Sorry about that.

  • EJB 3.0 and jndi lookup (simple question)

    hi all,
    i am newbie on Weblogic Application Server and i have some issues,
    i have weblogic application server 10.0, also i have oracle timesten in-memory database, i have configured datasource and deploy my ejb 3.0 application, but i could not done jndi lookup?
    here is my example:
    1. one stateless session bean :
    import javax.ejb.Remote;
    @Remote
    public interface InsertSubscriber {
         public void insertSubscriber(SubscriberT subscriberT);
    } 2. here is it's implementation :
    @Remote(InsertSubscriber.class)
    @Stateless
    public class InsertSubscriberBean implements InsertSubscriber {
         @PersistenceContext(unitName = "TimesTenDS")
         private EntityManager oracleManager;
         public void insertSubscriber(SubscriberT subscriber)
              try {
                   System.out.println("started");
                   oracleManager.persist(subscriber);
                   System.out.println("end");
              } catch (Exception e) {
                   e.printStackTrace();
    }3 and my test client :
    public class Client {
         public static void main(String[] args) {
              Context ctx = null;
              Hashtable ht = new Hashtable();
              ht.put(Context.INITIAL_CONTEXT_FACTORY,
                        "weblogic.jndi.WLInitialContextFactory");
              ht.put(Context.PROVIDER_URL, "t3://192.9.200.222:7001");
              try {
                   ctx = new InitialContext(ht);
                   InsertSubscriber usagefasade = (InsertSubscriber) ctx
                             .lookup("ejb.InsertSubscriberBean");               
              } catch (NamingException e) {
                   e.printStackTrace();
              } finally {
                   try {
                        ctx.close();
                   } catch (Exception e) {
                        e.printStackTrace();
    }what i did incorrect ???
    i got error like this : Name not fount exception
    when i tried to view jndi tree on weblogic server application console i found this :
         Binding Name:     
    TimestenExampleTimestenExample_jarInsertSubscriberBean_InsertSubscriber     
         Class:     
    test.InsertSubscriberBean_o7jk9u_InsertSubscriberImpl_1000_WLStub     
         Hash Code:     
    286     
         toString Results:     
    weblogic.rmi.internal.CollocatedRemoteRef - hostID: '2929168367193491522S::billing_domain:AdminServer', oid: '286', channel: 'null'what does it mean how i can done lookup to jndi ?
    Regards,
    Paata Lominadze,
    Magticom LTD.
    Georgia.

    Hi All,
    I am using the weblogic cluster with session replication and EJB 2.0 with Local entity beans.
    for fail-over session should be replicated to another server so we can achive the same session if 1st server fails.
    Suppose i m using two managed server(server1,server2) in the cluster.I am storing the object of class ABC into session and object contains the instance of Local-EntityBean home but i put that as a transient.I have also override the readObject and write object method.
    when write object is called on 1st server,readObject method should be called on second server so we will be sure that session is replicating properly.
    pleaase find the code below : -
    public IssuerPageBean() {
    initEJB();
    private void readObject(java.io.ObjectInputStream stream) throws IOException, ClassNotFoundException {
    stream.defaultReadObject();
    initEJB();
    initializeCommonObject();
    private void writeObject(java.io.ObjectOutputStream stream) throws IOException {
    stream.defaultWriteObject();
    private void initEJB() {
    try {
    ic = new InitialContext();
    issuerHome = (LocalIssuerHome) ic.lookup("java:comp/env/Issuer");
    } catch (NamingException e) {
    e.printStackTrace();
    in my case if i am calling the constructor IssuerPageBean(),it calls the initEJB() method and lookeup the entity local home properly but when readObject method is called on another server only initEJB() method is called directly and getting the exception below :
    WARNING: Error during create -
    javax.naming.NameNotFoundException: remaining name: env/ejb/Client
    at weblogic.j2eeclient.SimpleContext.resolve(Ljavax/naming/Name;Z)Ljavax/naming/Context;(SimpleContext.java:35)
    at weblogic.j2eeclient.SimpleContext.resolve(Ljavax/naming/Name;)Ljavax/naming/Context;(SimpleContext.java:39)
    at weblogic.j2eeclient.SimpleContext.lookup(Ljavax/naming/Name;)Ljava/lang/Object;(SimpleContext.java:57)
    at weblogic.j2eeclient.SimpleContext.lookup(Ljavax/naming/Name;)Ljava/lang/Object;(SimpleContext.java:57)
    at weblogic.j2eeclient.SimpleContext.lookup(Ljava/lang/String;)Ljava/lang/Object;(SimpleContext.java:62)
    at weblogic.jndi.factories.java.ReadOnlyContextWrapper.lookup(Ljava/lang/String;)Ljava/lang/Object;(ReadOnlyCont
    extWrapper.java:45)
    at weblogic.jndi.internal.AbstractURLContext.lookup(Ljava/lang/String;)Ljava/lang/Object;(AbstractURLContext.jav
    a:130)
    at javax.naming.InitialContext.lookup(Ljava/lang/String;)Ljava/lang/Object;(InitialContext.java:347)
    at com.lb.equities.veda.tools.salesvault.jsp.ClientPageBean.initEJB()V(ClientPageBean.java:218)
    at com.lb.equities.veda.tools.salesvault.jsp.ClientPageBean.readObject(Ljava/io/ObjectInputStream;)V(ClientPageB
    ean.java:191)
    at java.lang.LangAccessImpl.readObject(Ljava/lang/Class;Ljava/lang/Object;Ljava/io/ObjectInputStream;)V(Unknown
    Source)
    at java.io.ObjectStreamClass.invokeReadObject(Ljava/lang/Object;Ljava/io/ObjectInputStream;)V(Unknown Source)
    at java.io.ObjectInputStream.readSerialData(Ljava/lang/Object;Ljava/io/ObjectStreamClass;)V(Unknown Source)
    at java.io.ObjectInputStream.readOrdinaryObject(Z)Ljava/lang/Object;(Unknown Source)
    at java.io.ObjectInputStream.readObject0(Z)Ljava/lang/Object;(Unknown Source)
    at java.io.ObjectInputStream.readObject()Ljava/lang/Object;(Unknown Source)
    at java.util.HashMap.readObject(Ljava/io/ObjectInputStream;)V(Unknown Source)
    at java.lang.LangAccessImpl.readObject(Ljava/lang/Class;Ljava/lang/Object;Ljava/io/ObjectInputStream;)V(Unknown
    Source)
    at java.io.ObjectStreamClass.invokeReadObject(Ljava/lang/Object;Ljava/io/ObjectInputStream;)V(Unknown Source)
    at java.io.ObjectInputStream.readSerialData(Ljava/lang/Object;Ljava/io/ObjectStreamClass;)V(Unknown Source)
    at java.io.ObjectInputStream.readOrdinaryObject(Z)Ljava/lang/Object;(Unknown Source)
    at java.io.ObjectInputStream.readObject0(Z)Ljava/lang/Object;(Unknown Source)
    at java.io.ObjectInputStream.defaultReadFields(Ljava/lang/Object;Ljava/io/ObjectStreamClass;)V(Unknown Source)
    at java.io.ObjectInputStream.readSerialData(Ljava/lang/Object;Ljava/io/ObjectStreamClass;)V(Unknown Source)
    at java.io.ObjectInputStream.readOrdinaryObject(Z)Ljava/lang/Object;(Unknown Source)
    at java.io.ObjectInputStream.readObject0(Z)Ljava/lang/Object;(Unknown Source)
    at java.io.ObjectInputStream.readObject()Ljava/lang/Object;(Unknown Source)
    at weblogic.common.internal.ChunkedObjectInputStream.readObject()Ljava/lang/Object;(ChunkedObjectInputStream.jav
    a:120)
    at weblogic.rjvm.MsgAbbrevInputStream.readObject(Ljava/lang/Class;)Ljava/lang/Object;(MsgAbbrevInputStream.java:
    121)
    at weblogic.cluster.replication.ReplicationManager_WLSkel.invoke(ILweblogic/rmi/spi/InboundRequest;Lweblogic/rmi
    /spi/OutboundResponse;Ljava/lang/Object;)Lweblogic/rmi/spi/OutboundResponse;(Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(Lweblogic/rmi/extensions/server/RuntimeMethodDescriptor;Lweblogic
    /rmi/spi/InboundRequest;Lweblogic/rmi/spi/OutboundResponse;)V(BasicServerRef.java:492)
    Please help .
    Thanks in Advance.
    Edited by hforever at 03/04/2008 7:28 AM

  • Best practice for jndi lookup

    I am in the process of cleaning up a rather large codebase and am looking for the best way (or good methodologies I can choose from) for specifying the jndi lookup name. Our current code base has the following methods for specifying the lookup name:
    1) hard-coded strings
    2) constant defined in the file making lookup
    3) constant defined in external interface
    4) constant defined in EJB Home interface
    My initial thought was to create a single interface and put all the constants within it and have any class that wants to perform a lookup implement that interface. But before I went and did that I wanted to see if there were any other methods out there.
    I searched the forums (EJB/JNDI) but could not find anything that specified any method that was preferred.
    TIA

    I am in the process of cleaning up a rather large
    codebase and am looking for the best way (or good
    methodologies I can choose from) for specifying the
    jndi lookup name. Our current code base has the
    following methods for specifying the lookup name:
    1) hard-coded strings
    2) constant defined in the file making lookup
    3) constant defined in external interface
    4) constant defined in EJB Home interface
    constant defined in external interface
    My initial thought was to create a single interface
    and put all the constants within it and have any
    class that wants to perform a lookup implement that
    interface.
    sounds great !

  • JNDI lookup problem in WAS 5.1

    Hello all,
    I have generated an EAR using XDoclet and MyEclipse. When I deploy this EAR on WAS 5.1, I get the following exception:
    javax.naming.NameNotFoundException: Context: WarHog/nodes/WarHog/servers/server1, name: ejb/TEDIObjectManagerLocal: First component in name TEDIObjectManagerLocal not found.  Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
         at org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundHelper.java:85)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code))
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code))
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
         at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
         at com.ibm.rmi.iiop.CDRInputStream.readBoxedIDLEntity(CDRInputStream.java:2112)
         at com.ibm.rmi.iiop.CDRInputStream.readIDLValue(CDRInputStream.java:2177)
         at com.ibm.rmi.iiop.CDRInputStream.fast_read_value(CDRInputStream.java:1734)
         at com.ibm.rmi.io.IIOPInputStream.readValueType(IIOPInputStream.java:2085)
         at com.ibm.rmi.io.IIOPInputStream.readObjectField(IIOPInputStream.java:2057)
         at com.ibm.rmi.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:1765)
         at com.ibm.rmi.io.IIOPInputStream.inputObjectUsingClassDesc(IIOPInputStream.java:1348)
         at com.ibm.rmi.io.IIOPInputStream.continueSimpleReadObject(IIOPInputStream.java:420)
         at com.ibm.rmi.io.IIOPInputStream.simpleReadObjectLoop(IIOPInputStream.java:404)
         at com.ibm.rmi.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:347)
         at com.ibm.rmi.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:200)
         at com.ibm.rmi.iiop.CDRInputStream.read_value(CDRInputStream.java:1367)
         at com.ibm.rmi.util.ProxyUtil.copyObject(ProxyUtil.java:450)
         at com.ibm.CORBA.iiop.UtilDelegateImpl.copyObject(UtilDelegateImpl.java:789)
         at javax.rmi.CORBA.Util.copyObject(Util.java:333)
         at com.wdc.tedi.interfaces._TransformationEngine_Stub.transform(_TransformationEngine_Stub.java:268)
         at com.wdc.tedi.web.TestHarnessBean.translate(TestHarnessBean.java:42)
         at com.wdc.tedi.web.TestHarnessBean.setDataBlob(TestHarnessBean.java:80)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)First of all, I don't really understand what the error means. Is it that the JNDI lookup failed when one of my beans tried to do a lookup on 'ejb/TEDIObjectManagerLocal'? I believe there's some configuration that went wrong (EJB reference binding or something) when I deployed the EAR. The reason I don't think it's a faulty code is because the EAR runs like a charm when I deploy it on Oracle 10g and Weblogic.
    I am really stuck on this problem and shall appreciate any help that I can get. I can send the code, xdoclet tags and configuration if that might assist someone.
    Thanks
    -ybh6336

    Hello all,
    I'm still stuck on this issue. Following are the entries related to my
    application when I do a 'dumpNameSpace':
       28 (top)/nodes/WarHog/servers/server1/ejb/tedi/TEDIObjectManager
       28
    com.wdc.tedi.interfaces._TEDIObjectManagerHome_Stub
       29 (top)/nodes/WarHog/servers/server1/ejb/tedi/DSValueLookup
       29
    com.wdc.tedi.interfaces._DSValueLookupHome_Stub
       30 (top)/nodes/WarHog/servers/server1/ejb/tedi/TransformationEngine
       30
    com.wdc.tedi.interfaces._TransformationEngineHome_StubObservations:
    - I only see the namespace entries for my Session beans. There's one
    entity bean also which does not show up.
    - I don't see anything for the Local Home interfaces, it shows only the
    Home interfaces.
    As additional information, I'm looking up 'TEDIObjectManagerLocal'
    using 'ejb/TEDIObjectManagerLocal'. I also tried using 'local:ejb/ejb/TEDIObjectManagerLocal' (as Karthyk suggested) and
    'java:comp/env/ejb/TEDIObjectManagerLocal', but that does not work
    either.
    Also, the XDoclet tags that I use to generate the interfaces for
    TEDIObjectManager bean are as follows:
    /* @ejb.bean name="TEDIObjectManager"
    *           display-name="TEDIObjectManager"
    *           description="TEDIObjectManager"
    *           jndi-name="ejb/tedi/TEDIObjectManager"
    *           local-jndi-name="ejb/TEDIObjectManagerLocal"
    *           type="Stateless"
    *           view-type="both"
    * @ejb.util generate="physical"
    * @ejb.ejb-ref ejb-name="TEDIObject"
    * view-type = "local"
    * ref-name = "ejb/TEDIObjectLocal"
    * @oc4j.bean jndi-name="ejb/tedi/TEDIObjectManager"
    */My ejb-jar.xml looks like following for that bean:
    <session >
             <description><![CDATA[TEDIObjectManager]]></description>
             <display-name>TEDIObjectManager</display-name>
             <ejb-name>TEDIObjectManager</ejb-name>
             <home>com.wdc.tedi.interfaces.TEDIObjectManagerHome</home>
             <remote>com.wdc.tedi.interfaces.TEDIObjectManager</remote>
    <local-home>com.wdc.tedi.interfaces.TEDIObjectManagerLocalHome</local-home>
             <local>com.wdc.tedi.interfaces.TEDIObjectManagerLocal</local>
    <ejb-class>com.wdc.tedi.ejb.TEDIObjectManagerSession</ejb-class>
             <session-type>Stateless</session-type>
             <transaction-type>Container</transaction-type>
             <ejb-local-ref >
                <ejb-ref-name>ejb/TEDIObjectLocal</ejb-ref-name>
                <ejb-ref-type>Entity</ejb-ref-type>
    <local-home>com.wdc.tedi.interfaces.TEDIObjectLocalHome</local-home>
                <local>com.wdc.tedi.interfaces.TEDIObjectLocal</local>
                <ejb-link>TEDIObject</ejb-link>
             </ejb-local-ref>
          </session>AND following for the bean that is referencing it:
    <session >
             <description><![CDATA[TransformationEngine]]></description>
             <display-name>TransformationEngine</display-name>
             <ejb-name>TransformationEngine</ejb-name>
             <home>com.wdc.tedi.interfaces.TransformationEngineHome</home>
             <remote>com.wdc.tedi.interfaces.TransformationEngine</remote>
    <local-home>com.wdc.tedi.interfaces.TransformationEngineLocalHome</local-home>
    <local>com.wdc.tedi.interfaces.TransformationEngineLocal</local>
    <ejb-class>com.wdc.tedi.ejb.TransformationEngineSession</ejb-class>
             <session-type>Stateless</session-type>
             <transaction-type>Container</transaction-type>
             <ejb-local-ref >
                <ejb-ref-name>ejb/TEDIObjectManagerLocal</ejb-ref-name>
                <ejb-ref-type>Session</ejb-ref-type>
    <local-home>com.wdc.tedi.interfaces.TEDIObjectManagerLocalHome</local-home>
    <local>com.wdc.tedi.interfaces.TEDIObjectManagerLocal</local>
                <ejb-link>TEDIObjectManager</ejb-link>
             </ejb-local-ref>
          </session>The entries in ibm-ejb-jar-bnd.xmi (generated using MyEclipse) are as
    follows for the two beans:
    <ejbBindings
             xmi:id="Session_bnd_1"
             jndiName="ejb/tedi/TransformationEngine">
             <ejbRefBindings xmi:id="EJBRefBnd_1"
    jndiName="ejb/TEDIObjectManagerLocal">
        <bindingEjbRef href="META-INF/ejb-jar.xml#EJBLocalRef_1"/>
             </ejbRefBindings>
             <enterpriseBean
                xmi:type="ejb:Session"
    href="META-INF/ejb-jar.xml#Session_TransformationEngine" />
          </ejbBindings>
    <ejbBindings
             xmi:id="Session_bnd_3"
             jndiName="ejb/tedi/TEDIObjectManager">
             <ejbRefBindings xmi:id="EJBRefBnd_2"
    jndiName="ejb/TEDIObjectLocal">
        <bindingEjbRef href="META-INF/ejb-jar.xml#EJBLocalRef_2"/>
             </ejbRefBindings>
             <enterpriseBean
                xmi:type="ejb:Session"
    href="META-INF/ejb-jar.xml#Session_TEDIObjectManager" />
          </ejbBindings>I know I'm swamping the post with code, but please let me know if anyone finds something unusual.
    NOTE: When deploying on WAS, in the 'Map EJB references to beans' step, I'm giving the following values for 'TransformationEngine' bean:
    Reference binding: ejb/TEDIObjectManagerLocal
    JNDI Name: ejb/tedi/TEDIObjectManager
    There's one other similar binding that works for 'TEDIObjectManager'
    bean:
    Reference binding: ejb/TEDIObjectLocal
    JNDI Name: ejb/TEDIObject
    Everything in ejb-jar and ibm-ejb-jar-bnd.xmi look similar for this working bean, there is one difference though, I do the lookup on this one using 'java:comp/env/ejb/TEDIObjectLocal', but I've already tried that for the other one.
    Really appreciate your time.
    Thanks
    -yogesh

  • JNDI lookup in Static initializer

    Hi,
    Is there a problem looking up home interfaces in a static initializer in
    WL6.1?
    I have a class X which runs in my application client. It has a static
    initializer that looks up a home interface. The call to Context.lookup()
    times out with weblogic.rjvm.PeerGoneException: No message was received for:
    '240' seconds.
    The strange thing is, if I force the static initializer to run myself (by
    instantiating X directly), then it runs ok. I only get the above problem if
    the VM causes it to run (by loading a class Y that references X).
    Also, this behaviour is only apparent in the client. In the app server, X
    behaves correctly. I'm passing in JNDI properties as system properties on
    the command line to the client.
    Any help appreciated.
    Cheers,
    Manish

    Check the class loader and thread dump during the place where it works and
    the one where it doesn't ... that could help track down why it works that
    way.
    Peace,
    Cameron Purdy
    Tangosol Inc.
    << Tangosol Server: How Weblogic applications are customized >>
    << Download now from http://www.tangosol.com/download.jsp >>
    "Manish Shah" <[email protected]> wrote in message
    news:[email protected]..
    Hi,
    Is there a problem looking up home interfaces in a static initializer in
    WL6.1?
    I have a class X which runs in my application client. It has a static
    initializer that looks up a home interface. The call to Context.lookup()
    times out with weblogic.rjvm.PeerGoneException: No message was receivedfor:
    '240' seconds.
    The strange thing is, if I force the static initializer to run myself (by
    instantiating X directly), then it runs ok. I only get the above problemif
    the VM causes it to run (by loading a class Y that references X).
    Also, this behaviour is only apparent in the client. In the app server, X
    behaves correctly. I'm passing in JNDI properties as system properties on
    the command line to the client.
    Any help appreciated.
    Cheers,
    Manish

Maybe you are looking for

  • Dhcp conection problem[solved]

    i changed my network connection from pppoe to dhcp.accordingly i make d necessary change in /etc/rc.conf file in its networking section. for ex...eth0="dhcp" INTERFACES=(eth0) routes=(!gateway) after all that my network is still out of reach.plz help

  • I accidentally washed my iPod nano. Is there any hope for it?

    I stuck my iPod nano in my pocket, and yes, forgot to take it out before my sister washed our clothes. Right after it got washed, I plugged it in to my computer, and it did turn on, just with a little distortion on the screen. It has been about a mon

  • What iOS Developer Program license should be used?

    What iOS Developer Program license should be used for the following scenario: our company wants to develop an app to be distributed among employees, our subsidiaries, our service/sales partners (distributors of our products) and finally end-users. Th

  • IPhoto turns regular folder into a iPhoto Library

    I'm not sure how this happened, but my regular documents folder got turned into an iPhoto Library. Now i can't use the finder to search through my regular excel, powerpoint and all other files. How do i convert it back? I have a few iPhoto libraries

  • SMTP server outgoin messages.

    When i send mail from my MacBook Pro, the server SMTP send me "Cannot send message using the server SMTP, the sender address [email protected] was rejected by server smtp/live.com.