Re: How to get user name after login
I think it is getRemoteUser(); --- ±ç¬±³õ [EMAIL PROTECTED] wrote: After implementation of JDBCRealm, how to retrieve the username in Servlet after login? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
The connection was refused when attempting to contact localhost:7001
I am using the Tomcat 5.0.28. I have two browsers: Netscape and IE. I have been testing my JavaServer Faces (JSF) applications. I put JSF example war files (I tested many examples) under the webapps directory, started my Tomcat, and typed http://localhost:7001/X in the browser's address bar. All those applications worked fine. I did not run any application for a few weeks. Today, I lauched the Tomcat (no problem). I wanted to re-test those JSF examples that are under the webapps directory to refresh my memory. After I typed http://localhost:7001/XX in the Netscape's address bar, I got an alert: The connection was refused when attempting to contact localhost:7001. I also typed http://localhost:7001/X in the IE's address bar, the message is that the web site cannot be found. What is going on? What could go wrong? __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: can´t Configurate Database Connection Pool (DBCP) with Tomcat 5.0.28
I had exactly the same problem when I tried to configure the Tomcat 5.0.27. At that time, a number of people reported the difficulty. Finally, we put the configuration code in between the realm .../ element and the Host element of the $TOMCAT/conf/server.xml. Please e-mail me if you still have the problem. I will give you the step-by-step procedure. --- Anto Paul [EMAIL PROTECTED] wrote: On 4/15/05, Sevillano sevi llano [EMAIL PROTECTED] wrote: I don´t know if it helps, but this is my environment: j2sdk1.4.2_07 tomcat 5.0.28 oracle 9 j2sdk1.4.2_07 tomcat 5.0.28 mysql (I don´t remember the version, this is my home environment) thanks From: Sevillano sevi llano [EMAIL PROTECTED] Reply-To: Tomcat Users List tomcat-user@jakarta.apache.org To: tomcat-user@jakarta.apache.org Subject: Re: can´t Configurate Database Connection Pool (DBCP) with Tomcat 5.0.28 Date: Fri, 15 Apr 2005 09:48:29 + I think JDBC Drivers are correctly installed, because direct connection works correctly: DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); conn = DriverManager.getConnection(jdbc:oracle:thin:@*.*.*.*:1521:bddesa,**,**); I have the .jar files in Tomcat 5.0\common\lib From: Benjamin Cuthbert [EMAIL PROTECTED] Reply-To: Tomcat Users List tomcat-user@jakarta.apache.org To: Tomcat Users List tomcat-user@jakarta.apache.org CC: tomcat-user@jakarta.apache.org Subject: Re: can´t Configurate Database Connection Pool (DBCP) with Tomcat 5.0.28 Date: Fri, 15 Apr 2005 10:45:01 +0100 And you have the JDBC Driver installed, and tomcat comes up with no errors. Are you just trying to setup user authentication against a database instead of tomcat-users.xml Ben Cuthbert Deutsche Bank - Global Markets TISO Customer Trading Technology PGP: http://pgp.mit.edu +44 (0) 20 754 76389 (Tel) +44 (0) 20 754 74996 (Fax) Sevillano sevi llano [EMAIL PROTECTED] 04/15/2005 10:41 AM Please respond to Tomcat Users List To: tomcat-user@jakarta.apache.org cc: Subject:Re: can´t Configurate Database Connection Pool (DBCP) with Tomcat 5.0.28 Hi Benajmin, I´m testing with two different databases: oracle 9 and mysql with both I´ve got the same error org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' and with both I can connect directly for example, it works correctly: ... DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); conn = DriverManager.getConnection(jdbc:oracle:thin:@*.*.*.*:1521:bddesa,**,**); ... Thanks very much From: Benjamin Cuthbert [EMAIL PROTECTED] Reply-To: Tomcat Users List tomcat-user@jakarta.apache.org To: Tomcat Users List tomcat-user@jakarta.apache.org CC: tomcat-user@jakarta.apache.org Subject: Re: can´t Configurate Database Connection Pool (DBCP) with Tomcat 5.0.28 Date: Fri, 15 Apr 2005 10:36:30 +0100 Sevillano Can you show me your JDBC configuration. Ben Cuthbert Deutsche Bank - Global Markets TISO Customer Trading Technology PGP: http://pgp.mit.edu +44 (0) 20 754 76389 (Tel) +44 (0) 20 754 74996 (Fax) Sevillano sevi llano [EMAIL PROTECTED] 04/15/2005 10:34 AM Please respond to Tomcat Users List To: tomcat-user@jakarta.apache.org cc: Subject:can´t Configurate Database Connection Pool (DBCP) with Tomcat 5.0.28 Hi, I´m a newbie trying to configurate DBCP with Tomcat 5.0.28 I´m following this documentation: http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html ...Add this in between the /Context tag of the examples context and the /Host tag closing the localhost definition... but there is no /Context in my server.xml also I´ver read tons of forums about this question, and I´ve tested a lot of different configuration. this is the error I´ve got (the usual I think): org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' any help please? I´ve been the whole week trying to fix it thanks these are my files: SERVER.XML Server port=8005 shutdown=SHUTDOWN GlobalNamingResources !-- Used by Manager webapp -- Resource name=UserDatabase auth=Container === message truncated === __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: can´t Configurate Database Connection Pool (DBCP) with Tomcat 5.0.28
Hi Sevillano, I inserted the configuration after the last Realm / tag and before the Host ... tage (see below) in the $TOMCAT/config/server.xml file. This is my configuration (sorry, I should have shown it in my previous posting). Let us see if it works: !-- Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=sun.jdbc.odbc.JdbcOdbcDriver connectionURL=jdbc:odbc:CATALINA userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=user_roles roleNameCol=role_name / -- !-- Define the default virtual host Note: XML Schema validation will not work with Xerces 2.2. -- !-- The DefaultContext segment and its elements below are added by Caroline Jen -- DefaultContext Resource name=jdbc/OracleDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/OracleDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namemaxWait/name value-1/value /parameter parameter namemaxActive/name value20/value /parameter parameter namepassword/name valuejavadude/value /parameter parameter nameurl/name valuejdbc:oracle:thin:@bigbird:1522:dcapes/value /parameter parameter namedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value /parameter parameter namemaxIdle/name value10/value /parameter parameter nameusername/name valuejavauser/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter nameremoveAbandonedTimeout/name value60/value /parameter parameter namelogAbandoned/name valuetrue/value /parameter /ResourceParams /DefaultContext !-- The DefaultContext segment and its elements above are added by Caroline Jen -- Host name=localhost debug=0 appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false !-- The line below is added by Caroline Jen -- DefaultContext reloadable=true/ !-- Defines a cluster for this node, By defining this element, means that every manager will be changed. So when running a cluster -Caroline --- Sevillano sevi llano [EMAIL PROTECTED] wrote: but... where do I add the Context exactly? this is my server.xml, If I add context, tomcat doesn´t start thanks Server port=8005 shutdown=SHUTDOWN GlobalNamingResources !-- Used by Manager webapp -- Resource name=UserDatabase auth=Container type=org.apache.catalina.UserDatabase description=User database that can be updated and saved /Resource ResourceParams name=UserDatabase parameter namefactory/name valueorg.apache.catalina.users.MemoryUserDatabaseFactory/value /parameter parameter namepathname/name valueconf/tomcat-users.xml/value /parameter /ResourceParams /GlobalNamingResources Service name=Catalina Connector port=8080 / !-- This is here for compatibility only, not required -- Connector port=8009 protocol=AJP/1.3 / Engine name=Catalina defaultHost=localhost Logger className=org.apache.catalina.logger.FileLogger / Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=UserDatabase / Host name=localhost appBase=webapps/ /Engine /Service /Server From: Parsons Technical Services [EMAIL PROTECTED] Reply-To: Tomcat Users List tomcat-user@jakarta.apache.org To: Tomcat Users List tomcat-user@jakarta.apache.org Subject: Re: can´t Configurate Database Connection Pool (DBCP) with Tomcat 5.0.28 Date: Fri, 15 Apr 2005 07:56:36 -0400 Do you have your resource link in the context element? And if you don't have a context for the app you need to create one. Doug - Original Message - From: Sevillano sevi llano [EMAIL PROTECTED] To: tomcat-user@jakarta.apache.org Sent: Friday, April 15, 2005 5:34 AM Subject: can´t Configurate Database Connection Pool (DBCP) with Tomcat 5.0.28 Hi, I´m a newbie trying to configurate DBCP with Tomcat 5.0.28 I´m following this documentation: http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html ...Add this in between the /Context tag of the examples context and the /Host tag closing the localhost definition... but there is no /Context in my server.xml also I´ver read tons of forums about this question, and I´ve tested a lot of different configuration. this is the error I´ve got (the usual I think
Re: FW: My very first servlet cannot be run
Hi Patrick, I suppose that your compiled Log4jTester in the test package is under this directory: C:\tomcat-5.x/webapps/ROOT/WEB-INF/classes The mapping in the web.xml file should be: servlet servlet-namelog4j/servlet-name servlet-classtest.Log4jTester/servlet-class /servlet servlet-mapping servlet-namelog4j/servlet-name url-pattern/servlet/test.Log4jTester/url-pattern /servlet-mapping /web-app In the IE browser, type in http://localhost:8080/servlet/test.Log4jTester try it out. Let us know if you have further problems. --- Van Den Bemt, Patrick (P.) [EMAIL PROTECTED] wrote: Hi there, I have got an issue running a very first servlet on tomcat5. The valid Servlet code for Log4jTester : package test; public class Log4jTester { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { } } The valid web.xml : ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app display-namePatrickWorkspace/display-name descriptionThis is the Patrick workspace/description servlet servlet-namelog4j/servlet-name servlet-classtest.Log4jTester/servlet-class /servlet servlet-mapping servlet-namelog4j/servlet-name url-pattern/log4j/url-pattern /servlet-mapping /web-app The valid log4j.html HTML HEAD TITLE log4jtest /TITLE HEAD BODY FORM TYPE = submit ACTION=/test.Log4jTester METHOD=GET CENTER INPUT TYPE=submit NAME=submit VALUE=go /CENTER /FORM /BODY /HTML The valid index.html HTML HEAD /HEAD BODY A HREF = html/log4j.html log4j /A /BODY /HTML Deployment: The deployment works fine. Tomcat manager lists the PatrickWorkSpace. PatrickWorkSpace opens the index.html. Index.html opens the log4j.html Clicking the Go button on log4j.html results in following error HTTP Status 404 - /PatrickWorkSpace/test.Log4jTester type Status report message /PatrickWorkSpace/test.Log4jTester description The requested resource (/PatrickWorkSpace/test.Log4jTester) is not available. I hope anyone can give me some good hints and tips. Patrick. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: hi help regarding running first servlet,jsp in Tomcat 5.x
Please take a look at http://www.moreservlets.com/Using-Tomcat-4.html#Configure-Tomcat It gives instructions on the installation of Tomcat and compiling and testing simple Servlets and JSPs. Please let us know if you still run into problems. --- K thiruthuvadas [EMAIL PROTECTED] wrote: Dear Friends, i want to subscribe to the mailing list of tomcat. I have a doubt here i successfully installed tomcat 5.x in my windows server but when i tried to run my first sample application i caould not succeed i downloaded the sample file and placed it in the webapps folder. But when i access the http://localhost:8080/sample link the browser asks for network user name and password I could not run my first application with the help available inthe tomcat website It shows when Tomcat starts, that port 8080 is in use, it throws a java.net.bind exception regards, Das __ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Sending email with zip file attach problem
It is an example of sending bulk mails with attachment. You have to write the uploaded file into a temporary directory. See the attachments. I hope the example could be useful. -Caroline --- Daxin Zuo [EMAIL PROTECTED] wrote: Hi, Please help. Any sugestion is welcome. In my web page, users send email with attachment, so upload is related. I can provide the file in either a byte[] array, or in an inputstream. I try to send the attachement with JavaMail(I know there is email api in Tomcat-Common. But I have no a good example). --- my code in a function in a servlet --- DiskFileUpload upload = new DiskFileUpload(); List items = upload.parseRequest(request); Iterator itr = items.iterator(); item = (FileItem) itr.next(); . //- now it is a attachement. InputStream istrm= item.getInputStream(); ... MimeBodyPart messageBodyPart = new MimeBodyPart(); messageBodyPart.setDisposition(Part.INLINE); messageBodyPart.setContent(strBodyText, text/plain); MimeMultipart multipart = new MimeMultipart(); multipart.addBodyPart(messageBodyPart); messageBodyPart = new MimeBodyPart(istrm); messageBodyPart.setDisposition(messageBodyPart.ATTACHMENT); messageBodyPart.addHeader(Content-Type,strMime); //strMime is correct messageBodyPart.setFileName(fileName); multipart.addBodyPart(messageBodyPart); NO metter what file it is, the attachement received is ATT00211.txt. I the file is a text file, the contents are correct. if the file is a small zip file, it adds the lines as following in attached file: Content-Type: application/zip; name=idmeta.zip Content-Disposition: attachment; filename=idmeta.zip Content-Transfer-Encoding: 7bit What's wrong? Please forward instruction. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail - Helps protect you from nasty viruses. http://promotions.yahoo.com/new_mailpackage org.dhsinfo.message; // import the JavaMail packages import javax.mail.*; import javax.mail.internet.*; import javax.activation.*; // import misc classes that we need import java.util.Properties; import java.util.Collection; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.Action; import org.apache.struts.action.ActionError; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionServlet; import org.apache.struts.action.DynaActionForm; import org.apache.struts.upload.FormFile; public final class SendBatchMails extends Action { private final String PROPFILE = resources/smtpServer.properties; private Properties smtpProp = null; public SendBatchMails() { try { smtpProp = new Properties(); smtpProp.load ( getClass().getClassLoader().getResourceAsStream( PROPFILE ) ); } catch( IOException oEx ) { System.out.println(Unable to load the Properties + PROPFILE + oEx ); } } public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response ) throws java.lang.Exception { SelectRecipientsForm srf = ( SelectRecipientsForm )form; // get the message parameters from the HTML page String from = srf.getSender(); /* if ( from == null ) from = mailOption.defaultEmailFrom; */ String[] to = srf.getSelectedEmailAddresses(); String subject = srf.getMessageTopic(); String text = srf.getMessageBody(); FormFile file = srf.getTheFile(); String fileName = file.getFileName(); Address[] toAddress = new Address[ to.length ]; for ( int i=0; i to.length; i++ ) { toAddress[i] = new InternetAddress( to[i] ); } CreateTemporaryFile ctf = new CreateTemporaryFile(); String filePath = ctf.writeToFile( file, fileName ); //destroy the temporary file created file.destroy(); // set the SMTP host property value String smtpServer = smtpProp.getProperty( smtpServer ); Properties props = System.getProperties(); props.put( mail.smtp.host, smtpServer ); Transport trans = null; PrintWriter out = response.getWriter(); response.setContentType( text/html ); try { // create a JavaMail session Session session = Session.getDefaultInstance( props, null ); // To watch the mail commands go by to the mail server
Re: File upload
Are you following the struts-upload.war example that comes with the Struts 1.1? In that example, the uploaded file size is checked. If a file is stored somewhere under the AppName/WEB-INF directory, you have to use the stream to read the file. --- Derrick Koes [EMAIL PROTECTED] wrote: Configuration: Tomcat 5.0.24 IIS 5.0 JK2 connector Isapi_redirector2.dll Struts 1.1 Commons file upload 1.0 I seem to have an issue that when the file is a certain size it is written to a temp file on the file system before it is parsed by the multipart parser (at least that's what the exception message leads me to believe). However, since the working directory is my web app (/WEB-INF/ilt), the parser can't seem to find the file (not a fully qualified file name). This is a guess, but if correct I don't know how to fix the problem. Any help is appreciated. Belows is the stack trace and data from the request dumper valve: 2004-10-28 10:59:32 RequestDumperValve[/ilt]: === 2004-10-28 10:59:43 RequestDumperValve[/ilt]: REQUEST URI =/ilt/ilt/iltPerformUpload.do 2004-10-28 10:59:43 RequestDumperValve[/ilt]: authType=null 2004-10-28 10:59:43 RequestDumperValve[/ilt]: characterEncoding=null 2004-10-28 10:59:43 RequestDumperValve[/ilt]: contentLength=340147 2004-10-28 10:59:43 RequestDumperValve[/ilt]: contentType=multipart/form-data; boundary=---41184676334 2004-10-28 10:59:43 RequestDumperValve[/ilt]: contextPath=/ilt 2004-10-28 10:59:43 RequestDumperValve[/ilt]: cookie=com.skillsoft.mgs.sso.RedirectorServlet.ReturnToSkillPort=http:// dkoesxp/djk/home/index.cfm?selectdTab=0 2004-10-28 10:59:43 RequestDumperValve[/ilt]: cookie=CFMX_JSESSIONID=c8301990451098975559821 2004-10-28 10:59:43 RequestDumperValve[/ilt]: cookie=CFID=19459 2004-10-28 10:59:43 RequestDumperValve[/ilt]: cookie=CFTOKEN=98634115 2004-10-28 10:59:43 RequestDumperValve[/ilt]: header=accept=text/xml,application/xml,application/xhtml+xml,text/html;q =0.9,text/plain;q=0.8,image/png,*/*;q=0.5 2004-10-28 10:59:43 RequestDumperValve[/ilt]: header=accept-language=en-us,en;q=0.5 2004-10-28 10:59:43 RequestDumperValve[/ilt]: header=connection=keep-alive 2004-10-28 10:59:43 RequestDumperValve[/ilt]: header=host=dkoesxp 2004-10-28 10:59:43 RequestDumperValve[/ilt]: header=referer=http://dkoesxp/ilt/ilt/iltUpload.do;jsessionid=3048D443AD 4341273FB5FED42958E7C4 2004-10-28 10:59:43 RequestDumperValve[/ilt]: header=user-agent=Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20041001 Firefox/0.10.1 2004-10-28 10:59:43 RequestDumperValve[/ilt]: header=cookie=com.skillsoft.mgs.sso.RedirectorServlet.ReturnToSkillPort= http://dkoesxp/djk/home/index.cfm?selectdTab=0; CFMX_JSESSIONID=c8301990451098975559821; CFID=19459; CFTOKEN=98634115 2004-10-28 10:59:43 RequestDumperValve[/ilt]: header=content-length=340147 2004-10-28 10:59:43 RequestDumperValve[/ilt]: header=content-type=multipart/form-data; boundary=---41184676334 2004-10-28 10:59:43 RequestDumperValve[/ilt]: header=accept-encoding=gzip,deflate 2004-10-28 10:59:43 RequestDumperValve[/ilt]: header=accept-charset=ISO-8859-1,utf-8;q=0.7,*;q=0.7 2004-10-28 10:59:43 RequestDumperValve[/ilt]: header=keep-alive=300 2004-10-28 10:59:43 RequestDumperValve[/ilt]: locale=en_US 2004-10-28 10:59:43 RequestDumperValve[/ilt]: method=POST 2004-10-28 10:59:43 RequestDumperValve[/ilt]: pathInfo=null 2004-10-28 10:59:43 RequestDumperValve[/ilt]: protocol=HTTP/1.1 2004-10-28 10:59:43 RequestDumperValve[/ilt]: queryString=null 2004-10-28 10:59:43 RequestDumperValve[/ilt]: remoteAddr=10.20.3.42 2004-10-28 10:59:43 RequestDumperValve[/ilt]: remoteHost=10.20.3.42 2004-10-28 10:59:43 RequestDumperValve[/ilt]: remoteUser=null 2004-10-28 10:59:43 RequestDumperValve[/ilt]: requestedSessionId=3048D443AD4341273FB5FED42958E7C4 2004-10-28 10:59:43 RequestDumperValve[/ilt]: scheme=http 2004-10-28 10:59:43 RequestDumperValve[/ilt]: serverName=dkoesxp 2004-10-28 10:59:43 RequestDumperValve[/ilt]: serverPort=80 2004-10-28 10:59:43 RequestDumperValve[/ilt]: servletPath=/ilt/iltPerformUpload.do 2004-10-28 10:59:43 RequestDumperValve[/ilt]: isSecure=false 2004-10-28 10:59:43 RequestDumperValve[/ilt]: --- 2004-10-28 10:59:43 StandardWrapperValve[action]: Servlet.service() for servlet action threw exception org.apache.commons.fileupload.FileUploadException: Processing of multipart/form-data request failed. \WEB-INF\ilt\temp\upload_0001.tmp (The system cannot find the path specified) at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase .java:429) at
RE: Loading Oracle Driver Problems
You have the same problem that a number of people stumbled on last week. Finally, the problem was solved after days of struggle. Please find the Tomcat configuration procedure in the attachment. Contact me if you have further questions. --- David Short [EMAIL PROTECTED] wrote: Copy the Oracle JDBC classes file classes12.zip (rename to classes12.jar) into your Tomcat\common\lib directory. -Original Message- From: Peter Shankey [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 22, 2004 8:44 AM To: Tomcat Users List Subject: Loading Oracle Driver Problems Use Tomcat version 5.0.19 with Oracle 9.2.0.4 I have tried to follow the Tomcat instruction but somewhere along the line I have missed something: 1) I have copied all jar files from $ORACLE_HOME/jdbc/lib to $CATALINA_HOME/common/lib 2) Here is the web.xml file: resource-ref descriptionOracle Datasource example/description res-ref-namejdbc/myoracle/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref 3) Here is the server.xml file, I put this section between the Host tags in the xml file: Resource name=jdbc/myoracle auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/myoracle parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value /parameter parameter nameurl/name valuejdbc:oracle:thin:@192.168.1.101:1521:to1/value /parameter parameter nameusername/name valuetest/value /parameter parameter namepassword/name valuetest/value /parameter parameter namemaxActive/name value20/value /parameter parameter namemaxIdle/name value10/value /parameter parameter namemaxWait/name value-1/value /parameter /ResourceParams 4) Here is the bean I am trying to use: package mybean; import java.beans.*; import java.io.Serializable; import javax.naming.Context; import javax.naming.InitialContext; import javax.sql.DataSource; import java.sql.Connection; import java.sql.*; public class testDBConn extends Object implements Serializable { public testDBConn() throws Exception { Context initContext = new InitialContext(); Context envContext = (Context)initContext.lookup(java:/comp/env); DataSource ds = (DataSource)envContext.lookup(jdbc/myoracle); Connection conn = ds.getConnection(); } } The error I keep receiving is: MonitorFilter::javax.servlet.ServletException: Cannot create JDBC driver of class '' for connect URL 'null', cause: No suitable driver I am unsure where I am dropping the ball on this issue If you have any ideas please let me know. Thanks Pete - 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] ___ Do you Yahoo!? Declare Yourself - Register online to vote today! http://vote.yahoo.comTomcat 5.0.27, j2sdk1.4.2 and Windows XP, Oracle 9i Step 1. DBCP uses the Jakarta-Commons Database Connection Pool. It relies on number of Jakarta-Commons componenets: Jakarta-Commons DBCP 1.2.1 Jakarta-Commons Collections 2.1.1 Jakarta-Commons Pool 1.2 These jar files along with your the jar file for your JDBC driver should be installed in $CATALINA_HOME/common/lib. NOTE:Third Party drivers should be in jarfiles, not zipfiles. Tomcat only adds $CATALINA_HOME/common/lib/*.jar to the classpath. Step 2. download the most up-to-date version of the classes12.zip rename it to classes12.jar http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.htm and place it in TOMCAT_HOME\common\lib Step 3. check the read and execute access to the classes12.jar file (by right-click on the file and look for 'properties') Step 4. C:\jakarta-tomcat-5.0.27\conf\server.xml configuration Note: I added the following code in between the realm .../ element and the Host element. DefaultContext Resource name=jdbc/OracleDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/OracleDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namemaxWait/name value-1/value /parameter parameter namemaxActive/name value20/value /parameter parameter namepassword/name valueyour
RE: Help on database and server configuration
Please find the Tomcat 5.0.27 connection pool configuration procedure in the attachment. --- Ben Souther [EMAIL PROTECTED] wrote: If you have a specific question, or can't figure out an entry in your log files, feel free to ask. On Tue, 2004-09-21 at 09:33, Shanti Priya wrote: Hi ben!! I have gone through that,but it's not that useful for me as i have a bug with my database setups.As already suggested by the other user i set up the classes12.zip in lib also.Please help me out. thanks shanti -Original Message- From: Ben Souther [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 21, 2004 6:53 PM To: Tomcat Users List Subject: Re: Help on database and server configuration Hereyougo... http://jakarta.apache.org/tomcat/tomcat-5.0-doc/index.html On Tue, 2004-09-21 at 09:23, Shanti Priya wrote: Hi!! I have an application war file with me,that has to be installed on local tomcat5.It's developed using jsp/struts and oracle is the database.I basically use remote database and plz help me out in setting the server configurations and all. Thanks Regards, Shanti Priya Sunkara Location: Pune, India Email : [EMAIL PROTECTED] - 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] - 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] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com Tomcat 5.0.27, j2sdk1.4.2 and Windows XP, Oracle 9i Step 1. DBCP uses the Jakarta-Commons Database Connection Pool. It relies on number of Jakarta-Commons componenets: Jakarta-Commons DBCP 1.2.1 Jakarta-Commons Collections 2.1.1 Jakarta-Commons Pool 1.2 These jar files along with your the jar file for your JDBC driver should be installed in $CATALINA_HOME/common/lib. NOTE:Third Party drivers should be in jarfiles, not zipfiles. Tomcat only adds $CATALINA_HOME/common/lib/*.jar to the classpath. Step 2. download the most up-to-date version of the classes12.zip rename it to classes12.jar http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.htm and place it in TOMCAT_HOME\common\lib Step 3. check the read and execute access to the classes12.jar file (by right-click on the file and look for 'properties') Step 4. C:\jakarta-tomcat-5.0.27\conf\server.xml configuration Note: I added the following code in between the realm .../ element and the Host element. DefaultContext Resource name=jdbc/OracleDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/OracleDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namemaxWait/name value5000/value /parameter parameter namemaxActive/name value20/value /parameter parameter namepassword/name valueyour password/value /parameter parameter nameurl/name valuejdbc:oracle:thin:@172.19.47.22:1521:SystemID/value /parameter parameter namedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value /parameter parameter namemaxIdle/name value10/value /parameter parameter nameusername/name valueyour username/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter nameremoveAbandonedTimeout/name value60/value /parameter parameter namelogAbandoned/name valuetrue/value /parameter /ResourceParams /DefaultContext Step 5. web.xml Configuration (the one in MyApp/WEB-INF directory) add these lines after the taglib element ** resource-ref descriptionOracle Datasource/description res-ref-namejdbc/OracleDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem configuring a global resource to be linked from Context elements ....
Hi, Yoav. I have not yet solved my Tomcat 5.0.27 CP configuration problem. Yesterday, you said that the Tomcat log should not show it looked for MySQL driver when I am trying to connect to the Oracle 9i driver. It turned out that there is another application in the webapps looking for the MySQL driver. My current application does not look for the MySQL driver. A nice person really look into my configuration and my code and he said he does not see any obvious mistakes that other people have made. He is still helping digging into my CP configuration connection to the Oracle 9i. --- Shapira, Yoav [EMAIL PROTECTED] wrote: Hi, Maybe there really is a bug in the Tomcat release you're using: which one are you trying? Yoav Shapira Millennium Research Informatics -Original Message- From: Jonathan Rengifo [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 15, 2004 9:08 PM To: Tomcat User List Subject: Problem configuring a global resource to be linked from Context elements Hi all This is the third time I've write a message to the list asking for the same issue, but didn't solve it, I am starting to think about this is a really bug in Tomcat 5. My question is ... Why when I configure a Resource inside the GlobalNamingResources element just to ResourceLink it inside the context it just doesn't work, throwing an exception like this ... org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'oracle.jdbc.driver.OracleDriver' This means to me that the oracle driver I am using is could no be found, but then, why when I cut the Resource and paste it inside every Context I use it just work fine???... Please help How do I configure this global resource?? Here is how I am setting this up... GlobalNamingResources Resource name=jdbc/app auth=Container scope=Shareable type=javax.sql.DataSource/ ResourceParams name=jdbc/app parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter nameurl/name valuejdbc:oracle:thin:@myDatabaseServer:port:user/value /parameter parameter namepassword/name valuemyPassword/value /parameter parameter namemaxActive/name value20/value /parameter parameter namemaxWait/name value-1/value /parameter parameter namedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value /parameter parameter nameusername/name valuemyUser/value /parameter parameter namemaxIdle/name value10/value /parameter /ResourceParams /GlobalNamingResources Thanks .. Jonathan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail is new and improved - Check it out! http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Server.xml configuration problem
Hi, yours is working now. Mine is not. I missed the steps. Could you post your server.xml file please? Thanks. --- LINGALA, AMARESHWAR G (SBCSI) [EMAIL PROTECTED] wrote: It is working now, All I have to do is put the resource params inside of the DefaultContext Thanks for all your help !!! -Original Message- From: Jukka Uusisalo [mailto:[EMAIL PROTECTED] Sent: Thursday, September 16, 2004 1:50 PM To: Tomcat Users List Subject: Re: Server.xml configuration problem Hi, Your datasource jdbc/myOracle must be inside some Context element or DefaultContext element like DefaultContext Resource name=jdbc/myDataSource auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/myDataSource parameter namefactory/namen valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter !-- Add other resourceparams -- /DefaultContext Default context element is inside Host element. And also there have be reference in your application web.xml like resource-ref descriptionDatasource for my app/description res-ref-namejdbc/myDataSource/res-ref-name res-typejavax.sql.DataSource/res-type res-authcontainer/res-auth /resource-ref - Jukka - - Original Message - From: LINGALA, AMARESHWAR G (SBCSI) [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Thursday, September 16, 2004 9:21 PM Subject: RE: Server.xml configuration problem Can you please be more specific, I tried to follow up the documents but am unable to fix the bug. Can you please send me the example of the change? I would be very much thankful to you. I am assuming that Resource name=jdbc/myoracle auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/myoracle Should make the tomcat recognise the database. Thanks Amar -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Thursday, September 16, 2004 1:12 PM To: Tomcat Users List Subject: RE: Server.xml configuration problem Hi, You need to add an explicit Context element for your webapp, and inside it a ResourceLink element to make the GlobalNamingResources DataSource visible to your webapp. Check the configuration reference document for GlobalNamingResourcs and ResourceLink for details. Yoav Shapira Millennium Research Informatics -Original Message- From: LINGALA, AMARESHWAR G (SBCSI) [mailto:[EMAIL PROTECTED] Sent: Thursday, September 16, 2004 2:04 PM To: Tomcat Users List Subject: Server.xml configuration problem Hi, I am trying to set-up Connection pooling for my web application, I have made the following modifications to my server.xml file. !-- Example Server Configuration File -- !-- Note that component elements are nested corresponding to their parent-child relationships with each other -- !-- A Server is a singleton element that represents the entire JVM, which may contain one or more Service instances. The Server listens for a shutdown command on the indicated port. Note: A Server is not itself a Container, so you may not define subcomponents such as Valves or Loggers at this level. -- Server port=8005 shutdown=SHUTDOWN debug=0 !-- Comment these entries out to disable JMX MBeans support -- !-- You may also configure custom components (e.g. Valves/Realms) by including your own mbean-descriptor file(s), and setting the descriptors attribute to point to a ';' seperated list of paths (in the ClassLoader sense) of files to add to the default list. e.g. descriptors=/com/myfirm/mypackage/mbean-descriptor.xml -- Listener className=org.apache.catalina.mbeans.ServerLifecycleListener debug=0/ Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener debug=0/ !-- Global JNDI resources -- GlobalNamingResources !-- Test entry for demonstration purposes -- Environment name=simpleValue type=java.lang.Integer value=30/ !-- Editable user database that can also be used by UserDatabaseRealm to authenticate users -- Resource name=UserDatabase auth=Container type=org.apache.catalina.UserDatabase description=User database that can be updated and saved /Resource ResourceParams name=UserDatabase parameter namefactory/name valueorg.apache.catalina.users.MemoryUserDatabaseFactory/value /parameter parameter namepathname/name valueconf/tomcat-users.xml/value /parameter /ResourceParams !-- Modified by Amar Lingala on 09/15/04 -- Resource name=jdbc/myoracle auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/myoracle parameter namefactory/name
Att Is Needed Badly: (Several People Are Reporting exactly the Same Problem)Tomcat 5.0.27 CP Configuration
, check your file permissions and be sure Tomcat has read access to your class12.jar. Lastly, is this the most recent version of the Oracle JDBC driver? --David Caroline Jen wrote: I have been struggling with this problem for more than a week. I did follow the JDBC datasource howto. And I posted all the steps that I have taken to configure the Tomcat 5.0.27 connection pool. Nobody has really helped to look into the problem. Tomcat 5.0.27, j2sdk1.4.2, Oracle 10i, Windows XP I will post all my configuration steps again below the error message. The Tomcat logs file shows: == root cause org.dhsinfo.content.exceptions.PageDAOSysException: SQLException: Cannot create JDBC driver of class '' for connect URL 'null' org.dhsinfo.content.dao.OraclePageDAO.findPages(OraclePageDAO.java:51) org.dhsinfo.content.PageService.getPages(PageService.java:18) org.dhsinfo.content.SelectPage.execute(SelectPage.java:29) = The configuration steps that I have taken are listed below: Step 1. Jakarta-Commons DBCP 1.2.1 Jakarta-Commons Collections 2.1.1 Jakarta-Commons Pool 1.2 These jar files are installed in $CATALINA_HOME/common/lib. Step 2. download classes12.zip rename it to classes12.jar and place it in TOMCAT_HOME\common\lib Step 3. C:\jakarta-tomcat-5.0.27\conf\server.xml configuration I did put the driver and URL in the C:\jakarta-tomcat-5.0.27\conf\server.xml file (The code shown below is inserted between the Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=localhost_log. suffix=.txt timestamp=true/ and the closing /Host tag). Context path=/DBTest docBase=DBTest debug=5 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_DBTest_log. suffix=.txt timestamp=true/ Resource name=jdbc/OracleDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/OracleDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namemaxWait/name value5000/value /parameter parameter namemaxActive/name value20/value /parameter parameter namepassword/name valuecmis001/value /parameter parameter nameurl/name valuejdbc:oracle:thin:@172.19.47.22:1521:devora2/value /parameter parameter namedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value /parameter parameter namemaxIdle/name value10/value /parameter parameter nameusername/name valuecmis/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter nameremoveAbandonedTimeout/name value60/value /parameter parameter namelogAbandoned/name valuetrue/value /parameter /ResourceParams /Context Step 4. web.xml Configuration (the one in MyApp/WEB-INF directory) add these lines after the taglib element ** resource-ref descriptionOracle Datasource/description res-ref-namejdbc/OracleDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref ** --- Peng Tuck Kwok [EMAIL PROTECTED] wrote: On Tue, 14 Sep 2004 13:56:48 -0700 (PDT), Caroline Jen [EMAIL PROTECTED] wrote: When I configured the Tomcat 5.0.27, I did put the driver and URL in the C:\jakarta-tomcat-5.0.27\conf\server.xml file (The That's great, but did you actually put the driver in a location that tomcat could find it ? Like here: $CATALINA_HOME/common/lib ? Dump your driver there (make sure it's a jar file), restart tomcat. Check out the jdbc datasource howto if you've missed anything else. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] === message truncated === __ Do you Yahoo!? Yahoo! Mail is new and improved - Check it out! http://promotions.yahoo.com/new_mail2004-09-14 16:27:33 StandardContext[/balancer]org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com
Tomcat Connection Pool Configuration Problem (Cannot Establish the Connection)
Sorry about my previous posting. Now, I have got better trace of my JDBC connection problem. I am using the Tomcat 5.0.27, j2sdk1.4.2, Oracle 10i, Windows XP. The error message is: == root cause org.dhsinfo.content.exceptions.PageDAOSysException: SQLException: Cannot create JDBC driver of class '' for connect URL 'null' org.dhsinfo.content.dao.OraclePageDAO.findPages(OraclePageDAO.java:51) org.dhsinfo.content.PageService.getPages(PageService.java:18) org.dhsinfo.content.SelectPage.execute(SelectPage.java:29) org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525) javax.servlet.http.HttpServlet.service(HttpServlet.java:709) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) When I configured the Tomcat 5.0.27, I did put the driver and URL in the C:\jakarta-tomcat-5.0.27\conf\server.xml file (The location is below the Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=localhost_log. suffix=.txt timestamp=true/ and before the closing /Host tag). Please help me to see the problem: [code] Context path=/DBTest docBase=DBTest debug=5 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_DBTest_log. suffix=.txt timestamp=true/ Resource name=jdbc/OracleDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/OracleDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namemaxWait/name value5000/value /parameter parameter namemaxActive/name value20/value /parameter parameter namepassword/name valuecmis001/value /parameter parameter nameurl/name valuejdbc:oracle:thin:@172.19.47.22:1521:devora2/value /parameter parameter namedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value /parameter parameter namemaxIdle/name value10/value /parameter parameter nameusername/name valuecmis/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter nameremoveAbandonedTimeout/name value60/value /parameter parameter namelogAbandoned/name valuetrue/value /parameter /ResourceParams /Context [/code] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat Connection Pool Configuration Problem (Cannot Establish the Connection)
I have been struggling with this problem for more than a week. I did follow the JDBC datasource howto. And I posted all the steps that I have taken to configure the Tomcat 5.0.27 connection pool. Nobody has really helped to look into the problem. I will post all my configuration steps again below the error message. The Tomcat logs file shows: == root cause org.dhsinfo.content.exceptions.PageDAOSysException: SQLException: Cannot create JDBC driver of class '' for connect URL 'null' org.dhsinfo.content.dao.OraclePageDAO.findPages(OraclePageDAO.java:51) org.dhsinfo.content.PageService.getPages(PageService.java:18) org.dhsinfo.content.SelectPage.execute(SelectPage.java:29) = The configuration steps that I have taken are listed below: Step 1. Jakarta-Commons DBCP 1.2.1 Jakarta-Commons Collections 2.1.1 Jakarta-Commons Pool 1.2 These jar files are installed in $CATALINA_HOME/common/lib. Step 2. download classes12.zip rename it to classes12.jar and place it in TOMCAT_HOME\common\lib Step 3. C:\jakarta-tomcat-5.0.27\conf\server.xml configuration I did put the driver and URL in the C:\jakarta-tomcat-5.0.27\conf\server.xml file (The location is below the Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=localhost_log. suffix=.txt timestamp=true/ and before the closing /Host tag). Context path=/DBTest docBase=DBTest debug=5 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_DBTest_log. suffix=.txt timestamp=true/ Resource name=jdbc/OracleDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/OracleDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namemaxWait/name value5000/value /parameter parameter namemaxActive/name value20/value /parameter parameter namepassword/name valuecmis001/value /parameter parameter nameurl/name valuejdbc:oracle:thin:@172.19.47.22:1521:devora2/value /parameter parameter namedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value /parameter parameter namemaxIdle/name value10/value /parameter parameter nameusername/name valuecmis/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter nameremoveAbandonedTimeout/name value60/value /parameter parameter namelogAbandoned/name valuetrue/value /parameter /ResourceParams /Context Step 4. web.xml Configuration (the one in MyApp/WEB-INF directory) add these lines after the taglib element ** resource-ref descriptionOracle Datasource/description res-ref-namejdbc/OracleDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref ** --- Peng Tuck Kwok [EMAIL PROTECTED] wrote: On Tue, 14 Sep 2004 13:56:48 -0700 (PDT), Caroline Jen [EMAIL PROTECTED] wrote: When I configured the Tomcat 5.0.27, I did put the driver and URL in the C:\jakarta-tomcat-5.0.27\conf\server.xml file (The That's great, but did you actually put the driver in a location that tomcat could find it ? Like here: $CATALINA_HOME/common/lib ? Dump your driver there (make sure it's a jar file), restart tomcat. Check out the jdbc datasource howto if you've missed anything else. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat Connection Pool Configuration Problem (Cannot Establish the Connection)
I have been struggling with this problem for more than a week. I did follow the JDBC datasource howto. And I posted all the steps that I have taken to configure the Tomcat 5.0.27 connection pool. Nobody has really helped to look into the problem. Tomcat 5.0.27, j2sdk1.4.2, Oracle 10i, Windows XP I will post all my configuration steps again below the error message. The Tomcat logs file shows: == root cause org.dhsinfo.content.exceptions.PageDAOSysException: SQLException: Cannot create JDBC driver of class '' for connect URL 'null' org.dhsinfo.content.dao.OraclePageDAO.findPages(OraclePageDAO.java:51) org.dhsinfo.content.PageService.getPages(PageService.java:18) org.dhsinfo.content.SelectPage.execute(SelectPage.java:29) = The configuration steps that I have taken are listed below: Step 1. Jakarta-Commons DBCP 1.2.1 Jakarta-Commons Collections 2.1.1 Jakarta-Commons Pool 1.2 These jar files are installed in $CATALINA_HOME/common/lib. Step 2. download classes12.zip rename it to classes12.jar and place it in TOMCAT_HOME\common\lib Step 3. C:\jakarta-tomcat-5.0.27\conf\server.xml configuration I did put the driver and URL in the C:\jakarta-tomcat-5.0.27\conf\server.xml file (The code shown below is inserted between the Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=localhost_log. suffix=.txt timestamp=true/ and the closing /Host tag). Context path=/DBTest docBase=DBTest debug=5 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_DBTest_log. suffix=.txt timestamp=true/ Resource name=jdbc/OracleDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/OracleDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namemaxWait/name value5000/value /parameter parameter namemaxActive/name value20/value /parameter parameter namepassword/name valuecmis001/value /parameter parameter nameurl/name valuejdbc:oracle:thin:@172.19.47.22:1521:devora2/value /parameter parameter namedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value /parameter parameter namemaxIdle/name value10/value /parameter parameter nameusername/name valuecmis/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter nameremoveAbandonedTimeout/name value60/value /parameter parameter namelogAbandoned/name valuetrue/value /parameter /ResourceParams /Context Step 4. web.xml Configuration (the one in MyApp/WEB-INF directory) add these lines after the taglib element ** resource-ref descriptionOracle Datasource/description res-ref-namejdbc/OracleDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref ** --- Peng Tuck Kwok [EMAIL PROTECTED] wrote: On Tue, 14 Sep 2004 13:56:48 -0700 (PDT), Caroline Jen [EMAIL PROTECTED] wrote: When I configured the Tomcat 5.0.27, I did put the driver and URL in the C:\jakarta-tomcat-5.0.27\conf\server.xml file (The That's great, but did you actually put the driver in a location that tomcat could find it ? Like here: $CATALINA_HOME/common/lib ? Dump your driver there (make sure it's a jar file), restart tomcat. Check out the jdbc datasource howto if you've missed anything else. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat Connection Pool Configuration Problem (Cannot Establish the Connection)
Help may be truly needed. A couple of more people are reporting the exactly the same problem with the Tomcat 5.0.27 at http://java.sun.com -- Forums -- JDBC I am not the only one having this problem. --- Caroline Jen [EMAIL PROTECTED] wrote: I have been struggling with this problem for more than a week. I did follow the JDBC datasource howto. And I posted all the steps that I have taken to configure the Tomcat 5.0.27 connection pool. Nobody has really helped to look into the problem. I will post all my configuration steps again below the error message. The Tomcat logs file shows: == root cause org.dhsinfo.content.exceptions.PageDAOSysException: SQLException: Cannot create JDBC driver of class '' for connect URL 'null' org.dhsinfo.content.dao.OraclePageDAO.findPages(OraclePageDAO.java:51) org.dhsinfo.content.PageService.getPages(PageService.java:18) org.dhsinfo.content.SelectPage.execute(SelectPage.java:29) = The configuration steps that I have taken are listed below: Step 1. Jakarta-Commons DBCP 1.2.1 Jakarta-Commons Collections 2.1.1 Jakarta-Commons Pool 1.2 These jar files are installed in $CATALINA_HOME/common/lib. Step 2. download classes12.zip rename it to classes12.jar and place it in TOMCAT_HOME\common\lib Step 3. C:\jakarta-tomcat-5.0.27\conf\server.xml configuration I did put the driver and URL in the C:\jakarta-tomcat-5.0.27\conf\server.xml file (The location is below the Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=localhost_log. suffix=.txt timestamp=true/ and before the closing /Host tag). Context path=/DBTest docBase=DBTest debug=5 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_DBTest_log. suffix=.txt timestamp=true/ Resource name=jdbc/OracleDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/OracleDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namemaxWait/name value5000/value /parameter parameter namemaxActive/name value20/value /parameter parameter namepassword/name valuecmis001/value /parameter parameter nameurl/name valuejdbc:oracle:thin:@172.19.47.22:1521:devora2/value /parameter parameter namedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value /parameter parameter namemaxIdle/name value10/value /parameter parameter nameusername/name valuecmis/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter nameremoveAbandonedTimeout/name value60/value /parameter parameter namelogAbandoned/name valuetrue/value /parameter /ResourceParams /Context Step 4. web.xml Configuration (the one in MyApp/WEB-INF directory) add these lines after the taglib element ** resource-ref descriptionOracle Datasource/description res-ref-namejdbc/OracleDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref ** --- Peng Tuck Kwok [EMAIL PROTECTED] wrote: On Tue, 14 Sep 2004 13:56:48 -0700 (PDT), Caroline Jen [EMAIL PROTECTED] wrote: When I configured the Tomcat 5.0.27, I did put the driver and URL in the C:\jakarta-tomcat-5.0.27\conf\server.xml file (The That's great, but did you actually put the driver in a location that tomcat could find it ? Like here: $CATALINA_HOME/common/lib ? Dump your driver there (make sure it's a jar file), restart tomcat. Check out the jdbc datasource howto if you've missed anything else. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ Do you Yahoo!? Declare Yourself - Register online to vote today! http://vote.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OFF-TOPIC]Yoav -- RE: Some pretty basic Tomcat ConnectionPooling Questions????
I saw your Tomcat connection pool class. Your class opens and gets a 'conn' object from the connection pool. Where in your code returns the 'conn' object for use? Should there be a statemenet like: return conn; somewhere? 1. Declaration of private global variables: code private Context ctx = null; private DataSource ds = null; private Connection conn; /code 2. an init() method: code // init does DataSource lookup public void init(ServletConfig config) throws ServletException { super.init(config); try { ctx = new InitialContext(); if(ctx == null) { throw new Exception(No Context); } ds = (DataSource)ctx.lookup(java:comp/env/jdbc/mb); } // end try block catch(Exception e) { e.printStackTrace(); } } // end init() /code 3. an openConnection() method: code private void openConnection() { try { if(ds != null) { conn = ds.getConnection(); if(conn != null) { message = Got Connection to DB + conn.toString(); } } } // end try block catch(Exception e) { e.printStackTrace(); } } //end method openConnection() /code 4. a destroy() method that nulls the DataSource: code public void destroy() { ds = null; } /code --- Luke (Terry) Vanderfluit [EMAIL PROTECTED] wrote: Hi Yoav and all, Thanks for your reply, But you went a bit too far: the DataSource lookup is potentially expensive. That you can do in the init() method and keep a reference to the DataSource, because keeping that reference doesn't use a connection resource. Then in your servlet methods, get a connection from the DataSource, use it, and release it. In your servlet destroy method, null out your DataSource reference. So the DataSource lookup is done once, the DataSource reference is kept as a private non-static member variable of the servlet class, and the Connenctions are used only within methods, they're not class member variables. So now I have changed my code to: 1. Declaration of private global variables: code private Context ctx = null; private DataSource ds = null; private Connection conn; /code 2. an init() method: code // init does DataSource lookup public void init(ServletConfig config) throws ServletException { super.init(config); try { ctx = new InitialContext(); if(ctx == null) { throw new Exception(No Context); } ds = (DataSource)ctx.lookup(java:comp/env/jdbc/mb); } // end try block catch(Exception e) { e.printStackTrace(); } } // end init() /code 3. an openConnection() method: code private void openConnection() { try { if(ds != null) { conn = ds.getConnection(); if(conn != null) { message = Got Connection to DB + conn.toString(); } } } // end try block catch(Exception e) { e.printStackTrace(); } } //end method openConnection() /code 4. a destroy() method that nulls the DataSource: code public void destroy() { ds = null; } /code remarks -the conn.close() is called in the methods that call openConnection(). -I'm thinking of doing an 'include' for the openConnection method, so I don't have the code for the same method sitting in multiple classes. Would that be a good idea? (maintainability, yes but in terms of overhead?) /remarks Would this be the 'leanest' scenario for a database connection? thanks again, Luke -- Luke (Terry) Vanderfluit Mobile: 0421 276 282 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat Connection Pool
I do not quite understand the message A Context element will not get you far, no matter what its contents. But let's assume you actually have a docBase and path at least, and just typed shorthand. Do you mean that I should delete the open and closing Context tag? --- Shapira, Yoav [EMAIL PROTECTED] wrote: Hi, A Context element will not get you far, no matter what its contents. But let's assume you actually have a docBase and path at least, and just typed shorthand. When you can't start tomcat, look at the logs. They will have error messages that tell you what's wrong. Yoav Shapira Millennium Research Informatics -Original Message- From: Caroline Jen [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 08, 2004 5:26 PM To: [EMAIL PROTECTED] Subject: Tomcat Connection Pool I do not know what is going on. I am using the Tomcat 5.0.27 in the Windows XP environment. I insert the following code right before the /Host element in the $TOMCAT/conf/server.xml file; i.e. inside the Host element and right before its closing tag. I re-boot my computer, and then, I cannot start the Tomcat. I removed the segment of code shown below; then, Tomcat functions normally. What is wrong? Context Resource name=jdbc/OracleDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/OracleDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namemaxWait/name value5000/value /parameter parameter namemaxActive/name value20/value /parameter parameter namepassword/name valuecmis001/value /parameter parameter nameurl/name valuejdbc:oracle:thin:@172.19.47.22:1521:devora2/value /parameter parameter namedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value /parameter parameter namemaxIdle/name value10/value /parameter parameter nameusername/name valuecmis/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter nameremoveAbandonedTimeout/name value60/value /parameter parameter namelogAbandoned/name valuetrue/value /parameter /ResourceParams /Context __ Do you Yahoo!? Yahoo! Mail is new and improved - Check it out! http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail is new and improved - Check it out! http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat Connection Pool
I removed the opening and closing Context tag and inserted the following code inside the Host element of the C:\jakarta-tomcat-5.0.27\conf\server.xml file (right before the closing /Host tag). The Tomcat can be started again. Is it the correct way of configuring Tomcat for using connection pool? code: Resource name=jdbc/OracleDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/OracleDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namemaxWait/name value5000/value /parameter parameter namemaxActive/name value20/value /parameter parameter namepassword/name valuecmis001/value /parameter parameter nameurl/name valuejdbc:oracle:thin:@172.19.47.22:1521:devora2/value /parameter parameter namedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value /parameter parameter namemaxIdle/name value10/value /parameter parameter nameusername/name valuecmis/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter nameremoveAbandonedTimeout/name value60/value /parameter parameter namelogAbandoned/name valuetrue/value /parameter /ResourceParams -- --- Shapira, Yoav [EMAIL PROTECTED] wrote: Hi, No, I mean a Context element with no docBase and path attributes is cruising for a bruising at best. Yoav Shapira Millennium Research Informatics -Original Message- From: Caroline Jen [mailto:[EMAIL PROTECTED] Sent: Thursday, September 09, 2004 9:17 AM To: Tomcat Users List Subject: RE: Tomcat Connection Pool I do not quite understand the message A Context element will not get you far, no matter what its contents. But let's assume you actually have a docBase and path at least, and just typed shorthand. Do you mean that I should delete the open and closing Context tag? --- Shapira, Yoav [EMAIL PROTECTED] wrote: Hi, A Context element will not get you far, no matter what its contents. But let's assume you actually have a docBase and path at least, and just typed shorthand. When you can't start tomcat, look at the logs. They will have error messages that tell you what's wrong. Yoav Shapira Millennium Research Informatics -Original Message- From: Caroline Jen [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 08, 2004 5:26 PM To: [EMAIL PROTECTED] Subject: Tomcat Connection Pool I do not know what is going on. I am using the Tomcat 5.0.27 in the Windows XP environment. I insert the following code right before the /Host element in the $TOMCAT/conf/server.xml file; i.e. inside the Host element and right before its closing tag. I re-boot my computer, and then, I cannot start the Tomcat. I removed the segment of code shown below; then, Tomcat functions normally. What is wrong? Context Resource name=jdbc/OracleDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/OracleDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namemaxWait/name value5000/value /parameter parameter namemaxActive/name value20/value /parameter parameter namepassword/name valuecmis001/value /parameter parameter nameurl/name valuejdbc:oracle:thin:@172.19.47.22:1521:devora2/value /parameter parameter namedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value /parameter parameter namemaxIdle/name value10/value /parameter parameter nameusername/name valuecmis/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter nameremoveAbandonedTimeout/name value60/value /parameter parameter namelogAbandoned/name valuetrue/value /parameter /ResourceParams /Context __ Do you Yahoo!? Yahoo! Mail is new and improved - Check it out! http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments
Tomcat Connection Pool
I do not know what is going on. I am using the Tomcat 5.0.27 in the Windows XP environment. I insert the following code right before the /Host element in the $TOMCAT/conf/server.xml file; i.e. inside the Host element and right before its closing tag. I re-boot my computer, and then, I cannot start the Tomcat. I removed the segment of code shown below; then, Tomcat functions normally. What is wrong? Context Resource name=jdbc/OracleDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/OracleDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namemaxWait/name value5000/value /parameter parameter namemaxActive/name value20/value /parameter parameter namepassword/name valuecmis001/value /parameter parameter nameurl/name valuejdbc:oracle:thin:@172.19.47.22:1521:devora2/value /parameter parameter namedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value /parameter parameter namemaxIdle/name value10/value /parameter parameter nameusername/name valuecmis/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter nameremoveAbandonedTimeout/name value60/value /parameter parameter namelogAbandoned/name valuetrue/value /parameter /ResourceParams /Context __ Do you Yahoo!? Yahoo! Mail is new and improved - Check it out! http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Configuring Tomcat 5.0.27 for JNDI (with the McKoi Database)
I am sort of stuck with configuring the server.xml file under the $TOMCAT\conf directory for JNDI. For the Tomcat 4.x, I put the following block of code; i.e. DefaultContext right after the ending /context element and before the ending /host element in the server.xml file. However, I do not see the context element in the Tomcat 5.0.27. There is the host element, though. [code] DefaultContext Resource name=jdbc/McKoiDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/McKoiDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namedriverClassName/name value/value /parameter parameter nameurl/name valuejdbc:mckoi://localhost:/databasename?autoReconnect=true/value /parameter parameter nameusername/name valuejavauser/value /parameter parameter namepassword/name valuejavadude/value /parameter parameter namemaxActive/name value20/value /parameter parameter namemaxIdle/name value30/value /parameter parameter namemaxWait/name value1/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter nameremoveAbandonedTimeout/name value60/value /parameter parameter namelogAbandoned/name valuetrue/value /parameter /ResourceParams /DefaultContext [/code] 1. Where should I put the DefaultContext in the server.xml file? 2. What is the value I should give to the driverClassName parameter? 3. What is the port number I should give to the url parameter? i.e. jdbc:mckoi://localhost:/DatabaseName?autoReconnect=true ___ Do you Yahoo!? Win 1 of 4,000 free domain names from Yahoo! Enter now. http://promotions.yahoo.com/goldrush - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Configuring Tomcat 5.0.27 for JNDI (with the McKoi Database)
I am sort of stuck with configuring the server.xml file under the $TOMCAT\conf directory for JNDI. For the Tomcat 4.x, I put the following block of code; i.e. DefaultContext right after the ending /context element and before the ending /host element in the server.xml file. However, I do not see the context element in the Tomcat 5.0.27. There is the host element, though. [code] DefaultContext Resource name=jdbc/McKoiDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/McKoiDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namedriverClassName/name valuecom.mckoi.JDBCDriver/value /parameter parameter nameurl/name valuejdbc:mckoi://localhost:/databasename?autoReconnect=true/value /parameter parameter nameusername/name valuejavauser/value /parameter parameter namepassword/name valuejavadude/value /parameter parameter namemaxActive/name value20/value /parameter parameter namemaxIdle/name value30/value /parameter parameter namemaxWait/name value1/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter nameremoveAbandonedTimeout/name value60/value /parameter parameter namelogAbandoned/name valuetrue/value /parameter /ResourceParams /DefaultContext [/code] 1. Where should I put the DefaultContext in the server.xml file? 2. What is the port number I should give to the url parameter? i.e. jdbc:mckoi://localhost:/DatabaseName?autoReconnect=true __ Do you Yahoo!? Yahoo! Mail is new and improved - Check it out! http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Configuring Tomcat 5.0.27 for JNDI (with the McKoi Database)
Thanks for replying. I am building only one webapp. What does create a proper Context element instead of DefaultContext mean? Thanks --- Shapira, Yoav [EMAIL PROTECTED] wrote: Hi, You should put DefaultContext inside a Host. But if you only have one webapp, create a proper Context element for it instead of DefaultContext. The JDBC driver class name is supplied in your vendor documentation (in this case McKoi). A common one is com.mckoi.JDBCDriver. The port number is whatever port your database is listening on. Ask your DBA if you're not sure. Yoav Shapira Millennium Research Informatics -Original Message- From: Caroline Jen [mailto:[EMAIL PROTECTED] Sent: Friday, September 03, 2004 3:09 PM To: [EMAIL PROTECTED] Subject: Configuring Tomcat 5.0.27 for JNDI (with the McKoi Database) I am sort of stuck with configuring the server.xml file under the $TOMCAT\conf directory for JNDI. For the Tomcat 4.x, I put the following block of code; i.e. DefaultContext right after the ending /context element and before the ending /host element in the server.xml file. However, I do not see the context element in the Tomcat 5.0.27. There is the host element, though. [code] DefaultContext Resource name=jdbc/McKoiDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/McKoiDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namedriverClassName/name value/value /parameter parameter nameurl/name valuejdbc:mckoi://localhost:/databasename?autoReconnect=true/val ue /parameter parameter nameusername/name valuejavauser/value /parameter parameter namepassword/name valuejavadude/value /parameter parameter namemaxActive/name value20/value /parameter parameter namemaxIdle/name value30/value /parameter parameter namemaxWait/name value1/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter nameremoveAbandonedTimeout/name value60/value /parameter parameter namelogAbandoned/name valuetrue/value /parameter /ResourceParams /DefaultContext [/code] 1. Where should I put the DefaultContext in the server.xml file? 2. What is the value I should give to the driverClassName parameter? 3. What is the port number I should give to the url parameter? i.e. jdbc:mckoi://localhost:/DatabaseName?autoReconnect=true ___ Do you Yahoo!? Win 1 of 4,000 free domain names from Yahoo! Enter now. http://promotions.yahoo.com/goldrush - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat 5.0.27 and the McKoi Database
The web server that I use is the Tomcat 5.0.27. I have been working with the MySQL database all the time. All of a sudden, I am told to use the McKoi database. Do I need a connector to establish JDBC connection? How do I configure the Tomcat to use connection pool? __ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: security-constraint question
First of all, I am not sure that you need realm-name in teh web.xml if you user form-based authentication. You may use getRemoteUser() to get the name of the user. --- Giselle Dazzi [EMAIL PROTECTED] wrote: Hi everybody, Im using the security-constraint feature of Tomcat. Everything works well, but I dont know how to retrieve the login entered during authentication to use it throughout my application... Have you guys done this before ? thx My login page is specified in my web.xml: login-config auth-methodFORM/auth-method realm-nameAutenticacao/realm-name form-login-config form-login-page/login.jsp/form-login-page form-error-page/errorpage.html/form-error-page /form-login-config /login-config __ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JDBC Connection question
Which server do you use? Weblogic, Websphere, ... support connection pooling. --- Carlos Pereira [EMAIL PROTECTED] wrote: You can only run one transaction per connection. Also, your DBMS may support a limited number of threads per connection. (Wade Chandler) Ok. So, using one connection for the whole application is out of question. My other alternatives are connection pooling and using one connection per user. The server is supposed to have between 300/1000 people online at a time. I'm sure my question is very basic, but i want to know: what does it mean to have 1000 concurrent connections to the database (lets forget the dbms connection limit, just performance)? Please use a connection pool. For Instruction: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html and http://www.mysql.com/articles/connection_pooling_with_connectorj.html (Caroline Jen) I read it all. Connection pooling looks like the solution for all my problems. But, i had to configure server.xml to put it working. What about when i have to deploy the application? And if the server is NOT Tomcat, will it support connection pooling? Best regards, Carlos Pereira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JDBC Connection question
Please use a connection pool. For Instruction: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html and http://www.mysql.com/articles/connection_pooling_with_connectorj.html --- Carlos Pereira [EMAIL PROTECTED] wrote: Hi list, my application currently uses ONE connection object to communicate with the database. The connection is set with an initializer servlet (load_on_stratup=0), and all users use that connection to retrieve data. Is this the best approach, or should i create a connection per user? Why? Where can i know more? The security system works on top of the database, so that's not a problem. I'm more concerned with performance and concurrency. Regards and thanks, Carlos Pereira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat JDBCRealm And security-constraint in the web.xml
I am lost. Right now, I have Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=com.mysql.jdbc.Driver connectionURL=jdbc:mysql://localhost:3306/artimus? user=javauseramp;password=javadude userTable=members userNameCol=user_name userCredCol=user_password userRoleTable=user_roles roleNameCol=user_role/ in the Host element. The UserDataTable is in the Engine element and is commented out like this: !-- Realm className=org.apache.catalina.realm.UserDatabaseRealm debug=0 resourceName=UserDatabase/ -- For the JDBCRealm applies to my application only, your advice is that I should configure within the Context element like this: Context path=/myapp docBase=myapp Realm className=org.apache.catalina.realm.JDBCRealm . / Do you mean that I should also move UserDatabaseRealm from Engine to Host? And I should not comment it out? -Caroline /Context --- Adam Hardy [EMAIL PROTECTED] wrote: On 10/13/2003 07:56 AM Bill Barker wrote: Caroline Jen [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Tim: Before I posted my questions regarding the problem that I encountered, I have gone through http://jakarta.apache.org/tomcat/tomcat-4.1-doc/realm-howto.html#Configuring%20a%20Realm As long as I have the JDBCRealm in the server.xml, the Tomcat does not accept security-constraint specified in the application's web.xml file. And the Tomcat cannot find my application. Following your advice, I moved the Realm declaration outside of the Context declaration into the Host declaration, and my problem is solved. Nonetheles, you also said refine the Realm in each context where it is needed. I really want the JDBCRealm applies to my application only. My question is how do I do it? If what is below is accurate, then your Context is configured wrong. It needs to be: Context path=/myapp docBase=myapp Realm className=org.apache.catalina.realm.JDBCRealm . / /Context You should probably also leave e.g. the UserDatabaseRealm configured under the Host, so that other Contexts (i.e. admin manager) have a Realm to use. By configuring your own Realm under your Context, it will override the one defined in the Host. As long as you configure a 'manager' role for the superuser in your realm, then the superuser can happily login to use admin manager - if that fits in with the security requirements of course. That's what I do. But then I am project manager, chief developer, webmaster and DBA for my current project (I should say that more often, it makes Monday mornings great! Just don't tell anyone I'm working for myself :) ). Currently, my JDBCRealm looks like: Engine Host Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=com.mysql.jdbc.Driver connectionURL=jdbc:mysql://localhost:3306/artimus? user=javauseramp;password=javadude userTable=members userNameCol=user_name userCredCol=user_password userRoleTable=user_roles roleNameCol=user_role/ Context . /Context /Host /Engine --Caroline My configuration in the $TOMCAT_HOME/conf/sever.xml is shown below: Engine Host Context Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=com.mysql.jdbc.Driver connectionURL=jdbc:mysql://localhost:3306/artimus user=javauserpassword=javadude userTable=members userNameCol=user_name userCredCol=user_password userRoleTable=user_roles roleNameCol=user_role/ /Context /Host /Engine --- Tim Funk [EMAIL PROTECTED] wrote: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/realm-howto.html#Configuring%20a%20Realm -Tim Caroline Jen wrote: Tim: Would you explain refine the Realm in each context where it is needed? -Caroline --- Tim Funk [EMAIL PROTECTED] wrote: Move the Realm declaration outside of the Context declaration into the Host declaration. Or refine the Realm in each context where it is needed. -Tim Caroline Jen wrote: My applications behave wierd after I configured the JDBCRealm. After experimenting in many different ways, I found that as long as I have the JDBCRealm in the server.xml, the Tomcat does not accept security-constraint specified in the application's web.xml file. Please help me. My configuration in the $TOMCAT_HOME/conf/sever.xml is shown below: Engine Host Context Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=com.mysql.jdbc.Driver connectionURL=jdbc:mysql://localhost:3306/artimus user=javauserpassword=javadude userTable=members userNameCol=user_name userCredCol=user_password userRoleTable=user_roles
Re: Tomcat JDBCRealm And security-constraint in the web.xml
Tim: Would you explain refine the Realm in each context where it is needed? -Caroline --- Tim Funk [EMAIL PROTECTED] wrote: Move the Realm declaration outside of the Context declaration into the Host declaration. Or refine the Realm in each context where it is needed. -Tim Caroline Jen wrote: My applications behave wierd after I configured the JDBCRealm. After experimenting in many different ways, I found that as long as I have the JDBCRealm in the server.xml, the Tomcat does not accept security-constraint specified in the application's web.xml file. Please help me. My configuration in the $TOMCAT_HOME/conf/sever.xml is shown below: Engine Host Context Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=com.mysql.jdbc.Driver connectionURL=jdbc:mysql://localhost:3306/artimus user=javauserpassword=javadude userTable=members userNameCol=user_name userCredCol=user_password userRoleTable=user_roles roleNameCol=user_role/ /Context /Host /Engine - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat JDBCRealm And security-constraint in the web.xml
Tim: Before I posted my questions regarding the problem that I encountered, I have gone through http://jakarta.apache.org/tomcat/tomcat-4.1-doc/realm-howto.html#Configuring%20a%20Realm As long as I have the JDBCRealm in the server.xml, the Tomcat does not accept security-constraint specified in the application's web.xml file. And the Tomcat cannot find my application. Following your advice, I moved the Realm declaration outside of the Context declaration into the Host declaration, and my problem is solved. Nonetheles, you also said refine the Realm in each context where it is needed. I really want the JDBCRealm applies to my application only. My question is how do I do it? Currently, my JDBCRealm looks like: Engine Host Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=com.mysql.jdbc.Driver connectionURL=jdbc:mysql://localhost:3306/artimus? user=javauseramp;password=javadude userTable=members userNameCol=user_name userCredCol=user_password userRoleTable=user_roles roleNameCol=user_role/ Context . /Context /Host /Engine --Caroline My configuration in the $TOMCAT_HOME/conf/sever.xml is shown below: Engine Host Context Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=com.mysql.jdbc.Driver connectionURL=jdbc:mysql://localhost:3306/artimus user=javauserpassword=javadude userTable=members userNameCol=user_name userCredCol=user_password userRoleTable=user_roles roleNameCol=user_role/ /Context /Host /Engine --- Tim Funk [EMAIL PROTECTED] wrote: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/realm-howto.html#Configuring%20a%20Realm -Tim Caroline Jen wrote: Tim: Would you explain refine the Realm in each context where it is needed? -Caroline --- Tim Funk [EMAIL PROTECTED] wrote: Move the Realm declaration outside of the Context declaration into the Host declaration. Or refine the Realm in each context where it is needed. -Tim Caroline Jen wrote: My applications behave wierd after I configured the JDBCRealm. After experimenting in many different ways, I found that as long as I have the JDBCRealm in the server.xml, the Tomcat does not accept security-constraint specified in the application's web.xml file. Please help me. My configuration in the $TOMCAT_HOME/conf/sever.xml is shown below: Engine Host Context Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=com.mysql.jdbc.Driver connectionURL=jdbc:mysql://localhost:3306/artimus user=javauserpassword=javadude userTable=members userNameCol=user_name userCredCol=user_password userRoleTable=user_roles roleNameCol=user_role/ /Context /Host /Engine - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat JDBCRealm And security-constraint in the web.xml
My applications behave wierd after I configured the JDBCRealm. After experimenting in many different ways, I found that as long as I have the JDBCRealm in the server.xml, the Tomcat does not accept security-constraint specified in the application's web.xml file. Please help me. My configuration in the $TOMCAT_HOME/conf/sever.xml is shown below: Engine Host Context Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=com.mysql.jdbc.Driver connectionURL=jdbc:mysql://localhost:3306/artimus user=javauserpassword=javadude userTable=members userNameCol=user_name userCredCol=user_password userRoleTable=user_roles roleNameCol=user_role/ /Context /Host /Engine What happened is: First, I have an application artimus_1_1 that had worked well before JDBCRealm was inserted in the server.xml. Now, whenever I run the same application, I get: HTTP Status 404 -/artimus_1_1 description: The requested resource(/artimus_1_1) is not availabe. The web.xml of the application artimus_1_1 has security-constraint element in it and uses BASIC to authenticate users (i.e. the roles of the users are stored in the $TOMCAT_HOME/conf/tomcat-users.xml.) Second, I am working on another application. And I want to user FORM-based container-managed authentication for this application. I had login-config auth-methodFORM/auth-method form-login-config form-login-page/signin/logon.jsp/form-login-page form-error-page/signin/logon.jsp?error=true/form-error-page /form-login-config /login-config in the web.xml file and I had JDBCRealm in the $TOMCAT_HOME/conf/server.xml. I was able to display the welcome page. Thereafter,I inserted security-constraint preceding the login-config element, and inserted security-role following the login-config element. The application stops functioning. I get: HTTP Status 404 -/PracticeVersion description: The requested resource(/PracticeVersion) is not availabe. in the browser, and I have this message in the Tomcat log file (the Tomcat log file can be found in the attachment): LifecycleException: Container StandardContext[/PracticeVersion] has not been started This is what my PracticeVersion/WEB-INF/web.xml looks like when the problem happens (nothing is wrong with the specification and order of the tags): security-constraint web-resource-collection web-resource-nameAdministrative/web-resource-name !-- The URLs to protect -- url-pattern/do/admin/*/url-pattern /web-resource-collection auth-constraint !-- The authorized users -- role-nameadministrator/role-name role-nameeditor/role-name role-namecontributor/role-name role-nameadvisor/role-name /auth-constraint /security-constraint login-config auth-methodFORM/auth-method form-login-config form-login-page/signin/logon.jsp/form-login-page form-error-page/signin/error.jsp/form-error-page /form-login-config /login-config security-role role-nameadministrator/role-name /security-role security-role role-nameadvisor/role-name /security-role security-role role-nameeditor/role-name /security-role security-role role-namecontributor/role-name /security-role __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com2003-10-11 22:30:16 WebappLoader[]: Deploying class repositories to work directory C:\jakarta-tomcat-4.1.18-LE-jdk14\work\Standalone\localhost\_ 2003-10-11 22:30:16 WebappLoader[]: Deploy class files /WEB-INF/classes to C:\jakarta-tomcat-4.1.18-LE-jdk14\webapps\ROOT\WEB-INF\classes 2003-10-11 22:30:16 StandardManager[]: Seeding random number generator class java.security.SecureRandom 2003-10-11 22:30:16 StandardManager[]: Seeding of random number generator has been completed 2003-10-11 22:30:16 StandardWrapper[:default]: Loading container servlet default 2003-10-11 22:30:16 StandardWrapper[:invoker]: Loading container servlet invoker 2003-10-11 22:30:16 HostConfig[localhost]: Deploying configuration descriptor admin.xml 2003-10-11 22:30:17 HostConfig[localhost]: Deploying configuration descriptor manager.xml 2003-10-11 22:30:17 WebappLoader[/manager]: Deploying class repositories to work directory C:\jakarta-tomcat-4.1.18-LE-jdk14\work\Standalone\localhost\manager 2003-10-11 22:30:17 ContextConfig[/manager]: No Realm has been configured to authenticate against 2003-10-11 22:30:17 ContextConfig[/manager]: Marking this application unavailable due to previous error(s) 2003-10-11 22:30:17 StandardManager[/manager]: Seeding random number generator class java.security.SecureRandom 2003-10-11 22:30:17 StandardManager[/manager]: Seeding of random number generator has been completed 2003-10-11 22:30:18 StandardContext[/manager]: Context startup failed due to previous errors 2003-10-11 22:30:18 HostConfig[localhost]: Expanding web
Re: Could Not Start The Tomcat Server After Commenting Out Realm in the server.xml For Using JDBCRealm
Tim, sorry, I do not understand Since you didn't replace your connection information with the dummy JDBCRealm placeholder, the connection failed to the database. Now, I am testing the Tomcat using the existing code in the server.xml file by simply removing the surroundinging !-- and --. (I understand what you said about amp;) I could not start the Tomcat server. 1) I put !-- and -- around the UserDababaseRealm as shown below: !-- Realm className=org.apache.catalina.realm.UserDatabaseRealm debug=0 resourceName=UserDatabase/ -- 2) I removed the !-- and -- around the JDBCRealm for MySql (I do not insert any of my code, I simply use the existing code in the server.xml). See below: Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=org.gjt.mm.mysql.Driver connectionURL=jdbc:mysql://localhost/authority connectionName=test connectionPassword=test userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=user_roles roleNameCol=role_name / I saved the file and I could not start the Tomcat server. -Caroline --- Tim Funk [EMAIL PROTECTED] wrote: Tomcat won't start up if the Realm can't start up. Since you didn't replace your connection information with the dummy JDBCRealm placeholder, the connection failed to the database. As for the , in your connection string in your older email had: connectionURL=jdbc:mysql://localhost:3306/artimus?user=javauserpassword=javadude Which should be: connectionURL=jdbc:mysql://localhost:3306/artimus?user=javauseramp;password=javadude -Tim Caroline Jen wrote: Thanks for your reply. I tried the following: 1) I put !-- and -- around the UserDababaseRealm shown below: !-- Realm className=org.apache.catalina.realm.UserDatabaseRealm debug=0 resourceName=UserDatabase/ -- 2) I removed the !-- and -- around the JDBCRealm for MySql (I did not insert any of my code, I simply use the existing code in the server.xml) and I do not see any in that section of code. See below: Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=org.gjt.mm.mysql.Driver connectionURL=jdbc:mysql://localhost/authority connectionName=test connectionPassword=test userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=user_roles roleNameCol=role_name / I saved the file and I could not start the Tomcat server. I then reverted everything back, the Tomcat server works as normal. Wondering what is going on? -Caroline --- Tim Funk [EMAIL PROTECTED] wrote: 1) For simplicity, did you coment out the UserDatabaseRealm when placing your JDBCRealm at the same level? 2) Make sure the are encoded as amp; Otherwise - you xml document is not valid. -Tim Caroline Jen wrote: I encountered this problem: I followed the instructions on using the JDBCRealm (http://jakarta.apache.org/tomcat/tomcat-4.1-doc/realm-howto.html). I prepared userTable and userRoleTable tables. However, I could not start the Tomcat server after I inserted [CODE] Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=com.mysql.jdbc.Driver connectionURL=jdbc:mysql://localhost:3306/artimus?user=javauserpassword=javadude userTable=members userNameCol=user_name userCredCol=user_password userRoleTable=user_roles roleNameCol=user_role/ [/CODE] within the Engine tag in the $CATALINA_HOME/conf/server.xml file. I first inserted the aforementioned Realm within the context tag in the $CATALINA_HOME/conf/server.xml and I was unable to start the Tomcat server. I then moved the Realm inside the Engine tag, but it did not help. By the way, do you think the user and password given in the JDBCRealm are correct? I configured database username and password for use by Tomcat in the $CATALINA_HOME/conf/server.xml in the following way and I have used this database many times without problem. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Could Not Start The Tomcat Server After Commenting Out Realm in the server.xml For Using JDBCRealm
Tim, thanks for your help. The server workes now. --- Tim Funk [EMAIL PROTECTED] wrote: If your realm declaration is: Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=org.gjt.mm.mysql.Driver connectionURL=jdbc:mysql://localhost/authority connectionName=test connectionPassword=test userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=user_roles roleNameCol=role_name / Then tomcat will try to connect to localhost for the database authority with the user id and password being test. (If I read the props above correctly). If that connection fails when the Realm is created (which is at tomcat startup) - then tomcat will not startup. -Tim Caroline Jen wrote: Tim, sorry, I do not understand Since you didn't replace your connection information with the dummy JDBCRealm placeholder, the connection failed to the database. Now, I am testing the Tomcat using the existing code in the server.xml file by simply removing the surroundinging !-- and --. (I understand what you said about amp;) I could not start the Tomcat server. 1) I put !-- and -- around the UserDababaseRealm as shown below: !-- Realm className=org.apache.catalina.realm.UserDatabaseRealm debug=0 resourceName=UserDatabase/ -- 2) I removed the !-- and -- around the JDBCRealm for MySql (I do not insert any of my code, I simply use the existing code in the server.xml). See below: Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=org.gjt.mm.mysql.Driver connectionURL=jdbc:mysql://localhost/authority connectionName=test connectionPassword=test userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=user_roles roleNameCol=role_name / I saved the file and I could not start the Tomcat server. -Caroline - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Could Not Start The Tomcat Server After Commenting Out Realm in the server.xml For Using JDBCRealm
I encountered this problem: I followed the instructions on using the JDBCRealm (http://jakarta.apache.org/tomcat/tomcat-4.1-doc/realm-howto.html). I prepared userTable and userRoleTable tables. However, I could not start the Tomcat server after I inserted [CODE] Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=com.mysql.jdbc.Driver connectionURL=jdbc:mysql://localhost:3306/artimus?user=javauserpassword=javadude userTable=members userNameCol=user_name userCredCol=user_password userRoleTable=user_roles roleNameCol=user_role/ [/CODE] within the Engine tag in the $CATALINA_HOME/conf/server.xml file. I first inserted the aforementioned Realm within the context tag in the $CATALINA_HOME/conf/server.xml and I was unable to start the Tomcat server. I then moved the Realm inside the Engine tag, but it did not help. By the way, do you think the user and password given in the JDBCRealm are correct? I configured database username and password for use by Tomcat in the $CATALINA_HOME/conf/server.xml in the following way and I have used this database many times without problem. [CODE] DefaultContext Resource name=jdbc/MySQLDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/MySQLDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namedriverClassName/name valuecom.mysql.jdbc.Driver/value /parameter parameter nameurl/name valuejdbc:mysql://localhost:3306/artimus?autoReconnect=true/value /parameter parameter nameusername/name valuejavauser/value /parameter parameter namepassword/name valuejavadude/value /parameter parameter namemaxActive/name value20/value /parameter parameter namemaxIdle/name value30/value /parameter parameter namemaxWait/name value1/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter nameremoveAbandonedTimeout/name value60/value /parameter parameter namelogAbandoned/name valuetrue/value /parameter /ResourceParams /DefaultContext [/CODE] __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Could Not Start The Tomcat Server After Commenting Out Realm in the server.xml For Using JDBCRealm
Thanks for your reply. I tried the following: 1) I put !-- and -- around the UserDababaseRealm shown below: !-- Realm className=org.apache.catalina.realm.UserDatabaseRealm debug=0 resourceName=UserDatabase/ -- 2) I removed the !-- and -- around the JDBCRealm for MySql (I did not insert any of my code, I simply use the existing code in the server.xml) and I do not see any in that section of code. See below: Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=org.gjt.mm.mysql.Driver connectionURL=jdbc:mysql://localhost/authority connectionName=test connectionPassword=test userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=user_roles roleNameCol=role_name / I saved the file and I could not start the Tomcat server. I then reverted everything back, the Tomcat server works as normal. Wondering what is going on? -Caroline --- Tim Funk [EMAIL PROTECTED] wrote: 1) For simplicity, did you coment out the UserDatabaseRealm when placing your JDBCRealm at the same level? 2) Make sure the are encoded as amp; Otherwise - you xml document is not valid. -Tim Caroline Jen wrote: I encountered this problem: I followed the instructions on using the JDBCRealm (http://jakarta.apache.org/tomcat/tomcat-4.1-doc/realm-howto.html). I prepared userTable and userRoleTable tables. However, I could not start the Tomcat server after I inserted [CODE] Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=com.mysql.jdbc.Driver connectionURL=jdbc:mysql://localhost:3306/artimus?user=javauserpassword=javadude userTable=members userNameCol=user_name userCredCol=user_password userRoleTable=user_roles roleNameCol=user_role/ [/CODE] within the Engine tag in the $CATALINA_HOME/conf/server.xml file. I first inserted the aforementioned Realm within the context tag in the $CATALINA_HOME/conf/server.xml and I was unable to start the Tomcat server. I then moved the Realm inside the Engine tag, but it did not help. By the way, do you think the user and password given in the JDBCRealm are correct? I configured database username and password for use by Tomcat in the $CATALINA_HOME/conf/server.xml in the following way and I have used this database many times without problem. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]