You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Thorsten Scherler <th...@juntadeandalucia.es> on 2007/05/24 14:12:20 UTC

PublicationConfiguration.java and config.getChild(ELEMENT_PROXIES);

Hi all, 

I have a problem with the PublicationConfiguration.java:
(around line 180)
...
  Configuration proxyConfig = config.getChild(ELEMENT_PROXIES);
  if (proxyConfig != null) {
...

In my publication.xml I commented the <proxies> block so should
proxyConfig==null, or?

However debugging the class I get:
publication::<no
value>:@file:/home/thorsten/src/apache/lenya-1.4.x/build/lenya/webapp/lenya/pubs/default/config/publication.xml:21:70
which is not null.

For 
 Configuration[] proxyConfigs = proxyConfig.getChildren(ELEMENT_PROXY);
it is not throwing an error, just returning proxyConfigs
Configuration[0]  (id=83)	

However the patch I attached is blowing up when trying:
 String urlRoot=proxyConfig.getAttribute(ATTRIBUTE_ROOT);

An exception occurred:
org.apache.avalon.framework.configuration.ConfigurationException	

Message: No attribute named "root" is associated with the configuration
element "proxies" at
<generated>file:/home/thorsten/src/apache/lenya-1.4.x/build/lenya/webapp/lenya/pubs/default/config/publication.xml:21:70

Description: org.apache.cocoon.sitemap.PatternException: Cannot get
variable 'document-url' in expression '{page-envelope:document-url}'

I have to say that I applied all patches from 42050 and
http://issues.apache.org/bugzilla/attachment.cgi?id=20240 introduces
{page-envelope:document-url} in the sitemap.

Somebody an idea why proxyConfig!=null?

TIA for any thoughts.

salu2
-- 
Thorsten Scherler                                 thorsten.at.apache.org
Open Source Java                      consulting, training and solutions


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: PublicationConfiguration.java and config.getChild(ELEMENT_PROXIES);

Posted by Thorsten Scherler <th...@juntadeandalucia.es>.
On Thu, 2007-05-24 at 14:12 +0200, Thorsten Scherler wrote:
> Hi all, 
> 
> I have a problem with the PublicationConfiguration.java:
> (around line 180)
> ...
>   Configuration proxyConfig = config.getChild(ELEMENT_PROXIES);
>   if (proxyConfig != null) {
> ...
> 
> In my publication.xml I commented the <proxies> block so should
> proxyConfig==null, or?
> 
> However debugging the class I get:
> publication::<no
> value>:@file:/home/thorsten/src/apache/lenya-1.4.x/build/lenya/webapp/lenya/pubs/default/config/publication.xml:21:70
> which is not null.
> 
> For 
>  Configuration[] proxyConfigs = proxyConfig.getChildren(ELEMENT_PROXY);
> it is not throwing an error, just returning proxyConfigs
> Configuration[0]  (id=83)	
> 
> However the patch I attached is blowing up when trying:
>  String urlRoot=proxyConfig.getAttribute(ATTRIBUTE_ROOT);

I fixed the blow with
String urlRoot=proxyConfig.getAttribute(ATTRIBUTE_ROOT,null);
still I think should be proxyConfig == null.

salu2

> 
> An exception occurred:
> org.apache.avalon.framework.configuration.ConfigurationException	
> 
> Message: No attribute named "root" is associated with the configuration
> element "proxies" at
> <generated>file:/home/thorsten/src/apache/lenya-1.4.x/build/lenya/webapp/lenya/pubs/default/config/publication.xml:21:70
> 
> Description: org.apache.cocoon.sitemap.PatternException: Cannot get
> variable 'document-url' in expression '{page-envelope:document-url}'
> 
> I have to say that I applied all patches from 42050 and
> http://issues.apache.org/bugzilla/attachment.cgi?id=20240 introduces
> {page-envelope:document-url} in the sitemap.
> 
> Somebody an idea why proxyConfig!=null?
> 
> TIA for any thoughts.
> 
> salu2
-- 
Thorsten Scherler                                 thorsten.at.apache.org
Open Source Java                      consulting, training and solutions


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: PublicationConfiguration.java and config.getChild(ELEMENT_PROXIES);

Posted by Thorsten Scherler <th...@juntadeandalucia.es>.
On Fri, 2007-05-25 at 11:07 +0200, Jörn Nettingsmeier wrote:
> Thorsten Scherler wrote:
> > Hi all, 
> > 
> > I have a problem with the PublicationConfiguration.java:
> > (around line 180)
> > ...
> >   Configuration proxyConfig = config.getChild(ELEMENT_PROXIES);
> >   if (proxyConfig != null) {
> > ...
> > 
> > In my publication.xml I commented the <proxies> block so should
> > proxyConfig==null, or?
> 
> not directly related, but how did you compile it without the proxies 
> block? 

I mean the code snippet that is by default in the publication.xml
commented. I did not refer to a cocoon block.

> iirc andreas changed the RNG to mandate an empty <proxies/> as a 
> structure marker...

src/resources/build/publication.rng
<optional>
 <element name="proxies">
....

Not sure why we need a structure marker?

salu2
-- 
Thorsten Scherler                                 thorsten.at.apache.org
Open Source Java                      consulting, training and solutions


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: PublicationConfiguration.java and config.getChild(ELEMENT_PROXIES);

Posted by Jörn Nettingsmeier <ne...@apache.org>.
Thorsten Scherler wrote:
> Hi all, 
> 
> I have a problem with the PublicationConfiguration.java:
> (around line 180)
> ...
>   Configuration proxyConfig = config.getChild(ELEMENT_PROXIES);
>   if (proxyConfig != null) {
> ...
> 
> In my publication.xml I commented the <proxies> block so should
> proxyConfig==null, or?

not directly related, but how did you compile it without the proxies 
block? iirc andreas changed the RNG to mandate an empty <proxies/> as a 
structure marker...


-- 
Jörn Nettingsmeier

Kurt is up in heaven now.



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: PublicationConfiguration.java and config.getChild(ELEMENT_PROXIES);

Posted by Thorsten Scherler <th...@juntadeandalucia.es>.
On Thu, 2007-05-24 at 14:17 +0200, Andreas Hartmann wrote:
> Thorsten Scherler schrieb:
> > Hi all, 
> > 
> > I have a problem with the PublicationConfiguration.java:
> > (around line 180)
> > ...
> >   Configuration proxyConfig = config.getChild(ELEMENT_PROXIES);
> >   if (proxyConfig != null) {
> > ...
> > 
> > In my publication.xml I commented the <proxies> block so should
> > proxyConfig==null, or?
> > 
> > However debugging the class I get:
> > publication::<no
> > value>:@file:/home/thorsten/src/apache/lenya-1.4.x/build/lenya/webapp/lenya/pubs/default/config/publication.xml:21:70
> > which is not null.
> 
> IIRC there are two getChild() methods:
> 
> getChild(String) - create if it doesn't exist
> getChild(String, false) - return null if it doesn't exist

Cheers dude, air crossed.

getChild(String, String2) is the method and returns Strings2 if not
found.

Thanks for your quick response.

salu2
-- 
Thorsten Scherler                                 thorsten.at.apache.org
Open Source Java                      consulting, training and solutions


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: PublicationConfiguration.java and config.getChild(ELEMENT_PROXIES);

Posted by Andreas Hartmann <an...@apache.org>.
Thorsten Scherler schrieb:
> Hi all, 
> 
> I have a problem with the PublicationConfiguration.java:
> (around line 180)
> ...
>   Configuration proxyConfig = config.getChild(ELEMENT_PROXIES);
>   if (proxyConfig != null) {
> ...
> 
> In my publication.xml I commented the <proxies> block so should
> proxyConfig==null, or?
> 
> However debugging the class I get:
> publication::<no
> value>:@file:/home/thorsten/src/apache/lenya-1.4.x/build/lenya/webapp/lenya/pubs/default/config/publication.xml:21:70
> which is not null.

IIRC there are two getChild() methods:

getChild(String) - create if it doesn't exist
getChild(String, false) - return null if it doesn't exist

-- Andreas

> 
> For 
>  Configuration[] proxyConfigs = proxyConfig.getChildren(ELEMENT_PROXY);
> it is not throwing an error, just returning proxyConfigs
> Configuration[0]  (id=83)	
> 
> However the patch I attached is blowing up when trying:
>  String urlRoot=proxyConfig.getAttribute(ATTRIBUTE_ROOT);
> 
> An exception occurred:
> org.apache.avalon.framework.configuration.ConfigurationException	
> 
> Message: No attribute named "root" is associated with the configuration
> element "proxies" at
> <generated>file:/home/thorsten/src/apache/lenya-1.4.x/build/lenya/webapp/lenya/pubs/default/config/publication.xml:21:70
> 
> Description: org.apache.cocoon.sitemap.PatternException: Cannot get
> variable 'document-url' in expression '{page-envelope:document-url}'
> 
> I have to say that I applied all patches from 42050 and
> http://issues.apache.org/bugzilla/attachment.cgi?id=20240 introduces
> {page-envelope:document-url} in the sitemap.
> 
> Somebody an idea why proxyConfig!=null?
> 
> TIA for any thoughts.
> 
> salu2


-- 
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org