tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Tye" <tt...@ticnet.com>
Subject Re: <ejb-ref> <ejb-link> Implementation in 4.0.b1
Date Sun, 11 Mar 2001 06:13:02 GMT
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 <ammulder@alumni.princeton.edu>
To: <tomcat-dev@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: <tttye@ticnet.com>
> > > To: <tomcat-dev@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


Mime
View raw message