exception null on error page for missing taglib def
I got an error page defined in my web.xml as follows error-page exception-typejava.lang.Exception/exception-type location/Error.jsp/location /error-page I had removed a taglib definition from my web.xml file and had a page that still was using the tag. with out the error-page def I get the standard error 500 page with the following exception org.apache.jasper.JasperException: File /tags/struts-logic not found at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler. java:105) but with my error page I get a null for the exception. other errors show up ok on my error page. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: exception null on error page for missing taglib def
in looking at the attributes being passed to the error page when error is not null the following attributes are set javax.servlet.jsp.jspException javax.servlet.error.exception but for the taglib error only the following is set javax.servlet.error.exception also looking at the Java code for the error page It has the following Throwable exception = (Throwable) request.getAttribute(javax.servlet.jsp.jspException); -Original Message- From: Tim Cronin [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 10, 2003 10:35 AM To: '[EMAIL PROTECTED]' Subject: exception null on error page for missing taglib def I got an error page defined in my web.xml as follows error-page exception-typejava.lang.Exception/exception-type location/Error.jsp/location /error-page I had removed a taglib definition from my web.xml file and had a page that still was using the tag. with out the error-page def I get the standard error 500 page with the following exception org.apache.jasper.JasperException: File /tags/struts-logic not found at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler. java:105) but with my error page I get a null for the exception. other errors show up ok on my error page. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: choosing where to deploy class files
In other words, this package has internal references to Catalina classes? Yuck ... no. It has nothing to do /w Catalina. The Realm I developed is the only thing that directly references Catalina classes. The package the Realm uses to access the Database is a totally self contained encapsulation of our data model and It is used by other applications. It handles all Database access. It is our internal standard. I have servelets that have access this package as well. It would be similar if I was using the ORO regexp package in the Realm and in a Servlet. So I would have to place the oro jar file in common\lib and server\lib? xerces is in the common\lib but I would assume is used internally by tomcat. -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 09, 2002 11:48 AM To: Tomcat Users List Cc: '[EMAIL PROTECTED]' Subject: RE: choosing where to deploy class files On Thu, 9 May 2002, Tim Cronin wrote: Date: Thu, 9 May 2002 11:27:26 -0500 From: Tim Cronin [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Cc: '[EMAIL PROTECTED]' [EMAIL PROTECTED] Subject: RE: choosing where to deploy class files Thanks. I was afraid of that. * Anything that needs to be both places is a sign that you should refactor your classes into smaller pieces -- in particular, to make the ones that need to be visible to your webapp not depend on Catalina internals. My web apps don't need to see Catalina internals but I access the DB in Both places and we have a Package that handles all DB access and resource allocation. This package is out of my control so I am un able to Refactor it. In other words, this package has internal references to Catalina classes? Yuck ... There is any work around? Well, you could try putting it in server/lib (for Catalina) *and* in WEB-INF/lib (for each webapp) to avoid class loading conflicts ... Craig -- 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: choosing where to deploy class files
thanks for your many helpful responses. I got it to work by having my common code in common\classes and my Realm class in server\classes. Then I had to place all the third party libs in the common\lib. (unfortunately our dev env is w2k, no simlinks...) I now see that classes loaded in the child can see their parent but not visa versa (that whole inheritance thing... :-{} ) I kinda liked tc3.1 where I could be lazy and just use my classpath... It makes my dev env more complicated... -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 09, 2002 1:28 PM To: Tomcat Users List Subject: RE: choosing where to deploy class files On Thu, 9 May 2002, Tim Cronin wrote: Date: Thu, 9 May 2002 12:43:55 -0500 From: Tim Cronin [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Subject: RE: choosing where to deploy class files In other words, this package has internal references to Catalina classes? Yuck ... no. It has nothing to do /w Catalina. The Realm I developed is the only thing that directly references Catalina classes. The package the Realm uses to access the Database is a totally self contained encapsulation of our data model and It is used by other applications. It handles all Database access. It is our internal standard. I have servelets that have access this package as well. OK, so why can't you put the database package in common/lib and your Realm implementation in server/lib? The common/lib stuff is visible to Catalina internal classes, because it's class loade is the parent of the server/lib class loader. It would be similar if I was using the ORO regexp package in the Realm and in a Servlet. So I would have to place the oro jar file in common\lib and server\lib? xerces is in the common\lib but I would assume is used internally by tomcat. See the diagram in the class-loader-howto document I pointed at earlier in this thread. You'll see that putting the ORO classes in common/lib would make them available to both Catalina classes and your webapp's classes. Craig -- 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: new thread for Jeffrey Caswell
I sent this to you earlier it's everything on how to setup (the step 2 thread) http://www.acg-gmbh.de/mod_jk/ Using ApacheConfig modJk=PATH_TO_MOD_JK.SO_OR_DLL / I was getting that set the modJk attrib in the listener to the location of the mod_jk.dll Listener className=org.apache.ajp.tomcat4.config.ApacheConfig modJk=D:/apache/modules/mod_jk.dll append=false/ -Original Message- From: Caswell, Jeffrey non Unisys [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 09, 2002 2:02 PM To: '[EMAIL PROTECTED]' Subject: RE: new thread for Jeffrey Caswell I am re-sending this because I haven't received anything back... I am still having problems. Can someone please answer these questions? (using Windows NT 4.0 sp6a, Apache 2.0.35, Tomcat 4.0.3) 1) Gianluca said to put mod_jk.dll under libexec/ folder but the error logs said it should be under modules/. I moved it there, but it still isn't working. I get this message: mod_jk location: modules\mod_jk.dll Make sure it is installed corectly or set the config location Using ApacheConfig modJk=PATH_TO_MOD_JK.SO_OR_DLL / What does this mean? Where exactly am I supposed to put that tag? Can you give me an example? 2) Gianluca said to put the workers.properties file under the conf/ folder but the error logs said it should be under conf/jk/. Did I do something wrong? 3) Do I need to keep the stand-alone configuration in server.xml or do I only need the Service name=Tomcat-Apache one? 4) The Tomcat/Catalina documentation says to use mod_webapp in some places and mod_jk in other. Which one am I supposed to use? For example, do I: LoadModule jk_module modules/mod_jk.dllor, do I: LoadModule webapp_module modules/mod_webapp.so AddModule mod_webapp.c IfModule mod_webapp.c WebAppConnection warpConnection warp localhost:8008 WebAppDeploy examples warpConnection /examples/ /IfModule And, if it is the first one that I am supposed to use, are there supposed to be more lines after it, like in the second one? What should they be? 5) I substituted my IP address for every localhost I found, in all the configuration files. Is that right, or should I leave them as localhost? 6) Apache will no longer start up, now that I've changed the configuration files. Tomcat starts up but gives the message above about mod_jk. Can someone PLEASE look at these files and tell me what I am doing wrong? I know I am asking a lot here. We can take them one at a time. Thanks. -Original Message- From: Jamshed Qureshi [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 09, 2002 10:20 AM To: 'Tomcat Users List' Subject: RE: new thread for Jeffrey Caswell Thanks Gianluca, i haven't test any jsp's yet but both service are now running fine.. Millions plus thanks.. Jamshed -Original Message- From: Gianluca Gravina [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 09, 2002 4:34 PM To: 'Tomcat Users List' Subject: R: new thread for Jeffrey Caswell Let's start ... 1 :: Check that U have {apache2Path}/libexec/mod_jk.dll If not, download a precompiled version, it works for me ... 2 :: Check for these lines in your server.xml for Tomcat (I found them after installation, I didn't need to modify anything in server.xml) * SERVER:XML * ... ... Service name=Tomcat-Apache Connector className=org.apache.catalina.connector.warp.WarpConnector port=8008 minProcessors=5 maxProcessors=75 enableLookups=true appBase=webapps acceptCount=10 debug=0/ !-- Replace localhost with what your Apache ServerName is set to -- Engine className=org.apache.catalina.connector.warp.WarpEngine name=Apache debug=0 !-- Global logger unless overridden at lower levels -- Logger className=org.apache.catalina.logger.FileLogger prefix=apache_log. suffix=.txt timestamp=true/ !-- Because this Realm is here, an instance will be shared globally -- Realm className=org.apache.catalina.realm.MemoryRealm / /Engine /Service ... ... 3 :: Now U have to modify some lines in httpd.conf: ** HTTPD.CONF ** ... ... {at the end of the file: ) LoadModule jk_module libexec/mod_jk.dll Include {tomcat folder}/conf/auto/mod_jk.conf JkWorkersFile {tomcat folder}/conf/workers.properties // U'll write down this file later JkLogFile {apache2 folder}/logs/mod_jk.log JkLogLevelinfo JkLogStampFormat [%a %b %d %H:%M:%S %Y] * 4 :: Now open your editor and create a file like this in {tomcat folder}/conf/workers.properties: ** {tomcat folder}/conf/workers.properties ** worker.list=ajp13 worker.ajp13.port=8009 worker.ajp13.host=localhost worker.ajp13.type=ajp13 ** ! It's enough, next time U start apache, then Tomcat, U have to find something like this in your httpd.conf: VirtualHost * ServerName grava.d2g.com
RE: new thread for Jeffrey Caswell
looking at your files your trying to use both connectors the mod_jk is well documented in the link I sent earlier. I used it to setup and I've had no problems -Original Message- From: Caswell, Jeffrey non Unisys [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 09, 2002 1:24 PM To: 'Tomcat Users List' Subject: RE: new thread for Jeffrey Caswell I am still having problems. Can someone please answer these questions? (using Windows NT 4.0 sp6a, Apache 2.0.35, Tomcat 4.0.3) 1) Gianluca said to put mod_jk.dll under libexec/ folder but the error logs said it should be under modules/. I moved it there, but it still isn't working. I get this message: mod_jk location: modules\mod_jk.dll Make sure it is installed corectly or set the config location Using ApacheConfig modJk=PATH_TO_MOD_JK.SO_OR_DLL / What does this mean? Where exactly am I supposed to put that tag? Can you give me an example? See if the conf\auto\mod_jk.conf is being generated. make sure to include that file in the bottom 2) Gianluca said to put the workers.properties file under the conf/ folder but the error logs said it should be under conf/jk/. Did I do something wrong? 3) Do I need to keep the stand-alone configuration in server.xml or do I only need the Service name=Tomcat-Apache one? 4) The Tomcat/Catalina documentation says to use mod_webapp in some places and mod_jk in other. Which one am I supposed to use? For example, do I: LoadModule jk_module modules/mod_jk.dllor, do I: LoadModule webapp_module modules/mod_webapp.so AddModule mod_webapp.c IfModule mod_webapp.c WebAppConnection warpConnection warp localhost:8008 WebAppDeploy examples warpConnection /examples/ /IfModule And, if it is the first one that I am supposed to use, are there supposed to be more lines after it, like in the second one? What should they be? 5) I substituted my IP address for every localhost I found, in all the configuration files. Is that right, or should I leave them as localhost? 6) Apache will no longer start up, now that I've changed the configuration files. Tomcat starts up but gives the message above about mod_jk. Can someone PLEASE look at these files and tell me what I am doing wrong? I know I am asking a lot here. We can take them one at a time. Thanks. -Original Message- From: Jamshed Qureshi [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 09, 2002 10:20 AM To: 'Tomcat Users List' Subject: RE: new thread for Jeffrey Caswell Thanks Gianluca, i haven't test any jsp's yet but both service are now running fine.. Millions plus thanks.. Jamshed -Original Message- From: Gianluca Gravina [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 09, 2002 4:34 PM To: 'Tomcat Users List' Subject: R: new thread for Jeffrey Caswell Let's start ... 1 :: Check that U have {apache2Path}/libexec/mod_jk.dll If not, download a precompiled version, it works for me ... 2 :: Check for these lines in your server.xml for Tomcat (I found them after installation, I didn't need to modify anything in server.xml) * SERVER:XML * ... ... Service name=Tomcat-Apache Connector className=org.apache.catalina.connector.warp.WarpConnector port=8008 minProcessors=5 maxProcessors=75 enableLookups=true appBase=webapps acceptCount=10 debug=0/ !-- Replace localhost with what your Apache ServerName is set to -- Engine className=org.apache.catalina.connector.warp.WarpEngine name=Apache debug=0 !-- Global logger unless overridden at lower levels -- Logger className=org.apache.catalina.logger.FileLogger prefix=apache_log. suffix=.txt timestamp=true/ !-- Because this Realm is here, an instance will be shared globally -- Realm className=org.apache.catalina.realm.MemoryRealm / /Engine /Service ... ... 3 :: Now U have to modify some lines in httpd.conf: ** HTTPD.CONF ** ... ... {at the end of the file: ) LoadModule jk_module libexec/mod_jk.dll Include {tomcat folder}/conf/auto/mod_jk.conf JkWorkersFile {tomcat folder}/conf/workers.properties // U'll write down this file later JkLogFile {apache2 folder}/logs/mod_jk.log JkLogLevelinfo JkLogStampFormat [%a %b %d %H:%M:%S %Y] * 4 :: Now open your editor and create a file like this in {tomcat folder}/conf/workers.properties: ** {tomcat folder}/conf/workers.properties ** worker.list=ajp13 worker.ajp13.port=8009 worker.ajp13.host=localhost worker.ajp13.type=ajp13 ** ! It's enough, next time U start apache, then Tomcat, U have to find something like this in your httpd.conf: VirtualHost * ServerName grava.d2g.com JkMount /manager ajp13 JkMount /manager/* ajp13 JkMount /examples ajp13 JkMount /examples/* ajp13 JkMount /tomcat-docs ajp13 JkMount /tomcat-docs/* ajp13 JkMount
RE: someone plz help
here's what I use. public static void upload ( HttpServletRequest request, String uploadFolder ) throws IOException { String cType = request.getContentType(); if (cType != null cType.toLowerCase().startsWith(multipart/form-data)) { MultipartRequest multi = new MultipartRequest(request, uploadFolder); Enumeration files = multi.getFileNames(); if(!files.hasMoreElements()) { throw new IOException(No files upload); } } else { throw new IOException(Invalid Content type: + cType); } } -Original Message- From: # Lalit Nagpal # [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 07, 2002 12:03 AM To: [EMAIL PROTECTED] Subject: someone plz help i have set multipart/form-data tag in my html form. i need to get a form filled in by the visitors and also an attachment on the same form (file upload). i am using oreilly classes. problem is when i try to get data + file on the server using MultipartRequest class of oreilly i get the error content type is not multipart. I am using MultipartRequest class getParameter function to get the data, and the file upload works as usual. Any Ideas why this error is occuring. Plz help. Thanx in advance. = # Lalit Nagpal # __ Do You Yahoo!? Yahoo! Health - your guide to health and wellness http://health.yahoo.com -- 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: Frameset problem
I have the same problem. I found this link, is this the error your getting? http://www.tek-tips.com/gfaqs.cfm/lev2/3/lev3/22/spid/65/sfid/1552 I moved to mod_jk and all works ok. -Original Message- From: Vincent Lambert [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 07, 2002 7:11 AM To: 'Tomcat Users List' Subject: Frameset problem Hi, I am using TC 4.0.3 with JDK 1.4 connected to apache with webapp connector. Every thing works find except when i call two or more JSP within a frameset ! Did someone experience the same problem and how can I fixe it. Thanks in advance, Regards, Vince PS : My files... httpd.conf : VirtualHost 192.10.200.65 ServerName www.test6.vla DocumentRoot C:\dev\projets\FrameSet WebAppConnection warpTest6 warp localhost:8008 WebAppDeploy test5 warpTest6 /webapp /VirtualHost server.xml: Host name =www.test6.vla Context path=/webapp docBase=C:\dev\projets\FrameSet\webapp / Logger className=org.apache.catalina.logger.FileLogger prefix=test6. siffix=.out timestamp=true/ /Host index.html: frameset rows=20%,* frame name=menu src=/page_0.html/ frameset cols=50%,50% frame name=menu src=/webapp/jsp/jsp_1.jsp/ frame name=menu src=/webapp/jsp/jsp_2.jsp/ /frameset /frameset -- 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: someone plz help
I set all my browsers to not cache pages when developing. It has bitten me many times... -Original Message- From: # Lalit Nagpal # [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 07, 2002 8:59 AM To: Tomcat Users List Subject: RE: someone plz help my problem is solved thanx tim anyway. actually i just renamed my java file and recompiled it and it worked. Wonder what is with IE ... was it using cache data. Netscape was very descent and every changes i made where detected by it in every request that i made. wonder what the problem is with IE. = # Lalit Nagpal # __ Do You Yahoo!? Yahoo! Health - your guide to health and wellness http://health.yahoo.com -- 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]
Appending to TOMCAT's class path
the startup scripts (under 4.X) for tomcat do not use the System classpath setting by default. In a production environment I'm fine with putting my jars in the common\lib directory but in development I want to be able to add my source tree to the classpath tomcat uses. once I do this by changing the setclasspath script It stops finding internal files. one example is creating a custom realm. I fails to find the BaseRealm file that is in the server\lib\catalina.jar once I add that to the script it fails to find other files in additional jars. Does anyone have a solution other than having to make a new jar file every time I recompile? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Apache 2.0 Tomcat 4.0 integration on Win 2000: Please help me
http://www.acg-gmbh.de/mod_jk/ -Original Message- From: Ryan Gomes [mailto:[EMAIL PROTECTED]] Sent: Saturday, May 04, 2002 10:51 PM To: [EMAIL PROTECTED] Subject: Apache 2.0 Tomcat 4.0 integration on Win 2000: Please help me Hi! I need to integrate Apache 2 and Tomcat 4 on Windows 2000. I run into a whole lot of problems. The main problem is that Apache cannot load the mod_jk.dll module. I referred to a website and got another version of a re-compiled mod_jk.dll, but did no good. Has anyone integrated Apache 2 and Tomcat 4 on Windows 2000? Otherwise, any help would be greatly appreciated. I have been working on this for days and have reached nowhere... Do drop me a line Thanks! Ryan. _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Tomcat Apache 2 howto
http://www.acg-gmbh.de/mod_jk/ -Original Message- From: Chris Shen HOTMAIL [mailto:[EMAIL PROTECTED]] Sent: Friday, May 03, 2002 2:37 AM To: [EMAIL PROTECTED] Subject: Tomcat Apache 2 howto I've been able to successfully integrate tomcat 3 and 4 with Apache 1.3 using mod_jk. However, I have not been able to get either one of them to work with the latest Apache 2. I am just wondering if someone can perhaps provide some pointers to my problem. I am running on win NT/2k. Thanks! Chris -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Anti-Alias Font Images on the Fly?
I think image magick does this and they have a Java libe http://www.imagemagick.org/ -Original Message- From: Marc Elliott [mailto:[EMAIL PROTECTED]] Sent: Friday, May 03, 2002 11:36 AM To: Tomcat Users List Subject: Anti-Alias Font Images on the Fly? Hello folks, Do any of you know of a JSP/javabean/apache solution to generating nice anti-alias type image on the fly. I'm just sick to death of continually cutting and re-cutting images because 1 -- a designer won't work with HTML type faces and 2 -- the the textual content keeps changing I also have an application for building web sites in which I'd like to offer the option of changing the pretty graphic type to the user. Any thoughts? Thanks! Marc -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: ApacheConfig for Windows2000
this is for tomcat 4.0.x http://www.acg-gmbh.de/mod_jk/ you may want to upgrade tomcat -Original Message- From: Helferty, Richard (FUSA) [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 02, 2002 3:27 PM To: '[EMAIL PROTECTED]' Subject: ApacheConfig for Windows2000 Hello, I need help configuring Apache and Tomcat. Here are my versions. j2sdk1.4.0 tomcat-3.3a Apache 2.0.35 on Windows2000 Professional Basically I have tomcat and Apache both installed and running but can't run both. I got a little lost following Tomcat-Apache HOWTO instructions on jakarta.apache.org but basically I followed the instructions http://jakarta.apache.org/tomcat/tomcat-3.2-doc/tomcat-apache-howto.html#run ning_examples 1. Modify Apache's httpd.conf file. 2. Install a web server adapter. 3. Modify Tomcat's server.xml file. When I insert Include c:/jakarta-tomcat-3.3a/conf/auto/mod_jk.conf in the Apache httpd.conf file and attempt to start the web service, it fails. Any help would be greatly appreciated. Thanks ** This transmission may contain information that is privileged, confidential and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format. Thank you ** -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Getting to work Apache and Tomcat on Win2000
here is a good link Apache 2.0.x running with Tomcat 4.0.3 via mod_jk on w2k http://www.acg-gmbh.de/mod_jk/ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 01, 2002 8:55 AM To: [EMAIL PROTECTED] Subject: RE: Getting to work Apache and Tomcat on Win2000 Is there a definitive guide to installing mod_jk on Windows? I'm kind of confused, because the documentation speaks about the Coyote JK 2 Connector, and if I look at the distribution at http://jakarta.apache.org/builds/jakarta-tomcat-connectors/coyote/release/v1 .0-b8/ I only see JARs, no Apache modules. Searching for mod_jk in the Apache modules doesn't bring any results. Searching for mod_jk with Google brings me to http://jakarta.apache.org/tomcat/tomcat-3.3-doc/mod_jk-howto.html (is this still valid?) and from there to http://jakarta.apache.org/builds/jakarta-tomcat/release/v3.3/bin/win32/i386/ mod_jk.zip However, I can't bring all the pieces of this puzzle together... Regards, Eric -Original Message- From: Jacob Kjome [mailto:[EMAIL PROTECTED]] Sent: Mittwoch, 1. Mai 2002 15:23 To: Tomcat Users List Subject: Re: Getting to work Apache and Tomcat on Win2000 Yes, everyone has experience problems with mod_webapp on windows. My suggestion is don't use it at all. Use mod_jk until mod_webapp becomes more stable. Jake At 02:28 PM 5/1/2002 +0200, you wrote: Hi Having installed Tomcat 4.0.4-b2 successfully on my Windows 2000 together with the Java Standard Tag Library and the Jakarta String Tag Library, I went on to install Apache 1.3.24 as well. Here the troubles started... I installed the webapp_module according to the instructions and added a connection to Tomcat with the following lines in Apache's httpd.conf: # The connection to Tomcat WebAppConnection tomcat warp localhost:8008 # The examples for JSP WebAppDeploy examples tomcat /examples # The examples for JSTL WebAppDeploy standard-doc.war tomcat /standard-doc WebAppDeploy standard-examples.war tomcat /standard-examples # The examples for the String Tag Library WebAppDeploy string-doc.war tomcat /string-doc WebAppDeploy string-examples.war tomcat /string-examples While everything works as long as I connect to Tomcat directly with http://localhost:8080/ (e.g. using http://localhost:8080/standard-doc/), as soon as I used Apache, the whole system becomes very unstable. I might get away with using one or two .war files, but then Apache crashes. Has anyone experienced the same problems? Thank best regards, Eric swissinfo/Swiss Radio International Eric Lewis IT Engineering Giacomettistrasse 1 CH-3000 Berne 15 Phone: ++41 31 350 95 42 Fax:++41 31 350 99 40 mailto:[EMAIL PROTECTED] Switzerland is everywhere. Stay connected! http://www.swissinfo.org http://mobile.swissinfo.org http:/wap.swissinfo.org SRG SSR idée suisse -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Compiling mod_jk on Win2K, anyone?
this is for mod_jk but it might help... http://www.acg-gmbh.de/mod_jk/ -Original Message- From: Douglas, Rory [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 25, 2002 11:06 AM To: Tomcat Users List (E-mail) Subject: Compiling mod_jk on Win2K, anyone? Hello It seems some people are having success getting mod_jk2 compiled on Linux platforms. Is this the only way? Compiling the java side of the connector is, of course, painless and works like a charm. The native side appears to be somewhat confusing. I have downloaded Cygwin which gave me some of the missing include files, however, now the compiler wants sys/socketvar.h which doesn't exist in either VC++'s or Cygwin's include directories. Any ideas would be welcome Rory Douglas Sun Chemical Corporation (201) 224-4600 x178 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: My Tomcat server doesn't run??????
read RUNNING.txt in the root of the tomcat directory -Original Message- From: Suresh Akula [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 25, 2002 11:54 AM To: [EMAIL PROTECTED] Subject: Re: My Tomcat server doesn't run?? I am beginner on tomcat..i havent got any solution yet..i am running tomcat server on windows XP and the error is JAVA_HOME is not defined..when i set that variable to the parent directory where my java is installed(JAVA_HOME = D:\j2sdk1.4.0) still it doesn't work but the error message is JAVA_HOME is not defined correctly..help on this is highly appreciated THANKS MUCH From: Suresh Akula [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: My Tomcat server doesn't run?? Date: Thu, 25 Apr 2002 15:17:28 + Hi All I have downloaded jakarta-tomcat-3.1.1.zip and installed tomcat onto my D:drive. When i start the tomcat server by clicking on D:\jakarta-tomcat\bin\starttup.bat ..server doesn't run..wut is the problem???. I tried to download the latest version jakarta-tomcat-4.0.3 it also had the same problem. I am using tomcat to implement SOAP services using XML.Can anyone help me why the server doesn't run.My aim is if server runs ..i will configure server to use apache soap and set the server classpath to use apache xerces and soap.jar to implement soap services using xml in tomcat.. Thanks much in advance _ Join the world's largest e-mail service with MSN Hotmail. http://www.hotmail.com -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: tomcat and SSL (keyfile password)
your how-to would be very beneficial. thanks -Original Message- From: Dave North [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 25, 2002 1:25 PM To: [EMAIL PROTECTED] Subject: tomcat and SSL (keyfile password) Hello, After a few hours trying to get this working, I've finally got my tomcat server working with a certificate signed by Verisign. This all works great. However, to do this, I need to configure the keyfilePass into the server.xml file. This is bad as our security policy is thou shall not have any passwords in plain text. We also use SSL on our iPlanet server and it prompts at start time for the password (they use the term software token but it's the same). So, the question is: is it possible to have tomcat prompt for this and/or how have others got around keeping this in plain text? BTW: if anyone's interested, I have the complete step-by-step of how I got the versign cert working...the info is out there but it seems to be all over the place. Thanks Dave Dave North SIGNIANT Inc. Trusted Data Transfer Services www.signiant.com Phone: 613-761-3623 Mobile: 613-294-3231 Fax: 613-761-3629 Email: [EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: JDBCRealm Extension
I've (and others have been dealing with the same issue and have been directed to look at extending the Authentication classes. see the link below for details. http://mikal.org/interests/java/tomcat/archive/view?mesg=56125 -Original Message- From: Sarah Barwig [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 7:23 PM To: [EMAIL PROTECTED] Subject: JDBCRealm Extension Hi, I searched your archives briefly, which leads me to believe that I would be asking this question in the right place, but I haven't searched them extensively, so I might be re-asking a FAQ. If I am, then please forgive me. I'm attempting to use the Tomcat servlet engine's Realm authentication to protect a website. In addition to doing that, I would like Realm to pick up an additional piece of data from the database, and associate it with the session in tomcat's memory (somewhere?). I have found the appropriate file to extend (org.apache.catalina.realm.JDBCRealm), made the appropriate change to the sql statement, but now I'm stumped as to how to associate this piece of information with the SessionID that Tomcat sets in the cookie. Can anyone help me gain a bit more insight into this part of the black box? Thanks in advance, Sarah -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Re[2]: oci8 driver problem on Linux
For thin (type 4) Driver yes but for Type 2 (OCI) you need the binary lib. You need type 2 for ARRAYS thanks for the info though. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 24, 2002 1:35 AM To: 'Tomcat Users List' Subject: Re[2]: oci8 driver problem on Linux Tim Cronin [EMAIL PROTECTED] wrote:- All I saw on the oracle site was 8i oci driver for solaris where are the linux drivers? I think we downloaded the NT driver as NT is our main platform for development. I've got a RedHat7.2 server sat on my desk as well though and the same classes12.zip works fine on that. http://technet.oracle.com/software/tech/java/sqlj_jdbc/content.html Andrew ** This message has been sent via the Internet. Internet communications are not secure against interception or modification. Severn Trent Systems therefore can not guarantee that this message has not been modified in transit, and this message should not be viewed as contractually binding. This message and any files transmitted with it are confidential and intended solely for the use of the addressee. If you have received this message in error please notify the sender and destroy your copies of the message and any attached files. *** Severn Trent Systems Ltd : a part of Severn Trent plc. Registered in England and Wales Registration No. 2394552 -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: getRemoteUser(), getAuthType() returning empty string instead of NULL?
look in the JBOSS forums http://www.jboss.org/forums/forum.jsp?forum=50 I believe i've seen something on this... -Original Message- From: Zachary Kuhn [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 24, 2002 2:42 PM To: Tomcat Users List Subject: RE: getRemoteUser(), getAuthType() returning empty string instead of NULL? I've looked through the archives, no luck. Here is the problem. After installing the JBoss-2.4.4_Tomcat-4.0.1 package install, the tomcat server throws the following exception. When i go to http://www.cscoders.com:8080/. [INFO,EmbeddedCatalinaServiceSX] StandardHost[localhost]: MAPPING configuration error for request URI [ERROR,EmbeddedCatalinaServiceSX] HttpProcessor[8080][4] process.invoke java.lang.NullPointerException at org.apache.catalina.valves.ErrorDispatcherValve.status(ErrorDispatcherValve. java:280) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve. java:180) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 64) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170 ) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 64) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :163) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java: 1011) at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106 ) at java.lang.Thread.run(Thread.java:484) I have the following env vars set up CATALINA_HOME=/var/java/JBoss-2.4.4_Tomcat-4.0.1/catalina CLASSPATH=/usr/java/jdk1.3.1_01:/usr/java/jdk1.3.1_01/lib/tools.jar:./ JAVA_HOME=/usr/java/jdk1.3.1_01 JBOSS_DIST=/var/java/JBoss-2.4.4_Tomcat-4.0.1/jboss JDK_HOME=/usr/java/jdk1.3.1_01 in apache httpd conf i have LoadModule webapp_module modules/mod_webapp.so -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: oci8 driver problem on Linux
If you are using arrays/tables you need to use the type 2 driver. All I saw on the oracle site was 8i oci driver for solaris where are the linux drivers? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 9:41 AM To: Tomcat Users List Subject: Re: oci8 driver problem on Linux Shiva.Devaguptapu [EMAIL PROTECTED] wrote:- I downloaded the classes12.zip and libocijdbc8.so, combined as jdbc816jdk12-sol_20.zip from oracle.com and placed both of them in TOMCAT_HOME/lib. I also downloaded nls_charset12.zip and placed in the same folder. Even now the error is the same. It says no ocijdbc8 in java.library.path. The exact error is as follows: java.lang.UnsatisfiedLinkError: no ocijdbc8 in java.library.path Where did you get your classes12.zip from? We use the Type4 (i.e. doesn't need the Oracle client software) JDBC driver from Oracle's web site in both Tomcat and WebLogic and it works fine. I'm not sure but it sounds to me like you have a Type2 driver rather than a Type4. I can email you the type4 classes12.zip we use if you like? Andrew ** This message has been sent via the Internet. Internet communications are not secure against interception or modification. Severn Trent Systems therefore can not guarantee that this message has not been modified in transit, and this message should not be viewed as contractually binding. This message and any files transmitted with it are confidential and intended solely for the use of the addressee. If you have received this message in error please notify the sender and destroy your copies of the message and any attached files. *** Severn Trent Systems Ltd : a part of Severn Trent plc. Registered in England and Wales Registration No. 2394552 -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Do I have to use j_security_check to authenticate?
I've been dealing with this same problem. All though Form base authentication is session based the realm has no accessibility to the session object. There are also no events that tell when the session is first created only when objects are bound/unbound to the session. The isNew function is on New on the logon page if using FORM auth. One thing I've played with is creating my own principal that that extends org.apache.catalina.realm.GenericPrincipal the principal is available from HttpServletRequest.getUserPrincipal() but this is still not a complete solution since it is still disjointed from the session. I haven't looked at struts or turbine, I'm still trying to keep my head above water with tomcat and jboss... I'm using jsp pages so apparently turbine is out I would assume that we are not the only one's with this problem. Basically a secure app that when a user logs in needs to have some state data stored at the session. I figured that using the built-in security mechanism would be a more elegant solution but I'm finding that I have to do a lot of work arounds to get it to fit into my paradigm. if the Authenticator functionality was configurable via the web.xml or server.xml this would fix our problems. here's what I found on them but still not a clean solution having to muck with internal config files... http://mikal.org/interests/java/tomcat/archive/view?mesg=56125 if the forms Auth had one more configuration form-success-page this would also solve our problem centralizing all initialization. so much for the Rant. (I hope some of the Tomcat Developers watch this mail list...) -Original Message- From: Benjamin Drasin [mailto:[EMAIL PROTECTED]] Sent: Monday, April 22, 2002 6:16 PM To: [EMAIL PROTECTED] Subject: Re: Do I have to use j_security_check to authenticate? Thanks Rick, Some of my business code has to run before authentication takes place (the details are very specific to my application). Right now the code works like this, all in one servlet: 1)pre-authentication code 2)if ok to proceed 3) authentication code 4) post-authentication code (initialize the session) I might be able to stitch together something like this: 1) request goes for the initialize the session page, which is protected. 2) the user is not authenticated, so the go to my login form, which 3) submits to my own URL, do the pre-processing if ok to proceed forward to j_security_check 4) j_security_check authenticates, and forwards to the URL requested in step 1. 5) my page initializes the session. This strikes me as _awfully_ hacky. What I really want is to be able to explicitly authenticate the user from within my servlet code...is there really no way to do this? It seems to me like something that lots of people would want. It would allow me to keep all of my login code organized in a logical manner, rather than having to dance around the servlet container. Thanks in advance, Ben Drasin From: Rick Fincher [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: Re: Do I have to use j_security_check to authenticate? Date: Mon, 22 Apr 2002 18:36:13 -0400 Hi Ben, Someone else today had similar questions so you might want to check for the subject initializing Session state during realm login. This was in Tomcat 4.0.x which has this built in. If you use FORM level security you submit your own jsp page as the login page and another as the page to run if login fails. After login Tomcat passes control to your main page. When I converted some stuff like this I basically just stripped out the database lookup stuff and and took the login page front end (HTML stuff) and put it in a new file. That left the rest of my init stuff intact in the old login page. You can request info like the username, role etc from the request object with it's various methods. It is actually very nice because Tomcat now handles that for you and you can take most or all of the security validation stuff out of your pages. Like you say this makes your project something you can deploy with Tomcat or a full blown J2EE server without changes. One snag as the other fellow found out is that you lose a little control of what happens when a session times out. You get bounced out of the realm so you have to figure out how to deal with that. Rick Hello all- I have a servlet based application running on Tomcat 3.2. It uses a homespun security system which I would like to replace with standard J2EE security. However, when the user logs in there are a number of server-side tasks which have to be performed both before and after authentication takes place, and which logically and functionally are all part of the login process. Therefore it is a problem for me that, as best I can tell from availible documentation, all authentication is done through the magic URL /j_security_check which is opaquely handled by the application server.
RE: empty xml page using tomcat4.0
did you try HttpServletResponse.setContentType(text/xml)? -Original Message- From: Mathy V Arumugam [mailto:[EMAIL PROTECTED]] Sent: Monday, April 22, 2002 7:06 PM To: [EMAIL PROTECTED] Subject: empty xml page using tomcat4.0 Hello, I am new to this group. I have just installed tomcat 4.0. I am trying to create a xml document using servlet. I have copied all the style sheets and .xml files into the ..\webapps\ROOT dir, and servlet into ..\webapps\ROOT\WEB-INF\classes dir. I have also copied all the needed jar files into the coomon\lib dir. The servlet suppose to create a xml page. Instead it gives me a page with [document-null]. I run the same servlet using javawebserver2.0 and it runs great. What am I doing wrong? Please someone help me!!! Thanks -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Do I have to use j_security_check to authenticate?
Sorry I glazed HttpSessionListener thanks. this is all I could find on overriding the FormAuthenticator http://mikal.org/interests/java/tomcat/archive/view?mesg=56125 is there official documentation? do I have to muck with internal properties files to point to my Authenticator class? -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 10:41 AM To: Tomcat Users List Subject: RE: Do I have to use j_security_check to authenticate? On Tue, 23 Apr 2002, Tim Cronin wrote: I've been dealing with this same problem. All though Form base authentication is session based the realm has no accessibility to the session object. There are also no events that tell when the session is first created only when objects are bound/unbound to the session. That is not actually correct -- see HttpSessionListener.sessionCreated(). However, by itself it doesn't help much in the particular use case being discussed here. Yesterday I proposed a solution that used the sessionCreated() listener in combination with a filter to do what you wanted, while still remaining portable across any servlet 2.3 container. Check the archives. If you really wanted to modify Tomcat itself to support your paradigm, you'd want to subclass org.apache.catalina.authenticator.FormAuthenticator instead, and make it add the appropriate session attributes after the Realm indicates that the user has been successfully identified. Don't try to make the Realm implementation do this sort of thing -- that is not what it is designed for. Craig -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: web.xml parse error
the tag tells the order (from DTD) !ELEMENT servlet (icon?, servlet-name, display-name?, description?, (servlet-class|jsp-file), init-param*, load-on-startup?, run-as?, security-role-ref*) web-app servlet icon/icon servlet-name/servlet-name display-name/display-name description/description servlet-class/servlet-class init-param param-name/param-name param-value/param-value /init-param load-on-startup/load-on-startup . . . /servlet -Original Message- From: Animesh Chaturvedi - US [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 1:41 PM To: 'Tomcat Users List' Subject: RE: web.xml parse error Where can I find the correct order for web.xml. I am going through the DTD but it does not mention any preferred order. I tried moving my error-page directive inside web.xml, but that did not help ?? My web.xml (this is the web.xml shipped in tomcat/conf) has following entries in this order web-app servlet servlet-namedefault/servlet-name servlet-classorg.apache.catalina.servlets.DefaultServlet/servlet-class init-param param-namedebug/param-name param-value0/param-value /init-param init-param param-namelistings/param-name param-valuetrue/param-value /init-param load-on-startup1/load-on-startup /servlet : : : other similar servlet entries : : servlet-mapping servlet-namedefault/servlet-name url-pattern//url-pattern /servlet-mapping : : : other servlet mappings : session-config session-timeout30/session-timeout /session-config : mime-mapping extensionabs/extension mime-typeaudio/x-mpeg/mime-type /mime-mapping : : : other mime-mappings : : welcome-file-list welcome-fileindex.html/welcome-file welcome-fileindex.htm/welcome-file welcome-fileindex.jsp/welcome-file /welcome-file-list /web-app Where do you think I should put the error-page directive in here?? Thanks Animesh -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 11:15 AM To: Tomcat Users List Subject: Re: web.xml parse error You probably have the web.xml defined in an incorrect order. To answer your other question, you could define a 403 (forbidden) error page. Note this may only work right when using form-based authentication. With Basic authentication, you might need to override the Authenticator class that does the Basic authentication. As for 500 Internal Server error, many users have faced problems in defining an error page. But you could try doing the same thing as you have done for a 404 error-page declaration. Or you could probably define an error page directive for Servlet Exception. RS Animesh Chaturvedi - US [EMAIL PROTECTED] on 04/23/2002 01:03:57 PM Please respond to Tomcat Users List [EMAIL PROTECTED] To:'Tomcat Users List' [EMAIL PROTECTED] cc: Subject:web.xml parse error Hi I am adding the following error-page directive to web.xml. error-page error-code404/error-code location/webdev/notfound.jsp/location /error-page I always get the following error on starting tomcat Apache Tomcat/4.0.3 PARSE error at line 866 column 11 org.xml.sax.SAXParseException: The content of element type web-app must match (icon?,display-name?,description?,distributable?,context-param*,filter*,fil ter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mappin g*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,se curity-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-loca l-ref*). I tried putting the error-page directive in tomcat/conf/web.xml and then in my application context web.xml. But nothing works. One more question I don't like to see Tomcat's 500 Internal Server error page or 403 page. I want my customized page to show up. How can I do that? Thanks Animesh -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Tomcat and Apache 2
Under w2k I was unable to use mod_webapp http://www.tek-tips.com/gfaqs.cfm/lev2/3/lev3/22/spid/65/sfid/1552 -Original Message- From: Collins, Jim [mailto:[EMAIL PROTECTED]] Sent: Monday, April 22, 2002 10:13 AM To: 'Tomcat Users List' Subject: RE: Tomcat and Apache 2 Why couldn't you have posted this three weeks earlier :) -Original Message- From: Simon Stewart [mailto:[EMAIL PROTECTED]] Sent: 22 April 2002 16:03 To: Tomcat Users List Subject: Re: Tomcat and Apache 2 Something had to slip through the net, didn't it ;) Thanks for pointing that out; I've updated the HOWTO with your suggested URL. On Mon, Apr 22, 2002 at 03:44:07PM +0100, Alex Potter wrote: Simon an excellent document, however, the location of the mod_webapp connector source is given incorrectly on the web page, I guess the jakarta guys moved it? The correct location is http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4 .0.3/src/jakar ta-tomcat-connectors-4.0.2-01-src.tar.gz http://makeashorterlink.com/?G22365CB HTH Alex Cheers, Simon -- Even had to open up the case and gaze upon the hallowed peace that graced the helpdesk that day. -- Megahal (trained on asr), 1998-11-06 -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] PLEASE READ: The information contained in this email is confidential and intended for the named recipient(s) only. If you are not an intended recipient of this email you must not copy, distribute or take any further action in reliance on it and you should delete it and notify the sender immediately. Email is not a secure method of communication and Nomura International plc cannot accept responsibility for the accuracy or completeness of this message or any attachment(s). Please examine this email for virus infection, for which Nomura International plc accepts no responsibility. If verification of this email is sought then please request a hard copy. Unless otherwise stated any views or opinions presented are solely those of the author and do not represent those of Nomura International plc. This email is intended for informational purposes only and is not a solicitation or offer to buy or sell securities or related financial instruments. Nomura International plc is regulated by the Financial Services Authority and is a member of the London Stock Exchange. -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: initializing Session state during realm login
this is ok for someone going to the index page for the site but if your session times out or you point to a page other than index after the login page you are not set back to the index page but the last you were on or the page you requested. -Original Message- From: Rick Fincher [mailto:[EMAIL PROTECTED]] Sent: Monday, April 22, 2002 11:24 AM To: Tomcat Users List Subject: Re: initializing Session state during realm login Hi Tim, Your main (or index) page is your init page. After a successful login you can get the username and role from the request object with the getRemoteUser() and isUserInRole(roleNameString) methods. If you need more data than that you can try stuffing data into the session in your login form. I haven't tried that so I'm not sure if the session at the login is the same as your program's session. Rick I'm trying to use a custom Realm and FORM authentication. I need to be able to initialize session data after successful login. I found information on needing to create a Custom Authenticator. http://mikal.org/interests/java/tomcat/archive/view?mesg=56125 I'm worried about having muck with tomcat internals to do this. Is there a way to have the FORM authentication redirect to a determined start page on successful login so I can do all my initialization there? this would solve my problem. -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Tomcat and Apache 2
I had it setup (on w2k) and I could get to the index page ok but any page with frames would give me the error as described in the link WebApp: Error 500 (File: pr_warp.c Line: 434) (null) I don't have the logs (but I can regenerate them). I ended up using mod_jk instead -Original Message- From: Simon Stewart [mailto:[EMAIL PROTECTED]] Sent: Monday, April 22, 2002 11:51 AM To: Tomcat Users List Subject: Re: Tomcat and Apache 2 Can you be a little more specific? From a quick look at the page, the obvious flaw is that it mentions AddModule; with Apache 2, you only need to use LoadModule There's also the warning at the head of the page about mod_webapp under Windows being flakey. If you've got any error messages, that would be useful. I've only had experience with Tomcat and Apache under Linux, but I guess that others on this list know more about setting up under Win32 On Mon, Apr 22, 2002 at 11:19:49AM -0500, Tim Cronin wrote: Under w2k I was unable to use mod_webapp http://www.tek-tips.com/gfaqs.cfm/lev2/3/lev3/22/spid/65/sfid/1552 -Original Message- From: Collins, Jim [mailto:[EMAIL PROTECTED]] Sent: Monday, April 22, 2002 10:13 AM To: 'Tomcat Users List' Subject: RE: Tomcat and Apache 2 Why couldn't you have posted this three weeks earlier :) -Original Message- From: Simon Stewart [mailto:[EMAIL PROTECTED]] Sent: 22 April 2002 16:03 To: Tomcat Users List Subject: Re: Tomcat and Apache 2 Something had to slip through the net, didn't it ;) Thanks for pointing that out; I've updated the HOWTO with your suggested URL. On Mon, Apr 22, 2002 at 03:44:07PM +0100, Alex Potter wrote: Simon an excellent document, however, the location of the mod_webapp connector source is given incorrectly on the web page, I guess the jakarta guys moved it? The correct location is http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4 .0.3/src/jakar ta-tomcat-connectors-4.0.2-01-src.tar.gz http://makeashorterlink.com/?G22365CB Cheers, Simon -- Listen. Strange women lying in ponds distributing swords is no basis for a system of government. Supreme executive power derives from a mandate from the masses, not from some farcical aquatic ceremony. Raax on royalty -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: JDBC realm problems
have you tested accessing mysql from JDBC in isolation (write a simple test class that creates a connection and does a simple select)? there might be a problem on you permissions setup under mysql. http://www.mysql.com/documentation/mysql/bychapter/manual_MySQL_Database_Adm inistration.html#Privilege_system I had to remove the default user name= from the table to get access. -Original Message- From: Januski, Ken [mailto:[EMAIL PROTECTED]] Sent: Monday, April 22, 2002 1:11 PM To: Tomcat Users List Subject: RE: JDBC realm problems Half answering my own question I found that if I changed permissions to the relevant user I was able to get a bit further. At least the logon is now seen but it fails with this message: Invalid authorization specification: Access denied for user: 'ken;[EMAIL PROTECTED]' (Using password: NO) I have the feeling that this may also me an mySQL problem not a Tomcat one. Still if anyone has any clues to the solution I'd appreciate hearing them. Thanks, Ken -Original Message- From: Januski, Ken [mailto:[EMAIL PROTECTED]] Sent: Monday, April 22, 2002 12:58 PM To: Tomcat Users List Subject: JDBC realm problems Hi, I've spent many hours last week and a few more today trying to get JDBC security realm to work and keep stumbling on this error: java.sql.SQLException: General error: Access denied for user: 'localhost.localdomain' to database 'tomcatusers'; I'm sure many people have problems getting this to work right off and I've read a fair amount about various solutions. But what I can't figure out is why the access denied error doesn't include a user name but only localhost.localdomain. I've put user and password in server.xm; there is a tomcatusers table with what i believe are the correct entries. In fact they're copied/modified from the Goodwill book. I wouldn't be surprised by a bad username or bad password error but this indicates that the user name just isn't being passed along. Anyway I assume that I'll find the answer to the authentication problem if I can find out why the user name doesn't seem to be passed along to the database call. Does anyone have any clues? Thanks, Ken -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: JDBC realm problems
what if you remove the username and password from the URL and set them via the connectionName, connectionPassword attribs? -Original Message- From: Januski, Ken [mailto:[EMAIL PROTECTED]] Sent: Monday, April 22, 2002 1:23 PM To: Tomcat Users List Subject: RE: JDBC realm problems Yes I have. After some more investigation I think the problem is this: the entry in server.xml is like this user=ken;password=ken. But mySQL wants a and xml parser demands a ;. With a ; mySQL thinks no password was sent and so denies me with 'password: no'. With debug=99 comes into play and tells me The reference to entity 'password' must end with the ';' delimiter. But as soon as I do that then mySQL no longer sees the password!! I have read about the need to change the ; to while investigating on google so I know some people have found that necessary. My problem is that I then get the parser error. So it seems to me I'm sitting on the horns of a dilemma from which I hope someone can remove me. Thanks! -Original Message- From: Rick Fincher [mailto:[EMAIL PROTECTED]] Sent: Monday, April 22, 2002 2:14 PM To: Tomcat Users List Subject: Re: JDBC realm problems Hi Ken, Have you tried setting the debug level to 99 in the realm tag in server.xml? You may have already done this, but it will add a lot more info to the log about the process of getting into the realm. Rick Hi, I've spent many hours last week and a few more today trying to get JDBC security realm to work and keep stumbling on this error: java.sql.SQLException: General error: Access denied for user: 'localhost.localdomain' to database 'tomcatusers'; I'm sure many people have problems getting this to work right off and I've read a fair amount about various solutions. But what I can't figure out is why the access denied error doesn't include a user name but only localhost.localdomain. I've put user and password in server.xm; there is a tomcatusers table with what i believe are the correct entries. In fact they're copied/modified from the Goodwill book. I wouldn't be surprised by a bad username or bad password error but this indicates that the user name just isn't being passed along. Anyway I assume that I'll find the answer to the authentication problem if I can find out why the user name doesn't seem to be passed along to the database call. Does anyone have any clues? Thanks, Ken -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: using more memory, different classpath
1) if your using 4.x you can increase memory /w the following env var CATALINA_OPTS=-Xmsthe number of megs to start withm -Original Message- From: jason wood [mailto:[EMAIL PROTECTED]] Sent: Monday, April 22, 2002 2:15 PM To: [EMAIL PROTECTED] Subject: using more memory, different classpath (1) i received an out of memory exception and would like to know where to tell tomcat to use more memory (2) my tomcat installation directory is located on c:\ (this is where we keep development software), and d:\company_name\classes\... . How do i tell tomcat that my classes directory is located at the d:\ location thank you Jason - Do You Yahoo!? Yahoo! Games - play chess, backgammon, pool and more -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: using more memory, different classpath
(assuming 4.xx) if you follow the startup script the CLASSPATH is reset when tomcat is started, see setclasspath .sh/.bat. You can jar your files and place them CATALINA_HOME\common\lib or if your lazy like me you could modify the setclasspath. Beware if your using the j2ee lib you will create conflicts if you have the j2ee.jar in the class path. I had to have the following jars in the following order for tomcat to work... CATALINA_HOME\common\lib\servlet.jar; CATALINA_HOME\server\lib\tomcat-ajp.jar; CATALINA_HOME\server\lib\tomcat-util.jar; J2EE_HOME\lib\j2ee.jar -Original Message- From: Jacob Kjome [mailto:[EMAIL PROTECTED]] Sent: Monday, April 22, 2002 2:44 PM To: Tomcat Users List Subject: Re: using more memory, different classpath Hello jason, Monday, April 22, 2002, 2:14:39 PM, you wrote: jw (1) i received an out of memory exception and would like to know where to tell tomcat to use more memory use environment variables TOMCAT_OPTS (for Tomcat3.2.x or 3.3.x) and CATALINA_OPTS (for Tomcat 4.xx) to add options that Tomcat should use at startup. For instance CATALINA_OPTS=-server -Xms8m -Xmx128m Tells Tomcat 4.xx to start up with the server (rather than client) jvm and and to set the initial size of the Java memory allocation pool (that is, the heap) to 8 Mbytes, and then to set the maximum heap size to 128 Mbytes. See the following for reference: http://developer.java.sun.com/developer/technicalArticles/Programming/JVMPer f/ jw (2) my tomcat installation directory is located on c:\ (this is where we keep development software), and d:\company_name\classes\... . How do i tell tomcat that my classes directory is located at jw the d:\ location Not sure about this one. You mean, that you want tomcat to get its application wide classes from your classes directory rather than $TOMCAT_HOME/classes? Hmmm... not sure how to do that? Jake jw thank you jw Jason jw - jw Do You Yahoo!? jw Yahoo! Games - play chess, backgammon, pool and more -- Best regards, Jacobmailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: file upload servlet
Yes I think your right I had a parameter additional to the file and got an exception. when I put it as part of the query string the problem disappeared. -Original Message- From: Jose Euclides da Silva Junior - DIGR.O [mailto:[EMAIL PROTECTED]] Sent: Friday, December 29, 2000 7:26 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RES: file upload servlet -BEGIN PGP SIGNED MESSAGE- I think that you can not mix parameters and file when you use MultipartRequest ( from Jason') to handle multipart/form-data. Regards, José Euclides Júnior __ E-mail: [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] http://euclides.8m.com - -Mensagem original- De: Tim Cronin [SMTP:[EMAIL PROTECTED]] Enviada em: Quarta-feira, 27 de Dezembro de 2000 22:50 Para: '[EMAIL PROTECTED]' Assunto:RE: file upload servlet I'm using it on nt4 sun JDK 1.3, tomcat 3.1, apache 1.3.12 and on RH linux 6.2 sun JDK 1.3, tomcat 3.1, apache 1.3.12 I'm waiting till all the bleeding edgers debug 3.2 Initially I had some funky behavior when I ccped from the upload examples, but I rewrote it from scratch and it seems to work ok. - -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 27, 2000 6:40 PM To: [EMAIL PROTECTED] Subject: RE: file upload servlet I am very surprised. I tried the same version. Here is the code I am using. As you can see, (or somebody can see), this is from upload.war (the sample came with the multirequest class) with some modifications. If everything works ok, I should be able to see all the parameters and files listed. However, it only worked for text files. For binary files, results vary from server error to exception in the MultiPartRequest constrcutor. The only difference I could find between your code and mine is mine is in a servlet's doPost() function? Now I am really confused. Help! Is it related to tomcat somehow. I am using tomcat 3.2.1 with apache 1.3.14 on WinNT4.0. Yanbin try { MultipartRequest multi = new MultipartRequest(req, "D:/upload"); writer.println("PParams:/P"); Enumeration params = multi.getParameterNames(); while (params.hasMoreElements()) { String name = (String)params.nextElement(); String value = multi.getParameter(name); writer.println("p" + name + " = " + value + "/P"); } writer.println(); writer.println("pFiles:/p"); Enumeration files = multi.getFileNames(); while (files.hasMoreElements()) { String name = (String)files.nextElement(); String filename = multi.getFilesystemName(name); String type = multi.getContentType(name); File f = multi.getFile(name); writer.println("p" + "name: " + name + "/p"); writer.println("p" + "filename: " + filename + "/p"); writer.println("p" + "type: " + type + "/p"); if (f != null) { writer.println("p" + "f.toString(): " + f.toString() + "/p"); writer.println("p" + "f.getName(): " + f.getName() + "/p"); writer.println("p" + "f.exists(): " + f.exists() + "/p"); writer.println("p" + "f.length(): " + f.length() + "/p"); writer.println("p/p"); } } } catch (IOException lEx) { this.getServletContext().log("error reading or saving file" + lEx, lEx); } catch (Exception e) { this.getServletContext().log("caught un-known exception" + e, e); } |+ || Tim Cronin| || [EMAIL PROTECTED]| || eClub.com| ||| || 12/27/00 06:47 PM | || Please respond to | || tomcat-user | ||| |+ --- | | | | To: "'[EMAIL PROTECTED]'" | | [EMAIL PROTECTED] | | cc: (bcc: Yanbin Ma/SYS/NYTIMES) | | Subject: RE: file upload servlet | --- | I was able to upload text, image, exe files, and other binaries with
RE: want to preporcess javascript files
- I dont see why a js file won't be handled like a jsp regarding source control and revision history. this is not a problem. It is handled by source control, But I don't want to send revision history and code documentation to client machines. - It costs you in performance to use js in jsp - you make the Tomcat generate them again and again for each request. I guess that the js code is quite static and not changed between requests, so that generation is unnecessary. if I have it as the src attribute in the script tag it will only be downloaded once to each client, and if I cache the jsp page it will be resident in memory intead of reading it from disk before sending it down. - I have a js file whose code depends on some other java classes. I have made in java a sort of preprocessor that create it whenever a new version is required. The Jakarta team has done a great job at writing a preprocessor which I don't want or have the time to do. So back to my origonal question does anyone know how I could do this without telling me why I should not. -Original Message- From: Boaz Shaham [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 28, 2000 3:17 AM To: '[EMAIL PROTECTED]' Subject: RE: want to preporcess javascript files I had that problem too. Some notes: - I dont see why a js file won't be handled like a jsp regarding source control and revision history. - It costs you in performance to use js in jsp - you make the Tomcat generate them again and again for each request. I guess that the js code is quite static and not changed between requests, so that generation is unnecessary. - I have a js file whose code depends on some other java classes. I have made in java a sort of preprocessor that create it whenever a new version is required. If you still want to use it as jsp - try add to these files a header indicating the mime type for js code (dont know what it is) - Boaz -Original Message- From: Tim Cronin [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 27, 2000 23:17 To: '[EMAIL PROTECTED]' Cc: Paul Lange; Frank Livaudais; Rex Staples Subject: want to preporcess javascript files I was initially using jsp files to contain javascript. This way I could have them documented and keep revision history in them for development then have the commenst stripped out when they were deployed to clients. This works fine in IE. but causes Netscape to hang. I tryed to change them back to js and add a handler to preprocess these files as well but could not get it to work. Any solutions?
RE: Gzip
%@ page import="package.GZIPOutputStream" % %@ page import="java.io.OutputStream" % % OutputStream out1 = response.getOutputStream(); out = new PrintWriter(new GZIPOutputStream(out1), false); /*you should use the response.setContentType() */ response.setHeader("Content-Encoding", "gzip"); % -Original Message-From: Matt B [mailto:[EMAIL PROTECTED]]Sent: Thursday, December 28, 2000 12:34 PMTo: [EMAIL PROTECTED]Subject: Gzip I want to use GZip compression on JSP page. I've done this with a servlet using the following code: OutputStream out1 = response.getOutputStream(); out = new PrintWriter(new GZIPOutputStream(out1), false); response.setHeader("Content-Encoding", "gzip"); .. How would I get the equivalent using JSP? TIA Matt B.
want to preporcess javascript files
I was initially using jsp files to contain javascript. This way I could have them documented and keep revision history in them for development then have the commenst stripped out when they were deployed to clients. This works fine in IE. but causes Netscape to hang. I tryed to change them back to js and add a handler to preprocess these files as well but could not get it to work. Any solutions?
RE: file upload servlet
they have a good multipart form handler. http://www.servlets.com/resources/com.oreilly.servlet/ the only draw back is you need to know the path to store the files at before you parse the multipart request. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 27, 2000 5:15 PM To: [EMAIL PROTECTED] Subject: file upload servlet Hi all, Does anybody know a servlet utility that can handle binary file upload? I appreciate any information you can share. Ma, Yanbin
RE: file upload servlet
I'm using it on nt4 sun JDK 1.3, tomcat 3.1, apache 1.3.12 and on RH linux 6.2 sun JDK 1.3, tomcat 3.1, apache 1.3.12 I'm waiting till all the bleeding edgers debug 3.2 Initially I had some funky behavior when I ccped from the upload examples, but I rewrote it from scratch and it seems to work ok. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 27, 2000 6:40 PM To: [EMAIL PROTECTED] Subject: RE: file upload servlet I am very surprised. I tried the same version. Here is the code I am using. As you can see, (or somebody can see), this is from upload.war (the sample came with the multirequest class) with some modifications. If everything works ok, I should be able to see all the parameters and files listed. However, it only worked for text files. For binary files, results vary from server error to exception in the MultiPartRequest constrcutor. The only difference I could find between your code and mine is mine is in a servlet's doPost() function? Now I am really confused. Help! Is it related to tomcat somehow. I am using tomcat 3.2.1 with apache 1.3.14 on WinNT4.0. Yanbin try { MultipartRequest multi = new MultipartRequest(req, "D:/upload"); writer.println("PParams:/P"); Enumeration params = multi.getParameterNames(); while (params.hasMoreElements()) { String name = (String)params.nextElement(); String value = multi.getParameter(name); writer.println("p" + name + " = " + value + "/P"); } writer.println(); writer.println("pFiles:/p"); Enumeration files = multi.getFileNames(); while (files.hasMoreElements()) { String name = (String)files.nextElement(); String filename = multi.getFilesystemName(name); String type = multi.getContentType(name); File f = multi.getFile(name); writer.println("p" + "name: " + name + "/p"); writer.println("p" + "filename: " + filename + "/p"); writer.println("p" + "type: " + type + "/p"); if (f != null) { writer.println("p" + "f.toString(): " + f.toString() + "/p"); writer.println("p" + "f.getName(): " + f.getName() + "/p"); writer.println("p" + "f.exists(): " + f.exists() + "/p"); writer.println("p" + "f.length(): " + f.length() + "/p"); writer.println("p/p"); } } } catch (IOException lEx) { this.getServletContext().log("error reading or saving file" + lEx, lEx); } catch (Exception e) { this.getServletContext().log("caught un-known exception" + e, e); } |+ || Tim Cronin| || [EMAIL PROTECTED]| || eClub.com| ||| || 12/27/00 06:47 PM | || Please respond to | || tomcat-user | ||| |+ --- | | | | To: "'[EMAIL PROTECTED]'" | | [EMAIL PROTECTED] | | cc: (bcc: Yanbin Ma/SYS/NYTIMES) | | Subject: RE: file upload servlet | --- | I was able to upload text, image, exe files, and other binaries with oreily package. I am using the nov 20 2000 version here's the code from my jsp file private String processRequest ( HttpServletRequest request ) { String cType = request.getContentType(); if (cType != null cType.toLowerCase().startsWith("multipart/form-data")) { try { String appPath = getPath(request); MultipartRequest multi = new MultipartRequest(request, appPath); String submit = multi.getParameter(SUBMIT_UPLOAD_NAME); if(submit != null (submit.equals(SUBMIT_UPLOAD_VAL))) { Enumeration files = multi.getFileNames(); if(!files.hasMoreElements()) { return("No file was uploaded!"); } else { return("uploaded " + multi.getFilesystemName((String)files.nextElement()) + " to " + appPath); } } } catch(IOException e) { return(e.getMessage()); } } return(""
RE: printing error messages to log files
see javax.servlet.ServletContext.log or another simple hack if you got alot of system.out.prinln's in your code is to set system.out to a fileOutputStream. -Original Message- From: Ramkumar Manoharan [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 27, 2000 6:21 PM To: [EMAIL PROTECTED] Subject: printing error messages to log files Hi, Can anybody help me out on this?I want the error messages to be logged,but i don't see anything given in the doc.when i try to print the error messages with system.out.print it gets printed onto the console window.Any help would be appreciated. Thanks Ram _ Get your FREE download of MSN Explorer at http://explorer.msn.com
RE: printing error messages to log files
I believe it's the tomcat or servlet log. I ended up creating my own log so I could isolate my info from tomcat. -Original Message- From: Ramkumar Manoharan [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 27, 2000 8:06 PM To: [EMAIL PROTECTED] Subject: RE: printing error messages to log files Thanks again Tim.I looked at the javadoc and found the methods you were referring to,but how do you define the "servlet log".Iam puzzled.Is it the log file located on the tomcat server or can i define a log file on my own? Ram From: Tim Cronin [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: "'[EMAIL PROTECTED]'" [EMAIL PROTECTED] Subject: RE: printing error messages to log files Date: Wed, 27 Dec 2000 19:51:34 -0600 see the javadoc for javax.servlet.ServletContext.log there are two flavors one takes a String the other takes a String and an Exception for the other hack (very sudo) import java.io.File; import java.io.FileOutputStream; import java.io.PrintStream; FileOutputStream fout = new FileOutputStream(new File("logFile.txt")); System.setOut(new PrintStream(fout)); you could also do this the System.err as well this way you can isolate your audit statements from your error statements. -Original Message- From: Ramkumar Manoharan [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 27, 2000 7:38 PM To: [EMAIL PROTECTED] Subject: RE: printing error messages to log files Thanks tim for a quick reply.Can u show me a sample code or point me to some reference/tutorials that illustrates both of your suggestions. If i can see how it's done,it would help me a lot. Thanks Ram From: Tim Cronin [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: "'[EMAIL PROTECTED]'" [EMAIL PROTECTED] Subject: RE: printing error messages to log files Date: Wed, 27 Dec 2000 19:26:59 -0600 see javax.servlet.ServletContext.log or another simple hack if you got alot of system.out.prinln's in your code is to set system.out to a fileOutputStream. -Original Message- From: Ramkumar Manoharan [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 27, 2000 6:21 PM To: [EMAIL PROTECTED] Subject: printing error messages to log files Hi, Can anybody help me out on this?I want the error messages to be logged,but i don't see anything given in the doc.when i try to print the error messages with system.out.print it gets printed onto the console window.Any help would be appreciated. Thanks Ram _ Get your FREE download of MSN Explorer at http://explorer.msn.com _ Get your FREE download of MSN Explorer at http://explorer.msn.com _ Get your FREE download of MSN Explorer at http://explorer.msn.com