Thanks again Vincent,

                      Marc

----------Forwarded message ----------
Return-Path: <[EMAIL PROTECTED]>
Delivered-To: [EMAIL PROTECTED]
Received: (qmail 31910 invoked by uid 417); 2 Oct 2001 10:34:52 -0000
Received: from msgdirector1.onetel.net.uk (212.67.96.148)
  by i-softhome-jive-1 with SMTP; 2 Oct 2001 10:34:52 -0000
Received: from octovma (host213-120-114-227.in-addr.btopenworld.com
[213.120.114.227])
        by msgdirector1.onetel.net.uk (Mirapoint)
        with ESMTP id AAN80139 (AUTH vmassol);
        Tue, 2 Oct 2001 11:37:13 +0100 (BST)
Message-ID: <01da01c14b2f$48907f60$[EMAIL PROTECTED]>
Reply-To: "Vincent Massol" <[EMAIL PROTECTED]>
From: "Vincent Massol" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
References: <[EMAIL PROTECTED]>           
<00d601c14b25$7b85e450$[EMAIL PROTECTED]>           
<[EMAIL PROTECTED]>           
<019f01c14b2a$c06a8300$[EMAIL PROTECTED]>
<[EMAIL PROTECTED]>
Subject: Re: testing EJB
Date: Tue, 2 Oct 2001 11:44:53 +0100
MIME-Version: 1.0
Content-Type: text/plain;
        charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000

Marc,

Can you forward this email to the cactus-user list so that everyone knows
how you solved it and will not continue to try to answer your question ?
Thanks. Cheers,
-Vincent

P.S.: Also, please send all emails related to Cactus on the list as I like
to use the use as a central focus point for all discussions. Thanks.


----- Original Message -----
From: <[EMAIL PROTECTED]>
To: "Vincent Massol" <[EMAIL PROTECTED]>
Sent: Tuesday, October 02, 2001 10:49 AM
Subject: Re: testing EJB


>
>   Thank you very much, it seems to work great now!!!!
>
>   I just added two lines and everything works fine
>
> Hashtable env = new Hashtable();
> env.put(Context.PROVIDER_URL, "t3://localhost:7001");
> env.put(Context.INITIAL_CONTEXT_FACTORY,
>         "weblogic.jndi.WLInitialContextFactory");
> env.put(Context.SECURITY_PRINCIPAL,"username");
> env.put(Context.SECURITY_CREDENTIALS,"password");
> InitialContext ctx = new InitialContext(env);
>
>   Thanks again,
>                Marc
>
>
> Vincent Massol writes:
>
> >
> > ----- Original Message -----
> > From: <[EMAIL PROTECTED]>
> > To: "Vincent Massol" <[EMAIL PROTECTED]>
> > Sent: Tuesday, October 02, 2001 10:19 AM
> > Subject: Re: testing EJB
> >
> >
> > >
> > >   Yes, I read the tutorial and I don't understand your answer very
well
> > (my
> > > english is not as good as I wish)
> > >
> > >   I create the context using the following lines
> > > Hashtable env = new Hashtable();
> > > env.put(Context.PROVIDER_URL, "t3://localhost:7001");
> > > env.put(Context.INITIAL_CONTEXT_FACTORY,
> > >         "weblogic.jndi.WLInitialContextFactory");
> > > InitialContext ctx = new InitialContext(env);
> > >
> > >   How should I add the user to this initialcontext? (I have the
principal,
> > > the credentials, even the subject authenticated, what should I use and
> > > where should I put it?)
> > >
> >
> > Ok, let me put it differently. EJB unit testing is independent from
Cactus.
> > You use a Cactus XXXTestCase as a client to your EJB in the same way you
> > would write any EJB client. Your question is thus actually a WebLogic
> > question. I've done a search in the WL 5.1 documentation and found this
> > article which explains it all :
> > http://www.weblogic.com/docs51/classdocs/API_client.html [Read
especially
> > the part on "Getting the InitialContext"].
> >
> > Hope it helps,
> > Thanks
> > -Vincent
> >
> >
> > >   Thanks,
> > >          Marc
> > >
> > > Vincent Massol writes:
> > >
> > > > Hi Marc,
> > > >
> > > > I'm sure you've read the EJB tutorial on the Cactus web
> > > > site(http://jakarta.apache.org/cactus/howto_ejb.html). If your EJB
is
> > > > protected I think you simply need to pass some credentials in the
JNDI
> > > > connection. Instead of writing : InitialContext context = new
> > > > InitialContext(), create a Properties object and put into it the
correct
> > > > credentials (see your EJB server documentation as I'm not sure this
is
> > > > standardized), then call "InitialContext context = new
> > > > InitialContext(properties)".
> > > >
> > > > Hope it helps
> > > > -Vincent
> > > >
> > > > ----- Original Message -----
> > > > From: <[EMAIL PROTECTED]>
> > > > To: <[EMAIL PROTECTED]>
> > > > Sent: Tuesday, October 02, 2001 8:33 AM
> > > > Subject: testing EJB
> > > >
> > > >
> > > > >
> > > > >   How can I test with Cactus a protected EJB? I need to protect it
and
> > I
> > > > > need to use ctx.getCallerPrincipal() in the bean code to know who
> > called
> > > > > me.
> > > > >
> > > > >   Any help would be appreciate.
> > > > >
> > > > >   Thanks,
> > > > >         Marc
> > > > >
> > > >
> > >
> >
>

Reply via email to