Re: null servlet context

That's a normal behaviour, as long as the root resource has no
ServletDirectoryFrame. The ServletWrapper MUST be in a
"servlet directory" (a DirectoryResource with a ServletDirectoryFrame).

If you want to add a ServletWrapper under "space" add a
ServletDirectoryFrame to the root resource (and remove the
HTTPFrame).

Regards, Benoit.

Christopher William Turner wrote:

> I use jigsaw 2.0.1.
> I have created a servlet (class is GetTrade) and I have tested it OK in
> the servlets directory. (The servlets directory is always empty and I
> have the classes
> in a jar file on the classpath.)
>
> I then tried to create a resource immediately under "space" named "t" as
> a servlet-wrapper. I configured it for the class name "GetTrade" and
> checked that it had a
> servlet-wrapper-frame. When I try to access it I get an error.  It seems
> that
> "getServletContext()" is returning null. What else do I need to
> configure?.
> (I know can acheive the effect I want with a redirect framed resource
> but I would
> rather avoid unneeded indirection.)
>
> Here is a trace.
>
> GET /t?7709411 HTTP/1.0
> Cache-Control: no-cache
> Connection: keep-alive
> Date: Thu, 08 Apr 1999 17:58:06 GMT
> Pragma: no-cache
> Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
> Host: cycom:8001
> User-Agent: HotJava/1.1 FCS
>
> java.lang.NullPointerException:
>  at
> org.w3c.jigsaw.servlet.ServletWrapper.getLocalServletLoader(ServletWrapper.java:386)
>
>  at
> org.w3c.jigsaw.servlet.ServletWrapper.checkServlet(ServletWrapper.java:159)
>
>  at
> org.w3c.jigsaw.servlet.ServletWrapperFrame.perform(ServletWrapperFrame.java:91)
>
>  at
> org.w3c.tools.resources.FramedResource.performFrames(FramedResource.java:587)
>
>  at
> org.w3c.tools.resources.FramedResource.perform(FramedResource.java:605)
>  at org.w3c.jigsaw.http.httpd.perform(httpd.java:1592)
>  at org.w3c.jigsaw.http.Client.processRequest(Client.java:384)
>  at org.w3c.jigsaw.http.Client.startConnection(Client.java:459)
>  at org.w3c.jigsaw.http.socket.SocketClient.run(SocketClient.java:114)
>  at org.w3c.util.CachedThread.run(ThreadCache.java:86)
> --
> Chris Turner, http://www.cycom.co.uk/

--
- Benoît Mahé -------------------------------------------------------
                      World Wide Web Consortium   (W3C)
                    Architecture domain - Jigsaw Engineer

                http://www.w3.org/People/Mahe  - bmahe@w3.org
---------------------------------------------------------------------

Received on Friday, 9 April 1999 04:09:12 UTC