Re: Bug in tomcat scripts?

2008-08-13 Thread Enrique Arizón




- Mensaje original 
De: Christopher Schultz [EMAIL PROTECTED]
Para: Tomcat Users List users@tomcat.apache.org
Enviado: martes, 12 de agosto, 2008 19:30:51
Asunto: Re: Bug in tomcat scripts?

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Enrique,

Enrique Arizón wrote:
| # rm -rf $(cwd)/..  /etc/init.d/tomcat5 restart

Does this seem like a good idea to you?

Hmm... I added 'rm -rf' to my script and now I can't find any files!

The use case was more complex actually. My tomcat app keeps some data in the 
.../webapp/MyApp directory. During unit tests I remove MyApp, redeploy it after 
compiling and restart tomcat. (Not such an unusual scenario). The case is that 
the remove  redeploy  restart is executed in a shell script, and if 
suddenly I execute it while in webapp/MyApp tomcat is destroyed.

 I can't imagine that this has anything to do with the scripts that ship with 
any version of Tomcat.

Maybe you could post the entire script and we can figure out why you might want 
to delete an entire directory tree just for the heck of it.

- -chris

After browsing the scripts it looks to be related with the makeHomeDir() 
function in the Mandriva /etc/init.d/tomcat5 script. (I attach the file in case 
you are interested).

Regards,

Enrique

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkihyMsACgkQ9CaO5/Lv0PCjfACggbCbf7ERUoJX0aYw59bhY7Qx
TRMAn2pLYxOQQMOnKRwHPZlKdhir6XeS
=wjpc
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Bug in tomcat scripts?

2008-08-12 Thread Enrique Arizón
I suddenly removed my cwd just prior to start tomcat. Briefly, the script would 
be similar to:

# rm -rf $(cwd)/..  /etc/init.d/tomcat5 restart

after which I got lot of errors and tomcat broke (broke == I reinstalled the 
rpm package to make it work again). The worst thing is that after the first run 
of the suicide command when executing:

 # /etc/init.d/tomcat5 start

doesn't work but doesn't display any errors and returns OK.


The error list is similar to:
shell-init: error retrieving current directory: getcwd: cannot access parent 
directories: No existe el fichero o el directorio
Deteniendo tomcat5: [  OK  ]
Iniciando tomcat5: shell-init: error retrieving current directory: getcwd: 
cannot access parent directories: File or directory doesn't exists.
shell-init: error retrieving current directory: getcwd: cannot access parent 
directories: File or directory doesn't exists.
pushd: error retrieving current directory: getcwd: cannot access parent 
directories: File or directory doesn't exists.
/bin/ln: creating symbolic link «[commons-collections-tomcat5].jar»: File or 
directory doesn't exists.
/bin/ln: creating symbolic link «[commons-dbcp-tomcat5].jar»: File or directory 
doesn't exists.
/bin/ln: creating symbolic link «[commons-el].jar»: File or directory doesn't 
exists.
/bin/ln: creating symbolic link «[commons-pool-tomcat5].jar»: File or directory 
doesn't exists.
/bin/ln: creating symbolic link «[ecj].jar»: File or directory doesn't exists.
/bin/ln: creating symbolic link «[jaf].jar»: File or directory doesn't exists.
/bin/ln: creating symbolic link «[jasper5-compiler].jar»: File or directory 
doesn't exists.
/bin/ln: creating symbolic link «[jasper5-runtime].jar»: File or directory 
doesn't exists.
/bin/ln: creating symbolic link «[javamail].jar»: File or directory doesn't 
exists.
/bin/ln: creating symbolic link «[jsp].jar»: File or directory doesn't exists.
/bin/ln: creating symbolic link «[servlet].jar»: File or directory doesn't 
exists.
/bin/ln: creating symbolic link «[tomcat5][naming-factory].jar»: File or 
directory doesn't exists.
/bin/ln: creating symbolic link «[tomcat5][naming-resources].jar»: File or 
directory doesn't exists.
/usr/share/java-utils/java-functions: line 247: popd: directory stack empty
shell-init: error retrieving current directory: getcwd: cannot access parent 
directories: File or directory doesn't exists.
pushd: error retrieving current directory: getcwd: cannot access parent 
directories: File or directory doesn't exists.
/bin/ln: creating symbolic link «[jaxp_parser_impl].jar»: File or directory 
doesn't exists.
/bin/ln: creating symbolic link «[xml-commons-jaxp-1.3-apis].jar»: File or 
directory doesn't exists.
/usr/share/java-utils/java-functions: line 247: popd: directory stack empty
shell-init: error retrieving current directory: getcwd: cannot access parent 
directories: File or directory doesn't exists.
pushd: error retrieving current directory: getcwd: cannot access parent 
directories: File or directory doesn't exists.
/bin/ln: creating symbolic link «[catalina-ant5].jar»: File or directory 
doesn't exists
...
/usr/share/java-utils/java-functions: line 247: popd: directory stack empty


 I was using tomcat5 from standard Mandriva 2008 but probably the error will 
apply to other Linux distros/OSes where tomcat use a shell to start up.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat tool similar to top (Solved!)

2008-04-09 Thread Enrique Arizón
Answering myself, and in case someone else is
interested:

Looks that newest versions of tomcat mananager provide
some info about resource usage in a human readable
way. Once setup all that needed is to point to:

 http://MyServer:8080/manager/status/all

And quite detailed info will be providen about each
webapp with an output similar to:

localhost/wepapp1

Startup time: 2 ms TLD scan time: 0 ms
Active sessions: 0 Session count: 0 Max active
sessions: 0 Rejected session creations: 0 Expired
sessions: 0 Processing time: 4 ms
JSPs loaded: 0 JSPs reloaded: 0


Regards,

Enrique


--- Enrique Arizón [EMAIL PROTECTED]
escribió:

 Hi,
 
  I have a tomcat server with around 50 diferents
 small
 apps running on it.
 
  Time to time one of those apps gets out of control,
 but standard OS tools like top just show the java
 process running up to 200% of CPU usage.
 
  I setup tomcat to allow jconsole to connect and
 monitor it. Still jconsole doesn't provide the
 needed
 info. That's, something similar to top (process
 monitor on Windows, prstat on Solaris) indicating
 the
 VM/CPU usage percentage.
 
  Does anyone have a similiar problem and knowns how
 to
 fix it?
 
 Regards!
 
  Enrique
 


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat clustering

2008-04-07 Thread Enrique Arizón
Just one point:

 Notice clustering ussually must be made at the
highest application layer. Generic Clustering support
provided by containers can be of little help in a real
world scenarios.

 If you users sessions are simple tomcat sessions
clustering will be enough but if you have complex
session data structures (let's say for example a
java.util.ArrayList/Hashtable) you will need custom
solutions to sync sessions between clustered nodes.

 The easy/non-optimal way to go could be to store
state in a clustered database and use tomcat sessions
to mark what must be fetch from database. Mysql
makes a great help since it use in memory (RAM)
storage for clustered tables, is easy to set up and
just limited by the maximum node size (a few Gigas
with modermcheap hardware).





--- Ch Praveena [EMAIL PROTECTED] escribió:

 Hi all,
 
I want to cluster Tomcat6 along with session
 replication to implement
 Loadbalancing. From the document,

http://tomcat.apache.org/tomcat-6.0-doc/cluster-howto.html
 I have started
 making the things.
 
 Let me know where can I identify the default
 value of Multicast address
 is 228.0.0.4
 
 Please let me know if any other tutorials or
 articles in a detailed way for
 performing Tomcat6 clustering.
 -- 
 Regards,
 
 Praveena Chalamcharla,
 Securview
 


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat clustering

2008-04-07 Thread Enrique Arizón

--- Christopher Schultz [EMAIL PROTECTED]
escribió:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Enrique,
 
 Enrique Arizón wrote:
 | If you users sessions are simple tomcat sessions
 clustering will be
 | enough but if you have complex session data
 structures (let's say for
 | example a java.util.ArrayList/Hashtable) you will
 need custom
 | solutions to sync sessions between clustered
 nodes.
 
 Really? My experience has been that anything that
 properly implements
 java.io.Serializable does just fine migrating from
 node to node. Sure,
 migrating lots of data around a cluster is
 time-consuming and perhaps
 would not be considered a best-practice, but the
 container-provided
 clustering and session sync capabilities certainly
 do work.

 Completly agree. The case is that serialization is
slow, really, really slow (at least in terms of CPU
cicles) even serializing to local disks. But no doubt
it works. What I mean is that trusting container
clustering is going to solve any clustering problem
can be a really wrong idea, mainly because the
container limits to (correct me if I'm wrong)
serialize over the network session data. If such
session data is just a pointer to real data, it can
work, otherwise it will miserable fail with no so big
loads.

 On the opposite clustered databases will limit to 
sync changes (maybe just a few rows amongs maybe
thousands of rows per user). Also a custom solution (a
node notifying it's peers I changed this and this
, please update) will work much better.

 
 I would argue that a small session footprint is
 critical to a robust web
 application, clustered or not.
 
 | Mysql makes a great help since it use in memory
 (RAM) storage for
 | clustered tables
 
 What are you talking about? The closest thing to
 clustered tables that
 MySQL supports is the FEDERATED storage engine, and
 there are no
 guarantees about RAM usage for it.

Guess we are not speaking about the same thing. I
refer to NDB Cluster engine:
 
http://dev.mysql.com/doc/refman/5.0/en/mysql-cluster.html

 I read time ago that Google improved such engine for
its own purposes and the next Mysql will show improved
clustering stuff. Also, since Mysql is now part of Sun
I guess also it will get a boost from Solaris
engineering (I mean, Dtrace).


 
 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.8 (MingW32)
 Comment: Using GnuPG with Mozilla -
 http://enigmail.mozdev.org
 

iEYEARECAAYFAkf6gT0ACgkQ9CaO5/Lv0PAV2wCgtSxf1Pcwi/8cXEuKsnu4EPAe
 9hoAnir3tkn+qZ6l0pnoXhf1r4c9gVfY
 =QyZ9
 -END PGP SIGNATURE-
 

-
 To start a new topic, e-mail:
 users@tomcat.apache.org
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Tomcat tool similar to top

2008-03-05 Thread Enrique Arizón
Hi,

 I have a tomcat server with around 50 diferents small
apps running on it.

 Time to time one of those apps gets out of control,
but standard OS tools like top just show the java
process running up to 200% of CPU usage.

 I setup tomcat to allow jconsole to connect and
monitor it. Still jconsole doesn't provide the needed
info. That's, something similar to top (process
monitor on Windows, prstat on Solaris) indicating the
VM/CPU usage percentage.

 Does anyone have a similiar problem and knowns how to
fix it?

Regards!

 Enrique

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]