David,
After looking at the code in the book, it seems that you need to have a
'passwordFile' initialization parameter, in your web.xml file
<servlet>
<servlet-name>
TestProtectedPage
</servlet-name>
<servlet-class>
ProtectedPage
</servlet-class>
<init-param>
<param-name>passwordFile</param-name>
<param-value>your_password_file_location</param-value>
</init-param>
</servlet>
The contents of the password file should be built using the program on page
113.
This is all described on page 109.
-Richard
At 12:57 PM 10/3/01 -0400, you wrote:
>I am doing the examples from the book: "Core Servlets and Java Server
>Pages" by Marty Hall, published by Sun. The code being used is from
>Listing 4.3, ProtectedPage.java, p110.
>I am running iPlanet 4.1 SP7/jdk 1.3.1 on an NT box.
>The code compiles properly with no errors. However, at runtime, I get the
>following from
>iPlanet:***********************************************************************
>[03/Oct/2001:11:37:16] info ( 559): Internal Info: loading servlet
>/servlet/Test.ProtectedPage
>[03/Oct/2001:11:37:16] info ( 559): /servlet/Test.ProtectedPage: init
>[03/Oct/2001:11:37:16] failure ( 559): Internal error: unexpected
>exception thrown from the servlet init function (servlet
>class=Test.ProtectedPage): java.lang.NullPointerException, Stack:
>java.lang.NullPointerException at java.io.FileInputStream.open(Native
>Method) at java.io.FileInputStream.(FileInputStream.java:64) at
>Test.ProtectedPage.init(ProtectedPage.java:20) at
>com.netscape.server.http.servlet.NSServletEntity.load(NSServletEntity.java:377)
>at
>com.netscape.server.http.servlet.NSServletEntity.update(NSServletEntity.java:149)
>at
>com.netscape.server.http.servlet.NSServletRunner.Service(NSServletRunner.java:469)
>[03/Oct/2001:11:37:16] warning ( 559): Internal error: Failed to get
>GenericServlet.
>(uri=/servlet/Test.ProtectedPage,SCRIPT_NAME=/servlet/Test.ProtectedPage)
>****************************************************************
>
>If anyone has had success with these examples and has any input on the
>below error, I would appreciate the feedback.
>
>Cheers,
>--
>David L. Rice
>Web Applications Developer
>BellSouth/AL
>Direct: 205.977.0092
>24/7 Cell: 205.903.9467
>Wk: [EMAIL PROTECTED]
>Hm: [EMAIL PROTECTED]
>
>===========================================================================
>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
>JSP-INTEREST".
>For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
>Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets