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

M

Massimiliano

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
 
S

Sudsy

Massimiliano wrote:
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!
 
M

Massimiliano

Thanks Susdy i hope don't wrong again.
If you come in Rome i'll give you a beer.
Max
 
M

Massimiliano

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

Andrew Thompson said:
Massimiliano said:
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
 
A

Andrew Thompson

Massimiliano said:
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. ;-) ]
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top