RE: Deserialize tomcat sessions

2006-02-28 Thread Abraham Fdez
Thanks Filip,


Abraham Fernández Álvarez
Dpto. de Informática 
FNAC ESPAÑA S.A. 
Parque Empresarial La Finca
Pº de la Finca, bloque 11 2ª Planta
28223 Pozuelo de Alarcón (Madrid) 
( +34 91 7689211
7 +34 91 7689225 
/ [EMAIL PROTECTED]
: http://www.fnac.es 
 
 
 
 
 
 
 
 
 
 
 

-Mensaje original-
De: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] 
Enviado el: lunes, 27 de febrero de 2006 20:07
Para: Tomcat Users List
Asunto: Re: Deserialize tomcat sessions

byte[] mysessiondata = ...;
ObjectInputStream stream = new ObjectInputStream(new 
ByteArrayInputStream(mysessiondata));
StandardSession mysession = new StandardSession();
mysession.readObjectData(mysessiondata);

Object attribute = mysession.getAttribute(myattribute);

Filip


Abraham Fdez wrote:
 Thanks Filip,

 But... could you help me how to do it?. Now I only have this:

 Object stuff = (Object) new ObjectInputStream(new
 ByteArrayInputStream(kk2.getSession_Data())).readObject();

 Where kk2.getSession_Data returns a byte array (byte[]) where attributes
 are.


 Thanks,

 Abraham Fernández Álvarez
 Dpto. de Informática 
 FNAC ESPAÑA S.A. 
 Parque Empresarial La Finca
 Pº de la Finca, bloque 11 2ª Planta
 28223 Pozuelo de Alarcón (Madrid) 
 ( +34 91 7689211
 7 +34 91 7689225 
 / [EMAIL PROTECTED]
 : http://www.fnac.es 
  
  
  
  
  
  
  
  
  
  
  
 -Mensaje original-
 De: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] 
 Enviado el: lunes, 27 de febrero de 2006 14:18
 Para: Tomcat Users List
 Asunto: Re: Deserialize tomcat sessions

 File: StandardSession.java
 Method: readObjectData

 Filip


 Abraham Fdez wrote:
   
 Hi all,

  

  

 I have Persistent sessions in tomcat that are saved into Postgresql
 database. I make a Select from tomcat_sessions in order to get sessions
to
 get an attribute that is on each one.

  

 What is the function to deserialize each session from database?

  

  

 Thanks,
   
 


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


   


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat 5.5.x crashes almost every single day.

2006-02-28 Thread Abraham Fdez
Hi,

You must look at your java code in order to find any function that are
deprecated. Sometimes this functions are the problem of memory leaks, high
cpu usage, etc...

Best regards,


Abraham Fernández Álvarez
Dpto. de Informática 
FNAC ESPAÑA S.A. 
Parque Empresarial La Finca
Pº de la Finca, bloque 11 2ª Planta
28223 Pozuelo de Alarcón (Madrid) 
( +34 91 7689211
7 +34 91 7689225 
/ [EMAIL PROTECTED]
: http://www.fnac.es 
 
 
 
 
 
 
 
 
 
 
 

-Mensaje original-
De: news [mailto:[EMAIL PROTECTED] En nombre de Tomasz Nowak
Enviado el: martes, 28 de febrero de 2006 18:02
Para: users@tomcat.apache.org
Asunto: Sad: Tomcat 5.5.x crashes almost every single day.

Probably important:
===
- 2x Xeon, 3 GB mem
- Linux 2.4.26
- Java 1.5.0_06-b05
- Apache Tomcat 5.5.15
- CATALINA_OPTS=\
-server \
-Djava.awt.headless=true \
-Dfile.encoding=UTF-8 \
-XX:MaxPermSize=256m \
-Xms1024m -Xmx1024m
- Connector port=8009 protocol=AJP/1.3
maxThreads=200 minSpareThreads=25 maxSpareThreads=50
backlog=20 connectionTimeout=1
enableLookups=true redirectPort=8443 /

- mod_jk 1.2.15
- Apache Httpd 1.3.34
- 8 Tomcat vhosts
- 8 webapps
- each webapp runs on separate vhost
- each webapp is Apache Cocoon 2.1.7
- system load avarage: usually under 0.5
- http load: not more then 20-30 concurrent req

The pain: crashing Tomcat
==

Everything works right until Tomcat suddenly crashes,
what happens almost every single day. Sometimes it crashes
with OOME / out of heap (heh, is 1GB not enought!?), but
somtimes NOTHING wrong is logged into the logs - it
just stops responding to requests (hangs).

When Tomcat stops responding to requests JK eats all
of 256 Apache HTTPd MaxClients so other httpd vhosts
stop responding also. Disaster!

Any ideas before abandoning Java technology? ;)

Default Tomcat logging facility seems to be useless to me.
j.u.l. logging.properties semantics looks like a programmers
joke made to users (!). And even with swallowOutput it logs
everything into catalina.out (?) I found none decent
log4j-tomcat-virtual-hosts-logging-manual in Tomcat docs
also. Is Tomcat a production ready reference j2se server
or just a finish it yourself proof of concept toy?

I've been crond-restarting Tomcat 4.1 on Java 1.4 every
night for more than a year, and now I have to restart
Tomcat 5.5.15 on Java 1.5 AND apache httpd also almost
every single day. From my -user point of view, Tomcat
doesn't change in a good direction. In fact in it is
probably changing in wrong direction - at least the
4.1.x logger element has been working 'out of the box'.

Come on! Am I the only one that has such problems with Tomcat?
 
-- 
T.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Deserialize tomcat sessions

2006-02-27 Thread Abraham Fdez
Thanks Filip,

But... could you help me how to do it?. Now I only have this:

Object stuff = (Object) new ObjectInputStream(new
ByteArrayInputStream(kk2.getSession_Data())).readObject();

Where kk2.getSession_Data returns a byte array (byte[]) where attributes
are.


Thanks,

Abraham Fernández Álvarez
Dpto. de Informática 
FNAC ESPAÑA S.A. 
Parque Empresarial La Finca
Pº de la Finca, bloque 11 2ª Planta
28223 Pozuelo de Alarcón (Madrid) 
( +34 91 7689211
7 +34 91 7689225 
/ [EMAIL PROTECTED]
: http://www.fnac.es 
 
 
 
 
 
 
 
 
 
 
 
-Mensaje original-
De: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] 
Enviado el: lunes, 27 de febrero de 2006 14:18
Para: Tomcat Users List
Asunto: Re: Deserialize tomcat sessions

File: StandardSession.java
Method: readObjectData

Filip


Abraham Fdez wrote:
 Hi all,

  

  

 I have Persistent sessions in tomcat that are saved into Postgresql
 database. I make a Select from tomcat_sessions in order to get sessions to
 get an attribute that is on each one.

  

 What is the function to deserialize each session from database?

  

  

 Thanks,
   


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Read-Only Context with Tomcat + Hibernate

2006-02-15 Thread Abraham Fdez
Hi all,

 

I’m making a Web application with Apache + Tomcat + Mod_Jk + Hibernate +
Postgresql. I need that hibernate binds factory to JNDI but when I do that
it gives me and error that context is read-only.

 

Is there any method to implement this or any config tag that makes context
writable?.

 

Thanks all,

 

 


 http://www.fnac.es 

Abraham Fernández Álvarez


Dpto. de Informática 
FNAC ESPAÑA S.A. 
Parque Empresarial La Finca
Pº de la Finca, bloque 11 2ª Planta
28223 Pozuelo de Alarcón (Madrid) 
* +34 91 7689211
7 +34 91 7689225 

* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 

* http://www.fnac.es 

 

 

 

 

 

 

 

 

 

 

 



RE: Read-Only Context with Tomcat + Hibernate

2006-02-15 Thread Abraham Fdez
Yeah Kenevel,

I know this (This is what I am doing) but I want to give a name to
Hibernate's SessionFactory like session-factory
name=java:comp/Hibernate/blahblahblah and in that case is where Tomcat
says me that Context is read-only. I want this because I'm doing a Tomcat
Cluster with some servers and each one must have a SessionFactory with same
name in order to use Tomcat Persistent sessions manager on a postgresql
database.

Do you know anything about naming SessionFactory object in Tomcat?

Thanks a lot,

 
Abraham Fernández Álvarez
 

Dpto. de Informática 
FNAC ESPAÑA S.A. 
Parque Empresarial La Finca
Pº de la Finca, bloque 11 2ª Planta
28223 Pozuelo de Alarcón (Madrid) 
( +34 91 7689211
7 +34 91 7689225 
/ [EMAIL PROTECTED] 
 

 

-Mensaje original-
De: Kenevel [mailto:[EMAIL PROTECTED] 
Enviado el: miércoles, 15 de febrero de 2006 14:46
Para: Tomcat Users List
Asunto: Re: Read-Only Context with Tomcat + Hibernate

Abraham Fdez wrote:
 I'm making a Web application with Apache + Tomcat + Mod_Jk +
 Hibernate + Postgresql. I need that hibernate binds factory to JNDI
 but when I do that it gives me and error that context is read-only.

From memory Tomcat has a JNDI context that is read-only, but which can
accept values bound to it in the configuration files. So you can set up a
data-source in the conf/Catalina/localhost/yourcontext.xml file and bind
this to a JNDI name. This is then available to be read (only).

There will be docs on this but it looks something like this:

Context path=/yourpath docbase=/var/www/webapp/ ... 
Resource name=jdbc/datasourceJndiName auth=Container ... /
/Context

Incidentally, Spring is a superb way of integrating a Java webapp and
Hibernate

Mike

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]