Access MANIFEST.MF from web-application
Hi all! Is it possible to get access to the MANIFEST.MF in META-INF from my web-application? I would like to read the version info stored there to be used in my web-applicaton. InputStream mfis = this.getClass().getClassLoader().getResourceAsStream(META-INF/MANIFEST.MF ); Manifest mf = new Manifest( mfis ); does not work, and String jarname = System.getProperties().getProperty(java.class.path); JarFile jarfile = new JarFile(jarname); Manifest manifest = jarfile.getManifest(); does not seem to work either. Or is there something wrong? If I copy the MANIFEST.MF to WEB-INF/classes, the access by InputStream works, but that would mean doubling data. Thanks Peter - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat unusable when logging set to debug mode
Hi all! Because of a mistake in writing in my log4j configuration logging has been set to debug mode. When deploying the webapp Tomcat began to log thousands of debug messages, and so became unusable because of the heavy load. I had to stop Tomcat and delete the webapp from the webapp-directory manually. This is not very useful if there are running several, frequently used webapps... So is there away to avoid such situations? How can I Tomcat prevent to produce such heavy (and not very useful) load? Is there a way? Thanks Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Question configurung JBDCRealm (Tomcat 5.5.9)
Hi all! I have got a question regarding setup of a JBDCRealm. I read the HOW-TO on Tomcat homepage, and I am wondering about the database structure. I have an existing application, and the database it uses has got a table 'users' with the follwing columns: login, password, roleid,... where the roleid is a foreign key to the table 'roles' which has columns 'id' and 'rolename'. It is sufficient for me because every user can only have one role. Is there a way to use this database structure with JDBCRealm? Or do I have to add more tables as described in the HOW-TO? My database structure already contains all information, so it would be overhead to produce an extra table, I think. I tried the following: Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=org.postgresql.Driver connectionURL=jdbc:postgresql://localhost:5432/ testwebapp?user=loginamp;password=pwd userTable=users userNameCol=login userCredCol=password userRoleTable=users roleNameCol=roleid / but I got problems on roleNameCol=roleid. How can I get the rolename from table roles? Perhaps I missed something, and someone has an idea. Thanks Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: Question configurung JBDCRealm (Tomcat 5.5.9)
Hi andy! As in the HOW-TO described you need two tables, one table 'users' that holds the username and the password, and one table that holds the username and the roles the user is given (it is a mapping from users to roles). My database has also two tables, but the first table holds username, password AND roles, and the second table only is a collection of role names, assigned with an id. So my tables look like this: table users username(login) | password | roleid peter | secret| 0 andy| terces| 1 table roles id | rolename 0 | admin 1 | someuser I tried several combinations of tables/columnnames in my realm config, but none worked. Thanks Peter -Ursprüngliche Nachricht- Von: andy gordon [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 21. Dezember 2005 12:51 An: Tomcat Users List Betreff: Re: Question configurung JBDCRealm (Tomcat 5.5.9) Peter, If I understand what you described, it looks like your database is ok but your specification to tomcat is ever so slightly off. Change your server.xml in a way so that the role elements reference the role table and not users table. HTH - andy [EMAIL PROTECTED] wrote: Hi all! I have got a question regarding setup of a JBDCRealm. I read the HOW-TO on Tomcat homepage, and I am wondering about the database structure. I have an existing application, and the database it uses has got a table 'users' with the follwing columns: login, password, roleid,... where the roleid is a foreign key to the table 'roles' which has columns 'id' and 'rolename'. It is sufficient for me because every user can only have one role. Is there a way to use this database structure with JDBCRealm? Or do I have to add more tables as described in the HOW-TO? My database structure already contains all information, so it would be overhead to produce an extra table, I think. I tried the following: debug=99 driverName=org.postgresql.Driver connectionURL=jdbc:postgresql://localhost:5432/ testwebapp?user=loginpassword=pwd userTable=users userNameCol=login userCredCol=password userRoleTable=users roleNameCol=roleid / but I got problems on roleNameCol=roleid. How can I get the rolename from table roles? Perhaps I missed something, and someone has an idea. Thanks Peter - 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: ASKING AGAIN: problem in getting database connection from rem ote machine using JNDI
I dont know if it is required, but do you have a resource-ref entry in your web.xml, something like this? resource-ref descriptionmySQL Datasource/description res-ref-namejdbc/myAPP/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref where res-ref-name has to be the same as in context.xml. And perhaps your look-up-name might not be correct, but I am not sure because I am using PostrgreSQL databse. http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html might help you out. -Ursprüngliche Nachricht- Von: rahul [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 25. Oktober 2005 06:33 An: Tomcat Users List Betreff: ASKING AGAIN: problem in getting database connection from remote machine using JNDI Is there anything else that is required for remote database? -Original Message- From: rahul [mailto:[EMAIL PROTECTED] Sent: Monday, October 24, 2005 7:56 PM To: Tomcat Users List Subject: problem in getting database connection from remote machine using JNDI Hi all, I am using tomcat JNDI for getting databse connection in my application For this I have created a context.xml file in myAPP/META-INF which looks like this: ?xml version=1.0 encoding=UTF-8? Context path=/myAPP docBase=myAPP debug=5 reloadable=true privileged=true crossContext=true Resource name=jdbc/myAPP auth=Container type=javax.sql.DataSource maxActive=30 maxIdle=10 maxWait=6000 username=user password=password driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:3306/myDB removeAbandoned=true autoReconnect=true validationQuery=select now() factory=org.apache.commons.dbcp.BasicDataSourceFactory/ /Context This works absolutely fine. But when I try to connect to a remote database by changing url in above file to jdbc:mysql://192.168.5.65:3306/myDB my application fails It creates following exception while retrieving a connection: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Unknown database 'myDB') code I have written for fetching connection is: Context ctx = (Context) new InitialContext() .lookup(java:comp/env); if (ctx == null) { throw new Exception(No context available); } else { dataSource = (DataSource) ctx.lookup(jdbc/icontact); Connection connection = dataSource.getConnection(); } can anybody help? thanks in advance --RahulJoshi - 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: ASKING AGAIN: problem in getting database connection from rem ote machine using JNDI
Inspired by the last mail: Have you configured your remote database to listen to the ip-adress of your client. Does your databse accept connections from there? And is there a user installed on your remote database that has rights to access it? -Ursprüngliche Nachricht- Von: Andoni [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 25. Oktober 2005 11:32 An: Tomcat Users List Betreff: Re: ASKING AGAIN: problem in getting database connection from rem ote machine using JNDI Hello, I am looking at this error message you are getting: Cannot create PoolableConnectionFactory (Unknown database 'myDB') and thinking it isn't any thing to do with resource tags. Specially if it is working locally. To me it seems to be something wrong with your DB installation. Does the remote DB have a schema called myDB? Andoni. - Original Message - From: rahul Newsgroups: gmane.comp.jakarta.tomcat.user Sent: Tuesday, October 25, 2005 10:08 AM Subject: RE: ASKING AGAIN: problem in getting database connection from rem ote machine using JNDI Thanks for help Jan, But how to define jdbc/global in the Data Sources of the tomcat Server? can you explain further -RahulJoshi -Original Message- From: Jan Pernica [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 25, 2005 2:29 PM To: Tomcat Users List Subject: Re: ASKING AGAIN: problem in getting database connection from rem ote machine using JNDI In your deploy XML you should have somethink like this: ResourceLink global=jdbc/global name=jdbc/myApp type=javax.xml.DataSource/ Where jdbc/global is defined in the Data Sources of the tomcat server. Jan rahul wrote: I am still not been able to use remote database, even after including resource-ref in my web.xml -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 25, 2005 1:48 PM To: users@tomcat.apache.org Subject: RE: ASKING AGAIN: problem in getting database connection from rem ote machine using JNDI I dont know if it is required, but do you have a resource-ref entry in your web.xml, something like this? resource-ref descriptionmySQL Datasource/description res-ref-namejdbc/myAPP/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref where res-ref-name has to be the same as in context.xml. And perhaps your look-up-name might not be correct, but I am not sure because I am using PostrgreSQL databse. http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-h owto.html might help you out. -Ursprüngliche Nachricht- Von: rahul [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 25. Oktober 2005 06:33 An: Tomcat Users List Betreff: ASKING AGAIN: problem in getting database connection from remote machine using JNDI Is there anything else that is required for remote database? -Original Message- From: rahul [mailto:[EMAIL PROTECTED] Sent: Monday, October 24, 2005 7:56 PM To: Tomcat Users List Subject: problem in getting database connection from remote machine using JNDI Hi all, I am using tomcat JNDI for getting databse connection in my application For this I have created a context.xml file in myAPP/META-INF which looks like this: ?xml version=1.0 encoding=UTF-8? Context path=/myAPP docBase=myAPP debug=5 reloadable=true privileged=true crossContext=true Resource name=jdbc/myAPP auth=Container type=javax.sql.DataSource maxActive=30 maxIdle=10 maxWait=6000 username=user password=password driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:3306/myDB removeAbandoned=true autoReconnect=true validationQuery=select now() factory=org.apache.commons.dbcp.BasicDataSourceFactory/ /Context This works absolutely fine. But when I try to connect to a remote database by changing url in above file to jdbc:mysql://192.168.5.65:3306/myDB my application fails It creates following exception while retrieving a connection: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Unknown database 'myDB') code I have written for fetching connection is: Context ctx = (Context) new InitialContext() .lookup(java:comp/env); if (ctx == null) { throw new Exception(No context available); } else { dataSource = (DataSource) ctx.lookup(jdbc/icontact); Connection connection = dataSource.getConnection(); } can anybody help? thanks in advance --RahulJoshi - 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