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)*

Similar Messages

  • 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

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

  • Local EJBs in Weblogic 12c

    Hi - We are in the process of migrating our applications from Weblogic 10.3 to 12c. Due to legacy nature of the application, it's still using EJB 2.x
    Can somebody please let us know if Weblogic 12c fully supports EJB 2.x APIs and specifications. We are having some local EJBs in the code too. Would there be any potential issues migrating any local/remote EJBs or is it supposed to work out of the box?
    Note: We have already gone through the article http://docs.oracle.com/cd/E24329_01/web.1211/e24446/compatibility.htm#INTRO112 and have modified our EJBs to use EJBGen annotations. We have also run our EJBs through 12c appc and it does not report any such errors.
    Thanks!

    I guess the local JNDI name will be visible only when you look up from the
    same .ear scoped applications. It will not be visible in the global JNDI
    tree (applications outside of the .ear cannot access the bean as it is
    local).
    I am not sure what you refer by testing via console. If you want to access
    the bean from a different application (another .jar or .war which is not
    part of a .ear), then you should use remote views instead of local views.
    --Sathish
    <Santiago Abadia> wrote in message news:[email protected]..
    Hi.
    There isn't any error message in the server log. It says that deployment
    is sucessful.
    The message that appears when I try to test the EJB in the console is:
    "There was a problem determining the JNDI Name of the given bean."
    Thanks

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

  • Problem in calling Local EJB in weblogic 7.0

    Hi,
    I'm calling a Local Ejb from a client application, but i'm getting the following exception
    Exceptionjavax.naming.NameNotFoundException: Unable to resolve 'local' Resolved:
    '' Unresolved:'local' ; remaining name 'local'
    I'm Using Weblogic 7.0
    But I have given the correct JNDI name in the deployment descriptor and whereever necessary
    If any one knows abt this, pls reply back, its urgent
    Thanks in advance
    Kiran

    Hi again,
    The exact exception is below,
    Exceptionjavax.naming.LinkException: [Root exception is javax.naming.NameNotFoundException: Invalid  name:app/ejb/kmml.jar#MMLDatavalidationEJB/local-home]; Link Remaining Name: 'java:app/ejb/kmml.jar#MMLDatavalidationEJB/local-home'
    thanks
    kiran

  • Very Urgent !!! Exception in looking up Local EJB from Servlet in WSAD 5.1

    Hi,
    I have a servlet and a local EJB. The servlet and EJB are deployed on same application server but in different J2EE applications i.e. different EAR files.
    When I lookup an EJB with remote interfaces from servlet everything works fine. But when I try to lookup EJB with local interfaces from
    Servlet I get following Exception.
    Exception Stack: -
    ========================================================
    avax.naming.NameNotFoundException: Context: localhost/nodes/localhost/servers/server1, name: TestLocalHome: First component in name TestLocalHome not found. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
    [12/8/05 14:14:05:047 IST] 7debf35b SystemErr R      at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.do_resolve_complete_info(WsnOptimizedNamingImpl.java:968)
    [12/8/05 14:14:05:047 IST] 7debf35b SystemErr R      at com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase.resolve_complete_info(WsnOptimizedNamingImplBase.java:1399)
    [12/8/05 14:14:05:047 IST] 7debf35b SystemErr R      at com.ibm.WsnOptimizedNaming._NamingContextStub.resolve_complete_info(Unknown Source)
    [12/8/05 14:14:05:047 IST] 7debf35b SystemErr R      at com.ibm.ws.naming.jndicos.CNContextImpl.cosResolve(CNContextImpl.java:3491)
    [12/8/05 14:14:05:047 IST] 7debf35b SystemErr R      at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1519)
    [12/8/05 14:14:05:047 IST] 7debf35b SystemErr R      at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1480)
    [12/8/05 14:14:05:047 IST] 7debf35b SystemErr R      at com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1187)
    [12/8/05 14:14:05:047 IST] 7debf35b SystemErr R      at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:1067)
    [12/8/05 14:14:05:047 IST] 7debf35b SystemErr R      at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:132)
    [12/8/05 14:14:05:047 IST] 7debf35b SystemErr R      at javax.naming.InitialContext.lookup(InitialContext.java:360)
    [12/8/05 14:14:05:047 IST] 7debf35b SystemErr R      at org.apache.jsp._DomainClient._jspService(_DomainClient.java:95)
    [12/8/05 14:14:05:047 IST] 7debf35b SystemErr R      at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java:89)
    [12/8/05 14:14:05:047 IST] 7debf35b SystemErr R      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    [12/8/05 14:14:05:047 IST] 7debf35b SystemErr R      at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:344)
    [12/8/05 14:14:05:047 IST] 7debf35b SystemErr R      at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java:669)
    [12/8/05 14:14:05:047 IST] 7debf35b SystemErr R      at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:767)
    [12/8/05 14:14:05:047 IST] 7debf35b SystemErr R      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    [12/8/05 14:14:05:047 IST] 7debf35b SystemErr R      at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
    [12/8/05 14:14:05:047 IST] 7debf35b SystemErr R      at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
    [12/8/05 14:14:05:047 IST] 7debf35b SystemErr R      at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
    [12/8/05 14:14:05:047 IST] 7debf35b SystemErr R      at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
    [12/8/05 14:14:05:047 IST] 7debf35b SystemErr R      at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
    [12/8/05 14:14:05:047 IST] 7debf35b SystemErr R      at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
    [12/8/05 14:14:05:047 IST] 7debf35b SystemErr R      at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
    [12/8/05 14:14:05:047 IST] 7debf35b SystemErr R      at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:983)
    [12/8/05 14:14:05:047 IST] 7debf35b SystemErr R      at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:564)
    [12/8/05 14:14:05:062 IST] 7debf35b SystemErr R      at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200)
    [12/8/05 14:14:05:062 IST] 7debf35b SystemErr R      at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:119)
    [12/8/05 14:14:05:062 IST] 7debf35b SystemErr R      at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:276)
    [12/8/05 14:14:05:062 IST] 7debf35b SystemErr R      at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
    [12/8/05 14:14:05:062 IST] 7debf35b SystemErr R      at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)
    [12/8/05 14:14:05:062 IST] 7debf35b SystemErr R      at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
    [12/8/05 14:14:05:062 IST] 7debf35b SystemErr R      at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
    [12/8/05 14:14:05:062 IST] 7debf35b SystemErr R      at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:618)
    [12/8/05 14:14:05:062 IST] 7debf35b SystemErr R      at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:439)
    [12/8/05 14:14:05:062 IST] 7debf35b SystemErr R      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:672)
    ========================================================
    Please help asap.
    Regds
    VJ.

    The ejb spec only defines local ejb access within the same application. It's possible some app servers support access from a different application but it wouldn't be portable, nor would it work within the J2EE SDK or Sun Java System App Servers. To access a local ejb from a web component or ejb , define an ejb-local-ref in the client component's standard .xml file (web.xml or ejb-jar.xml) and use the ejb-link element to specify the ejb-name of the target ejb.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Getting NameNotFoundException while trying to look up timer from startup cl

    Hi all,
    I am getting NameNotFoundException while trying to look up timer from startup class.
    I have configured commonj.timers.TimerManager in ejb-jar.xml of my MDB. I am using statrtup classes to initialize some static components immidiate to the MDB's active state. I have to initialize the timer manager object immidiate to the MDB's active state which is configured in ejb-jar.xml. I wrote this lookup logic in postStart() method of ApplicationLifecycleListener, The method getting called but the lookup logic getting failed, the same look up logic is working in MDB class (MDBTimer.java). I have tried different ways, I did’nt get solution, finally I am posting the problem here.
    Could any of weblogic experts please help out on this Issue?
    Here I am giving my code.
    weblogic-application.xml
    <?xml version='1.0' encoding='UTF-8'?>
    <weblogic-application
         xmlns="http://www.bea.com/ns/weblogic/weblogic-application" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-application http://www.bea.com/ns/weblogic/weblogic-application/1.0/weblogic-application.xsd">
         <listener>
              <listener-class>my.examples.mdb.timer.TestApplicationListener</listener-class>
         </listener>     
    </weblogic-application>
    ejb-jar.xml
              <ejb-jar 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/j2ee/ejb-jar_3_0.xsd"
                   version="3.0">
                   <enterprise-beans>
                        <message-driven>
                             <ejb-name>MyTimerMDB</ejb-name>
                             <ejb-class>my.examples.mdb.timer.MDBTimer
                             </ejb-class>
                             <resource-ref>
                                  <description>My Default Timer Manager</description>
                                  <res-ref-name>timer/MyDefaultTimer</res-ref-name>
                                  <res-type>commonj.timers.TimerManager</res-type>
                                  <res-auth>Container</res-auth>
                                  <res-sharing-scope>Unshareable</res-sharing-scope>
                             </resource-ref>
                        </message-driven>
                   </enterprise-beans>
              </ejb-jar>
    MDBTimer.java
    package my.examples.mdb.timer;
    import javax.ejb.MessageDriven;
    import javax.ejb.TransactionAttribute;
    import javax.ejb.TransactionAttributeType;
    import javax.jms.Message;
    import javax.jms.MessageListener;
    import javax.jms.ObjectMessage;
    import commonj.timers.Timer;
    import commonj.timers.TimerManager;
    @MessageDriven(mappedName = "TEST_Q", name = "MyTimerMDB", activationConfig = {
              @javax.ejb.ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
              @javax.ejb.ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
              @javax.ejb.ActivationConfigProperty(propertyName = "transactionType", propertyValue = "Container"), })
    @TransactionAttribute(TransactionAttributeType.REQUIRED)
    public class MDBTimer implements MessageListener {
         public static TimerManager manager = null;
         @Override
         public void onMessage(Message arg0) {
              System.out.println("onMessage() method called...\n\n");
              if (arg0 instanceof ObjectMessage) {
                   ObjectMessage msg = (ObjectMessage) arg0;
                   try {
                        if (msg.getObject() instanceof String) {
                             Thread.sleep(1000);
                             System.out
                                       .println("Message received >> " + msg.getObject());
                   } catch (Exception e) {
                        e.printStackTrace();
              System.out.println("onMessage() method returned...\n\n");
              if(manager==null){
                   manager=MyUtil.getTimerManager();
    TestApplicationListener.java
    package my.examples.mdb.timer;
    import commonj.timers.TimerManager;
    import weblogic.application.ApplicationException;
    import weblogic.application.ApplicationLifecycleEvent;
    import weblogic.application.ApplicationLifecycleListener;
    public class TestApplicationListener extends ApplicationLifecycleListener {
         public void preStart(ApplicationLifecycleEvent evt)throws ApplicationException {
              String logStr = ">>>>TestApplicationListener.preStart()>>>>";
              System.out.println(logStr+"entered...");
              super.preStart(evt);
              System.out.println(logStr+"leveaing...");
         public void postStart(ApplicationLifecycleEvent evt)throws ApplicationException {
              String logStr = ">>>>TestApplicationListener.postStart()>>>>";
              System.out.println(logStr+"entered...");
              super.postStart(evt);
              TimerManager timerManager = MyUtil.getTimerManager();
              System.out.println(logStr+"Got timer manager ==> "+timerManager);
              System.out.println(logStr+"leveaing...");
         public void preStop(ApplicationLifecycleEvent evt)throws ApplicationException {
              String logStr = ">>>>TestApplicationListener.preStop()>>>>";
              System.out.println(logStr+"entered...");
              TimerManager timerManager = MyUtil.getTimerManager();
              System.out.println(logStr+"Got timer manager ==> "+timerManager);
              super.preStop(evt);
              System.out.println(logStr+"leveaing...");
         public void postStop(ApplicationLifecycleEvent evt) throws ApplicationException{
              String logStr = ">>>>TestApplicationListener.postStop()>>>>";
              System.out.println(logStr+"entered...");
              super.preStop(evt);
              System.out.println(logStr+"leveaing...");
    MyUtil.java
    package my.examples.mdb.timer;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import commonj.timers.TimerManager;
    public class MyUtil {
         public static TimerManager getTimerManager() {
              TimerManager timerManager = null;
              try {
                   InitialContext ctx = new InitialContext();
                   timerManager = (TimerManager) ctx
                             .lookup("java:comp/env/timer/MyDefaultTimer");
                   System.out
                             .println("@@@@@Looked-up using java:comp/env/timer/MyDefaultTimer : "
                                       + timerManager);
              } catch (NamingException e) {
                   e.printStackTrace();
              return timerManager;
    }

    Thaks for your valuble information. I tried as you suggested!!! But NO luck . Still I am getting the issue.
    I am using a class(TestApplicationListener) implements ApplicationLifecycleListener to listen my application.
    I have overriden the methods preStart(), postStart(), preStop() and postStop().
    Given following entries in weblogic-application.xml
    <listener>
              <listener-class>my.examples.mdb.timer.TestApplicationListener</listener-class>
    </listener>     
    Also given
    <ejb>
                   <start-mdbs-with-application>false</start-mdbs-with-application>
    </ejb>          As you suggested.
    If I try to look-up timer manager from postStart() method of TestApplicationListener then it is giving NameNotFoundException
    , same exception is giving in preStop() method.
    If it is problem with initialization; I think, it should not give problem with preStop() method. (Correct me if I am wrong)
    If I try to lookup the timer manager from onMessage() method of my MDB, It is not giving any problem.
    I didn’t understand the reason why it is happening.
    Note: All the life cycle methods (preStart(), postStart(), preStop() and postStop() ) are getting executed when I start/stop/redeploy my application from console.

  • A problem determining the JNDI Name of a local EJB with WL 8.1

    Hi,
    I created a very simple local EJB and deployed it with Weblogic8.1. When I test
    it in the Weblogic server admin page, I got the following message:
    "The EJB MyLocal has not been tested successfully. There was a problem determining
    the JNDI Name of the given bean."
    Can anyone help figure out the problem?
    Thanks
    Henry

    Does the ejb have a target server specified?
    Does the Ejb have a Jndi binding as specified in the <local-jndi-name></local-jndi-name>
    element of weblogic-ejb-jar.xml?
    thanks,
    Deepak
    "Henry" <[email protected]> wrote:
    >
    >
    Hi,
    I created a very simple local EJB and deployed it with Weblogic8.1. When
    I test
    it in the Weblogic server admin page, I got the following message:
    "The EJB MyLocal has not been tested successfully. There was a problem
    determining
    the JNDI Name of the given bean."
    Can anyone help figure out the problem?
    Thanks
    Henry

  • Java Generics in Ejbs WebLogic 9.2 MP1 WindowsXP Sun JDK

    Hi guys,
    I tried to deploy our application on Weblogic Server 9.2 MP1 (Windows, Sun JDK) and during deployment I have this error see bellow.
    Can somebody tell me what is the problem with generics and EJB compiler?
    Is necessary to add any path or change any server settings?
    Thanks for help
    Robert
    location: interface
    ...daoadapter_DaoAdapter_rge4uk_Intf
    public void batchPersist(java.util.List<T> arg0);
    ^
    ...daoadapter_DaoAdapter_rge4uk_Intf.java:20: cannot find symbol
    symbol : class T
    location: interface
    2 errors
    at weblogic.utils.compiler.CompilerInvoker.compileMaybeExit(CompilerInvoker.java:435)
    at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvoker.java:295)
    at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvoker.java:303)
    at weblogic.ejb.container.ejbc.EJBCompiler.doCompile(EJBCompiler.java:309)
    at weblogic.ejb.container.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:497)
    at weblogic.ejb.container.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:464)
    at weblogic.ejb.container.deployer.EJBDeployer.runEJBC(EJBDeployer.java:430)
    at weblogic.ejb.container.deployer.EJBDeployer.compileJar(EJBDeployer.java:752)
    at weblogic.ejb.container.deployer.EJBDeployer.compileIfNecessary(EJBDeployer.java:655)
    at weblogic.ejb.container.deployer.EJBDeployer.prepare(EJBDeployer.java:1199)
    at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:354)
    at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
    at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:360)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
    at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:56)
    at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:46)
    at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:615)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
    at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:191)
    at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:147)
    at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:61)
    at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperatio
    n.java:189)
    at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:87)
    at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217)
    at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:718)
    at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1185)
    at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:247)
    at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:15
    7)
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(Deploymen
    tReceiverCallbackDeliverer.java:157)
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiv
    erCallbackDeliverer.java:12)
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCal
    lbackDeliverer.java:45)
    at weblogic.work.ServerWorkManagerImpl$WorkAdapterImpl.run(ServerWorkManagerImpl.java:518)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)

    Thanks Matt for your answer.
    But I don't finish my testing :)
    I tried to deploy the same application on Weblogic 9.2 MP2 and then MP3 (sun jdk domain) and I didn't have problem with generics (application was correctly deployed and running).
    Then something was fixed in newer versions or may be bea guys support more then is in EJB 2.x specification.
    My next step, I'll try to deploy it on Jrockit domain and I give a note to conference what happen, may be it can help to somebody else.
    Thanks
    Robert

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

  • Does return value of Local EJB need to be serializable?

    Hi,
    I know It's a bit lazy of me not looking this up in the specs, but I'll give it a go anyway. Does the return value of a Local EJB need to be a serializable object? For my app it would be very convenient to return a org.w3c.dom.Document.
    Kind Regards,
    Rune Bj�rnstad.

    If you use LocalEJB, all params addresses are referencies, so you needn't use serializable interface.

  • Please Help me Xdoclet CMP EJBs weblogic 8.1

    Hi all,
    I am new to both xdoclet and weblogic.
    I have confusion about foriegn-key-column and key-column in @weblogic.column-map tag for many to many relationship
    I have many to many relationship between Order EJB and Item EJB. join table name is OrderLine.
    In Order EJB I have cmr method
    public abstract java.util.Collection getItems();
    which one @weblogic.column-map tag is correct? is foriegn-key reference from Order table to OrderLine table or OrderLine table to Order table. My impression is it is from OrderLine table to Order table. Just want to confirm it.
    1)
    public abstract class OrderEJB implements EntityBean {
    * @ejb.interface-method
    * view-type="local"
    * @ejb.relation
    * name="OrdersItems"
    * role-name="Order"
    * @weblogic.relation
    * join-table-name="OrderLine"
    * generate="false"
    * @weblogic.column-map
    * foriegn-key-column="order_itemId"
    * key-column="orderline_item_id"*
    public abstract Collection getItems();
    Or
    2)
    public abstract class OrderEJB implements EntityBean {
    * @ejb.interface-method
    * view-type="local"
    * @ejb.relation
    * name="OrdersItems"
    * role-name="Order"
    * @weblogic.relation
    * join-table-name="OrderLine"
    * generate="false"
    * @weblogic.column-map
    * foriegn-key-column="orderline_itemId"
    * key-column="order_item_id"*
    public abstract Collection getItems();
    My second question is suppose I have composite foriegn-key, in that case how will I define @weblogic.column-map tags,
    will it be something like this?
    public abstract class OrderEJB implements EntityBean {
    * @ejb.interface-method
    * view-type="local"
    * @ejb.relation
    * name="OrdersItems"
    * role-name="Order"
    * @weblogic.relation
    * join-table-name="OrderLine"
    * generate="false"
    * @weblogic.column-map
    * foriegn-key-column="fk_col1"
    * key-column="pk_col1"*
    * @weblogic.column-map
    * foriegn-key-column="fk_col2"
    * key-column="pk_col2"
    public abstract Collection getItems();
    Thanks in advance

    Create a web application, put you JSP in the web application, put the web application in the server. And Robert is you Father's Brother.

  • 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();
    }

Maybe you are looking for

  • Connecting to a website and reading from a file

    Hi all. I want to be able to connect to a website of my choosing (what class will i need to import of this?) and then read from a txt file. The text file will look like this: String integer So i first want to read the string in and then the integer.

  • Site-to-site vpn with 2 asa and home router

    I am trying to establish a site-to-site vpn between 2 ASAs and am able to get the tunnel to establish and can get connectivity from the remote end of the connection to the local side. However, traffic from the local side is not able to get to the rem

  • How do I move new photos to an album

    That is one question.  iPhone 4s. I have created an album.  I select each potho individeually.  Then I can copy them, but cannot then find the album into which I want to paste. Is there no way to select a group of photos on the phone? Second question

  • Unable to initialize the Microsoft Exchange Information Store service because the clocks on the client and on the server machine are skewed

    Each time I restart this exchange server, the Information Store and System Attendant don't start. If It try to manually start the services, I get the follow errors: Event ID 5003: Unable to initialize the Microsoft Exchange Information Store service

  • Business partner Archive Issue in Web UI

    Hi All, I have a requirement to set the archive flag in BP while edit it in Web UI . Once user select status as close in EDIT mode of BP and press SAVE button then it should set the archive flag in backend. could you please let us know where can I wr