Re: confusion to DBCP
Hi, Yes Connection pool is good because it gives a performance boost to your application ( because open connection / close connection is cpu and network intensive ) You dont have a to configure DBCP in tomcat. you can do that in your application as well. You can configure DBCP in struts-config.xml if you are using struts :o) Why to re invent a wheel ( which may be buggy ) when there are loads which are free and tested .. :o) Any other question feel free to ask .. Regards Guru Guru on the Web : http://gurumoorthy.no-ip.org - Original Message - From: li yanjing [EMAIL PROTECTED] To: tomcat-user@jakarta.apache.org Sent: Sunday, May 08, 2005 5:18 AM Subject: confusion to DBCP I'm using mysql + tomcat as server to run jsp pages. and there are JavaBeans too. I have read a lot on the web that using a connection pool is very good. I just wondering why I should configure DBCP in tomcat? i think if i write the database connection in jsp pages(not in beans) I need configure DBCP in tomcat. if in the page I just call some JavaBeans to connect to database, i just need write a connection pool class in java. is that true? thanks -- - 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: Simple JavaBeans applications not working (newbie question); FIXED!
--- Anoop kumar V [EMAIL PROTECTED] wrote: Everything works perfectly fine in your jsp and bean except that the package mentioned in your bean (Beany.java) file seems incorrect Aaawwrrgh! (Bangs head against wall several dozen times) Thank you. That was such a stupid mistake; I should have spotted it. If there is any excuse it is that I'd had what *looked* like the same problem with two earlier attempts; the package name was not the problem there. Because I thought this was the same problem, I probably didn't consider the obvious answer again. Really, though; this is a great example of trying too hard, and missing what was staring me in the face. Also you do not need to place a web.xml in the WEB-INF folder - I mean its optional since tomcat5.X That's okay; it seems to work *without* the web.xml file, but not with it(!) I'll have a look at that sometime. Another thing I noticed that you have placed your bean as a jar in the WEB-INF/lib directory Yes; I was trying lots of things out to get it to work; I originally did as you described. Thanks for the help, - MS ___ How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: trouble with Font objects in Tomcat
I agree 100% with Farhad. The problem is not with headless but with your code. The exception tells you exactly what is happening. Your code is not finding the font. If you want to build fonts, you have to upload the font files with the right TextAttribute settings. On 5/7/05, Daniel Watrous [EMAIL PROTECTED] wrote: Is there at least someone that could tell me where to find more information about the option JAVA_OPTS=-Djava.awt.headless=true? What exactly is its purpose? Thanks in advance. Daniel On 5/6/05, Daniel Watrous [EMAIL PROTECTED] wrote: Hello, I have a web application that uses java.awt.Font objects to render images. The application will run in tomcat and that is where I have done development. When I first tried to run the application on a Linux box with Tomcat 5.0.25 I got the following error: java.lang.NoClassDefFoundError at com.words2walls.customquote.CustomQuote.getQuoteFontName(Unknown Source) at com.words2walls.webapp.filters.SessionQuoteFilter.doFilter(Unknown Source) Here is the code call that throws the error: public String getQuoteFontName() { return QuoteFontType.getInstance(this.quoteFontCode).toString(); } And the class that is being called: /* * QuoteFontType.java * * Created on April 15, 2005, 9:41 AM */ package com.words2walls.customquote; import java.awt.Font; import java.awt.FontFormatException; import java.util.*; import java.io.*; import com.words2walls.customquote.exceptions.FontNotFoundException; /** * Type safe enumeration of available fonts * * @author Daniel Watrous */ public class QuoteFontType { private static final String pathToWebapp = C:\\Program Files\\Apache Software Foundation\\Tomcat 5.0\\webapps\\words2walls; private static final String pathToPackage = \\WEB-INF\\classes\\com\\words2walls\\fonts\\; private String fontName; private int fontCode; private Font font; private static org.apache.log4j.Category cat = org.apache.log4j.Category.getInstance(QuoteFontType.class.getName()); public static final QuoteFontType ADORABLE = new QuoteFontType(1,Adorable,adorable.ttf); private static final Map INSTANCES = new HashMap(); static { cat.debug(Enter Static block to place fonts in INSTANCES Map); INSTANCES.put (ADORABLE.toInteger(), ADORABLE); cat.debug(Exit Static block with INSTANCES.size() = + INSTANCES.size()); } /** Creates a new instance of QuoteFontType */ private QuoteFontType(int code, String fontName, String filename) { // create a font from the font file try { File fontFile = new File (pathToWebapp+pathToPackage+filename); FileInputStream fis = new FileInputStream(fontFile); font = Font.createFont(Font.TRUETYPE_FONT, fis); } catch (Exception e) { throw new FontNotFoundException(e); } // set member variables this.font = font; this.fontCode = code; this.fontName = fontName; } public String toString() { return fontName; } public Integer toInteger() { return new Integer(fontCode); } public static QuoteFontType getInstance(int code) { return (QuoteFontType) INSTANCES.get(new Integer(code)); } public Font getFont() { return font; } } After some googling I found that if I set an environment variable JAVA_OPTS=-Djava.awt.headless=true that this error would go away. I'm not sure why this is the case, but it worked. I am now trying to test the application on a windows machine with Tomcat 5.0.30 and I get the same error. I have set a Windows XP environment variable the same as mentioned above. I have also added the option to the Java tab of the Tomcat monitor under Java Options:. What is the cause of this error? Is there some way that I can make it work on both Windows and Linux? Thanks in advance. Daniel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: trouble with Font objects in Tomcat
Your class comments indicate a different purpose than your class code, but assuming a connection in your mind, code something like the following might be helpful to you: public class Fonts { public static Font [] getFonts() { return GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts(); } public static String [] getFontNames() { Font [] fonts = getFonts(); String [] fontNames = new String [fonts.length]; for (int i = 0; i fonts.length; i++) { fontNames[i] = fonts[i].getFontName(); } return fontNames; } public static String [] getFontFamilies() { Font [] fonts = getFonts(); String [] fontFamilies = new String [fonts.length]; for (int i = 0; i fonts.length; i++) { fontFamilies[i] = fonts[i].getFamily(); } return fontFamilies; } public static String [] getNames() { Font [] fonts = getFonts(); String [] names = new String [fonts.length]; for (int i = 0; i fonts.length; i++) { names[i] = fonts[i].getName(); } return names; } public static void main(String [] params) { String [] names = Fonts.getNames(); for(int i = 0; i names.length; i++) { com.crackwillow.log.StdOut.log(fonts,names[i]); } } } ///;-) Michael McGrady On 5/6/05, Daniel Watrous [EMAIL PROTECTED] wrote: Hello, I have a web application that uses java.awt.Font objects to render images. The application will run in tomcat and that is where I have done development. When I first tried to run the application on a Linux box with Tomcat 5.0.25 I got the following error: java.lang.NoClassDefFoundError at com.words2walls.customquote.CustomQuote.getQuoteFontName(Unknown Source) at com.words2walls.webapp.filters.SessionQuoteFilter.doFilter(Unknown Source) Here is the code call that throws the error: public String getQuoteFontName() { return QuoteFontType.getInstance(this.quoteFontCode).toString(); } And the class that is being called: /* * QuoteFontType.java * * Created on April 15, 2005, 9:41 AM */ package com.words2walls.customquote; import java.awt.Font; import java.awt.FontFormatException; import java.util.*; import java.io.*; import com.words2walls.customquote.exceptions.FontNotFoundException; /** * Type safe enumeration of available fonts * * @author Daniel Watrous */ public class QuoteFontType { private static final String pathToWebapp = C:\\Program Files\\Apache Software Foundation\\Tomcat 5.0\\webapps\\words2walls; private static final String pathToPackage = \\WEB-INF\\classes\\com\\words2walls\\fonts\\; private String fontName; private int fontCode; private Font font; private static org.apache.log4j.Category cat = org.apache.log4j.Category.getInstance(QuoteFontType.class.getName()); public static final QuoteFontType ADORABLE = new QuoteFontType(1,Adorable,adorable.ttf); private static final Map INSTANCES = new HashMap(); static { cat.debug(Enter Static block to place fonts in INSTANCES Map); INSTANCES.put (ADORABLE.toInteger(), ADORABLE); cat.debug(Exit Static block with INSTANCES.size() = + INSTANCES.size()); } /** Creates a new instance of QuoteFontType */ private QuoteFontType(int code, String fontName, String filename) { // create a font from the font file try { File fontFile = new File (pathToWebapp+pathToPackage+filename); FileInputStream fis = new FileInputStream(fontFile); font = Font.createFont(Font.TRUETYPE_FONT, fis); } catch (Exception e) { throw new FontNotFoundException(e); } // set member variables this.font = font; this.fontCode = code; this.fontName = fontName; } public String toString() { return fontName; } public Integer toInteger() { return new Integer(fontCode); } public static QuoteFontType getInstance(int code) { return (QuoteFontType) INSTANCES.get(new Integer(code)); } public Font getFont() { return font; } } After some googling I found that if I set an environment variable JAVA_OPTS=-Djava.awt.headless=true that this error would go away. I'm not sure why this is the case, but it worked. I am now trying to test the application on a windows machine with Tomcat 5.0.30 and I get the same error. I have set a Windows XP environment variable the same as mentioned above. I have also added the option to the Java tab of the Tomcat monitor under Java Options:. What is the cause of this error? Is there some way that I can make it work on both Windows and Linux? Thanks in advance. Daniel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --
Re: Simple JavaBeans applications not working (newbie question)
On Sat, May 07, 2005 at 01:39:50PM -0400, Anoop kumar V wrote: : Another thing I noticed that you have placed your bean as a jar in the : WEB-INF/lib directory - while this works perfectly the practice is to put : custom class files in the WEB-INF/classes directory as just .class files : under their respective folders (as per package declaration).. What practice would this be? Some would argue that placing your classes in JAR files permits better organization/grouping than a flat space under WEB-INF classes. Per the spec, the only difference between WEB-INF/classes and WEB-INF/lib is that the former is searched first. -QM -- software -- http://www.brandxdev.net/ tech news -- http://www.RoarNetworX.com/ code scan -- http://www.JxRef.org/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
jkmount question
I was reading the following nice explanation of the mod_jk configuration options. The 3rd form, the suffix match is easy, but I don't understand the difference between the 2 first forms for JkMount, the exact match and the context match. Could someone explain when you'd use one versus the other? Thanks. http://publib.boulder.ibm.com/iseries/v5r2/ic2924/info/rzaie/rzaiemod_jk.htm#jkmount - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cannot download files with IE through tomcat. SSL with no-cache problems?
I found the solution! Posting here to save other people the problems I had in finding this: Put this in your server.xml (or conf/Catatlina/localhost/*.xml) file: Valve className=org.apache.catalina.authenticator.FormAuthenticator disableProxyCaching=false / -- Don Rota, CTG Operations Rational Software, IBM Software Group 20 Maguire Road, Lexington, MA 02421-3104 Tel: 781 676 2655, Fax: 781 676 7645 [EMAIL PROTECTED] Donny R Rota/Lexington/[EMAIL PROTECTED] 05/06/2005 03:13 PM Please respond to Tomcat Users List To Tomcat Users List tomcat-user@jakarta.apache.org cc Subject Cannot download files with IE through tomcat. SSL with no-cache problems? On Apache Tomcat/5.0.28, I've got SLL installed, and whenever I try to download a doc file I get: Some files can harm your computer. If the file information below looks suspicious, or you do not fully trust the source, do not open or save this file File name: x.doc File type:Microsoft Word Document From:yyy.ibm.com Open Save Cancel More Info I click Open and then the folloing file download dialog comes up: Internet Explorer cannot download .doc from y.ibm.com Internet Explorer was not able to open this Internet Site. The requested site is either unavailable or cannot be found. Please try again later. OK Downloading works fine in FireFox. Downloading works fine if I turn off SSL. We have an apache server (full httpd server) inhouse where this type of SSL download works fine too. Is there a SSL no-cache setting I have to put in server.xml or something? Thanks ...Don... -- Don Rota, CTG Operations Rational Software, IBM Software Group 20 Maguire Road, Lexington, MA 02421-3104 Tel: 781 676 2655, Fax: 781 676 7645 [EMAIL PROTECTED]
Re: Cannot download files with IE through tomcat. SSL with no-cache problems?
As posted by Tim Funk in reply to your original message, the details regarding this problem are found here: http://issues.apache.org/bugzilla/show_bug.cgi?id=27122 Note that it is a problem with IE only, wherein IE can't handle no-cache cache directives, and Tomcat only sets these headers when serving content from a protected context. Also, if you're using other than form authentication, you need to substitute the class name for your authenticator in the valve configuration described below. Donny R Rota wrote: I found the solution! Posting here to save other people the problems I had in finding this: Put this in your server.xml (or conf/Catatlina/localhost/*.xml) file: Valve className=org.apache.catalina.authenticator.FormAuthenticator disableProxyCaching=false / -- Don Rota, CTG Operations Rational Software, IBM Software Group 20 Maguire Road, Lexington, MA 02421-3104 Tel: 781 676 2655, Fax: 781 676 7645 [EMAIL PROTECTED] Donny R Rota/Lexington/[EMAIL PROTECTED] 05/06/2005 03:13 PM Please respond to Tomcat Users List To Tomcat Users List tomcat-user@jakarta.apache.org cc Subject Cannot download files with IE through tomcat. SSL with no-cache problems? On Apache Tomcat/5.0.28, I've got SLL installed, and whenever I try to download a doc file I get: Some files can harm your computer. If the file information below looks suspicious, or you do not fully trust the source, do not open or save this file File name: x.doc File type:Microsoft Word Document From:yyy.ibm.com Open Save Cancel More Info I click Open and then the folloing file download dialog comes up: Internet Explorer cannot download .doc from y.ibm.com Internet Explorer was not able to open this Internet Site. The requested site is either unavailable or cannot be found. Please try again later. OK Downloading works fine in FireFox. Downloading works fine if I turn off SSL. We have an apache server (full httpd server) inhouse where this type of SSL download works fine too. Is there a SSL no-cache setting I have to put in server.xml or something? Thanks ...Don... -- Don Rota, CTG Operations Rational Software, IBM Software Group 20 Maguire Road, Lexington, MA 02421-3104 Tel: 781 676 2655, Fax: 781 676 7645 [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat install errors
I'm iafraind I don't understand. Where should the line be? I've done the following mkdir dir=${tomcat-dbcp.home}/src/java/org/apache/tomcat/dbcp / move todir=${tomcat-dbcp.home}/src/java/org/apache/tomcat/dbcp fileset dir=${tomcat-dbcp.home}/src/java/org/apache/commons/ fileset dir=${tomcat-dbcp.home}/src/java/org/apache/commons/ include name=**/*.java / /fileset /move But this is the result: BUILD FAILED /home/tomcat/build.xml:49: The following error occurred while executing this line: /home/tomcat/jakarta-tomcat-5/build.xml:1901: The following error occurred while executing this line: /home/tomcat/jakarta-tomcat-5/build.xml:670: The following error occurred while executing this line: /home/tomcat/jakarta-tomcat-5/build.xml:682: The following error occurred while executing this line: /home/tomcat/jakarta-tomcat-5/build.xml:718: Cannot replace directory /usr/share/java/tomcat-deps/src/java/org/apache/tomcat/dbcp with directory /usr/share/java/tomcat-deps/src/java/org/apache/commons Total time: 8 seconds [EMAIL PROTECTED]:/home/tomcat# On 5/8/05, Kent R. Spillner [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, FL- I just encountered the same problem building tomcat that you reported on tomcat-user@ last week. In my case, I'm trying to install tomcat 5.5.9 on Mac OS X 10.4, using darwinports. Personally, I think removing both the mkdir move tasks is risky; tomcat-dbcp obviously wants the commons source code to be relocated to an org.apache.tomcat.dbcp subpackage. I would be worried that while this might allow tomcat to build, it will cause breakage during normal use. Instead, add an explicit include to the fileset inside the problematic move task, i.e.: fileset dir=${tomcat-dbcp.home}/src/java/org/ apache/commons/ include name=**/*.java / /fileset HTH, Kent socrates:~ sl4mmy$ uname -a Darwin socrates.local 8.0.0 Darwin Kernel Version 8.0.0: Sat Mar 26 14:15:22 PST 2005; root:xnu-792.obj~1/RELEASE_PPC Power Macintosh powerpc socrates:~ sl4mmy$ java -version java version 1.5.0_02 Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_02-56) Java HotSpot(TM) Client VM (build 1.5.0_02-36, mixed mode, sharing) socrates:~ sl4mmy$ ant -version Apache Ant version 1.6.3 compiled on April 28 2005 -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (Darwin) iD8DBQFCfn/R2DzcNcFR0iwRAk01AJ9S+f02D10AVeAdB6dCox69ACj+RACgjJhr gCS3ihcRGhEXhDaZ47dvoBw= =/WEP -END PGP SIGNATURE-
Re: Tomcat install errors
Attempting to put the include inside the move element, one has the following error: BUILD FAILED /home/tomcat/build.xml:49: The following error occurred while executing this line: /home/tomcat/jakarta-tomcat-5/build.xml:1896: The following error occurred while executing this line: /home/tomcat/jakarta-tomcat-5/build.xml:670: The following error occurred while executing this line: /home/tomcat/jakarta-tomcat-5/build.xml:682: The following error occurred while executing this line: /home/tomcat/jakarta-tomcat-5/build.xml:718: The move type doesn't support the nested include element. On 5/8/05, FL [EMAIL PROTECTED] wrote: I'm iafraind I don't understand. Where should the line be? I've done the following mkdir dir=${tomcat-dbcp.home}/src/java/org/apache/tomcat/dbcp / move todir=${tomcat-dbcp.home}/src/java/org/apache/tomcat/dbcp fileset dir=${tomcat-dbcp.home}/src/java/org/apache/commons/ fileset dir=${tomcat-dbcp.home}/src/java/org/apache/commons/ include name=**/*.java / /fileset /move But this is the result: BUILD FAILED /home/tomcat/build.xml:49: The following error occurred while executing this line: /home/tomcat/jakarta-tomcat-5/build.xml:1901: The following error occurred while executing this line: /home/tomcat/jakarta-tomcat-5/build.xml:670: The following error occurred while executing this line: /home/tomcat/jakarta-tomcat-5/build.xml:682: The following error occurred while executing this line: /home/tomcat/jakarta-tomcat-5/build.xml:718: Cannot replace directory /usr/share/java/tomcat-deps/src/java/org/apache/tomcat/dbcp with directory /usr/share/java/tomcat-deps/src/java/org/apache/commons Total time: 8 seconds [EMAIL PROTECTED]:/home/tomcat# On 5/8/05, Kent R. Spillner [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, FL- I just encountered the same problem building tomcat that you reported on tomcat-user@ last week. In my case, I'm trying to install tomcat 5.5.9 on Mac OS X 10.4, using darwinports. Personally, I think removing both the mkdir move tasks is risky; tomcat-dbcp obviously wants the commons source code to be relocated to an org.apache.tomcat.dbcp subpackage. I would be worried that while this might allow tomcat to build, it will cause breakage during normal use. Instead, add an explicit include to the fileset inside the problematic move task, i.e.: fileset dir=${tomcat-dbcp.home}/src/java/org/ apache/commons/ include name=**/*.java / /fileset HTH, Kent socrates:~ sl4mmy$ uname -a Darwin socrates.local 8.0.0 Darwin Kernel Version 8.0.0: Sat Mar 26 14:15:22 PST 2005; root:xnu-792.obj~1/RELEASE_PPC Power Macintosh powerpc socrates:~ sl4mmy$ java -version java version 1.5.0_02 Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_02-56) Java HotSpot(TM) Client VM (build 1.5.0_02-36, mixed mode, sharing) socrates:~ sl4mmy$ ant -version Apache Ant version 1.6.3 compiled on April 28 2005 -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (Darwin) iD8DBQFCfn/R2DzcNcFR0iwRAk01AJ9S+f02D10AVeAdB6dCox69ACj+RACgjJhr gCS3ihcRGhEXhDaZ47dvoBw= =/WEP -END PGP SIGNATURE-
Re: Tomcat install errors
Problem solved: On 5/8/05, Kent R. Spillner [EMAIL PROTECTED] wrote: - - - -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, FL- On May 8, 2005, at 5:09 PM, FL wrote: I'm afraid I don't understand. Where should the line be? Doh; sorry. I should have been more clear. I've done the following mkdir dir=${tomcat-dbcp.home}/src/java/org/apache/tomcat/ dbcp / move todir=${tomcat-dbcp.home}/src/java/org/apache/tomcat/ dbcp fileset dir=${tomcat-dbcp.home}/src/java/org/ apache/commons/ fileset dir=${tomcat-dbcp.home}/src/java/org/apache/commons/ include name=**/*.java / /fileset /move You're on the right track, but you don't want to keep the first fileset. An oversight... So, this: mkdir dir=${tomcat-dbcp.home}/src/java/org/apache/tomcat/dbcp / move todir=${tomcat-dbcp.home}/src/java/org/apache/tomcat/dbcp fileset dir=${tomcat-dbcp.home}/src/java/org/apache/commons / /move Becomes this: mkdir dir=${tomcat-dbcp.home}/src/java/org/apache/tomcat/dbcp / move todir=${tomcat-dbcp.home}/src/java/org/apache/tomcat/dbcp fileset dir=${tomcat-dbcp.home}/src/java/org/apache/commons include name=**/*.java / /fileset /move It's that first, empty fileset that is causing the problems; could be a bug in ant? Aha: that works. I did try it that way (without the /fileset) and the empty fileset did cause trouble. Thank you! Let me know if you need any more help with this! Best, Kent - - - -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (Darwin) iD8DBQFCfpY62DzcNcFR0iwRAiqyAKCqT6Z0YsQ4Vpi5S8dIwey0VG+2FACdGjoA ZjKLrS+tDz/dNuK7AuKBdLA= =j1ji - - - -END PGP SIGNATURE-
Re: Simple JavaBeans applications not working (newbie question)
From: Michael Strorm [EMAIL PROTECTED] skeleton/WEB-INF/lib/subapp/Beany.class Jar files go in WEB-INF/lib. Classes go under WEB-INF/classes in a directory structure matching the package name. What package statement does Beany.java contain? org.apache.jasper.JasperException: /subapp/skeleton.jsp(2,0) The value for the useBean class attribute subclass.Beany is invalid. Shouldn't that be 'subapp.Beany' and not 'subclass.Beany'? That's why I asked, above, about the package statement. Before you continue, you might shut down Tomcat and delete the 'work' directory associated with this webapp to make sure you're starting fresh. (I assume such a thing exists in version 5, I'm still using 4.1.) You're close, just change one thing at a time until you figure it out. -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DBCP ClassCastException
Hi all, I'm getting a the following ClassCastException running Tomcat 5.5.9 with MySQL java.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp.BasicDataSource Here's the relevant code: *Java code:* org.apache.commons.dbcp.BasicDataSource datasource; datasource = (BasicDataSource)ctx.lookup(java:comp/env/jdbc/myserver); *web.xml* resource-ref descriptionDB Connection/description res-ref-namejdbc/myserver/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref *server.xml* ** ResourceParams name=jdbc/myserver parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter *...* This same code works in Tomcat 5.0.30. Has anything changed? Am I missing something? Thanks.