How can i look up a EJB residing in different machine from client side?

hai ,
How can i look up a EJB residing in different machine from client side?
this is my code...........i don't know what should i use as Initial Context Factory...................i am using a sun appserver 8............
package com.parx.lms.lmsdelegate;
import com.parx.lms.exception.LMSException;
import javax.naming.Context;
import javax .ejb.CreateException;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.rmi.PortableRemoteObject;
import java.rmi.RemoteException;
import com.parx.lms.controller.*;
import com.parx.lms.vo.UserVo;
import com.parx.lms.exception.BusinessException;
import java.util.Hashtable;
import java.lang.*;
public class LmsDelegate{
private final static String JNDI_NAME="LmsBean";
private static String url="http://localhost:4848";
public static Lms lms = null;
public void getController() throws CreateException,
NamingException,RemoteException{
if(lms == null){
Hashtable h=new Hashtable();
h.put(Context.INITIAL_CONTEXT_FACTORY," ********what should i use here???????*************************");
h.put(Context.PROVIDER_URL,url);
System.out.println("Before Loading Context in Delegate");
Context ctx=new InitialContext(h);
System.out.println("Loaded Context in Delegate");
Object obj=ctx.lookup(JNDI_NAME);
System.out.println("Loaded Object in Delegate");
System.out.println("Before Loading Home in Delegate");
LmsHome home = (LmsHome )PortableRemoteObject.narrow(obj,com.parx.lms.controller.LmsHome.class);
System.out.println("Loaded Home in Delegate");
lms = home.create();
System.out.println("Loaded remote in Delegate");
public void addUserDelegate(UserVo vo) throws BusinessException{
try{
getController();
System.out.println("Before calling the addUser of Session");
lms.addUser(vo);
}catch(CreateException e){
System.out.println("Create Exception in Delegate due to--->"+e);
e.printStackTrace();
throw new BusinessException(e);
}catch(NamingException e){
System.out.println("Naming Exception in Delegate due to--->"+e);
e.printStackTrace();
throw new BusinessException(e);
catch(RemoteException e){
System.out.println("Remote Exception in Delegate due to--->"+e);
e.printStackTrace();
throw new BusinessException(e);
}catch(LMSException e){
System.out.println("duplicate user name--->"+e);
e.printStackTrace();
throw new BusinessException(e);
pls help me..........

h.put(Context.INITIAL_CONTEXT_FACTORY," ********what should i use here???????*************************")
Each app server provides their own jndi factory class. For ex for weblogic it is weblogic.jndi.WLInitialContextFactory. SInce you are using sun app server, check if there are any examples to find out or the docs.
private static String url="http://localhost:4848
Since the client is in a different machine the localhost is not going to work here. provide the url or the machine name of the system in which ur sunapp server is running. In addition u will need to have the stubs of the remote interfaces in ur client machine.

Similar Messages

  • How can I make an external link (to a different folder) from the main menu?

    How can I make an external link (to a different folder) from the main menu?

    If the folder is outside the Muse page, you will have to insert manual HTML to define a more complex URL like e.g. ../_stuff for going one level up and then into a folder called "_stuff" The deeper you are in the hierarchy, the more ../ you will have to add to climb up.
    Mylenium

  • How can I delete a sparse bundle for an old machine from a Time Capsule?

    I have multiple Macs backed up to a Time Capsule. I have given away one and want to delete the backup for the old system completely. Trying to move the sparse bundle for the named system to the trash seems to hang with the barber pole forever. Do I need to wait several hours for the delete to happen?

    You might want to take a look at the blue box at the bottom of this document from Time Capsule and Time Machine expert Pondini
    http://web.me.com/pondini/Time_Machine/TCQ5.html

  • I got bulks of videos in my ipad 2, how can i look at my videos in list display? or make the fonts in my movie gallery smaller?

    I got bulks of videos in my ipad 2, how can i look at my videos in list display? It's hard for me to look through my gallery with grid display..
    any ideas?

    There is no list display option. If there were such an option, it would likely be available within the Videos app.

  • I lost my iTunes library on my pc when the hard drive crashed. None of the data on the drive was recoverable and I did not have a backup. How can I get the music that resides on my ipod nano (4th generation back onto the new hard drive on my pc.

    I lost my iTunes library on my pc when the hard drive crashed. None of the data on the drive was recoverable and I did not have a backup either locally or on the cloud. Much of the music is from old vinyl and podcasts which are no longer available.
    How can I get the music that resides on my ipod nano (4th generation) back onto the new hard drive on my pc.
    I have been reluctant to install iTunes on the new hard drive out of fear that I will lose all the contents on the ipod if I try to synch to the new hard drive.
    Help!

    No backup is a huge mistake.
    You can redownload some itunes purchases in some countries:
    Downloading past purchases from the App Store ... - Apple - Support

  • How can i look up a TxDataSource bound in Weblogic JNDI

              HI,
              How can i look up a TxDataSource bound in weblogic JNDI. When i access it using
              javax.sql.XADataSourse ds = (XADataSourse)context.lookUp(jndiName)
              .it gives me classcast exception.
              and if i lookup it using javax.sql.DataSource like below
              javax.sql.DataSourse ds = (DataSourse)context.lookUp(jndiName)
              then while executing my sql on the connection object it throws some other excepiton
              like below
              java.sql.SQLException: weblogic.rmi.extensions.RemoteRuntimeException: Unexpected
              Exception - with nested exception:
              [weblogic.rjvm.PeerGoneException: ; nested exception is:
                      java.io.EOFException]
              at weblogic.jdbc.rmi.SerialStatement.executeQuery(SerialStatement.java:92)
              at TestTransactionMgr.main(TestTransactionMgr.java:46)
              How can i solve this problem.. Actually my application needs to handle distributed
              transactions so i need to implement XADataSource.
              can somebody help me iin this.
              Thanks & Regards
              Akhil Nagpla
              

              HI,
              How can i look up a TxDataSource bound in weblogic JNDI. When i access it using
              javax.sql.XADataSourse ds = (XADataSourse)context.lookUp(jndiName)
              .it gives me classcast exception.
              and if i lookup it using javax.sql.DataSource like below
              javax.sql.DataSourse ds = (DataSourse)context.lookUp(jndiName)
              then while executing my sql on the connection object it throws some other excepiton
              like below
              java.sql.SQLException: weblogic.rmi.extensions.RemoteRuntimeException: Unexpected
              Exception - with nested exception:
              [weblogic.rjvm.PeerGoneException: ; nested exception is:
                      java.io.EOFException]
              at weblogic.jdbc.rmi.SerialStatement.executeQuery(SerialStatement.java:92)
              at TestTransactionMgr.main(TestTransactionMgr.java:46)
              How can i solve this problem.. Actually my application needs to handle distributed
              transactions so i need to implement XADataSource.
              can somebody help me iin this.
              Thanks & Regards
              Akhil Nagpla
              

  • How can one invoke a WebLogic EJB from a BPEL Server hosted on OC4J?

    How can one invoke a WebLogic EJB from a BPEL Server hosted on OC4J?
    Reason I ask is I keep getting this error:
    javax.naming.NoInitialContextException: Cannot instantiate cla
    ss: weblogic.jndi.WLInitialContextFactory [Root exception is java.lang.ClassNotF
    oundException: weblogic.jndi.WLInitialContextFactory]
    Note: I am using <bpelx:exec> as a way to execute some java program.
    Essentially my java client (essentially an EJB client hosted on Oc4J) needs access to wlclient.jar since it needs access to weblogic.jndi.WLInitialContextFactory. I have a EJB client running on BPEL server hosted on Oc4J that needs to access some EJBs hosted on weblogic.
    Where do I place this wlclient.jar so that BPEL PM can start peacefully and at runtime discover the InitialContextFactory classes?
    Placing it in the j2ee/home/applib doesn't solve the problem. The server fails to start up if I do this
    I tried placing it in BPEL-INF\lib directory ...
    I still get the same exception...see below for exception dump
    I verified the BPEL suitcase, and it in fact does contain the jar file wlclient.jar
    integration\orabpel\domains\default\deploy contains the bpel_BPELProcess2_1.0.jar file and snapshot of that is as follows:
    <PRE>
    &#9474; bpel.xml
    &#9474; BPELProcess2.bpel
    &#9474; BPELProcess2.jpr
    &#9474; BPELProcess2.wsdl
    &#9474; bpel_BPELProcess2_1.0.jar
    &#9474; build.xml
    &#9474; buildxml.copy
    &#9474; graphics.xml
    &#9474;
    &#9500;&#9472;&#9472;&#9472;BPEL-INF
    &#9474; &#9492;&#9472;&#9472;&#9472;lib
    &#9474; myEJB.jar
    &#9474; wlclient.jar
    &#9474;
    &#9500;&#9472;&#9472;&#9472;META-INF
    &#9474; MANIFEST.MF
    &#9474;
    &#9492;&#9472;&#9472;&#9472;output
    bpel_BPELProcess2_1.0.jar
    </PRE>
    I tried using the BPEL-INF\jar directory...Is this something the obant automatically detects? or do I have to modify the build.xml? I created this directory and let Jdev deploy to local BPEL server->default domain handle it
    #####################3
    I even tried copying the wlclient.jar to
    integration\orabpel\system\classes but this doesn't help since the BPEL PM fails to start if I explode this jar into this directory.
    In short,where do I place the wlclient.jar so that this exception can be contained.
    I edited the build.xml to point to the jar, that too didn't work, unless I made some mistake in the file
    <bpelc classpath="${basedir}/BPEL-INF/classes;${home}/system/classes;${home}/lib/j2ee_1.3.01.jar;${basedir}/BPEL-INF/jar/wlclient.jar" input="${basedir}/bpel.xml" rev="${rev}" deploy="${deploy}" />
    </target>
    </project>
    DETAILS on ERROR
    I get the following error
    Process "BPELProcess2" (revision "1.0") successfully compiled.
    <2005-12-14 09:17:55,770> <INFO> <default.collaxa.cube.engine.deployment> Proces
    s "BPELProcess2" (revision "1.0") successfully loaded.
    05/12/14 09:18:36 weblogic.jndi.WLInitialContextFactory
    javax.naming.NoInitialContextException: Cannot instantiate cla
    ss: weblogic.jndi.WLInitialContextFactory [Root exception is java.lang.ClassNotF
    oundException: weblogic.jndi.WLInitialContextFactory]
    05/12/14 09:18:36 at javax.naming.spi.NamingManager.getInitialContext(Nami
    ngManager.java:652)
    05/12/14 09:18:36 at javax.naming.InitialContext.getDefaultInitCtx(Initial
    Context.java:243)
    05/12/14 09:18:36 at javax.naming.InitialContext.init(InitialContext.java:
    219)
    05/12/14 09:18:36 at javax.naming.InitialContext.<init>(InitialContext.jav
    a:195)
    05/12/14 09:18:36 at com.ejb.test.MapFinder.getDefaultMapName(Map
    Finder.java:37)
    ##################3
    with the bpelx all I have is two lines of code that creates a java object and calls a method on it.
    The method does this:
        private String initialContextFactory = "weblogic.jndi.WLInitialContextFactory";
        private String providerUrl = "t3://localhost:7001";
        private String urlPkgPrefixes = "";
        private String mapEjbJndiName = "ejb/mycompany/Redlands";
        public String getDefaultMapName() {
          try {
              Hashtable env = new Hashtable();
              env.put(Context.INITIAL_CONTEXT_FACTORY, getInitialContextFactory());
              env.put(Context.PROVIDER_URL, getProviderUrl());
              if (getUrlPkgPrefixes() != null && !getUrlPkgPrefixes().equals(""))
                  env.put(Context.URL_PKG_PREFIXES, getUrlPkgPrefixes());
              System.out.println("    " + getInitialContextFactory());
              System.out.println("    " + getProviderUrl());
              System.out.println("    " + getUrlPkgPrefixes());
              System.out.println("    " + getEjbName());
              // Get a naming context
              context = new InitialContext(env);
               Object ms  = context.lookup(getEjbName());
              MyEJBHome home = (MyEJBHome ) PortableRemoteObject.narrow(ms, MyEJBHome.class);
              myEjb = home.create();
              return myEjb.getDefaultName();
          } catch (RemoteException re){
              System.out.println(re.getCause().getMessage());
          catch (Exception ex) {
              ex.printStackTrace();
          return null; //if unable to resolve the context factory etc...
        }

    I did exactly as you suggested. I edited the application.xml and added this
    <library path="C:\ArcGIS\test\bea\wlclient.jar"/>
    I didn't add weblogic because the needed classes were all in wlclient.jar
    I also edited the BASE_OB_CLASSPATH to include this jar.
    Here is the result when I just start BPEL PM Server. Somehow BPEL PM doesn't like to have wlclient.jar in its classpath during startup.
    Failed to create "worker" bean; exception reported is: "javax.naming.NameNotFoun
    dException: remaining name: env
    at weblogic.j2eeclient.SimpleContext.lookup(SimpleContext.java:49)
    at weblogic.j2eeclient.SimpleContext.lookup(SimpleContext.java:57)
    at weblogic.j2eeclient.SimpleContext.lookup(SimpleContext.java:62)
    at javax.naming.InitialContext.lookup(InitialContext.java:347)
    at com.collaxa.cube.engine.ejb.impl.WorkerBean.ejbCreate(WorkerBean.java
    :49)
    at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at com.evermind.server.ejb.MessageDrivenHome.getInstance(MessageDrivenHo
    me.java:1235)
    at com.evermind.server.ejb.MessageDrivenHome$2.run(MessageDrivenHome.jav
    a:1150)
    at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(Relea
    sableResourcePooledExecutor.java:186)
    at java.lang.Thread.run(Thread.java:534)
    <2005-12-29 13:39:05,281> <ERROR> <collaxa> <ServerManager::loadAllDomains>
    ORABPEL START-UP ERROR!!!!!!!!
    OraBPEL run-time system failed to start due to exception:
    Could not initialize jms connection pool.
    Could not initialize connection pool for connection factory "java:comp/env/jms/
    ollaxa/BPELInvokerQueueFactory"; the reason is remaining name: env/jms/collaxa/
    PELInvokerQueueFactory.
    Note: So what I did was to removed the entry from application.xml and tried with just obsetenv.bat having the wlclient.jar added to it. This too failed!!
    Here is a snapshot of the error I got.
    Process "BPELProcess2" (revision "1.0") successfully compiled.
    <2005-12-29 13:53:11,207> <INFO> <default.collaxa.cube.engine.deployment> Proces
    s "BPELProcess2" (revision "1.0") successfully loaded.
    05/12/29 13:53:32 Cannot instantiate class: weblogic.jndi.WLInitialContextFactor
    y
    05/12/29 13:53:32 javax.naming.NoInitialContextException: Cannot instantiate cla
    ss: weblogic.jndi.WLInitialContextFactory [Root exception is java.lang.ClassNotF
    oundException: weblogic.jndi.WLInitialContextFactory]
    05/12/29 13:53:32 at javax.naming.spi.NamingManager.getInitialContext(Nami
    ngManager.java:652)
    05/12/29 13:53:32 at javax.naming.InitialContext.getDefaultInitCtx(Initial
    Context.java:243)
    05/12/29 13:53:32 at javax.naming.InitialContext.init(InitialContext.java:
    219)
    05/12/29 13:53:32 at javax.naming.InitialContext.<init>(InitialContext.jav
    a:195)
    05/12/29 13:53:32 at com.esri.adf.ejb.test.MapFinder.getDefaultMapName(Map
    Finder.java:57)
    05/12/29 13:53:32 at bpel.p0.ExecLetBxExe1.execute(ExecLetBxExe1.java:62)
    05/12/29 13:53:32 at com.collaxa.cube.engine.ext.wmp.BPELXExecWMP.__execut
    eStatements(BPELXExecWMP.java:49)
    05/12/29 13:53:32 at com.collaxa.cube.engine.ext.wmp.BPELActivityWMP.perfo
    rm(BPELActivityWMP.java:185)
    05/12/29 13:53:32 at com.collaxa.cube.engine.CubeEngine.performActivity(Cu
    beEngine.java:3398)
    05/12/29 13:53:32 at com.collaxa.cube.engine.CubeEngine.handleWorkItem(Cub
    eEngine.java:1905)
    05/12/29 13:53:32 at com.collaxa.cube.engine.dispatch.message.instance.Per
    formMessageHandler.handleLocal(PerformMessageHandler.java:75)
    05/12/29 13:53:32 at com.collaxa.cube.engine.dispatch.DispatchHelper.handl
    eLocalMessage(DispatchHelper.java:100)
    05/12/29 13:53:32 at com.collaxa.cube.engine.dispatch.DispatchHelper.sendM

  • HT201303 how can I look up the answer to my security questions for Apps?

    I want to buy apps , but I forgot the answer to my security questions, How can I look up the answer or set it up again?

    If you have a rescue email address set up on your account then you can try going to https://appleid.apple.com/ and click 'Manage your Apple ID' on the right-hand side of that page and log into your account. Then click on 'Password and Security' on the left-hand side of that page and on the right-hand side you might see an option to send security question reset info to your rescue email address.
    If you don't have a rescue email address set up then go to Express Lane  and select 'iTunes' from the list of 'products' in the middle of the screen.
    Then select 'iTunes Store', and on the next screen select 'Account Management'
    Next choose 'iTunes Store Account Security' and fill in that you'd like your security questions/answers reset.
    You should get an email reply within, I think, about 24 to 48 hours (and check your Spam folder as well as your Inbox)

  • How can I look at old text messages

    How can I look at old text messages that I haven't deleted my phone just won't load to let me go up that far.?

    As Ann said, it does depend on your phone.  One third party app that works on many phones (especially older models, but not all phones) is BitPim ( http://www.bitpim.org/ ) but it can potentially harm/brick your phone if you don't know what you are doing - use it with caution.  I have used it successfully to get texts and photos off an old flip phone that was deactivated and had no sd card.
    Newer smartphones can download apps that will give you the ability to print out texts.

  • When I look up the creation date for files on my Macbook I get the date and month in brackets, but not the year.  Why is this and how can I look up the year?

    When I look up the creation date for files on my Macbook (using "get info", or the information window in Iphoto) I get the date and month in brackets, but not the year.  Why is this and how can I look up the year? 

    Does the Date Modified column in a window set to List view show the date correctly, or does it also display it incorrectly?
    To add additional columns to a Finder (folder) window, with that window open and active open the View Options for it. You can do that by pressing Command-J or by selecting View Options from the View menu in the main menubar.

  • How can i look to see what is on icloud i would like to manage whats on it

    how can i look to see what is on icloud i would like to manage it. Erase things on there to make more room??

    Settings > iCloud > Storage & Backup > Manage Storage. Select your device. Each app should have an on/off switch, so you can choose which apps' data will be included in the next backup.

  • How can i look up my apple id without the email address associated with it

    I do not know the email address associated with my apple id. How can i look up my apple id with out it

    You need an non-Apple email address to set up an Apple ID.
    Yuu can get a Gmail account heee. It is free
    https://support.google.com/mail/answer/56256?hl=en

  • How can I make a backup to an external hard drive from iPhoto if it won't open?

    how can I make a backup to an external hard drive from iPhoto if it won't open? I just wan't to make a backup to my pictures not my entire computer so how does Time Machine work on that?

      you could also clone the drive or volume, or just some of the user folders. look for carbon copy cloner, then enable the "use checksum to insure file integrity."
      you can have multiple iPhoto Library catalogues in different locations.
    Continue to use TimeMachine and make sure it has 350% or more capacity than your system and data.

  • How can I keep track of which users use which machines

    Hello!
    I'm notice that we have one machine in our labs that is constantly getting the keyboard damaged by one of the students. We use an Open Directory system to allow the students to log into any available machine, but how can I log which users are using that particular machine??
    Thanks!

    hi,
    try "last" in the client's terminal. is this what you are looking for?
    cheers,
    Michael.

  • How can I transfer my contacts to my new iPhone 5s from my olds iPhone 5s

    How can I transfer my contacts to my new iPhone 5s from my olds iPhone 5s?

    Use your backup from your old iPhone to restore your new one (assuming you have done iCloud backups or in iTunes). Also try looking at this https://support.apple.com/en-us/HT201269

Maybe you are looking for