commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vinicius Caldeira Carvalho <vinicius.carva...@squadra.com.br>
Subject Re: chains: refering to another chain in my chain
Date Wed, 06 Apr 2005 13:03:35 GMT
Craig McClanahan wrote:

>On Apr 4, 2005 6:06 AM, Vinicius Caldeira Carvalho
><vinicius.carvalho@squadra.com.br> wrote:
>  
>
>>Vinicius Caldeira Carvalho wrote:
>>
>>    
>>
>>>PS: I'm using org.apache.commons.chain.CONFIG_WEB_RESOURCE I thought
>>>this may add some extra info :-)
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>>
>>>
>>>
>>>      
>>>
>>Well, I found out that the property for the catalog is
>>catalogName="something" and not catalog="something", Thanks lord for
>>OpenSource :D
>>
>><command className="org.apache.commons.chain.generic.LookupCommand"
>>name="validarRegraCompraPlanoCobertura" catalogName="catalog"/>
>>
>>Now I get:
>>java.lang.IllegalArgumentException: Cannot find catalog 'catalog'
>>
>>here's my web.xml
>>
>><context-param>
>>  <param-name>org.apache.commons.chain.CONFIG_WEB_RESOURCE</param-name>
>>  <param-value>/WEB-INF/catalog.xml</param-value>
>></context-param>
>><context-param>
>>    <param-name>org.apache.commons.chain.CONFIG_ATTR</param-name>
>>    <param-value>catalog</param-value>
>></context-param>
>>
>>    
>>
>
>Specifying the catalog name as a context param implies that you are
>using the old style (now deprecated) mechanism for configuring
>[chain], which (most importantly) does *not* register the catalog with
>CatalogFactory.  Instead, you'll want to leave out the second
><context-param> entry, and make sure your chain definitions document
>includes information about the catalogs to be used:
>
><catalogs>
>    <catalog name="catalog">
>        <chain .../>
>        <chain .../>
>    </catalog>
>    <catalog name="otherCatalog">
>        <chain .../>
>        <chain .../>
>    </catalog>
></catalogs>
>
>Craig
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>
>
>  
>
Well I guess I'm doing something terrible wrong here. But it's not 
working using <catalogs></catalogs>

here's my catalog.xml:



<catalogs>
    <catalog name="catalog">
        <chain name="validarRegraCompraPlanoCobertura">
            <command 
className="myCompanySystem.view.administrarregracompra.action.commands.InitSalvarRegraCompraCommand"/>
            <command 
className="myCompanySystem.view.administrarregracompra.action.commands.RemoverItensCommand"/>
   
   
            <command 
className="myCompanySystem.view.administrarregracompra.action.commands.VerificarItensDuplicadosCommand"/>
            <command 
className="myCompanySystem.view.administrarregracompra.action.commands.VerificarExistenciaItemCommand"/>
            <command 
className="myCompanySystem.view.administrarregracompra.action.commands.AssembleRegraCompraCommand"/>
            <command 
className="myCompanySystem.view.administrarregracompra.action.commands.VerificarCategoriaPaiCommand"/>
            <command 
className="myCompanySystem.view.administrarregracompra.action.commands.VerificarHierarquiaItemsCommand"/>
            <command 
className="myCompanySystem.view.administrarregracompra.action.commands.UpdateRegraCompraCommand"/>
        </chain>
        <chain name="ordernarRegraCompraPlanoCobertura">
            <command 
className="myCompanySystem.view.administrarregracompra.action.commands.InitSalvarRegraCompraCommand"/>
            <command 
className="myCompanySystem.view.administrarregracompra.action.commands.RemoverItensCommand"/>
   
   
            <command 
className="myCompanySystem.view.administrarregracompra.action.commands.VerificarItensDuplicadosCommand"/>
            <command 
className="myCompanySystem.view.administrarregracompra.action.commands.VerificarExistenciaItemCommand"/>
            <command 
className="myCompanySystem.view.administrarregracompra.action.commands.AssembleRegraCompraCommand"/>
            <command 
className="myCompanySystem.view.administrarregracompra.action.commands.VerificarCategoriaPaiCommand"/>
            <command 
className="myCompanySystem.view.administrarregracompra.action.commands.VerificarHierarquiaItemsCommand"/>
            <command 
className="myCompanySystem.view.administrarregracompra.action.commands.UpdateRegraCompraCommand"/>
            <command 
className="myCompanySystem.view.administrarregracompra.action.commands.OrganizarRegraCompraCommand"/>
        </chain>
    </catalog>
</catalogs>

Here's my web.xml:
  <context-param>
  <param-name>org.apache.commons.chain.CONFIG_WEB_RESOURCE</param-name>
  <param-value>/WEB-INF/catalog.xml</param-value>
</context-param>

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

Now It doesn't run the commands:
10:00:14,110 INFO  [STDOUT] java.lang.NullPointerException
10:00:14,110 INFO  [STDOUT]     at 
com.araujo.convenios.view.action.CommandAction.getCommand(CommandAction.java:32)
10:00:14,110 INFO  [STDOUT]     at 
com.araujo.convenios.view.administrarregracompra.action.OrganizarRegraCompraAction.doExecute(OrganizarRegraCompraAction.java:39)

Could someone please help?

Thanx

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


Mime
View raw message