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 15:31:48 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


I've something working for an app I'm migrating to cocoon-2.2. Could 
one of the other bug hunters check if the attached patch works for her,
too? If so that patch could be a base for how to solve this issue.

TIA and have a nice weekend!

Giacomo

On Fri, 12 May 2006, Giacomo Pati wrote:

> Date: Fri, 12 May 2006 16:56:28 +0200 (CEST)
> From: Giacomo Pati <giacomo@apache.org>
> Reply-To: dev@cocoon.apache.org
> To: dev@cocoon.apache.org
> Subject: Re: CallFunctionNode problems in trunk
> 
> --[PinePGP]--------------------------------------------------[begin]--
>
> 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
> --[PinePGP]-----------------------------------------------------------
> gpg:  Signature made Fri May 12 16:56:29 2006 CEST using DSA key ID 98E35590
> gpg:  Good signature from "Giacomo Pati <giacomo@otego.com>"
> gpg:                  aka "Giacomo Pati <giacomo@apache.org>"
> gpg:                  aka "Giacomo Pati <giacomo@pati.ch>"
> --[PinePGP]----------------------------------------------------[end]--
>

- -- 
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)

iD8DBQFEZKplLNdJvZjjVZARAl5tAKCqRsQJCQXkBdLPXtOV+sWpBC8izgCaAzBU
LZdrWbJlBdI76MYvn9rq/Qs=
=ZTOJ
-----END PGP SIGNATURE-----
Mime
View raw message