RE:Local VisualVM connection to Tomcat
I had a similar problem when using jps/jstat and finally I found someone advising to use -J-Djava.io.tmpdir option. It worked for me, try adding -J-Djava.io.tmpdir when calling visualvm De : Howard W. Smith, Jr. [smithh032...@gmail.com] Envoyé : mardi 23 juillet 2013 00:55 À : Tomcat Users List Objet : Re: Local VisualVM connection to Tomcat On Mon, Jul 22, 2013 at 3:10 PM, honyk j.tosov...@email.cz wrote: On 2013-06-28 Christopher Schultz wrote: On 6/27/13 5:17 PM, honyk wrote: I realized that my tomcat runs as a service but I am logged as an user and in this case the tomcat is not visible to me. I'll test it differently tomorrow. Try running VisualVM as an administrator. I've found the problem, but I have no remedy for it yet. https://java.net/projects/visualvm/lists/users/archive/2013-07/message/2 Briefly, the service uses the TMP environment variable as it is specified for the given user, but when that user is logged remotely, the suffix \session_number is added at the end of this path so these both do not match and VisualVM doesn't detect my tomcat/JVM as expected. I know Chris bashed me for this earlier (on this list), politely, and/or recommended or said something about not to login via administrator into my Windows Server 2008 R2 web app server running TomEE (tomcat7), but... in response to this thread, I login to my Windows SErver 2008 R2 web app server, always, as administrator, and yes (confirmed as Chuck mentioned earlier in this thread), The possibility of services interacting with the desktop disappeared some time ago. so, I just specify a JMX port in my java settings for my TomEE (tomcat7) running as windows service, and specify the JMX port in Java Visual VM, and voila, I think this is saved to Windows registry (or somewhere), and I always see my TomEE (tomcat7) instance when I run Java Visual VM. Of course, the JMX port is not opened on the firewall/router. i just login remotely via remote desktop connection and do what I need to do (stop tomcat7 service, update my app in tomee/webapps, and start tomcat7 service). Others may disagree, but i have found this to be quite secure and as it was said earlier in this thread... a piece of cake. :) - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Tomcat Threads busy
Hi when a request comes to tomcat and tomcat does not have any free thread available or all the threads are busy and request queue is also full then where I need to write the logic for redirect the request to some other server. I have ConnectionRedirectionValve.java already written but in that file the request redirection logic is handled when threads are not sufficient at application level means application inside tomcat do not have any spare semaphore that is handled in this file. Even though when tomcat does not have sufficient threads then I do not think the flow will move to ConnectionRedirectionValve.java So please suggest how to handle this Thanks Anil
Websocket blogs
Hi, I'm going to post the experience I gained while working on websocket and jsr 356 implementation in Tomcat 8. First page is here http://nickytd.wordpress.com/developers-perspective-on-java-api-for-websocket-jsr-356-part-i/ Comments and feedback are welcome. cheers niki
OSGi in Tomcat
Hi guys, I would like to know how can I integrate tomcat with osgi (Equinox)? thank´s. -- Obrigado Leonardo Torres.
Re: OSGi in Tomcat
2013/7/23 Leonardo Torres wrote: Hi guys, I would like to know how can I integrate tomcat with osgi (Equinox)? What exactly do you need? - OSGi running inside Tomcat - Or Tomcat running inside OSGi environment. If this is what you need then you can look at http://eclipse.org/gemini/web Regards Violeta thank´s. -- Obrigado Leonardo Torres.
Re: OSGi in Tomcat
Let me explain my scenario, so you can help me. I have an application that uses the implementation of tomcat to websocket, and this application need to find services dynamically. So I need to use OSGi as service repository. I believe embed OSGi in tomcat, work in my scenario. On Tue, Jul 23, 2013 at 10:31 AM, Violeta Georgieva miles...@gmail.comwrote: 2013/7/23 Leonardo Torres wrote: Hi guys, I would like to know how can I integrate tomcat with osgi (Equinox)? What exactly do you need? - OSGi running inside Tomcat - Or Tomcat running inside OSGi environment. If this is what you need then you can look at http://eclipse.org/gemini/web Regards Violeta thank´s. -- Obrigado Leonardo Torres. -- Obrigado Leonardo Torres.
Re: JSVC - two processes running as root
The version of tomcat installed is 7.0.32 if that helps. Anyone has seen this issue? How do we resolve this? Thanks, Shridev On Thu, Jul 18, 2013 at 3:27 PM, Shridev Makim sma...@gmail.com wrote: Hello, We are trying to run tomcat7 as a daemon using JSVC in SunOS environment. The compiled jsvc executable is owned by root. We have modified daemon.sh that bundles with tomcat7 for our environment to run our tomcat instance. When we execute this shell script, it creates two processes and both the processes are owned by root as shown below (output of ps -ef | grep jsvc): root 9109 9108 2 15:15:03 ? 0:37 /doc/dmadmin6/product/tomcat7/bin/jsvc -java-home /doc/dmadmin6/product/jdk6/jd root 9108 1 0 15:15:03 ? 0:00 /doc/dmadmin6/product/tomcat7/bin/jsvc -java-home /doc/dmadmin6/product/jdk6/jd We are running the shell script as a non privileged user (dmadmin6) and we are even passing this user name with -user switch to jsvc. We were expecting the child process (pid 9109) to be run as a non privileged user (dmadmin6) in our case. Anyone else has experienced this? Currently in production we have tomcat 6 configured to run with jsvc and in that environment we see that the child process is running as a non privileged user. Thanks in advance for your help! -- Shridev -- Shridev Makim sma...@gmail.com 678-557-6023 (cell)
Re: OSGi in Tomcat
2013/7/23 Leonardo Torres wrote: Let me explain my scenario, so you can help me. I have an application that uses the implementation of tomcat to websocket, and this application need to find services dynamically. So I need to use OSGi as service repository. I believe embed OSGi in tomcat, work in my scenario. Then check that http://eclipse.dzone.com/articles/embedding-osgi-tomcat
RE: Local VisualVM connection to Tomcat
On 2013-07-23 Eugène Adell wrote: On Mon, Jul 22, 2013 at 3:10 PM, honyk j.tosov...@email.cz wrote: On 2013-06-28 Christopher Schultz wrote: On 6/27/13 5:17 PM, honyk wrote: I realized that my tomcat runs as a service but I am logged as an user and in this case the tomcat is not visible to me. Try running VisualVM as an administrator. I've found the problem, but I have no remedy for it yet. https://java.net/projects/visualvm/lists/users/archive/2013- 07/message/2 Briefly, the service uses the TMP environment variable as it is specified for the given user, but when that user is logged remotely, the suffix \session_number is added at the end of this path so these both do not match and VisualVM doesn't detect my tomcat/JVM as expected. I had a similar problem when using jps/jstat and finally I found someone advising to use -J-Djava.io.tmpdir option. It worked for me, try adding -J-Djava.io.tmpdir when calling visualvm This helped a bit. Now I can see two extra Unknown Applications, but without any details. One pid belongs to tomcat. From this http://visualvm.java.net/troubleshooting.html I suppose I changed only one of two paths which should match: While 'java.io.tmpdir' is now %TMP%\hsperfdata_username, ?jvmstat? is still looking for the content here: %TMP%\SessionNumber\hsperfdata_username I'll consult this behaviour with VisualVM developers. Jan - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
JMX monitoring of tomcat service
Dear All, I run tomcat as service on Windows Server 2008 R2. I am not able to monitor it locally yet (discussed in another thread) so in the meantime I am trying to establish JMX connection to it acc. to this guide: http://tomcat.apache.org/tomcat-7.0-doc/monitoring.html All params are changed using tomcat7w.exe (in the Java options text field) and then the service is restarted. I am experiencing several weird issues: 1) Basic settings (single line): -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9090 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false Firewal is deactivated, but I cannot access tomcat via VisualVM JMX ('remotely', but from the same PC) using the localhost:9090 path (could not find the server). The same result for 127.0.0.1 or exact local IP address. ...seting the first otpion to true... -Dcom.sun.management.jmxremote=true ... same result ... one extra option -Djava.rmi.server.hostname=MY_IP_ADDRESS ...same result 2) Using listener http://www.liferay.com/web/thiago.moreira/blog/-/blogs/how-to-monitor-lifera y-tomcat-remotely-through-firewalls-using-visualvm I downloaded extra jar file, placed it to /lib folder and edited server.xml file. a) From that moment on credentials were required regardless authentication has been set to true or false. b) When credentials files were specified, there were still 'FileNotFound' errors in the log (even when absolute paths were used): -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9090 -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.password.file=../conf/jmxremote.password -Dcom.sun.management.jmxremote.access.file=../conf/jmxremote.access -Dcom.sun.management.jmxremote.ssl=false Any way, after many attempts I haven't found any solution how to monitor my Tomcat instance yet :-( Am I missing something? Jan - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: JSVC - two processes running as root
Shridev, On 23.7.2013 16:14, Shridev Makim wrote: The version of tomcat installed is 7.0.32 if that helps. Anyone has seen this issue? How do we resolve this? FWIW, I'm running JSVC for years, and I never saw anything similar. When we execute this shell script, it creates two processes and both the processes are owned by root as shown below (output of ps -ef | grep jsvc): ... We are running the shell script as a non privileged user (dmadmin6) This is strange... How is it possible that non privileged user creates two processes owned by root? Could you post your full tomcat script (daemon.sh), and full ouput of ps -fHA | grep jsvc command? -Ognjen - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: JSVC - two processes running as root
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Ognjen, On 7/23/13 12:15 PM, Ognjen Blagojevic wrote: Shridev, On 23.7.2013 16:14, Shridev Makim wrote: The version of tomcat installed is 7.0.32 if that helps. Anyone has seen this issue? How do we resolve this? FWIW, I'm running JSVC for years, and I never saw anything similar. When we execute this shell script, it creates two processes and both the processes are owned by root as shown below (output of ps -ef | grep jsvc): ... We are running the shell script as a non privileged user (dmadmin6) This is strange... How is it possible that non privileged user creates two processes owned by root? Could you post your full tomcat script (daemon.sh) Or, better yet, a diff of the script against the original. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJR7q7iAAoJEBzwKT+lPKRYkSAP/3ciB1qAT1M6hViY3tUXhMQQ pdT1hdlkH7Yv1qyQfXBvBH7uQW21Do3vWhZYzm127ex+iE/8k2LvQihA2bNKrb0N 30gSUatM2FfN+PPalRBASGVCwylohpjSyhagxuMM23ELZ3lmU94XYC+LFonu2PVk ggOWnpw74aZPHWPQanAytCo2X5FAmlcOtHYZnrUsldpvHLgYW+/7LIovgsYJsq0S S6bQ9xE2yXfK8ore+9mT5UM/KlHZOCOoRzoMFvUdyHMSzjhWlFVwvuVrziqfxvi/ l/jut+yeb6AJbi4miyWDPnutoeIqqdxjt4ytpAMG71jXIyej81EV+bFfq4SmBitN YootqAboQftMTysrftgK6CeF9xz3FICrgDMvMr+3kZjIGprphGunGypWe4L5+A5O girNMd5NOgf92YgB6WhAgUo76eZM7/yFAUIA42lVWa9jTxUjpESkN3QXJc77Iwlm ZxknYjnr8NqDalhCWzn2RiutC8Vi83LnMCTDX18yA/Afs7VGoujnAvGJyjgKzwLH an9UpQjkXEb3qkt2px7MFHDuNMnt2XkCb+OTaKzPErDw6fK/hNTCcQtOxh7wQFLw ypg8gfALxfu153vW712vrxIcqxkSN7ALIcNM7SjhhYAB6jruZ/2rey2CmGKLi8bm ms2QmF6U0vyHG6/WulM9 =F/NH -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat Threads busy
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Anil, On 7/23/13 4:35 AM, Anil Goyal -X (anigoyal - ARICENT TECHNOLOGIES MAURIITIUS LIMITED at Cisco) wrote: That logic needs to happen in another layer, in a load-balancer. Tomcat cannot do this on its own. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJR7q9aAAoJEBzwKT+lPKRYyWsQAMCXavCXXodFgfPMaWg000eQ 0s4i4zVe3fqcUjfgeMoVua1xmYvV8cfe1t+4GDdZWDqBIpc+fBCfi0pkQKa0itUL vmQ+vKQ/QJ9U+v0IJ272Hj/C7ar0F5/7m9A3SDF+dMxHPHwa6skUOG2X4RQXLzah 8KZ9aGQUigsMkwQLtV6Oa3eAkqxknyLPyyuMbrEWNLj7rcQz/6lghT2nWI/SdKz0 OTOGw+t4U01JM9cWldxqt2oJ7Q3/r8sVDhBcEURJPGXXs3g6SoOOJl0kZb8a5QQj 5tNSlb/jKx0ACT4jyUQqQOUx/flksa8tIjio4AWwgWRklqgF6xW3S8tGfxq1inRm PL33KkkBeV7VyoTQiw9QRash37wx2uuGTP+BC8ARO8zu8ugF66YxeNBmBcQEXipX vSthyIxvTMqf0JBGAPardKn2eYlCeV2lkvGjiVwdq1J6DlB4eaBaXj5JiOh+sy1O DMRCAjHj4G0QNOBCFdw+jcXRT1LIidRxjn8yRvc5jql13jBLf80A/mIHWJudOThA ox7lxyzu3V+G1iCfKdgIt7tO+QtjJiYpSSTDmRF253GvYGF4W4KxIOpYPrQy/ZVH vG4P9BY4JEkXNPQKpCI0zzc31GyhP+D2yHSPLmJCTTzsX9bhRuYfE4ROzui0fPxh LRb9RuK/f/hfaqJCixPt =VwAB -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: JSVC - two processes running as root
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Shridev, On 7/18/13 3:27 PM, Shridev Makim wrote: Hello, We are trying to run tomcat7 as a daemon using JSVC in SunOS environment. The compiled jsvc executable is owned by root. We have modified daemon.sh that bundles with tomcat7 for our environment to run our tomcat instance. When we execute this shell script, it creates two processes and both the processes are owned by root as shown below (output of ps -ef | grep jsvc): root 9109 9108 2 15:15:03 ? 0:37 /doc/dmadmin6/product/tomcat7/bin/jsvc -java-home /doc/dmadmin6/product/jdk6/jd root 9108 1 0 15:15:03 ? 0:00 /doc/dmadmin6/product/tomcat7/bin/jsvc -java-home /doc/dmadmin6/product/jdk6/jd We are running the shell script as a non privileged user (dmadmin6) and we are even passing this user name with -user switch to jsvc. We were expecting the child process (pid 9109) to be run as a non privileged user (dmadmin6) in our case. Anyone else has experienced this? Currently in production we have tomcat 6 configured to run with jsvc and in that environment we see that the child process is running as a non privileged user. http://commons.apache.org/proper/commons-daemon/jsvc.html#How_jsvc_works Note that jsvc is not a Tomcat component; it's part of Apache Commons. The jsvc daemon you use with Tomcat 6 is likely to be (virtually) identical to that which you use with Tomcat 7. You didn't tell us how you have modified the daemon.sh script, so we have no idea what could be happening. It would be good if you could give us much, much more detail. Thanks, - -chris -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJR7ranAAoJEBzwKT+lPKRYcVEQAKtvpN4keXKsKMi5LLApCbcb S2LPrmveT5Ij+G7vFc5I8ngXx2qxC50wgUb4sKBVKb/nblgFWPyoO2eGPPbTvWMn 62CG6vdGUIkmTFYuInJQcYPyLYjoLtpSSfaQw3lC3lkrNAYOWi5k0yhSz/DMUGWU HPLOLiM6VAffwAO3zOOhWROb8/zIQ1yaeFSP52wF0W/YR22MlrABJItb908tY7PH 3Zg6XqM7Vw/W9JUy5a0VlATd6vfOsPvXwcasm7/XHmjkh3cTscfV/3Vxz0Zeh4vR awXgR/8/uJyRsroD80NIUIEeIfV2+iZf2siuZTVjTpZEhG1lPrpTEYSic+TvmicG gs5RPMKwGAfDAR1R3opa7zILakqHsreAHfJpTAfuIz/tZrX/iJv+zqCHp4+V2lII asoAR7xZd33P2ckaJObjVuC9Y0nkRV4lQOX3yymMrVgk+TbWcbV49bwgAS97hVq3 YLsG3x0MNzhntnoDG44R+bOkvYdOOu9cVQcZukz2roK6wT7vcKpEGb4QGovaPNt5 zOpZyiAFB/JyFvn2hbmYdKB4c1+hzHdp1TDj01JnFBcqegMzosM20X7pTwTdDpxP 2aD3SV8DZ4GzgM0BNQplzVQGbQE+YskhFFOGYaP3j0W8RyVVpjmFW/JedfHEPezN UroOUgy+SugSsLz2ZedP =aSbM -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: JMX monitoring of tomcat service
2013/7/23 honyk j.tosov...@email.cz: Dear All, I run tomcat as service on Windows Server 2008 R2. I am not able to monitor it locally yet (discussed in another thread) so in the meantime I am trying to establish JMX connection to it acc. to this guide: http://tomcat.apache.org/tomcat-7.0-doc/monitoring.html All params are changed using tomcat7w.exe (in the Java options text field) and then the service is restarted. I am experiencing several weird issues: 1) Basic settings (single line): -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9090 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false If these properties are on the same line in the java options tab, it won't work they need to be on different lines. [...] b) When credentials files were specified, there were still 'FileNotFound' errors in the log (even when absolute paths were used): -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9090 -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.password.file=../conf/jmxremote.password -Dcom.sun.management.jmxremote.access.file=../conf/jmxremote.access -Dcom.sun.management.jmxremote.ssl=false When launching tomcat as a service, without changing the default configuration, it will start in the system32 folder (or something else on Win 2008) and not in the tomcat folder. So the path for password file and acces file should be absolute - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: JSVC - two processes running as root
On Tue, Jul 23, 2013 at 1:00 PM, Christopher Schultz ch...@christopherschultz.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Shridev, On 7/18/13 3:27 PM, Shridev Makim wrote: Hello, We are trying to run tomcat7 as a daemon using JSVC in SunOS environment. The compiled jsvc executable is owned by root. We have modified daemon.sh that bundles with tomcat7 for our environment to run our tomcat instance. When we execute this shell script, it creates two processes and both the processes are owned by root as shown below (output of ps -ef | grep jsvc): root 9109 9108 2 15:15:03 ? 0:37 /doc/dmadmin6/product/tomcat7/bin/jsvc -java-home /doc/dmadmin6/product/jdk6/jd root 9108 1 0 15:15:03 ? 0:00 /doc/dmadmin6/product/tomcat7/bin/jsvc -java-home /doc/dmadmin6/product/jdk6/jd We are running the shell script as a non privileged user (dmadmin6) and we are even passing this user name with -user switch to jsvc. We were expecting the child process (pid 9109) to be run as a non privileged user (dmadmin6) in our case. Anyone else has experienced this? Currently in production we have tomcat 6 configured to run with jsvc and in that environment we see that the child process is running as a non privileged user. http://commons.apache.org/proper/commons-daemon/jsvc.html#How_jsvc_works Note that jsvc is not a Tomcat component; it's part of Apache Commons. The jsvc daemon you use with Tomcat 6 is likely to be (virtually) identical to that which you use with Tomcat 7. You didn't tell us how you have modified the daemon.sh script, so we have no idea what could be happening. It would be good if you could give us much, much more detail. Thanks, - -chris -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJR7ranAAoJEBzwKT+lPKRYcVEQAKtvpN4keXKsKMi5LLApCbcb S2LPrmveT5Ij+G7vFc5I8ngXx2qxC50wgUb4sKBVKb/nblgFWPyoO2eGPPbTvWMn 62CG6vdGUIkmTFYuInJQcYPyLYjoLtpSSfaQw3lC3lkrNAYOWi5k0yhSz/DMUGWU HPLOLiM6VAffwAO3zOOhWROb8/zIQ1yaeFSP52wF0W/YR22MlrABJItb908tY7PH 3Zg6XqM7Vw/W9JUy5a0VlATd6vfOsPvXwcasm7/XHmjkh3cTscfV/3Vxz0Zeh4vR awXgR/8/uJyRsroD80NIUIEeIfV2+iZf2siuZTVjTpZEhG1lPrpTEYSic+TvmicG gs5RPMKwGAfDAR1R3opa7zILakqHsreAHfJpTAfuIz/tZrX/iJv+zqCHp4+V2lII asoAR7xZd33P2ckaJObjVuC9Y0nkRV4lQOX3yymMrVgk+TbWcbV49bwgAS97hVq3 YLsG3x0MNzhntnoDG44R+bOkvYdOOu9cVQcZukz2roK6wT7vcKpEGb4QGovaPNt5 zOpZyiAFB/JyFvn2hbmYdKB4c1+hzHdp1TDj01JnFBcqegMzosM20X7pTwTdDpxP 2aD3SV8DZ4GzgM0BNQplzVQGbQE+YskhFFOGYaP3j0W8RyVVpjmFW/JedfHEPezN UroOUgy+SugSsLz2ZedP =aSbM -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org Thanks guys for responding. Here are the content of the script. We invoke this shell script with passing only one parameter named start. Only thing modified in the daemon.sh script was to change the TOMCAT_USER to dmadmin6 in line nbr 86. #!/bin/sh # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the License); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an AS IS BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # - # Commons Daemon wrapper script. # # $Id: daemon.sh 1202058 2011-11-15 06:37:12Z mturk $ # - # # resolve links - $0 may be a softlink ARG0=$0 while [ -h $ARG0 ]; do ls=`ls -ld $ARG0` link=`expr $ls : '.*- \(.*\)$'` if expr $link : '/.*' /dev/null; then ARG0=$link else ARG0=`dirname $ARG0`/$link fi done DIRNAME=`dirname $ARG0` PROGRAM=`basename $ARG0` while [ .$1 != . ] do case $1 in --java-home ) JAVA_HOME=$2 shift; shift; continue ;; --catalina-home ) CATALINA_HOME=$2 shift; shift; continue ;; --catalina-base ) CATALINA_BASE=$2 shift; shift; continue ;; --catalina-pid ) CATALINA_PID=$2 shift; shift; continue ;; --tomcat-user ) TOMCAT_USER=$2 shift; shift; continue ;; * ) break ;; esac done #
RE: JMX monitoring of tomcat service
On 2013-07-23 Cédric Couralet wrote: 2013/7/23 honyk j.tosov...@email.cz: Dear All, I run tomcat as service on Windows Server 2008 R2. I am not able to monitor it locally yet (discussed in another thread) so in the meantime I am trying to establish JMX connection to it acc. to this guide: http://tomcat.apache.org/tomcat-7.0-doc/monitoring.html All params are changed using tomcat7w.exe (in the Java options text field) and then the service is restarted. I am experiencing several weird issues: 1) Basic settings (single line): -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9090 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false If these properties are on the same line in the java options tab, it won't work they need to be on different lines. Ooops... What a shame. Looking into various sources it really seems to be my fatal mistake. I'll check tomorrow. b) When credentials files were specified, there were still 'FileNotFound' errors in the log (even when absolute paths were used): -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9090 -Dcom.sun.management.jmxremote.authenticate=true - Dcom.sun.management.jmxremote.password.file=../conf/jmxremote.password -Dcom.sun.management.jmxremote.access.file=../conf/jmxremote.access -Dcom.sun.management.jmxremote.ssl=false When launching tomcat as a service, without changing the default configuration, it will start in the system32 folder (or something else on Win 2008) and not in the tomcat folder. So the path for password file and acces file should be absolute I tried absolute paths as well, but this result is most likely related to the above case - all my Java options were on the single line, thus most likely ignored completely. Jan - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: OSGi in Tomcat
Thank´s for reply. Just one more question, If I want to use tomcat inside of OSGi environment, how can I do that ? On Tue, Jul 23, 2013 at 12:50 PM, Violeta Georgieva miles...@gmail.comwrote: 2013/7/23 Leonardo Torres wrote: Let me explain my scenario, so you can help me. I have an application that uses the implementation of tomcat to websocket, and this application need to find services dynamically. So I need to use OSGi as service repository. I believe embed OSGi in tomcat, work in my scenario. Then check that http://eclipse.dzone.com/articles/embedding-osgi-tomcat -- Obrigado Leonardo Torres.
Re: JSVC - two processes running as root
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Shridev, On 7/23/13 2:41 PM, Shridev Makim wrote: Thanks guys for responding. Here are the content of the script. We invoke this shell script with passing only one parameter named start. Only thing modified in the daemon.sh script was to change the TOMCAT_USER to dmadmin6 in line nbr 86. Why bother changing the script when you can either set the TOMCAT_USER environment variable or pass --tomcat-user to the script? Here is the output of the ps -fA | grep jsvc command ( -H was giving illegal option error): root 6574 1 0 14:36:48 ? 0:00 /doc/dmadmin6/product/tomcat7/bin/jsvc -java-home /doc/dmadmin6/product/jdk6/jd dmadmin6 6606 5152 0 14:38:15 pts/2 0:00 grep jsvc root 6575 6574 0 14:36:48 ? 0:23 /doc/dmadmin6/product/tomcat7/bin/jsvc -java-home /doc/dmadmin6/product/jdk6/jd I can't make head or tail out of that 'ps' output. Can you clean it up a bit? It looks like word-wrapping is confusing things. Try adding the -w switch to get more than 80 (or whatever) column output. And here is the output of the version.sh: Using CATALINA_BASE: /doc/dmadmin6/product/tomcat7 Using CATALINA_HOME: /doc/dmadmin6/product/tomcat7 Using CATALINA_TMPDIR: /doc/dmadmin6/product/tomcat7/temp Using JRE_HOME: /doc/dmadmin6/product/jdk6/jdk1.6.0_37/jre Using CLASSPATH: /doc/dmadmin6/product/tomcat7/bin/bootstrap.jar:/doc/dmadmin6/product/tomcat7/bin/tomcat-juli.jar Server version: Apache Tomcat/7.0.32 Server built: Oct 3 2012 08:51:20 Server number: 7.0.32.0 At any rate, you should upgrade to Tomcat 7.0.42. Lots of good fixes since 7.0.32. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJR7vAMAAoJEBzwKT+lPKRY1lUP/3wgTknPYLEebeaisOLf5Hgs Qwh0T1kdSAVcOGRTFXMT2VldOHaO/Obc60dJ1/XGjiO/qePAc/OEK2JLVKfznf0j OCmv3atALJ2w/L1vGxAFmPpV4EcYQF98xh+VfIsZ1i640CfCxIKueAImgU9WHX+w WROQIfGJQ38IgTZECwGl+UujEJyJq23PBoLE4WKTy+UpQqZku7pfttWWRPLzbiQ5 WcU6FyYkrPgYnh3XltZWaz9cEXtf3ABjlSZarqGi9jZ6EyR2lv7VQKVvDulxkrn/ qk3/HQAH7X4EmyPpNnFx0RKDZ64gaZtcXLE98Sp/wMMy1Mq0I1IXXKgAjeDtXjt/ c/Of0OiO/g0F4yZ92LryDtqbsUgoo2r+Mdz1zaB7RqzF9IGxJLGoGEIcgMDccIll uDAIINUVXg32c/bMurmjt0LozSFrx5PGvWYxMzMVLgbrK/p1Ie0y8BJIQeGKF0FD uYbgWWxhAXVdGgBw82N4Iw5fFxJa3fh/LZ3D1Evg/+t7C88emagtDpYM9EGxfLQN EX58ZVabAU96B/UK4u3DPTx0y434NaxcrQqsdcZZt/OF8X7J24mf0fVmopUZlxRF TfiurORz817wPxqoUwA9iFJPjaGAcBiTOGWzwq82ZFM9hO+1xckd13NbAO9tnpOF VrFr+l/EoVvCmh+/GA0b =81+x -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: JSVC - two processes running as root
Shridev, On 23.7.2013 20:41, Shridev Makim wrote: Here are the content of the script. Your script looks ok to me. 1. Do you actually have user dmadmin6 on your system? Does su - dmadmin6 works for you? 2. Did you compiled jsvc as described in the docs [1]? 3. Do you invoke your script as user root? In the first message you wrote that you invoke your script as non-priviledged user, which is wrong. You should invoke your startup script as root. Jsvc should create process owned by root, and a child process owned by dmadmin6. [1] http://tomcat.apache.org/tomcat-7.0-doc/setup.html#Unix_daemon Here is the output of the ps -fA | grep jsvc command ( -H was giving illegal option error): I acually wanted to see all jsvc parameters, not truncated one. Could you try to redirect output of ps to file, and paste it from there? Here is the example of ps output with all parameters: root 31235 1 0 23:07 ?00:00:00 jsvc.exec -java-home /usr/java/default -user dmadmin6 -pidfile /usr/local/tomcat-base/logs/catalina-daemon.pid -wait 10 -outfile /usr/local/tomcat-base/logs/catalina-daemon.out -errfile 1 -classpath /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/commons-daemon.jar:/usr/local/tomcat/bin/tomcat-juli.jar -Djava.util.logging.config.file=/usr/local/tomcat-base/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Dorg.apache.el.parser.COERCE_TO_ZERO=false -Xms200m -Xmx200m -Djava.endorsed.dirs= -Dcatalina.base=/usr/local/tomcat-base -Dcatalina.home=/usr/local/tomcat -Djava.io.tmpdir=/usr/local/tomcat-base/temp org.apache.catalina.startup.Bootstrap dmadmin6 31236 31235 64 23:07 ?00:00:06 jsvc.exec -java-home /usr/java/default -user dmadmin6 -pidfile /usr/local/tomcat-base/logs/catalina-daemon.pid -wait 10 -outfile /usr/local/tomcat-base/logs/catalina-daemon.out -errfile 1 -classpath /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/commons-daemon.jar:/usr/local/tomcat/bin/tomcat-juli.jar -Djava.util.logging.config.file=/usr/local/tomcat-base/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Dorg.apache.el.parser.COERCE_TO_ZERO=false -Xms200m -Xmx200m -Djava.endorsed.dirs= -Dcatalina.base=/usr/local/tomcat-base -Dcatalina.home=/usr/local/tomcat -Djava.io.tmpdir=/usr/local/tomcat-base/temp org.apache.catalina.startup.Bootstrap -Ognjen - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: JMX monitoring of tomcat service
On 24/07/2013 5:34 AM, honyk j.tosov...@email.cz wrote: On 2013-07-23 Cédric Couralet wrote: 2013/7/23 honyk j.tosov...@email.cz: Dear All, I run tomcat as service on Windows Server 2008 R2. I am not able to monitor it locally yet (discussed in another thread) so in the meantime I am trying to establish JMX connection to it acc. to this guide: http://tomcat.apache.org/tomcat-7.0-doc/monitoring.html All params are changed using tomcat7w.exe (in the Java options text field) and then the service is restarted. I am experiencing several weird issues: 1) Basic settings (single line): -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9090 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false If these properties are on the same line in the java options tab, it won't work they need to be on different lines. Ooops... What a shame. Looking into various sources it really seems to be my fatal mistake. I'll check tomorrow. b) When credentials files were specified, there were still 'FileNotFound' errors in the log (even when absolute paths were used): -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9090 -Dcom.sun.management.jmxremote.authenticate=true - Dcom.sun.management.jmxremote.password.file=../conf/jmxremote.password -Dcom.sun.management.jmxremote.access.file=../conf/jmxremote.access -Dcom.sun.management.jmxremote.ssl=false When launching tomcat as a service, without changing the default configuration, it will start in the system32 folder (or something else on Win 2008) and not in the tomcat folder. So the path for password file and acces file should be absolute I tried absolute paths as well, but this result is most likely related to the above case - all my Java options were on the single line, thus most likely ignored completely. Jan - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org Do you have the Listener setup in your server.xml?
RE: Re:[OT] Enable session persistence between two tomcat nodes behind load balancer
-Original Message- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: Monday, July 22, 2013 5:45 PM To: Tomcat Users List Subject: Re:[OT] Enable session persistence between two tomcat nodes behind load balancer -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Jeffrey, On 7/22/13 10:00 AM, Jeffrey Janner wrote: -Original Message- From: vi...@thepenguin.org [mailto:vi...@thepenguin.org] Sent: Saturday, July 20, 2013 7:25 AM To: Tomcat Users List Subject: Enable session persistence between two tomcat nodes behind load balancer Hello: I have been searching for an answer to how to set this up. I find a lot of posts on session persistence but none seem to describe how to set it up. Is there a simple explanation out there that tells me how I go about setting up session persistence (with Apache, I would just set up memcached on the db server and configure the memcache module on each Apache instance to point to the memcached and it works). I don't need opcode persistence. I just want the tomcats to either a) direct all session traffic to a single node or b) make the two tomcats aware of all sessions. Can someone point me in the right direction? I am not a java coder, but if code changes need to be made, I can work through it. Thanks, Vicki Vicki - I think you've got your terms a little mixed up here, but not much. From your description what you are really looking for is session replication. You are in luck, because the default server.xml has a commented out section on how to set up replication right there (at least up to Tomcat 6.x). You also want to review the documentation on replication on the Tomcat website for your release (http://tomcat.apache.org). I said not much above, because replication relies on persistence-ability, meaning they both need the same basic setup in order to work. As I recall from looking into it (but not setting up a production setup), you must declare your sessions persistable in your code for either function to work properly. Jeff p.s. In case you're wondering why not production, turns out our initial dev team put way too much info in the session to make replication a feasible option for us at the time. I think we've been whittling it away over time, but haven't tried it since the first effort. I've written (but not actually used - it was just a proof-of-concept) a Filter and HttpSession wrapper that can wrap session data in an object wrapper whose only member is a transient Object reference[1]. This will allow you to throw huge objects into the session that won't be sent across the wire (only their empty wrappers will be sent). If your application will tolerate a session attribute suddenly being null, and can recover from that by re-building the necessary data, you could use the same trick to enable Tomcat's session persistence. - -chris [1] You can also do something similar with WeakReference objects, which allows you to keep huge amounts of data cached in your sessions but allow the garbage collector to discard some of that cached data if it's getting low on memory. Thanks for the insight Chris, but I seriously doubt our code is that resilient. Besides, I'd much rather have code that's done right rather than a bunch of band-aids to work around the issues. Having a similar discussion right now about an issue that could be fixed in under 10 lines of code changes, a rebuild, and an update of the affected client (a phoneapp), but I'm have to deal with it in a massive configuration change because that's easier for the dev team. (Codespeack for no one really knows how to modify phoneapp).
Re: JSVC - two processes running as root
Chris, On 23.7.2013 23:05, Christopher Schultz wrote: Why bother changing the script when you can either set the TOMCAT_USER environment variable or pass --tomcat-user to the script? Speaking of which, maybe the TOMCAT_USER environment variable is actually set to root, so modification of the script was a futile one? Ps output should clear things up. -Ognjen - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: SingleSignOn valve enabled by default?
NO: !-- /conf/server.xml -- !-- SingleSignOn valve, share authentication between web applications Documentation at: /docs/config/valve.html -- !-- Valve className=org.apache.catalina.authenticator.SingleSignOn / -- YES: !-- /conf/server.xml -- !-- SingleSignOn valve, share authentication between web applications Documentation at: /docs/config/valve.html -- Valve className=org.apache.catalina.authenticator.SingleSignOn / Martin __ Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. Date: Fri, 19 Jul 2013 20:16:32 +0800 From: soul2zim...@gmail.com To: users@tomcat.apache.org Subject: SingleSignOn valve enabled by default? Hi all, I have an issue with SSO configuration in tomcat 7.0.42. According to the doc [1], it requires to enable SSO valve inside server.xml. However, without making such modification, I deployed two web-app test.war and test2.war (see attached file). Then, try to login from /test, after successful login, I don't need to login a second time for /test2 and can see the secured welcome page directly . That's strange for me, is the SingleSignOn valve enabled by default in tomcat? FYI, I add following configuration in tomcat-user.xml role rolename=User/ user username=test password=pass.1234 roles=User/ If it's not a real issue, please point me how that works, and I'd like to know how could I set the reauthenticate parameter for SSO. [1] http://tomcat.apache.org/tomcat-7.0-doc/config/host.html#Single_Sign_On Thanks Regards, - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [OT] Enable session persistence between two tomcat nodes behind load balancer
On 7/23/2013 5:51 PM, Jeffrey Janner wrote: -Original Message- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: Monday, July 22, 2013 5:45 PM To: Tomcat Users List Subject: Re:[OT] Enable session persistence between two tomcat nodes behind load balancer -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Jeffrey, On 7/22/13 10:00 AM, Jeffrey Janner wrote: -Original Message- From: vi...@thepenguin.org [mailto:vi...@thepenguin.org] Sent: Saturday, July 20, 2013 7:25 AM To: Tomcat Users List Subject: Enable session persistence between two tomcat nodes behind load balancer Hello: I have been searching for an answer to how to set this up. I find a lot of posts on session persistence but none seem to describe how to set it up. Is there a simple explanation out there that tells me how I go about setting up session persistence (with Apache, I would just set up memcached on the db server and configure the memcache module on each Apache instance to point to the memcached and it works). I don't need opcode persistence. I just want the tomcats to either a) direct all session traffic to a single node or b) make the two tomcats aware of all sessions. Can someone point me in the right direction? I am not a java coder, but if code changes need to be made, I can work through it. Thanks, Vicki Vicki - I think you've got your terms a little mixed up here, but not much. From your description what you are really looking for is session replication. You are in luck, because the default server.xml has a commented out section on how to set up replication right there (at least up to Tomcat 6.x). You also want to review the documentation on replication on the Tomcat website for your release (http://tomcat.apache.org). I said not much above, because replication relies on persistence-ability, meaning they both need the same basic setup in order to work. As I recall from looking into it (but not setting up a production setup), you must declare your sessions persistable in your code for either function to work properly. Jeff p.s. In case you're wondering why not production, turns out our initial dev team put way too much info in the session to make replication a feasible option for us at the time. I think we've been whittling it away over time, but haven't tried it since the first effort. I've written (but not actually used - it was just a proof-of-concept) a Filter and HttpSession wrapper that can wrap session data in an object wrapper whose only member is a transient Object reference[1]. This will allow you to throw huge objects into the session that won't be sent across the wire (only their empty wrappers will be sent). If your application will tolerate a session attribute suddenly being null, and can recover from that by re-building the necessary data, you could use the same trick to enable Tomcat's session persistence. - -chris [1] You can also do something similar with WeakReference objects, which allows you to keep huge amounts of data cached in your sessions but allow the garbage collector to discard some of that cached data if it's getting low on memory. Thanks for the insight Chris, but I seriously doubt our code is that resilient. Besides, I'd much rather have code that's done right rather than a bunch of band-aids to work around the issues. Having a similar discussion right now about an issue that could be fixed in under 10 lines of code changes, a rebuild, and an update of the affected client (a phoneapp), but I'm have to deal with it in a massive configuration change because that's easier for the dev team. (Codespeack for no one really knows how to modify phoneapp). That makes me glad that I'm the one and only for our setup, both developer and server administrator. At least I get to choose how I want to handle issues, whether in code or in some kind of external configuration. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org