Tomcat and jdk1.3 or jdk1.4
are there different Tomcat-5.0.25-Downloads for jdk1.3 and jdk1.4 available? Which java-packages are missing in the Version for jdk1.4? Thanks, Holger de Wall - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat and DataSource JNDI
Hi Doug, it works on my Linux (Kernel 2.4.19), JVM 1.3.1 and Tomcat 5.0.19 (with context.xml in META-INF/) and Tomcat 4.1.29 with the ResourceLink in the Context in the server.xml. But it doesn'nt work, when I start the Tomcat with this CATALINA_OPTS: -Djava.naming.factory.initial=com.sun.jndi.fscontext.RefFSContextFactory -Djava.naming.provider.url=file:/jdbcpool/ifxpool We need this file-based DataSource for DB-Connections to an Informix Dynamic Server 9.30. from the StackTrace: - javax.naming.NamingException: Cannot create resource instance at org.apache.naming.factory.ResourceEnvFactory.getObjectInstance(ResourceEnvFactory.java:146) ... --- What are the necessary JNDI-Properties getting a DataSource from Tomcat? Holger Several questions: What version of Tomcat is this? What platform/OS are you on? Which JDK version? Typically this error is from a mis-configuration for the jndi. Here are my configuration files or parts of for my development box. First in the server.xml set up a GlobalResource such as this: GlobalNamingResources Environment name=simpleValue type=java.lang.Integer value=30/ Resource name=jdbc/GolfDB type=javax.sql.DataSource/ ResourceParams name=jdbc/GolfDB parameter namevalidationQuery/name valueselect 1/value /parameter parameter nameurl/name valuejdbc:mysql://localhost:3306/golf?autoReconnect=true/value /parameter parameter nameusername/name value**/value /parameter parameter namepassword/name value**/value /parameter parameter namemaxActive/name value30/value /parameter parameter namemaxWait/name value5000/value /parameter parameter namedriverClassName/name valuecom.mysql.jdbc.Driver/value /parameter parameter namemaxIdle/name value2/value /parameter /ResourceParams /GlobalNamingResources Of course replace the necesary data with your specifics. Next place this, at the bottom, in your web.xml for the app: resource-ref descriptionGolfDB Connection/description res-ref-namejdbc/GolfDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref For TC5: Now create a file in the META-INF directory. Name the file context.xml. In this file you will need to define the context and the link to the jdbc. For TC4: Add this to the server.xml Context className=org.apache.catalina.core.StandardContext cachingAllowed=true charsetMapperClass=org.apache.catalina.util.CharsetMapper cookies=true crossContext=true debug=0 displayName=golf docBase=golf mapperClass=org.apache.catalina.core.StandardContextMapper path=/golf privileged=false reloadable=false swallowOutput=false useNaming=true wrapperClass=org.apache.catalina.core.StandardWrapper ResourceLink name=jdbc/GolfDB global=jdbc/GolfDB type=javax.sql.DataSource/ /Context My application is deployed with the manager from a war file named golf.war The resource name is jdbc/GolfDB and I am running against a MySQL database. Make sure all the names match exactly as this will cause many bumps from banging you head. Adjust other setting to match your needs. I am on TAO linux, Tomcat 5.0.19 /4.1.29 And JVM 1.4.2_04-b05. Doug www.parsonstechnical.com - Original Message - From: Paul Richards [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, April 13, 2004 3:03 PM Subject: Tomcat and DataSource JNDI Hi, I am running Tomcat from the Java Webservices Developer Pack 1.3 and I cannot get JNDI working for mysql DataSource objects. I have googled around for my error which is: java.sql.SQLException: Cannot load JDBC driver class 'null' at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.ja v a:529) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java: 3 29) What I found on google was that this error is not just a problem with Mysql and that people have experienced it with Oracle and Postgresql also: http://archives.real-time.com/pipermail/tomcat-users/2002-October/081368.ht ml I tried the suggestion in this last URL of using the exact orderings of parameters in the server.xml file as shown in the Tomcat JNDI DataSource HowTo. Unfortunately this has not helped my case. I appreciate that a very similar thread to this is currently running but that problem looks different to mine. I have failover code which created a Mysql datasource manually if the JNDI fails and the failover code works perfectly. This makes me sure that my CLASSPATHs are correct. -- Holger de Wall LKV-SH, Steenbeker Weg 151, Kiel 24106 Tel. : +049 431-33987-38 Fax : +049 431-33987-20
JNDI ResourceEnvFactory
Hi, How must CATALINA_OPTS be set, that the ctx.lookup(java:comp/env...) is successfull ? when I tried to get a database connection via a JNDI DataSource described in the Tomcat documentation (ctx.lookup(java:comp/env/...)), I get schnipp javax.naming.NamingException: Cannot create resource instance at org.apache.naming.factory.ResourceEnvFactory.getObjectInstance(ResourceEnvFactory.java:146) ---schnapp--- The problem is, that we have to start tomcat with CATALINA_OPTS= -Djava.naming.factory.initial=com.sun.jndi.fscontext.RefFSContextFactory -Djava.naming.provider.url=file:/somepath/poolfile Holger de Wall - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Apache + Tomcat RH Setup
you will see it, after this commandline: rpm -ev apache-1.3.12-25 mod_ssl-2.6.6-25 mod_perl-1.24-4 Also, I need to get an apache rpm uninstalled. rpm -e apache-1.3.12-25 error: removing these packages would break dependencies: apache = 1.3.12-25 is needed by mod_ssl-2.6.6-25 webserver is needed by mod_perl-1.24-4 Are these other packages needed by anything else? --- the solution depends on the 'boot concept' of your Linux-Distribution. if you have 'insserv', their are helpfull tipps in `man insserv`. You will find something about the 'boot concept in `man init.d` I have been reading through John's HOWTO to get these operating together (with the latest release versions, which I do not think will matter for this question...) and noticed that he says to start Tomcat before Apache and wait at least 15 seconds. I have read similar things from time to time, so I am guessing its pretty important. If I wanted to set these up to start on the system boot, via the run levels (/etc/rc.d/rc3.d etc...) how should I setup those links. Such as S84Tomcatd and S85Apached (linked to scripts in /etc/init.d). Would that make sure that tomcat is started before apache? If I wanted to setup the links in /etc/rc.d/rc6.d would apached have to shut down before tomcat? If I wanted to restart tomcat, for any reason during system runtime, would I have to shut down apache, shut down tomcat, start tomcat, start apache? If I wanted to restart apache, what needs to be done? -- Holger de Wall LKV-SH, Steenbeker Weg 151, Kiel 24106 Tel. : +049 431-33987-38 Fax : +049 431-33987-20 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: help: want to encrypt Tomcat user passwords
Hy, I am using jdbcrealm to store the username and passwords in the Oracle 9I database. But th passwords are stored as plain Texts. I want to encrypt the passwords. How can I do it? Is there any InBuilt feature in Tomcat? look at http://localhost:8080/tomcat-docs/realm-howto.html#Digested%20Passwords for creating encrypted passwords on STDOUT. then alter the table users: alter table users add user_md5 varchar(255,20); insert the encrypted password from STDOUT put the 'digest'-attribute in the Realm-section and change the attribute userCredCol: Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=yourOracle-driver connectionURL=yourAuthorityDb; connectionName=tomcat connectionPassword=tomcat userTable=users userNameCol=user_name userCredCol=user_md5 userRoleTable=user_roles roleNameCol=role_name digest=MD5 / -- Holger de Wall LKV-SH, Steenbeker Weg 151, Kiel 24106 Tel. : +049 431-33987-38 Fax : +049 431-33987-20 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JDBCRealm through a firewall
Hi, it works now. :-) The reconnect function of Tomcat 4.1.29 works, when there is really no jdbc-connection from tomcat to the database. Therefore we changed the timeout settings in the firewall that the 'connction' timeout has the same value as the 'absolute' timeout an the 'half-close' timeout was modified to 0 seconds. After this changes the JDBCRealm became able to check if there is a jdbc-connection available or not and can try to reconnect. I think 4.1.29's JDBCRealm tried to reconnect on failure. our firewall (Cisco PIX 506) seems to be the reason for a 'java.sql.Exception' given by the JDBCRealm: - -- 2003-11-13 09:46:28 JDBCRealm[dmz.domain]: Exception performing authentication java.sql.SQLException: System or internal error ... - -- The Tomcat 4.1.24 with our webapplication stays on the DMZ outside the firewall. The Database (the server for our JDBCRealm) stays behind the firewall, which let pass the TCP-Requests through the Port 'myport', we set in the 'connectionURL'. Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=com.informix.jdbc.IfxDriver connectionURL=jdbc:informix-sqli://ip-address-inside:myport/upload:i nformixserver=myserver connectionName=tomcat connectionPassword=tomcat userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=user_roles roleNameCol=role_name / If the Servlet-Engine on the DMZ don't get any authentication-requests for about one hour, the Cisco Pix doesn't detect any traffic on this established connection. Therefore (security reasons) the Pix kills the Realm-Connection from the DMZ to the Database, what is the only reason for a broken and unusable JDBCRealm. How can we force the Servlet-Engine to establish a new Realm-Connection to the Database without a restarting the complete Tomcat-Server ? -- Holger de Wall LKV-SH, Steenbeker Weg 151, Kiel 24106 Tel. : +049 431-33987-38 Fax : +049 431-33987-20 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JDBCRealm through a firewall
I think 4.1.29's JDBCRealm tried to reconnect on failure. we upgrade to Tomcat 4.1.29 because I heard about a new ErrorRecovery function in the JDBCRealm. Which Parameter in which xml-file is responsible for this feature. our firewall (Cisco PIX 506) seems to be the reason for a 'java.sql.Exception' given by the JDBCRealm: - -- 2003-11-13 09:46:28 JDBCRealm[dmz.domain]: Exception performing authentication java.sql.SQLException: System or internal error ... - -- The Tomcat 4.1.24 with our webapplication stays on the DMZ outside the firewall. The Database (the server for our JDBCRealm) stays behind the firewall, which let pass the TCP-Requests through the Port 'myport', we set in the 'connectionURL'. Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=com.informix.jdbc.IfxDriver connectionURL=jdbc:informix-sqli://ip-address-inside:myport/upload:i nformixserver=myserver connectionName=tomcat connectionPassword=tomcat userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=user_roles roleNameCol=role_name / If the Servlet-Engine on the DMZ don't get any authentication-requests for about one hour, the Cisco Pix doesn't detect any traffic on this established connection. Therefore (security reasons) the Pix kills the Realm-Connection from the DMZ to the Database, what is the only reason for a broken and unusable JDBCRealm. How can we force the Servlet-Engine to establish a new Realm-Connection to the Database without a restarting the complete Tomcat-Server ? Holger de Wall LKV-SH, Steenbeker Weg 151, Kiel 24106 Tel. : +049 431-33987-38 Fax : +049 431-33987-20 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JDBCRealm through a firewall
Hallo, How can we force the Servlet-Engine to establish a new Realm-Connection to the Database without a restarting the complete Tomcat-Server ? I think 4.1.29's JDBCRealm tried to reconnect on failure. it wasn't the solution :-( Holger de Wall - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JDBCRealm through a firewall
BITTE DURCHSEHEN our firewall (Cisco PIX 506) seems to be the reason for a 'java.sql.Exception' given by the JDBCRealm: --- 2003-11-13 09:46:28 JDBCRealm[dmz.domain]: Exception performing authentication java.sql.SQLException: System or internal error ... --- The Tomcat 4.1.24 with our webapplication stays on the DMZ outside the firewall. The Database (the server for our JDBCRealm) stays behind the firewall, which let pass the TCP-Requests through the Port 'myport', we set in the 'connectionURL'. Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=com.informix.jdbc.IfxDriver connectionURL=jdbc:informix-sqli://ip-address-inside:myport/upload:informixserver=myserver connectionName=tomcat connectionPassword=tomcat userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=user_roles roleNameCol=role_name / If the Servlet-Engine on the DMZ don't get any authentication-requests for about one hour, the Cisco Pix doesn't detect any traffic on this established connection. Therefore (security reasons) the Pix kills the Realm-Connection from the DMZ to the Database, what is the only reason for a broken and unusable JDBCRealm. How can we force the Servlet-Engine to establish a new Realm-Connection to the Database without a restarting the complete Tomcat-Server ? Holger de Wall - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]