You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Abraham Fdez <ab...@fnac.es> on 2006/02/27 10:19:09 UTC

Deserialize tomcat sessions

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,

 


 <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 

* abraham.fernandez@fnac.es <ma...@fnac.es> 

* http://www.fnac.es 

 

 

 

 

 

 

 

 

 

 

 


RE: Deserialize tomcat sessions

Posted by Abraham Fdez <ab...@fnac.es>.
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 
/ abraham.fernandez@fnac.es
: http://www.fnac.es 
 
 
 
 
 
 
 
 
 
 
 

-----Mensaje original-----
De: Filip Hanik - Dev Lists [mailto:devlists@hanik.com] 
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 
> / abraham.fernandez@fnac.es
> : http://www.fnac.es 
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
> -----Mensaje original-----
> De: Filip Hanik - Dev Lists [mailto:devlists@hanik.com] 
> 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: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Deserialize tomcat sessions

Posted by Abraham Fdez <ab...@fnac.es>.
Hi Filip,

In this line " StandardSession mysession = new StandardSession();" there
could be in "new StandardSession()" a Manager.

What should Manager I use?

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 
/ abraham.fernandez@fnac.es
: http://www.fnac.es 
 
 
 
 
 
 
 
 
 
 
 

-----Mensaje original-----
De: Filip Hanik - Dev Lists [mailto:devlists@hanik.com] 
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 
> / abraham.fernandez@fnac.es
> : http://www.fnac.es 
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
> -----Mensaje original-----
> De: Filip Hanik - Dev Lists [mailto:devlists@hanik.com] 
> 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: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Deserialize tomcat sessions

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
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 
> / abraham.fernandez@fnac.es
> : http://www.fnac.es 
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
> -----Mensaje original-----
> De: Filip Hanik - Dev Lists [mailto:devlists@hanik.com] 
> 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: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Deserialize tomcat sessions

Posted by Abraham Fdez <ab...@fnac.es>.
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 
/ abraham.fernandez@fnac.es
: http://www.fnac.es 
 
 
 
 
 
 
 
 
 
 
 
-----Mensaje original-----
De: Filip Hanik - Dev Lists [mailto:devlists@hanik.com] 
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: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Deserialize tomcat sessions

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
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: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org