The getServlet() method has been deprecated and can return null in new Servlet
engine implementation.
You might want to make a call to this servlet when the servlet engine starts or
write a method making a call to this servlet if the object is not available in the
servletContext.

Olivier

Neal Kaiser wrote:

>  I have a database pooling servlet which I need to load at startup time then
> reference many times later. I've switched from JRun and am trying out
> OrionServer, but can't seem to get it to work. Here's my web-application.xml
> snippet:
>
>  -------
>         <servlet>
>                  <servlet-name>GlobalConnectionBroker</servlet-name>
>
> <servlet-class>net.anythingcreative.db.GlobalConnectionBroker</servlet-class
>
>                  <init-param>
>                         <param-name>configfile</param-name>
>
>  <param-value>/usr/local/jdk/ex/creative.cfg</param-value>
>                  </init-param>
>                  <load-on-startup></load-on-startup>
>         </servlet>
>  ------
>
>  You'll notice that I'm calling it "GlobalConnectionBroker", and that's the
>  name I use to reference it later.
>
>  Here's my site.log, you can see that it is loaded:
> ---
>  10/22/99 8:50 AM Started
>  10/22/99 8:50 AM net.anythingcreative.db.GlobalConnectionBroker: init
>  10/22/99 8:50 AM globalBroker is loaded:
>  net.anythingcreative.db.DbConnectionBroker@40074b41
>  10/22/99 8:50 AM com.evermind.servlet.XSLServlet: init
>  -----
>   However, I don't understand why it is saying "globalBroker"?  That is just
> a
>  variable for a class that GlobalConnectionBroker loads....
>
>  Anyway, here is my code that tries to grab a handle to the
>  GlobalConnectionBroker, but it always returns null:
>
>       Servlet servlet = null;
>        try {
>          servlet = (GlobalConnectionBroker)
>        application.getServlet("GlobalConnectionBroker");
>        } catch (Exception e) {
>          application.log("Exception: " + e);
>          return null;
>        }
>
>       conServlet = (GlobalConnectionBroker) servlet;
>        if (conServlet == null) {
>          // it always returns null here.......
>         return null;
>       }
>
>  Does anyone have any ideas?
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> FAQs on JSP can be found at:
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to