Skip to main content

New Glassfish embedded APIs: any way to look up a properly initialized InitialContext?

3 replies [Last post]
ljnelson
Offline
Joined: 2003-08-04
Points: 0

javax.ejb.embeddable.EJBContainer--the standard way of producing a lite EJB
container--no longer suits our purposes since it doesn't support working
with @Remote EJBs.

Consequently we are looking to move to the newly sanctioned Glassfish
embedded APIs, which, if I understand correctly, have been overhauled for
3.1 and are available at http://embedded-glassfish.java.net/nonav/apidocs/.

Emulating javax.ejb.embeddable.EJBContainer seems easy enough.

However, I cannot see how to get an InitialContext from the API. This would
be extremely convenient, as otherwise I need to put together a
jndi.properties with all the right values set, and I don't know what those
values should be.

Am I overlooking something, or is it possible to get an InitialContext (or
just a javax.naming.Context) from the Glassfish embedded APIs?

Thanks,
Laird

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
mvatkina
Offline
Joined: 2005-04-04
Points: 0

Laird,

@Remote EJBs should work on the default ports.

-marina

Laird Nelson wrote:
> javax.ejb.embeddable.EJBContainer--the standard way of producing a
> lite EJB container--no longer suits our purposes since it doesn't
> support working with @Remote EJBs.
>
> Consequently we are looking to move to the newly sanctioned Glassfish
> embedded APIs, which, if I understand correctly, have been overhauled
> for 3.1 and are available at
> http://embedded-glassfish.java.net/nonav/apidocs/.
>
> Emulating javax.ejb.embeddable.EJBContainer seems easy enough.
>
> However, I cannot see how to get an InitialContext from the API. This
> would be extremely convenient, as otherwise I need to put together a
> jndi.properties with all the right values set, and I don't know what
> those values should be.
>
> Am I overlooking something, or is it possible to get an InitialContext
> (or just a javax.naming.Context) from the Glassfish embedded APIs?
>
> Thanks,
> Laird

ljnelson
Offline
Joined: 2003-08-04
Points: 0

Yep; blindly tried new InitialContext() and it seems like everything works
fine. Thanks.

L

On Mon, Jan 31, 2011 at 1:54 PM, Marina Vatkina
wrote:

> Laird,
>
> @Remote EJBs should work on the default ports.
>
> -marina
>
>
> Laird Nelson wrote:
>
>> javax.ejb.embeddable.EJBContainer--the standard way of producing a lite
>> EJB container--no longer suits our purposes since it doesn't support working
>> with @Remote EJBs.
>>
>> Consequently we are looking to move to the newly sanctioned Glassfish
>> embedded APIs, which, if I understand correctly, have been overhauled for
>> 3.1 and are available at
>> http://embedded-glassfish.java.net/nonav/apidocs/.
>>
>> Emulating javax.ejb.embeddable.EJBContainer seems easy enough.
>>
>> However, I cannot see how to get an InitialContext from the API. This
>> would be extremely convenient, as otherwise I need to put together a
>> jndi.properties with all the right values set, and I don't know what those
>> values should be.
>>
>> Am I overlooking something, or is it possible to get an InitialContext (or
>> just a javax.naming.Context) from the Glassfish embedded APIs?
>>
>> Thanks,
>> Laird
>>
>

Bhavanishankar ...
Offline
Joined: 2011-01-31
Points: 0

Hi Laird,

Thats should work. The devtest

does.

_Bhavani.

On 02/01/2011 12:30 AM, Laird Nelson wrote:
> Yep; blindly tried new InitialContext() and it seems like everything
> works fine. Thanks.
>
> L
>
> On Mon, Jan 31, 2011 at 1:54 PM, Marina Vatkina
> > wrote:
>
> Laird,
>
> @Remote EJBs should work on the default ports.
>
> -marina
>
>
> Laird Nelson wrote:
>
> javax.ejb.embeddable.EJBContainer--the standard way of
> producing a lite EJB container--no longer suits our purposes
> since it doesn't support working with @Remote EJBs.
>
> Consequently we are looking to move to the newly sanctioned
> Glassfish embedded APIs, which, if I understand correctly,
> have been overhauled for 3.1 and are available at
> http://embedded-glassfish.java.net/nonav/apidocs/.
>
> Emulating javax.ejb.embeddable.EJBContainer seems easy enough.
>
> However, I cannot see how to get an InitialContext from the
> API. This would be extremely convenient, as otherwise I need
> to put together a jndi.properties with all the right values
> set, and I don't know what those values should be.
>
> Am I overlooking something, or is it possible to get an
> InitialContext (or just a javax.naming.Context) from the
> Glassfish embedded APIs?
>
> Thanks,
> Laird
>
>