You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Antonio Gallardo <ag...@agssa.net> on 2006/05/29 07:57:19 UTC

[2.2] Avalon does not hidden spring exceptions.

Hi,

While merging from  2.1 XInclude fallback tests, they don't pass due 
[1]. Since XIncludeTransformer is an Avalon component, he does not 
recognize Spring exceptions at all. I am sure we need to address this 
because we are going to hit the same error in other components. Is there 
a workaround in place. Please help.

Best Regards,

Antonio Gallardo

[1]
Tests run: 4, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.303 
sec <<< FAILURE!
testXIncludeSimpleFallbackTest(org.apache.cocoon.transformation.XIncludeTransformerTestCase)  
Time elapsed: 0.107 sec  <<< ERROR!
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean 
named 'org.apache.excalibur.source.SourceFactory/file' is defined
    at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:352)
    at 
org.springframework.beans.factory.support.AbstractBeanFactory.getMergedBeanDefinition(AbstractBeanFactory.java:671)
    at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198)
    at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:204)
    at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
    at 
org.apache.cocoon.core.container.spring.AvalonServiceSelector.select(AvalonServiceSelector.java:59)
    at 
org.apache.excalibur.source.impl.SourceResolverImpl.resolveURI(SourceResolverImpl.java:204)
    at 
org.apache.excalibur.source.impl.SourceResolverImpl.resolveURI(SourceResolverImpl.java:152)
    at 
org.apache.cocoon.components.source.SourceResolverAdapter.resolveURI(SourceResolverAdapter.java:49)
    at org.apache.cocoon.xml.XMLBaseSupport.resolve(XMLBaseSupport.java:98)
    at 
org.apache.cocoon.xml.XMLBaseSupport.makeAbsolute(XMLBaseSupport.java:116)
    at 
org.apache.cocoon.transformation.XIncludeTransformer$XIncludePipe.processXIncludeElement(XIncludeTransformer.java:413)
    at 
org.apache.cocoon.transformation.XIncludeTransformer$XIncludePipe.startElement(XIncludeTransformer.java:226)
    at 
org.apache.cocoon.xml.AbstractXMLPipe.startElement(AbstractXMLPipe.java:93)
    at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source)
    at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at 
org.apache.cocoon.core.container.spring.PoolableFactoryBean$ProxyHandler.invoke(PoolableFactoryBean.java:340)
    at $Proxy11.startElement(Unknown Source)
    at 
org.apache.cocoon.xml.dom.DOMStreamer$NamespaceNormalizingDOMStreamer.startNode(DOMStreamer.java:434)
    at 
org.apache.cocoon.xml.dom.DOMStreamer$NamespaceNormalizingDOMStreamer.stream(DOMStreamer.java:216)
    at org.apache.cocoon.xml.dom.DOMStreamer.stream(DOMStreamer.java:140)
    at 
org.apache.cocoon.SitemapComponentTestCase.transform(SitemapComponentTestCase.java:403)
    at 
org.apache.cocoon.transformation.XIncludeTransformerTestCase.xincludeTest(XIncludeTransformerTestCase.java:39)
    at 
org.apache.cocoon.transformation.XIncludeTransformerTestCase.testXIncludeSimpleFallbackTest(XIncludeTransformerTestCase.java:67)


Re: [2.2] Avalon does not hidden spring exceptions.

Posted by Antonio Gallardo <ag...@agssa.net>.
Carsten Ziegeler escribió:
> Antonio Gallardo wrote:
>   
>> Hi,
>>
>> While merging from  2.1 XInclude fallback tests, they don't pass due 
>> [1]. Since XIncludeTransformer is an Avalon component, he does not 
>> recognize Spring exceptions at all. I am sure we need to address this 
>> because we are going to hit the same error in other components. Is there 
>> a workaround in place. Please help.
>>
>>     
> I think we should catch the Spring exception in our Avalon bridge and
> rethrow a ServiceException. I'll look into that tonight.
>   
Exactly. But it should be a o.a.c.ResourceNotFoundException. :-)

Best Regards,

Antonio Gallardo.


Re: [2.2] Avalon does not hidden spring exceptions.

Posted by Carsten Ziegeler <cz...@apache.org>.
Antonio Gallardo wrote:
> Hi,
> 
> While merging from  2.1 XInclude fallback tests, they don't pass due 
> [1]. Since XIncludeTransformer is an Avalon component, he does not 
> recognize Spring exceptions at all. I am sure we need to address this 
> because we are going to hit the same error in other components. Is there 
> a workaround in place. Please help.
> 
I think we should catch the Spring exception in our Avalon bridge and
rethrow a ServiceException. I'll look into that tonight.

Carsten
-- 
Carsten Ziegeler - Open Source Group, S&N AG
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/

Re: [2.2] Avalon does not hidden spring exceptions.

Posted by Antonio Gallardo <ag...@agssa.net>.
Carsten Ziegeler escribió:
> Antonio Gallardo schrieb:
>   
>> Hi,
>>
>> While merging from  2.1 XInclude fallback tests, they don't pass due 
>> [1]. Since XIncludeTransformer is an Avalon component, he does not 
>> recognize Spring exceptions at all. I am sure we need to address this 
>> because we are going to hit the same error in other components. Is there 
>> a workaround in place. Please help.
>>
>>     
> I added a fix which will wrap the Spring exception into an Avalon exception.
> Now, currently the XInclude testcase is working for me; it does not fail.
>   
Danke. :-)

XIncludeTransformer fallback tests are running now.

Best Regards,

Antonio Gallardo


Re: [2.2] Avalon does not hidden spring exceptions.

Posted by Carsten Ziegeler <cz...@apache.org>.
Antonio Gallardo schrieb:
> Hi,
> 
> While merging from  2.1 XInclude fallback tests, they don't pass due 
> [1]. Since XIncludeTransformer is an Avalon component, he does not 
> recognize Spring exceptions at all. I am sure we need to address this 
> because we are going to hit the same error in other components. Is there 
> a workaround in place. Please help.
> 
I added a fix which will wrap the Spring exception into an Avalon exception.
Now, currently the XInclude testcase is working for me; it does not fail.

Carsten
-- 
Carsten Ziegeler - Open Source Group, S&N AG
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/

Re: [2.2] Avalon does not hidden spring exceptions.

Posted by Carsten Ziegeler <cz...@apache.org>.
Reinhard Poetz wrote:
> I see that there is no component org.apache.excalibur.source.SourceFactory/file 
> available. Try to add it to the components part and run the tests again.
If you extend the SitemapComponentTestCase (like the XInclude test
does), the source resolver should be set up automatically.
> 
> Maybe Carsten can help here more (and explain what's the difference between 2.1 
> and 2.2 here).
> 
I don't know that much about the 2.1 version; in 2.2 we added a lot of
support for automatic component adding, so in most cases you don't need
an own xconf file for your test case as the common components like
source resolver etc are already setup.

Carsten
-- 
Carsten Ziegeler - Open Source Group, S&N AG
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/

Re: [2.2] Avalon does not hidden spring exceptions.

Posted by Reinhard Poetz <re...@apache.org>.
Antonio Gallardo wrote:
> Reinhard Poetz escribió:
>> IIUC this exception means that your testcase xconf doesn't provide a 
>> bean with the name "org.apache.excalibur.source.SourceFactory/file", 
>> does it?
>>
> Would you explain more? :-)

First, I'm not a specialist in our junit testing mechanisms and I guess that 
there was some change between 2.1 and 2.2 because of the move to Spring. Looking 
at XIncludeTransformerTestCase.xtest

<testcase>
  <context>
    <entry name="root-url" value="/"/>
  </context>

  <roles>
   <role name="org.apache.excalibur.xml.sax.SAXParser"
         shorthand="xml-parser"
         default-class="org.apache.excalibur.xml.impl.JaxpParser"/>
  </roles>

  <components/>

</testcase>

I see that there is no component org.apache.excalibur.source.SourceFactory/file 
available. Try to add it to the components part and run the tests again.

Maybe Carsten can help here more (and explain what's the difference between 2.1 
and 2.2 here).

-- 
Reinhard Pötz           Independent Consultant, Trainer & (IT)-Coach 

{Software Engineering, Open Source, Web Applications, Apache Cocoon}

                                        web(log): http://www.poetz.cc
--------------------------------------------------------------------

	

	
		
___________________________________________________________ 
Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de

Re: [2.2] Avalon does not hidden spring exceptions.

Posted by Antonio Gallardo <ag...@agssa.net>.
Reinhard Poetz escribió:
> Antonio Gallardo wrote:
>> Hi,
>>
>> While merging from  2.1 XInclude fallback tests, they don't pass due 
>> [1]. Since XIncludeTransformer is an Avalon component, he does not 
>> recognize Spring exceptions at all. I am sure we need to address this 
>> because we are going to hit the same error in other components. Is 
>> there a workaround in place. Please help.
>>
>> Best Regards,
>>
>> Antonio Gallardo
>>
>> [1]
>> Tests run: 4, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.303 
>> sec <<< FAILURE!
>> testXIncludeSimpleFallbackTest(org.apache.cocoon.transformation.XIncludeTransformerTestCase)  
>> Time elapsed: 0.107 sec  <<< ERROR!
>> org.springframework.beans.factory.NoSuchBeanDefinitionException: No 
>> bean named 'org.apache.excalibur.source.SourceFactory/file' is defined
>>    at 
>> org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:352) 
>
>
> IIUC this exception means that your testcase xconf doesn't provide a 
> bean with the name "org.apache.excalibur.source.SourceFactory/file", 
> does it?
>
Would you explain more? :-)

Best Regards,

Antonio Gallardo


Re: [2.2] Avalon does not hidden spring exceptions.

Posted by Reinhard Poetz <re...@apache.org>.
Antonio Gallardo wrote:
> Hi,
> 
> While merging from  2.1 XInclude fallback tests, they don't pass due 
> [1]. Since XIncludeTransformer is an Avalon component, he does not 
> recognize Spring exceptions at all. I am sure we need to address this 
> because we are going to hit the same error in other components. Is there 
> a workaround in place. Please help.
> 
> Best Regards,
> 
> Antonio Gallardo
> 
> [1]
> Tests run: 4, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.303 
> sec <<< FAILURE!
> testXIncludeSimpleFallbackTest(org.apache.cocoon.transformation.XIncludeTransformerTestCase)  
> Time elapsed: 0.107 sec  <<< ERROR!
> org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean 
> named 'org.apache.excalibur.source.SourceFactory/file' is defined
>    at 
> org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:352) 

IIUC this exception means that your testcase xconf doesn't provide a bean with 
the name "org.apache.excalibur.source.SourceFactory/file", does it?

-- 
Reinhard Pötz           Independent Consultant, Trainer & (IT)-Coach 

{Software Engineering, Open Source, Web Applications, Apache Cocoon}

                                        web(log): http://www.poetz.cc
--------------------------------------------------------------------

		
___________________________________________________________ 
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de