You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Stuart Roebuck <st...@adolos.co.uk> on 2002/05/09 21:25:49 UTC

Help! Problems installing a user component and role into Cocoon 2

I'm trying to install a new 'user' component into Cocoon 2 but I'm 
hitting a problem which I can't seem to get a handle on:

Basically, I'm getting a the following stack dump:

> ERROR   (2002-05-09) 19:03.08:176   [sitemap.generator.database-
> access](/about_us_index.html) 
> HttpProcessor[8080][4]/DatabaseAccessGenerator: Can't get 
> DatabaseAccessManager component
> org.apache.avalon.framework.component.ComponentException: Could not 
> find component
>         at 
> org.apache.avalon.excalibur.component.ExcaliburComponentManager.lookup
> (ExcaliburComponentManager.java:335)
>         at 
> org.apache.cocoon.components.CocoonComponentManager.lookup
> (CocoonComponentManager.java:175)
>         at 
> org.apache.avalon.excalibur.component.DefaultComponentFactory$ComponentManagerProxy.
> lookup(DefaultComponentFactory.java:323)
>         at 
> org.apache.avalon.excalibur.component.DefaultComponentFactory$ComponentManagerProxy.
> lookup(DefaultComponentFactory.java:323)
>         at 
> com.adolos.cocoon.generation.DatabaseAccessGenerator.compose
> (DatabaseAccessGenerator.java:94)
> ...

My new DatabaseAccessGenerator (generator) is composable and uses the 
given manager to lookup the new component called DatabaseAccessManager.  
This component is defined in my my.roles file:

> <?xml version="1.0"?>
> <role-list>
>   <role name="com.adolos.cocoon.util.DatabaseAccessManager"
>         shorthand="database-access-manager"
>         default-class="com.adolos.cocoon.util.DatabaseAccessManager"/>
> </role-list>

The my.roles file is referenced in my cocoon.xconf file as:

> <cocoon version="2.0" user-roles="/WEB-INF/my.roles">

This appears to be being accessed, as prior to putting in the preceding 
forward-slash this reference threw a runtime error as well.

The cocoon.xconf file also has an entry for the component like this (I'm 
not sure if this is really necessary):

>   <database-access-manager 
> class="com.adolos.cocoon.util.DatabaseAccessManager" 
> logger="core.database.access" />

I have some logging in place and I know that the compose and configure 
methods of my DatabaseAccessManager component are called prior to any 
attempt to use the component.

But, when my DatabaseAccessGenerator attempts to lookup the component it 
throws the 'Could not find component' exception listed above (top).

I've checked and double-checked that the role names match up throughout.

Any thoughts?

P.S. I've produced plenty of working generators in the past, but this is 
my first independent component so don't underestimate my ability to do 
something stupid!


            Public Key - 1024D/88DD65AF 2001-11-23 Stuart Roebuck (Adolos)
      Key fingerprint = 89D9 E405 F8B1 9B22 0FA2  F2C1 9E57 5AB1 88DD 65AF
-------------------------------------------------------------------------
Stuart Roebuck                                  stuart.roebuck@adolos.com
Systems Architect                             Java, XML, MacOS X, XP, 
etc.
ADOLOS                                           <http://www.adolos.com/>


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Help! Problems installing a user component and role into Cocoon 2

Posted by Stuart Roebuck <st...@adolos.co.uk>.
On Friday, May 10, 2002, at 11:30 AM, Gerhard Froehlich wrote:

> Stuart Roebuck wrote:
>> On Friday, May 10, 2002, at 08:03 AM, Gerhard Froehlich wrote:
>>> Stuart Roebuck wrote:
>>>
>>>> I'm trying to install a new 'user' component into Cocoon 2 but I'm 
>>>> hitting a problem which I can't seem to get a handle on:
>>>> Basically, I'm getting a the following stack dump:
>>>>
>>>>> ERROR   (2002-05-09) 19:03.08:176   [sitemap.generator.database-
>>>>> access](/about_us_index.html) 
>>>>> HttpProcessor[8080][4]/DatabaseAccessGenerator: Can't get 
>>>>> DatabaseAccessManager component
>>>>> org.apache.avalon.framework.component.ComponentException: Could not 
>>>>> find component
>>>>>         at 
>>>>> org.apache.avalon.excalibur.component.ExcaliburComponentManager.lookup
>>>>> (ExcaliburComponentManager.java:335)
>>>>>         at 
>>>>> org.apache.cocoon.components.CocoonComponentManager.lookup
>>>>> (CocoonComponentManager.java:175)
>>>>>         at 
>>>>> org.apache.avalon.excalibur.component.DefaultComponentFactory$ComponentManagerProxy.
>>>>> lookup(DefaultComponentFactory.java:323)
>>>>>         at 
>>>>> org.apache.avalon.excalibur.component.DefaultComponentFactory$ComponentManagerProxy.
>>>>> lookup(DefaultComponentFactory.java:323)
>>>>>         at 
>>>>> com.adolos.cocoon.generation.DatabaseAccessGenerator.compose
>>>>> (DatabaseAccessGenerator.java:94)
>>>>> ...
>>>>
>>>> My new DatabaseAccessGenerator (generator) is composable and uses 
>>>> the given manager to lookup the new component called 
>>>> DatabaseAccessManager.  This component is defined in my my.roles 
>>>> file:
>>>>
>>>>> <?xml version="1.0"?>
>>>>> <role-list>
>>>>>   <role name="com.adolos.cocoon.util.DatabaseAccessManager"
>>>>>         shorthand="database-access-manager"
>>>>>         default-
>>>>> class="com.adolos.cocoon.util.DatabaseAccessManager"/>
>>>>> </role-list>
>>>>
>>>> The my.roles file is referenced in my cocoon.xconf file as:
>>>>
>>>>> <cocoon version="2.0" user-roles="/WEB-INF/my.roles">
>>>>
>>>> This appears to be being accessed, as prior to putting in the 
>>>> preceding forward-slash this reference threw a runtime error as well.
>>>> The cocoon.xconf file also has an entry for the component like this 
>>>> (I'm not sure if this is really necessary):
>>>>
>>>>>   <database-access-manager 
>>>>> class="com.adolos.cocoon.util.DatabaseAccessManager" 
>>>>> logger="core.database.access" />
>>>>
>>>> I have some logging in place and I know that the compose and 
>>>> configure methods of my DatabaseAccessManager component are called 
>>>> prior to any attempt to use the component.
>>>> But, when my DatabaseAccessGenerator attempts to lookup the 
>>>> component it throws the 'Could not find component' exception listed 
>>>> above (top).
>>>> I've checked and double-checked that the role names match up 
>>>> throughout.
>>>> Any thoughts?
>>>
>>>
>>> Blind shot. Do you have a work interface for your 
>>> DatabaseAccessManager?
>> Thank you for a suggestion - I'm not sure what you mean by a 'work 
>> interface'.  Do you mean 'ThreadSafe', 'Poolable', etc. ?  Here is the 
>> class declaration:
>> public class DatabaseAccessManager extends AbstractLoggable implements 
>> Composable, Configurable, ThreadSafe {
>
> Every Avalon Component must implement a work interface, in your case:
>
> package your.package;
>
> import org.apache.avalon.framework.component.Component;
>
> public interface DatabaseAccessManager extends Component {
>
>     String ROLE = your.package.DatabaseAccessManager ";
>
>     //your methods and fields
> }
>
> public class DatabaseAccessManagerImpl
> extends AbstractLoggable
> implements DatabaseAccessManager,
> Parameterizable, Composable, Disposable, ThreadSafe {
>
> //your class goes here
> }
>
> You see what I mean. There interface name is the same as you
> define in your roles.conf. Important is the String ROLE in the
> DatabaseAccessManager interface. Now the ComponentManager should
> find your component.
>
> Refer to:
> <http://jakarta.apache.org/avalon/developing/index.html>
>
> I hope that helps!

Very much - thank you!

I wasn't aware of that bit of extra documentation - I had gone to the 
page:

	<http://jakarta.apache.org/avalon/framework/index.html>

which has an explanation on "What is a Component?" and "Designing a 
Component" but these texts aren't anywhere near as detailed as the one 
you mentioned.  It might be good to have a link to the "Developing with 
Apache Avalon" guide from that page.

Okay... off to make the changes. :-)

Stuart.


            Public Key - 1024D/88DD65AF 2001-11-23 Stuart Roebuck (Adolos)
      Key fingerprint = 89D9 E405 F8B1 9B22 0FA2  F2C1 9E57 5AB1 88DD 65AF
-------------------------------------------------------------------------
Stuart Roebuck                                  stuart.roebuck@adolos.com
Systems Architect                             Java, XML, MacOS X, XP, 
etc.
ADOLOS                                           <http://www.adolos.com/>


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Help! Problems installing a user component and role into Cocoon 2

Posted by Gerhard Froehlich <g-...@gmx.de>.
Stuart Roebuck wrote:
> 
> On Friday, May 10, 2002, at 08:03 AM, Gerhard Froehlich wrote:
> 
>> Stuart Roebuck wrote:
>>
>>> I'm trying to install a new 'user' component into Cocoon 2 but I'm 
>>> hitting a problem which I can't seem to get a handle on:
>>> Basically, I'm getting a the following stack dump:
>>>
>>>> ERROR   (2002-05-09) 19:03.08:176   [sitemap.generator.database-
>>>> access](/about_us_index.html) 
>>>> HttpProcessor[8080][4]/DatabaseAccessGenerator: Can't get 
>>>> DatabaseAccessManager component
>>>> org.apache.avalon.framework.component.ComponentException: Could not 
>>>> find component
>>>>         at 
>>>> org.apache.avalon.excalibur.component.ExcaliburComponentManager.lookup
>>>> (ExcaliburComponentManager.java:335)
>>>>         at org.apache.cocoon.components.CocoonComponentManager.lookup
>>>> (CocoonComponentManager.java:175)
>>>>         at 
>>>> org.apache.avalon.excalibur.component.DefaultComponentFactory$ComponentManagerProxy. 
>>>>
>>>> lookup(DefaultComponentFactory.java:323)
>>>>         at 
>>>> org.apache.avalon.excalibur.component.DefaultComponentFactory$ComponentManagerProxy. 
>>>>
>>>> lookup(DefaultComponentFactory.java:323)
>>>>         at com.adolos.cocoon.generation.DatabaseAccessGenerator.compose
>>>> (DatabaseAccessGenerator.java:94)
>>>> ...
>>>
>>> My new DatabaseAccessGenerator (generator) is composable and uses the 
>>> given manager to lookup the new component called 
>>> DatabaseAccessManager.  This component is defined in my my.roles file:
>>>
>>>> <?xml version="1.0"?>
>>>> <role-list>
>>>>   <role name="com.adolos.cocoon.util.DatabaseAccessManager"
>>>>         shorthand="database-access-manager"
>>>>         default-class="com.adolos.cocoon.util.DatabaseAccessManager"/>
>>>> </role-list>
>>>
>>> The my.roles file is referenced in my cocoon.xconf file as:
>>>
>>>> <cocoon version="2.0" user-roles="/WEB-INF/my.roles">
>>>
>>> This appears to be being accessed, as prior to putting in the 
>>> preceding forward-slash this reference threw a runtime error as well.
>>> The cocoon.xconf file also has an entry for the component like this 
>>> (I'm not sure if this is really necessary):
>>>
>>>>   <database-access-manager 
>>>> class="com.adolos.cocoon.util.DatabaseAccessManager" 
>>>> logger="core.database.access" />
>>>
>>> I have some logging in place and I know that the compose and 
>>> configure methods of my DatabaseAccessManager component are called 
>>> prior to any attempt to use the component.
>>> But, when my DatabaseAccessGenerator attempts to lookup the component 
>>> it throws the 'Could not find component' exception listed above (top).
>>> I've checked and double-checked that the role names match up throughout.
>>> Any thoughts?
>>
>>
>> Blind shot. Do you have a work interface for your DatabaseAccessManager?
> 
> 
> Thank you for a suggestion - I'm not sure what you mean by a 'work 
> interface'.  Do you mean 'ThreadSafe', 'Poolable', etc. ?  Here is the 
> class declaration:
> 
> public class DatabaseAccessManager extends AbstractLoggable implements 
> Composable, Configurable, ThreadSafe {

Every Avalon Component must implement a work interface, in your case:

package your.package;

import org.apache.avalon.framework.component.Component;

public interface DatabaseAccessManager extends Component {

     String ROLE = your.package.DatabaseAccessManager ";

     //your methods and fields
}

public class DatabaseAccessManagerImpl
extends AbstractLoggable
implements DatabaseAccessManager,
Parameterizable, Composable, Disposable, ThreadSafe {

//your class goes here
}

You see what I mean. There interface name is the same as you
define in your roles.conf. Important is the String ROLE in the
DatabaseAccessManager interface. Now the ComponentManager should
find your component.

Refer to:
<http://jakarta.apache.org/avalon/developing/index.html>

I hope that helps!

Greets
Gerhard

-- 

--------------------------------------------------
Black holes were created when God divided by zero.
--------------------------------------------------

Weblogging at: http://radio.weblogs.com/0107791/


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Help! Problems installing a user component and role into Cocoon 2

Posted by Stuart Roebuck <st...@adolos.co.uk>.
On Friday, May 10, 2002, at 08:03 AM, Gerhard Froehlich wrote:

> Stuart Roebuck wrote:
>> I'm trying to install a new 'user' component into Cocoon 2 but I'm 
>> hitting a problem which I can't seem to get a handle on:
>> Basically, I'm getting a the following stack dump:
>>> ERROR   (2002-05-09) 19:03.08:176   [sitemap.generator.database-
>>> access](/about_us_index.html) 
>>> HttpProcessor[8080][4]/DatabaseAccessGenerator: Can't get 
>>> DatabaseAccessManager component
>>> org.apache.avalon.framework.component.ComponentException: Could not 
>>> find component
>>>         at 
>>> org.apache.avalon.excalibur.component.ExcaliburComponentManager.lookup
>>> (ExcaliburComponentManager.java:335)
>>>         at org.apache.cocoon.components.CocoonComponentManager.lookup
>>> (CocoonComponentManager.java:175)
>>>         at 
>>> org.apache.avalon.excalibur.component.DefaultComponentFactory$ComponentManagerProxy.
>>> lookup(DefaultComponentFactory.java:323)
>>>         at 
>>> org.apache.avalon.excalibur.component.DefaultComponentFactory$ComponentManagerProxy.
>>> lookup(DefaultComponentFactory.java:323)
>>>         at 
>>> com.adolos.cocoon.generation.DatabaseAccessGenerator.compose
>>> (DatabaseAccessGenerator.java:94)
>>> ...
>> My new DatabaseAccessGenerator (generator) is composable and uses the 
>> given manager to lookup the new component called 
>> DatabaseAccessManager.  This component is defined in my my.roles file:
>>> <?xml version="1.0"?>
>>> <role-list>
>>>   <role name="com.adolos.cocoon.util.DatabaseAccessManager"
>>>         shorthand="database-access-manager"
>>>         default-class="com.adolos.cocoon.util.DatabaseAccessManager"/>
>>> </role-list>
>> The my.roles file is referenced in my cocoon.xconf file as:
>>> <cocoon version="2.0" user-roles="/WEB-INF/my.roles">
>> This appears to be being accessed, as prior to putting in the 
>> preceding forward-slash this reference threw a runtime error as well.
>> The cocoon.xconf file also has an entry for the component like this 
>> (I'm not sure if this is really necessary):
>>>   <database-access-manager 
>>> class="com.adolos.cocoon.util.DatabaseAccessManager" 
>>> logger="core.database.access" />
>> I have some logging in place and I know that the compose and configure 
>> methods of my DatabaseAccessManager component are called prior to any 
>> attempt to use the component.
>> But, when my DatabaseAccessGenerator attempts to lookup the component 
>> it throws the 'Could not find component' exception listed above (top).
>> I've checked and double-checked that the role names match up 
>> throughout.
>> Any thoughts?
>
> Blind shot. Do you have a work interface for your DatabaseAccessManager?

Thank you for a suggestion - I'm not sure what you mean by a 'work 
interface'.  Do you mean 'ThreadSafe', 'Poolable', etc. ?  Here is the 
class declaration:

> public class DatabaseAccessManager extends AbstractLoggable implements 
> Composable, Configurable, ThreadSafe {
>

Here's the call to look up the component, the exception is thrown in the 
lookup:

>     public void compose(ComponentManager manager) throws 
> ComponentException {
>         super.compose(manager);
>         try {
>             this.dam = (DatabaseAccessManager) 
> this.manager.lookup(DatabaseAccessManager.ROLE);
>         } catch (ComponentException e) {
>             getLogger().error("Can't get DatabaseAccessManager 
> component", e);
>             this.dam = null;
>         }
>     }

I've done some further debugging and I've established that the manager 
and this.manager objects (which are identical at the time of the lookup 
call) contain an entry for the DatabaseAccessManager role in the parent 
manager.  Could there be any issue with the lookup only discovering 
things in the immediate manager?

The other thought was whether there could be any problems arising in 
creating the instance of the DatabaseAccessManager, and if there was a 
problem, whether the error message would be different or whether 'Could 
not find component' could mean this as well.

Stuart.

            Public Key - 1024D/88DD65AF 2001-11-23 Stuart Roebuck (Adolos)
      Key fingerprint = 89D9 E405 F8B1 9B22 0FA2  F2C1 9E57 5AB1 88DD 65AF
-------------------------------------------------------------------------
Stuart Roebuck                                  stuart.roebuck@adolos.com
Systems Architect                             Java, XML, MacOS X, XP, 
etc.
ADOLOS                                           <http://www.adolos.com/>


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Help! Problems installing a user component and role into Cocoon 2

Posted by Gerhard Froehlich <g-...@gmx.de>.
Stuart Roebuck wrote:
> I'm trying to install a new 'user' component into Cocoon 2 but I'm 
> hitting a problem which I can't seem to get a handle on:
> 
> Basically, I'm getting a the following stack dump:
> 
>> ERROR   (2002-05-09) 19:03.08:176   [sitemap.generator.database-
>> access](/about_us_index.html) 
>> HttpProcessor[8080][4]/DatabaseAccessGenerator: Can't get 
>> DatabaseAccessManager component
>> org.apache.avalon.framework.component.ComponentException: Could not 
>> find component
>>         at 
>> org.apache.avalon.excalibur.component.ExcaliburComponentManager.lookup
>> (ExcaliburComponentManager.java:335)
>>         at org.apache.cocoon.components.CocoonComponentManager.lookup
>> (CocoonComponentManager.java:175)
>>         at 
>> org.apache.avalon.excalibur.component.DefaultComponentFactory$ComponentManagerProxy. 
>>
>> lookup(DefaultComponentFactory.java:323)
>>         at 
>> org.apache.avalon.excalibur.component.DefaultComponentFactory$ComponentManagerProxy. 
>>
>> lookup(DefaultComponentFactory.java:323)
>>         at com.adolos.cocoon.generation.DatabaseAccessGenerator.compose
>> (DatabaseAccessGenerator.java:94)
>> ...
> 
> 
> My new DatabaseAccessGenerator (generator) is composable and uses the 
> given manager to lookup the new component called DatabaseAccessManager.  
> This component is defined in my my.roles file:
> 
>> <?xml version="1.0"?>
>> <role-list>
>>   <role name="com.adolos.cocoon.util.DatabaseAccessManager"
>>         shorthand="database-access-manager"
>>         default-class="com.adolos.cocoon.util.DatabaseAccessManager"/>
>> </role-list>
> 
> 
> The my.roles file is referenced in my cocoon.xconf file as:
> 
>> <cocoon version="2.0" user-roles="/WEB-INF/my.roles">
> 
> 
> This appears to be being accessed, as prior to putting in the preceding 
> forward-slash this reference threw a runtime error as well.
> 
> The cocoon.xconf file also has an entry for the component like this (I'm 
> not sure if this is really necessary):
> 
>>   <database-access-manager 
>> class="com.adolos.cocoon.util.DatabaseAccessManager" 
>> logger="core.database.access" />
> 
> 
> I have some logging in place and I know that the compose and configure 
> methods of my DatabaseAccessManager component are called prior to any 
> attempt to use the component.
> 
> But, when my DatabaseAccessGenerator attempts to lookup the component it 
> throws the 'Could not find component' exception listed above (top).
> 
> I've checked and double-checked that the role names match up throughout.
> 
> Any thoughts?

Blind shot. Do you have a work interface for your DatabaseAccessManager?

Greets
Gerhard

-- 

--------------------------------
Beam me up... arrgh, no carrier!
--------------------------------

Weblogging at: http://radio.weblogs.com/0107791/


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>