Re: [jBoss-User] java:comp:/env Question?
Hi!
pranab wrote:
> I tried as per the suggestion to see if java:comp/env works .
> Here is what I did
>
> Properties p = new Properties();
>
> p.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
> p.put(Context.PROVIDER_URL,"localhost:1099");
> p.put(Context.URL_PKG_PREFIXES, "org.jboss.naming");
> Context ctx = (Context) new
> InitialContext(p).lookup("java:comp/env");
> javax.naming.NamingEnumeration enum1 = ctx.list("");
> while(enum1.hasMore())
> {
> System.out.println("Object 1:"+enum1.next());
> }
> Here is what I got
> javax.naming.NameNotFoundException: comp not bound
This doesn't work since you're not doing it from a component that is
required to have the java: namespace. Do the same thing from within an
EJB and you will get a different result...
/Rickard
--
Rickard Öberg
@home: +46 13 177937
Email: [EMAIL PROTECTED]
http://www.telkel.com
http://www.jboss.org
http://www.dreambean.com
--
--
To subscribe:[EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]
Re: [jBoss-User] java:comp:/env Question?
Hi ,
I tried as per the suggestion to see if java:comp/env works .
Here is what I did
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
p.put(Context.PROVIDER_URL,"localhost:1099");
p.put(Context.URL_PKG_PREFIXES, "org.jboss.naming");
Context ctx = (Context) new
InitialContext(p).lookup("java:comp/env");
javax.naming.NamingEnumeration enum1 = ctx.list("");
while(enum1.hasMore())
{
System.out.println("Object 1:"+enum1.next());
}
Here is what I got
javax.naming.NameNotFoundException: comp not bound
at
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(
RemoteCall.java:245)
at
sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall
220)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
at
org.jnp.interfaces.NamingContext.lookup(NamingContext.java:280)
at
org.jnp.interfaces.NamingContext.lookup(NamingContext.java:265)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at com.ebd.ejb.CabinClient.main(CabinClient.java:45)
Rickard Öberg wrote:
>
> Hi!
>
> pranab wrote:
> > I was trying to use the prefix "java:comp/env" to lookup on a
> > EJB.
> > It doesn't work that way in Jboss2.However it works when doing a plain
> > lookup on the EJB JNDI Name.
> >
> > I used this code to find out whats in there in the jndi context
> >
> > Context jndiContext = getInitialContext();
> > System.out.println("Name:"+
> > jndiContext.getNameInNamespace());
> > System.out.println("Environment:"+
> > jndiContext.getEnvironment());
> > javax.naming.NamingEnumeration enum = jndiContext.list("");
> > while(enum.hasMore())
> > {
> > System.out.println("Object:"+enum.next());
> > }
> > javax.naming.NamingEnumeration enum =
> > jndiContext.list("jdbc");
> > while(enum.hasMore())
> > {
> > System.out.println("Object:"+enum.next());
> > }
> > here is the output
> > Object:Hypersonic: org.jboss.jdbc.DataSourceImpl
> > Object:jmx: org.jboss.jmx.server.JMXAdaptorImpl
> > Object:TravelAgentBean: $Proxy0
> > Object:Cabin: $Proxy1
> > Object:jdbc: org.jnp.interfaces.NamingContext
> > Object:xa.postgresqlPool: org.jboss.minerva.datasource.XAPoolDataSource
> > Object:InstantDB: org.jboss.jdbc.DataSourceImpl
> > Object:TransactionManager: class org.jboss.tm.TxManager
> > initial context :javax.naming.InitialContext@b66cc
> > Object:jdbc/postgresql: org.jboss.jdbc.DataSourceImpl
>
> You are listing the root default context. This is exactly how it should
> be.
>
> > I think the call getNameInNamespace for the root context is not mapped
> > to "java:comp/env"
> > string.
>
> Which it should not be.
>
> > Is it how it is supposed to function???
>
> Yes. You are accessing the default JNDI namespace. If you want to access
> the java: namespace then you must lookup the java: namespace. Like this:
> Context ctx = new InitialContext().lookup("java:comp/env");
> .. and do a listing of that. The contents will be what you specified in
> your ejb-jar.xml descriptor. If you haven't specified anything (no
> references or environment entries) it will be empty.
Here are my references
[Container factory] Deploying Cabin
[Container factory] Deploying TravelAgentBean
[Container factory] Binding an EJBReference testref
[Container factory] Binding testref to external JNDI source: Cabin
[Container factory] Binding an EJBReference ejb/CabinHome
[Container factory] Binding ejb/CabinHome to external JNDI source: Cabin
[Container factory] Binding an EJBReference sessionref
[Container factory] Binding sessionref to external JNDI source:
TravelAgentBean
...
[Container factory] Bound TravelAgentBean to TravelAgentBean
[Container factory] Bound Cabin to Cabin
Besides this I have one environment Reference in ejb-jar.xml
TEST_ENV
java.lang.String
It Works
I am yet to see it work.
PKD
>
> /Rickard
>
> --
> Rickard Öberg
>
> @home: +46 13 177937
> Email: [EMAIL PROTECTED]
> http://www.telkel.com
> http://www.jboss.org
> http://www.dreambean.com
>
> --
> --
> To subscribe:[EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> Problems?: [EMAIL PROTECTED]
--
--
To subscribe:[EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]
Re: [jBoss-User] java:comp:/env Question?
Hi!
pranab wrote:
> I was trying to use the prefix "java:comp/env" to lookup on a
> EJB.
> It doesn't work that way in Jboss2.However it works when doing a plain
> lookup on the EJB JNDI Name.
>
> I used this code to find out whats in there in the jndi context
>
> Context jndiContext = getInitialContext();
> System.out.println("Name:"+
> jndiContext.getNameInNamespace());
> System.out.println("Environment:"+
> jndiContext.getEnvironment());
> javax.naming.NamingEnumeration enum = jndiContext.list("");
> while(enum.hasMore())
> {
> System.out.println("Object:"+enum.next());
> }
> javax.naming.NamingEnumeration enum =
> jndiContext.list("jdbc");
> while(enum.hasMore())
> {
> System.out.println("Object:"+enum.next());
> }
> here is the output
> Object:Hypersonic: org.jboss.jdbc.DataSourceImpl
> Object:jmx: org.jboss.jmx.server.JMXAdaptorImpl
> Object:TravelAgentBean: $Proxy0
> Object:Cabin: $Proxy1
> Object:jdbc: org.jnp.interfaces.NamingContext
> Object:xa.postgresqlPool: org.jboss.minerva.datasource.XAPoolDataSource
> Object:InstantDB: org.jboss.jdbc.DataSourceImpl
> Object:TransactionManager: class org.jboss.tm.TxManager
> initial context :javax.naming.InitialContext@b66cc
> Object:jdbc/postgresql: org.jboss.jdbc.DataSourceImpl
You are listing the root default context. This is exactly how it should
be.
> I think the call getNameInNamespace for the root context is not mapped
> to "java:comp/env"
> string.
Which it should not be.
> Is it how it is supposed to function???
Yes. You are accessing the default JNDI namespace. If you want to access
the java: namespace then you must lookup the java: namespace. Like this:
Context ctx = new InitialContext().lookup("java:comp/env");
.. and do a listing of that. The contents will be what you specified in
your ejb-jar.xml descriptor. If you haven't specified anything (no
references or environment entries) it will be empty.
/Rickard
--
Rickard Öberg
@home: +46 13 177937
Email: [EMAIL PROTECTED]
http://www.telkel.com
http://www.jboss.org
http://www.dreambean.com
--
--
To subscribe:[EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]
Re: [jBoss-User] java:comp:/env Question?
Hi Guys,
I was trying to use the prefix "java:comp/env" to lookup on a
EJB.
It doesn't work that way in Jboss2.However it works when doing a plain
lookup on the EJB JNDI Name.
I used this code to find out whats in there in the jndi context
Context jndiContext = getInitialContext();
System.out.println("Name:"+
jndiContext.getNameInNamespace());
System.out.println("Environment:"+
jndiContext.getEnvironment());
javax.naming.NamingEnumeration enum = jndiContext.list("");
while(enum.hasMore())
{
System.out.println("Object:"+enum.next());
}
javax.naming.NamingEnumeration enum =
jndiContext.list("jdbc");
while(enum.hasMore())
{
System.out.println("Object:"+enum.next());
}
here is the output
Object:Hypersonic: org.jboss.jdbc.DataSourceImpl
Object:jmx: org.jboss.jmx.server.JMXAdaptorImpl
Object:TravelAgentBean: $Proxy0
Object:Cabin: $Proxy1
Object:jdbc: org.jnp.interfaces.NamingContext
Object:xa.postgresqlPool: org.jboss.minerva.datasource.XAPoolDataSource
Object:InstantDB: org.jboss.jdbc.DataSourceImpl
Object:TransactionManager: class org.jboss.tm.TxManager
initial context :javax.naming.InitialContext@b66cc
Object:jdbc/postgresql: org.jboss.jdbc.DataSourceImpl
I think the call getNameInNamespace for the root context is not mapped
to "java:comp/env"
string.
Is it how it is supposed to function???
PKD
Rickard Öberg wrote:
>
> Hi!
>
> Dan Christopherson wrote:
> > But if your arbitrary name (quux, say) shows up under
> > java:comp/env/ejb/quux in one container and under /quux under another,
> > isn't that a problem?
>
> Yes, 'cause then one of them would be buggy ;-)
>
> The prefix is always "java:comp/env". The suffix is always the ejb-name
> that is defined for the EJB-reference in the ejb-jar.xml file. So if
> *you* specify "ejb/Foo" the name is going to be "java:comp/env/ejb/Foo",
> and if *you* specify "Foo" the name is going to be "java:comp/env/Foo".
>
> There is no arbitray choice for the container to make. Everything is
> deterministic.
>
> Clear? :-)
>
> /Rickard
>
> --
> Rickard Öberg
>
> @home: +46 13 177937
> Email: [EMAIL PROTECTED]
> http://www.telkel.com
> http://www.jboss.org
> http://www.dreambean.com
>
> --
> --
> To subscribe:[EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> Problems?: [EMAIL PROTECTED]
--
--
To subscribe:[EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]
Re: [jBoss-User] java:comp:/env Question?
Well Weblogic does support "java:comp/env" but it is ignoring ejb-link; it uses the mapping defined in their own XML descriptor. Rickard Öberg wrote: > > 14.3.4 (Container responsibilities wrt environment): > "Preserve the application assembly information in the ejb-link elements > by binding an EJB > reference to the home interface of the specified target enterprise > bean." > > If the bean developer has chosen a name that is a valid JNDI suffix the > container must bind the EJB home to this name. > > What vendors are interpreting this differently?? > > /Rickard > -- -- To subscribe:[EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Problems?: [EMAIL PROTECTED]
Re: [jBoss-User] java:comp:/env Question?
Yes, I agree. In Weblogic, I cannot use "java:comp/env" in clients , but in the J2EE RI, this is possible. Rickard Öberg wrote: > > Note that a "java:comp/env" JNDI namespace has been defined for > application clients in J2EE now (J2EE 1.3 I think). Which is logical. > This will make it substantially easier to write app clients IMHO. > > /Rickard > -- -- To subscribe:[EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Problems?: [EMAIL PROTECTED]
Re: [jBoss-User] java:comp:/env Question?
Hi! marc fleury wrote: > > What has become a requirement? java: already is... what are you > > referring to? > > For client lookups as opposed to bean (not as far as I can tell) > bean lookups are the requirement today. Depends on what version of J2EE you want to support. J2EE 1.2 has java: for Application Client Modules defined... /Rickard -- Rickard Öberg @home: +46 13 177937 Email: [EMAIL PROTECTED] http://www.telkel.com http://www.jboss.org http://www.dreambean.com -- -- To subscribe:[EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Problems?: [EMAIL PROTECTED]
RE: [jBoss-User] java:comp:/env Question?
> What has become a requirement? java: already is... what are you > referring to? For client lookups as opposed to bean (not as far as I can tell) bean lookups are the requirement today. marc > > /Rickard > > -- > Rickard Öberg > > @home: +46 13 177937 > Email: [EMAIL PROTECTED] > http://www.telkel.com > http://www.jboss.org > http://www.dreambean.com > > > -- > -- > To subscribe:[EMAIL PROTECTED] > To unsubscribe: [EMAIL PROTECTED] > Problems?: [EMAIL PROTECTED] > > -- -- To subscribe:[EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Problems?: [EMAIL PROTECTED]
Re: [jBoss-User] java:comp:/env Question?
Hey marc fleury wrote: > Oh ok... > so java: is not thread local anymore... Remember that the thread local is just an implementation detail. The semantics is what counts: if a componet uses the java: namespace it should get its own. If that translates to a threadlocal in the case of application clients I don't know (haven't read J2EE 1.2, chapter 5 BTW, that closely yet). > wow > Has it become a requirement of EJB as well? What has become a requirement? java: already is... what are you referring to? /Rickard -- Rickard Öberg @home: +46 13 177937 Email: [EMAIL PROTECTED] http://www.telkel.com http://www.jboss.org http://www.dreambean.com -- -- To subscribe:[EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Problems?: [EMAIL PROTECTED]
RE: [jBoss-User] java:comp:/env Question?
Oh ok... so java: is not thread local anymore... wow Has it become a requirement of EJB as well? marc > Note that a "java:comp/env" JNDI namespace has been defined for > application clients in J2EE now (J2EE 1.3 I think). Which is logical. > This will make it substantially easier to write app clients IMHO. > > /Rickard > > -- > Rickard Öberg > > @home: +46 13 177937 > Email: [EMAIL PROTECTED] > http://www.telkel.com > http://www.jboss.org > http://www.dreambean.com > > > -- > -- > To subscribe:[EMAIL PROTECTED] > To unsubscribe: [EMAIL PROTECTED] > Problems?: [EMAIL PROTECTED] > > -- -- To subscribe:[EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Problems?: [EMAIL PROTECTED]
Re: [jBoss-User] java:comp:/env Question?
Hey marc fleury wrote: > AFAIK (might have changed in 2.0) for 1.1 the java:comp/env/ is only for > beans visibility on the naming space. The clients have a direct > relationship with name quux-/quux. > > /quux would not be an option, but java:comp/env/ejb/quux or > java:comp/env/quux would be. That being for target beans, not clients. The > client visibility is defined Note that a "java:comp/env" JNDI namespace has been defined for application clients in J2EE now (J2EE 1.3 I think). Which is logical. This will make it substantially easier to write app clients IMHO. /Rickard -- Rickard Öberg @home: +46 13 177937 Email: [EMAIL PROTECTED] http://www.telkel.com http://www.jboss.org http://www.dreambean.com -- -- To subscribe:[EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Problems?: [EMAIL PROTECTED]
Re: [jBoss-User] java:comp:/env Question?
Aaron Mulder wrote: > > I think what we're saying here is that all containers should put > it under java:comp/env/quux if you call it "quux", and under > java:comp/env/ejb/quux if you call it "ejb/quux". Is that not the case? Exactly. /Rickard -- Rickard Öberg @home: +46 13 177937 Email: [EMAIL PROTECTED] http://www.telkel.com http://www.jboss.org http://www.dreambean.com -- -- To subscribe:[EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Problems?: [EMAIL PROTECTED]
Re: [jBoss-User] java:comp:/env Question?
Hi! Dan Christopherson wrote: > But if your arbitrary name (quux, say) shows up under > java:comp/env/ejb/quux in one container and under /quux under another, > isn't that a problem? Yes, 'cause then one of them would be buggy ;-) The prefix is always "java:comp/env". The suffix is always the ejb-name that is defined for the EJB-reference in the ejb-jar.xml file. So if *you* specify "ejb/Foo" the name is going to be "java:comp/env/ejb/Foo", and if *you* specify "Foo" the name is going to be "java:comp/env/Foo". There is no arbitray choice for the container to make. Everything is deterministic. Clear? :-) /Rickard -- Rickard Öberg @home: +46 13 177937 Email: [EMAIL PROTECTED] http://www.telkel.com http://www.jboss.org http://www.dreambean.com -- -- To subscribe:[EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Problems?: [EMAIL PROTECTED]
Re: [jBoss-User] java:comp:/env Question?
In this scenario it is possible to do lookup as
ctx.lookup("java:comp/env/quux") for the home
interface reference.
PKD
Aaron Mulder wrote:
>
> I think what we're saying here is that all containers should put
> it under java:comp/env/quux if you call it "quux", and under
> java:comp/env/ejb/quux if you call it "ejb/quux". Is that not the case?
>
> Aaron
>
> On Wed, 12 Jul 2000, Dan Christopherson wrote:
>
> > But if your arbitrary name (quux, say) shows up under
> > java:comp/env/ejb/quux in one container and under /quux under another,
> > isn't that a problem?
> >
> > Dan Christopherson (danch)
> > STR Technical Architect (www.str.com)
> >
> > On Wed, 12 Jul 2000, Rickard [iso-8859-1] Öberg wrote:
> >
> > > Hi!
> > >
> > > Wong Kok Wai wrote:
> > > > Which means the looking up of EJB using "java:com/env/ejb" is not
> > > > mandatory, and to me this means non-portability between containers.
> > >
> > > It does not. These names are chosen arbitrarily by the bean developer.
> > > The bean developer may choose to use the /ejb prefix convention, but
> > > this is not mandatory.
> > >
> > > Since this is a name that is chosen by the bean developer this has
> > > nothing to do with container portability. The bean developer may easily
> > > hardcode the string name of the referenced beans in his code, since this
> > > is something that will never change.
> > >
> > > /Rickard
> > >
> > > --
> > > Rickard Öberg
> > >
> > > @home: +46 13 177937
> > > Email: [EMAIL PROTECTED]
> > > http://www.telkel.com
> > > http://www.jboss.org
> > > http://www.dreambean.com
> > >
> > >
> > > --
> > > --
> > > To subscribe:[EMAIL PROTECTED]
> > > To unsubscribe: [EMAIL PROTECTED]
> > > Problems?: [EMAIL PROTECTED]
> > >
> >
> >
> >
> > --
> > --
> > To subscribe:[EMAIL PROTECTED]
> > To unsubscribe: [EMAIL PROTECTED]
> > Problems?: [EMAIL PROTECTED]
> >
>
> --
> --
> To subscribe:[EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> Problems?: [EMAIL PROTECTED]
--
--
To subscribe:[EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]
Re: [jBoss-User] java:comp:/env Question?
I think what we're saying here is that all containers should put it under java:comp/env/quux if you call it "quux", and under java:comp/env/ejb/quux if you call it "ejb/quux". Is that not the case? Aaron On Wed, 12 Jul 2000, Dan Christopherson wrote: > But if your arbitrary name (quux, say) shows up under > java:comp/env/ejb/quux in one container and under /quux under another, > isn't that a problem? > > Dan Christopherson (danch) > STR Technical Architect (www.str.com) > > On Wed, 12 Jul 2000, Rickard [iso-8859-1] Öberg wrote: > > > Hi! > > > > Wong Kok Wai wrote: > > > Which means the looking up of EJB using "java:com/env/ejb" is not > > > mandatory, and to me this means non-portability between containers. > > > > It does not. These names are chosen arbitrarily by the bean developer. > > The bean developer may choose to use the /ejb prefix convention, but > > this is not mandatory. > > > > Since this is a name that is chosen by the bean developer this has > > nothing to do with container portability. The bean developer may easily > > hardcode the string name of the referenced beans in his code, since this > > is something that will never change. > > > > /Rickard > > > > -- > > Rickard Öberg > > > > @home: +46 13 177937 > > Email: [EMAIL PROTECTED] > > http://www.telkel.com > > http://www.jboss.org > > http://www.dreambean.com > > > > > > -- > > -- > > To subscribe:[EMAIL PROTECTED] > > To unsubscribe: [EMAIL PROTECTED] > > Problems?: [EMAIL PROTECTED] > > > > > > -- > -- > To subscribe:[EMAIL PROTECTED] > To unsubscribe: [EMAIL PROTECTED] > Problems?: [EMAIL PROTECTED] > -- -- To subscribe:[EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Problems?: [EMAIL PROTECTED]
RE: [jBoss-User] java:comp:/env Question?
AFAIK (might have changed in 2.0) for 1.1 the java:comp/env/ is only for beans visibility on the naming space. The clients have a direct relationship with name quux-/quux. /quux would not be an option, but java:comp/env/ejb/quux or java:comp/env/quux would be. That being for target beans, not clients. The client visibility is defined marc > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf Of Dan Christopherson > Sent: Wednesday, July 12, 2000 9:52 AM > To: jBoss > Subject: Re: [jBoss-User] java:comp:/env Question? > > > But if your arbitrary name (quux, say) shows up under > java:comp/env/ejb/quux in one container and under /quux under another, > isn't that a problem? > > Dan Christopherson (danch) > STR Technical Architect (www.str.com) > > On Wed, 12 Jul 2000, Rickard [iso-8859-1] Öberg wrote: > > > Hi! > > > > Wong Kok Wai wrote: > > > Which means the looking up of EJB using "java:com/env/ejb" is not > > > mandatory, and to me this means non-portability between containers. > > > > It does not. These names are chosen arbitrarily by the bean developer. > > The bean developer may choose to use the /ejb prefix convention, but > > this is not mandatory. > > > > Since this is a name that is chosen by the bean developer this has > > nothing to do with container portability. The bean developer may easily > > hardcode the string name of the referenced beans in his code, since this > > is something that will never change. > > > > /Rickard > > > > -- > > Rickard Öberg > > > > @home: +46 13 177937 > > Email: [EMAIL PROTECTED] > > http://www.telkel.com > > http://www.jboss.org > > http://www.dreambean.com > > > > > > -- > > -- > > To subscribe:[EMAIL PROTECTED] > > To unsubscribe: [EMAIL PROTECTED] > > Problems?: [EMAIL PROTECTED] > > > > > > -- > -- > To subscribe:[EMAIL PROTECTED] > To unsubscribe: [EMAIL PROTECTED] > Problems?: [EMAIL PROTECTED] > > -- -- To subscribe:[EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Problems?: [EMAIL PROTECTED]
Re: [jBoss-User] java:comp:/env Question?
But if your arbitrary name (quux, say) shows up under java:comp/env/ejb/quux in one container and under /quux under another, isn't that a problem? Dan Christopherson (danch) STR Technical Architect (www.str.com) On Wed, 12 Jul 2000, Rickard [iso-8859-1] Öberg wrote: > Hi! > > Wong Kok Wai wrote: > > Which means the looking up of EJB using "java:com/env/ejb" is not > > mandatory, and to me this means non-portability between containers. > > It does not. These names are chosen arbitrarily by the bean developer. > The bean developer may choose to use the /ejb prefix convention, but > this is not mandatory. > > Since this is a name that is chosen by the bean developer this has > nothing to do with container portability. The bean developer may easily > hardcode the string name of the referenced beans in his code, since this > is something that will never change. > > /Rickard > > -- > Rickard Öberg > > @home: +46 13 177937 > Email: [EMAIL PROTECTED] > http://www.telkel.com > http://www.jboss.org > http://www.dreambean.com > > > -- > -- > To subscribe:[EMAIL PROTECTED] > To unsubscribe: [EMAIL PROTECTED] > Problems?: [EMAIL PROTECTED] > -- -- To subscribe:[EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Problems?: [EMAIL PROTECTED]
Re: [jBoss-User] java:comp:/env Question?
Wong Kok Wai wrote: > > Note that it would be reasonable to assume that while /ejb is not > > created automatically, if the bean developer chooses a name prefixed > > with /ejb it must be created. Any other behaviour is a bug in the EJB > > server. > > Is this stated in the specs? 14.3.4 (Container responsibilities wrt environment): "Preserve the application assembly information in the ejb-link elements by binding an EJB reference to the home interface of the specified target enterprise bean." If the bean developer has chosen a name that is a valid JNDI suffix the container must bind the EJB home to this name. What vendors are interpreting this differently?? /Rickard -- Rickard Öberg @home: +46 13 177937 Email: [EMAIL PROTECTED] http://www.telkel.com http://www.jboss.org http://www.dreambean.com -- -- To subscribe:[EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Problems?: [EMAIL PROTECTED]
Re: [jBoss-User] java:comp:/env Question?
Rickard Öberg wrote: > Hi! > > Juha-P Lindfors wrote: > > > > Hi, > > > > On Wed, 12 Jul 2000, Wong Kok Wai wrote: > > > See section 14.3.1.1 of EJB 1.1, second bullet point: > > > > > > "The EJB specification recommends, but does not require..." > > > > > > By that it means not mandatory. > > > > I understand this means the /ejb subcontext under java:comp/env/. > > This is not mandatory. The java:comp/env/ naming however is. > > Note that it would be reasonable to assume that while /ejb is not > created automatically, if the bean developer chooses a name prefixed > with /ejb it must be created. Any other behaviour is a bug in the EJB > server. Is this stated in the specs? -- -- To subscribe:[EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Problems?: [EMAIL PROTECTED]
Re: [jBoss-User] java:comp:/env Question?
Hi! Wong Kok Wai wrote: > Which means the looking up of EJB using "java:com/env/ejb" is not > mandatory, and to me this means non-portability between containers. It does not. These names are chosen arbitrarily by the bean developer. The bean developer may choose to use the /ejb prefix convention, but this is not mandatory. Since this is a name that is chosen by the bean developer this has nothing to do with container portability. The bean developer may easily hardcode the string name of the referenced beans in his code, since this is something that will never change. /Rickard -- Rickard Öberg @home: +46 13 177937 Email: [EMAIL PROTECTED] http://www.telkel.com http://www.jboss.org http://www.dreambean.com -- -- To subscribe:[EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Problems?: [EMAIL PROTECTED]
Re: [jBoss-User] java:comp:/env Question?
Hi! Juha-P Lindfors wrote: > > Hi, > > On Wed, 12 Jul 2000, Wong Kok Wai wrote: > > See section 14.3.1.1 of EJB 1.1, second bullet point: > > > > "The EJB specification recommends, but does not require..." > > > > By that it means not mandatory. > > I understand this means the /ejb subcontext under java:comp/env/. > This is not mandatory. The java:comp/env/ naming however is. Note that it would be reasonable to assume that while /ejb is not created automatically, if the bean developer chooses a name prefixed with /ejb it must be created. Any other behaviour is a bug in the EJB server. /Rickard -- Rickard Öberg @home: +46 13 177937 Email: [EMAIL PROTECTED] http://www.telkel.com http://www.jboss.org http://www.dreambean.com -- -- To subscribe:[EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Problems?: [EMAIL PROTECTED]
Re: [jBoss-User] java:comp:/env Question?
Hi! Wong Kok Wai wrote: > > See section 14.3.1.1 of EJB 1.1, second bullet point: > > "The EJB specification recommends, but does not require..." > > By that it means not mandatory. As Juha pointed out this only means that the naming convention of using the /ejb prefix is not mandatory. Which is normal, since these are arbitrary names chosen by the bean developer. /Rickard -- Rickard Öberg @home: +46 13 177937 Email: [EMAIL PROTECTED] http://www.telkel.com http://www.jboss.org http://www.dreambean.com -- -- To subscribe:[EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Problems?: [EMAIL PROTECTED]
Re: [jBoss-User] java:comp:/env Question?
Yes. Juha-P Lindfors wrote: > Yes, and I agree, but in your earlier post you said "java:comp/env/" is > not mandatory which was incorrect. I think you meant to include the /ejb > subcontext there as well. > > -- Juha > -- -- To subscribe:[EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Problems?: [EMAIL PROTECTED]
Re: [jBoss-User] java:comp:/env Question?
Yes, and I agree, but in your earlier post you said "java:comp/env/" is not mandatory which was incorrect. I think you meant to include the /ejb subcontext there as well. -- Juha On Wed, 12 Jul 2000, Wong Kok Wai wrote: > Which means the looking up of EJB using "java:com/env/ejb" is not > mandatory, and to me this means non-portability between containers. > > Juha-P Lindfors wrote: > > > Hi, > > > > On Wed, 12 Jul 2000, Wong Kok Wai wrote: > > > See section 14.3.1.1 of EJB 1.1, second bullet point: > > > > > > "The EJB specification recommends, but does not require..." > > > > > > By that it means not mandatory. > > > > I understand this means the /ejb subcontext under java:comp/env/. > > This is not mandatory. The java:comp/env/ naming however is. > > > > -- Juha > > > > -- > > -- > > To subscribe:[EMAIL PROTECTED] > > To unsubscribe: [EMAIL PROTECTED] > > Problems?: [EMAIL PROTECTED] > > > > -- > -- > To subscribe:[EMAIL PROTECTED] > To unsubscribe: [EMAIL PROTECTED] > Problems?: [EMAIL PROTECTED] > > -- -- To subscribe:[EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Problems?: [EMAIL PROTECTED]
Re: [jBoss-User] java:comp:/env Question?
Which means the looking up of EJB using "java:com/env/ejb" is not mandatory, and to me this means non-portability between containers. Juha-P Lindfors wrote: > Hi, > > On Wed, 12 Jul 2000, Wong Kok Wai wrote: > > See section 14.3.1.1 of EJB 1.1, second bullet point: > > > > "The EJB specification recommends, but does not require..." > > > > By that it means not mandatory. > > I understand this means the /ejb subcontext under java:comp/env/. > This is not mandatory. The java:comp/env/ naming however is. > > -- Juha > > -- > -- > To subscribe:[EMAIL PROTECTED] > To unsubscribe: [EMAIL PROTECTED] > Problems?: [EMAIL PROTECTED] -- -- To subscribe:[EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Problems?: [EMAIL PROTECTED]
Re: [jBoss-User] java:comp:/env Question?
Hi, On Wed, 12 Jul 2000, Wong Kok Wai wrote: > See section 14.3.1.1 of EJB 1.1, second bullet point: > > "The EJB specification recommends, but does not require..." > > By that it means not mandatory. I understand this means the /ejb subcontext under java:comp/env/. This is not mandatory. The java:comp/env/ naming however is. -- Juha -- -- To subscribe:[EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Problems?: [EMAIL PROTECTED]
Re: [jBoss-User] java:comp:/env Question?
See section 14.3.1.1 of EJB 1.1, second bullet point: "The EJB specification recommends, but does not require..." By that it means not mandatory. Rickard Öberg wrote: > Hi! > > Wong Kok Wai wrote: > > Personally, I would prefer the specs make java:comp/env mandatory so that all > > containers are consistence in the looking up call. The problem now is it is > > only suggested so all vendors can define whatever they wish. > > Supporting this namespace is indeed mandated in EJB 1.1. What in the > spec gives you the impression that it is not mandatory? > > regards, > Rickard > -- -- To subscribe:[EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Problems?: [EMAIL PROTECTED]
Re: [jBoss-User] java:comp:/env Question?
Hi! Wong Kok Wai wrote: > Personally, I would prefer the specs make java:comp/env mandatory so that all > containers are consistence in the looking up call. The problem now is it is > only suggested so all vendors can define whatever they wish. Supporting this namespace is indeed mandated in EJB 1.1. What in the spec gives you the impression that it is not mandatory? regards, Rickard -- Rickard Öberg @home: +46 13 177937 Email: [EMAIL PROTECTED] http://www.telkel.com http://www.jboss.org http://www.dreambean.com -- -- To subscribe:[EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Problems?: [EMAIL PROTECTED]
Re: [jBoss-User] java:comp:/env Question?
Personally, I would prefer the specs make java:comp/env mandatory so that all
containers are consistence in the looking up call. The problem now is it is
only suggested so all vendors can define whatever they wish.
danch wrote:
> For the record, a lot of the containers I've been dealing with put
> deployed EJB homes in the root namespace when you get the initial
> context:
>
> Context ctx = new InitialContext();
> MyBeanHome = ctx.lookup("homey");
>
> Where things land in JNDI land is one of the most irritating things when
> going from one container to another: some have bugs and things don't
> show up where they should, some take the spec literally when it calls
> these things 'suggested', etc.
>
--
--
To subscribe:[EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]
Re: [jBoss-User] java:comp:/env Question?
For the record, a lot of the containers I've been dealing with put
deployed EJB homes in the root namespace when you get the initial
context:
Context ctx = new InitialContext();
MyBeanHome = ctx.lookup("homey");
Where things land in JNDI land is one of the most irritating things when
going from one container to another: some have bugs and things don't
show up where they should, some take the spec literally when it calls
these things 'suggested', etc.
Pranab Dhar wrote:
>
> Hi ,
> I have been trying to use the java:comp/env default context in my
> client to get
> Home references.From the books and specification I gather that
> deployed bean are
> mapped under java:comp/env/ejb subdirectory i.e for an EJB we will
> use
> java:comp/env/ejb/TestBeanHome to do a lookup. So far all my
> attempts has been a
> failure. Am I doing something wrong ?
>
> PKD
>
> --
> --
> To subscribe:[EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> Problems?: [EMAIL PROTECTED]
--
--
To subscribe:[EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]
