Re: Newbie: Deploying .war file, getting it working with MySQL
I have finally fixed this problem. It was to do with the Resource tags name parameter in server.xml not matching the res-ref-name tag in the applications WEB-INF/web.xml file. Thanks for all the patient help I got here. Hugh Morgan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Newbie: Deploying .war file, getting it working with MySQL
I am tring to get an web site that I have developed with Java Studio Creator working on a VPS. I cannot get tomcat to comunicate with the MySQL database. I have got a minimal web site working, and I have added a simple dtabase query to it and I get the error at [1] (for full error see http://205.234.144.63:8080/minimal/). I have got a simple java app. working with MySQL. What I have done; Put the minimal.war file in /usr/local/jakarta/jakarta-tomcat-5.5.9/webapps. Put in a Context tag in server.xml file relating to the .war file [2]. This is expanded by tomcat. Put in a Realm tag relating to the jdbc driver [3]. Put the tag libarys in the correct place. You can see my .war file at http://www.geocities.com/hughmorgan72/minimal.zip. It requires a database called smsserver, with a table called unit, with a column called name. Versions; Apache Tomcat/5.5.9 Java Studio Creator 2004Q2 Version 9 Linux server.imecserver1.com 2.4.20-021stab028.24.777-enterprise #1 SMP Fri Jan 6 19:39:27 MSK 2006 i686 athlon i386 GNU/Linux Any suggestions? Thanks very much, my boss is breathing down my neck. [1] javax.servlet.ServletException: javax.servlet.jsp.JspException: javax.faces.FacesException: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' [2] Context path=/minimal docBase=minimal debug=0 reloadable=false crossContext=true /Context [3] Realm className=org.apache.catalina.realm.JDBCRealm driverName=com.mysql.jdbc.Driver connectionURL=jdbc:mysql://localhost/authority connectionName=root connectionPassword=ROOT_PASSWORD userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=user_roles roleNameCol=role_name / - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Newbie: Deploying .war file, getting it working with MySQL
Have you installed a mysql-connector? -- http://dev.mysql.com/downloads/connector/j/3.0.html - unpack - find a file called mysql-connector-java-..jar - copy this file into the common/lib directory of your Tomcat installation -- Franck I am tring to get an web site that I have developed with Java Studio Creator working on a VPS. I cannot get tomcat to comunicate with the MySQL database. I have got a minimal web site working, and I have added a simple dtabase query to it and I get the error at [1] (for full error see http://205.234.144.63:8080/minimal/). I have got a simple java app. working with MySQL. What I have done; Put the minimal.war file in /usr/local/jakarta/jakarta-tomcat-5.5.9/webapps. Put in a Context tag in server.xml file relating to the .war file [2]. This is expanded by tomcat. Put in a Realm tag relating to the jdbc driver [3]. Put the tag libarys in the correct place. You can see my .war file at http://www.geocities.com/hughmorgan72/minimal.zip. It requires a database called smsserver, with a table called unit, with a column called name. Versions; Apache Tomcat/5.5.9 Java Studio Creator 2004Q2 Version 9 Linux server.imecserver1.com 2.4.20-021stab028.24.777-enterprise #1 SMP Fri Jan 6 19:39:27 MSK 2006 i686 athlon i386 GNU/Linux Any suggestions? Thanks very much, my boss is breathing down my neck. [1] javax.servlet.ServletException: javax.servlet.jsp.JspException: javax.faces.FacesException: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' [2] Context path=/minimal docBase=minimal debug=0 reloadable=false crossContext=true /Context [3] Realm className=org.apache.catalina.realm.JDBCRealm driverName=com.mysql.jdbc.Driver connectionURL=jdbc:mysql://localhost/authority connectionName=root connectionPassword=ROOT_PASSWORD userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=user_roles roleNameCol=role_name / - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Dipl.-Hyd. Franck Borel Universitaetsbibliothek Freiburg EMail: [EMAIL PROTECTED] EDV-Dezernat Tel. : +49-761 / 203-3908 Werthmannplatz 2 | Postfach 1629 Fax : +49-761 / 203-3987 79098 Freiburg | 79016 Freiburg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Newbie: Deploying .war file, getting it working with MySQL
Franck Borel wrote: Have you installed a mysql-connector? -- http://dev.mysql.com/downloads/connector/j/3.0.html - unpack - find a file called mysql-connector-java-..jar - copy this file into the common/lib directory of your Tomcat installation -- Franck On the VPS there is already the file mysql-connector-java-3.0.15-ga-bin.jar in /usr/local/jakarta/jakarta-tomcat-5.5.9/common/lib/. I use this one in my test app and it works fine. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Newbie: Deploying .war file, getting it working with MySQL
Have you set the entry unpackWARs true like this ? Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false -- Franck Franck Borel wrote: Have you installed a mysql-connector? -- http://dev.mysql.com/downloads/connector/j/3.0.html - unpack - find a file called mysql-connector-java-..jar - copy this file into the common/lib directory of your Tomcat installation -- Franck On the VPS there is already the file mysql-connector-java-3.0.15-ga-bin.jar in /usr/local/jakarta/jakarta-tomcat-5.5.9/common/lib/. I use this one in my test app and it works fine. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Dipl.-Hyd. Franck Borel Universitaetsbibliothek Freiburg EMail: [EMAIL PROTECTED] EDV-Dezernat Tel. : +49-761 / 203-3908 Werthmannplatz 2 | Postfach 1629 Fax : +49-761 / 203-3987 79098 Freiburg | 79016 Freiburg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Newbie: Deploying .war file, getting it working with MySQL
Franck Borel wrote: Have you set the entry unpackWARs true like this ? Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false Yes, that is exactly what my Host tag looks like, and the war file is unpacked correctly; Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false Thanks for the help. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Newbie: Deploying .war file, getting it working with MySQL
Where did you place your Realm block? It must be placed inside the context block like this: Context .. Realm ./ /Context.. -- Franck Franck Borel wrote: Have you set the entry unpackWARs true like this ? Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false Yes, that is exactly what my Host tag looks like, and the war file is unpacked correctly; Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false Thanks for the help. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Dipl.-Hyd. Franck Borel Universitaetsbibliothek Freiburg EMail: [EMAIL PROTECTED] EDV-Dezernat Tel. : +49-761 / 203-3908 Werthmannplatz 2 | Postfach 1629 Fax : +49-761 / 203-3987 79098 Freiburg | 79016 Freiburg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Newbie: Deploying .war file, getting it working with MySQL
Franck Borel wrote: Where did you place your Realm block? It must be placed inside the context block like this: Context .. Realm ./ /Context.. I did not have it here, I had it in the Engine tag. I have now changed it, and stoped and restarted the server. I still get the same error. The relavent bit of my server.xml file looks like this - Engine name=Catalina defaultHost=localhost ... !-- Realm className=org.apache.catalina.realm.JDBCRealm driverName=com.mysql.jdbc.Driver connectionURL=jdbc:mysql://localhost/authority connectionName=root connectionPassword=ROOT_PASSWORD userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=user_roles roleNameCol=role_name / -- ... Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false Context path=/minimal docBase=minimal debug=0 reloadable=false crossContext=true Realm className=org.apache.catalina.realm.JDBCRealm driverName=com.mysql.jdbc.Driver connectionURL=jdbc:mysql://localhost/authority connectionName=root connectionPassword=ROOT_PASSWORD userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=user_roles roleNameCol=role_name / /Context - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Newbie: Deploying .war file, getting it working with MySQL
Try this: Context path=/minimal docBase=minimal debug=0 reloadable=false crossContext=true Resource name=jdbc/authority auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/authority parameternameusername/namevalueroot/value/parameter paramaternamepassword/namevalueROOT_PASSWORD/value/parameter parameternamedriverClassName/namevaluecom.mysql.jdbc.Driver/value/parameter parameternameurl/namevaluejdbc:mysql://localhost/authority/value/parameter /ResourceParams /Context -- Franck Franck Borel wrote: Where did you place your Realm block? It must be placed inside the context block like this: Context .. Realm ./ /Context.. I did not have it here, I had it in the Engine tag. I have now changed it, and stoped and restarted the server. I still get the same error. The relavent bit of my server.xml file looks like this - Engine name=Catalina defaultHost=localhost ... !-- Realm className=org.apache.catalina.realm.JDBCRealm driverName=com.mysql.jdbc.Driver connectionURL=jdbc:mysql://localhost/authority connectionName=root connectionPassword=ROOT_PASSWORD userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=user_roles roleNameCol=role_name / -- ... Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false Context path=/minimal docBase=minimal debug=0 reloadable=false crossContext=true Realm className=org.apache.catalina.realm.JDBCRealm driverName=com.mysql.jdbc.Driver connectionURL=jdbc:mysql://localhost/authority connectionName=root connectionPassword=ROOT_PASSWORD userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=user_roles roleNameCol=role_name / /Context - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Dipl.-Hyd. Franck Borel Universitaetsbibliothek Freiburg EMail: [EMAIL PROTECTED] EDV-Dezernat Tel. : +49-761 / 203-3908 Werthmannplatz 2 | Postfach 1629 Fax : +49-761 / 203-3987 79098 Freiburg | 79016 Freiburg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Newbie: Deploying .war file, getting it working with MySQL
Franck Borel wrote: Try this: Context path=/minimal docBase=minimal debug=0 reloadable=false crossContext=true Resource name=jdbc/authority auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/authority parameternameusername/namevalueroot/value/parameter paramaternamepassword/namevalueROOT_PASSWORD/value/parameter parameternamedriverClassName/namevaluecom.mysql.jdbc.Driver/value/parameter parameternameurl/namevaluejdbc:mysql://localhost/authority/value/parameter /ResourceParams /Context Same error (after changing paramater ;) ). Did make me think though, what is authority? Should I have cganged this (to the name of the database for example)? Thanks again, Hugh -- Franck Franck Borel wrote: Where did you place your Realm block? It must be placed inside the context block like this: Context .. Realm ./ /Context.. I did not have it here, I had it in the Engine tag. I have now changed it, and stoped and restarted the server. I still get the same error. The relavent bit of my server.xml file looks like this - Engine name=Catalina defaultHost=localhost ... !-- Realm className=org.apache.catalina.realm.JDBCRealm driverName=com.mysql.jdbc.Driver connectionURL=jdbc:mysql://localhost/authority connectionName=root connectionPassword=ROOT_PASSWORD userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=user_roles roleNameCol=role_name / -- ... Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false Context path=/minimal docBase=minimal debug=0 reloadable=false crossContext=true Realm className=org.apache.catalina.realm.JDBCRealm driverName=com.mysql.jdbc.Driver connectionURL=jdbc:mysql://localhost/authority connectionName=root connectionPassword=ROOT_PASSWORD userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=user_roles roleNameCol=role_name / /Context - 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]
Re: Newbie: Deploying .war file, getting it working with MySQL
Yes, authority in the url is the name of the database being accessed. URL syntax looks something like this: jdbc:mysql//[DNS_name|IP][:portNum]/database portNum is 3306 if not specified and you can add a ? and connect options after the database name as needed. Hugh Morgan wrote: Franck Borel wrote: Try this: Context path=/minimal docBase=minimal debug=0 reloadable=false crossContext=true Resource name=jdbc/authority auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/authority parameternameusername/namevalueroot/value/parameter paramaternamepassword/namevalueROOT_PASSWORD/value/parameter parameternamedriverClassName/namevaluecom.mysql.jdbc.Driver/value/parameter parameternameurl/namevaluejdbc:mysql://localhost/authority/value/parameter /ResourceParams /Context Same error (after changing paramater ;) ). Did make me think though, what is authority? Should I have cganged this (to the name of the database for example)? Thanks again, Hugh -- Franck Franck Borel wrote: Where did you place your Realm block? It must be placed inside the context block like this: Context .. Realm ./ /Context.. I did not have it here, I had it in the Engine tag. I have now changed it, and stoped and restarted the server. I still get the same error. The relavent bit of my server.xml file looks like this - Engine name=Catalina defaultHost=localhost ... !-- Realm className=org.apache.catalina.realm.JDBCRealm driverName=com.mysql.jdbc.Driver connectionURL=jdbc:mysql://localhost/authority connectionName=root connectionPassword=ROOT_PASSWORD userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=user_roles roleNameCol=role_name / -- ... Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false Context path=/minimal docBase=minimal debug=0 reloadable=false crossContext=true Realm className=org.apache.catalina.realm.JDBCRealm driverName=com.mysql.jdbc.Driver connectionURL=jdbc:mysql://localhost/authority connectionName=root connectionPassword=ROOT_PASSWORD userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=user_roles roleNameCol=role_name / /Context - 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]
Re: Newbie: Deploying .war file, getting it working with MySQL
Hello Do you tried to connect to your databse normaly (I mean without tomcat) to see if your user/pwd and database are set correctly in Mysql Like this for example #mysql -uUSER -pPASSWORD DATABASE Are you sure the user have access authority to this databse from localhost ? I know this is very simple but sometimes Pascal - Original Message - From: Hugh Morgan [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Monday, May 08, 2006 5:16 PM Subject: Re: Newbie: Deploying .war file, getting it working with MySQL Franck Borel wrote: Try this: Context path=/minimal docBase=minimal debug=0 reloadable=false crossContext=true Resource name=jdbc/authority auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/authority parameternameusername/namevalueroot/value/parameter paramaternamepassword/namevalueROOT_PASSWORD/value/parameter parameternamedriverClassName/namevaluecom.mysql.jdbc.Driver/value/parameter parameternameurl/namevaluejdbc:mysql://localhost/authority/value/parameter /ResourceParams /Context Same error (after changing paramater ;) ). Did make me think though, what is authority? Should I have cganged this (to the name of the database for example)? Thanks again, Hugh -- Franck Franck Borel wrote: Where did you place your Realm block? It must be placed inside the context block like this: Context .. Realm ./ /Context.. I did not have it here, I had it in the Engine tag. I have now changed it, and stoped and restarted the server. I still get the same error. The relavent bit of my server.xml file looks like this - Engine name=Catalina defaultHost=localhost ... !-- Realm className=org.apache.catalina.realm.JDBCRealm driverName=com.mysql.jdbc.Driver connectionURL=jdbc:mysql://localhost/authority connectionName=root connectionPassword=ROOT_PASSWORD userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=user_roles roleNameCol=role_name / -- ... Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false Context path=/minimal docBase=minimal debug=0 reloadable=false crossContext=true Realm className=org.apache.catalina.realm.JDBCRealm driverName=com.mysql.jdbc.Driver connectionURL=jdbc:mysql://localhost/authority connectionName=root connectionPassword=ROOT_PASSWORD userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=user_roles roleNameCol=role_name / /Context - 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]
Re: Newbie: Deploying .war file, getting it working with MySQL
David Smith wrote: Yes, authority in the url is the name of the database being accessed. URL syntax looks something like this: jdbc:mysql//[DNS_name|IP][:portNum]/database portNum is 3306 if not specified and you can add a ? and connect options after the database name as needed. I have made this change (to the server.xml file), still the same error [1]. I guess it is not getting to database, as it says Cannot create JDBC driver of class '' for connect URL 'null'. I am guessing there is somewere else I need to specify the class name and database URL? [1] Context path=/minimal docBase=minimal debug=0 reloadable=false crossContext=true Resource name=jdbc/smsserver auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/smsserver parameternameusername/namevalueroot/value/parameter parameternamepassword/namevaluelock74numb/value/parameter parameternamedriverClassName/namevaluecom.mysql.jdbc.Driver/value/parameter parameternameurl/namevaluejdbc:mysql://localhost/smsserver/value/parameter /ResourceParams /Context - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Newbie: Deploying .war file, getting it working with MySQL
Pascal wrote: Hello Do you tried to connect to your databse normaly (I mean without tomcat) to see if your user/pwd and database are set correctly in Mysql Like this for example #mysql -uUSER -pPASSWORD DATABASE [EMAIL PROTECTED] [~/temp/java]# mysql -uroot -pROOT_PASSWORD smsserver Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 4264 to server version: 4.1.18-standard Type 'help;' or '\h' for help. Type '\c' to clear the buffer. Are you sure the user have access authority to this databse from localhost ? I can get to it from a java app with this code; Class.forName(com.mysql.jdbc.Driver); String url = jdbc:mysql://localhost/smsserver; con = DriverManager.getConnection(url, root, ROOT_PASSWORD); I guess this proves it works. I know this is very simple but sometimes Pascal Yeah I know. Thanks anyway. Hugh - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]