[newbie-ejb...helppppppppppp]Remote ejb Connection

Discussion in 'Java' started by Massimiliano, Jan 3, 2004.

  1. Massimiliano

    Massimiliano Guest

    Hello,
    i'm a newbie j2ee programmer and so i need an help about some pratical
    problems.....please HELP ME!! :p

    I'm testing an ejb application like this:

    -server A with jsp & session bean that with a method hello() call a method
    HaveNiceDay() in an entity bean on server B

    i writed on the method hello this code:

    Hashtable env = new Hashtable();

    env.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");

    env.put(Context.PROVIDER_URL, "t3://192.168.0.74:7001");

    env.put(Context.SECURITY_PRINCIPAL, "system@pippo");

    env.put(Context.SECURITY_CREDENTIALS, "inailweb");

    Context ctx = new InitialContext(env);

    Object obj = ctx.lookup("BackSession");

    BackHome home = (BackHome) javax.rmi.PortableRemoteObject.narrow(obj,
    BackHome.class);

    Back back = home.create();

    rit=back.HaveNiceDay();


    I use weblogic 7 and i need to know:
    i create a jar for server A with(session bean) and a jar for server B (with
    entity),but i don't know if i need to place the second jar in the server A?
    Because i think that the server A need only the home & remote interface of
    entity bean on his jar...true??

    Can you help me with pratical code or links....please!!!!!!!
    Massi
     
    Massimiliano, Jan 3, 2004
    #1
    1. Advertising

  2. Massimiliano

    Sudsy Guest

    Massimiliano wrote:
    <snip>
    > I use weblogic 7 and i need to know:
    > i create a jar for server A with(session bean) and a jar for server B (with
    > entity),but i don't know if i need to place the second jar in the server A?
    > Because i think that the server A need only the home & remote interface of
    > entity bean on his jar...true??


    Congratulations! You've waded through the waters and arrived at some
    code which looks like it should work just fine. Looks a lot like mine
    in fact, which is why I don't think you need any more code pointers.
    But since you asked, you could go to <http://www.sudsy.net>, click on
    the "Technology" button and select the "Stateless session EJBs" article.
    And you're absolutely correct: clients only require the home and remote
    interfaces to invoke the methods on your bean. Well done!
     
    Sudsy, Jan 3, 2004
    #2
    1. Advertising

  3. Massimiliano

    Massimiliano Guest

    Thanks Susdy i hope don't wrong again.
    If you come in Rome i'll give you a beer.
    Max
    "Sudsy" <> ha scritto nel messaggio
    news:...
    > Massimiliano wrote:
    > <snip>
    > > I use weblogic 7 and i need to know:
    > > i create a jar for server A with(session bean) and a jar for server B

    (with
    > > entity),but i don't know if i need to place the second jar in the server

    A?
    > > Because i think that the server A need only the home & remote interface

    of
    > > entity bean on his jar...true??

    >
    > Congratulations! You've waded through the waters and arrived at some
    > code which looks like it should work just fine. Looks a lot like mine
    > in fact, which is why I don't think you need any more code pointers.
    > But since you asked, you could go to <http://www.sudsy.net>, click on
    > the "Technology" button and select the "Stateless session EJBs" article.
    > And you're absolutely correct: clients only require the home and remote
    > interfaces to invoke the methods on your bean. Well done!
    >
     
    Massimiliano, Jan 3, 2004
    #3
  4. Andrew Thompson, Jan 3, 2004
    #4
  5. Massimiliano

    Massimiliano Guest

    i'm italian and i don't speak an excellent english ...explain me your answer
    about Sudsy
    :)

    "Andrew Thompson" <> ha scritto nel messaggio
    news:IuIJb.76292$...
    > "Massimiliano" <> wrote in message
    > news:9UAJb.227761$...
    > > Thanks Susdy...
    > > If you come in Rome i'll give you a beer.

    >
    > Now, let me just check. You have
    > never actually _seen_ Sudsy have you?
    >
    > Sudsy looks exactly like this.
    > http://www.athompson.info/andrew/ :)
    > [ And yes - he _is_ that ugly in real life! ;-) ]
    >
    > --
    > Andrew Thompson
    > * http://www.PhySci.org/ PhySci software suite
    > * http://www.1point1C.org/ 1.1C - Superluminal!
    > * http://www.AThompson.info/andrew/ personal site
    >
    >
     
    Massimiliano, Jan 4, 2004
    #5
  6. "Massimiliano" <> wrote in message
    news:S3NJb.228914$...
    > i'm italian and i don't speak an excellent english ...explain me your

    answer
    > about Sudsy
    > :)


    I want free beer if I visit Rome.
    If I had to pretend I was Sudsy to
    _get_ free beer, no problem!

    [ Excuse: I am Australian. ;-) ]

    --
    Andrew Thompson
    * http://www.PhySci.org/ PhySci software suite
    * http://www.1point1C.org/ 1.1C - Superluminal!
    * http://www.AThompson.info/andrew/ personal site
     
    Andrew Thompson, Jan 4, 2004
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?bWFoc2E=?=

    image in datalist please helppppppppppp

    =?Utf-8?B?bWFoc2E=?=, May 1, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,681
    =?Utf-8?B?bWFoc2E=?=
    May 1, 2004
  2. Steve
    Replies:
    1
    Views:
    730
    John C. Bollinger
    Jul 15, 2003
  3. Mumbai Joe
    Replies:
    0
    Views:
    630
    Mumbai Joe
    Jul 29, 2003
  4. Donkey Hot
    Replies:
    1
    Views:
    790
  5. Raymond Schanks
    Replies:
    0
    Views:
    699
    Raymond Schanks
    Aug 3, 2010
Loading...

Share This Page