Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

cannot activate servlet in the Web browser

 
Cathy Valdez
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OS=Windows98, Tomcat v. 4.1.27.exe, J2SE/JDK v. 1.3.1
contents of AUTOEXEC.BAT:
set PATH=c:\jdk1.3.1\bin;%PATH%
set CLASSPATH=%CLASSPATH%;.; c:\ServletDevel\database;c:\ServletDevel\database\lib\conn_pool.jar;c:\Tomcat\common\lib\servlet.jar
set JAVA_HOME=c:\jdk1.3.1

Compilation of servlet files that are included in this web application is successful.

Below is the content of Tomcat\webapps\database\WEB-INF\web.xml
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">
<web-app>
<display-name>SL-314 Database Exercise #1 Solution</display-name>
<description>
This Web Application is a solution for Database Exercise #1.
This WebApp demonstrates a typical servlet design using Connection
Pooling and Data Access Objects to interface with a database.
</description>
<!--
Step: Enter the parameters for constructing the Connection Pool.
-->
<context-param>
<param-name>jdbcDriver</param-name>
<param-value>com.pointbase.jdbc.jdbcUniversalDriver</param-value>
</context-param>
<context-param>
<param-name>jdbcURL</param-name>
<param-value>jdbc ointbase://@PB_HOST@:9093/WordGames</param-value>;
</context-param>
<context-param>
<param-name>jdbcUserName</param-name>
<param-value>PUBLIC</param-value> <!-- no user name -->
</context-param>
<context-param>
<param-name>jdbcPassword</param-name>
<param-value>PUBLIC</param-value> <!-- no password -->
</context-param>
<context-param>
<param-name>minimumConnections</param-name>
<param-value>1</param-value>
</context-param>
<context-param>
<param-name>maximumConnections</param-name>
<param-value>5</param-value>
</context-param>
<!--
Step: Enter the servlet context listener class name
-->
<listener>
<listener-class>sl314.web.InitializeConnectionPool</listener-class>
</listener>
<servlet>
<servlet-name>WordScrambleServlet</servlet-name>
<servlet-class>sl314.web.ScrambleGameServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>WordScrambleServlet</servlet-name>
<url-pattern>/wordScramble</url-pattern>
</servlet-mapping>
<error-page>
<exception-type>sl314.util.sql.ConnNotAvailException</exception-type>
<location>/error/server_busy.html</location>
</error-page>
<error-page>
<exception-type>sl314.util.sql.ShuttingDownException</exception-type>
<location>/error/server_shutdown.html</location>
</error-page>
</web-app>

I want this example web application with database activate the Scramble Game Servlet and run in the Web browser.
When I entered the URL http://localhost:8080/database/ for the message form in the Address field of Internet Explorer, the page for http://localhost:8080/database/index.html
below is displayed:

Duke's Arcade
Select from one of the following games:
�Word Scramble
When I clicked the Word Scramble above, the page for http://localhost:8080/database/wordScramble displayed the errors below:

Http status - 500
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException
at sl314.web.ScrambleGameServlet.showCategories(ScrambleGameServlet.java:54)
at sl314.web.ScrambleGameServlet.doGet(ScrambleGameServlet.java:29)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:601)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Thread.java:484)
root cause
java.lang.NullPointerException
at sl314.domain.WordCategoryDAO.selectAllCategories(WordCategoryDAO.java:38)
at sl314.domain.WordCategoryService.getCategories(WordCategoryService.java:16)
at sl314.web.ScrambleGameServlet.showCategories(ScrambleGameServlet.java:43)
at sl314.web.ScrambleGameServlet.doGet(ScrambleGameServlet.java:29)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:601)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Thread.java:484)

Apache Tomcat/4.1.27
What do errors above mean? What should I do to correct those errors so to activate the servlet in the Web browser?
The topic is integrating web application with database, I�ve done nothing with the connection to the database management system, and I don�t know how will I do it. What DBMS should I have installed in my PC so to use for this?
Can anybody there help?
Any suggestions regarding this would be greatly appreciated.
Thanks in advance.
Regards,
Cathy
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic