How to deploy Java application into Tomcat in Linux
Hi, As per my understanding, the steps to deploy a Java application on Tomcat (5.X/6.X) in Linux would be as follows: 1) Install Tomcat on Linux 2) Add a host entry in $TOMCAT_HOME/conf with the syntax like- - reports.fion.co.in The above code would assign the host name to access the URL, gives the location of the web application pointed out by appBase & context path. 3) Start Tomcat. Please let me know if the steps above are correct and also please let me know in detail if the steps are not correct. -- *STL Disclaimer:* The content of this message may be legally privileged and confidential and are for the use of the intended recipient(s) only. It should not be read, copied and used by anyone other than the intended recipient(s). If you have received this message in error, please immediately notify the sender, preserve its confidentiality and delete it. Before opening any attachments please check them for viruses and defects. No employee or agent is authorised to conclude any binding agreement on behalf of Sterlite Technologies Limited with another party by email without express written confirmation by authorised person. Visit us at www.sterlitetechnologies.com Please consider environment before printing this email !
Re: Connection Pooling in Tomcat 6 using Java
Dear All, Please accept my heartily thanks for your valuable responses. *Daniel / Chris*, Thank you so much. You both gave me a vary helpful explanation. I have read many forums but still was confused but you guys have cleared my doubts and also gave me new ideas to do better. Thank you again. *Best Regards,* *Saurabh Sarasvat* On Mon, Mar 31, 2014 at 6:50 PM, Daniel Mikusa wrote: > On Mar 31, 2014, at 7:05 AM, Saurabh Saraswat > wrote: > > > Dear All, > > > > I am doing connection pooling with tomcat 6. And i am doing this very > first > > time before today i had no idea about connection pooling. I want to > ensure > > that it is the correct way or not. > > Please do me correct if i am doing wrong anywhere. I am explaining you > all > > steps done by me- > > > > *1. Have created a context.xml* > > Using "conf/context.xml" works, but it will create the resource that you > define for every application that you deploy to Tomcat. Sometimes this is > the desired effect and sometimes this ends up creating a lot of extra pools > that are not needed. > > If you want to create a pool for one app, you can put it in > "conf/Catalina/localhost/.xml" or inside your WAR file at > "META-INF/context.xml". These are locations for context configuration that > is specific to an application and when resources are placed in one of these > two locations (don't put them in both), the resource will only be created > once, for the specific app. > > Alternatively, you can put your resource definitions in "conf/server.xml" > (inside the GlobalNamingResources block) and it'll allow you to create one > pool and share it across multiple applications. The nice thing about this > approach is that with multiple applications using the same pool, you can > generally use your connections more efficiently. > > Which one you pick depends on your environment and what makes sense there. > > > > > > > > > > > > maxActive="100" maxIdle="30" maxWait="1" > > username="root" password="root" > > driverClassName="com.mysql.jdbc.Driver" > > > > > url="jdbc:MySQL://localhost:3306/MaxDB?zeroDateTimeBehavior=convertToNull"/> > > > > > > Looks OK. > > > > > *2. Mapping in web.xml* > > > > > > MySql DataSource > > jdbc/MaxDB > > javax.sql.DataSource > > Container > > > > I don't believe that this is needed by Tomcat. > > > > > *3. Then on my servlet i am getting the object of connection like this-* > > > >private static InitialContext ic; > >protected static DataSource datasource; > >private static Context ctx; > > > > protected static Connection getConnection() throws DatabaseException > > { > >Connection conn = null; > >try > >{ > >ctx = new InitialContext(); > >datasource = (DataSource) > > ctx.lookup("java:/comp/env/jdbc/MaxDB"); > >conn = datasource.getConnection(); > >} > > I didn't run this code, but at a glance it looks OK. > > >catch (Exception ex) > >{ > > > >} > > > >return conn; > >} > > > > Is that it or we need to do anything else for connection pooling. As i > > google then i found there is an API Commons DBCP so tomcat use it > > internally or we have to do something with this. > > Yes. Tomcat will use DBCP internally. There's nothing additional you > need to do, just define your resources. > > If you want to use a different connection pool, you can do that. You just > need to specify the "factory" attribute and the class name of the factory > to use to create the pool. Another commonly used pool is Tomcat's > jdbc-pool, which ships as a second option in Tomcat 7. > > > Using this i am able to get the connection object.But at the second > request > > how i will validate that its taking the connection object from pool and > not > > creating the new con object. Even i am not sire that here i am using > > connection pooling or getting object of connection simply using > datasource. > > You can connect with jconsole / jvisualvm and look at the mbeans. Tomcat > exports mbeans for the resources that you define. Through them you can see > the stats for your connection pool. > > Dan > > > > > Please assist me! > > > > Thanking You! > > > > *Best Regards,* > > > > *Saurabh Sarasvat* > > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > >
Re: Is it possible to send a 'keep-alive' packet back to client session every x seconds?
Hi Matthew, On 03/28/2014 01:35 AM, Matthew Turany wrote: Thanks everyone, development tells me that their going to build the function into the application. You're lucky ;-) trying to build custom kernels and then using a tcp_keepalive would be a logistic nightmare. I know you solved differently this issue, but in case other people is watching this thread, who said you have to build custom kernels?!? Just change a sysctl knob and be done with that. Exagerating, it's just ~100 characers to type, no reboot required neither. Check here for the details, i'm sure will come handy in other situations: http://tldp.org/HOWTO/TCP-Keepalive-HOWTO/usingkeepalive.html Cheers, Matt [...] Frederik - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat under load && frontend reverse proxy timeouts
Hi Igor, On 03/27/2014 10:51 PM, Igor Cicimov wrote: On 27/03/2014 12:39 PM, "Frederik Nosi" wrote: Hi all, Having to deal with slow applications deployed under tomcat, with a reverse proxy in front, frequently i've noticed that even when the frontend timeouts and closes it's part of the TCP connection, the Tomcat thread processing the request goes on and on till it finishes. Is there a way to make the proccessing thread stop when the frontend connection get's closed? Thanks in advance, Frederik What kind of application is this? What is the reason that the thread takes longer than expected? Unfortunately for me is legacy apps, sometimes writen from companies that never exist anymore, but i have to somehow make stuff work. I cant modify them. Is it just the load on the app server or its waiting on the backend database maybe? Yes, nearly all apps talk with a backend DB, but for that part knowing our DBA stuff and havnig access to the database servers i'm confident it is not due to the load on our databases. Is mostly due to the number of queries per request from the application side. And another problematic point is that some of this applications dont even use connection pooling. And most of this apps make calls to webservices outside my control, without having the possibility to configure a timeout. Load is an issue too, usualy CPU load not memory, so not connected to the garbage collector. We've tried scaling horizontaly, and there's where i noticed the amplification effect of mod_jk, i posted another mail on this issue and a patch, with subject: "Re: mod_jk - Failover behaviour and load + patch" but the thread went nowhere FWICS. If load then for sure you can limit the tomcat connector threads and the accept queue to reduce it and add some more app servers. If backend connection then you can sync the client timeout and the db connection timeout. See above. Thanks Igor, Frederik - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [OT] Problem in accessing link
On 3/31/2014 2:17 PM, Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Mark, On 3/31/14, 11:33 AM, Mark Eggers wrote: Please do not top-post. On 3/31/2014 2:14 AM, Randhir Singh wrote: Hi, Thanks for your answer. There are 2 applications hosted on this Tomcat. 1 is working fine and the other only is giving problems which we are accessing on port 10080. Request inputs on this so that the resolution is found. I'll quote from the original stack trace (thanks for providing this, by the way). -- *exception* java.lang.NullPointerException com.elitecore.reports.manager.server.GetCompanyInfoServlet.doAction(Ge tCompanyInfoServlet.java:93) -- The line above points to exactly where the problem exists. This method is throwing a null pointer exception, which means it's trying to access a variable without that variable being initialized. Either a null is being passed into this method, or you're using a variable that has been declared but not initialized. Modern IDEs will warn you if you've declared a non-primitive variable and attempt to use it without initialization. Actually, the compiler will throw an error for uninitialized local variable references, primitives included. Class members silently default to whatever "zero" means for that type (false for booleans, null for references). - -chris Ah yep . . . Guess I've not written code and attempted to use uninitialized primitives. Just wrote a quick one, and sure enough the compiler complained. I need to make more mistakes . . . /mde/ - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Problem in accessing link
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Randir, On 3/31/14, 5:14 AM, Randhir Singh wrote: > Thanks for your answer. There are 2 applications hosted on this > Tomcat. 1 is working fine and the other only is giving problems > which we are accessing on port 10080. > > Request inputs on this so that the resolution is found. You need to request inputs on this from whoever Elite Core is. We cannot help you, here. Good luck, - -chris > -Original Message- From: Christopher Schultz > [mailto:ch...@christopherschultz.net] Sent: Saturday, March 29, > 2014 6:22 PM To: Tomcat Users List Subject: Re: Problem in > accessing link > > Randhir, > > On 3/29/14, 8:38 AM, Randhir Singh wrote: >> We are using tomcat in our production setup, the version of >> tomcat is 5.0.28. > > It would be really good for you to investigate upgrading your > version of Tomcat. Not only has Tomcat 5.0 been retired, but Tomcat > 5.5 has also been retired. Tomcat 8 is about to be released. There > are known and unknown unpatched security problems with the Tomcat 5 > versions which will never be patched. > >> While accessing the link hosted on tomcat, the following error >> is coming as below: > >> -- >> >> - -- >> -- >> >> - > >> *HTTP Status 500 - * -- > >> *type* Exception report > >> *message* > >> *description* *The server encountered an internal error () that >> prevented it from fulfilling this request.* > >> *exception* > >> java.lang.NullPointerException > > >> com.elitecore.reports.manager.server.GetCompanyInfoServlet.doAction(Ge >> >> tCompanyInfoServlet.java:93) > > This > > is a problem with whatever "elitecore' is. You'll have to look > there. > >> Request you to please advice on what steps should be taken so >> that this problem is resolved. > > This is not a problem with Tomcat: it's a problem with the web > application deployed on Tomcat. This is something you'll have to do > yourself or engage the original developer. > > -chris > > - > > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > -BEGIN PGP SIGNATURE- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJTOdt4AAoJEBzwKT+lPKRYFJUP/2skKVpGkF09mj44ZJlR7731 WSKCe7C7fI6wZTD94hAVMMEqVKcyLvMBpeFih4S+zjUSvCs9Cw0kz9pjtvwA9mA9 8THXGKoNQuJs/xSRdEkJUSfQf2JAOXcklIKRL5EOH+bq/AT8n9ARHWX4rj72BKe5 UHYU50qsLIKQnjpxSJDz2cebQY9DuDe5MWn9TF16YL0ySfRT7wAmaXVeR4bgfuJr lPlGydpsQ/1FXDOf/uU7gTjL6opVfK03RjNAKCuOdqN7HXdqNLQs2SHOA2V/jItc uI+VXx6bj1+PuE9iNteBP5BJaDmlaBVVuBPEIRTplF3KBewSUaluDh6aOf8wnc9X ThDDPrSWiwHLID2J+h0jCsxnfdAxEjgoTS25i2kTwDisVWlngafnlyoTBacZPOp4 hCcoKdRguU6mUYpyvu19NyZLPGmBofYGB69tNMXQOhlA12HxGUHMqXs9ndag1pgq jhimFiMDYlQ+2FS+vtKAGQDBa8HVohgIdCYsI5r5R0sZHZwx09K5KR1nZw7RK8Vf nE1ydf+4r2YkJKCRKlF+lQxpdmxASAdSrzlqIrWj6sszXf24g+mK5EzYuVT7twUi Y6ycVI3fxo4ovm5AWcFlBcoDwl4wpzGWcVNc8D0hbmCS7gBELuWbwTnTsjT7Ockx hYzYZQUInB0f9mqap9Pb =itWA -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [OT] Problem in accessing link
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Mark, On 3/31/14, 11:33 AM, Mark Eggers wrote: > Please do not top-post. On 3/31/2014 2:14 AM, Randhir Singh wrote: >> Hi, >> >> Thanks for your answer. There are 2 applications hosted on this >> Tomcat. 1 is working fine and the other only is giving problems >> which we are accessing on port 10080. >> >> Request inputs on this so that the resolution is found. > > I'll quote from the original stack trace (thanks for providing > this, by the way). > > -- > > *exception* > > java.lang.NullPointerException > > com.elitecore.reports.manager.server.GetCompanyInfoServlet.doAction(Ge > > tCompanyInfoServlet.java:93) > > -- > > The line above points to exactly where the problem exists. This > method is throwing a null pointer exception, which means it's > trying to access a variable without that variable being > initialized. Either a null is being passed into this method, or > you're using a variable that has been declared but not > initialized. > > Modern IDEs will warn you if you've declared a non-primitive > variable and attempt to use it without initialization. Actually, the compiler will throw an error for uninitialized local variable references, primitives included. Class members silently default to whatever "zero" means for that type (false for booleans, null for references). - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJTOdtVAAoJEBzwKT+lPKRYeVMP/Rh1iAg4Cwe703sUDJdaM6iL V09xU2S1xEcPZCgR15n2VgUdPvvSZAZoDNI0XX8ThTILi3DM/ELQjhcVqGsM732R s3SNm6LG9bJEoevZXZE9IXQf+f9GEx2nLaB71DdYo9dnV7GN0eBK3UP+Us2GK+m1 allzN2qIgVb9iymuK89PX4a4HaG6t5Lu48QP9cJKAAgV866kml5SRKW2YayOXA5p LB0sXMG++9l5Tg1qnEABO3+a3RmWJ3H3TId87KvoPqCjxwoF2Tzry/bl1eJY1y5K AGVN7QlaE0u8T5MQoZSPj5ZlKwJJLqVbgQAxJNp9i6PBiT1r66tTK2bANM5axZsk Wvs94DuaQ8jZQRkaLyQlcV5NT0WnQO1LES2z0ny7qG4NH0grqFjjbBJWvZ7DLayt FxqzIetVkiZdf6mj838dOnjq5UlpStyPIFwhKJWDhvi7D1IsJeKJ9D6E/YcwILmK dU9hAnczDJrky/pLApMe7ZydYK4pojlMzx/tMESB2tOIH1yf4a797xOEWnrJaeOk RUKo7KWuAkMO9xCJDthJ272jQ5mxX7t/9g3qzZ24kAFBVW4+uoLKLOXTopNJuF2E U0KWsFMoasFo3/jfxacDlIxp83PAWfhZWcttRWVgtQwG329gralzuqJ4EIigsPXy /orZGaprbBO+s4t2xm0F =WmaS -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Connection Pooling in Tomcat 6 using Java
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Saurabh, On 3/31/14, 7:05 AM, Saurabh Saraswat wrote: > I am doing connection pooling with tomcat 6. And i am doing this > very first time before today i had no idea about connection > pooling. I want to ensure that it is the correct way or not. Glad to see you are taking a step in writing a scalable web application. Connection pooling helps you scale better by both reducing the time it takes to connect to your database and also by limiting the number of concurrent connections to the database (which keeps it healthy). > Please do me correct if i am doing wrong anywhere. I am explaining > you all steps done by me- > > *1. Have created a context.xml* > > > > > type="javax.sql.DataSource" maxActive="100" maxIdle="30" > maxWait="1" username="root" password="root" > driverClassName="com.mysql.jdbc.Driver" > > url="jdbc:MySQL://localhost:3306/MaxDB?zeroDateTimeBehavior=convertToNull"/> > > > > *2. Mapping in web.xml* > > MySql DataSource > jdbc/MaxDB > javax.sql.DataSource > Container > > *3. Then on my servlet i am getting the object of connection like > this-* > > private static InitialContext ic; protected static DataSource > datasource; private static Context ctx; > > protected static Connection getConnection() throws > DatabaseException { Connection conn = null; try { ctx = new > InitialContext(); datasource = (DataSource) > ctx.lookup("java:/comp/env/jdbc/MaxDB"); conn = > datasource.getConnection(); } catch (Exception ex) { > > } > > return conn; } Looks good so far. When you're done with the Connection object, just call close() on it and it will be returned to the pool. Make sure to do it in a "finally" block. (I have lots more tips for JDBC connections on an old blog post I wrote which can be found here: http://blog.christopherschultz.net/index.php/2009/03/16/properly-handling-pooled-jdbc-connections/) > Is that it or we need to do anything else for connection pooling. > As i google then i found there is an API Commons DBCP so tomcat use > it internally or we have to do something with this. You do not need to use any special APIs beyond what you have above: the JNDI stuff and JDBC. > Using this i am able to get the connection object.But at the second > request how i will validate that its taking the connection object > from pool and not creating the new con object. Even i am not sire > that here i am using connection pooling or getting object of > connection simply using datasource. MySQL/Maria support the SLEEP() function in queries. Try this. Configure your pool with *only* a single connection (which you should always do in development anyway), then issue a "SELECT SLEEP(3)" from your web application. While the thread is sleeping, do a "SHOW PROCESSLIST" from the MySQL CLI. You'll see the connection id along with the query being executed. Then when the request completes (after ~3 seconds), re-run "SHOW PROCESSLIST" to convince yourself that there are no queries running. Then, make the request again to execute the "SELECT SLEEP(3)" and do "SHOW PROCESSLIST" in the MySQL CLI again: you should see the same connection id running the query. You could also try to load-test your web application with a single connection in the pool and then go ask MySQL to SHOW PROCESSLIST, and you should see only a single query executing at a time. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJTOdppAAoJEBzwKT+lPKRYXioP/jza7PD2N+O0Y7VBCnA7UDob aAkF0boQ242ZtZQh2LkdRISxSp03ZO/8x+w504so/hTJ/1nxHvl+RvRhuDqfaxYP pzA5MjxN72h2NGf5IYNVmALNZCJI8HlC45UDQ762VnHAGy6ZKv4HZUcvKhkR++Xl BPtVAUO6g9AI8BCbe+j9fgHpwMCd12KyD3bxFFUxLh1ZP1Y7FH8gThHyE9d0NzP8 iuJgaLvIs/Be1OAlogq95H45d4sO7MNMPqo4OsDafW4RNOAOHFfVGx5IIp2vVVRJ QABUzZNUiQakCmOTJu5q/NMx6PpN71qxvakVofAk00ZzT9wzbuHZmE3vTnBH1gTQ eyY6mJskqv8jKKeogtCtpeeLEPQxLpy/fWL289jsFJSDIq3HZJWkKcIbbOywjLnP X7PQ/wAACQ4sm0ieUrz/Vytd9k59+bjiW/Q0GzmZvRPf7IZhHcjsY4Q/rIRRo7Y4 f1V8llfOdfDSv1kaD0oD1dsLoTEmsWGMKK05PoF4EcXRTpBxbNpg5H5cTLmuLHSr U8zHnHayHJ/rJcj+raeYTj/dqLhYnTZGyCnn7gNdQZJssCoTzeUU7Ay8kw4gDghY Vr1fbbz7XOz9cO9vm0M/ornb5DvU3QbFamQgymTjRUvLCQ9eMhsyH9qT5OtCh6PR MIdAkqbnmCTSlqHMrPdj =xz7b -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: SSL Certificates
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Ninthun, On 3/31/14, 10:19 AM, Bomma, Nithun wrote: > Hello, > > We are using WebSphere v6.1 for SSO and we are moving to ForgeRock > and it uses Apache Tomcat (v7.0.37) > > We are trying to import the certificates (Verisign) including the > chain certificates from WebSphere to Tomcat. > > Have any of you did this before? If yes, could you help us out? Websphere probably should be using Java keystores. You should just be able to use the same keystore, although something might need to be re-named or something. Save yourself a huge headache and use Portecle: http://portecle.sourceforge.net/ You should be able to take your server key and issued certificate and create a new Java Keystore to use with the BIO or NIO connectors. If you are using APR, then you will have to export your key and certificate to individual files and configure them appropriately. Hope that helps, - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJTObq8AAoJEBzwKT+lPKRY99sQAKdQryt76EFPHD42vk72o/pJ vgBaWBsLL57rK+6LgsUSuNneTviGaBkDY6kBVjnGzA1w3I9MJn4XnhX8Pm/Z1ZQd rpYDk3/E+CI2Gh5C6HTkgcXE/hffQ8xKAhS/CZj4riJu6S3YSIPFtX6H3vTkQD1A tWlUE8fEWm0Wo529izbiPPPseZTBdAU1Sbv4z4AEjZolrxyvE6Bm0GSyvSYTu5cm g0oxv7hoSl8IxKHaI6mxmRFLCrBSRBmIHp6vSB7OHzmx0pi6UuZzWnhjL9N1VhZ6 zA3vxlQlicXxjMdWOY2dsy6GLxzK+CmOK61Fk52uJMRJgEz1Dzdb2hyuypdt1aVC F160wtePQpbYkjnXusjsfE8PsiZxFyiFOBbfVnoni6yY7DiVSID5lglbvXPjnveA jMCHKTjDrGZAeou7Tuu1aUMqvg9kaSOlCGAstK5G5wuAV8GSvGoqAfuZ70EbrTdj pqK4xGl+uFKaJfw0bkFzD6seSWevk8CiWCZ46h3JVISM42VWqtiWnfKkTNjFSUVx ECFll3YGmEwWbwo9cTDHD/GJYMqi878vhA34v/YmOVFLV6dVy0hOjudC6NXeu9/t Hk2AGm82Fi5mgP3ZWT8K35/GcH1ezd77M+jFmikFjCZC6btZw26ir2A9i2xbdZ// In71YEw3kQauMHA6UsgL =BbUU -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Request for better deployment usability: should be able to specify context root inside war
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Sebastien, On 3/31/14, 12:43 PM, Sebastien Tardif wrote: > I understand that Tomcat currently doesn't always support > specifying the context root to be used in a file inside the War. You are correct in that you cannot have a completely self-contained WAR file that specifies a context root that is not the same name as the WAR file itself (excepting ROOT, which is special, of course). But as Mark says, you can use an external configuration file to do this for you. What is your use case that you can't name the WAR file whatever you want, or that you *must* deploy the WAR file under one name and have the context path be different *and* you can't use an external configuration file? > Extract from: > http://tomcat.apache.org/tomcat-7.0-doc/config/context.html When > autoDeploy or deployOnStartup operations are performed by a Host, > the name and context path of the web application are derived from > the name(s) of the file(s) that define(s) the web application. > Consequently, the context path may not be defined in a > META-INF/context.xml embedded in the application and there is a > close relationship between the context name, context path, context > version and the base file name (the name minus any .war or .xml > extension) of the file. > > Other web server handle this better, like GlassFish and it's very > convenient. Usability is something we should try to achieve. > > Since, in all cases, the War will need to be "read" anyway, how > hard or costly that can be to lookup a configuration file and read > it? > > I think we cannot mentions "performance" reasons for current > behavior since everything else that need to be done will always be > x factor way slower. It's like optimizing string concatenation > become calling a database, that makes me laugh in each project I > work on. I have no idea what you are talking about, here. Tomcat does not read the context root from within the WAR file, and it's not for performance reasons. > That issue is the only one that makes the infamous GlassFish looks > better so I wanted to raise it. If Glassfish better meets your needs, then you should use it. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJTObniAAoJEBzwKT+lPKRYJ28P/3uwHKyf7MHEVLXoT6KtwP6D RNwl1GSxsE8rL72GDMBc2F8fkghEIQLNirSpIQ3BqKl7831kYgJZdoF+/PNOA5hN FWRCQyjZOxliTd77M2bS4VONef63RplpVZL+J58qSAOq5uwb30+ILjpLIx4qf/wC jT6XTghE1TsAOzeZCAhkgLZL5KPSKLBxQ0kElLZljVD2xSBYVcH89B4ioA2odTX5 5cBNwGLFbew5WL4mST8v/ZUNzm466CCD+i9mqlDLMwR2Ya73g6mZTTLem8WjNIYX 9M9c4qxlTPjfNW2S2f33QI8UAiuIdxkxHUj7zl7I+rY45GJZRIHT7xyZXAjoTEJ7 JvBkB7BZf2op2bdLTZ9UC6Z5GzOO91ktM7mP3+ucn389ik4pmQxIgSo+yaok3iJ4 vloc6si9FE40Ac9d/h/Xpuz2EiC5LuwM7T1BfcvtNPwWiSuFw7CkSfHbS+Y1MS1+ t6PBPskKbL2EP/9XRrlt9LFy4DldvFEK9KFn02pqufJ8YA8cR4ob4+kK92vqpze0 C7JtzmPx6xzMKae9J+dM7HZbUViqa6swxThKDlD4hezjv2BgaFO+Qbd+2Is0fYNs vvYoJj7mpOZIlWhxO88bCHV8QSAX47B9QlAW2PwYKPIjEBFZ7txXJIETPFdRSKOc QU3jPFXqiFsZJzDTm4uD =TwK9 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: SSL Certificates
On 3/31/14 10:32 AM, Blume Wolfgang wrote: Hi, If your certificate need not be changed, then you need not create a new Certificate Signing Request (CSR) to get a new certificate, but only do the "Importing the Certificate" part of the description: Import chain certificate, then your existing certificate. Of course, that presupposes that you can export the certificate in a format that Tomcat can use. If we're talking WebSphere on an AS/400, it probably uses DCM. And if we're talking Tomcat on an AS/400, the only option I'm aware of is a Java keystore. And if there's a way to get from the former to the latter, I wouldn't mind knowing about it myself: we've had customers jump the gun, and generate DCM-compatible certificates, not knowing that Tomcat didn't use them. -- JHHL - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Request for better deployment usability: should be able to specify context root inside war
On Mon, Mar 31, 2014 at 1:27 PM, Mark Eggers wrote: > As far as Glassfish versus Apache Tomcat goes, they address different use > cases. Glassfish is a J2EE application server. Apache Tomcat is a servlet > container. While you can convince Apache Tomcat to do a lot of things, at > some point it's better to run an application server if your requirements > dictate it. Apache TomEE is a good choice. > +1 TomEE is a good choice, and it makes you a Tomcat user, too. :) > > BTW, I like Glassfish and Apache TomEE. It just depends on my use case. > As one that migrated from Glassfish to TomEE, my recommendation is TomEE. > Concerning string concatenation, I think you would be surprised. Since > strings are immutable, concatenating strings is very expensive if you're > doing more than a few. I believe I read somewhere that concatenating 'n' > strings is proportional to the quadratic of n. In short, ouch. Are there > better places to spend time on optimization? Probably, but this depends on > your application. Is concatenating 100 strings using the concatenation > operator needlessly expensive? Most probably. > In the past, i worked on a contract where I moved some string-processing Powerbuilder logic from PowerBuilder/client to database stored proc. Previously, the Powerbuilder client-side string-processing code took 1.5 hours to complete; after i moved the logic to database stored proc, it took 2 to 10 seconds to complete. :)
RE: Need urgent help - Removing jvmoptions from tomcat service
> -Original Message- > From: Mukul Bhatnagar [mailto:mukul@gmail.com] > Sent: Monday, March 31, 2014 12:40 PM > To: users@tomcat.apache.org > Subject: Fwd: Need urgent help - Removing jvmoptions from tomcat > service > > -- Forwarded message -- > From: Mukul Bhatnagar > Date: Mon, Mar 31, 2014 at 10:59 PM > Subject: Need urgent help - Removing jvmoptions from tomcat service > To: users-h...@tomcat.apache.org > > > Hi all, > > I am using tomcat as Windows service for my application. I created JVM > options. lets say -Djava.library . > Now everything runs fine and i do see the java properties using the > command > line: > > tomcat7w.exe //ES//applId > > Now, since everything i am doing is in batch script.When i am > uninstalling the service, the JVMoptions donot get deleted. they stay > there forever and on installing/executing the service, the JVMoptions > get duplicated. > > how do i remove JVMoptions in my script during uninstalltion of tomcat > service, what is the command line for that? > > -- > Warm Regards, > Mukul Bhatnagar > How are you installing/uninstalling the service/options? Normally, the recommending way of working with the windows service runner (aka Apache Commons Daemon) will uninstall any added/changed options. Perhaps reading the documentation on ACD will give you some insight. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Fwd: Need urgent help - Removing jvmoptions from tomcat service
-- Forwarded message -- From: Mukul Bhatnagar Date: Mon, Mar 31, 2014 at 10:59 PM Subject: Need urgent help - Removing jvmoptions from tomcat service To: users-h...@tomcat.apache.org Hi all, I am using tomcat as Windows service for my application. I created JVM options. lets say -Djava.library . Now everything runs fine and i do see the java properties using the command line: tomcat7w.exe //ES//applId Now, since everything i am doing is in batch script.When i am uninstalling the service, the JVMoptions donot get deleted. they stay there forever and on installing/executing the service, the JVMoptions get duplicated. how do i remove JVMoptions in my script during uninstalltion of tomcat service, what is the command line for that? -- Warm Regards, Mukul Bhatnagar -- Warm Regards, Mukul Bhatnagar
Re: SSL Certificates
Hi, If your certificate need not be changed, then you need not create a new Certificate Signing Request (CSR) to get a new certificate, but only do the "Importing the Certificate" part of the description: Import chain certificate, then your existing certificate. Wolfgang 2014-03-31 16:45 GMT+02:00 Bomma, Nithun : > Thanks Leo! > > I don't want to create a new CSR, since the certificate with WebSphere > exists until 2015. > > I just want to export the certificate with chain from WebSphere and import > into Tomcat directly. > > Any thoughts? > > Thanks, > Nithun Bomma > WebSphere Administrator > Amtrak - Information Technology (Operations) > AIM: nithunbomma > EMAIL: nithun.bo...@amtrak.com > Desk: 215-349-2065; ATS: 728-2065; Cell: 215-704-4981 > -Original Message- > From: Leo Donahue [mailto:donahu...@gmail.com] > Sent: Monday, March 31, 2014 10:39 AM > To: Tomcat Users List > Subject: Re: SSL Certificates > > On Mon, Mar 31, 2014 at 7:19 AM, Bomma, Nithun >wrote: > > > Hello, > > > > We are using WebSphere v6.1 for SSO and we are moving to ForgeRock and > > it uses Apache Tomcat (v7.0.37) > > > > We are trying to import the certificates (Verisign) including the > > chain certificates from WebSphere to Tomcat. > > > > Have any of you did this before? If yes, could you help us out? > > > > Thanks, > > Nithun > > > > It's all right here: > > http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Installing_a_Certificate_from_a_Certificate_Authority > > Where do you need help specifically? > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > >
Re: Request for better deployment usability: should be able to specify context root inside war
On 3/31/2014 9:43 AM, Sebastien Tardif wrote: I understand that Tomcat currently doesn't always support specifying the context root to be used in a file inside the War. Extract from: http://tomcat.apache.org/tomcat-7.0-doc/config/context.html When autoDeploy or deployOnStartup operations are performed by a Host, the name and context path of the web application are derived from the name(s) of the file(s) that define(s) the web application. Consequently, the context path may not be defined in a META-INF/context.xml embedded in the application and there is a close relationship between the context name, context path, context version and the base file name (the name minus any .war or .xml extension) of the file. Other web server handle this better, like GlassFish and it's very convenient. Usability is something we should try to achieve. Since, in all cases, the War will need to be "read" anyway, how hard or costly that can be to lookup a configuration file and read it? I think we cannot mentions "performance" reasons for current behavior since everything else that need to be done will always be x factor way slower. It's like optimizing string concatenation become calling a database, that makes me laugh in each project I work on. That issue is the only one that makes the infamous GlassFish looks better so I wanted to raise it. I humbly disagree. What follows is my (somewhat rambling) opinion. If I remember correctly, the decision to derive a context path from the WAR file name was driven by lots of not so fun deployment race conditions, double deployment issues, and non-obvious deployment difficulties. The Tomcat users mailing list archive is littered with examples. If you want to name your WAR file or exploded directory 'foo.war' or 'foo/', but want your context to be '/bar', then deploy outside of appBase, name the context file bar.xml, and set docBase to the absolute path of the application. This is for example, what NetBeans does when working with Tomcat. It's nice, avoids copying lots of information around, and makes IDE updates immediately available (OK - libraries and class updates trigger a reload) all in the confines of the 'Tomcat way'. I don't see any good use cases for this, and lots of room for confusion. It's much easier to fix your build and deploy tools to create rational names matching the desired context. If that's not possible, deploy outside of appBase, and use a context file named context-name.xml in $CATALINA_BASE/conf/host-name/. As far as Glassfish versus Apache Tomcat goes, they address different use cases. Glassfish is a J2EE application server. Apache Tomcat is a servlet container. While you can convince Apache Tomcat to do a lot of things, at some point it's better to run an application server if your requirements dictate it. Apache TomEE is a good choice. BTW, I like Glassfish and Apache TomEE. It just depends on my use case. Concerning string concatenation, I think you would be surprised. Since strings are immutable, concatenating strings is very expensive if you're doing more than a few. I believe I read somewhere that concatenating 'n' strings is proportional to the quadratic of n. In short, ouch. Are there better places to spend time on optimization? Probably, but this depends on your application. Is concatenating 100 strings using the concatenation operator needlessly expensive? Most probably. . . . just my two cents. /mde/ - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Request for better deployment usability: should be able to specify context root inside war
I understand that Tomcat currently doesn't always support specifying the context root to be used in a file inside the War. Extract from: http://tomcat.apache.org/tomcat-7.0-doc/config/context.html When autoDeploy or deployOnStartup operations are performed by a Host, the name and context path of the web application are derived from the name(s) of the file(s) that define(s) the web application. Consequently, the context path may not be defined in a META-INF/context.xml embedded in the application and there is a close relationship between the context name, context path, context version and the base file name (the name minus any .war or .xml extension) of the file. Other web server handle this better, like GlassFish and it's very convenient. Usability is something we should try to achieve. Since, in all cases, the War will need to be "read" anyway, how hard or costly that can be to lookup a configuration file and read it? I think we cannot mentions "performance" reasons for current behavior since everything else that need to be done will always be x factor way slower. It's like optimizing string concatenation become calling a database, that makes me laugh in each project I work on. That issue is the only one that makes the infamous GlassFish looks better so I wanted to raise it.
Re: Problem in accessing link
Please do not top-post. On 3/31/2014 2:14 AM, Randhir Singh wrote: Hi, Thanks for your answer. There are 2 applications hosted on this Tomcat. 1 is working fine and the other only is giving problems which we are accessing on port 10080. Request inputs on this so that the resolution is found. I'll quote from the original stack trace (thanks for providing this, by the way). -- *exception* java.lang.NullPointerException com.elitecore.reports.manager.server.GetCompanyInfoServlet.doAction(Ge tCompanyInfoServlet.java:93) -- The line above points to exactly where the problem exists. This method is throwing a null pointer exception, which means it's trying to access a variable without that variable being initialized. Either a null is being passed into this method, or you're using a variable that has been declared but not initialized. Modern IDEs will warn you if you've declared a non-primitive variable and attempt to use it without initialization. If a null is being passed into this method, you need to check that the value being passed in is not null before using it. The problem is either in com.elitecore.reports.manager.server.GetCompanyInfoServlet.doAction(), or something that is calling it and passing in a null value (which is then not being checked for). It is not a Tomcat problem. You would see exactly this same behavior running on Jetty, Glassfish, JBoss, Weblogic, Websphere, or any other application server or servlet container. As others have said, 5.0.x (and 5.5.x) have been retired. There are security issues that should be addressed for any Internet-facing application. The only way to address the security issues is by upgrading. The security issues and upgrading have nothing to do with the null pointer exception you're asking about. . . . just my two cents /mde/ Regards -Original Message- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: Saturday, March 29, 2014 6:22 PM To: Tomcat Users List Subject: Re: Problem in accessing link -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Randhir, On 3/29/14, 8:38 AM, Randhir Singh wrote: We are using tomcat in our production setup, the version of tomcat is 5.0.28. It would be really good for you to investigate upgrading your version of Tomcat. Not only has Tomcat 5.0 been retired, but Tomcat 5.5 has also been retired. Tomcat 8 is about to be released. There are known and unknown unpatched security problems with the Tomcat 5 versions which will never be patched. While accessing the link hosted on tomcat, the following error is coming as below: -- -- -- *HTTP Status 500 - * -- *type* Exception report *message* *description* *The server encountered an internal error () that prevented it from fulfilling this request.* *exception* java.lang.NullPointerException com.elitecore.reports.manager.server.GetCompanyInfoServlet.doAction(Ge tCompanyInfoServlet.java:93) This is a problem with whatever "elitecore' is. You'll have to look there. Request you to please advice on what steps should be taken so that this problem is resolved. This is not a problem with Tomcat: it's a problem with the web application deployed on Tomcat. This is something you'll have to do yourself or engage the original developer. - -chris - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [OT] timeout
On 3/31/2014 4:18 AM, Vicky B wrote: there is a firewall between browser and apache httpd and i am not sure if there is a firewall between apache and tomcat (mostly no). Mostly? Mostly? As in sometimes there's a firewall, and other times there's not, but mostly not? Or do you mean that you're supporting this application at multiple sites, and it's misbehaving at some sites? And that most of the sites do not have a firewall between Apache HTTPD and Apache Tomcat, but some do? Or do you mean that you're almost certain that there is no firewall between Apache HTTPD and Apache Tomcat, but you're not 100% certain? But why would this firewall drop the connection ? Firewalls can be configured to drop connections after a certain amount of inactivity. If you have a long-running process and are not sending information back to the user, there are many places where the connection could be closed. 1. Between Apache Tomcat and Apache HTTPD As I mentioned earlier, if you have configured an AJP timeout (which is not the default configuration) and it is too short, Apache HTTPD will close the connection and send an error message back to the browser. 2. Firewall between Apache Tomcat and Apache HTTPD A firewall can be configured to close connections after a period of inactivity. 3. Firewall between Apache HTTPD and the browser A firewall can be configured to close connections after a period of inactivity. This might generate the type of error in the log extract that you posted earlier. However, that error may be completely unrelated to the problem, as well as all of these other musings many of us are doing. The short answer is that none of us know, because you have not provided enough information for us to be anything more than speculative. If you want help in resolving this problem, you need to provide us with answers to the questions we've asked (as a start). We can then help (mostly by asking more questions) narrow down the possibilities, and then possibly help you solve the problem. Or as André politely pointed out, give you enough information so that you can go back to the developers so that they can fix the problem. As he has pointed out, 90% of the time it's an application issue. There is no 'magic' one line answer and configuration that will fix your problem (most likely - but again, we don't know). If you do not have the answers to the questions we are asking, please go ask someone who does have the answers and the access for the information. Otherwise we're all just wasting time and bandwidth. Meanwhile your users are still getting errors . . . . . . just my (not caffeinated) two cents /mde/ PS - please, please, please do not top-post. Your comments when they're read first make no sense until you scroll to the bottom and read the rest of the message. /mde/ On Mon, Mar 31, 2014 at 3:16 PM, Howard W. Smith, Jr. < smithh032...@gmail.com> wrote: On Mar 31, 2014 3:48 AM, "André Warnier" wrote: Howard W. Smith, Jr. wrote: On Sun, Mar 30, 2014 at 9:54 PM, Caldarale, Charles R < chuck.caldar...@unisys.com> wrote: From: Howard W. Smith, Jr. [mailto:smithh032...@gmail.com] Subject: Re: timeout - and if that is not the reason, then find the person responsible for the in-between equipment and ask them why their junk closes the connection before your application has a chance to respond 'junk'? please clarify the usage of the word 'junk', here. :) I think the definition "something of poor quality" would fit in this case, if the poor quality were a result of configuring equipment without regard to the requirements of the network users. - Chuck understood, thanks Chuck. :) Yes, what I meant precisely was thus : if after receiving numerous complaints from your users and your boss that your application is misbehaving; after an in-depth review of the Apache httpd and tomcat on-line documentation; after a level-headed discussion of the issue with a group of independent experts; after a thorough witnessed interview of a significant sample of the users to ascertain their professional behaviour in front of a browser and the absence of any problem with their mouse buttons; after a careful and time-consuming examination of all the evidence, including the access logs of both tomcat and httpd; if after all that thus you would come to the inescapable conclusion that it is the intermediate firewall/gateway that is the cause of all the trouble, then when you talk to the people responsible for that equipment, the word that might come to mind then, to qualify this equipment and its settings seen as a whole, is "junk". Thank you for offering me the opportunity to clarify this section of my previous post. You're welcome, the pleasure was [almost] all mine, and thank you for the clarification. :-) - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For addition
RE: SSL Certificates
Thanks Leo! I don't want to create a new CSR, since the certificate with WebSphere exists until 2015. I just want to export the certificate with chain from WebSphere and import into Tomcat directly. Any thoughts? Thanks, Nithun Bomma WebSphere Administrator Amtrak - Information Technology (Operations) AIM: nithunbomma EMAIL: nithun.bo...@amtrak.com Desk: 215-349-2065; ATS: 728-2065; Cell: 215-704-4981 -Original Message- From: Leo Donahue [mailto:donahu...@gmail.com] Sent: Monday, March 31, 2014 10:39 AM To: Tomcat Users List Subject: Re: SSL Certificates On Mon, Mar 31, 2014 at 7:19 AM, Bomma, Nithun wrote: > Hello, > > We are using WebSphere v6.1 for SSO and we are moving to ForgeRock and > it uses Apache Tomcat (v7.0.37) > > We are trying to import the certificates (Verisign) including the > chain certificates from WebSphere to Tomcat. > > Have any of you did this before? If yes, could you help us out? > > Thanks, > Nithun > It's all right here: http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Installing_a_Certificate_from_a_Certificate_Authority Where do you need help specifically? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: SSL Certificates
On Mon, Mar 31, 2014 at 7:19 AM, Bomma, Nithun wrote: > Hello, > > We are using WebSphere v6.1 for SSO and we are moving to ForgeRock and it > uses Apache Tomcat (v7.0.37) > > We are trying to import the certificates (Verisign) including the chain > certificates from WebSphere to Tomcat. > > Have any of you did this before? If yes, could you help us out? > > Thanks, > Nithun > It's all right here: http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Installing_a_Certificate_from_a_Certificate_Authority Where do you need help specifically?
SSL Certificates
Hello, We are using WebSphere v6.1 for SSO and we are moving to ForgeRock and it uses Apache Tomcat (v7.0.37) We are trying to import the certificates (Verisign) including the chain certificates from WebSphere to Tomcat. Have any of you did this before? If yes, could you help us out? Thanks, Nithun
Re: [OT] timeout
André Warnier wrote: Vicky B wrote: there is a firewall between browser and apache httpd and i am not sure if there is a firewall between apache and tomcat (mostly no). But why would this firewall drop the connection ? Some people never learn.. Sigh. Ok, Vicky, one last try from me : 1) stop *guessing* where the problem may be, and try to collect some *facts* 2) restore all the settings which you have changed, to their default values 3) re-read the responses which you have received so far, and try to understand them. Do not make us feel like you are not listening to anything we're saying. Example : the response to your question above has already been given previously. 4) Your question above is not really relevant to your problem (unless you prove us otherwise). Stop going off on tangents like time-outs and firewalls, and focus on the most likely sources for the problem, which are, in that order : 1. the application; 2. the users. At least 90% of the problems mentioned on this list, in the end are problems of the application - not of the server, not of the connections, not of the users. 5) when a browser sends a request to a server, it expects *some* response within 4-5 minutes. If the server does not send anything to that browser during 4-5 minutes, the browser will stop waiting. It will display a message to the user, saying that the server does not respond, and it will close the connection to the server. If the server then tries to send something to the browser, the server will get an error, and write a message in the logs saying "connection reset by peer". 6) Is this happening ? is your application sometimes taking more than 4-5 minutes to respond to a browser request ? No ? are you sure ? can you prove that this is not happening ? 7) If you are sure that the above does not happen, then *find out what happens*. Where is the response being held up ? set up your server's logfiles to find out, make a test, and look at the logfiles. Then if the logfiles show that Tomcat is sending the response, but that the browser never gets it, come back here with your question, along with all the information that you have been asked for previously (copy of the log messages etc.) 8) If you do not have access to the information which would show where the problem is, we are sorry but we cannot do anything about that. Just think of how much harder it is for us, who do not even have access to the information that you have access to, except through you. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Connection Pooling in Tomcat 6 using Java
On Mar 31, 2014, at 7:05 AM, Saurabh Saraswat wrote: > Dear All, > > I am doing connection pooling with tomcat 6. And i am doing this very first > time before today i had no idea about connection pooling. I want to ensure > that it is the correct way or not. > Please do me correct if i am doing wrong anywhere. I am explaining you all > steps done by me- > > *1. Have created a context.xml* Using “conf/context.xml” works, but it will create the resource that you define for every application that you deploy to Tomcat. Sometimes this is the desired effect and sometimes this ends up creating a lot of extra pools that are not needed. If you want to create a pool for one app, you can put it in “conf/Catalina/localhost/.xml” or inside your WAR file at “META-INF/context.xml”. These are locations for context configuration that is specific to an application and when resources are placed in one of these two locations (don’t put them in both), the resource will only be created once, for the specific app. Alternatively, you can put your resource definitions in “conf/server.xml” (inside the GlobalNamingResources block) and it’ll allow you to create one pool and share it across multiple applications. The nice thing about this approach is that with multiple applications using the same pool, you can generally use your connections more efficiently. Which one you pick depends on your environment and what makes sense there. > > > > > maxActive="100" maxIdle="30" maxWait="1" > username="root" password=“root" > driverClassName="com.mysql.jdbc.Driver" > > url="jdbc:MySQL://localhost:3306/MaxDB?zeroDateTimeBehavior=convertToNull"/> > > Looks OK. > > *2. Mapping in web.xml* > > > MySql DataSource > jdbc/MaxDB > javax.sql.DataSource > Container > I don’t believe that this is needed by Tomcat. > > *3. Then on my servlet i am getting the object of connection like this-* > >private static InitialContext ic; >protected static DataSource datasource; >private static Context ctx; > > protected static Connection getConnection() throws DatabaseException > { >Connection conn = null; >try >{ >ctx = new InitialContext(); >datasource = (DataSource) > ctx.lookup("java:/comp/env/jdbc/MaxDB"); >conn = datasource.getConnection(); >} I didn’t run this code, but at a glance it looks OK. >catch (Exception ex) >{ > >} > >return conn; >} > > Is that it or we need to do anything else for connection pooling. As i > google then i found there is an API Commons DBCP so tomcat use it > internally or we have to do something with this. Yes. Tomcat will use DBCP internally. There’s nothing additional you need to do, just define your resources. If you want to use a different connection pool, you can do that. You just need to specify the “factory” attribute and the class name of the factory to use to create the pool. Another commonly used pool is Tomcat’s jdbc-pool, which ships as a second option in Tomcat 7. > Using this i am able to get the connection object.But at the second request > how i will validate that its taking the connection object from pool and not > creating the new con object. Even i am not sire that here i am using > connection pooling or getting object of connection simply using datasource. You can connect with jconsole / jvisualvm and look at the mbeans. Tomcat exports mbeans for the resources that you define. Through them you can see the stats for your connection pool. Dan > > Please assist me! > > Thanking You! > > *Best Regards,* > > *Saurabh Sarasvat* - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [OT] timeout
Vicky B wrote: there is a firewall between browser and apache httpd and i am not sure if there is a firewall between apache and tomcat (mostly no). But why would this firewall drop the connection ? Some people never learn.. Sigh. On Mon, Mar 31, 2014 at 3:16 PM, Howard W. Smith, Jr. < smithh032...@gmail.com> wrote: On Mar 31, 2014 3:48 AM, "André Warnier" wrote: Howard W. Smith, Jr. wrote: On Sun, Mar 30, 2014 at 9:54 PM, Caldarale, Charles R < chuck.caldar...@unisys.com> wrote: From: Howard W. Smith, Jr. [mailto:smithh032...@gmail.com] Subject: Re: timeout - and if that is not the reason, then find the person responsible for the in-between equipment and ask them why their junk closes the connection before your application has a chance to respond 'junk'? please clarify the usage of the word 'junk', here. :) I think the definition "something of poor quality" would fit in this case, if the poor quality were a result of configuring equipment without regard to the requirements of the network users. - Chuck understood, thanks Chuck. :) Yes, what I meant precisely was thus : if after receiving numerous complaints from your users and your boss that your application is misbehaving; after an in-depth review of the Apache httpd and tomcat on-line documentation; after a level-headed discussion of the issue with a group of independent experts; after a thorough witnessed interview of a significant sample of the users to ascertain their professional behaviour in front of a browser and the absence of any problem with their mouse buttons; after a careful and time-consuming examination of all the evidence, including the access logs of both tomcat and httpd; if after all that thus you would come to the inescapable conclusion that it is the intermediate firewall/gateway that is the cause of all the trouble, then when you talk to the people responsible for that equipment, the word that might come to mind then, to qualify this equipment and its settings seen as a whole, is "junk". Thank you for offering me the opportunity to clarify this section of my previous post. You're welcome, the pleasure was [almost] all mine, and thank you for the clarification. :-) - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [OT] timeout
there is a firewall between browser and apache httpd and i am not sure if there is a firewall between apache and tomcat (mostly no). But why would this firewall drop the connection ? On Mon, Mar 31, 2014 at 3:16 PM, Howard W. Smith, Jr. < smithh032...@gmail.com> wrote: > On Mar 31, 2014 3:48 AM, "André Warnier" wrote: > > > > Howard W. Smith, Jr. wrote: > >> > >> On Sun, Mar 30, 2014 at 9:54 PM, Caldarale, Charles R < > >> chuck.caldar...@unisys.com> wrote: > >> > From: Howard W. Smith, Jr. [mailto:smithh032...@gmail.com] > Subject: Re: timeout > > > > - and if that is not the reason, then find the person responsible for > >>> > >>> the > > > > in-between equipment and ask them why their junk closes the > connection > > before your application has a chance to respond > > 'junk'? please clarify the usage of the word 'junk', here. :) > >>> > >>> I think the definition "something of poor quality" would fit in this > case, > >>> if the poor quality were a result of configuring equipment without > regard > >>> to the requirements of the network users. > >>> > >>> - Chuck > >>> > >> > >> understood, thanks Chuck. :) > >> > > > > Yes, what I meant precisely was thus : if after receiving numerous > complaints from your users and your boss that your application is > misbehaving; after an in-depth review of the Apache httpd and tomcat > on-line documentation; after a level-headed discussion of the issue with a > group of independent experts; after a thorough witnessed interview of a > significant sample of the users to ascertain their professional behaviour > in front of a browser and the absence of any problem with their mouse > buttons; after a careful and time-consuming examination of all the > evidence, including the access logs of both tomcat and httpd; if after all > that thus you would come to the inescapable conclusion that it is the > intermediate firewall/gateway that is the cause of all the trouble, then > when you talk to the people responsible for that equipment, the word that > might come to mind then, to qualify this equipment and its settings seen as > a whole, is "junk". > > > > Thank you for offering me the opportunity to clarify this section of my > previous post. > > > > You're welcome, the pleasure was [almost] all mine, and thank you for the > clarification. :-) > > > > > > > - > > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > > For additional commands, e-mail: users-h...@tomcat.apache.org > > > -- *Thanks & Regards Vickyb*
Connection Pooling in Tomcat 6 using Java
Dear All, I am doing connection pooling with tomcat 6. And i am doing this very first time before today i had no idea about connection pooling. I want to ensure that it is the correct way or not. Please do me correct if i am doing wrong anywhere. I am explaining you all steps done by me- *1. Have created a context.xml* *2. Mapping in web.xml* MySql DataSource jdbc/MaxDB javax.sql.DataSource Container *3. Then on my servlet i am getting the object of connection like this-* private static InitialContext ic; protected static DataSource datasource; private static Context ctx; protected static Connection getConnection() throws DatabaseException { Connection conn = null; try { ctx = new InitialContext(); datasource = (DataSource) ctx.lookup("java:/comp/env/jdbc/MaxDB"); conn = datasource.getConnection(); } catch (Exception ex) { } return conn; } Is that it or we need to do anything else for connection pooling. As i google then i found there is an API Commons DBCP so tomcat use it internally or we have to do something with this. Using this i am able to get the connection object.But at the second request how i will validate that its taking the connection object from pool and not creating the new con object. Even i am not sire that here i am using connection pooling or getting object of connection simply using datasource. Please assist me! Thanking You! *Best Regards,* *Saurabh Sarasvat*
Re: Tomcat 7.0.52 strage startup
Hi. 1) Don't top-post. Roberto Bottoni - AfterBit wrote: Hi, I have a linux debian 6 on a virtual machine..HD is ok and also the filesystem.. i have updated the system a few days ago.. I thought an update might solve the problems, but I get no success .. Tomcat is launched at system startup.. Then I would recommend to stop doing that (temporarily). Remove the links which start Tomcat at system boot (look in /etc/rc2.d or rc3.d or rc4.d). Reboot the system and make sure that Tomcat is not started. (If it is still started, you have not removed all the relevant links). Wait until the system is totally booted and ready, and then invoke the tomcat startup script manually, like : /etc/init.d/tomcatX start Give Tomcat time enough to start (watch the logs), then stop it again using /etc/init.d/tomcatX stop Do this repeatedly, e.g. 10 times. And then check if, in that case, it always starts properly, or it also intermittently fails to start properly. I do not use remote-shares or anything like that for your deployment The problem is intermittent.. [...] - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 7.0.52 strage startup
Hi, I have a linux debian 6 on a virtual machine..HD is ok and also the filesystem.. i have updated the system a few days ago.. I thought an update might solve the problems, but I get no success .. Tomcat is launched at system startup.. I do not use remote-shares or anything like that for your deployment The problem is intermittent.. - Original Message - From: "Christopher Schultz" To: "Tomcat Users List" Sent: Friday, March 28, 2014 5:46 PM Subject: Re: Tomcat 7.0.52 strage startup -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Roberto, On 3/17/14, 8:06 AM, Roberto Bottoni - AfterBit wrote: sometimes i get the following error at tomcat 7 startup.. What version do you have? How do you launch Tomcat? so i restart and restart again and finally tomcat starts without problem. How do you restart? Just with a stop and start? Same procedure as above? The error below is raised even during tomcat execution.. I need a little trace to start to investigate.. because now i cannot understand the origin of this error.. Are you sure that your hardware -- particularly the disk -- is okay? Do you use remote-shares or anything like that for your deployment? The stack trace you showed sounds like a complete disaster. I would normally expect that to be the result of a corrupted Tomcat installation, but you say it sometimes works, so it must be an intermittent problem -- hence my questions about reliability of hardware and maybe using a remote (unreliable) filesystem. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJTNZlfAAoJEBzwKT+lPKRY12wP/j533Q+IVcdMfSNKUlSoomVd oHHsp1Srs+YGG5IFBGYDI2nafn+jv6+BR79bESMVRlHLNxZXpE2P+Z83a/Ffmz8N CtJGTqxCEOl3jtx2bFHkxHQm8CFklHhGJgMttdJ3jNRFjj+bQVwE4rE6wxq5lcuc gAjQxFcv2MXPDieJgdMIlbkuazfX4mCmqzvdRoJJxp3Q4KdYJTwq604hKHowTUbz BNhfj/tQdkWGE40zZwzpaPBv13jVarEYNpPzaI303JIpcsCEbc4iOO/PD89ZeJE4 Tgy8vWxm0MIL2Jv15uhajuADn2c4GCxrGrGDcwzlR4JvCxKaCqS8vEEY3XjtxRve weuNEhHI8mlHWWxcpKtNUaE6LCJoLzsZRUAn8WcwQf3ejPyIGgkMaI10bWPLBIT4 o4G0B91EaYtzE88ju/4v7yeYRbR3GminFN37+QLRpXqxByyN9FY+c3ox7PV9BupN eTqL4PPs22UlpKCstUKkEhqa1CuoWeYR1nZjIAatEbGTW2it89G99z4ntF9+/fGl uAhuuVlHIr4R0Wj6eMO5GCfUt9tFKAuSTYhW76q3mZ3oAglbrrUEOv6vdeEAyBBv twlGzU6CTD162AkpKIOtDs7Y/lSCUnstq+1bpZVVu8ozWaSEWUmYaGqc/ZD/vxTl DVCZATXSE6l+82r3eLqJ =lGKT -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [OT] timeout
On Mar 31, 2014 3:48 AM, "André Warnier" wrote: > > Howard W. Smith, Jr. wrote: >> >> On Sun, Mar 30, 2014 at 9:54 PM, Caldarale, Charles R < >> chuck.caldar...@unisys.com> wrote: >> From: Howard W. Smith, Jr. [mailto:smithh032...@gmail.com] Subject: Re: timeout > > - and if that is not the reason, then find the person responsible for >>> >>> the > > in-between equipment and ask them why their junk closes the connection > before your application has a chance to respond 'junk'? please clarify the usage of the word 'junk', here. :) >>> >>> I think the definition "something of poor quality" would fit in this case, >>> if the poor quality were a result of configuring equipment without regard >>> to the requirements of the network users. >>> >>> - Chuck >>> >> >> understood, thanks Chuck. :) >> > > Yes, what I meant precisely was thus : if after receiving numerous complaints from your users and your boss that your application is misbehaving; after an in-depth review of the Apache httpd and tomcat on-line documentation; after a level-headed discussion of the issue with a group of independent experts; after a thorough witnessed interview of a significant sample of the users to ascertain their professional behaviour in front of a browser and the absence of any problem with their mouse buttons; after a careful and time-consuming examination of all the evidence, including the access logs of both tomcat and httpd; if after all that thus you would come to the inescapable conclusion that it is the intermediate firewall/gateway that is the cause of all the trouble, then when you talk to the people responsible for that equipment, the word that might come to mind then, to qualify this equipment and its settings seen as a whole, is "junk". > > Thank you for offering me the opportunity to clarify this section of my previous post. > You're welcome, the pleasure was [almost] all mine, and thank you for the clarification. :-) > > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org >
RE: Problem in accessing link
Hi, Thanks for your answer. There are 2 applications hosted on this Tomcat. 1 is working fine and the other only is giving problems which we are accessing on port 10080. Request inputs on this so that the resolution is found. Regards -Original Message- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: Saturday, March 29, 2014 6:22 PM To: Tomcat Users List Subject: Re: Problem in accessing link -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Randhir, On 3/29/14, 8:38 AM, Randhir Singh wrote: > We are using tomcat in our production setup, the version of tomcat is > 5.0.28. It would be really good for you to investigate upgrading your version of Tomcat. Not only has Tomcat 5.0 been retired, but Tomcat 5.5 has also been retired. Tomcat 8 is about to be released. There are known and unknown unpatched security problems with the Tomcat 5 versions which will never be patched. > While accessing the link hosted on tomcat, the following error is > coming as below: > > -- > -- > -- > > > *HTTP Status 500 - * -- > > *type* Exception report > > *message* > > *description* *The server encountered an internal error () that > prevented it from fulfilling this request.* > > *exception* > > java.lang.NullPointerException > > > com.elitecore.reports.manager.server.GetCompanyInfoServlet.doAction(Ge > tCompanyInfoServlet.java:93) This > is a problem with whatever "elitecore' is. You'll have to look there. > Request you to please advice on what steps should be taken so that > this problem is resolved. This is not a problem with Tomcat: it's a problem with the web application deployed on Tomcat. This is something you'll have to do yourself or engage the original developer. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJTNsHTAAoJEBzwKT+lPKRYqW4QAMW++3uHS1w9b5MmPSrCC8+N Fpzy+yqdlF0x7P35C+yLhOCHi3Q6UdKj6NvYXRUlFJKu02zej7O39P128O/CJCja cAQk917Kf9AWrUmhV7cRX1Kltl0pbZJOI5LSkkD3tJ6Wi7zpGs4xr5X66cqDgVEY rmUQWPMJa8pVB0xN/rRQhwUkRwFMMKk6EZuJLFx6NwctJHgLR17+FpK2HJHWp9Yw g4smAVZRrWw7jGXdktZE5RYDiFvqb8IfOfTuUWWE+Say/jdgsMiRAjAAB0isI7yQ 26Z/F6UB98yQnepBVId6hYAEVr97Cxf2cjIRhYCo6oUhWo+clbJBTQ3MonytStEy b8ABkv+1h2QjLrv9/wX1HgV5SaiKVS75lt4QW9n3FoGPEAfQLC/Y4vU+zoedw0QZ sIk1ujP6+VbvQurniN4Ji8nnrPvFSpROLtb99FPE+nUmMoeSOejPlSbpvS95SKI6 f9O23Q3wI1UrJCFSo5qhamafanEBJ+JKZgMWnyqJqwJL33yxYWo33+QS+vU8AOc/ 41VLbocNotZH6FImCxTX3Uag7VppNOzq7sEQ/bAu+808WJ5AWXxlKwKON3lCcjTn uqkZiQEV9EuS2ljGzJJeYkhLz/C84sBrQaE3bI8P0L44FvC4Fh5wuH3DAFgmlgKG T+9Hhfy/3rl8jlkGllne =Gid1 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org -- *STL Disclaimer:* The content of this message may be legally privileged and confidential and are for the use of the intended recipient(s) only. It should not be read, copied and used by anyone other than the intended recipient(s). If you have received this message in error, please immediately notify the sender, preserve its confidentiality and delete it. Before opening any attachments please check them for viruses and defects. No employee or agent is authorised to conclude any binding agreement on behalf of Sterlite Technologies Limited with another party by email without express written confirmation by authorised person. Visit us at www.sterlitetechnologies.com Please consider environment before printing this email ! - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [OT] timeout
Howard W. Smith, Jr. wrote: On Sun, Mar 30, 2014 at 9:54 PM, Caldarale, Charles R < chuck.caldar...@unisys.com> wrote: From: Howard W. Smith, Jr. [mailto:smithh032...@gmail.com] Subject: Re: timeout - and if that is not the reason, then find the person responsible for the in-between equipment and ask them why their junk closes the connection before your application has a chance to respond 'junk'? please clarify the usage of the word 'junk', here. :) I think the definition "something of poor quality" would fit in this case, if the poor quality were a result of configuring equipment without regard to the requirements of the network users. - Chuck understood, thanks Chuck. :) Yes, what I meant precisely was thus : if after receiving numerous complaints from your users and your boss that your application is misbehaving; after an in-depth review of the Apache httpd and tomcat on-line documentation; after a level-headed discussion of the issue with a group of independent experts; after a thorough witnessed interview of a significant sample of the users to ascertain their professional behaviour in front of a browser and the absence of any problem with their mouse buttons; after a careful and time-consuming examination of all the evidence, including the access logs of both tomcat and httpd; if after all that thus you would come to the inescapable conclusion that it is the intermediate firewall/gateway that is the cause of all the trouble, then when you talk to the people responsible for that equipment, the word that might come to mind then, to qualify this equipment and its settings seen as a whole, is "junk". Thank you for offering me the opportunity to clarify this section of my previous post. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org