You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Pedro Salgado <sa...@04web.com> on 2005/01/07 17:19:35 UTC

commons-chain: missing context parameter

Hello to all,

  On the cookbook, section "Load a Catalog From a Web Application", it is
missing this piece on the given web.xml.

    <context-param>
        <param-name>org.apache.commons.chain.CONFIG_ATTR</param-name>
        <param-value>catalog</param-value>
    </context-param>
    <context-param>


  I checked 
org.apache.commons.chain.web.ChainListener.contextInitialized(...) source
and it says CONFIG_ATTR is deprecated. I think this is also wrong. If so,
why do I need to declare it on the web.xml? It could also be a bug on the
method implementation.

  Regards,

Pedro


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: commons-chain: missing context parameter

Posted by Pedro Salgado <sa...@04web.com>.
  Still not working :( The catalog is null.
  If I specify org.apache.commons.chain.CONFIG_ATTR on my web.xml the
catalog is no longer null but it does not contain any commands.

  I have looked at the source code severall times and I don't know where is
the problem. Help?





I have appended a logger to commons-chain and commons-digester... here are
the results :

** commons-chain log

15:46:17,970 - INFO org.apache.commons.chain.web.ChainListener -
Initializing chain listener
15:46:18,050 - DEBUG org.apache.commons.chain.web.ChainResources - Loading
chain config resource 'chain-config.xml'


** commons-digester log

does not provide any information about commons-chain parse operation (?)


My configuration :

** chain-config.xml (that is being copied to the WEB-INF/classes)

<?xml version="1.0" encoding="UTF-8" ?>
<catalogs>

    <catalog name="risks">


        <command
            name="viewRiskTypes"
            className="package.commands.ViewRiskTypes"/>

    </catalog>

</catalogs>

** web.xml (Tomcat-5.0.27)

 <context-param>
    <param-name>org.apache.commons.chain.CONFIG_CLASS_RESOURCE</param-name>
    <param-value>chain-config.xml</param-value>
 </context-param>

 <listener>
   <listener-class>
     org.apache.commons.chain.web.ChainListener
   </listener-class>
 </listener>




On 10/1/05 7:40 am, "Pedro Salgado" <sa...@04web.com> wrote:

> 
> Thank you!
> 
> Pedro
> 
> On 7/1/05 7:50 pm, "Craig McClanahan" <cr...@gmail.com> wrote:
> 
>>   <catalogs>
>>       <catalog name="foo">
>>           ... commands for catalog "foo" ...
>>       </catalog>
>>       <catalog name="bar">
>>           ... commands for catalog "bar" ...
>>       </catalog>
>>   </catalogs>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: commons-chain: missing context parameter

Posted by Pedro Salgado <sa...@04web.com>.
Thank you!

Pedro

On 7/1/05 7:50 pm, "Craig McClanahan" <cr...@gmail.com> wrote:

>   <catalogs>
>       <catalog name="foo">
>           ... commands for catalog "foo" ...
>       </catalog>
>       <catalog name="bar">
>           ... commands for catalog "bar" ...
>       </catalog>
>   </catalogs>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: commons-chain: missing context parameter

Posted by Craig McClanahan <cr...@gmail.com>.
Setting a context init parameter to define the catalog name was the
original configuration mechanism.  However, configuration was later
enhanced so you can specify the catalog name on a <catalog> element
directly in your config file, and therefore even load different
catalogs from the same document:

    <catalogs>
        <catalog name="foo">
            ... commands for catalog "foo" ...
        </catalog>
        <catalog name="bar">
            ... commands for catalog "bar" ...
        </catalog>
    </catalogs>

Craig



On Fri, 07 Jan 2005 17:19:35 +0100, Pedro Salgado <sa...@04web.com> wrote:
> Hello to all,
> 
>   On the cookbook, section "Load a Catalog From a Web Application", it is
> missing this piece on the given web.xml.
> 
>     <context-param>
>         <param-name>org.apache.commons.chain.CONFIG_ATTR</param-name>
>         <param-value>catalog</param-value>
>     </context-param>
>     <context-param>
> 
>   I checked
> org.apache.commons.chain.web.ChainListener.contextInitialized(...) source
> and it says CONFIG_ATTR is deprecated. I think this is also wrong. If so,
> why do I need to declare it on the web.xml? It could also be a bug on the
> method implementation.
> 
>   Regards,
> 
> Pedro
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org