Re: [JBoss-user] More Newbie Questions

2001-06-24 Thread Vinay Menon
Hasn't the second line been commented out?! Believe the first line would be enough. The line to use the PortableRemoteObject is an RMI-IIOP thingey. So just session = (Session)new InitialContext().lookup("java:comp/env/mail/MyMail"); would be fine for now.     - Original Message - From: Hunter Hillegas Sent: Saturday, June 23, 2001 11:46 PM To: JBoss 2 Subject: [JBoss-user] More Newbie Questions  I've got another newbie question. I perused the Javadoc and couldn't find ananswer...In the JBoss docs, in the JavaMail section there is some sample code...One part is like this:try {session = (Session)new InitialContext().lookup("java:comp/env/mail/MyMail");InitialContext().lookup(("java:comp/env/mail/MyMail"), Session.class);}The second line won't compile. What does it do? I tried to figure it outbased on the JNDI docs but I'm at a loss.Thanks,Hunter___JBoss-user mailing list[EMAIL PROTECTED]http://lists.sourceforge.net/lists/listinfo/jboss-userGet more from the Web.  FREE MSN Explorer download : http://explorer.msn.com


Re: [JBoss-user] More Newbie Questions

2001-06-24 Thread Allen fogleson

off hand I would say the second line is a narrowing from
javax.rmi.PortableRemoteObject

it should say session =
(Session)PortableRemoteObject.narrow(InitialContext().lookup(("java:comp/env
/mail/MyMail"), Session.class);

Al

- Original Message -
From: Hunter Hillegas <[EMAIL PROTECTED]>
To: JBoss 2 <[EMAIL PROTECTED]>
Sent: Saturday, June 23, 2001 6:37 PM
Subject: [JBoss-user] More Newbie Questions


> I've got another newbie question. I perused the Javadoc and couldn't find
an
> answer...
>
> In the JBoss docs, in the JavaMail section there is some sample code...
>
> One part is like this:
>
> try {
> session = (Session)new
InitialContext().lookup("java:comp/env/mail/MyMail");
> InitialContext().lookup(("java:comp/env/mail/MyMail"), Session.class);
> }
>
> The second line won't compile. What does it do? I tried to figure it out
> based on the JNDI docs but I'm at a loss.
>
> Thanks,
> Hunter
>
>
> ___
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



[JBoss-user] More Newbie Questions

2001-06-23 Thread Hunter Hillegas

I've got another newbie question. I perused the Javadoc and couldn't find an
answer...

In the JBoss docs, in the JavaMail section there is some sample code...

One part is like this:

try {
session = (Session)new InitialContext().lookup("java:comp/env/mail/MyMail");
InitialContext().lookup(("java:comp/env/mail/MyMail"), Session.class);
}

The second line won't compile. What does it do? I tried to figure it out
based on the JNDI docs but I'm at a loss.

Thanks,
Hunter


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user