Just so nobody thinks that I am an asshole here is my explanation:
The original question of Kam was: "How to call EJB from servlet....?"
If anybody can explain what does this question mean, great, because I couldn't. To me it created an impression that the guy has no idea about eather EJB or Servlets which made me think that his problem is not about using Servlet as a client that interracts with ejb, but understanding the whole concept of Servlets, EJB and other related technologies. Therefore RTFB is fine and I am glad that most of you had agree with me.
Leter when this whole thing was started (unfortunately by me) he provided a rather intelegent explanation of what exactly he was trying to do, which if he would do on the first place would save a whole lot of us from going thru this bullshit.
He was trying to use an EJB runing in Weblogic container using a servlet running on the Tomcat. Basicaly he has created himself a somewhat distributed environment for whatever purposes and has problem establishing a communication between two. Now we're cooking. Perfect question for this forum after all... don't you agree.
And yes I'll be the first one to admit that most of the tutorials assume that your client and EJB are running on the same machine. Therefore here is the example of how to connect to the remote machine:
This example uses IBM Websphere 4.0 so if you're using Weblogic I would assume you have to use their InitialContextFactory class
================
import javax.naming.*;
import java.util.*;
............ your code ...........
try{
Properties prop = new Properties();
prop.setProperty(Context.INITIAL_CONTEXT_FACTORY, com.ibm.websphere.naming.WsnInitialContextFactory);
prop.setProperty(Context.PROVIDER_URL, "iiop:///"); // this statement can be omitted
// this example assumes Name Server running on the local host on port 900
// otherwise the above statement should look as follows:
// prop.setProperty(Context.PROVIDER_URL, "iiop://host_name:port_number/");
ItitialContext ctx = new InitialContext(prop);
Object homeObject = ctx.lookup("YouHomeObject");
............. the rest of your code for instantiating and using EJB remains the same as if it was on the local machine ........
=========================
So all that you have to know the name of the machine and the port number of the Name Server, as well as, defining your interfaces to the classpath of your client.
There we go, hope it helps Kam
Alex
"Jain, Sanjay (Exchange)" <[EMAIL PROTECTED]> wrote:
Joseph,
Here is what Zhurakusky said
Oh by the way Kam......
if you curious what RTFB stands for:
R - read
T - the
F - fu--ing
B - book
I can't think of anything other than 'fucking' that Zhurakusky had in mind.
So you probably didn't read the email completely. Which is fine if you
hadn't jumped in frivolous defense of that guy.
Again quoting you
"Surprisingly, mailing lists are a written medium, meaning that in order to
use it, they're able to read already..."
So practice what you preach. Read the email before you answer next time.
-----Original Message-----
From: Joseph Ottinger [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 28, 2001 5:35 AM
To: [EMAIL PROTECTED]
Subject: Re: calling a ejb
Not to belabour the point, but he said "F" - not "fucking," which would have
been vulgar. You're free to use any "f" word you like, including "freaking,"
"fabricated," or any other descriptive that your dictionary offers. I'm
rather on Oleg's side, myself, as this list has a higher signal-to-noise
ratio than any other list I've been on in years. One reason I'm quiet here
is because of the "delete" capability; usually I delete after reading the
first line of every post (and, in a few cases, just the sender's name, which
has worked amazingly well.) Another reason I'm quiet in here is that I'm
afraid to be like Hans, or Geert, or even Celeste, and appear competent -
that would burden me with a thousand quacking newbies, all begging for
information easily attained through a bit of reading on their own.
Surprisingly, mailing lists are a written medium, meaning that in order to
use it, they're able to read already...
>From: Ramesh Kesavanarayanan <[EMAIL PROTECTED]>
>Reply-To: A mailing list about Java Server Pages specification and
>reference <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Re: calling a ejb
>Date: Fri, 28 Dec 2001 03:46:16 +0000
>
> i totally agree with what zivki says.if you do not
>want to answer any question ignore them. who do you
>think you are to use vulgar language? you are not the
>mediator of this group so just shut up and do your
>work if you are not interested in any question. you
>think all the question you ask are relevant??????
>
>
>=====
>
>
>________________________________________________________________________
>Download Logos, Picture Messages & Ringtones for your mobile phone
> Visit http://mobile.yahoo.co.in
>
>===========================================================================
>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
>JSP-INTEREST".
>For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
>DIGEST".
>Some relevant FAQs on JSP/Servlets can be found at:
>
> http://archives.java.sun.com/jsp-interest.html
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.jsp
> http://www.jguru.com/faq/index.jsp
> http://www.jspinsider.com
---------------------------------------------------
Joseph B. Ottinger [EMAIL PROTECTED]
http://adjacency.org IT Consultant
_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://archives.java.sun.com/jsp-interest.html
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.jsp
http://www.jguru.com/faq/index.jsp
http://www.jspinsider.com
***********************************************************************
Bear Stearns is not responsible for any recommendation, solicitation,
offer or agreement or any information about any transaction, customer
account or account activity contained in this communication.
***********************************************************************
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://archives.java.sun.com/jsp-interest.html
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.jsp
http://www.jguru.com/faq/index.jsp
http://www.jspinsider.com
Do You Yahoo!?
Send your FREE holiday greetings online at Yahoo! Greetings.
