Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 56244 invoked from network); 14 Jun 2004 14:21:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 14 Jun 2004 14:21:38 -0000 Received: (qmail 37912 invoked by uid 500); 14 Jun 2004 14:20:43 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 37879 invoked by uid 500); 14 Jun 2004 14:20:42 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 37861 invoked by uid 99); 14 Jun 2004 14:20:42 -0000 Received: from [132.236.56.39] (HELO postoffice9.mail.cornell.edu) (132.236.56.39) by apache.org (qpsmtpd/0.27.1) with ESMTP; Mon, 14 Jun 2004 07:20:41 -0700 Received: from [128.253.38.244] (defiant.ento.cornell.edu [128.253.38.244]) by postoffice9.mail.cornell.edu (8.12.10/8.12.6) with ESMTP id i5EEKPSR001989 for ; Mon, 14 Jun 2004 10:20:27 -0400 (EDT) Message-ID: <40CDB42B.5090801@cornell.edu> Date: Mon, 14 Jun 2004 10:20:27 -0400 From: David Smith User-Agent: Mozilla Thunderbird 0.6 (Macintosh/20040502) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tomcat Users List Subject: Re: problems to connect with mySQL References: <1087219321.40cda679b63be@www.uco.es> <40CDA97F.20801@cornell.edu> <1087220826.40cdac5a41b98@www.uco.es> In-Reply-To: <1087220826.40cdac5a41b98@www.uco.es> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N context.xml is just an xml file in conf/Catalina/localhost (at least for the default TC 5 setup). Replace 'context' with the name of your webapp. If the webapp is named samples, then the context file is samples.xml. The manager and admin context xml files are already there for you to take a look at. This context xml file is where to put context specific database connections, loggers, filters, valves, etc., ... On the empty jsp: Not all exceptions are caught in the jsp. A small few that should never normally happen can still be thrown and cause what you saw. I've had to suffer a few of them myself and always found the exception in the logs. You should still be able to find some info on what happened by looking at the logs. --David i02maolp@uco.es wrote: >context.xml doesn't exist. How do I have to create it? > > > >Mensaje citado por: David Smith : > > > >>Hi. >> >>I don't see anything in your setup for connecting to MySQL except a load >> >>of references to the jar file in your classpath. Also you didn't post >>your context.xml file for this webapp (maybe it doesn't exist?). I'd >>take the mysql jar out of your classpath and see the URL's I posted in >>my message 'Re: MySQL-connection pool' earlier this morning: >> >>Take a look at: >>http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-resources-howto.html >> >>About halfway down the page is a section titled 'JDBC Data Sources' >> >>Also take a look at: >>http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples- >> >> >howto.html > > >> >>This page has some specific examples to look at. >> >>--David >> >>i02maolp@uco.es wrote: >> >> >> >>>I'm trying to make a web application with JSP and servlets that access >>> >>> >>to a >> >> >>>MySQL data base. When I call to one of the servlets that access to the >>> >>> >>DB, the >> >> >>>browser (mozilla) works for a few seconds but at the end it show >>> >>> >>nothing (a >> >> >>>totally blank page) and in the browser status bar appear the following >>> >>> >>>message: "Finished". What I have to do in order to it works? >>> >>>My enviroment is: >>> >>>Linux Red Hat >>>Tomcat 5.0.25 >>>MySQL 4.0.17 >>> >>>More information: >>> >>>web.xml (conf) ----> >>> >>> >>>>> PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" >>> "http://java.sun.com/dtd/web-app_2_3.dtd"> >>> >>> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >>> default >>> >>> org.apache.catalina.servlets.DefaultServlet >>> >>> >>> debug >>> 0 >>> >>> >>> listings >>> true >>> >>> 1 >>> >>> >>> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >>> >>> invoker >>> >>> org.apache.catalina.servlets.InvokerServlet >>> >>> >>> debug >>> 0 >>> >>> 2 >>> >>> >>> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >>> jsp >>> >>> >>> >>org.apache.jasper.servlet.JspServlet >> >> >>> >>> fork >>> false >>> >>> >>> xpoweredBy >>> false >>> >>> 3 >>> >>> >>> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >>> >>> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >>> >>> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >>> >>> default >>> / >>> >>> >>> >>> >>> >>> invoker >>> /servlet/* >>> >>> >>> >>> >>> jsp >>> *.jsp >>> >>> >>> >>> jsp >>> *.jspx >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >> >> >>> >> >> >>> >> >> >>> >>> 30 >>> >>> >>> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >>> abs >>> audio/x-mpeg >>> >>> >>> ai >>> application/postscript >>> >>> >>> aif >>> audio/x-aiff >>> >>> >>> aifc >>> audio/x-aiff >>> >>> >>> aiff >>> audio/x-aiff >>> >>> >>> aim >>> application/x-aim >>> >>> >>> art >>> image/x-jg >>> >>> >>> asf >>> video/x-ms-asf >>> >>> >>> asx >>> video/x-ms-asf >>> >>> >>> au >>> audio/basic >>> >>> >>> avi >>> video/x-msvideo >>> >>> >>> avx >>> video/x-rad-screenplay >>> >>> >>> bcpio >>> application/x-bcpio >>> >>> >>> bin >>> application/octet-stream >>> >>> >>> bmp >>> image/bmp >>> >>> >>> body >>> text/html >>> >>> >>> cdf >>> application/x-cdf >>> >>> >>> cer >>> application/x-x509-ca-cert >>> >>> >>> class >>> application/java >>> >>> >>> cpio >>> application/x-cpio >>> >>> >>> csh >>> application/x-csh >>> >>> >>> css >>> text/css >>> >>> >>> dib >>> image/bmp >>> >>> >>> doc >>> application/msword >>> >>> >>> dtd >>> text/plain >>> >>> >>> dv >>> video/x-dv >>> >>> >>> dvi >>> application/x-dvi >>> >>> >>> eps >>> application/postscript >>> >>> >>> etx >>> text/x-setext >>> >>> >>> exe >>> application/octet-stream >>> >>> >>> gif >>> image/gif >>> >>> >>> gtar >>> application/x-gtar >>> >>> >>> gz >>> application/x-gzip >>> >>> >>> hdf >>> application/x-hdf >>> >>> >>> hqx >>> application/mac-binhex40 >>> >>> >>> htc >>> text/x-component >>> >>> >>> htm >>> text/html >>> >>> >>> html >>> text/html >>> >>> >>> hqx >>> application/mac-binhex40 >>> >>> >>> ief >>> image/ief >>> >>> >>> jad >>> text/vnd.sun.j2me.app-descriptor >>> >>> >>> jar >>> application/java-archive >>> >>> >>> java >>> text/plain >>> >>> >>> jnlp >>> application/x-java-jnlp-file >>> >>> >>> jpe >>> image/jpeg >>> >>> >>> jpeg >>> image/jpeg >>> >>> >>> jpg >>> image/jpeg >>> >>> >>> js >>> text/javascript >>> >>> >>> jsf >>> text/plain >>> >>> >>> jspf >>> text/plain >>> >>> >>> kar >>> audio/x-midi >>> >>> >>> latex >>> application/x-latex >>> >>> >>> m3u >>> audio/x-mpegurl >>> >>> >>> mac >>> image/x-macpaint >>> >>> >>> man >>> application/x-troff-man >>> >>> >>> me >>> application/x-troff-me >>> >>> >>> mid >>> audio/x-midi >>> >>> >>> midi >>> audio/x-midi >>> >>> >>> mif >>> application/x-mif >>> >>> >>> mov >>> video/quicktime >>> >>> >>> movie >>> video/x-sgi-movie >>> >>> >>> mp1 >>> audio/x-mpeg >>> >>> >>> mp2 >>> audio/x-mpeg >>> >>> >>> mp3 >>> audio/x-mpeg >>> >>> >>> mpa >>> audio/x-mpeg >>> >>> >>> mpe >>> video/mpeg >>> >>> >>> mpeg >>> video/mpeg >>> >>> >>> mpega >>> audio/x-mpeg >>> >>> >>> mpg >>> video/mpeg >>> >>> >>> mpv2 >>> video/mpeg2 >>> >>> >>> ms >>> application/x-wais-source >>> >>> >>> nc >>> application/x-netcdf >>> >>> >>> oda >>> application/oda >>> >>> >>> pbm >>> image/x-portable-bitmap >>> >>> >>> pct >>> image/pict >>> >>> >>> pdf >>> application/pdf >>> >>> >>> pgm >>> image/x-portable-graymap >>> >>> >>> pic >>> image/pict >>> >>> >>> pict >>> image/pict >>> >>> >>> pls >>> audio/x-scpls >>> >>> >>> png >>> image/png >>> >>> >>> pnm >>> image/x-portable-anymap >>> >>> >>> pnt >>> image/x-macpaint >>> >>> >>> ppm >>> image/x-portable-pixmap >>> >>> >>> ps >>> application/postscript >>> >>> >>> psd >>> image/x-photoshop >>> >>> >>> qt >>> video/quicktime >>> >>> >>> qti >>> image/x-quicktime >>> >>> >>> qtif >>> image/x-quicktime >>> >>> >>> ras >>> image/x-cmu-raster >>> >>> >>> rgb >>> image/x-rgb >>> >>> >>> rm >>> application/vnd.rn-realmedia >>> >>> >>> roff >>> application/x-troff >>> >>> >>> rtf >>> application/rtf >>> >>> >>> rtx >>> text/richtext >>> >>> >>> sh >>> application/x-sh >>> >>> >>> shar >>> application/x-shar >>> >>> >>> smf >>> audio/x-midi >>> >>> >>> sit >>> application/x-stuffit >>> >>> >>> snd >>> audio/basic >>> >>> >>> src >>> application/x-wais-source >>> >>> >>> sv4cpio >>> application/x-sv4cpio >>> >>> >>> sv4crc >>> application/x-sv4crc >>> >>> >>> swf >>> application/x-shockwave-flash >>> >>> >>> t >>> application/x-troff >>> >>> >>> tar >>> application/x-tar >>> >>> >>> tcl >>> application/x-tcl >>> >>> >>> tex >>> application/x-tex >>> >>> >>> texi >>> application/x-texinfo >>> >>> >>> texinfo >>> application/x-texinfo >>> >>> >>> tif >>> image/tiff >>> >>> >>> tiff >>> image/tiff >>> >>> >>> tr >>> application/x-troff >>> >>> >>> tsv >>> text/tab-separated-values >>> >>> >>> txt >>> text/plain >>> >>> >>> ulw >>> audio/basic >>> >>> >>> ustar >>> application/x-ustar >>> >>> >>> xbm >>> image/x-xbitmap >>> >>> >>> xml >>> text/xml >>> >>> >>> xpm >>> image/x-xpixmap >>> >>> >>> xsl >>> text/xml >>> >>> >>> xwd >>> image/x-xwindowdump >>> >>> >>> wav >>> audio/x-wav >>> >>> >>> svg >>> image/svg+xml >>> >>> >>> svgz >>> image/svg+xml >>> >>> >>> >>> wbmp >>> image/vnd.wap.wbmp >>> >>> >>> >>> wml >>> text/vnd.wap.wml >>> >>> >>> >>> wmlc >>> application/vnd.wap.wmlc >>> >>> >>> >>> wmls >>> text/vnd.wap.wmlscript >>> >>> >>> >>> wmlscriptc >>> application/vnd.wap.wmlscriptc >>> >>> >>> wrl >>> x-world/x-vrml >>> >>> >>> Z >>> application/x-compress >>> >>> >>> z >>> application/x-compress >>> >>> >>> zip >>> application/zip >>> >>> >>> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >>> index.html >>> index.htm >>> index.jsp >>> >>> >>> >>> >>> >>> >>******************************************************************************* >> >> >* > > >>>*************************** >>> >>>server.xml (conf) ----> >>> >>> >>> >>> >> >>> >>className="org.apache.catalina.mbeans.ServerLifecycleListener"/> >> >> >>> >>className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/> >>> >>> >> >>> >>value="30"/> >> >> >>> >> >>> >>type="org.apache.catalina.UserDatabase"/> >> >> >>> >>> >>> factory >>> >>> >>> >>org.apache.catalina.users.MemoryUserDatabaseFactory >> >> >>> >>> >>> pathname >>> conf/tomcat-users.xml >>> >>> >>> >>> >>> >>disableUploadTimeout="true" port="80" redirectPort="8443"> >>> >>> >>protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler" >>>redirectPort="8443"> >>> >>> >>> >>> >>className="org.apache.catalina.core.StandardDefaultContext" >>> >>> >>reloadable="true"> >> >> >>> >>> >>prefix="localhost_log." suffix=".txt" timestamp="true"/> >>> >>> >>prefix="catalina_log." suffix=".txt" timestamp="true"/> >>> >>> >>> >>> >>> >>> >>> >>******************************************************************************* >> >> >* > > >>>********************************* >>> >>>web.xml (WEB_INF) ---> >>> >>> >>> >>>>> PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" >>> "http://java.sun.com/dtd/web-app_2_3.dtd"> >>> >>> >>> >>> Agendita >>> >>> >>> Es un ejemplo que muestra el funcionamiento de los Java Servlets >>> >>> >>con >> >> >>>MySQL >>> >>> >>> invoker >>> /servlet/* >>> >>> >>> >>> >>> >>******************************************************************************* >> >> >* > > >>>*********************************** >>> >>>[root@localhost root]# echo $CLASSPATH >>>/opt/SUNWappserver/jdk/lib:/usr/local/jakarta-tomcat- >>>5.0.25/common/lib:/usr/local/mysql-connector-java-3.0.14- >>>production:/usr/local/jakarta-tomcat-5.0.25/common/lib/servlet- >>>api.jar:/usr/local/jakarta-tomcat-5.0.25/common/lib/mysql-connector-java- >>> >>> >3.0.14- > > >>>production-bin.jar:/opt/SUNWappserver/jdk/lib:/usr/local/jakarta-tomcat- >>>5.0.25/common/lib:/usr/local/mysql-connector-java-3.0.14- >>>production:/usr/local/jakarta-tomcat-5.0.25/common/lib/servlet- >>>api.jar:/usr/local/jakarta-tomcat-5.0.25/common/lib/mysql-connector-java- >>> >>> >3.0.14- > > >>>production-bin.jar:/opt/SUNWappserver/jdk/lib:/usr/local/jakarta-tomcat- >>>5.0.25/common/lib:/usr/local/mysql-connector-java-3.0.14- >>>production:/usr/local/jakarta-tomcat-5.0.25/common/lib/servlet- >>>api.jar:/usr/local/jakarta-tomcat-5.0.25/common/lib/mysql-connector-java- >>> >>> >3.0.14- > > >>>production-bin.jar: >>> >>> >>> >>> >>******************************************************************************* >> >> >* > > >>>*********************************** >>> >>>[root@localhost root]# netstat -tlnp >>>Active Internet connections (only servers) >>>Proto Recv-Q Send-Q Local Address Foreign Address >>> >>> >>State >> >> >>>PID/Program name >>>tcp 0 0 0.0.0.0:32768 0.0.0.0:* >>> >>> >>LISTEN >> >> >>>3529/rpc.statd >>>tcp 0 0 127.0.0.1:32769 0.0.0.0:* >>> >>> >>LISTEN >> >> >>>3691/xinetd >>>tcp 0 0 127.0.0.1:8005 0.0.0.0:* >>> >>> >>LISTEN >> >> >>>4385/java >>>tcp 0 0 0.0.0.0:8009 0.0.0.0:* >>> >>> >>LISTEN >> >> >>>4385/java >>>tcp 0 0 0.0.0.0:3306 0.0.0.0:* >>> >>> >>LISTEN >> >> >>>3807/mysqld >>>tcp 0 0 0.0.0.0:111 0.0.0.0:* >>> >>> >>LISTEN >> >> >>>3510/portmap >>>tcp 0 0 0.0.0.0:80 0.0.0.0:* >>> >>> >>LISTEN >> >> >>>4385/java >>>tcp 0 0 0.0.0.0:6000 0.0.0.0:* >>> >>> >>LISTEN >> >> >>>3922/X >>>tcp 0 0 0.0.0.0:22 0.0.0.0:* >>> >>> >>LISTEN >> >> >>>3677/sshd >>>tcp 0 0 127.0.0.1:631 0.0.0.0:* >>> >>> >>LISTEN >> >> >>>3635/cupsd >>>tcp 0 0 127.0.0.1:25 0.0.0.0:* >>> >>> >>LISTEN >> >> >>>3717/sendmail: acce >>> >>> >>>Thanks in advance. >>> >>>--------------------------------------------------------------------- >>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org >>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org >>> >>> >>> >>> >>> >>--------------------------------------------------------------------- >>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org >>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org >> >> >> >> > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org >For additional commands, e-mail: tomcat-user-help@jakarta.apache.org > > > --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org