You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Gabo Manuel <km...@solegysystems.com> on 2009/03/20 07:24:02 UTC
[CXF2.2][IPLANET6sp6][Spring2.0.6] spring unable to find namespace
Hi guys,
First of all, since CXF2.2 is out... WOOOOHOOOOOOO!!!
I have the following configuration in beans.xml:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xmlns:jaxrs="http://cxf.apache.org/jaxrs"
xmlns:soap="http://cxf.apache.org/bindings/soap"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://cxf.apache.org/bindings/soap
http://cxf.apache.org/schemas/configuration/soap.xsd
http://cxf.apache.org/jaxrs
http://cxf.apache.org/schemas/jaxrs.xsd
http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd
">
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<import
resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
<jaxrs:server id="restServices" address="/rest">
<jaxrs:serviceBeans>
<bean class="some.domain.MyService"/>
</jaxrs:serviceBeans>
<jaxrs:providers>
<bean class="some.domain.BooleanProvider"/>
</jaxrs:providers>
<jaxrs:inInterceptors>
<bean class="some.domain.RestInHandler"/>
</jaxrs:inInterceptors>
</jaxrs:server>
</beans>
Upon starting the iplanet instance, I get the following error message:
failure: WebModule[]: WEB2683: Exception sending context initialized
event to listener instance of class
org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
Configuration problem: Unable to locate Spring NamespaceHandler for XML
schema namespace [http://cxf.apache.org/jaxrs]
Offending resource: ServletContext resource [/WEB-INF/beans.xml]
at
org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
at
org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
at
org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:80)
at
org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:261)
at
org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1111)
at
org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1104)
at
org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:133)
at
org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:90)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:458)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:353)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:280)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:131)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:147)
at
org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
at
org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92)
at
org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:101)
at
org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:389)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:324)
at
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:244)
at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187)
at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3387)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3743)
at com.iplanet.ias.web.WebModule.start(WebModule.java:251)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
at
org.apache.catalina.core.StandardHost.start(StandardHost.java:652)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:355)
at org.apache.catalina.startup.Embedded.start(Embedded.java:995)
at com.iplanet.ias.web.WebContainer.start(WebContainer.java:431)
at
com.iplanet.ias.web.WebContainer.startInstance(WebContainer.java:500)
at
com.iplanet.ias.server.J2EERunner.confPostInit(J2EERunner.java:161)
I am able to ping "cxf.apache.org" to check just in case it was not
accessible. I am also able to run this same set of configurations and
binaries in my local tomcat server (v6.0.13).
Again, thanks in advance.
Gabo
Re: [CXF2.2][IPLANET6sp6][Spring2.0.6] spring unable to find namespace
Posted by Gabo Manuel <km...@solegysystems.com>.
Hi amine (or Salam?),
Try the following annotations in your object declaration:
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
@XmlType(name="MyObject")
@XmlAccessorType(XmlAccessType.PROPERTY)
@XmlRootElement(name="MyObject")
public class MyObject {
//add your getters and setters here...
}
-------------------
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
@XmlRootElement(name="MyObjectList")
@XmlType(name="MyObjectList")
@XmlAccessorType(XmlAccessType.FIELD)
public class MyObjectList {
@XmlElement(nillable=true, name="MyObject")
private List<MyObject> objects = new ArrayList<MyObject>();
//add your getters and setters here...
}
I'm using default JAXB and I don't see any "duplication" of the nodes. Hth.
Gabo
P.S. I am not sure how this relates to my original question. :)
amine amine wrote:
> Salam,
>
> Hi Gabo,
>
> I want to ask you about combining JAX-WS and JAX-RS, for me it's my
> interface that contains annotations (WS & RS) and I'm using @XmlElement,
> @XmlRootelement and @XmlWrapper. it works both services WS and RESTfulWS are
> available, but the XML structure of the responses give double XML nodes
>
> like this bellow (the Clients node figures two times and the expected is
> only once) :
> <ClientsList>
> <Clients>
> <Clients>
> <Client>
> </Client>
> <Client>
> </Client>
> </Clients>
> </Clients>
> </ClientsList>
>
> thank you in advance! and good luck !
>
Re: [CXF2.2][IPLANET6sp6][Spring2.0.6] spring unable to find
namespace
Posted by amine amine <am...@gmail.com>.
Salam,
Hi Gabo,
I want to ask you about combining JAX-WS and JAX-RS, for me it's my
interface that contains annotations (WS & RS) and I'm using @XmlElement,
@XmlRootelement and @XmlWrapper. it works both services WS and RESTfulWS are
available, but the XML structure of the responses give double XML nodes
like this bellow (the Clients node figures two times and the expected is
only once) :
<ClientsList>
<Clients>
<Clients>
<Client>
</Client>
<Client>
</Client>
</Clients>
</Clients>
</ClientsList>
thank you in advance! and good luck !
--
Tigre et dragon "guardians of paradise"
Re: [CXF2.2][IPLANET6sp6][Spring2.0.6] spring unable to find namespace
Posted by Gabo Manuel <km...@solegysystems.com>.
Hi Sergey,
I knew it was something to do with the versions... just didn't know
which. Just would like to ask however, how come it works in tomcat? I am
definitely sure of using spring 2.0.6 since its only now that I
downloaded 2.5.5.
Gabo
Sergey Beryozkin wrote:
> No problems :-) You mentioned the Spring version in the subject in the
> first email in this thread and we noticed it only today, LOL :-)
> Cheers, Sergey
>
> ----- Original Message ----- From: "Gabo Manuel"
> <km...@solegysystems.com>
> To: <us...@cxf.apache.org>
> Sent: Tuesday, March 24, 2009 12:19 PM
> Subject: Re: [CXF2.2][IPLANET6sp6][Spring2.0.6] spring unable to find
> namespace
>
>
>> Hi Sergey,
>>
>> Thanks for that. I did not notice that part. It was the cause of the
>> problem. Sorry for the trouble. :(
>>
>> Its going through now.
>>
>> Gabo
>>
>> Sergey Beryozkin wrote:
>>> Hi,
>>>
>>> Actually, CXF 2.2 depends on Spring 2.5.x, while you.re using
>>> Sppring 2.0.6 (as the subject says) - can that be the cause of the
>>> problem ?
>>>
>>> Cheers, Sergey
Re: [CXF2.2][IPLANET6sp6][Spring2.0.6] spring unable to find namespace
Posted by Sergey Beryozkin <sb...@progress.com>.
No problems :-) You mentioned the Spring version in the subject in the first email in this thread and we noticed it only today, LOL
:-)
Cheers, Sergey
----- Original Message -----
From: "Gabo Manuel" <km...@solegysystems.com>
To: <us...@cxf.apache.org>
Sent: Tuesday, March 24, 2009 12:19 PM
Subject: Re: [CXF2.2][IPLANET6sp6][Spring2.0.6] spring unable to find namespace
> Hi Sergey,
>
> Thanks for that. I did not notice that part. It was the cause of the problem. Sorry for the trouble. :(
>
> Its going through now.
>
> Gabo
>
> Sergey Beryozkin wrote:
>> Hi,
>>
>> Actually, CXF 2.2 depends on Spring 2.5.x, while you.re using Sppring 2.0.6 (as the subject says) - can that be the cause of the
>> problem ?
>>
>> Cheers, Sergey
>>
Re: [CXF2.2][IPLANET6sp6][Spring2.0.6] spring unable to find namespace
Posted by Gabo Manuel <km...@solegysystems.com>.
Hi Sergey,
Thanks for that. I did not notice that part. It was the cause of the
problem. Sorry for the trouble. :(
Its going through now.
Gabo
Sergey Beryozkin wrote:
> Hi,
>
> Actually, CXF 2.2 depends on Spring 2.5.x, while you.re using Sppring
> 2.0.6 (as the subject says) - can that be the cause of the problem ?
>
> Cheers, Sergey
>
Re: [CXF2.2][IPLANET6sp6][Spring2.0.6] spring unable to find namespace
Posted by Sergey Beryozkin <sb...@progress.com>.
Hi,
Actually, CXF 2.2 depends on Spring 2.5.x, while you.re using Sppring 2.0.6 (as the subject says) - can that be the cause of the
problem ?
Cheers, Sergey
----- Original Message -----
From: "Gabo Manuel" <km...@solegysystems.com>
To: <us...@cxf.apache.org>
Sent: Tuesday, March 24, 2009 11:42 AM
Subject: Re: [CXF2.2][IPLANET6sp6][Spring2.0.6] spring unable to find namespace
> Hi All,
>
> I am not sure if this would be an accurate comparison. I dug up my old old old test app. I created this when I first got wind of
> CXF from XFire. Below is the difference of this scenario from the one earlier posted:
>
> Spring-2.0.4
> CXF-2.0.1-incubator
>
> Test.java:
> public class Test {
> public String echo(String s){
> return "entered method: " + s;
> }
> }
>
> beans.xml
> <beans xmlns="http://www.springframework.org/schema/beans"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:jaxws="http://cxf.apache.org/jaxws"
> xmlns:soap="http://cxf.apache.org/bindings/soap"
> xsi:schemaLocation="http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
> http://cxf.apache.org/bindings/soap
> http://cxf.apache.org/schemas/configuration/soap.xsd
> http://cxf.apache.org/jaxws
> http://cxf.apache.org/schemas/jaxws.xsd">
>
> <import resource="classpath:META-INF/cxf/cxf.xml" />
> <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
> <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
>
> <jaxws:endpoint
> id="test"
> implementor="some.domain.Test"
> address="/Test"
> >
> <jaxws:binding>
> <soap:soapBinding style="RPC" use="LITERAL" />
> </jaxws:binding>
> </jaxws:endpoint>
> </beans>
>
> I start the instance and no errors. I check for the WSDL and it displays the binding. No method though:
>
> <?xml version="1.0" encoding="utf-8" ?>
> <wsdl:definitions
> xmlns:ns1="http://domain.some/"
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> name="TestService"
> targetNamespace="http://domain.some/">
> <wsdl:portType name="Test" />
> <wsdl:binding name="TestServiceSoapBinding" type="ns1:Test">
> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
> </wsdl:binding>
> <wsdl:service name="TestService">
> <wsdl:port binding="ns1:TestServiceSoapBinding" name="TestPort">
> <soap:address location="http://192.168.0.1:8030/services/Test" />
> </wsdl:port>
> </wsdl:service>
> </wsdl:definitions>
>
> I'll try creating a bit more complex sample for the old API. I'll post it as soon as I have result. I just thought this might
> strike a flag or something.
>
> Gabo
>
> Sergey Beryozkin wrote:
>> Hi Gabo
>>
>> Nearly every CXF component has a file META-INF/spring.handlers, jaxws and jaxrs componets ship such files. It appears Spring can
>> not find these files for some reasons on the classpath...
>>
>> Cheers, Sergey
>>
>> ----- Original Message ----- From: "Gabo Manuel" <km...@solegysystems.com>
>> To: <us...@cxf.apache.org>
>> Cc: "Daniel Kulp" <dk...@apache.org>
>> Sent: Tuesday, March 24, 2009 3:11 AM
>> Subject: Re: [CXF2.2][IPLANET6sp6][Spring2.0.6] spring unable to find namespace
>>
>>
>>> Hi Dan,
>>>
>>>> Are you using something like "dependency:unpack-dependencies" or something to combine the various jars into a single jar/war?
>>>> If so, that will DEFINITELY cause this.
>>> Nope. Unless it is used by something by default. I am not using any war.
>>>
>>>> Check the stuff you are deploying for a META-INF/spring.handlers file and make sure it contains mapping for the required
>>>> handlers.
>>> I checked the said file of the spring.jar I am using. I have added the following entries:
>>>
>>> http\://cxf.apache.org/jaxws=org.apache.cxf.jaxws.spring.NamespaceHandler
>>> http\://cxf.apache.org/jaxrs=org.apache.cxf.jaxrs.spring.NamespaceHandler
>>> http\://cxf.apache.org/bindings/soap=org.apache.cxf.binding.soap.spring.NamespaceHandler
>>>
>>> But I still get the same error message:
>>>
>>> failure: WebModule[]: WEB2683: Exception sending context initialized event to listener instance of class
>>> org.springframework.web.context.ContextLoaderListener
>>> org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring
>>> NamespaceHandler for XML schema namespace [http://cxf.apache.org/jaxws]
>>> Offending resource: ServletContext resource [/WEB-INF/beans.xml]
>>>
>>> I'll try to look further if this is an issue with IPlanet since the setup works fine for tomcat.
>>>
>>> Gabo
>>>
>> ------------------------------------------------------------------------
>>
>>
>> No virus found in this incoming message.
>> Checked by AVG - www.avg.com Version: 8.0.238 / Virus Database: 270.11.25/2019 - Release Date: 03/23/09 18:51:00
>>
>>
Re: [CXF2.2][IPLANET6sp6][Spring2.0.6] spring unable to find namespace
Posted by Gabo Manuel <km...@solegysystems.com>.
Hi All,
I am not sure if this would be an accurate comparison. I dug up my old
old old test app. I created this when I first got wind of CXF from
XFire. Below is the difference of this scenario from the one earlier posted:
Spring-2.0.4
CXF-2.0.1-incubator
Test.java:
public class Test {
public String echo(String s){
return "entered method: " + s;
}
}
beans.xml
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xmlns:soap="http://cxf.apache.org/bindings/soap"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://cxf.apache.org/bindings/soap
http://cxf.apache.org/schemas/configuration/soap.xsd
http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd">
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<jaxws:endpoint
id="test"
implementor="some.domain.Test"
address="/Test"
>
<jaxws:binding>
<soap:soapBinding style="RPC" use="LITERAL" />
</jaxws:binding>
</jaxws:endpoint>
</beans>
I start the instance and no errors. I check for the WSDL and it displays
the binding. No method though:
<?xml version="1.0" encoding="utf-8" ?>
<wsdl:definitions
xmlns:ns1="http://domain.some/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
name="TestService"
targetNamespace="http://domain.some/">
<wsdl:portType name="Test" />
<wsdl:binding name="TestServiceSoapBinding" type="ns1:Test">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
</wsdl:binding>
<wsdl:service name="TestService">
<wsdl:port binding="ns1:TestServiceSoapBinding" name="TestPort">
<soap:address location="http://192.168.0.1:8030/services/Test" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
I'll try creating a bit more complex sample for the old API. I'll post
it as soon as I have result. I just thought this might strike a flag or
something.
Gabo
Sergey Beryozkin wrote:
> Hi Gabo
>
> Nearly every CXF component has a file META-INF/spring.handlers, jaxws
> and jaxrs componets ship such files. It appears Spring can not find
> these files for some reasons on the classpath...
>
> Cheers, Sergey
>
> ----- Original Message ----- From: "Gabo Manuel"
> <km...@solegysystems.com>
> To: <us...@cxf.apache.org>
> Cc: "Daniel Kulp" <dk...@apache.org>
> Sent: Tuesday, March 24, 2009 3:11 AM
> Subject: Re: [CXF2.2][IPLANET6sp6][Spring2.0.6] spring unable to find
> namespace
>
>
>> Hi Dan,
>>
>>> Are you using something like "dependency:unpack-dependencies" or
>>> something to combine the various jars into a single jar/war? If so,
>>> that will DEFINITELY cause this.
>> Nope. Unless it is used by something by default. I am not using any war.
>>
>>> Check the stuff you are deploying for a META-INF/spring.handlers
>>> file and make sure it contains mapping for the required handlers.
>> I checked the said file of the spring.jar I am using. I have added
>> the following entries:
>>
>> http\://cxf.apache.org/jaxws=org.apache.cxf.jaxws.spring.NamespaceHandler
>>
>> http\://cxf.apache.org/jaxrs=org.apache.cxf.jaxrs.spring.NamespaceHandler
>>
>> http\://cxf.apache.org/bindings/soap=org.apache.cxf.binding.soap.spring.NamespaceHandler
>>
>>
>> But I still get the same error message:
>>
>> failure: WebModule[]: WEB2683: Exception sending context initialized
>> event to listener instance of class
>> org.springframework.web.context.ContextLoaderListener
>> org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
>> Configuration problem: Unable to locate Spring NamespaceHandler for
>> XML schema namespace [http://cxf.apache.org/jaxws]
>> Offending resource: ServletContext resource [/WEB-INF/beans.xml]
>>
>> I'll try to look further if this is an issue with IPlanet since the
>> setup works fine for tomcat.
>>
>> Gabo
>>
> ------------------------------------------------------------------------
>
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 8.0.238 / Virus Database: 270.11.25/2019 - Release Date: 03/23/09 18:51:00
>
>
Re: [CXF2.2][IPLANET6sp6][Spring2.0.6] spring unable to find namespace
Posted by Sergey Beryozkin <sb...@progress.com>.
Hi Gabo
Nearly every CXF component has a file META-INF/spring.handlers, jaxws and jaxrs componets ship such files. It appears Spring can not
find these files for some reasons on the classpath...
Cheers, Sergey
----- Original Message -----
From: "Gabo Manuel" <km...@solegysystems.com>
To: <us...@cxf.apache.org>
Cc: "Daniel Kulp" <dk...@apache.org>
Sent: Tuesday, March 24, 2009 3:11 AM
Subject: Re: [CXF2.2][IPLANET6sp6][Spring2.0.6] spring unable to find namespace
> Hi Dan,
>
>> Are you using something like "dependency:unpack-dependencies" or something to combine the various jars into a single jar/war?
>> If so, that will DEFINITELY cause this.
> Nope. Unless it is used by something by default. I am not using any war.
>
>> Check the stuff you are deploying for a META-INF/spring.handlers file and make sure it contains mapping for the required
>> handlers.
> I checked the said file of the spring.jar I am using. I have added the following entries:
>
> http\://cxf.apache.org/jaxws=org.apache.cxf.jaxws.spring.NamespaceHandler
> http\://cxf.apache.org/jaxrs=org.apache.cxf.jaxrs.spring.NamespaceHandler
> http\://cxf.apache.org/bindings/soap=org.apache.cxf.binding.soap.spring.NamespaceHandler
>
> But I still get the same error message:
>
> failure: WebModule[]: WEB2683: Exception sending context initialized event to listener instance of class
> org.springframework.web.context.ContextLoaderListener
> org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring
> NamespaceHandler for XML schema namespace [http://cxf.apache.org/jaxws]
> Offending resource: ServletContext resource [/WEB-INF/beans.xml]
>
> I'll try to look further if this is an issue with IPlanet since the setup works fine for tomcat.
>
> Gabo
>
Re: [CXF2.2][IPLANET6sp6][Spring2.0.6] spring unable to find namespace
Posted by Gabo Manuel <km...@solegysystems.com>.
Hi Dan,
> Are you using something like "dependency:unpack-dependencies" or something to
> combine the various jars into a single jar/war? If so, that will DEFINITELY
> cause this.
>
Nope. Unless it is used by something by default. I am not using any war.
> Check the stuff you are deploying for a META-INF/spring.handlers file and make
> sure it contains mapping for the required handlers.
I checked the said file of the spring.jar I am using. I have added the
following entries:
http\://cxf.apache.org/jaxws=org.apache.cxf.jaxws.spring.NamespaceHandler
http\://cxf.apache.org/jaxrs=org.apache.cxf.jaxrs.spring.NamespaceHandler
http\://cxf.apache.org/bindings/soap=org.apache.cxf.binding.soap.spring.NamespaceHandler
But I still get the same error message:
failure: WebModule[]: WEB2683: Exception sending context initialized
event to listener instance of class
org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
Configuration problem: Unable to locate Spring NamespaceHandler for XML
schema namespace [http://cxf.apache.org/jaxws]
Offending resource: ServletContext resource [/WEB-INF/beans.xml]
I'll try to look further if this is an issue with IPlanet since the
setup works fine for tomcat.
Gabo
Re: [CXF2.2][IPLANET6sp6][Spring2.0.6] spring unable to find namespace
Posted by Daniel Kulp <dk...@apache.org>.
Are you using something like "dependency:unpack-dependencies" or something to
combine the various jars into a single jar/war? If so, that will DEFINITELY
cause this.
Check the stuff you are deploying for a META-INF/spring.handlers file and make
sure it contains mapping for the required handlers.
examples:
http\://cxf.apache.org/jaxws=org.apache.cxf.jaxws.spring.NamespaceHandler
http\://cxf.apache.org/jaxrs=org.apache.cxf.jaxrs.spring.NamespaceHandler
etc....
Dan
On Fri March 20 2009 6:03:17 am Gabo Manuel wrote:
> Hi Sergey,
>
> I have modified the beans.xml as follows:
>
> <beans xmlns="http://www.springframework.org/schema/beans"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:jaxws="http://cxf.apache.org/jaxws"
> xmlns:soap="http://cxf.apache.org/bindings/soap"
> xsi:schemaLocation="
> http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
> http://cxf.apache.org/bindings/soap
> http://cxf.apache.org/schemas/configuration/soap.xsd
> http://cxf.apache.org/jaxws
> http://cxf.apache.org/schemas/jaxws.xsd
> ">
>
> <import resource="classpath:META-INF/cxf/cxf.xml" />
> <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
> <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
>
> <bean name="usernameTokenInterceptor"
> class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
> <constructor-arg>
> <map>
> <entry key="action" value="UsernameToken" />
> <entry key="passwordType" value="PasswordDigest" />
> <entry key="passwordCallbackRef">
> <bean
> class="some.domain.handlers.SoapPasswordCallback" />
> </entry>
> </map>
> </constructor-arg>
> </bean>
> <jaxws:endpoint address="/soap/MyService"
> implementor="some.domain.MyService" >
> <jaxws:inInterceptors>
> <ref bean="usernameTokenInterceptor"/>
> </jaxws:inInterceptors>
> </jaxws:endpoint>
> </beans>
>
>
> I still receive the exception, but this time pointing to jaxws:
>
> failure: WebModule[]: WEB2683: Exception sending context initialized
> event to listener instance of class
> org.springframework.web.context.ContextLoaderListener
> org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
> Configuration problem: Unable to locate Spring NamespaceHandler for XML
> schema namespace [http://cxf.apache.org/jaxws]
> Offending resource: ServletContext resource [/WEB-INF/beans.xml]
>
> at
> org.springframework.beans.factory.parsing.FailFastProblemReporter.error(Fai
>lFastProblemReporter.java:68) at
> org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext
>.java:85) at
> org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext
>.java:80) at
> org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(Be
>anDefinitionParserDelegate.java:261) at
> org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCus
>tomElement(BeanDefinitionParserDelegate.java:1111) at
> org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCus
>tomElement(BeanDefinitionParserDelegate.java:1104) at
> org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.p
>arseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:133) at
> org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.r
>egisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:90) at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanD
>efinitions(XmlBeanDefinitionReader.java:458) at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDef
>initions(XmlBeanDefinitionReader.java:353) at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefin
>itions(XmlBeanDefinitionReader.java:303) at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefin
>itions(XmlBeanDefinitionReader.java:280) at
> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.load
>BeanDefinitions(AbstractBeanDefinitionReader.java:131) at
> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.load
>BeanDefinitions(AbstractBeanDefinitionReader.java:147) at
> org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDe
>finitions(XmlWebApplicationContext.java:124) at
> org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDe
>finitions(XmlWebApplicationContext.java:92) at
> org.springframework.context.support.AbstractRefreshableApplicationContext.r
>efreshBeanFactory(AbstractRefreshableApplicationContext.java:101) at
> org.springframework.context.support.AbstractApplicationContext.obtainFreshB
>eanFactory(AbstractApplicationContext.java:389) at
> org.springframework.context.support.AbstractApplicationContext.refresh(Abst
>ractApplicationContext.java:324) at
> org.springframework.web.context.ContextLoader.createWebApplicationContext(C
>ontextLoader.java:244) at
> org.springframework.web.context.ContextLoader.initWebApplicationContext(Con
>textLoader.java:187) at
> org.springframework.web.context.ContextLoaderListener.contextInitialized(Co
>ntextLoaderListener.java:49) at
> org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java
>:3387) at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:3743)
> at com.iplanet.ias.web.WebModule.start(WebModule.java:251)
> at
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
> at
> org.apache.catalina.core.StandardHost.start(StandardHost.java:652)
> at
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
> at
> org.apache.catalina.core.StandardEngine.start(StandardEngine.java:355)
> at org.apache.catalina.startup.Embedded.start(Embedded.java:995)
> at com.iplanet.ias.web.WebContainer.start(WebContainer.java:431)
> at
> com.iplanet.ias.web.WebContainer.startInstance(WebContainer.java:500)
> at
> com.iplanet.ias.server.J2EERunner.confPostInit(J2EERunner.java:161)
>
> I have read somewhere that I would have to include the
> "something-frontend.jar". I checked the contents, and the classes are
> supposedly inside the cxf2.2.jar already (unless I missed something).
>
> As a sidenote, the service implementation contains annotation from both
> jax-ws and jax-rs.
>
> Again, my thanks in advance.
>
> Gabo
>
> Sergey Beryozkin wrote:
> > Hi Gabo
> >
> > I'd like to try to narrow the problem. Does it work if you remove the
> > jaxrs bits out of this configuration (I'm presuming there could be some
> > jaxws:endpoint definitions there) ?
> >
> > Thanks, Sergey
--
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog
Re: [CXF2.2][IPLANET6sp6][Spring2.0.6] spring unable to find namespace
Posted by Gabo Manuel <km...@solegysystems.com>.
Hi Sergey,
I have modified the beans.xml as follows:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xmlns:soap="http://cxf.apache.org/bindings/soap"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://cxf.apache.org/bindings/soap
http://cxf.apache.org/schemas/configuration/soap.xsd
http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd
">
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<bean name="usernameTokenInterceptor"
class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
<constructor-arg>
<map>
<entry key="action" value="UsernameToken" />
<entry key="passwordType" value="PasswordDigest" />
<entry key="passwordCallbackRef">
<bean
class="some.domain.handlers.SoapPasswordCallback" />
</entry>
</map>
</constructor-arg>
</bean>
<jaxws:endpoint address="/soap/MyService"
implementor="some.domain.MyService" >
<jaxws:inInterceptors>
<ref bean="usernameTokenInterceptor"/>
</jaxws:inInterceptors>
</jaxws:endpoint>
</beans>
I still receive the exception, but this time pointing to jaxws:
failure: WebModule[]: WEB2683: Exception sending context initialized
event to listener instance of class
org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
Configuration problem: Unable to locate Spring NamespaceHandler for XML
schema namespace [http://cxf.apache.org/jaxws]
Offending resource: ServletContext resource [/WEB-INF/beans.xml]
at
org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
at
org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
at
org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:80)
at
org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:261)
at
org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1111)
at
org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1104)
at
org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:133)
at
org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:90)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:458)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:353)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:280)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:131)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:147)
at
org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
at
org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92)
at
org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:101)
at
org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:389)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:324)
at
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:244)
at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187)
at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3387)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3743)
at com.iplanet.ias.web.WebModule.start(WebModule.java:251)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
at
org.apache.catalina.core.StandardHost.start(StandardHost.java:652)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:355)
at org.apache.catalina.startup.Embedded.start(Embedded.java:995)
at com.iplanet.ias.web.WebContainer.start(WebContainer.java:431)
at
com.iplanet.ias.web.WebContainer.startInstance(WebContainer.java:500)
at
com.iplanet.ias.server.J2EERunner.confPostInit(J2EERunner.java:161)
I have read somewhere that I would have to include the
"something-frontend.jar". I checked the contents, and the classes are
supposedly inside the cxf2.2.jar already (unless I missed something).
As a sidenote, the service implementation contains annotation from both
jax-ws and jax-rs.
Again, my thanks in advance.
Gabo
Sergey Beryozkin wrote:
> Hi Gabo
>
> I'd like to try to narrow the problem. Does it work if you remove the
> jaxrs bits out of this configuration (I'm presuming there could be some
> jaxws:endpoint definitions there) ?
>
> Thanks, Sergey
>
RE: [CXF2.2][IPLANET6sp6][Spring2.0.6] spring unable to find namespace
Posted by Sergey Beryozkin <sb...@progress.com>.
Hi Gabo
I'd like to try to narrow the problem. Does it work if you remove the
jaxrs bits out of this configuration (I'm presuming there could be some
jaxws:endpoint definitions there) ?
Thanks, Sergey
-----Original Message-----
From: Gabo Manuel [mailto:kmanuel@solegysystems.com]
Sent: 20 March 2009 06:24
To: users@cxf.apache.org
Subject: [CXF2.2][IPLANET6sp6][Spring2.0.6] spring unable to find
namespace
Hi guys,
First of all, since CXF2.2 is out... WOOOOHOOOOOOO!!!
I have the following configuration in beans.xml:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xmlns:jaxrs="http://cxf.apache.org/jaxrs"
xmlns:soap="http://cxf.apache.org/bindings/soap"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://cxf.apache.org/bindings/soap
http://cxf.apache.org/schemas/configuration/soap.xsd
http://cxf.apache.org/jaxrs
http://cxf.apache.org/schemas/jaxrs.xsd
http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd
">
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"
/>
<import
resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
<jaxrs:server id="restServices" address="/rest">
<jaxrs:serviceBeans>
<bean class="some.domain.MyService"/>
</jaxrs:serviceBeans>
<jaxrs:providers>
<bean class="some.domain.BooleanProvider"/>
</jaxrs:providers>
<jaxrs:inInterceptors>
<bean class="some.domain.RestInHandler"/>
</jaxrs:inInterceptors>
</jaxrs:server>
</beans>
Upon starting the iplanet instance, I get the following error message:
failure: WebModule[]: WEB2683: Exception sending context initialized
event to listener instance of class
org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.parsing.BeanDefinitionParsingException
:
Configuration problem: Unable to locate Spring NamespaceHandler for XML
schema namespace [http://cxf.apache.org/jaxrs]
Offending resource: ServletContext resource [/WEB-INF/beans.xml]
at
org.springframework.beans.factory.parsing.FailFastProblemReporter.error(
FailFastProblemReporter.java:68)
at
org.springframework.beans.factory.parsing.ReaderContext.error(ReaderCont
ext.java:85)
at
org.springframework.beans.factory.parsing.ReaderContext.error(ReaderCont
ext.java:80)
at
org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error
(BeanDefinitionParserDelegate.java:261)
at
org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parse
CustomElement(BeanDefinitionParserDelegate.java:1111)
at
org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parse
CustomElement(BeanDefinitionParserDelegate.java:1104)
at
org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReade
r.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:133)
at
org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReade
r.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:90)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBe
anDefinitions(XmlBeanDefinitionReader.java:458)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBean
Definitions(XmlBeanDefinitionReader.java:353)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDe
finitions(XmlBeanDefinitionReader.java:303)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDe
finitions(XmlBeanDefinitionReader.java:280)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.l
oadBeanDefinitions(AbstractBeanDefinitionReader.java:131)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.l
oadBeanDefinitions(AbstractBeanDefinitionReader.java:147)
at
org.springframework.web.context.support.XmlWebApplicationContext.loadBea
nDefinitions(XmlWebApplicationContext.java:124)
at
org.springframework.web.context.support.XmlWebApplicationContext.loadBea
nDefinitions(XmlWebApplicationContext.java:92)
at
org.springframework.context.support.AbstractRefreshableApplicationContex
t.refreshBeanFactory(AbstractRefreshableApplicationContext.java:101)
at
org.springframework.context.support.AbstractApplicationContext.obtainFre
shBeanFactory(AbstractApplicationContext.java:389)
at
org.springframework.context.support.AbstractApplicationContext.refresh(A
bstractApplicationContext.java:324)
at
org.springframework.web.context.ContextLoader.createWebApplicationContex
t(ContextLoader.java:244)
at
org.springframework.web.context.ContextLoader.initWebApplicationContext(
ContextLoader.java:187)
at
org.springframework.web.context.ContextLoaderListener.contextInitialized
(ContextLoaderListener.java:49)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.j
ava:3387)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3743
)
at com.iplanet.ias.web.WebModule.start(WebModule.java:251)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
at
org.apache.catalina.core.StandardHost.start(StandardHost.java:652)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:355)
at org.apache.catalina.startup.Embedded.start(Embedded.java:995)
at com.iplanet.ias.web.WebContainer.start(WebContainer.java:431)
at
com.iplanet.ias.web.WebContainer.startInstance(WebContainer.java:500)
at
com.iplanet.ias.server.J2EERunner.confPostInit(J2EERunner.java:161)
I am able to ping "cxf.apache.org" to check just in case it was not
accessible. I am also able to run this same set of configurations and
binaries in my local tomcat server (v6.0.13).
Again, thanks in advance.
Gabo