tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Treves" <dw...@macam.ac.il>
Subject Re: newbie Q about EJB from servlets
Date Wed, 17 Oct 2001 07:48:20 GMT
I run Tomcat as a service in IIS 5.

How do I add to Tomcat's CLASSPATH when it is a service?

I know that in the 3.x versions there was a folder named "classes" inside
%TOMCAT_HOME% that was a part of the CLASSPATH, is it also like that in 4?

waiting for an answer...   :o)

By the way, I thought about it... I put classes data in the web.xml file,
and when trying to get a reference to an EJB object I simply use the
PortableRemoteObject.narrow() method, BUT (there is always a but...), how
does the server know to which server to connect? It is not an application
that I pass environment variables to.

Can you please clarify that issue?


Thanks for your time!
David.
----- Original Message -----
From: "Dmitri Colebatch" <dim@bigpond.net.au>
To: <tomcat-user@jakarta.apache.org>
Sent: Wednesday, October 17, 2001 9:43 AM
Subject: Re: newbie Q about EJB from servlets


> Have you got the ejb classes (as in javax.ejb.CreateException) in your
> classpath too?
>
> Are you running tomcat embedded or standalone?
>
> cheers
> dim
>
> On Wed, 17 Oct 2001, David Treves wrote:
>
> > Hi, Iam trying to get a reference to an EJB object from a servlet. I set
the
> > following tag in the web.xml file:
> >
> >  <ejb-ref>
> >   <description>reference to LoginBean</description>
> >   <ejb-ref-name>ejb/AuthHome</ejb-ref-name>
> >   <ejb-ref-type>Session</ejb-ref-type>
> >   <home>macam.common.ejb.authBean.AuthHome</home>
> >   <remote>macam.common.ejb.authBean.Auth</remote>
> >  </ejb-ref>
> >
> > If my servlet code tries to get the EJB reference I get the following
error:
> >
> > java.lang.NoClassDefFoundError: javax/ejb/CreateException.....  (the
rest at
> > the bottom - if it matters)
> >
> > I have under "WEB-INF\classes" the whole package of my EJBs, yet it
throws
> > tht exception. By the way, if I try to catch also
javax.ejb.RemoveException
> > in my code I get the same error but regarding RemoveException (instead
> > CreateException)
> >
> > Any idea what I am missing here? do I need some <env-entry> tags that I
am
> > not aware of?
> >
> > I should add that the EJB object itself is available all along (waiting
for
> > calls).
> >
> > Here is the complete error message:
> >
> >
> >
> >
> > A Servlet Exception Has Occurred
> > Exception Report:
> > javax.servlet.ServletException: Cannot allocate servlet instance for
path
> > /webTrails/servlet/login
> >  at
> >
org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java
> > :415)
> >  at
> >
org.apache.catalina.servlets.InvokerServlet.doPost(InvokerServlet.java:216)
> >  at javax.servlet.http.HttpServlet.service(HttpServlet.java:1145)
> >  at javax.servlet.http.HttpServlet.service(HttpServlet.java:1264)
> >  at
> >
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
> > FilterChain.java:247)
> >  at
> >
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
> > ain.java:193)
> >  at
> >
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
> > va:243)
> >  at
> >
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > 66)
> >  at
> >
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> >  at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> >  at
> >
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
> > va:215)
> >  at
> >
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > 66)
> >  at
> >
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:2
> > 46)
> >  at
> >
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > 64)
> >  at
> >
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> >  at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> >  at
> >
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2366)
> >  at
> >
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164
> > )
> >  at
> >
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > 66)
> >  at
> >
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
> >  at
> >
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > 64)
> >  at
> >
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> >  at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> >  at
> >
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
> > :163)
> >  at
> >
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > 66)
> >  at
> >
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> >  at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> >  at
> >
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:
> > 1005)
> >  at
> >
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1098
> > )
> >  at java.lang.Thread.run(Thread.java:539)
> >
> > Root Cause:
> > java.lang.NoClassDefFoundError: javax/ejb/CreateException
> >  at java.lang.Class.getDeclaredConstructors0(Native Method)
> >  at java.lang.Class.privateGetDeclaredConstructors(Class.java:1581)
> >  at java.lang.Class.getConstructor0(Class.java:1753)
> >  at java.lang.Class.newInstance0(Class.java:271)
> >  at java.lang.Class.newInstance(Class.java:254)
> >  at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:832)
> >  at
> >
org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:621)
> >  at
> >
org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java
> > :396)
> >  at
> >
org.apache.catalina.servlets.InvokerServlet.doPost(InvokerServlet.java:216)
> >  at javax.servlet.http.HttpServlet.service(HttpServlet.java:1145)
> >  at javax.servlet.http.HttpServlet.service(HttpServlet.java:1264)
> >  at
> >
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
> > FilterChain.java:247)
> >  at
> >
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
> > ain.java:193)
> >  at
> >
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
> > va:243)
> >  at
> >
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > 66)
> >  at
> >
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> >  at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> >  at
> >
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
> > va:215)
> >  at
> >
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > 66)
> >  at
> >
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:2
> > 46)
> >  at
> >
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > 64)
> >  at
> >
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> >  at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> >  at
> >
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2366)
> >  at
> >
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164
> > )
> >  at
> >
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > 66)
> >  at
> >
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
> >  at
> >
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > 64)
> >  at
> >
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> >  at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> >  at
> >
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
> > :163)
> >  at
> >
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > 66)
> >  at
> >
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> >  at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> >  at
> >
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:
> > 1005)
> >  at
> >
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1098
> > )
> >  at java.lang.Thread.run(Thread.java:539)
> >
> >


Mime
View raw message