You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by boca2608 <bo...@gmail.com> on 2018/07/02 15:14:37 UTC

Using GroovyBeanDefinitionReader received "No namespace handler found for URI: http://cxf.apache.org/configuration/security"

I am trying to use GroovyBeanDefinitionReader to replace my current Spring
XML configuration, but run into an issue with creating a bean for CXF
conduit.  Here is the code that creates the conduit bean:

        def reader = new GroovyBeanDefinitionReader(ctx)
        reader.beans{
           
xmlns([http:'http://cxf.apache.org/transports/http/configuration',sec:'http://cxf.apache.org/configuration/security'])
            http.'conduit'('name':'http://.*/vzpublish/.*') {
                http.'authorization' {
                    sec.'UserName' = 'user'
                    sec.'Password' = 'pass'
                    sec.'AuthorizationType' = 'Basic'
                }
            }
        }

It returned an error:
org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
Configuration problem: No namespace handler found for URI:
http://cxf.apache.org/configuration/security

The namespace handler for CXF security is not included in the namespace
handler map used (by Groovy, see below) even with the dependency the
following dependency included:

compile "org.apache.cxf:cxf-common-schemas:2.3.11"


Groovy came up with the following map of namespace handlers (nothing for
security):
{http://www.springframework.org/schema/aop=org.springframework.aop.config.AopNamespaceHandler,
http://camel.apache.org/schema/cxf=org.apache.camel.component.cxf.spring.NamespaceHandler,
http://schemas.xmlsoap.org/ws/2004/09/policy=org.apache.cxf.ws.policy.spring.PolicyNamespaceHandler,
http://camel.apache.org/schema/spring=org.apache.camel.spring.handler.CamelNamespaceHandler,
http://www.springframework.org/schema/lang=org.springframework.scripting.config.LangNamespaceHandler,
http://cxf.apache.org/ws/addressing=org.apache.cxf.ws.addressing.spring.NamespaceHandler,
http://www.springframework.org/schema/c=org.springframework.beans.factory.xml.SimpleConstructorNamespaceHandler,
http://cxf.apache.org/jaxws=org.apache.cxf.jaxws.spring.NamespaceHandler,
http://www.springframework.org/schema/jee=org.springframework.ejb.config.JeeNamespaceHandler,
http://cxf.apache.org/policy=org.apache.cxf.ws.policy.spring.NamespaceHandler,
http://www.w3.org/2006/07/ws-policy=org.apache.cxf.ws.policy.spring.PolicyNamespaceHandler,
http://cxf.apache.org/bindings/soap=org.apache.cxf.binding.soap.spring.NamespaceHandler,
http://www.springframework.org/schema/jdbc=org.springframework.jdbc.config.JdbcNamespaceHandler,
http://www.springframework.org/schema/p=org.springframework.beans.factory.xml.SimplePropertyNamespaceHandler,
http://www.springframework.org/schema/util=org.springframework.beans.factory.xml.UtilNamespaceHandler,
http://www.springframework.org/schema/mvc=org.springframework.web.servlet.config.MvcNamespaceHandler,
http://cxf.apache.org/transports/http/configuration=org.apache.cxf.transport.http.spring.NamespaceHandler@2e510ee5,
http://cxf.apache.org/core=org.apache.cxf.bus.spring.NamespaceHandler,
http://cxf.apache.org/jaxrs-client=org.apache.cxf.jaxrs.client.spring.NamespaceHandler,
http://cxf.apache.org/simple=org.apache.cxf.frontend.spring.NamespaceHandler,
http://www.springframework.org/schema/task=org.springframework.scheduling.config.TaskNamespaceHandler,
http://cxf.apache.org/jaxrs=org.apache.cxf.jaxrs.spring.NamespaceHandler,
http://www.w3.org/ns/ws-policy=org.apache.cxf.ws.policy.spring.PolicyNamespaceHandler,
http://cxf.apache.org/transports/camel=org.apache.camel.component.cxf.transport.spring.NamespaceHandler,
http://camel.apache.org/schema/spring/v2.21=org.apache.camel.spring.handler.CamelNamespaceHandler,
http://www.springframework.org/schema/cache=org.springframework.cache.config.CacheNamespaceHandler,
http://cxf.apache.org/transports/http-jetty/configuration=org.apache.cxf.transport.http_jetty.spring.NamespaceHandler,
http://www.springframework.org/schema/tx=org.springframework.transaction.config.TxNamespaceHandler,
http://www.springframework.org/schema/context=org.springframework.context.config.ContextNamespaceHandler}

Is there anything else that needs to be included in the dependency/classpath
to make this work?  Thanks in advance for any help!



--
Sent from: http://cxf.547215.n5.nabble.com/cxf-user-f547216.html

Re: Using GroovyBeanDefinitionReader received "No namespace handler found for URI: http://cxf.apache.org/configuration/security"

Posted by boca2608 <bo...@gmail.com>.
Colm, thank you very much for your time and insight!



--
Sent from: http://cxf.547215.n5.nabble.com/cxf-user-f547216.html

Re: Using GroovyBeanDefinitionReader received "No namespace handler found for URI: http://cxf.apache.org/configuration/security"

Posted by Colm O hEigeartaigh <co...@apache.org>.
The HTTP "conduit" element is handled by the
org.apache.cxf.transport.http.spring.NamespaceHandler, which registers the
HttpConduitBeanDefinitionParser for the "conduit" element. The
HttpConduitBeanDefinitionParser takes care of parsing the "security"
namespace configuration inside the "conduit" Element - there is not a
separate Spring NamespaceHandler for the security schema.

I don't know enough about using groovy in this way to say if there's a
workaround for the problem you have encountered, sorry.

Colm.

On Tue, Jul 3, 2018 at 5:03 PM, boca2608 <bo...@gmail.com> wrote:

> Hi Colm,
>
> Thank you very much for taking time to help.
>
> The reason why I used the org.apache.cxf:cxf-common-schemas:2.3.11 was
> that
> according to CXF docs, this package contains the namespace handler for cxf
> security, and that the latest version of this package (according to Maven)
> is 2.3.11.   In any case, I tried to use CXF 3.2.5 but received the same
> error.  It seems that XmlBeanDefinitionReader tried to create the
> defaultNamespaceHandlerResolver using the default handler mappings
> location
> (META-INF/spring.handlers).  This created the map I included in the
> original
> post which contains most CXF namespace handlers, except for the security
> one.
>
> Thanks!
>
>
>
> --
> Sent from: http://cxf.547215.n5.nabble.com/cxf-user-f547216.html
>



-- 
Colm O hEigeartaigh

Talend Community Coder
http://coders.talend.com

Re: Using GroovyBeanDefinitionReader received "No namespace handler found for URI: http://cxf.apache.org/configuration/security"

Posted by boca2608 <bo...@gmail.com>.
Hi Colm,

Thank you very much for taking time to help.  

The reason why I used the org.apache.cxf:cxf-common-schemas:2.3.11 was that
according to CXF docs, this package contains the namespace handler for cxf
security, and that the latest version of this package (according to Maven)
is 2.3.11.   In any case, I tried to use CXF 3.2.5 but received the same
error.  It seems that XmlBeanDefinitionReader tried to create the
defaultNamespaceHandlerResolver using the default handler mappings location
(META-INF/spring.handlers).  This created the map I included in the original
post which contains most CXF namespace handlers, except for the security
one.

Thanks!



--
Sent from: http://cxf.547215.n5.nabble.com/cxf-user-f547216.html

Re: Using GroovyBeanDefinitionReader received "No namespace handler found for URI: http://cxf.apache.org/configuration/security"

Posted by Colm O hEigeartaigh <co...@apache.org>.
 "org.apache.cxf:cxf-common-schemas:2.3.11" is from a very old version of
CXF. The security schema is present in "cxf-core" in more recent versions
of CXF. You could try upgrading to the most recent version of CXF (3.2.5)
and include cxf-core on the classpath and see if it works.

Colm.

On Mon, Jul 2, 2018 at 4:14 PM, boca2608 <bo...@gmail.com> wrote:

> I am trying to use GroovyBeanDefinitionReader to replace my current Spring
> XML configuration, but run into an issue with creating a bean for CXF
> conduit.  Here is the code that creates the conduit bean:
>
>         def reader = new GroovyBeanDefinitionReader(ctx)
>         reader.beans{
>
> xmlns([http:'http://cxf.apache.org/transports/http/configuration',sec:'
> http://cxf.apache.org/configuration/security'])
>             http.'conduit'('name':'http://.*/vzpublish/.*') {
>                 http.'authorization' {
>                     sec.'UserName' = 'user'
>                     sec.'Password' = 'pass'
>                     sec.'AuthorizationType' = 'Basic'
>                 }
>             }
>         }
>
> It returned an error:
> org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
> Configuration problem: No namespace handler found for URI:
> http://cxf.apache.org/configuration/security
>
> The namespace handler for CXF security is not included in the namespace
> handler map used (by Groovy, see below) even with the dependency the
> following dependency included:
>
> compile "org.apache.cxf:cxf-common-schemas:2.3.11"
>
>
> Groovy came up with the following map of namespace handlers (nothing for
> security):
> {http://www.springframework.org/schema/aop=org.springframework.aop.config.
> AopNamespaceHandler,
> http://camel.apache.org/schema/cxf=org.apache.camel.component.cxf.spring.
> NamespaceHandler,
> http://schemas.xmlsoap.org/ws/2004/09/policy=org.apache.cxf.
> ws.policy.spring.PolicyNamespaceHandler,
> http://camel.apache.org/schema/spring=org.apache.camel.spring.handler.
> CamelNamespaceHandler,
> http://www.springframework.org/schema/lang=org.springframework.scripting.
> config.LangNamespaceHandler,
> http://cxf.apache.org/ws/addressing=org.apache.cxf.ws.addressing.spring.
> NamespaceHandler,
> http://www.springframework.org/schema/c=org.springframework.beans.factory.
> xml.SimpleConstructorNamespaceHandler,
> http://cxf.apache.org/jaxws=org.apache.cxf.jaxws.spring.NamespaceHandler,
> http://www.springframework.org/schema/jee=org.springframework.ejb.config.
> JeeNamespaceHandler,
> http://cxf.apache.org/policy=org.apache.cxf.ws.policy.
> spring.NamespaceHandler,
> http://www.w3.org/2006/07/ws-policy=org.apache.cxf.ws.policy.spring.
> PolicyNamespaceHandler,
> http://cxf.apache.org/bindings/soap=org.apache.cxf.binding.soap.spring.
> NamespaceHandler,
> http://www.springframework.org/schema/jdbc=org.
> springframework.jdbc.config.JdbcNamespaceHandler,
> http://www.springframework.org/schema/p=org.springframework.beans.factory.
> xml.SimplePropertyNamespaceHandler,
> http://www.springframework.org/schema/util=org.
> springframework.beans.factory.xml.UtilNamespaceHandler,
> http://www.springframework.org/schema/mvc=org.springframework.web.servlet.
> config.MvcNamespaceHandler,
> http://cxf.apache.org/transports/http/configuration=
> org.apache.cxf.transport.http.spring.NamespaceHandler@2e510ee5,
> http://cxf.apache.org/core=org.apache.cxf.bus.spring.NamespaceHandler,
> http://cxf.apache.org/jaxrs-client=org.apache.cxf.jaxrs.
> client.spring.NamespaceHandler,
> http://cxf.apache.org/simple=org.apache.cxf.frontend.
> spring.NamespaceHandler,
> http://www.springframework.org/schema/task=org.springframework.scheduling.
> config.TaskNamespaceHandler,
> http://cxf.apache.org/jaxrs=org.apache.cxf.jaxrs.spring.NamespaceHandler,
> http://www.w3.org/ns/ws-policy=org.apache.cxf.ws.policy.spring.
> PolicyNamespaceHandler,
> http://cxf.apache.org/transports/camel=org.apache.
> camel.component.cxf.transport.spring.NamespaceHandler,
> http://camel.apache.org/schema/spring/v2.21=org.
> apache.camel.spring.handler.CamelNamespaceHandler,
> http://www.springframework.org/schema/cache=org.
> springframework.cache.config.CacheNamespaceHandler,
> http://cxf.apache.org/transports/http-jetty/configuration=org.apache.cxf.
> transport.http_jetty.spring.NamespaceHandler,
> http://www.springframework.org/schema/tx=org.springframework.transaction.
> config.TxNamespaceHandler,
> http://www.springframework.org/schema/context=org.springframework.context.
> config.ContextNamespaceHandler}
>
> Is there anything else that needs to be included in the
> dependency/classpath
> to make this work?  Thanks in advance for any help!
>
>
>
> --
> Sent from: http://cxf.547215.n5.nabble.com/cxf-user-f547216.html
>



-- 
Colm O hEigeartaigh

Talend Community Coder
http://coders.talend.com