Unable to lookup local EJB reference (ejb 2.1)

Hi All,
I am trying to do a simple local EJB lookup of ejb2(XDCGIVTCursorHoldableJDBCReader) from ejb1(XDCGIVTBatchController), Both the ejbs are located in the same EAR. This is weblogic 10
I am running into name-not-found exceptions.
Here is my ejb-jar.xml
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">
     <enterprise-beans>
          <session>
               <ejb-name>XDCGIVTBatchController</ejb-name>
               <home>xxx.BatchJobControllerHome</home>
               <remote>xxx.BatchJobController</remote>
               <ejb-class>xxx.BatchJobControllerBean</ejb-class>
               <session-type>Stateless</session-type>
               <transaction-type>Container</transaction-type>
               <ejb-local-ref>
                    <ejb-ref-name>ejb/local/XDCGIVTCursorHoldableJDBCReader</ejb-ref-name>
                    <ejb-ref-type>Session</ejb-ref-type>
                    <local-home>xxx.CursorHoldableJDBCReaderLocalHome</local-home>
                    <local>xxx.CursorHoldableJDBCReaderLocal</local>
                    <ejb-link>XDCGIVTCursorHoldableJDBCReader</ejb-link>
               </ejb-local-ref>
               <resource-ref>
                    <res-ref-name>wm/BatchWorkManager</res-ref-name>
                    <res-type>commonj.work.WorkManager</res-type>
                    <res-auth>Container</res-auth>
                    <res-sharing-scope>Shareable</res-sharing-scope>
               </resource-ref>
          </session>
          <session>
               <ejb-name>XDCGIVTCursorHoldableJDBCReader</ejb-name>
               <local-home>xxx.CursorHoldableJDBCReaderLocalHome</local-home>
               <local>xxx.CursorHoldableJDBCReaderLocal</local>
               <ejb-class>xxx.CursorHoldableJDBCReaderBean</ejb-class>
               <session-type>Stateful</session-type>
               <transaction-type>Bean</transaction-type>
               <resource-ref>
                    <res-ref-name>jdbc/IVTdb</res-ref-name>
                    <res-type>javax.sql.DataSource</res-type>
                    <res-auth>Container</res-auth>
                    <res-sharing-scope>Unshareable</res-sharing-scope>
               </resource-ref>
          </session>
     </enterprise-beans>
</ejb-jar>
and here is my weblogic-ejb-jar.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
** This file was automatically generated by
** EJBGen WebLogic Server 10.3 SP0 Fri Jul 25 16:30:05 EDT 2008 1137967
-->
<weblogic-ejb-jar
xmlns="http://www.bea.com/ns/weblogic/90" xmlns:j2ee="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic-ejb-jar.xsd">
<weblogic-enterprise-bean>
<ejb-name>XDCGIVTBatchController</ejb-name>
<stateless-session-descriptor>
</stateless-session-descriptor>
     <jndi-name>ejb/XDCGIVTBatchController</jndi-name>
</weblogic-enterprise-bean>
<weblogic-enterprise-bean>
     <ejb-name>XDCGIVTCursorHoldableJDBCReader</ejb-name>
     <local-jndi-name>XDCGIVTCursorHoldableJDBCReader</local-jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
I am using the following code to do the lookup
Object hm = new InitialContext().lookup("java:comp/env/ejb/local/XDCGIVTCursorHoldableJDBCReader);
I have also tried looking up with
java:comp/env/ejb/XDCGIVTCursorHoldableJDBCReader with no success.
Any ideas? suggestions? what am I doing wrong?
Thanks in advance!!
Neeraj

Hey Matt,
So the flow is as follows
1. Servlet looks up EJB1
2. EJB1 starts a commonj.work using the commonj.WorkManager
3. The worker tries to lookup EJB2 using java:comp/env (and thats the same place I tried to dump the namespace)
Could it be that I am getting a new namespace in the commonj worker ? This doesn't seem to be the case in IBM WebSphere.
Thanks for your help!
Neeraj

Similar Messages

  • Unable to find Local Ejb home in websphere 6.0

    Its really anoying as am unable to guess . I am invoking an EJB locally using code as below . The Ejb works fine while testing with UniversalTestClient However when i try to invoke it from my Client it gives jndi error.
    Am using RAD 6.0 IDE and WebSphere6.0 and Ejb 2.1
    I tried calling ejb providing different jndi names as below but it doesn't work .
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory");
    env.put (Context.PROVIDER_URL, "corbaloc:iiop:localhost:2809/");
    try{
    InitialContext icontext = new InitialContext(env);
    // Object result = icontext.lookup("local:ejb/DefaultSession");
    // Object result = icontext.lookup("D7VRC491Node01Cell/nodes/D7VRC491Node01/servers/server1/TestEj b/ejb/com/test/ejbs/DefaultSessionLocalHome");
    // Object result = icontext.lookup("local:ejb/ejb/com/test/ejbs/DefaultSessionLocalHome");
    Object result = icontext.lookup("ejb/com/dhsmv/ejbs/DefaultSessionLocalHome");
    DefaultSessionLocalHome localHome = (DefaultSessionLocalHome) result;
    DefaultSessionLocal localSession = (DefaultSessionLocal) localHome.create();
    String strTest = localSession.welcome(" Hello World ");
    System.out.println(" Retrieved ejb method ..." + strTest);
    I get an exception that first component of jndi name is not available. Please suggets where is the problem hiding. Is there any thing wrong with jndi name .
    Thanks.

    The CORBA error could suggest your bootstrap port is already being used by another process. Try changing it to something else.
    Assuming your webconsole works - its something like this (although off the top of my head can't be sure...)
    Select servers from the menu on the left, then select, your server.
    From the newly loaded page, on the right hand side, you should see a link called "Ports". Modify your bootstrap port, usual value is 2809.
    How does that work?

  • 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

  • Fail to lookup the local EJB by JNDI in Managed Server

    Hi all,
    I currently in a deep problem, and can't figure out the cause of it. It just annoying me for week.
    In my app, I have binded to the local ejb to JNDI (let's say "ejb/CustomerLocal"), then the client lookup the Local EJB by the following code.
    localIc = new InitialContext();
    home = (EJBLocalHome)localIc.lookup("ejb/CustomerLocal");
    It works well as I do development in the Domain Admin Server. However, when I do the System Integration Test and deploy my app to the managed server, the app fail. It just can't do the Local EJB lookup. Following is the exception.
    javax.naming.NameNotFoundException: Unable to resolve 'ejb/CustomerLocal' Resolved ejb[Root exc
    eption is javax.naming.NameNotFoundException: Unable to resolve 'ejb.CustomerLocal' Resolved ejb
    ]; remaining name CustomerLocal'
    Does anybody know the cause of it and have solution?
    Thanks a lot

    Hi,
    Just now I replicated the same problem what you are facing. I created one managed server. When I deployed my ejb to admin server I did not get any problem. But when I deploy the same into my managed server I got Naming Exception. Because I did n/t specify Context.PROVIDER_URL. A provider URL contains bootstrap server information that the initial context factory can use to obtain an initial context. So when you deploy EJB on another server, you have to get the Naming service from that server. Hence provider URL must pointing to that server. So I included following statements before lookup my ejb in managed server.
    Properties p=new Properties ();
    p.put (Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
    p.put (Context.PROVIDER_URL,"t3://localhost: 7003");
    Context ctx=new InitialContext (p);
    FacadeHome home=(FacadeHome) ctx.lookup ("ejb/CustomerLocal");
    In my case managed server port number is 7003. Now onwards managed server (Port number 7003) will provide ‘Naming Service’, not by admin server (port number 7001), which is default.
    Note: Context.PROVIDER_URL— specifies the URL of the WebLogic Server that provides the name service. The default is t3://localhost: 7001. When you are not specified it will assume that POVIDER_URL is t3://localhost: 7001 this is nothing but your admin server in your case. However, a JNDI client may need to access a name space other than the one identified in its environment. In this case, it is necessary to explicitly set the java.naming.provider.url (provider URL) property used by the InitialContext constructor.
    I hope it helps.
    Regards,
    Kuldeep Singh.

  • Unable to invoke local interfaces in EJB 2, SJSAS 9 environment

    Hi,
    I am unable to get SJSAS to register local interfaces for an BMP entity bean. I am new to entity beans, and am trying out a simple case using EJB 2.0 deployed on SJSAS 9. I even had tried setting source level to 1.4, but no luck.
    EJB looks ok, as it was verified successfully by netbeans 5. But, I could not find the bean registerd when I verified it through the JNDI Brownsing utiltiy in SJSAS.
    I get the error
    javax.naming.NameNotFoundException: AccountLocal not found
    I have provided ejb-local-ref in web.xml, as shown below
    <ejb-local-ref>
    <ejb-ref-name>NewAccountLocal</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <local-home>entity2.NewAccountLocalHome</local-home>
    <local>entity2.NewAccountLocal</local>
    </ejb-local-ref>
    ejb-jar.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <ejb-jar version="2.1" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">
    <display-name>ejbEntity2</display-name>
    <enterprise-beans>
    <entity>
    <display-name>NewAccountEB</display-name>
    <ejb-name>NewAccountBean</ejb-name>
    <local-home>entity2.NewAccountLocalHome</local-home>
    <local>entity2.NewAccountLocal</local>
    <ejb-class>entity2.NewAccountBean</ejb-class>
    <persistence-type>Bean</persistence-type>
    <prim-key-class>entity2.AccountPK</prim-key-class>
    <reentrant>false</reentrant>
    </entity>
    </enterprise-beans>
    <assembly-descriptor>
    <container-transaction>
    <method>
    <ejb-name>NewAccountBean</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>
    sun-ejb-jar.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE sun-ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 EJB 2.0//EN" "http://www.sun.com/software/appserver/dtds/sun-ejb-jar_2_0-0.dtd">
    <sun-ejb-jar>
    <enterprise-beans>
    <ejb>
    <ejb-name>NewAccountBean</ejb-name>
    <jndi-name>NewAccountLocal</jndi-name>
    <bean-pool>
    <steady-pool-size>1</steady-pool-size>
    <resize-quantity>1</resize-quantity>
    <max-pool-size>3</max-pool-size>
    <pool-idle-timeout-in-seconds>60</pool-idle-timeout-in-seconds>
    </bean-pool>
    <bean-cache>
    <max-cache-size>10</max-cache-size>
    <resize-quantity>1</resize-quantity>
    <removal-timeout-in-seconds>360</removal-timeout-in-seconds>
    <victim-selection-policy>LRU</victim-selection-policy>
    </bean-cache>
    </ejb>
    </enterprise-beans>
    </sun-ejb-jar>
    Access code:
    Object obj = ctx.lookup("NewAccountLocal");
    entity2.NewAccountLocalHome accHome = (entity2.NewAccountLocalHome) obj;

    Use "java:comp/env/NewAccountBean" instead. The portion relative to java:comp/env must
    exactly match the value in the <ejb-ref-name> element. There is no automatic prepending of
    "ejb" to the context relative to java:comp/env.
    Of course you could also keep the code the same, but change the value of the ejb-ref-name
    to <ejb-ref-name>ejb/NewAccountBean</ejb-ref-name>
    All that matters is that the value relative to java:comp/env and what's in the ejb-ref-name are a match.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Problems while performing lookup for Local EJBs

    Can anybody tell me how can i perform local ejb lookup in Sun app Server 8.0/8.1 ?
    I have following entries in ejb-jar.xml.
    <?xml version="1.0" encoding="UTF-8"?>
    <!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 >
    <enterprise-beans>
    <session >
    <ejb-name>TeamLeaderBean</ejb-name>
    <local-home>spring.ejb.example.TeamLeaderLocalHome
    </local- home>
    <local>spring.ejb.example.TeamLeaderLocal</local>
    <ejb-class>spring.ejb.example.TeamLeaderBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    </session>
    </enterprise-beans>
    <assembly-descriptor></assembly-descriptor>
    </ejb-jar>
    In sun-ejb-jar.xml I have
    <sun-ejb-jar>
    <enterprise-beans>
    <ejb>
    <ejb-name>TeamLeaderBean</ejb-name>
    <jndi-name>TeamLeaderBeanLocal</jndi-name>
    </ejb>
    </enterprise-beans>
    </sun-ejb-jar>
    In the client EJBs code I have used following ways of performing lookup...
    ctx.lookup("java:comp/env//TeamLeaderBeanLocal");
    ctx.lookup("java:comp/env/ejb/local/TeamLeaderBeanLocal");
    ctx.lookup("ejb/TeamLeaderBeanLocal");
    Unfortunately none of these performs a successful lookup...???
    Can anybody solve my problem?

    In order to look up a local EJB from an EJB client you have to add an <ejb-local-ref> element for client EJB. So:
    <session>
    <ejb-name>MyClientEJB</ejb-name>
    <ejb-local-ref>
    <ejb-ref-name>ejb/TeamLeaderBeanLocal</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <ejb-link>TeamLeaderBeanLocal</ejb-link>
    </ejb-local-ref>
    </session>
    fil
    Can anybody tell me how can i perform local ejb
    lookup in Sun app Server 8.0/8.1 ?
    I have following entries in ejb-jar.xml.
    <?xml version="1.0" encoding="UTF-8"?>
    <!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 >
    <enterprise-beans>
    <session >
    <ejb-name>TeamLeaderBean</ejb-name>
    <local-home>spring.ejb.example.TeamLeaderLocalHome
    </local- home>
    <local>spring.ejb.example.TeamLeaderLocal</local>
    <ejb-class>spring.ejb.example.TeamLeaderBean</ejb-clas
    s>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    </session>
    </enterprise-beans>
    <assembly-descriptor></assembly-descriptor>
    </ejb-jar>
    In sun-ejb-jar.xml I have
    <sun-ejb-jar>
    <enterprise-beans>
    <ejb>
    <ejb-name>TeamLeaderBean</ejb-name>
    <jndi-name>TeamLeaderBeanLocal</jndi-name>
    </ejb>
    </enterprise-beans>
    </sun-ejb-jar>
    In the client EJBs code I have used following ways of
    performing lookup...
    ctx.lookup("java:comp/env//TeamLeaderBeanLocal");
    ctx.lookup("java:comp/env/ejb/local/TeamLeaderBeanLoca
    l");
    ctx.lookup("ejb/TeamLeaderBeanLocal");
    Unfortunately none of these performs a successful
    lookup...???
    Can anybody solve my problem?

  • Unable to Lookup EJB

    Hello,
    I am trying to lookup an EJB from my web app using the following code and web.xml entry.
    Context ctx = new InitialContext();
    NavigatorHome home = (NavigatorHome)ctx.lookup("java:comp/env/ejb/NavigatorEJB");
    <ejb-ref>
    <ejb-ref-name>ejb/diamelle.ebc.Navigator</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>diamelle.ebc.NavigatorHome</home>
    <remote>diamelle.ebc.Navigator</remote>
    <ejb-link>NavigatorEJB</ejb-link>
    </ejb-ref>
    It produces the error below. Any ideas?
    Thanks in advance.
    Suneet
    [03/Jun/2003:14:57:04] WARNING ( 2064): CORE3283: stderr: javax.naming.NamingException: invocation exception
    [03/Jun/2003:14:57:04] WARNING ( 2064): CORE3283: stderr: at com.sun.enterprise.naming.NamingManagerImpl.getComponentId(NamingManagerImpl.java:990)
    [03/Jun/2003:14:57:04] WARNING ( 2064): CORE3283: stderr: at com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl.java:789)
    [03/Jun/2003:14:57:04] WARNING ( 2064): CORE3283: stderr: at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:107)
    [03/Jun/2003:14:57:04] WARNING ( 2064): CORE3283: stderr: at javax.naming.InitialContext.lookup(InitialContext.java:347)

    Suneet,
    You are doing a look up by using NavigatorEJB. So you should use the same JNDI name in the web.xml as well.
    Change <ejb-ref-name>ejb/diamelle.ebc.Navigator</ejb-ref-name> to <ejb-ref-name>ejb/Navigator</ejb-ref-name>. I think it will work.

  • Unable to load the EJB module. DeploymentContext does not contain any EJB.

    I'm writing an enterprise application to familiarize myself with Glassfish 3.1.2 and EJB 3.1. I've created several local, stateless beans, and injected one into a JSF managed bean. The ejb and web modules compile fine, but when I launch the application with Glassfish I get the following startup error and the application does not deploy. I don't understand what it means, can someone ellaborate?
    SEVERE: Exception while invoking class org.glassfish.ejb.startup.EjbDeployer prepare method
    SEVERE: Exception while invoking class org.glassfish.javaee.full.deployment.EarDeployer prepare method
    SEVERE: Exception while preparing the app
    SEVERE: Unable to load the EJB module. DeploymentContext does not contain any EJB. Check the archive to ensure correct packaging for D:\Documents\NetBeansProjects\Test\dist\gfdeploy\Test\Test-war_war.
    If you use EJB component annotations to define the EJB, and an ejb or web deployment descriptor is also used, please make sure that the deployment descriptor references a Java EE 5 or higher version schema, and that the metadata-complete attribute is not set to true, so the component annotations can be processed as expected
    org.glassfish.deployment.common.DeploymentException: Unable to load the EJB module. DeploymentContext does not contain any EJB. Check the archive to ensure correct packaging for D:\Documents\NetBeansProjects\Test\dist\gfdeploy\Test\Test-war_war.
    If you use EJB component annotations to define the EJB, and an ejb or web deployment descriptor is also used, please make sure that the deployment descriptor references a Java EE 5 or higher version schema, and that the metadata-complete attribute is not set to true, so the component annotations can be processed as expected
         at org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:166)
         at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:871)
         at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:410)
         at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
         at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)
         at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348)
         at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)
         at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)
         at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)
         at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)
         at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)
         at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:461)
         at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:212)
         at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
         at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
         at com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(ContainerMapper.java:354)
         at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
         at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
         at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
         at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
         at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
         at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
         at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
         at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
         at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
         at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
         at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
         at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
         at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
         at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
         at java.lang.Thread.run(Thread.java:722)

    My guess is that you deployed an ejb without bean in it. when you have an ejb module, be sure you have at least one bean present.
    Are you sure you have implementend some beans? Or did you do this only in the web module?
    Try adding an @Stateless bean doing nothing in you ejb module, redeploy and let me know if that works

  • Probmel with Local EJB JNDI Binding

    Hi friends,
    I am using jboss server. I need to deployee one session bean and one entity bean. and I have done it. but it show me jndi binding like this
    [BaseLocalProxyFactory] Bound EJB LocalHome 'BookBean' to jndi 'local/BookBean@18722656'
    [BaseLocalProxyFactory] Bound EJB LocalHome 'BookFacadeBean' to jndi 'local/BookFacadeBean@9668715'
    but it should be bind jndi bninding like this
    [BaseLocalProxyFactory] Bound EJB LocalHome 'BookBean' to jndi 'BookBean'
    [BaseLocalProxyFactory] Bound EJB LocalHome 'BookFacadeBean' to jndi 'BookFacadeBean'
    I don't understand where I am comminting mistake. I am giving ejb-jar.xml mapping below.
    <?xml version="1.0" encoding="UTF-8"?>
    <!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>BookEJB</description>
         <display-name>BookEJB</display-name>
         <enterprise-beans>
              <session>
                   <display-name>BookFacade</display-name>
                   <ejb-name>BookFacadeBean</ejb-name>
                   <local-home>com.ejb.book.service.BookFacadeHome</local-home>
                   <local>com.ejb.book.service.BookFacadeLocal</local>
                   <ejb-class>com.ejb.book.service.BookFacadeBean</ejb-class>
                   <session-type>Stateless</session-type>
                   <transaction-type>Container</transaction-type>
              </session>
              <entity>
                   <description>EntityBean</description>
                   <display-name>BookEntity</display-name>
                   <ejb-name>BookBean</ejb-name>
                   <local-home>com.ejb.book.persistence.BookLocalHome</local-home>
                   <local>com.ejb.book.persistence.BookLocal</local>
                   <ejb-class>com.ejb.book.persistence.BookLocalBean</ejb-class>
                   <persistence-type>Container</persistence-type>
                   <prim-key-class>java.lang.Integer</prim-key-class>
                   <reentrant>false</reentrant>
                   <abstract-schema-name>book</abstract-schema-name>
                   <cmp-field>
                        <field-name>bookID</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>bookName</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>bookAuthor</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>bookVersion</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>bookPrice</field-name>
                   </cmp-field>
                   <primkey-field>bookID</primkey-field>
                   <query>
                        <description>Query By All</description>
                             <query-method>
                                  <method-name>findAll</method-name>
                                  <method-params></method-params>
                             </query-method>
                             <ejb-ql>SELECT OBJECT(u) FROM book AS u </ejb-ql>
                   </query>
                   <query>
                        <description>Query for findByBookName</description>
                        <query-method>
                             <method-name>findByPrimaryKey</method-name>
                                  <method-params>
                                       <method-param>java.lang.Integer</method-param>
                                  </method-params>
                        </query-method>
                        <ejb-ql>SELECT OBJECT(u) FROM book AS u WHERE u.bookID=?1</ejb-ql>
              </query>
                   <query>
                        <description>Query for findByBookName</description>
                        <query-method>
                             <method-name>findByBookName</method-name>
                                  <method-params>
                                       <method-param>java.lang.String</method-param>
                                  </method-params>
                        </query-method>
                        <ejb-ql>SELECT OBJECT(u) FROM book AS u WHERE u.bookName=?1</ejb-ql>
              </query>
              <query>
                        <description>Query for findByBookAuthor</description>
                        <query-method>
                             <method-name>findByBookAuthor</method-name>
                             <method-params>
                                  <method-param>java.lang.String</method-param>
                             </method-params>
                        </query-method>
                        <ejb-ql>SELECT OBJECT(u) FROM book AS u WHERE u.bookAuthor=?1</ejb-ql>
              </query>
              <query>
                   <description>Query for findByBookVersion</description>
                   <query-method>
                        <method-name>findByBookVersion</method-name>
                        <method-params>
                             <method-param>java.lang.String</method-param>
                        </method-params>
                   </query-method>
                   <ejb-ql>SELECT OBJECT(u) FROM book AS u     WHERE u.bookVersion=?1</ejb-ql>
              </query>
              <query>
                   <description>Query for findByBookPrice</description>
                   <query-method>
                        <method-name>findByBookPrice</method-name>
                        <method-params>
                             <method-param>java.lang.Float</method-param>
                        </method-params>
                   </query-method>
                   <ejb-ql>SELECT OBJECT(u) FROM book AS u WHERE u.bookPrice=?1</ejb-ql>
              </query>
              </entity>
         </enterprise-beans>
         <assembly-descriptor>
              <container-transaction>
                   <method>
                        <ejb-name>BookBean</ejb-name>
                        <method-name>*</method-name>
                   </method>
                   <trans-attribute>Required</trans-attribute>
              </container-transaction>
              <container-transaction>
                   <method>
                        <ejb-name>BookFacadeBean</ejb-name>
                        <method-name>*</method-name>
                   </method>
                   <trans-attribute>Required</trans-attribute>
              </container-transaction>
         </assembly-descriptor>
    </ejb-jar>
    I appreciate if you reply me on [email protected].
    Thanks in advance.
    TumoDav (UmaShankar)

    Hi friend,
    Thanks for replying me. But , I am unable to call this EJB by simple EJBClient (simple java file) when I am trying to call this ejb, then it show me this error :-
    javax.naming.NameNotFoundException: BookFacadeBean not bound
         at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
         at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
         at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
         at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
         at sun.rmi.transport.Transport$1.run(Transport.java:153)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
         at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
         at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
         at java.lang.Thread.run(Thread.java:595)
         at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
         at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
         at sun.rmi.server.UnicastRef.invoke(Unknown Source)
         at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
         at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
         at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
         at javax.naming.InitialContext.lookup(Unknown Source)
         at EJBClient.EJBClient.BookEJBClient(EJBClient.java:45)
         at EJBClient.EJBClient.main(EJBClient.java:30)
    Here I am giving my ejb client.
    package EJBClient;
    import java.util.Iterator;
    import java.util.Properties;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.rmi.PortableRemoteObject;
    import com.ejb.book.service.BookFacadeBean;
    import com.ejb.book.service.BookFacadeHome;
    import com.ejb.book.service.BookFacadeLocal;
    import com.ejb.book.vo.BookVo;
    * @author UmaShankar
    public class EJBClient {
         * @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              BookEJBClient();
         public static void BookEJBClient(){
              String providerURL = "jnp://localhost:1099";
              String factoryName = "org.jnp.interfaces.NamingContextFactory"; //org.jnp.interfaces.NamingContextFactory
              String factoryPkgs = "org.jboss.naming:org.jnp.interfaces";
              Properties prop = System.getProperties();
              prop.put("Context.PROVIDER_URL", providerURL);
              prop.put("java.naming.provider.url", providerURL);
              prop.put("java.naming.factory.initial", factoryName);
              prop.put("java.naming.factory.url.pkgs", factoryPkgs);
              try{
                   Context ctx = new InitialContext(prop);
                   Object obj = ctx.lookup("BookFacadeBean");
                   BookFacadeHome home = (BookFacadeHome)PortableRemoteObject.narrow(obj, BookFacadeHome.class);
                   BookFacadeLocal local = home.create();
                   //java.util.Hashtable allD = local.getBookName();
                   System.out.println("-------------Start-------------------");
                   System.out.println("BookName:-"+local.getBookName());
                   System.out.println("BookAuthor:-"+local.getBookAuthor());
                   if(allD.isEmpty()){
                        System.out.println("There is no record. Empty Hash");
                   java.util.Set set = allD.keySet();
                   for(Iterator it = set.iterator();it.hasNext();System.out.println("-----------------------------")){
                        Integer key = (Integer)it.next();
                        BookVo vo = (BookVo)allD.get(key);
                        System.out.println(vo.getBookId());
                        System.out.println(vo.getBookName());
                        System.out.println(vo.getBookAuthor());
                        System.out.println(vo.getBookVersion());
                        System.out.println(vo.getBookPrive());
              }catch(Exception e){
                   e.printStackTrace();
    }

  • Trying to look up a LOCAL EJB (Weblogic 8.1)

    Hi,
    I'm trying to look up a LOCAL EJB (Weblogic 8.1):
    try
    Context ct = new InitialContext();
    Object o = ct.lookup("*ejbSecurityDataLocalHelper*");
    catch(...)
    I systematically get the following exception:
    Caused by: javax.naming.LinkException: Root exception is javax.naming.NameNotFoundException: While trying to look up /app/ejb/AEX_JRK_security_EJB.jar#SecurityDataHelper/local-home in /app/ejb/ISL_MSD_mktdata_general_EJB.jar#MarketDataGeneralManager.; remaining name '/app/ejb/AEX_JRK_security_EJB/jar#SecurityDataHelper/local-home'; Link Remaining Name: 'java:app/ejb/AEX_JRK_security_EJB.jar#SecurityDataHelper/local-home'
    Where SecurityDataHelper is the Local EJB, who's called from MarketDataGeneralManager EJB.
    I realized that the Weblogic JNDI tree shows a red dot next to the name SecurityDataHelperLocalHome: as the other names are not red, I could guess there was something wrong at deployment... buy deployment logs are OK. When I tryied to test the EJB via the Weblogic console there was a message "The EJB SecurityDataHelper has not been tested successfully. There was a problem determining the JNDI Name of the given bean. "
    My ejb-jar.xml looks like this:
    <session>
    <ejb-name>SecurityDataHelper</ejb-name>
    <local-home>com.MyLocalHome</local-home>
    <local>com.MyLocalObject</local>
    <ejb-class>com.MyBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    </session>
    and my weblogic-ejb-jar.xml:
    <weblogic-enterprise-bean>
    <ejb-name>SecurityDataHelper</ejb-name>
    <stateless-session-descriptor>
    </stateless-session-descriptor>
    <enable-call-by-reference>True</enable-call-by-reference>
    <local-jndi-name>ejbSecurityDataLocalHelper</local-jndi-name>
    </weblogic-enterprise-bean>
    What I am doing wrong???

    Hi Dan,
    As u have targeted the ConnectionFactory to "soa_server1" which is running on "realHostName:7001" ....Can u please check from the AdminConsole that the JNDI name ""jms/b2b/B2BQueueConnectionFactory" is present in the JNDI Tree?
    AdminConsole---->Servers---soa_server1 (click) ---> in this general configuration page you will see a link "View JNDI Tree" please ckick on that link to see the JNDI tree entries.
    If you dont see any JNDI entry there then it means there is something wrong while setting up the Connection Factory in that case please refer to the Screenshots of Creating and Targeting the Connection Factory: *http://middlewaremagic.com/weblogic/?p=1987*
    Thanks
    Jay SenSharma
    *http://middlewaremagic.com/weblogic (Middleware magic Is Here)*

  • Lookup Failure EJB JNDI - StatelessSession Bean Example on Unix

    Hi,
    I am trying to run weblogic 5.1 on Unix. Earlier on, I tried
    running the ejb example: "StatelessSession" on Windows NT and succeeded.
    However I am unable to do so on unix.
    Error message says that the problem is in URL or JNDI name.
    I started the Weblogic Server on Unix and then started the Console
    on my own Desktop i.e. Windows 2000. Then I was able to connect
    to myserver which was running on Unix and could see the EJB deployed
    all ok.
    Now for running this example as and when I try to run the
    java client code (which is a java application / class) I am unable
    to do a lookup for the context.
    I have verified that the DNS name for the Unix box as well as
    port # is correct. Same is true for the JNDI name. My problem appears
    to be of class path.
    I looked up the log file and found out the problem:
    Tue Mar 13 16:41:40 CST 2001:<E> <ServletContext-General> Cannot
    find resource 'classes/examples/ejb/basic/statelessSession/TraderBe
    anHomeImpl_ServiceStub.class' in document root '/app/weblogic/planit/weblogic/myserver/public_html'
    So that means if I place the client files in this directory (i.e.
    public_html) it would run. But I am wondering where do I need to
    specify that the server should look in "ClientClasses" directory
    and not in "public_html" directory.
    What else could be wrong......
    Sincerely,
    Ahmad

    Ahmad,
    This file gets generated when you run java weblogic.ejbc. This is the last
    step in creating the EJB. From the class files, weblogic needs to create the skelton
    and the stub so that they are able to communicate back and forth...
    Peter
    "Ahmad" <[email protected]> wrote:
    >
    Hi All,
    I took a fresh look at the Error as displayed in the log
    file on the Unix machine:
    It says it Cannot find resource 'classes/examples/ejb/basic/statelessSession/TraderBeanHomeImpl_WLStub.class'
    in document root '/app/weblogic/planit/weblogic/myserver/public_html'
    Now I looked under public_html directory and did not find the "classes"
    directory. What I did was :
    1. Created a new "classes" directory under public_html.
    2. copy the whole directory structure from "clienclasses" directory
    and placed it under the newly created directory.
    However to my surprise, could not find TraderBeanHomeImpl_WLStub.class
    When I tried to look for the same file on NT machine, (where this
    example is running all o.k) I still
    could not find it. When is this class generated and what is happening.
    "Ahmad" <[email protected]> wrote:
    Hello There!!
    My class path on unix is set as follows:
    planit@itd00n15> . ./setEnv.sh
    ============= Setting Environment ================
    WL_HOME=/app/weblogic/planit/weblogic
    JAVA_HOME=/usr/java/jdk122a
    CLIENT_CLASSES=/app/weblogic/planit/weblogic/myserver/clientclasses
    SERVER_CLASSES=/app/weblogic/planit/weblogic/myserver/serverclasses
    SERVLET_CLASSES=/app/weblogic/planit/weblogic/myserver/servletclasses
    PATH=/usr/java/jdk122a/bin:/usr/java/jdk122a/bin:/app/weblogic/planit/weblogic/bin:/usr/java/jdk122a/bin:/oracle/product/8.1.6/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/ccs/bin:/usr/openwin/bin
    CLASSPATH=/usr/java/jdk122a/lib/tools.jar:/app/weblogic/planit/weblogic/license:/app/weblogic/planit/weblogic/classes:/app/weblogic/planit/weblogic/lib/weblogicaux.jar:/app/weblogic/planit/weblogic/eval/cloudscape/lib/cloudscape.jar:/app/weblogic/planit/weblogic/myserver/clientclasses:/app/weblogic/planit/weblogic/myserver/serverclasses
    LD_LIBRARY_PATH=/oracle/product/8.1.6/lib:/app/weblogic/planit/weblogic/lib/solaris:/app/weblogic/planit/weblogic/lib/solaris:/app/weblogic/planit/weblogic/lib/solaris
    I have no idea what is going on!!
    Ahmad
    "Ahmad" <[email protected]> wrote:
    By the way, we are using service pack 4. Would that matter
    on Unix
    for this kind of exception...
    I am not sure, where would I define the class path to
    the client
    stub classes. I mean in which file!!
    Sincerely,
    Ahmad
    "Ahmad" <[email protected]> wrote:
    What directory Structure should I be in in order to
    run
    the
    client. On NT I have to be in "ClientClasses" directory.
    For
    example following example runs fine on Windows NT:
    C:\weblogic\myserver\clientclasses>java examples.ejb.basic.statelessSession.Client
    Beginning statelessSession.Client...
    Creating a trader
    Buying 100 shares of BEAS.
    Buying 200 shares of MSFT.
    Buying 300 shares of AMZN.
    Buying 400 shares of HWP.
    Selling 100 shares of BEAS.
    Selling 200 shares of MSFT.
    Selling 300 shares of AMZN.
    Selling 400 shares of HWP.
    Removing the trader
    End statelessSession.Client...
    However for unix, I tried different directories, I am
    not sure
    which one in the hierarchy am I supposed to be, in order
    to
    run the client.
    By the way, I tried putting the ctx.lookup method ina
    catch block
    and tried to print the stack trace.
    Here is the error which I am getting, irrespective of
    the directory
    hierarchy I am in:
    planit@itd00n15> java examples.ejb.basic.statelessSession.Client
    Beginning statelessSession.Client...
    About to Lookup the JNDI name !!
    The client was unable to lookup the EJBHome. Pleasemake
    sure
    that you have deployed the ejb with the JNDI name statelessSession.TraderHome
    on the WebLogic server at t3://planit-dev.intranet.sprintspectrum.com:10400
    Printing the Stack Trace :
    javax.naming.CommunicationException. Root exceptionis
    java.lang.ClassNotFoundException:
    class examples.ejb.basic.statelessSession.TraderBeanHomeImpl_ServiceStub
    previously not found
    at java.lang.Throwable.fillInStackTrace(Native
    Method)
    at java.lang.Throwable.fillInStackTrace(Compiled
    Code)
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Exception.<init>(Compiled Code)
    at java.lang.ClassNotFoundException.<init>(Compiled
    Code)
    at weblogic.rjvm.MsgAbbrev.read(Compiled Code)
    at weblogic.socket.JVMAbbrevSocket.readMsgAbbrevs(JVMAbbrevSocket.java:505)
    at weblogic.rjvm.MsgAbbrevInputStream.prime(MsgAbbrevInputStream.java:134)
    at weblogic.rjvm.RJVMImpl.dispatch(RJVMImpl.java:610)
    at weblogic.rjvm.ConnectionManagerClient.handleRJVM(ConnectionManagerClient.java:34)
    at weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:630)
    at weblogic.socket.JVMAbbrevSocket.dispatch(Compiled
    Code)
    at weblogic.socket.JVMSocketT3.dispatch(Compiled
    Code)
    at weblogic.socket.JavaSocketMuxer.processSockets(Compiled
    Code)
    at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:23)
    at weblogic.kernel.ExecuteThread.run(Compiled
    Code)
    --------------- nested within: ------------------
    weblogic.rmi.UnmarshalException: Unmarshalling return
    - with nested exception:
    [java.lang.ClassNotFoundException: class examples.ejb.basic.statelessSession.TraderBeanHomeImpl_ServiceStub
    previously not found]
    at java.lang.Throwable.fillInStackTrace(Native
    Method)
    at java.lang.Throwable.fillInStackTrace(Compiled
    Code)
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Exception.<init>(Compiled Code)
    at java.io.IOException.<init>(IOException.java:47)
    at weblogic.common.T3Exception.<init>(T3Exception.java:47)
    at weblogic.rmi.RemoteException.<init>(RemoteException.java:41)
    at weblogic.rmi.UnmarshalException.<init>(UnmarshalException.java:31)
    at weblogic.jndi.toolkit.BasicWLContext_WLStub.lookup(BasicWLContext_WLStub.java:256)
    at weblogic.jndi.toolkit.WLContextStub.lookup(Compiled
    Code)
    at javax.naming.InitialContext.lookup(InitialContext.java:349)
    at examples.ejb.basic.statelessSession.Client.lookupHome(Client.java:154)
    at examples.ejb.basic.statelessSession.Client.<init>(Client.java:44)
    at examples.ejb.basic.statelessSession.Client.main(Client.java:86)
    Throwing ne !!
    NamingException Occured!!. Exception Message:
    null
    Sincerely,
    Ahmad
    "Ahmad" <[email protected]> wrote:
    Hi all,
    I am still unable to find out where do I have to
    tell
    weblogic tha the stubs for the client classes are in
    ClientClasses directory.
    Any ideas are welcome.
    Sincerely,
    Ahmad
    "Ahmad" <[email protected]> wrote:
    Hi,
    I am trying to run weblogic 5.1 on Unix. Earlieron,
    I tried
    running the ejb example: "StatelessSession" on Windows
    NT and succeeded.
    However I am unable to do so on unix.
    Error message says that the problem is in URL or
    JNDI
    name.
    I started the Weblogic Server on Unix and then started
    the Console
    on my own Desktop i.e. Windows 2000. Then I was ableto
    connect
    to myserver which was running on Unix and could see
    the
    EJB deployed
    all ok.
    Now for running this example as and when I
    try
    to run the java client code (which is a java application/
    class) I am unable to do a lookup for the context.
    I have verified that the DNS name for the Unix boxas
    well as port # is correct. Same is true for the JNDIname.
    My
    problem appears to be of class path.
    I looked up the log file and found out the problem:
    Tue Mar 13 16:41:40 CST 2001:<E> <ServletContext-General>
    Cannot find 'classes/examples/ejb/basic/statelessSession/TraderBe
    anHomeImpl_ServiceStub.class' in document
    '/app/weblogic/planit/weblogic/myserver/public_html'
    So that means if I place the client files in this
    directory
    (i.e. public_html) it would run. But I am wonderingwhere
    do
    I need to specify that the server should look in
    "ClientClasses" directory and not in "public_html"
    directory.
    What else could be wrong......
    Sincerely,
    Ahmad

  • Challenge: call local ejb from remote ejb on weblogic 9.2

    Hi ALL,
    How do I call to local ejb from remote ejb object. The jar file is deployed on weblogic server 9.2, if you want get it http://geocities.yahoo.com.br/lindembe/BEAProject.jar and the source code are http://geocities.yahoo.com.br/lindembe/BEAProject.zip. It is a sample app with two ejb that works so good on JBOSS, JOnAS, but BEA Weblogic.....
    The complete problem you watch http://forum.java.sun.com/thread.jspa?threadID=768718&messageID=4387570#4387570
    or
    http://forums.bea.com/bea/message.jspa?messageID=600043148&tstart=0

    Your code in SigemFacadeBean should just do:
    InitialContext ctx = new InitialContext();
    when you lookup the local EJB. (This will work on all app servers. There's no need to put an app-server specific intial context factory in your code.)
    Also, you can remove the jndi-name setting for the local ejb from your weblogic-ejb-jar.xml. jndi-name is only applied to remote ejbs.
    -- Rob
    WLS Blog http://dev2dev.bea.com/blog/rwoollen/

  • Error while importing EJB model in Web dynpro: Unable to fetch the EJBs.

    Hi,
    We are getting the below error while importing ejb model to Web dynpro.
    Error :
    Unable to fetch the EJBs. Check if the selected Enterprise Application contain the EJBs.
    I have created the public part-> It has a reference to EJB client and the enterprise application also has reference to the EJB project.The EJB is also added in dependency list.
    But still we are getting this error. Could anyone please explain what can i do to solve this issue.
    Best Regards,
    Karthika

    Hi Vishweshwara,
    Thanks for your reply.
    Please find the steps i followed while importing EJB model in webdynpro.
    1. The Entity forwarding permission has been enabled.
    2. public part reference has been created and through the reference entity option the ejbDC->Client public part is selected.
    I followed all the steps mentioned in the document. But still i am getting that error. In EJB DC we have list of JPA entities and stateless session beans are exposed as a webservice(top-down manner).The enterprise application has a reference to the EJB DC.
    I could be able to invoke the ejb service beans from ejb explorer and Webservice navigator.
    I am able to insert,delete and modify the records from there.
    Please let me know what could i do to resolve this error?
    Best Regards,
    Karthika
    Edited by: SAKarthika on Apr 29, 2011 1:43 PM

  • How to lookup a EJB 3.0 session bean which is deployed in WebLogic 10.3

    Now Jdeveloper 11.1.1, is giving WebLogic server 10.3.
    With internal WebLogic server, when I created a Sample client, it generated code as:
    private static Context getInitialContext() throws NamingException {
        Hashtable env = new Hashtable();
        // WebLogic Server 10.x connection details
        env.put( Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory" );
        env.put(Context.PROVIDER_URL, "t3://127.0.0.1:7101");
        return new InitialContext( env );
    public static void main(String [] args) {
        try {
            final Context context = getInitialContext();
            DefaultSession defaultSession = (DefaultSession)context.lookup("property-DefaultSession#com.vs.property.model.session.DefaultSession");
        } catch (Exception ex) {
    }How to update the above code to lookup the EJB 3.0 session beans with an external WebLogic server 10.3?
    Is there any documentation available on how to install weblogic, troubleshoot, debug, WebLogic server 10.3?
    regds
    -raju

    Raju,
    Hi, to start, here is a tutorial on a quickstart web application using an EJB 3.0 stateless session bean that fronts a container managed EclipseLink JPA entity manager on WebLogic 10.3, you will find references there to other general WebLogic documentation.
    [http://wiki.eclipse.org/EclipseLink/Examples/JPA/WebLogic_Web_Tutorial]
    using @EJB injection on the client instead of a JNDI lookup as below
    [http://edocs.bea.com/wls/docs103/ejb30/annotations.html#wp1417411]
    1) in your second env.put I noticed that your t3 port is 7101, I usually use the default 7001 - but It looks like this port is valid for the JDeveloper embedded version of WebLogic server runs - just verify that it matches the port of your server.
    2) your name#qualified-name lookup looks ok. Verify that the jndi-name element is set in your weblogic-ejb-jar.xml for non injection clients like the following
    &lt;weblogic-ejb-jar&gt;
    &lt;weblogic-enterprise-bean&gt;
    &lt;ejb-name&gt;ApplicationService&lt;/ejb-name&gt;
    &lt;jndi-name&gt;ApplicationService&lt;/jndi-name&gt;
    3) as a test outside of your application - launch the WebLogic admin console and goto the testing tab of your bean in [Home &gt; Summary of Deployments &gt; "application" &gt; "session bean name"
    thank you
    /michael : http://www.eclipselink.org                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to lookup an EJB from JSP on a Remote Server in JES2005Q4

    Hi,
    I am having two different domain (domain1,domain2) respectvely. My ABC.ear j2eee application is deployed on domain2 and its iiop port is 33703.In domain1 i have xyz.war (web application) and it's IIOP port is 3700 .In xyz.war i am having CallEJB.jsp file.In this Jsp file i want to lookup an EJB Service called PaymentEJB(JNDI Name is ejb/PaymentEJB).
    The code is below
    InitialContext context=new InitialContext();
    Object objRef=context.lookup("corbaname:iiop:andaman:33703#ejb/PaymentEJB");
    I am getting the following error.
    [#|2005-12-14T16:42:03.422+0530|SEVERE|sun-appserver-pe8.1_02|javax.enterprise.resource.corba._DEFAULT_.rpc.transport|_ThreadID=11;|"IOP00410216: (COMM_FAILURE) Unable to create IIOP listener on the specified host/port: all interfaces/3700"
    org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 216 completed: No
    at com.sun.corba.ee.impl.logging.ORBUtilSystemException.createListenerFailed(ORBUtilSystemException.java:2661)
    My doubt is
    1.While starting domain1 and domain2 iiop listeners are started on the port 3700 and 33703.in that case why EJB lookup tries to create listener on one more time.
    2.I am looking the 33703 port only.but it tries to create port on 3700 why?
    3.It was working till JES2005Q1.Is there any patch i need to install? or i need to change anything in my code.
    I am frustrated with this error for past one week.I will be happy if some body will give me the peace of mind(thru some solution).

    Hi,
    I am having two different domain (domain1,domain2) respectvely. My ABC.ear j2eee application is deployed on domain2 and its iiop port is 33703.In domain1 i have xyz.war (web application) and it's IIOP port is 3700 .In xyz.war i am having CallEJB.jsp file.In this Jsp file i want to lookup an EJB Service called PaymentEJB(JNDI Name is ejb/PaymentEJB).
    The code is below
    InitialContext context=new InitialContext();
    Object objRef=context.lookup("corbaname:iiop:andaman:33703#ejb/PaymentEJB");
    I am getting the following error.
    [#|2005-12-14T16:42:03.422+0530|SEVERE|sun-appserver-pe8.1_02|javax.enterprise.resource.corba._DEFAULT_.rpc.transport|_ThreadID=11;|"IOP00410216: (COMM_FAILURE) Unable to create IIOP listener on the specified host/port: all interfaces/3700"
    org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 216 completed: No
    at com.sun.corba.ee.impl.logging.ORBUtilSystemException.createListenerFailed(ORBUtilSystemException.java:2661)
    My doubt is
    1.While starting domain1 and domain2 iiop listeners are started on the port 3700 and 33703.in that case why EJB lookup tries to create listener on one more time.
    2.I am looking the 33703 port only.but it tries to create port on 3700 why?
    3.It was working till JES2005Q1.Is there any patch i need to install? or i need to change anything in my code.
    I am frustrated with this error for past one week.I will be happy if some body will give me the peace of mind(thru some solution).

Maybe you are looking for