Ejb-ref, ejb-link or JNDI lookup

If I have an application in which one EJB is using another EJB in the SAME application,
what is the best of way of accessing the other EJB?
Why would I use ejb-ref / ejb-link instead of just looking it up in the JNDI?
Just curious.
Thanks.
Dan

ejb-ref/ejb-link were introduced in the ejb spec to allow bean developers to
develop beans without any knowledge of the environment into which they would
be deployed. If you can live with hard coded jndi names then that is fine or
you can use the mechanism define below but using ejb-ref/ejb-link makes your
beans more reuseable and less dependent on the final environement.
If both the ejbs are in the same application I would recommend using ejb-ref
and ejb-link.
-- Anand
"Chad McDaniel" <[email protected]> wrote in message
news:[email protected]..
"Dan Baumbach" <[email protected]> writes:
If I have an application in which one EJB is using another EJB in the
SAME application,
what is the best of way of accessing the other EJB?
Why would I use ejb-ref / ejb-link instead of just looking it up in theJNDI?
>>
>
I believe that ejb-ref/link is not useful in most systems and causes
another level of complexity to maintain. Since EJBs are complex enough
I think that using the basic JNDI lookup is preferable. Also, this
frees you to move the beans to a remote server if you ever want to.
The simplest and most flexible technique, I believe, is to use a
utility class that handles all EJB lookups for you and use a simple
EJB and JNDI name mapping that this class can generate the JNDI name
with a simply manipulation of the bean name. If you ever change the
reference technique you will then only have one class to modify.
This is also a good place to cache home references.

Similar Messages

  • EJB Refs ( coded name and JNDI name )

    Hi
    I am just starting to develop EJBs . I can't get to work the EJB refs as expected . In a session bean I have a lookup for an Entity bean . Both beans are in separate JAR files , but in the same ear .
    The lookup from session bean to entity bean only works when
    the coded name in EJB ref is defined exactly the same as JNDI name for enity bean , also the name in lookup method must be the same in session bean .
    To my surprise , the JNDI name for the target EJB , defined in EJB ref for session bean , does not mater at all . Even if I change it to a non existant name , the bean lookup works .
    Theoritacally I understand that EJB ref is there to provide a mapping between the name of bean mentioned in code to the actual JNDI name of another bean , at the time of deployment .
    The above is happening in J2EE 1.4 envoirment .
    Please let me know , what am I doing here that is wrong .
    ( All examples and tutorials , usually give coded name same as JNDI name ) .
    Thanks
    Tarun

    Hi Tarun,
    The ejb-ref-name lives in a different namespace than the global JNDI names. Any names of ejb-refs, ejb-local-refs, resource-refs, etc. are scoped within a particular component's private namespace. All environment references are accessed via the java:comp/env namespace at runtime. So, if your ejb-ref-name(a.k.a "coded name") is ejb/foo in the deployment descriptor, you would access it from the code as follows :
    initialContext.lookup("java:comp/env/ejb/foo");
    This way, neither the standard deployment descriptor nor the code has any dependency on the global JNDI name. That's a good thing since the decision about which target EJB should be linked to is often not made until deployment time rather than development time. Furthermore, it means if you want to change the linking you can always do it without recompiling your code.
    As for the global JNDI names, the first thing to note is that they are completely vendor-specific. That's why they don't appear in the standard deployment descriptor. In the J2EE SDK, each EJB that exposes a Remote view is assigned a global JNDI name in sun-ejb-jar.xml. This JNDI name is assigned from the global namespace of the application server. There's nothing stopping it from also being "ejb/foo", but it refers to a different thing than the "ejb/foo" above.
    Now we have an ejb-ref called ejb/foo and an ejb whose JNDI name is ejb/foo, but we haven't linked the two. When it comes to linking, you have two choices:
    1. If the target ejb is in the same .ear as the client component, you can use the ejb-link mechanism. This allows you to specify the target ejb by referring to its ejb-name. Since ejb-name is only guaranteed to be unique within an ejb-jar, the syntax allows for you to give the uri of the containing ejb-jar, followed by #, followed by ejb-name.
    2. Alternatively, you can specify the global JNDI name of the target ejb using sun-ejb-jar.xml Note that this will work whether the target ejb is in the same .ear or not. However, it's the only option if the target ejb is in a different .ear. In this case, you would create an ejb-ref entry for the client component within the sun-ejb-jar.xml. e.g. :
    <ejb>
    <ejb-name>MyClientBean</ejb-name>
    <ejb-ref>
    <ejb-ref-name>ejb/foo</ejb-ref-name>
    <jndi-name>ejb/foo</jndi-name>
    </ejb-ref>
    </ejb>
    Again, it's just a coincidence that both names happen to be ejb/foo. They refer to different things.
    When you do a global lookup from your code, initialContext.lookup('ejb/foo"), it will work in some environments because you're simply bypassing the level of indirection provided by your component environment and going straight to the global namespace. This is non-portable and not a good idea, since you've now tightly coupled the name of the target ejb to your client component. That means if it changes you need to recompile your code. Hope this helps.
    --ken

  • Ejb-ref and JNDI lookup problem

    Hi,
    I use WLS6.1sp2. I created one EntityBean and SessionBean jar files. I tried to
    use session bean to refer entity bean, I failed. The details are as following:
    In EntityBean's weblogic-ejb-jar.xml, I set:
    <jndi-name>cabin.CabinHome</jndi-name>
    In sessionbean's ejb-jar.xml
    <ejb-ref>
    <ejb-ref-name>ejb/CabinHome</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <home>com.titan.cabin.CabinHome</home>
    <remote>com.titan.cabin.Cabin</remote>
    </ejb-ref>
    In sessionbean's weblogic-ejb-jar.xml
    <reference-descriptor>
         <ejb-reference-description>
              <ejb-ref-name>ejb/CabinHome</ejb-ref-name>
              <jndi-name>ejb/CabinHome</jndi-name>
         </ejb-reference-description>
    </reference-descriptor>
    At sessionbean's client, I use
    javax.naming.Context jndiContext = getInitialContext();
    Object obj = jndiContext.lookup("java:comp/env/ejb/CabinHome");
    When I run client file, I get the following error message:
    - with nested exception:
    [javax.naming.LinkException:  [Root exception is javax.naming.NameNotFoundException:
    Unable to resolve ejb.CabinHome Resolved: '' Unresolved:'ejb' ; remaining name
    'CabinHome']; Link Remaining Name: 'ejb/CabinHome']>
    javax.naming.LinkException: . Root exception is javax.naming.NameNotFoundException:
    Unable to resolve ejb.CabinHome Resolved: '' Unresolved:'ejb' ; remaining name
    'CabinHome'
         <<no stack trace available>>
    --------------- nested within: ------------------
    javax.ejb.EJBException
    - with nested exception:
    [javax.naming.LinkException:  [Root exception is javax.naming.NameNotFoundException:
    Unable to resolve ejb.CabinHome Resolved: '' Unresolved:'ejb' ; remaining name
    'CabinHome']; Link Remaining Name: 'ejb/CabinHome']
         at com.titan.travelagent.TravelAgentBean.listCabins(TravelAgentBean.java:45)
         at com.titan.travelagent.TravelAgentBean_a4c3ph_EOImpl.listCabins(TravelAgentBean_a4c3ph_EOImpl.java:37)
         at com.titan.travelagent.TravelAgentBean_a4c3ph_EOImpl_WLSkel.invoke(Unknown
    Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
         at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:93)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267)
         at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    ####<Feb 1, 2002 11:32:40 PM PST> <Info> <Management> <dj> <travelServer> <ExecuteThread:
    '14' for queue: 'default'> <system> <> <140009> <Configuration changes for domain
    saved to the repository.>
    Do you know what's wrong? how to fix this problem?
    Thanks in advance.
    DJ

    Slava,
    I took "cabin." out from weblogic-ejb-jar.xml, I got the same error.
    DJ
    "Slava Imeshev" <[email protected]> wrote:
    Hi DJ,
    I think you don't need "cabin." in weblogic-ejb-jar.xml :
    <jndi-name>cabin.CabinHome</jndi-name>
    Regards,
    Slava Imeshev
    "DJ" <[email protected]> wrote in message
    news:[email protected]...
    Hi,
    I use WLS6.1sp2. I created one EntityBean and SessionBean jar files.I
    tried to
    use session bean to refer entity bean, I failed. The details are asfollowing:
    In EntityBean's weblogic-ejb-jar.xml, I set:
    <jndi-name>cabin.CabinHome</jndi-name>
    In sessionbean's ejb-jar.xml
    <ejb-ref>
    <ejb-ref-name>ejb/CabinHome</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <home>com.titan.cabin.CabinHome</home>
    <remote>com.titan.cabin.Cabin</remote>
    </ejb-ref>
    In sessionbean's weblogic-ejb-jar.xml
    <reference-descriptor>
    <ejb-reference-description>
    <ejb-ref-name>ejb/CabinHome</ejb-ref-name>
    <jndi-name>ejb/CabinHome</jndi-name>
    </ejb-reference-description>
    </reference-descriptor>
    At sessionbean's client, I use
    javax.naming.Context jndiContext = getInitialContext();
    Object obj = jndiContext.lookup("java:comp/env/ejb/CabinHome");
    When I run client file, I get the following error message:
    - with nested exception:
    [javax.naming.LinkException:  [Root exception is
    javax.naming.NameNotFoundException:>> Unable to resolve ejb.CabinHome Resolved: '' Unresolved:'ejb' ; remaining>name>> 'CabinHome'; Link Remaining Name: 'ejb/CabinHome']>
    javax.naming.LinkException: . Root exception isjavax.naming.NameNotFoundException:
    Unable to resolve ejb.CabinHome Resolved: '' Unresolved:'ejb' ; remainingname
    'CabinHome'
    <<no stack trace available>>
    --------------- nested within: ------------------
    javax.ejb.EJBException
    - with nested exception:
    [javax.naming.LinkException:  [Root exception is
    javax.naming.NameNotFoundException:>> Unable to resolve ejb.CabinHome Resolved: '' Unresolved:'ejb' ; remaining>name>> 'CabinHome'; Link Remaining Name: 'ejb/CabinHome']
    atcom.titan.travelagent.TravelAgentBean.listCabins(TravelAgentBean.java:45)
    atcom.titan.travelagent.TravelAgentBean_a4c3ph_EOImpl.listCabins(TravelAgentBe
    an_a4c3ph_EOImpl.java:37)
    atcom.titan.travelagent.TravelAgentBean_a4c3ph_EOImpl_WLSkel.invoke(Unknown
    Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
    atweblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java
    :93)
    atweblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267)
    atweblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:2
    2)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    ####<Feb 1, 2002 11:32:40 PM PST> <Info> <Management> <dj> <travelServer><ExecuteThread:
    '14' for queue: 'default'> <system> <> <140009> <Configuration changesfor
    domain
    saved to the repository.>
    Do you know what's wrong? how to fix this problem?
    Thanks in advance.
    DJ

  • Client EJB JNDI lookup broken in OC4J 9.0.2?

    I have a client program that connects to an EJB in the application server and invokes methods on it. If it look up the EJB using the actual JNDI binding, it works fine. If I look it up in java:comp/env (and use the ejb-ref in application-client.xml and ejb-ref-mapping in orion-application-client.xml) the client program catches the following exception:
    caught : javax.naming.NameNotFoundException: No object bound for java:comp/env/ejb/logging/Logger
    javax.naming.NameNotFoundException: No object bound for java:comp/env/ejb/logging/Logger
    at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:116)
    at javax.naming.InitialContext.lookup(InitialContext.java:347)
    at com.mycompany.common.logging.ejb.test.LoggerEJBTest.main(LoggerEJBTest.java:37)
    Now, assuming I don't have any typos (and I'd be thrilled if someone pointed it out if that were the case), then it looks like this is a bug in OC4J 9.0.2: the ejb-ref and ejb-ref-mapping elements do not work. For the record, I am using the same ejb-ref and ejb-ref-mapping elements for a servlet's web.xml and orion-web.xml, respectively, without problems.
    Here are relevant file excerpts:
    LoggerEJBTest.java:
    String hostName = "localhost";
    String hostPort = "23791";
    String userName = "abc";
    String password = "def";
    String providerURL = "ormi://" + hostName + ":" + hostPort + "/ghi";
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.ApplicationClientInitialContextFactory");
    env.put(Context.PROVIDER_URL, providerURL);
    env.put(Context.SECURITY_PRINCIPAL, userName);
    env.put(Context.SECURITY_CREDENTIALS, password);
    System.out.println("create initial context");
    Context context = new InitialContext(env);
    System.out.println("get home object");
    //works when uncommented
    //Object homeObject = context.lookup("logging/Logger");
    //broken:
    Object homeObject = context.lookup("java:comp/env/ejb/logging/Logger");
    ejb-jar.xml:
    <?xml version="1.0"?>
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>
    <description>abc</description>
    <display-name>abc</display-name>
    <enterprise-beans>
    <session>
    <description>Logger Bean</description>
    <display-name>Logger</display-name>
    <ejb-name>Logger</ejb-name>
    <home>com.mycompany.common.logging.ejb.LoggerHome</home>
    <remote>com.mycompany.common.logging.ejb.Logger</remote>
    <ejb-class>com.mycompany.common.logging.ejb.LoggerBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    </session>
    </enterprise-beans>
    </ejb-jar>
    orion-ejb-jar.xml:
    <?xml version="1.0"?>
    <!DOCTYPE orion-ejb-jar PUBLIC "-//Evermind//DTD Enterprise JavaBeans 2.0 runtime//EN" "http://xmlns.oracle.com/ias/dtds/orion-ejb-jar.dtd">
    <orion-ejb-jar>
         <enterprise-beans>
              <session-deployment name="Logger" location="logging/Logger">
         </enterprise-beans>
    </orion-ejb-jar>
    application-client.xml:
    <?xml version="1.0"?>
    <!DOCTYPE application-client PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application Client 1.3//EN" "http://java.sun.com/dtd/application-client_1_3.dtd">
    <application-client>
         <display-name>logging test</display-name>
    <ejb-ref>
    <ejb-ref-name>ejb/logging/Logger</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>com.mycompany.common.logging.ejb.LoggerHome</home>
    <remote>com.mycompany.common.logging.ejb.Logger</remote>
    <ejb-link>Logger</ejb-link>
    </ejb-ref>
    </application-client>
    orion-application-client.xml:
    <?xml version="1.0"?>
    <!DOCTYPE orion-application-client PUBLIC "-//Evermind//DTD J2EE Application-client runtime 1.2//EN" "http://xmlns.oracle.com/ias/dtds/orion-application-client.dtd">
    <orion-application-client>
    <ejb-ref-mapping location="logging/Logger" name="ejb/logging/Logger" />
    </orion-application-client>

    As far as I know, the only way to lookup an EJB (deployed to
    OC4J) from a regular java class using the "ApplicationClientInitialContextFactory"
    class and the logical JNDI name is to include your regular java
    class (i.e. the client) in your application's EAR file (the file
    you use to deploy your application to OC4J).OK, but that sounds like a pretty silly constraint. Shouldn't the ApplicationClientInitialContextFactory know how to do the mapping using the application-client.xml and orion-application-client.xml settings? What does the OC4J server provide that makes this magically work?
    From the information you have supplied, it appears that you may
    not want to include your client (java) class in your EAR file.That is correct. It is an integration test program, not meant to be deployed into the application server.
    So now the question is, "Do you want to make your client part
    of your J2EE application, and include it in the application
    EAR file?"
    If you do, then you have made several mistakes which prevent
    you from doing that, but I don't want to explain further, since
    you may not want to do that, anyway!Not applicable. But on that topic, aside from being able to auto-start a client application within the OC4J JVM, are there any other reasons why I might want to deploy a client in that manner? I mean, honestly, these things are called "clients" and "servers" for a reason.
    Now if you have been reading other postings to this forum,
    and if you have read the documentation for OC4J, you would
    know that it requires J2SDK 1.3.1 only (not 1.4.0).I am well aware of the other postings on that topic. I am, however, counting on Oracle to live up to their promise to certify 1.4 with with the next update to OC4J:
    Limits of 10g
    That aside, I already consider OC4J 9.0.2 to be a broken product at this point anyway, so hacking it to use Java 1.4 doesn't bother me that much. OC4J 9.0.2 works about as well with Java 1.4 as with Java 1.3, assuming one replaces the tools.jar. The other major incompatibility is that Oracle SOAP breaks if a web service EJB home&remote interface is compiled with Java 1.4:
    http://forums.oracle.com/forums/message.jsp?id=936894
    Alas, we're using Apache SOAP 2.3 rather than the ass-backwards stuff in OC4J, anyways, so there's no problem.

  • Problems with JNDI lookup for java:comp/env/ejb

    Hi all,
    I'm using OC4J 9.0.3 and I have problems when looking up for the local
    EJB context.
    I have a SLSB which refers to another SLSB via a JNDI mapping like
    shown below. Both services are deployed within one EAR file.
    (snippets of ejb-jar.xml and orion-ejb-jar.xml)
    <ejb-jar>
    <enterprise-beans>
    <session>
    <ejb-name>ServiceABean</ejb-name>
    <home>com.coi.ServiceAHome</home>
    <remote>com.coi.ServiceA</remote>
    <ejb-class>com.coi.ServiceABean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    <ejb-ref>
    <ejb-ref-name>ejb/some/sub/packages/ServiceB</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>com.coi.ServiceBHome</home>
    <remote>com.coi.ServiceB</remote>
    </ejb-ref>
    </session>
    </enterprise-beans>
    </ejb-jar>
    <orion-ejb-jar>
    <enterprise-beans>
    <session-deployment location="global/some/sub/packages/ServiceA" name="ServiceABean">
    <ejb-ref-mapping name="ejb/some/sub/packages/ServiceB" location="global/some/sub/packages/ServiceB" />
    </session-deployment>
    </enterprise-beans>
    </orion-ejb-jar>
    The ApplicationInitialContextFactory will be used (prepared by the container),
    so the lookup for ServiceB within a method of ServiceA should work as follows:
    public class ServiceABean implements SessionBean
    public void someMethod()
    InitialContext con = new InitialContext(); // will be of class ApplicationContext
    Context localEjbContext = (Context)con.lookup( "java:comp/env/ejb" );
    ServiceBHome serviceBHome = (ServiceBHome) PortableRemoteObject.narrow(
    localEjbContext.lookup( "some/sub/packages/ServiceB" ),
    ServiceBHome.class );
    The problem is now, that the lookup for "java:comp/env/ejb" doesn't work
    and throws a NameNotFoundException.
    To figure out what's actually happening during lookup I debugged a little bit and
    tried a few things:
    1. A lookup for "java:comp" works fine. It returns an instance of class FlatMapContext
    which consists of a hash map which itself contains an entry for "env".
    2. So a lookup for "env" on that FlatMapContext also works and returns an instance of SubContext.
    3. A lookup for "ejb" using this SubContext causes a NameNotFoundException
    with message "java:comp/env/ejb not found".
    4. A lookup like con.lookup( "java:comp/env" ) throws also a NameNotFoundException
    with message "java:comp/env not found (not inside a J2EE module, for instance a Web-App,
    EJB, or Application-Client)".
    Does anyone know something about this?
    Regards
    --thomas

    Hi Debu,
    Great! 9.0.4 will be released in june/july this year, right? Sorry for my ironical reaction, but does that mean, that I don't have any chance to get my whole stuff running in 9.0.3? I cannot believe that. Isn't there a wordaround I could apply? A setting or whatever to substitute the daft FlatCtx by something else that is implemented according to the spec?
    Regards
    --thomas

  • Does mapping to JNDI for ejb-refs have a performance impact?

    Does mapping to JNDI names for ejb-refs have a performance impact for
    WLS6.1?
    In the ejb-jar.xml deployment descriptor, you can define an ejb reference as
    follows:
    <ejb-ref>
    <ejb-ref-name>ejb/AccountHomeRemote</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <home>com.package structure.AccountHomeRemote</home>
    <remote>com.package structure.AccountRemote</remote>
    <!-- <ejb-link>AccountBean</ejb-link>-->
    </ejb-ref>
    Now, optionally, you can use the ejb-link element - or - you can, in the
    weblogic DD, specify a JNDI name that the ejb-ref maps to.
    Using a JNDI name buys you some flexibility. If, for some reason, the jar is
    divided, you dont have to convert ejb-link's to JNDI names. The question is:
    Is there a performance cost in doing this?
    Cheers

    Hi Aashish,
    Thanks for your quick reply. it was helpful, but i am not using RFC's. Correct me if i am wrong, but i have explained the scenarios in detail below.
    Scenario 1. Synchronous
    1) PI Picks file from a common folder.
    2) PI does a data mapping and sends the data to ECC.
    3) ECC contains an inbound interface which receives the data and in which abap proxy code is written.
    4) The abap proxy code executes a function module and sends the response as an internal table back to PI.
    5) PI receives the response and places it in a text/csv file and places it back to another folder.
    I assume that the above would be possible only using BPM. What i understand is that in order for an interface to receive and send data, abstract mappings are to be used, and for this BPM is required. We do not have any conversions etc. its just a simple matter of receiving an internal table from ECC and creating a file to place in the folder.
    I also understand that BPM could have bottlenecks due to queue and cache issues, messages might be pending, or lost etc.
    Scenario 2. Asynchronous
    1) PI Picks file from a common folder.
    2) PI does a data mapping and sends the data to ECC.
    3) ECC contains an inbound interface which receives the data and in which abap proxy code is written.
    4) ABAP Proxy code executes the same function module and calls a seperate outbound interface and passes the values to it. This would be used in sending the response back.
    5)  PI receives the response from the second interface and places it in a text/csv file and places it back to another folder.
    I would like to know which would be the better approach. Documentation/references to support your claims would be much appreciated.
    Cheers,
    Mz

  • Error Deploying Application - ejb-link or jndi-name

    I get the following error when depoying my J2EE application. Can anyone help ?
    Deployment failed on Server MServer1
    weblogic.management.DeploymentException:
    Exception:weblogic.management.ApplicationException: activate failed for Supplier
         Module: Supplier     Error: weblogic.management.DeploymentException: Could not setup environment - with nested exception:
    [weblogic.deployment.EnvironmentException: ejb-ref ejb/ReceiverSes requires an ejb-link or jndi-name]
    weblogic.deployment.EnvironmentException: ejb-ref ejb/ReceiverSes requires an ejb-link or jndi-name
         at weblogic.deployment.EnvironmentBuilder.addEJBReferences(EnvironmentBuilder.java:473)
         at weblogic.servlet.internal.CompEnv.init(CompEnv.java:123)
         at weblogic.servlet.internal.WebAppServletContext.activate(WebAppServletContext.java:5616)
         at weblogic.servlet.internal.WebAppServletContext.setActive(WebAppServletContext.java:5588)
         at weblogic.servlet.internal.WebAppModule.activate(WebAppModule.java:841)
         at weblogic.j2ee.J2EEApplicationContainer.activateModule(J2EEApplicationContainer.java:3127)
         at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2081)
         at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2062)
         at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.activateContainer(SlaveDeployer.java:2592)
         at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.doCommit(SlaveDeployer.java:2515)
         at weblogic.management.deploy.slave.SlaveDeployer$Task.commit(SlaveDeployer.java:2317)
         at weblogic.management.deploy.slave.SlaveDeployer$Task.checkAutoCommit(SlaveDeployer.java:2399)
         at weblogic.management.deploy.slave.SlaveDeployer$Task.prepare(SlaveDeployer.java:2311)
         at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2479)
         at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:798)
         at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:507)
         at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:465)
         at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    --------------- nested within: ------------------
    weblogic.management.DeploymentException: Could not setup environment - with nested exception:
    [weblogic.deployment.EnvironmentException: ejb-ref ejb/ReceiverSes requires an ejb-link or jndi-name]
         at weblogic.servlet.internal.CompEnv.init(CompEnv.java:133)
         at weblogic.servlet.internal.WebAppServletContext.activate(WebAppServletContext.java:5616)
         at weblogic.servlet.internal.WebAppServletContext.setActive(WebAppServletContext.java:5588)
         at weblogic.servlet.internal.WebAppModule.activate(WebAppModule.java:841)
         at weblogic.j2ee.J2EEApplicationContainer.activateModule(J2EEApplicationContainer.java:3127)
         at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2081)
         at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2062)
         at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.activateContainer(SlaveDeployer.java:2592)
         at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.doCommit(SlaveDeployer.java:2515)
         at weblogic.management.deploy.slave.SlaveDeployer$Task.commit(SlaveDeployer.java:2317)
         at weblogic.management.deploy.slave.SlaveDeployer$Task.checkAutoCommit(SlaveDeployer.java:2399)
         at weblogic.management.deploy.slave.SlaveDeployer$Task.prepare(SlaveDeployer.java:2311)
         at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2479)
         at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:798)
         at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:507)
         at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:465)
         at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)

    I found the issue. The below entries were missing from weblogic.xml
    <ejb-reference-description>
    <ejb-ref-name>ejb/PipelineExecutor</ejb-ref-name>
    <jndi-name>${APPNAME}.BEA_personalization.PipelineExecutor</jndi-name>
    </ejb-reference-description>
    "rohit" <[email protected]> wrote:
    >
    Does anyone knows why we would get the below error. I verified the web.xml
    and
    it seems to be right. Any help appreciated. Rohit
    <Jul 1, 2003 5:08:12 PM PDT> <Error> <Deployer> <149231> <The slave deployer
    was
    unable to set the activation state to true for the application portalApp
    weblogic.management.ApplicationException: activate failed forceoportal
    Module Name: ceoportal, Error: weblogic.j2ee.DeploymentException: Could
    not setu
    p environment - with nested exception:
    [weblogic.deployment.EnvironmentException: ejb-ref ejb/PipelineExecutor
    requires
    an ejb-link or jndi-name]
    at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContai
    ner.java:1093)
    at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContai
    ner.java:1022)
    at weblogic.management.deploy.slave.SlaveDeployer.setActivationStateForA
    llApplications(SlaveDeployer.java:617)
    at weblogic.management.deploy.slave.SlaveDeployer.resume(SlaveDeployer.j
    ava:376)
    at weblogic.management.deploy.DeploymentManagerServerLifeCycleImpl.resum
    e(DeploymentManagerServerLifeCycleImpl.java:235)
    at weblogic.t3.srvr.ServerLifeCycleList.resume(ServerLifeCycleList.java:
    65)
    at weblogic.t3.srvr.T3Srvr.resume(T3Srvr.java:832)
    at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:300)
    at weblogic.Server.main(Server.java:32)

  • ejb-ref problems in WLE 5.0.1

    Platform : WLE 5.0.1 on Solaris 2.6
    I'm having a problem with EJB deployment in WLE 5.1. The ejb-spec
    specifies that you must add <ejb-ref> entries for each entity or
    session bean in your ejb-jar.xml that references another bean. So, in
    this case both A and B reference C in the code.
    <ejb-jar>
    <enterprise-beans>
    <entity>
    <ejb-name>C</ejb-name>
    <home>com.xxx.CHome</home>
    <remote>com.xxx.C</remote>
    <ejb-class>com.xxx.CBean</ejb-class>
    </entity>
    <session>
    <ejb-name>B</ejb-name>
    <home>com.xxx.BHome</home>
    <remote>com.xxx.B</remote>
    <ejb-class>com.xxx.BBean</ejb-class>
    <ejb-ref>
    <ejb-ref-name>ejb/CBean</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <home>com.xxx.CHome</home>
    <remote>com.xxx.C</remote>
    <ejb-link>C</ejb-link>
    </ejb-ref>
    </session>
    <session>
    <ejb-name>A</ejb-name>
    <home>com.xxx.AHome</home>
    <remote>com.xxx.A</remote>
    <ejb-class>com.xxx.ABean</ejb-class>
    <ejb-ref>
    <ejb-ref-name>ejb/CBean</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <home>com.xxx.CHome</home>
    <remote>com.xxx.C</remote>
    <ejb-link>C</ejb-link>
    </ejb-ref>
    </session>
    </enterprise-beans>
    <ejb-jar>
    In this case, upon starting the JavaXAServer I get a
    javax.naming.NameAlreadyBoundException thrown. The EJB spec
    specifically states that I should be able to refer to C with the same
    name from A and B. Is this a bug?
    I can get around this by changing the name of the second reference to
    something like "ejb/CBean2".
    Additionally, I get a NameNotFoundException when looking up the
    reference from within A or B as follows :-
    Context ic = new InitialContext();
    Object ob = ic.lookup("java:comp/env/ejb/CBean");
    The only way I can work around this, is to construct the
    InitialContext using the 'client' view, passing
    com.beasys.jndi.WLEInitialContextFactory as the factory name, passing
    the ISL host/port in the PROVIDER_URL and then using the JNDI names
    for the lookup.
    What's going wrong?
    TIA

    this seems to be a WLE 5.0.1 bug
    Developer wrote in message <[email protected]>...
    Platform : WLE 5.0.1 on Solaris 2.6
    I'm having a problem with EJB deployment in WLE 5.1. The ejb-spec
    specifies that you must add <ejb-ref> entries for each entity or
    session bean in your ejb-jar.xml that references another bean. So, in
    this case both A and B reference C in the code.
    <ejb-jar>
    <enterprise-beans>
    <entity>
    <ejb-name>C</ejb-name>
    <home>com.xxx.CHome</home>
    <remote>com.xxx.C</remote>
    <ejb-class>com.xxx.CBean</ejb-class>
    </entity>
    <session>
    <ejb-name>B</ejb-name>
    <home>com.xxx.BHome</home>
    <remote>com.xxx.B</remote>
    <ejb-class>com.xxx.BBean</ejb-class>
    <ejb-ref>
    <ejb-ref-name>ejb/CBean</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <home>com.xxx.CHome</home>
    <remote>com.xxx.C</remote>
    <ejb-link>C</ejb-link>
    </ejb-ref>
    </session>
    <session>
    <ejb-name>A</ejb-name>
    <home>com.xxx.AHome</home>
    <remote>com.xxx.A</remote>
    <ejb-class>com.xxx.ABean</ejb-class>
    <ejb-ref>
    <ejb-ref-name>ejb/CBean</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <home>com.xxx.CHome</home>
    <remote>com.xxx.C</remote>
    <ejb-link>C</ejb-link>
    </ejb-ref>
    </session>
    </enterprise-beans>
    <ejb-jar>
    In this case, upon starting the JavaXAServer I get a
    javax.naming.NameAlreadyBoundException thrown. The EJB spec
    specifically states that I should be able to refer to C with the same
    name from A and B. Is this a bug?
    I can get around this by changing the name of the second reference to
    something like "ejb/CBean2".
    Additionally, I get a NameNotFoundException when looking up the
    reference from within A or B as follows :-
    Context ic = new InitialContext();
    Object ob = ic.lookup("java:comp/env/ejb/CBean");
    The only way I can work around this, is to construct the
    InitialContext using the 'client' view, passing
    com.beasys.jndi.WLEInitialContextFactory as the factory name, passing
    the ISL host/port in the PROVIDER_URL and then using the JNDI names
    for the lookup.
    What's going wrong?
    TIA

  • ejb-ref related question

    I've developed a stateful session ejb. It has the following entry in
    "ejb-jar.xml":
    <session>
    <display-name>L2CustomerBroker</display-name>
    <ejb-name>L2CustomerBroker</ejb-name>
    <home>com.brighthaul.ste.server.brokers.L2CustomerBrokerHome</home>
    <remote>com.brighthaul.ste.server.brokers.L2CustomerBroker</remote>
    <ejb-class>com.brighthaul.ste.server.brokers.L2CustomerBrokerBean</ejb-class
    >
    <session-type>Stateful</session-type>
    <transaction-type>Container</transaction-type>
    <ejb-ref>
    <ejb-ref-name>com.brighthaul.ste.server.brokers.L2CustomerBrokerHome</ejb-re
    f-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>com.brighthaul.ste.server.brokers.L2CustomerBrokerHome</home>
    <remote>com.brighthaul.ste.server.brokers.L2CustomerBroker</remote>
    <ejb-link>L2CustomerBroker</ejb-link>
    </ejb-ref>
    </session>
    Its matching entry in "weblogic-ejb-jar.xml" is:
    <weblogic-enterprise-bean>
    <ejb-name>L2CustomerBroker</ejb-name>
    <stateful-session-descriptor>
    <stateful-session-clustering/>
    <allow-concurrent-calls>true</allow-concurrent-calls> <!-- Is this
    right?!! -->
    </stateful-session-descriptor>
    <transaction-descriptor/>
    <reference-descriptor>
    <ejb-reference-description>
    <ejb-ref-name>com.brighthaul.ste.server.brokers.L2CustomerBrokerHome</ejb-re
    f-name>
    <jndi-name>L2CustomerBroker</jndi-name>
    </ejb-reference-description>
    </reference-descriptor>
    <jndi-name>L2CustomerBroker</jndi-name>
    </weblogic-enterprise-bean>
    When a simple test application tries to locate the L2CustomerBroker bean
    via:
    context.lookup("com.brighthaul.ste.server.brokers.L2CustomerBroker");
    a NamingException is thrown:
    javax.naming.NameNotFoundException: Unable to resolve
    'com.brighthaul.ste.server.brokers.L2CustomerBrokerHome' Resolved: ''
    Unresolved:'com' ; remaining name
    'com.brighthaul.ste.server.brokers.L2CustomerBroker'
    at
    weblogic.rmi.internal.BasicOutboundRequest.sendReceive(BasicOutboundRequest.
    java:109)
    at
    weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java
    :263)
    at
    weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java
    :230)
    at weblogic.jndi.internal.ServerNamingNode_WLStub.lookup(Unknown
    Source)
    at
    weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:337)
    at
    weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:332)
    at javax.naming.InitialContext.lookup(InitialContext.java:347)
    at
    com.brighthaul.ste.common.util.EJBHomeFactory.lookUpHome(EJBHomeFactory.java
    :77)
    at
    com.brighthaul.ste.server.brokers.DeleteMe.main(DeleteMe.java:15)
    Exception in thread "main"
    What am I doing wrong?
    I'm able to locate the home interface via the "usual" way (looking up
    "L2CustomerBroker"). Does this form of lookup can be applied from another VM (standalone application)?
    Why do I have to declare the <ejb-ref> inside a <session> element?

    "One suggestion though, use simple names for EJB references.. something like "CustomerBroker""
    Since the consumer of the JNDI lookup must narrow the object to a known type, the simple name adds an unnecessary layer of indirection, and a subsequent maintenace hassle. The most straight-forward naming system is to use the fully-qualified name of the home interface, as the original poster has done.

  • Ejb-ref element references to other beans

    Hello,
    Can anyone tell me what ejb references to other beans are for? (ejb-ref element).
    I am completely missing the point and would be grateful if someone could tell me why I should have the overhead of writing this:
    <ejb-ref>
    <ejb-ref-name>ejb/waUserMgr</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>com.reuters.pds.webapp.bl.user.api.WAUserMgrHome</home>
    <remote>com.reuters.pds.webapp.bl.user.api.WAUserMgr</remote>
    <ejb-link>WAUserMgrEJB</ejb-link>
    </ejb-ref>
    Any comment welcome..
    Julien.

    Hi,
    The <ejb-ref> element is optional, you could use the actual JNDI name instead.
    The advantage with using <ejb-ref> is that, if you deploy the bean on another server, probably with a different JNDI name,
    your code can still continue using the same name as defined by <ejb-ref-name>.
    Internally, the <ejb-ref-name> will be mapped to the actual JNDI location, maybe using symbolic links.

  • Ejb-ref in the deployment descriptor

    Could someone help me on how to configure an ejb-reference in the 3 xml
    files.
    ejb-jar.xml, weblogic-ejb-jar.xml and web.xml
    These are the entries for my application, but I get some exception. Can
    somebody help me pls?
    ejb-jar.xml
    <enterprise-beans>
    <session id="Abcd">
    <small-icon></small-icon>
    <ejb-name>ABCD</ejb-name>
    <home>AbcdHome</home>
    <remote>AbcdRemote</remote>
    <ejb-class>AbcdBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    </session>
    </enterprise-beans>
    web.xml contains the foll,
    <ejb-ref>
    <ejb-ref-name>ejb/abcd</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>AbcdHome</home>
    <remote>AbcdRemote</remote>
    <ejb-link>ABCD</ejb-link>
    </ejb-ref>
    weblogic.ejb-jar.xml contains,
    <weblogic-enterprise-bean>
    <ejb-name>ABCD</ejb-name>
    <caching-descriptor>
    <max-beans-in-free-pool>100</max-beans-in-free-pool>
    </caching-descriptor>
    <reference-descriptor>
    <ejb-reference-description>
    <ejb-ref-name>ejb/abcd</ejb-ref-name>
    <jndi-name>ejb/ABCD</jndi-name>
    </ejb-reference-description>
    </reference-descriptor>
    </weblogic-enterprise-bean>
    But when i run the application, I get the foll exception,
    In EJB RemotePlatform, a session or entity bean that has a remote home m
    ust be given a JNDI name in the weblogic-ejb-jar.xml descriptor file.
    at weblogic.ejb20.compliance.EJBComplianceChecker.check(EJBComplianceChe
    cker.java:256)
    at weblogic.ejb20.compliance.EJBComplianceChecker.checkDeploymentInfo(EJ
    BComplianceChecker.java:220)
    at weblogic.ejb20.ejbc.EJBCompiler.complianceCheckJar(EJBCompiler.java:4
    52)
    at weblogic.ejb20.ejbc.EJBCompiler.checkCompliance(EJBCompiler.java:409)
    at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:202)
    at weblogic.ejb20.deployer.Deployer.runEJBC(Deployer.java:296)
    at weblogic.ejb20.deployer.Deployer.compileEJB(Deployer.java:676)
    at weblogic.ejb20.deployer.Deployer.deploy(Deployer.java:843)
    at weblogic.j2ee.EJBComponent.deploy(EJBComponent.java:30)
    at weblogic.j2ee.Application.addComponent(Application.java:160)
    at weblogic.j2ee.J2EEService.addDeployment(J2EEService.java:117)
    at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
    oymentTarget.java:329)
    at weblogic.management.mbeans.custom.DeploymentTarget.addDeployments(Dep
    loymentTarget.java:279)
    at weblogic.management.mbeans.custom.DeploymentTarget.updateServerDeploy
    ments(DeploymentTarget.java:233)
    at weblogic.management.mbeans.custom.DeploymentTarget.updateDeployments(
    DeploymentTarget.java:193)
    at java.lang.reflect.Method.invoke(Native Method)
    at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
    eanImpl.java:606)
    at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
    .java:590)
    at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
    ionMBeanImpl.java:350)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    55)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    23)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:444)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:185)
    at $Proxy34.updateDeployments(Unknown Source)
    at weblogic.management.configuration.ServerMBean_CachingStub.updateDeplo
    yments(ServerMBean_CachingStub.java:2706)
    at weblogic.management.mbeans.custom.ApplicationManager.startConfigManag
    er(ApplicationManager.java:360)
    at weblogic.management.mbeans.custom.ApplicationManager.start(Applicatio
    nManager.java:152)
    at java.lang.reflect.Method.invoke(Native Method)
    at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
    eanImpl.java:606)
    at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
    .java:590)
    at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
    ionMBeanImpl.java:350)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    55)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    23)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:444)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:185)
    at $Proxy48.start(Unknown Source)
    at weblogic.management.configuration.ApplicationManagerMBean_CachingStub
    .start(ApplicationManagerMBean_CachingStub.java:479)
    at weblogic.management.Admin.startApplicationManager(Admin.java:1138)
    at weblogic.management.Admin.finish(Admin.java:561)
    at weblogic.t3.srvr.T3Srvr.start(T3Srvr.java:501)
    at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:198)
    at weblogic.Server.main(Server.java:35)
    >
    <Jan 31, 2002 3:56:18 PM PST> <Error> <J2EE> <Error deploying application
    Defaul
    tVoiceApp: Could not load DefaultVoiceApp>
    java.lang.reflect.UndeclaredThrowableException:
    weblogic.xml.dom.DOMProcessingEx
    ception: Could not setup environment for EJBReference or ResourceReference.
    Can
    not find WEB-INF/weblogic.xml in the Web application.
    at weblogic.servlet.internal.WebAppServletContext.initFromDescriptors(We
    bAppServletContext.java:1509)
    at weblogic.servlet.internal.WebAppServletContext.init(WebAppServletCont
    ext.java:871)
    at weblogic.servlet.internal.WebAppServletContext.<init>(WebAppServletCo
    ntext.java:806)
    at weblogic.servlet.internal.HttpServer.loadWebApp(HttpServer.java:413)
    at weblogic.j2ee.WebAppComponent.deploy(WebAppComponent.java:74)
    at weblogic.j2ee.Application.addComponent(Application.java:160)
    at weblogic.j2ee.J2EEService.addDeployment(J2EEService.java:117)
    at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
    oymentTarget.java:329)
    at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
    oymentTarget.java:144)
    at weblogic.management.mbeans.custom.WebServer.addWebDeployment(WebServe
    r.java:76)
    at java.lang.reflect.Method.invoke(Native Method)
    at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
    eanImpl.java:606)
    at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
    .java:590)
    at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
    ionMBeanImpl.java:350)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    55)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    23)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:444)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:185)
    at $Proxy35.addWebDeployment(Unknown Source)
    at weblogic.management.configuration.WebServerMBean_CachingStub.addWebDe
    ployment(WebServerMBean_CachingStub.java:1093)
    at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
    oymentTarget.java:315)
    at weblogic.management.mbeans.custom.DeploymentTarget.addDeployments(Dep
    loymentTarget.java:279)
    at weblogic.management.mbeans.custom.DeploymentTarget.updateServerDeploy
    ments(DeploymentTarget.java:233)
    at weblogic.management.mbeans.custom.DeploymentTarget.updateDeployments(
    DeploymentTarget.java:193)
    at java.lang.reflect.Method.invoke(Native Method)
    at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
    eanImpl.java:606)
    at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
    .java:590)
    at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
    ionMBeanImpl.java:350)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    55)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    23)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:444)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:185)
    at $Proxy34.updateDeployments(Unknown Source)
    at weblogic.management.configuration.ServerMBean_CachingStub.updateDeplo
    yments(ServerMBean_CachingStub.java:2706)
    at weblogic.management.mbeans.custom.ApplicationManager.startConfigManag
    er(ApplicationManager.java:360)
    at weblogic.management.mbeans.custom.ApplicationManager.start(Applicatio
    nManager.java:152)
    at java.lang.reflect.Method.invoke(Native Method)
    at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
    eanImpl.java:606)
    at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
    .java:590)
    at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
    ionMBeanImpl.java:350)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    55)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    23)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:444)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:185)
    at $Proxy48.start(Unknown Source)
    at weblogic.management.configuration.ApplicationManagerMBean_CachingStub
    .start(ApplicationManagerMBean_CachingStub.java:479)
    at weblogic.management.Admin.startApplicationManager(Admin.java:1138)
    at weblogic.management.Admin.finish(Admin.java:561)
    at weblogic.t3.srvr.T3Srvr.start(T3Srvr.java:501)
    at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:198)
    at weblogic.Server.main(Server.java:35)
    --------------- nested within: ------------------
    weblogic.j2ee.DeploymentException: Could not load DefaultVoiceApp - with
    nested
    exception:
    [weblogic.xml.dom.DOMProcessingException: Could not setup environment for
    EJBRef
    erence or ResourceReference. Cannot find WEB-INF/weblogic.xml in the Web
    applic
    ation.]
    at weblogic.servlet.internal.HttpServer.loadWebApp(HttpServer.java:416)
    at weblogic.j2ee.WebAppComponent.deploy(WebAppComponent.java:74)
    at weblogic.j2ee.Application.addComponent(Application.java:160)
    at weblogic.j2ee.J2EEService.addDeployment(J2EEService.java:117)
    at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
    oymentTarget.java:329)
    at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
    oymentTarget.java:144)
    at weblogic.management.mbeans.custom.WebServer.addWebDeployment(WebServe
    r.java:76)
    at java.lang.reflect.Method.invoke(Native Method)
    at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
    eanImpl.java:606)
    at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
    .java:590)
    at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
    ionMBeanImpl.java:350)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    55)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    23)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:444)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:185)
    at $Proxy35.addWebDeployment(Unknown Source)
    at weblogic.management.configuration.WebServerMBean_CachingStub.addWebDe
    ployment(WebServerMBean_CachingStub.java:1093)
    at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
    oymentTarget.java:315)
    at weblogic.management.mbeans.custom.DeploymentTarget.addDeployments(Dep
    loymentTarget.java:279)
    at weblogic.management.mbeans.custom.DeploymentTarget.updateServerDeploy
    ments(DeploymentTarget.java:233)
    at weblogic.management.mbeans.custom.DeploymentTarget.updateDeployments(
    DeploymentTarget.java:193)
    at java.lang.reflect.Method.invoke(Native Method)
    at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
    eanImpl.java:606)
    at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
    .java:590)
    at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
    ionMBeanImpl.java:350)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    55)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    23)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:444)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:185)
    at $Proxy34.updateDeployments(Unknown Source)
    at weblogic.management.configuration.ServerMBean_CachingStub.updateDeplo
    yments(ServerMBean_CachingStub.java:2706)
    at weblogic.management.mbeans.custom.ApplicationManager.startConfigManag
    er(ApplicationManager.java:360)
    at weblogic.management.mbeans.custom.ApplicationManager.start(Applicatio
    nManager.java:152)
    at java.lang.reflect.Method.invoke(Native Method)
    at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
    eanImpl.java:606)
    at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
    .java:590)
    at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
    ionMBeanImpl.java:350)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    55)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    23)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:444)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:185)
    at $Proxy48.start(Unknown Source)
    at weblogic.management.configuration.ApplicationManagerMBean_CachingStub
    .start(ApplicationManagerMBean_CachingStub.java:479)
    at weblogic.management.Admin.startApplicationManager(Admin.java:1138)
    at weblogic.management.Admin.finish(Admin.java:561)
    at weblogic.t3.srvr.T3Srvr.start(T3Srvr.java:501)
    at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:198)
    at weblogic.Server.main(Server.java:35)
    Can someone help me on what to set in sequence please. Any help would highly
    be appreciated.
    Thanks in advance.
    Regards
    Aru

    Aaru,
    Verify the document structure @
    http://e-docs.bea.com/wls/docs61/ejb/reference.html#1026457
    jndi-name is of the ejb is missing in your WEJ.xml
    and the jndi-name defined under
    <reference-descriptor><ejb-reference-description>
    </reference-descriptor></ejb-reference-description>
    is the reference jndi-name(referenced by this bean)
    For more info refere
    the weblogic 6.x dtd
    http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.dtd
    Venki..
    Aru wrote:
    As per the doc that you referred, the doc too says that the jndi-name should
    be within the ejb-reference-description which in turn is inside the
    reference-descriptor. I don't get what you tried to say. Am I missing
    anything? Could you please make sure that for me.
    Just with curiosity I even tried your suggestion but it gives me the
    exception as expected,
    The XML parser encountered an error in your deployment descriptor. Please
    ensure
    that your deployment descriptor corresponds to the format in the DTD. The
    error
    was:
    org.xml.sax.SAXParseException: The content of element type
    "ejb-reference-descr
    iption" is incomplete, it must match "(ejb-ref-name,jndi-name)".
    "Venki Seshaadri" <[email protected]> wrote in message
    news:[email protected]...
    Aaru,
    <jndi-name> should be outside <reference-descriptor>
    refer to http://e-docs.bea.com/wls/docs61/ejb/reference.html#1026457
    <weblogic-enterprise-bean>
    <reference-descriptor>...</reference-descriptor>
    <jndi-name>ejb/ABCD</jndi-name>
    </weblogic-enterprise-bean>
    Hope this helps,
    Venki
    [email protected]
    Aru wrote:
    FYI, I am using Weblogic 6.1
    "Aru" <[email protected]> wrote in message
    news:[email protected]...
    Could someone help me on how to configure an ejb-reference in the 3 xml
    files.
    ejb-jar.xml, weblogic-ejb-jar.xml and web.xml
    These are the entries for my application, but I get some exception. Can
    somebody help me pls?
    ejb-jar.xml
    <enterprise-beans>
    <session id="Abcd">
    <small-icon></small-icon>
    <ejb-name>ABCD</ejb-name>
    <home>AbcdHome</home>
    <remote>AbcdRemote</remote>
    <ejb-class>AbcdBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    </session>
    </enterprise-beans>
    web.xml contains the foll,
    <ejb-ref>
    <ejb-ref-name>ejb/abcd</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>AbcdHome</home>
    <remote>AbcdRemote</remote>
    <ejb-link>ABCD</ejb-link>
    </ejb-ref>
    weblogic.ejb-jar.xml contains,
    <weblogic-enterprise-bean>
    <ejb-name>ABCD</ejb-name>
    <caching-descriptor>
    <max-beans-in-free-pool>100</max-beans-in-free-pool>
    </caching-descriptor>
    <reference-descriptor>
    <ejb-reference-description>
    <ejb-ref-name>ejb/abcd</ejb-ref-name>
    <jndi-name>ejb/ABCD</jndi-name>
    </ejb-reference-description>
    </reference-descriptor>
    </weblogic-enterprise-bean>
    But when i run the application, I get the foll exception,
    In EJB RemotePlatform, a session or entity bean that has a remote home m
    ust be given a JNDI name in the weblogic-ejb-jar.xml descriptor file.
    at weblogic.ejb20.compliance.EJBComplianceChecker.check(EJBComplianceChe
    cker.java:256)
    at weblogic.ejb20.compliance.EJBComplianceChecker.checkDeploymentInfo(EJ
    BComplianceChecker.java:220)
    at weblogic.ejb20.ejbc.EJBCompiler.complianceCheckJar(EJBCompiler.java:4
    52)
    at weblogic.ejb20.ejbc.EJBCompiler.checkCompliance(EJBCompiler.java:409)
    at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:202)
    at weblogic.ejb20.deployer.Deployer.runEJBC(Deployer.java:296)
    at weblogic.ejb20.deployer.Deployer.compileEJB(Deployer.java:676)
    at weblogic.ejb20.deployer.Deployer.deploy(Deployer.java:843)
    at weblogic.j2ee.EJBComponent.deploy(EJBComponent.java:30)
    at weblogic.j2ee.Application.addComponent(Application.java:160)
    at weblogic.j2ee.J2EEService.addDeployment(J2EEService.java:117)
    at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
    oymentTarget.java:329)
    at weblogic.management.mbeans.custom.DeploymentTarget.addDeployments(Dep
    loymentTarget.java:279)
    at weblogic.management.mbeans.custom.DeploymentTarget.updateServerDeploy
    ments(DeploymentTarget.java:233)
    at weblogic.management.mbeans.custom.DeploymentTarget.updateDeployments(
    DeploymentTarget.java:193)
    at java.lang.reflect.Method.invoke(Native Method)
    at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
    eanImpl.java:606)
    at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
    .java:590)
    at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
    ionMBeanImpl.java:350)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    55)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    23)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:444)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:185)
    at $Proxy34.updateDeployments(Unknown Source)
    at weblogic.management.configuration.ServerMBean_CachingStub.updateDeplo
    yments(ServerMBean_CachingStub.java:2706)
    at weblogic.management.mbeans.custom.ApplicationManager.startConfigManag
    er(ApplicationManager.java:360)
    at weblogic.management.mbeans.custom.ApplicationManager.start(Applicatio
    nManager.java:152)
    at java.lang.reflect.Method.invoke(Native Method)
    at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
    eanImpl.java:606)
    at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
    .java:590)
    at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
    ionMBeanImpl.java:350)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    55)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    23)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:444)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:185)
    at $Proxy48.start(Unknown Source)
    at weblogic.management.configuration.ApplicationManagerMBean_CachingStub
    .start(ApplicationManagerMBean_CachingStub.java:479)
    at weblogic.management.Admin.startApplicationManager(Admin.java:1138)
    at weblogic.management.Admin.finish(Admin.java:561)
    at weblogic.t3.srvr.T3Srvr.start(T3Srvr.java:501)
    at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:198)
    at weblogic.Server.main(Server.java:35)
    <Jan 31, 2002 3:56:18 PM PST> <Error> <J2EE> <Error deploying
    application
    Defaul
    tVoiceApp: Could not load DefaultVoiceApp>
    java.lang.reflect.UndeclaredThrowableException:
    weblogic.xml.dom.DOMProcessingEx
    ception: Could not setup environment for EJBReference or
    ResourceReference.
    Can
    not find WEB-INF/weblogic.xml in the Web application.
    at weblogic.servlet.internal.WebAppServletContext.initFromDescriptors(We
    bAppServletContext.java:1509)
    at weblogic.servlet.internal.WebAppServletContext.init(WebAppServletCont
    ext.java:871)
    at weblogic.servlet.internal.WebAppServletContext.<init>(WebAppServletCo
    ntext.java:806)
    at weblogic.servlet.internal.HttpServer.loadWebApp(HttpServer.java:413)
    at weblogic.j2ee.WebAppComponent.deploy(WebAppComponent.java:74)
    at weblogic.j2ee.Application.addComponent(Application.java:160)
    at weblogic.j2ee.J2EEService.addDeployment(J2EEService.java:117)
    at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
    oymentTarget.java:329)
    at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
    oymentTarget.java:144)
    at weblogic.management.mbeans.custom.WebServer.addWebDeployment(WebServe
    r.java:76)
    at java.lang.reflect.Method.invoke(Native Method)
    at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
    eanImpl.java:606)
    at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
    .java:590)
    at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
    ionMBeanImpl.java:350)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    55)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    23)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:444)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:185)
    at $Proxy35.addWebDeployment(Unknown Source)
    at weblogic.management.configuration.WebServerMBean_CachingStub.addWebDe
    ployment(WebServerMBean_CachingStub.java:1093)
    at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
    oymentTarget.java:315)
    at weblogic.management.mbeans.custom.DeploymentTarget.addDeployments(Dep
    loymentTarget.java:279)
    at weblogic.management.mbeans.custom.DeploymentTarget.updateServerDeploy
    ments(DeploymentTarget.java:233)
    at weblogic.management.mbeans.custom.DeploymentTarget.updateDeployments(
    DeploymentTarget.java:193)
    at java.lang.reflect.Method.invoke(Native Method)
    at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
    eanImpl.java:606)
    at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
    .java:590)
    at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
    ionMBeanImpl.java:350)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    55)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    23)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:444)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:185)
    at $Proxy34.updateDeployments(Unknown Source)
    at weblogic.management.configuration.ServerMBean_CachingStub.updateDeplo
    yments(ServerMBean_CachingStub.java:2706)
    at weblogic.management.mbeans.custom.ApplicationManager.startConfigManag
    er(ApplicationManager.java:360)
    at weblogic.management.mbeans.custom.ApplicationManager.start(Applicatio
    nManager.java:152)
    at java.lang.reflect.Method.invoke(Native Method)
    at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
    eanImpl.java:606)
    at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
    .java:590)
    at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
    ionMBeanImpl.java:350)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    55)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    23)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:444)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:185)
    at $Proxy48.start(Unknown Source)
    at weblogic.management.configuration.ApplicationManagerMBean_CachingStub
    .start(ApplicationManagerMBean_CachingStub.java:479)
    at weblogic.management.Admin.startApplicationManager(Admin.java:1138)
    at weblogic.management.Admin.finish(Admin.java:561)
    at weblogic.t3.srvr.T3Srvr.start(T3Srvr.java:501)
    at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:198)
    at weblogic.Server.main(Server.java:35)
    --------------- nested within: ------------------
    weblogic.j2ee.DeploymentException: Could not load DefaultVoiceApp - with
    nested
    exception:
    [weblogic.xml.dom.DOMProcessingException: Could not setup environment
    for> >>>>EJBRef>>>>erence or ResourceReference. Cannot find WEB-INF/weblogic.xml in the Web>>>>applic>>>>ation.
    at weblogic.servlet.internal.HttpServer.loadWebApp(HttpServer.java:416)
    at weblogic.j2ee.WebAppComponent.deploy(WebAppComponent.java:74)
    at weblogic.j2ee.Application.addComponent(Application.java:160)
    at weblogic.j2ee.J2EEService.addDeployment(J2EEService.java:117)
    at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
    oymentTarget.java:329)
    at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
    oymentTarget.java:144)
    at weblogic.management.mbeans.custom.WebServer.addWebDeployment(WebServe
    r.java:76)
    at java.lang.reflect.Method.invoke(Native Method)
    at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
    eanImpl.java:606)
    at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
    .java:590)
    at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
    ionMBeanImpl.java:350)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    55)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    23)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:444)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:185)
    at $Proxy35.addWebDeployment(Unknown Source)
    at weblogic.management.configuration.WebServerMBean_CachingStub.addWebDe
    ployment(WebServerMBean_CachingStub.java:1093)
    at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
    oymentTarget.java:315)
    at weblogic.management.mbeans.custom.DeploymentTarget.addDeployments(Dep
    loymentTarget.java:279)
    at weblogic.management.mbeans.custom.DeploymentTarget.updateServerDeploy
    ments(DeploymentTarget.java:233)
    at weblogic.management.mbeans.custom.DeploymentTarget.updateDeployments(
    DeploymentTarget.java:193)
    at java.lang.reflect.Method.invoke(Native Method)
    at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
    eanImpl.java:606)
    at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
    .java:590)
    at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
    ionMBeanImpl.java:350)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    55)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    23)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:444)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:185)
    at $Proxy34.updateDeployments(Unknown Source)
    at weblogic.management.configuration.ServerMBean_CachingStub.updateDeplo
    yments(ServerMBean_CachingStub.java:2706)
    at weblogic.management.mbeans.custom.ApplicationManager.startConfigManag
    er(ApplicationManager.java:360)
    at weblogic.management.mbeans.custom.ApplicationManager.start(Applicatio
    nManager.java:152)
    at java.lang.reflect.Method.invoke(Native Method)
    at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
    eanImpl.java:606)
    at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
    .java:590)
    at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
    ionMBeanImpl.java:350)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    55)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    23)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:444)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:185)
    at $Proxy48.start(Unknown Source)
    at weblogic.management.configuration.ApplicationManagerMBean_CachingStub
    .start(ApplicationManagerMBean_CachingStub.java:479)
    at weblogic.management.Admin.startApplicationManager(Admin.java:1138)
    at weblogic.management.Admin.finish(Admin.java:561)
    at weblogic.t3.srvr.T3Srvr.start(T3Srvr.java:501)
    at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:198)
    at weblogic.Server.main(Server.java:35)
    Can someone help me on what to set in sequence please. Any help would
    highly
    be appreciated.
    Thanks in advance.
    Regards
    Aru

  • EJB annotation does not work but lookup does

    Hello, I am developing an application which has two modules: an EJB module and a WEB module. As I am using EJB 3 I would like to call the EJBs from the web module using the @EJB annotation.
    For example:
        @EJB(name = "GestioDeLlocsEJB")
        private GestioDeLlocsRemote gestioDeLlocs;
        public Collection<Lloc> getLlocs() {
            return gestioDeLlocs.findAllLlocs();
        }The problem is that the JEE container injects a null in the Remote interface ( gestioDeLlocs ) so it seems to fail when trying to match the name and the JNDI reference.
    I have added the following lines in sun-web.xml:
      <ejb-ref>
        <ejb-ref-name>GestioDeLlocsEJB</ejb-ref-name>
        <jndi-name>es.ajuntament.palma.drogues.servei.GestioDeLlocsRemote</jndi-name>
      </ejb-ref>And I have added some lines in web.xml too:
       <ejb-ref>
            <ejb-ref-name>GestioDeLlocsEJB</ejb-ref-name>
            <ejb-ref-type>Session</ejb-ref-type>
            <remote>es.ajuntament.palma.drogues.servei.GestioDeLlocsRemote</remote>
        </ejb-ref>I can test the EJBs by using the traditional lookup method:
    Context c = new InitialContext();
    return (GestioDeLlocsRemote) c.lookup("es.ajuntament.palma.drogues.servei.GestioDeLlocsRemote");But I would like to use the @EJB annotation which seems not to work.
    What am I doing wrong?

    What kind of class are you putting the annotation on? Only certain managed classes like servlet classes,
    JSF managed beans, etc. support Java EE environment annotations. If it's a plain POJO the annotations
    will be ignored.

  • 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 fails for client applications

    I am currently porting our j2ee application to weblogic 7.0. The application already
    runs successfully on Orion and Jboss. I have got everything working now except
    for our client applications, which all fail with a JNDI lookup error. The exception
    is:
    javax.naming.NameNotFoundException: Unable to resolve 'java:comp.env/ejb/QualiferInstance'
    Resolved: '' Unresolved:'java:comp' ; remaining name 'java:comp.env
    /ejb/QualifierInstance'
    at weblogic.rmi.internal.BasicOutboundRequest.sendReceive(BasicOutbound
    equest.java:109)
    at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemote
    ef.java:262)
    at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemote
    ef.java:229)
    at weblogic.jndi.internal.ServerNamingNode_WLStub.lookup(Unknown Source
    at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:338)
    at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:333)
    at javax.naming.InitialContext.lookup(InitialContext.java:347)
    at BatchIndexer.main(BatchIndexer.java:89)
    I have looked up numerous postings on various mailing lists describing similar
    problems, but none of them give an explanation which helps me.
    I am convinced that I have the ejb deployment descriptors correct because all
    our JSPs, servlets and session beans successfully lookup and use the EJBs.
    I am also convinced that I have the correct code for the JNDI lookup in our client
    applications, because they work perfectly well on Orion and Jboss and use syntax
    which is described as correct in the jsee specification, i.e. "java:comp/env/..."
    Here is the descriptor from weblogic-ejb-jar.xml for the EJB mentioned in the
    example exception above:
    <weblogic-enterprise-bean>
    <ejb-name>QualifierInstance</ejb-name>
    <jndi-name>comp/env/ejb/QualifierInstance</jndi-name>
    </weblogic-enterprise-bean>
    And here is the descriptor in the application-client.xml file:
         <ejb-ref>
              <ejb-ref-name>ejb/QualifierInstance</ejb-ref-name>
              <ejb-ref-type>Entity</ejb-ref-type>           <home>com.espritsoutron.xengine.ejb.metamodel.QualifierInstanceHome</home>
              <remote>com.espritsoutron.xengine.ejb.metamodel.QualifierInstance</remote>
              <ejb-link>QualifierInstance</ejb-link>
         </ejb-ref>
    And here is the code in the client application that attempts to perform the lookup:
    qiHome = (QualifierInstanceHome)PortableRemoteObject.narrow(context.lookup("java:comp/env/ejb/QualifierInstance"),
    QualifierInstanceHome.class);
    The annoying thing is that I know I can make this work if I change the code to
    omit the "java:" prefix, but I don't want to do this because then it would no
    longer work on either Orion and Jboss.
    P.S. I have also tried changing the jndi-name in the weblogic-ejb-jar descriptor
    to "ejb/QualifierInstance" and just "QualifierInstance", but neither of these
    make any difference. I even tried chaning it to "java:comp/env/ejb/QualifierInstance"
    but that totally breaks the server.
    Can anyone can please help with this?

    you can find the JNDI name in the JNDI tree from the admin console
    right click on your server and choose "view jndi tree".
    if you bind your ejb to ejb/QualifierInstance
    you look it up with that exact same name ejb/QualifierInstance
    Julian Fawcett wrote:
    I am currently porting our j2ee application to weblogic 7.0. The application already
    runs successfully on Orion and Jboss. I have got everything working now except
    for our client applications, which all fail with a JNDI lookup error. The exception
    is:
    javax.naming.NameNotFoundException: Unable to resolve 'java:comp.env/ejb/QualiferInstance'
    Resolved: '' Unresolved:'java:comp' ; remaining name 'java:comp.env
    /ejb/QualifierInstance'
    at weblogic.rmi.internal.BasicOutboundRequest.sendReceive(BasicOutbound
    equest.java:109)
    at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemote
    ef.java:262)
    at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemote
    ef.java:229)
    at weblogic.jndi.internal.ServerNamingNode_WLStub.lookup(Unknown Source
    at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:338)
    at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:333)
    at javax.naming.InitialContext.lookup(InitialContext.java:347)
    at BatchIndexer.main(BatchIndexer.java:89)
    I have looked up numerous postings on various mailing lists describing similar
    problems, but none of them give an explanation which helps me.
    I am convinced that I have the ejb deployment descriptors correct because all
    our JSPs, servlets and session beans successfully lookup and use the EJBs.
    I am also convinced that I have the correct code for the JNDI lookup in our client
    applications, because they work perfectly well on Orion and Jboss and use syntax
    which is described as correct in the jsee specification, i.e. "java:comp/env/..."
    Here is the descriptor from weblogic-ejb-jar.xml for the EJB mentioned in the
    example exception above:
    <weblogic-enterprise-bean>
    <ejb-name>QualifierInstance</ejb-name>
    <jndi-name>comp/env/ejb/QualifierInstance</jndi-name>
    </weblogic-enterprise-bean>
    And here is the descriptor in the application-client.xml file:
         <ejb-ref>
              <ejb-ref-name>ejb/QualifierInstance</ejb-ref-name>
              <ejb-ref-type>Entity</ejb-ref-type>           <home>com.espritsoutron.xengine.ejb.metamodel.QualifierInstanceHome</home>
              <remote>com.espritsoutron.xengine.ejb.metamodel.QualifierInstance</remote>
              <ejb-link>QualifierInstance</ejb-link>
         </ejb-ref>
    And here is the code in the client application that attempts to perform the lookup:
    qiHome = (QualifierInstanceHome)PortableRemoteObject.narrow(context.lookup("java:comp/env/ejb/QualifierInstance"),
    QualifierInstanceHome.class);
    The annoying thing is that I know I can make this work if I change the code to
    omit the "java:" prefix, but I don't want to do this because then it would no
    longer work on either Orion and Jboss.
    P.S. I have also tried changing the jndi-name in the weblogic-ejb-jar descriptor
    to "ejb/QualifierInstance" and just "QualifierInstance", but neither of these
    make any difference. I even tried chaning it to "java:comp/env/ejb/QualifierInstance"
    but that totally breaks the server.
    Can anyone can please help with this?

  • JNDI lookup of a Stateless Session bean from another stateless session bean

    Hi,
       I am working on SAP Netweaver. We have created a stateless session bean which is finally deployed as a webservice. From this stateless session bean we need to call another stateless session bean as a local reference.
        I have done the following.
    1. Added JNDI-Name to the ejb-j2ee-engine.xml.
    2. My lookup code is as follows
    Context context = null;
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sap.engine.services.jndi.InitialContextFactoryImpl");
    context = new InitialContext(env);
    Object ejbObj =     context.lookup("MyBean");
    But i get the NamingException .Here MyBean is the jndi-name provided in the ejb-j2ee-engine.xml.
    Can somebody tell me what i am doing wrong.
    Thanks
    Priya

    Hi,
        Thanks for your replies.I did as you had suggested.I added ejb-local-ref to the ejb-jar.xml and i provided ejb-ref as MyBean.
    My lookup code uses the string
    ctxt.lookup("localejbs\MyBean");
    But still i get Naming Exception.
    I tried something different yesterday.
    I changed the code to use
    InitialContext ctxt = new InitialContext();
    ctxt.lookup("localejbs/"+ pathfromJNDIRegistry);
    and this time i did not get Naming exception but i got RemoteException saying there was error loading the class.
    Is there something i need to add somewhere for the classloader to be able to find and load this class in the second scenario.
    Please suggest me which method to go for amongst the two and what is the missing information i need to add.
    Thanks
    Priya

Maybe you are looking for