cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Giacomo Pati <giac...@apache.org>
Subject Re: CallFunctionNode problems in trunk
Date Fri, 12 May 2006 14:56:28 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On Fri, 12 May 2006, Carsten Ziegeler wrote:

> Date: Fri, 12 May 2006 16:23:58 +0200
> From: Carsten Ziegeler <cziegeler@apache.org>
> Reply-To: dev@cocoon.apache.org
> To: dev@cocoon.apache.org
> Subject: Re: CallFunctionNode problems in trunk
> 
> Giacomo Pati schrieb:
>> On Fri, 12 May 2006, Carsten Ziegeler wrote:
>>
>>>> Date: Fri, 12 May 2006 16:05:16 +0200
>>>> From: Carsten Ziegeler <cziegeler@apache.org>
>>>> Reply-To: dev@cocoon.apache.org
>>>> To: dev@cocoon.apache.org
>>>> Subject: Re: CallFunctionNode problems in trunk
>>>>
>>>> Reinhard Poetz schrieb:
>>>>> Carsten Ziegeler wrote:
>>>>>> Ignore my last email - the current code is correct. The singleton
>>>>>> variable is set to false some lines below :(
>>>>> Just wanted to answer that it doesn't fix it. IIUC the container with
the
>>>>> builders is setup in SitemapLanguage.java#405-430. But I don't understand
how
>>>>> the selector gets filled with all the builders ...
>>>>>
>>>> Yes, the code is correct. The problem is in the selector (see my reply
>>>> to Giacomo's mail). I think we should fix the node builder: I guess if
>>
>> I've browsed through alost all NodeBuilders and have seen that we have
>> to fix alot of them (many aren't singletons)
>>
>>>> it would use a list of simple beans (where the bean contains the
>>>> resource name, function name etc), and then process this list in
>>>> linkNode() it should work.
>>
>> Well, this is another problem as those values (resource name, function
>> name, ...) are held in member variables too :-( and the linkNode method
>> needs a way to distinguish them (but hase no argument to check for).
>>
> Ok, so let's change the strategy and fix the standalone service
> selector... :) If svn works again I can do this on monday evening - if
> noone beats me to it.

I've made a quich hack to see if that will help (and maybe I'm looking 
at the wrong place):

Index: 
src/main/java/org/apache/cocoon/components/treeprocessor/StandaloneServiceSelector.java
===================================================================
- --- src/main/java/org/apache/cocoon/components/treeprocessor/StandaloneServiceSelector.java
    (revision 405757)
+++ src/main/java/org/apache/cocoon/components/treeprocessor/StandaloneServiceSelector.java
    (working copy)
@@ -38,6 +38,7 @@
  import org.apache.avalon.framework.service.ServiceManager;
  import org.apache.avalon.framework.service.ServiceSelector;
  import org.apache.avalon.framework.service.Serviceable;
+import org.apache.avalon.framework.thread.ThreadSafe;
  import org.apache.cocoon.core.container.spring.ComponentInfo;
  import org.apache.cocoon.util.ClassUtils;

@@ -107,7 +108,11 @@
          info.setRole(role);
          info.setConfiguration(configuration);
          info.setComponentClassName(componentClass.getName());
- -        info.setModel(ComponentInfo.MODEL_SINGLETON);
+        if (ThreadSafe.class.isAssignableFrom(componentClass)) {
+            info.setModel(ComponentInfo.MODEL_SINGLETON);
+        } else {
+            info.setModel(ComponentInfo.MODEL_PRIMITIVE);
+        }
          return info;
      }

Doesn't get me any further. Still getting

java.lang.NullPointerException
 	at org.apache.cocoon.components.treeprocessor.sitemap.CallFunctionNode.invoke(CallFunctionNode.java:113)

Any additional ideas?

- -- 
Giacomo Pati
Otego AG, Switzerland - http://www.otego.com
Orixo, the XML business alliance - http://www.orixo.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)

iD8DBQFEZKIdLNdJvZjjVZARAmS5AJsHR3AmqdB3TK6ubPDNo4dmFNZCKQCfcvCx
MC84LZZkb3VV03hnwxtpqzo=
=9X8I
-----END PGP SIGNATURE-----

Mime
View raw message