RE: init() block not initializing?
Hi, Did you check the $CATALINA_HOME/logs/catalina.out log? By default, it swallows System.out and System.err statements. Yoav Shapira Millennium ChemInformatics -Original Message- From: Scott Purcell [mailto:[EMAIL PROTECTED]] Sent: Friday, December 06, 2002 2:34 PM To: [EMAIL PROTECTED] Subject: init() block not initializing? Hello, I am trying to get a servlet Initialization block to initialize but I cannot seem to get it to work. I am running a new install of Tomcat 4.1.12 on win2000. I have created a webapp called cybrary, and I have put that into the server xml with the following line: Context path=/cybrary docBase=cybrary debug=0 reloadable=true crossContext=true / Then I created the proper structure under webapps eg: /webapps/cybrary/WEB-INF/classes/com/ddi/ags/rpc/CybraryRPCHandler.java The code I am running is here, there is nothing to it, just want it to hit the init block. When I run it with the following url: http://localhost:8080/cybrary/servlet/CybraryRPCHandler the out.println message shows, but no init ever. I am printing that to stdout, in which I never see any print. Does anyone know why this would occur. Also, in case needed the web.xml is below all of this: package com.ddi.ags.rpc; import java.io.*; import java.util.*; import java.net.*; import javax.servlet.*; import javax.servlet.http.*; import org.apache.xmlrpc.*; public class CybraryRPCHandler extends HttpServlet { public void init() throws ServletException { System.out.println(IN the init); } public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { PrintWriter out = response.getWriter(); response.setContentType(text/html); out.println(this is another attempt at the init firing up.); } } web.xml ## ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app servlet servlet-nameCybraryRPCHandler/servlet-name servlet-classcom.ddi.ags.rpc.CybraryRPCHandler/servlet-class /servlet servlet-mapping servlet-nameCybraryRPCHandler/servlet-name url-pattern/servlet/CybraryRPCHandler/url-pattern /servlet-mapping welcome-file-list welcome-fileindex.html/welcome-file /welcome-file-list /web-app -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: init() block not initializing?
I went under my $CATALINA_HOME/logs but do not see a catalina.out.log. Do I need to adjust something in the server.xml? -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED]] Sent: Friday, December 06, 2002 1:37 PM To: Tomcat Users List Subject: RE: init() block not initializing? Hi, Did you check the $CATALINA_HOME/logs/catalina.out log? By default, it swallows System.out and System.err statements. Yoav Shapira Millennium ChemInformatics -Original Message- From: Scott Purcell [mailto:[EMAIL PROTECTED]] Sent: Friday, December 06, 2002 2:34 PM To: [EMAIL PROTECTED] Subject: init() block not initializing? Hello, I am trying to get a servlet Initialization block to initialize but I cannot seem to get it to work. I am running a new install of Tomcat 4.1.12 on win2000. I have created a webapp called cybrary, and I have put that into the server xml with the following line: Context path=/cybrary docBase=cybrary debug=0 reloadable=true crossContext=true / Then I created the proper structure under webapps eg: /webapps/cybrary/WEB-INF/classes/com/ddi/ags/rpc/CybraryRPCHandler.java The code I am running is here, there is nothing to it, just want it to hit the init block. When I run it with the following url: http://localhost:8080/cybrary/servlet/CybraryRPCHandler the out.println message shows, but no init ever. I am printing that to stdout, in which I never see any print. Does anyone know why this would occur. Also, in case needed the web.xml is below all of this: package com.ddi.ags.rpc; import java.io.*; import java.util.*; import java.net.*; import javax.servlet.*; import javax.servlet.http.*; import org.apache.xmlrpc.*; public class CybraryRPCHandler extends HttpServlet { public void init() throws ServletException { System.out.println(IN the init); } public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { PrintWriter out = response.getWriter(); response.setContentType(text/html); out.println(this is another attempt at the init firing up.); } } web.xml ## ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app servlet servlet-nameCybraryRPCHandler/servlet-name servlet-classcom.ddi.ags.rpc.CybraryRPCHandler/servlet-class /servlet servlet-mapping servlet-nameCybraryRPCHandler/servlet-name url-pattern/servlet/CybraryRPCHandler/url-pattern /servlet-mapping welcome-file-list welcome-fileindex.html/welcome-file /welcome-file-list /web-app -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: init() block not initializing?
I finally found my output in the /logs/localhost_log.2002-12-06.txt, but that is kind of a hastle. Is there a way to get it back to stdout? Thanks, Scott -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED]] Sent: Friday, December 06, 2002 1:37 PM To: Tomcat Users List Subject: RE: init() block not initializing? Hi, Did you check the $CATALINA_HOME/logs/catalina.out log? By default, it swallows System.out and System.err statements. Yoav Shapira Millennium ChemInformatics -Original Message- From: Scott Purcell [mailto:[EMAIL PROTECTED]] Sent: Friday, December 06, 2002 2:34 PM To: [EMAIL PROTECTED] Subject: init() block not initializing? Hello, I am trying to get a servlet Initialization block to initialize but I cannot seem to get it to work. I am running a new install of Tomcat 4.1.12 on win2000. I have created a webapp called cybrary, and I have put that into the server xml with the following line: Context path=/cybrary docBase=cybrary debug=0 reloadable=true crossContext=true / Then I created the proper structure under webapps eg: /webapps/cybrary/WEB-INF/classes/com/ddi/ags/rpc/CybraryRPCHandler.java The code I am running is here, there is nothing to it, just want it to hit the init block. When I run it with the following url: http://localhost:8080/cybrary/servlet/CybraryRPCHandler the out.println message shows, but no init ever. I am printing that to stdout, in which I never see any print. Does anyone know why this would occur. Also, in case needed the web.xml is below all of this: package com.ddi.ags.rpc; import java.io.*; import java.util.*; import java.net.*; import javax.servlet.*; import javax.servlet.http.*; import org.apache.xmlrpc.*; public class CybraryRPCHandler extends HttpServlet { public void init() throws ServletException { System.out.println(IN the init); } public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { PrintWriter out = response.getWriter(); response.setContentType(text/html); out.println(this is another attempt at the init firing up.); } } web.xml ## ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app servlet servlet-nameCybraryRPCHandler/servlet-name servlet-classcom.ddi.ags.rpc.CybraryRPCHandler/servlet-class /servlet servlet-mapping servlet-nameCybraryRPCHandler/servlet-name url-pattern/servlet/CybraryRPCHandler/url-pattern /servlet-mapping welcome-file-list welcome-fileindex.html/welcome-file /welcome-file-list /web-app -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]