How to close open connections after application stop?

2009-02-22 Thread Edoardo Panfili
Hy, I have one webapp in Tomcat 6.0.18 with this context: Context path=/myApp docBase=myApp debug=100 reloadable=true Resource name=jdbc/myApp auth=Container type=javax.sql.DataSource maxActive=8 maxIdle=5 maxWait=300 username=myApp password=passwd

RE: Record and simulate a web app

2009-02-22 Thread Taylan Develioglu
Guys, I've been following this thread for a while now, but doesn't Jmeter already do what you're trying to accomplish here? I've used jmeter's proxy to record and replay http requests/responses before with success. Or am I missing something here? Here's a link to some instructions :

Re: How to close open connections after application stop?

2009-02-22 Thread Mark Thomas
Edoardo Panfili wrote: Hy, I have one webapp in Tomcat 6.0.18 with this context: Context path=/myApp docBase=myApp debug=100 reloadable=true Resource name=jdbc/myApp auth=Container type=javax.sql.DataSource maxActive=8 maxIdle=5 maxWait=300 username=myApp

RE: IIS6, Tomcat 6.0, ISAPI redirector 1.2.27 - no log on one server

2009-02-22 Thread Martin Gainty
Rick To redirect requests to a program1. In IIS Manager, expand the local computer, right-click the Web site or directory you want to redirect, and click Properties. 2. Click the Home Directory, Virtual Directory, or Directory tab. 3. Under The content for this source should come from, click A

Re: Authenticating Users

2009-02-22 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mark, On 2/21/2009 4:06 PM, Mark Thomas wrote: 5. Patch DataSourceRealm 6. Make case sensitivity configurable and contribute your patch back to the ASF. 7. Use securityfilter to write your realm, and not be tied to Tomcat. 8. Many databases

Re: Record and simulate a web app

2009-02-22 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Taylan, On 2/22/2009 8:26 AM, Taylan Develioglu wrote: Guys, I've been following this thread for a while now, but doesn't Jmeter already do what you're trying to accomplish here? No. We're not trying to reply requests to the server. We're trying

Re: very slow class loading on initial JSP/servlet request after restart

2009-02-22 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Sam, On 2/20/2009 6:44 PM, Sam Hokin wrote: Thanks, Chris. I ran e2fsck with the -c option, which runs badblocks, when I tested it earlier. And I just ran badblocks again - 0 bad blocks found. Did you run badblocks on the array, or on an

Re: How to close open connections after application stop?

2009-02-22 Thread Edoardo Panfili
Mark Thomas ha scritto: Edoardo Panfili wrote: Hy, I have one webapp in Tomcat 6.0.18 with this context: Context path=/myApp docBase=myApp debug=100 reloadable=true Resource name=jdbc/myApp auth=Container type=javax.sql.DataSource maxActive=8 maxIdle=5 maxWait=300

Re: How to close open connections after application stop?

2009-02-22 Thread Mark Thomas
Edoardo Panfili wrote: Mark Thomas ha scritto: Edoardo Panfili wrote: Hy, I have one webapp in Tomcat 6.0.18 with this context: Context path=/myApp docBase=myApp debug=100 reloadable=true Resource name=jdbc/myApp auth=Container type=javax.sql.DataSource maxActive=8

Re: How to close open connections after application stop?

2009-02-22 Thread Edoardo Panfili
Edoardo Panfili ha scritto: Mark Thomas ha scritto: Edoardo Panfili wrote: Hy, I have one webapp in Tomcat 6.0.18 with this context: Context path=/myApp docBase=myApp debug=100 reloadable=true Resource name=jdbc/myApp auth=Container type=javax.sql.DataSource maxActive=8

Re: Authenticating Users

2009-02-22 Thread Alan Chaney
Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mark, I was the OP on this one. Mark just made a couple of suggestions. On 2/21/2009 4:06 PM, Mark Thomas wrote: 5. Patch DataSourceRealm 6. Make case sensitivity configurable and contribute your patch back to

RE: How to close open connections after application stop?

2009-02-22 Thread Martin Gainty
javax.sql.DataSource dataSource ; java.sql.Connection connection; java.sql.Statement statement; java.sqlResultset resultSet; code.. try { connection = dataSource.getConnection(); statement = connection.prepareStatement(SELECT FU FROM BAR);

Re: How to close open connections after application stop?

2009-02-22 Thread Edoardo Panfili
Martin Gainty ha scritto: javax.sql.DataSource dataSource ; java.sql.Connection connection; java.sql.Statement statement; java.sqlResultset resultSet; code.. try{ connection = dataSource.getConnection(); statement = connection.prepareStatement(SELECT FU FROM BAR);

Re: How to close open connections after application stop?

2009-02-22 Thread Alan Chaney
Edoardo wrote I have resultset.close(); statement.close(); connection.close(); in my code. and connection = dataSource.getConnection(); seems very close to my ambiente = (Context) new InitialContext().lookup(java:comp/env); pool = (DataSource) ambiente.lookup(jdbc/myApp);

Re: How to close open connections after application stop?

2009-02-22 Thread Edoardo Panfili
Alan Chaney ha scritto: Edoardo wrote I have resultset.close(); statement.close(); connection.close(); in my code. and connection = dataSource.getConnection(); seems very close to my ambiente = (Context) new InitialContext().lookup(java:comp/env); pool = (DataSource)

Re: How to close open connections after application stop?

2009-02-22 Thread Edoardo Panfili
Alan Chaney ha scritto: I don't think so. Let me recap your problem: When you undeploy an application from tomcat (using the DBCP pooling mechanism) you can't make STRUCTURAL changes to the database because it complains that connections are still in use. This is exactly what one would

Re: How to close open connections after application stop?

2009-02-22 Thread Mark Thomas
Edoardo Panfili wrote: Using this code in destroy() method of a servlet marked as load-on-startup1/load-on-startup Yep - that is the sort of code you'd need. Using a context listener would be a better solution as Tomcat is free to call destroy() on your Servlet whenever it likes. Mark

Re: How to close open connections after application stop?

2009-02-22 Thread Edoardo Panfili
Mark Thomas ha scritto: Edoardo Panfili wrote: Using this code in destroy() method of a servlet marked as load-on-startup1/load-on-startup Yep - that is the sort of code you'd need. Using a context listener would be a better solution as Tomcat is free to call destroy() on your Servlet

Re: Authenticating Users

2009-02-22 Thread Gregor Schneider
To the OP: 1. May I ask what database it is you're using? 2- I'd go for the following solution: Create a JSP-page accepting the credentials. The username should be converted to uppercase. The password should be left as is so that case-sensivity here is maintained. Don't know if I'm missing

Re: Authenticating Users

2009-02-22 Thread Robert Koberg
(function() { var doLogin = function() { var uname = doc.byId(name).toLowerCase(); var passw = doc.byId(password).toLowerCase(); //var digest = sha1.digest(uname + :My Realm: + passw); xhr.send(...); } return { login: function() { doLogin(); return false;

Re: Authenticating Users

2009-02-22 Thread Alan Chaney
Gregor Schneider wrote: To the OP: 1. May I ask what database it is you're using? Postgres - but a more general solution would be nice. 2- I'd go for the following solution: Create a JSP-page accepting the credentials. The username should be converted to uppercase. The password should be

RE: Authenticating Users

2009-02-22 Thread Martin Gainty
Which specific attributes are you seeking that are not in DataSourceRealm? Realm className=org.apache.catalina.realm.DataSourceRealm debug=99 dataSourceName=jdbc/authority userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=user_roles roleNameCol=role_name/

Re: Authenticating Users

2009-02-22 Thread Alan Chaney
Martin Gainty wrote: Which specific attributes are you seeking that are not in DataSourceRealm? Realm className=org.apache.catalina.realm.DataSourceRealm debug=99 dataSourceName=jdbc/authority userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=user_roles

Re: Getting the tomcat server IP

2009-02-22 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Yuval, On 2/21/2009 1:44 PM, Yuval Perlov wrote: Also, from the socket object you can always call socket.getLocalAddress() on an outgoing connection. This is useful if you want to make sure you are getting the IP for a particular network. Aren't

Re: Authenticating Users

2009-02-22 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Alan, On 2/22/2009 4:47 PM, Alan Chaney wrote: From my point of view, as I don't use hashed passwords at the moment the easiest thing to do is to modify the DataSourceRealm as suggested by Mark Thomas. However, I think that the ability to extend

RE: Authenticating Users

2009-02-22 Thread Martin Gainty
Martin Gainty wrote: Which specific attributes are you seeking that are not in DataSourceRealm? Realm className=org.apache.catalina.realm.DataSourceRealm debug=99 dataSourceName=jdbc/authority userTable=users userNameCol=user_name userCredCol=user_pass

Re: How to close open connections after application stop?

2009-02-22 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Martin, On 2/22/2009 10:26 AM, Martin Gainty wrote: catch (SQLException sqlEx) { try { resultset.close(); statement.close(); connection.close(); } It's kind of silly to call close() on all these

Re: Authenticating Users

2009-02-22 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Martin, Wow. On 2/22/2009 8:52 PM, Martin Gainty wrote: Alan Chaney wrote: To summarize 1. password be case insensitive [I may be able to talk them out of this] MGhandled from java.lang.String toUpperCase/toUpperCase

Fwd: J2EE on Mac

2009-02-22 Thread Mighty Tornado
Hi, I installed Tomcat on my mac OS X and it's running. I also have Eclipse Europa. Now I don't think I have J2EE installed - How do I do it? I went to Sun's website and it gave me an archive with GlassFish which I don't need. Can somebody please tell me where I can download the latest J2EE for

how to make more than one web applications run without context root name on tomcat (Virtual hosting)

2009-02-22 Thread sweta bachhety
I am trying to configure my server(tomcat 5.5.26) in a way that i can access two applications without mentioning their context name. I have googled for it and done the following configuration in my server.xml I have two application, App1 and App2 now i want that both should run with out

Re: Fwd: J2EE on Mac

2009-02-22 Thread Edoardo Panfili
Mighty Tornado ha scritto: Hi, I installed Tomcat on my mac OS X and it's running. I also have Eclipse Europa. Now I don't think I have J2EE installed - How do I do it? You can download different eclipse packages, Eclipse IDE for Java EE Developers is more comfortable. I went to Sun's

Re: Fwd: J2EE on Mac

2009-02-22 Thread Edoardo Panfili
Mighty Tornado ha scritto: Hi, I installed Tomcat on my mac OS X and it's running. I also have Eclipse Europa. Now I don't think I have J2EE installed - How do I do it? You can download different eclipse packages, Eclipse IDE for Java EE Developers is more comfortable. I went to Sun's