| Author |
cannot activate servlet in the Web browser
|
Cathy Valdez
Greenhorn
Joined: Oct 22, 2003
Posts: 23
|
|
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
|
 |
Mike Curwen
Ranch Hand
Joined: Feb 20, 2001
Posts: 3695
|
|
It requires a pointbase database, and if you don't already have it, I'm not sure how useful this app will be. It's not only the database, but of course, all the data inside of it. How I can tell: in your web.xml file, there is a line that contains: jdbc:pointbase://@PB_HOST@:9093/WordGames You would replace @PB_HOST@ with the IP address of the computer that pointbase is running on (or 'localhost' if it's on the same box as Tomcat)
|
 |
 |
|
|
subject: cannot activate servlet in the Web browser
|
|
|