You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by tt...@ticnet.com on 2001/03/09 17:55:57 UTC

Implementation in 4.0.b1

I am trying to obtain a remote reference to an EJB in another machine.  
I have set the ejb-ref in web.xml as follows:
<ejb-ref> 
    <description>Sample bean generated by coolgen placed here for ease of
                     early testing</description>
    <ejb-ref-name>ejb/S_STRESS_32K</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>cool.models.coop07.java.S_STRESS_32KpsHome</home>
    <remote>cool.models.coop07.java.S_STRESS_32Kps</remote>
    <ejb-link>jndi:/ttt1.ca.com:1099/S_STRESS_32Kps</ejb-link>
</ejb-ref>
However, when I do ctx.lookup("java:/comp/ejb/S_STRESS_32K") I get a null
reference instead of the necessary remote reference to the home interface.
Is ejb-link implemented and documented?
Which code is involved in ejb-link lookup?
Is this fixed in the latest 4.0?

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, email: tomcat-dev-help@jakarta.apache.org


Re: Implementation in 4.0.b1

Posted by Remy Maucherat <re...@betaversion.org>.
Quoting tttye@ticnet.com:

> YET: this same code works when I run it from a standalone Java
> application.
> I believe that tomcat's InitialContext() is preventing the remote
> connection from being established.

Actually, it's a classloader related issue which has been fixed after beta 1.

Remy

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, email: tomcat-dev-help@jakarta.apache.org


Re: Implementation in 4.0.b1

Posted by Tim Tye <tt...@ticnet.com>.
The EJB 2.0 Draft specification does specify <ejb-ref> via <ejb-link> as the
connection between different EJB containers.  Also, all naming lookup does
go through a JNDI interface usually starting at a local InitialContext.
I can send you the section describing this in the EJB specification on
Monday.

----- Original Message -----
From: Aaron Mulder <am...@alumni.princeton.edu>
To: <to...@jakarta.apache.org>
Sent: Saturday, March 10, 2001 7:40 AM
Subject: Re: <ejb-ref> <ejb-link> Implementation in 4.0.b1


> I'm a little confused by all of the discussion around this.
> Acoording to the spec, the <ejb-link> is supposed to have the name of
> an EJB deployed in the same application unit.  In other words, no JNDI
> stuff, no factories, just a name.  "MyBean", or whatever.
> If Tomcat wants you to put JNDI stuff in there, isn't that an
> abuse of the spec?  Shouldn't Tomcat be using a separate server-specific
> deployment descriptor to provide the extra information to reference beans
> that are in a different application (i.e. those that require cusotm JNDI
> settings)?
>
> Aaron
>
> On Fri, 9 Mar 2001 tttye@ticnet.com wrote:
> > Weining Qi writes:
> >
> > > if you are running tomcat 3.x in the same window (tomcat run), look at
the
> > > feedback from tomcat when call the ejb that way, you can see that
tomcat
> > > does not recognize the namespace "java:com/env/" for calling ejb as
> >   The name is "java:comp/ejb"  NOT --------------.
> >   And yes tomcat does recognize it!!!!
> >   Because it is defined in web.xml as shown in the snip.
> >
> > > the sun j2ee specification v1.3. you should call ejb directly by its
jndi
> > > name, which you gave when you deployed it.
> > I tried that, it does not work.  I get "NamingException".
> > Note: the EJB is deployed in a different machine than tomcat.
> > When I try to open the context to that machine directly from a servlet
in
> > tomcat, I get:
> > javax.naming.NoInitialContextException: Cannot instantiate class:
> > org.jnp.interfaces.NamingContextFactory.  Root exception is
> > java.lang.ClassCastException: org.jnp.interfaces.NamingContextFactory
> >     at
> > javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:659)
> >     at
> > javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:250)
> >     at javax.naming.InitialContext.init(InitialContext.java:226)
> >     at javax.naming.InitialContext.<init>(InitialContext.java:202)
> >     at SimpleServlet.printContextInfo(SimpleServlet.java:168)
> >     at SimpleServlet.doIt(SimpleServlet.java:99)
> >     at SimpleServlet.doGet(SimpleServlet.java:30)
> >     at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
> >     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> >     at
> >
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
java:573)
> >     at
> >
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatch
er.java:321)
> >     at
> >
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher
.java:236)
> >     at
> >
org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java
:386)
> >     at
> >
org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:144)
> >     at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
> >     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> >     at
> >
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:215)
> >     at filters.ExampleFilter.doFilter(ExampleFilter.java:140)
> >     at
> >
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:180)
> >     at filters.ExampleFilter.doFilter(ExampleFilter.java:140)
> >     at
> >
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:180)
> >     at
> >
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:251)
> >     at
> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977)
> >     at
> >
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:196)
> >     at
org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242)
> >     at
> >
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase
.java:464)
> >     at
> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:975)
> >     at
> >
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2041)
> >     at
> >
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161
)
> >     at
org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242)
> >     at
> >
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:414)
> >     at
> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:975)
> >     at
> >
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:159)
> >     at
> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977)
> >     at
> >
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:
818)
> >     at
> >
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:897)
> >     at java.lang.Thread.run(Thread.java:484)
> >
> > YET: this same code works when I run it from a standalone Java
application.
> > I believe that tomcat's InitialContext() is preventing the remote
> > connection from being established.
> >
> > >
> > > Weining
> > > ================================
> > > Weining Qi
> > > RabobankICT and Info.nl, Amsterdam
> > > IPO, TU/e, Eindhoven, The Netherlands
> > > http://weining.n3.net/
> > > Tel: +31.628161183
> > >
> > > ----- Original Message -----
> > > From: <tt...@ticnet.com>
> > > To: <to...@jakarta.apache.org>
> > > Sent: Friday, March 09, 2001 5:55 PM
> > > Subject: <ejb-ref> <ejb-link> Implementation in 4.0.b1
> > >
> > >
> > > >
> > > > I am trying to obtain a remote reference to an EJB in another
machine.
> > > > I have set the ejb-ref in web.xml as follows:
> > > > <ejb-ref>
> > > >     <description>Sample bean generated by coolgen placed here for
ease of
> > > >                      early testing</description>
> > > >     <ejb-ref-name>ejb/S_STRESS_32K</ejb-ref-name>
> > > >     <ejb-ref-type>Session</ejb-ref-type>
> > > >     <home>cool.models.coop07.java.S_STRESS_32KpsHome</home>
> > > >     <remote>cool.models.coop07.java.S_STRESS_32Kps</remote>
> > > >     <ejb-link>jndi:/ttt1.ca.com:1099/S_STRESS_32Kps</ejb-link>
> > > > </ejb-ref>
> > > > However, when I do ctx.lookup("java:/comp/ejb/S_STRESS_32K") I get a
null
> > > > reference instead of the necessary remote reference to the home
interface.
> > > > Is ejb-link implemented and documented?
> > > > Which code is involved in ejb-link lookup?
> > > > Is this fixed in the latest 4.0?
> > > >
> > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> > > > For additional commands, email: tomcat-dev-help@jakarta.apache.org
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> > > For additional commands, email: tomcat-dev-help@jakarta.apache.org
> > >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> > For additional commands, email: tomcat-dev-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, email: tomcat-dev-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, email: tomcat-dev-help@jakarta.apache.org


Re: Implementation in 4.0.b1

Posted by Aaron Mulder <am...@alumni.princeton.edu>.
	I'm a little confused by all of the discussion around this.
Acoording to the spec, the <ejb-link> is supposed to have the name of
an EJB deployed in the same application unit.  In other words, no JNDI
stuff, no factories, just a name.  "MyBean", or whatever.
	If Tomcat wants you to put JNDI stuff in there, isn't that an
abuse of the spec?  Shouldn't Tomcat be using a separate server-specific
deployment descriptor to provide the extra information to reference beans
that are in a different application (i.e. those that require cusotm JNDI
settings)?

Aaron

On Fri, 9 Mar 2001 tttye@ticnet.com wrote:
> Weining Qi writes:
>
> > if you are running tomcat 3.x in the same window (tomcat run), look at the
> > feedback from tomcat when call the ejb that way, you can see that tomcat
> > does not recognize the namespace "java:com/env/" for calling ejb as
>   The name is "java:comp/ejb"  NOT --------------.
>   And yes tomcat does recognize it!!!!
>   Because it is defined in web.xml as shown in the snip.
>
> > the sun j2ee specification v1.3. you should call ejb directly by its jndi
> > name, which you gave when you deployed it.
> I tried that, it does not work.  I get "NamingException".
> Note: the EJB is deployed in a different machine than tomcat.
> When I try to open the context to that machine directly from a servlet in
> tomcat, I get:
> javax.naming.NoInitialContextException: Cannot instantiate class:
> org.jnp.interfaces.NamingContextFactory.  Root exception is
> java.lang.ClassCastException: org.jnp.interfaces.NamingContextFactory
>     at
> javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:659)
>     at
> javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:250)
>     at javax.naming.InitialContext.init(InitialContext.java:226)
>     at javax.naming.InitialContext.<init>(InitialContext.java:202)
>     at SimpleServlet.printContextInfo(SimpleServlet.java:168)
>     at SimpleServlet.doIt(SimpleServlet.java:99)
>     at SimpleServlet.doGet(SimpleServlet.java:30)
>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>     at
> org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:573)
>     at
> org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:321)
>     at
> org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:236)
>     at
> org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:386)
>     at
> org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:144)
>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>     at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
>     at filters.ExampleFilter.doFilter(ExampleFilter.java:140)
>     at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:180)
>     at filters.ExampleFilter.doFilter(ExampleFilter.java:140)
>     at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:180)
>     at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:251)
>     at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977)
>     at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:196)
>     at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242)
>     at
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:464)
>     at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:975)
>     at
> org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2041)
>     at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
>     at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242)
>     at
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:414)
>     at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:975)
>     at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:159)
>     at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977)
>     at
> org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:818)
>     at
> org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:897)
>     at java.lang.Thread.run(Thread.java:484)
>
> YET: this same code works when I run it from a standalone Java application.
> I believe that tomcat's InitialContext() is preventing the remote
> connection from being established.
>
> >
> > Weining
> > ================================
> > Weining Qi
> > RabobankICT and Info.nl, Amsterdam
> > IPO, TU/e, Eindhoven, The Netherlands
> > http://weining.n3.net/
> > Tel: +31.628161183
> >
> > ----- Original Message -----
> > From: <tt...@ticnet.com>
> > To: <to...@jakarta.apache.org>
> > Sent: Friday, March 09, 2001 5:55 PM
> > Subject: <ejb-ref> <ejb-link> Implementation in 4.0.b1
> >
> >
> > >
> > > I am trying to obtain a remote reference to an EJB in another machine.
> > > I have set the ejb-ref in web.xml as follows:
> > > <ejb-ref>
> > >     <description>Sample bean generated by coolgen placed here for ease of
> > >                      early testing</description>
> > >     <ejb-ref-name>ejb/S_STRESS_32K</ejb-ref-name>
> > >     <ejb-ref-type>Session</ejb-ref-type>
> > >     <home>cool.models.coop07.java.S_STRESS_32KpsHome</home>
> > >     <remote>cool.models.coop07.java.S_STRESS_32Kps</remote>
> > >     <ejb-link>jndi:/ttt1.ca.com:1099/S_STRESS_32Kps</ejb-link>
> > > </ejb-ref>
> > > However, when I do ctx.lookup("java:/comp/ejb/S_STRESS_32K") I get a null
> > > reference instead of the necessary remote reference to the home interface.
> > > Is ejb-link implemented and documented?
> > > Which code is involved in ejb-link lookup?
> > > Is this fixed in the latest 4.0?
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> > > For additional commands, email: tomcat-dev-help@jakarta.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> > For additional commands, email: tomcat-dev-help@jakarta.apache.org
> >
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, email: tomcat-dev-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, email: tomcat-dev-help@jakarta.apache.org


Re: Implementation in 4.0.b1

Posted by tt...@ticnet.com.
Weining Qi writes:

> if you are running tomcat 3.x in the same window (tomcat run), look at the
> feedback from tomcat when call the ejb that way, you can see that tomcat 
> does not recognize the namespace "java:com/env/" for calling ejb as 
  The name is "java:comp/ejb"  NOT --------------.
  And yes tomcat does recognize it!!!!
  Because it is defined in web.xml as shown in the snip.

> the sun j2ee specification v1.3. you should call ejb directly by its jndi 
> name, which you gave when you deployed it.
I tried that, it does not work.  I get "NamingException".
Note: the EJB is deployed in a different machine than tomcat.  
When I try to open the context to that machine directly from a servlet in
tomcat, I get:
javax.naming.NoInitialContextException: Cannot instantiate class:
org.jnp.interfaces.NamingContextFactory.  Root exception is
java.lang.ClassCastException: org.jnp.interfaces.NamingContextFactory
    at
javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:659)
    at
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:250)
    at javax.naming.InitialContext.init(InitialContext.java:226)
    at javax.naming.InitialContext.<init>(InitialContext.java:202)
    at SimpleServlet.printContextInfo(SimpleServlet.java:168)
    at SimpleServlet.doIt(SimpleServlet.java:99)
    at SimpleServlet.doGet(SimpleServlet.java:30)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:573)
    at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:321)
    at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:236)
    at
org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:386)
    at
org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:144)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
    at filters.ExampleFilter.doFilter(ExampleFilter.java:140)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:180)
    at filters.ExampleFilter.doFilter(ExampleFilter.java:140)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:180)
    at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:251)
    at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977)
    at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:196)
    at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242)
    at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:464)
    at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:975)
    at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2041)
    at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
    at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242)
    at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:414)
    at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:975)
    at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:159)
    at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977)
    at
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:818)
    at
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:897)
    at java.lang.Thread.run(Thread.java:484)

YET: this same code works when I run it from a standalone Java application.
I believe that tomcat's InitialContext() is preventing the remote
connection from being established.

> 
> Weining
> ================================
> Weining Qi
> RabobankICT and Info.nl, Amsterdam
> IPO, TU/e, Eindhoven, The Netherlands
> http://weining.n3.net/
> Tel: +31.628161183
> 
> ----- Original Message -----
> From: <tt...@ticnet.com>
> To: <to...@jakarta.apache.org>
> Sent: Friday, March 09, 2001 5:55 PM
> Subject: <ejb-ref> <ejb-link> Implementation in 4.0.b1
> 
> 
> >
> > I am trying to obtain a remote reference to an EJB in another machine.
> > I have set the ejb-ref in web.xml as follows:
> > <ejb-ref>
> >     <description>Sample bean generated by coolgen placed here for ease of
> >                      early testing</description>
> >     <ejb-ref-name>ejb/S_STRESS_32K</ejb-ref-name>
> >     <ejb-ref-type>Session</ejb-ref-type>
> >     <home>cool.models.coop07.java.S_STRESS_32KpsHome</home>
> >     <remote>cool.models.coop07.java.S_STRESS_32Kps</remote>
> >     <ejb-link>jndi:/ttt1.ca.com:1099/S_STRESS_32Kps</ejb-link>
> > </ejb-ref>
> > However, when I do ctx.lookup("java:/comp/ejb/S_STRESS_32K") I get a null
> > reference instead of the necessary remote reference to the home interface.
> > Is ejb-link implemented and documented?
> > Which code is involved in ejb-link lookup?
> > Is this fixed in the latest 4.0?
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> > For additional commands, email: tomcat-dev-help@jakarta.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, email: tomcat-dev-help@jakarta.apache.org
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, email: tomcat-dev-help@jakarta.apache.org


Re: Implementation in 4.0.b1

Posted by Weining Qi <w....@tue.nl>.
hi,

if you are running tomcat 3.x in the same window (tomcat run), look at the
feedback from tomcat when call the ejb that way, you can see that tomcat does
not recognize the namespace "java:com/env/" for calling ejb as recommended by
the sun j2ee specification v1.3. you should call ejb directly by its jndi name,
which you gave when you deployed it.

tomcat 4.0-beta has also the same problem, but it improves with interpreting the
<env-entry> element: you can get environment entries defined within deployment
descriptor of the tomcat app the same way of j2ee speci v1.3 (p. 5-4). but, with
tomcat 4.0-beta you cannot call ejb by jndi name!? i just test this today. the
ejb server i am using is j2ee sun reference implementation, winnt and win2000.

is there anybody who has met the same on other ejb servers?

Weining
================================
Weining Qi
RabobankICT and Info.nl, Amsterdam
IPO, TU/e, Eindhoven, The Netherlands
http://weining.n3.net/
Tel: +31.628161183

----- Original Message -----
From: <tt...@ticnet.com>
To: <to...@jakarta.apache.org>
Sent: Friday, March 09, 2001 5:55 PM
Subject: <ejb-ref> <ejb-link> Implementation in 4.0.b1


>
> I am trying to obtain a remote reference to an EJB in another machine.
> I have set the ejb-ref in web.xml as follows:
> <ejb-ref>
>     <description>Sample bean generated by coolgen placed here for ease of
>                      early testing</description>
>     <ejb-ref-name>ejb/S_STRESS_32K</ejb-ref-name>
>     <ejb-ref-type>Session</ejb-ref-type>
>     <home>cool.models.coop07.java.S_STRESS_32KpsHome</home>
>     <remote>cool.models.coop07.java.S_STRESS_32Kps</remote>
>     <ejb-link>jndi:/ttt1.ca.com:1099/S_STRESS_32Kps</ejb-link>
> </ejb-ref>
> However, when I do ctx.lookup("java:/comp/ejb/S_STRESS_32K") I get a null
> reference instead of the necessary remote reference to the home interface.
> Is ejb-link implemented and documented?
> Which code is involved in ejb-link lookup?
> Is this fixed in the latest 4.0?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, email: tomcat-dev-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, email: tomcat-dev-help@jakarta.apache.org


Re: Implementation in 4.0.b1

Posted by Remy Maucherat <re...@apache.org>.
> Where is the interface document for tomcat object factories?

It's the standard JNDI interface : javax.naming.spi.ObjectFactory

The first parameter you get is a reference instance which contains a set of
parameters. The format of the reference is proprietary (since there is no
standard for this), but very straightforward.

> I would like to have an object factory for JBoss context.

I don't know how feasible that is ...

Remy


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, email: tomcat-dev-help@jakarta.apache.org


Re: Implementation in 4.0.b1

Posted by Tim Tye <tt...@ticnet.com>.
Where is the interface document for tomcat object factories?
I would like to have an object factory for JBoss context.

----- Original Message -----
From: Remy Maucherat <re...@apache.org>
To: <to...@jakarta.apache.org>
Sent: Friday, March 09, 2001 7:13 PM
Subject: Re: <ejb-ref> <ejb-link> Implementation in 4.0.b1


> > I am trying to obtain a remote reference to an EJB in another machine.
> > I have set the ejb-ref in web.xml as follows:
> > <ejb-ref>
> >     <description>Sample bean generated by coolgen placed here for ease
of
> >                      early testing</description>
> >     <ejb-ref-name>ejb/S_STRESS_32K</ejb-ref-name>
> >     <ejb-ref-type>Session</ejb-ref-type>
> >     <home>cool.models.coop07.java.S_STRESS_32KpsHome</home>
> >     <remote>cool.models.coop07.java.S_STRESS_32Kps</remote>
> >     <ejb-link>jndi:/ttt1.ca.com:1099/S_STRESS_32Kps</ejb-link>
> > </ejb-ref>
> > However, when I do ctx.lookup("java:/comp/ejb/S_STRESS_32K") I get a
null
> > reference instead of the necessary remote reference to the home
interface.
> > Is ejb-link implemented and documented?
> > Which code is involved in ejb-link lookup?
> > Is this fixed in the latest 4.0?
>
> Tomcat 4 will parse the web.xml file and bind references to the specified
> resources in the naming environment. To be able to resolve those
references,
> TC needs an appropriate object factory. If no object factory is available,
> null is returned when you do a lookup.
>
> Right now, there are two factories :
> - one for getting Tyrex managed data sources
> - one for getting Tyrex UserTransactions
> You can easily add additional factories for additional resource types
(EJBs,
> JMS resources ...). Contributed object factories (provided they are
generic
> enough) could be added to the repository.
>
> Remy
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, email: tomcat-dev-help@jakarta.apache.org
>
>




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, email: tomcat-dev-help@jakarta.apache.org


Re: Implementation in 4.0.b1

Posted by Remy Maucherat <re...@apache.org>.
> I am trying to obtain a remote reference to an EJB in another machine.
> I have set the ejb-ref in web.xml as follows:
> <ejb-ref>
>     <description>Sample bean generated by coolgen placed here for ease of
>                      early testing</description>
>     <ejb-ref-name>ejb/S_STRESS_32K</ejb-ref-name>
>     <ejb-ref-type>Session</ejb-ref-type>
>     <home>cool.models.coop07.java.S_STRESS_32KpsHome</home>
>     <remote>cool.models.coop07.java.S_STRESS_32Kps</remote>
>     <ejb-link>jndi:/ttt1.ca.com:1099/S_STRESS_32Kps</ejb-link>
> </ejb-ref>
> However, when I do ctx.lookup("java:/comp/ejb/S_STRESS_32K") I get a null
> reference instead of the necessary remote reference to the home interface.
> Is ejb-link implemented and documented?
> Which code is involved in ejb-link lookup?
> Is this fixed in the latest 4.0?

Tomcat 4 will parse the web.xml file and bind references to the specified
resources in the naming environment. To be able to resolve those references,
TC needs an appropriate object factory. If no object factory is available,
null is returned when you do a lookup.

Right now, there are two factories :
- one for getting Tyrex managed data sources
- one for getting Tyrex UserTransactions
You can easily add additional factories for additional resource types (EJBs,
JMS resources ...). Contributed object factories (provided they are generic
enough) could be added to the repository.

Remy


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, email: tomcat-dev-help@jakarta.apache.org