You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Vadim Gritsenko <va...@reverycodes.com> on 2004/05/17 14:21:52 UTC

Re: cvs commit: cocoon-2.1/src/blocks/xsp/java/org/apache/cocoon/components/language/markup Logicsheet.java

Please revert. This object is *not* serializable. How ServiceManager and 
the rest will be de-serialized???

Vadim



unico@apache.org wrote:

>unico       2004/05/17 04:21:08
>
>  Modified:    src/blocks/xsp/java/org/apache/cocoon/components/language/markup
>                        Logicsheet.java
>  Log:
>  fix ClassCastException when caching logicsheets in JCS store
>  
>  Revision  Changes    Path
>  1.2       +3 -2      cocoon-2.1/src/blocks/xsp/java/org/apache/cocoon/components/language/markup/Logicsheet.java
>  
>  Index: Logicsheet.java
>  ===================================================================
>  RCS file: /home/cvs/cocoon-2.1/src/blocks/xsp/java/org/apache/cocoon/components/language/markup/Logicsheet.java,v
>  retrieving revision 1.1
>  retrieving revision 1.2
>  diff -u -r1.1 -r1.2
>  --- Logicsheet.java	10 Mar 2004 12:58:04 -0000	1.1
>  +++ Logicsheet.java	17 May 2004 11:21:08 -0000	1.2
>  @@ -34,6 +34,7 @@
>   import javax.xml.transform.sax.TransformerHandler;
>   
>   import java.io.IOException;
>  +import java.io.Serializable;
>   import java.net.MalformedURLException;
>   import java.util.HashMap;
>   import java.util.Map;
>  @@ -51,7 +52,7 @@
>    * @author <a href="mailto:ovidiu@cup.hp.com">Ovidiu Predescu</a>
>    * @version CVS $Id$
>    */
>  -public class Logicsheet extends AbstractLogEnabled
>  +public class Logicsheet extends AbstractLogEnabled implements Serializable
>   {
>       /**
>        * The Source Resolver object for this logicsheet.
>  
>  
>  
>
>  
>


Re: cvs commit: cocoon-2.1/src/blocks/xsp/java/org/apache/cocoon/components/language/m arkupLogicsheet.java

Posted by Antonio Gallardo <ag...@agssa.net>.
Vadim Gritsenko dijo:
> BTW, quick test showed that JCS does not persist its cache on shutdown -
> four files created by JCS (groupIdCache.data, groupIdCache.key,
> main.data, main.key) are empty. One more reason to revert.

Please run:

http://localhost:8888/samples/linkstatus

and

http://localhost:8888/samples/blocks/lucene/create

You will see the main.data file grow.

Best Regards,

Antonio Gallardo

Re: cvs commit: cocoon-2.1/src/blocks/xsp/java/org/apache/cocoon/components/language/m arkupLogicsheet.java

Posted by Antonio Gallardo <ag...@agssa.net>.
Vadim Gritsenko dijo:
> BTW, quick test showed that JCS does not persist its cache on shutdown -
> four files created by JCS (groupIdCache.data, groupIdCache.key,
> main.data, main.key) are empty. One more reason to revert.

JCS persist when needed. I think it is smarter. I already have the
main.data file in 18.6MB.

Best Regards,

Antonio Gallardo


Re: cvs commit: cocoon-2.1/src/blocks/xsp/java/org/apache/cocoon/components/language/m arkupLogicsheet.java

Posted by Vadim Gritsenko <va...@reverycodes.com>.
Antonio Gallardo wrote:

>Vadim Gritsenko dijo:
>  
>
>>Antonio Gallardo wrote:
>>
>>    
>>
>>>Vadim Gritsenko dijo:
>>>
>>>
>>>      
>>>
>>>>Please revert. This object is *not* serializable. How ServiceManager and
>>>>the rest will be de-serialized???
>>>>
>>>>
>>>>        
>>>>
>>>??... Can you explain why you think we need to revert? It is working now.
>>>I am testing it and seems it is OK.
>>>
>>>
>>>      
>>>
>>First, take a look at the class in question. It contains:
>>
>>1)    private Logger logger; /* from AbstractLogEnabled */
>>2)    private SourceResolver resolver;
>>3)    private String systemId;
>>4)    protected Map namespaceURIs = new HashMap();
>>5)    private ServiceManager manager;
>>
>>While 3 and 4 are Serializable, the rest is not. Now, please explain how
>>fields 1, 2, and 5 will be de-serialized. I can tell you default Java
>>behavior in this scenario: they will be null. Next, imaging how those
>>XSP pages you are testing will work when 1,2, and 5 are null.
>>    
>>
>
>OK. I am a Java newbie. I have a question: Why and how it is working now?
>I ran almost all the samples, even the long ones and it seems to be
>worked. If we have concerns. I have ask at the JCP developers list. Maybe
>they can tell us why this work.
>  
>

It does not work if you first save cache to disk, and then load cache 
from the disk. Uncomment cache-directory parameter first to move cache 
outside of Jetty temp directory.


BTW, quick test showed that JCS does not persist its cache on shutdown - 
four files created by JCS (groupIdCache.data, groupIdCache.key, 
main.data, main.key) are empty. One more reason to revert.

Vaidm


Re: cvs commit: cocoon-2.1/src/blocks/xsp/java/org/apache/cocoon/components/language/m arkupLogicsheet.java

Posted by Antonio Gallardo <ag...@agssa.net>.
Vadim Gritsenko dijo:
> Antonio Gallardo wrote:
>
>>Vadim Gritsenko dijo:
>>
>>
>>>Please revert. This object is *not* serializable. How ServiceManager and
>>>the rest will be de-serialized???
>>>
>>>
>>
>>??... Can you explain why you think we need to revert? It is working now.
>>I am testing it and seems it is OK.
>>
>>
>
> First, take a look at the class in question. It contains:
>
> 1)    private Logger logger; /* from AbstractLogEnabled */
> 2)    private SourceResolver resolver;
> 3)    private String systemId;
> 4)    protected Map namespaceURIs = new HashMap();
> 5)    private ServiceManager manager;
>
> While 3 and 4 are Serializable, the rest is not. Now, please explain how
> fields 1, 2, and 5 will be de-serialized. I can tell you default Java
> behavior in this scenario: they will be null. Next, imaging how those
> XSP pages you are testing will work when 1,2, and 5 are null.

OK. I am a Java newbie. I have a question: Why and how it is working now?
I ran almost all the samples, even the long ones and it seems to be
worked. If we have concerns. I have ask at the JCP developers list. Maybe
they can tell us why this work.

Best Regards,

Antonio Gallardo

Re: cvs commit: cocoon-2.1/src/blocks/xsp/java/org/apache/cocoon/components/language/m arkupLogicsheet.java

Posted by Vadim Gritsenko <va...@reverycodes.com>.
Antonio Gallardo wrote:

>Vadim Gritsenko dijo:
>  
>
>>Please revert. This object is *not* serializable. How ServiceManager and
>>the rest will be de-serialized???
>>    
>>
>
>??... Can you explain why you think we need to revert? It is working now.
>I am testing it and seems it is OK.
>  
>

First, take a look at the class in question. It contains:

1)    private Logger logger; /* from AbstractLogEnabled */
2)    private SourceResolver resolver;
3)    private String systemId;
4)    protected Map namespaceURIs = new HashMap();
5)    private ServiceManager manager;

While 3 and 4 are Serializable, the rest is not. Now, please explain how 
fields 1, 2, and 5 will be de-serialized. I can tell you default Java 
behavior in this scenario: they will be null. Next, imaging how those 
XSP pages you are testing will work when 1,2, and 5 are null.

Vadim


Re: cvs commit: cocoon-2.1/src/blocks/xsp/java/org/apache/cocoon/components/language/m arkupLogicsheet.java

Posted by Antonio Gallardo <ag...@agssa.net>.
Vadim Gritsenko dijo:
> Please revert. This object is *not* serializable. How ServiceManager and
> the rest will be de-serialized???

??... Can you explain why you think we need to revert? It is working now.
I am testing it and seems it is OK.

Best Regards,

Antonio Gallardo