You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by volume <a....@gmail.com> on 2007/09/27 12:29:12 UTC
Spring 1.2.7 "beans" configuration problems, XFire -> CXF
migration.
Hi, all!
Now I'm trying to migrate from XFire 1.1.2 to CXF 2.0.2.
All is under Spring 1.2.7, app-server Tomcat 5.5.14, Java - 1.5.0_09-b03
The main reason of this migration is that Xfire 1.1.2 with Java 1.6.* starts
to return "nothing" on SOAP requests. When testing service with SOAP WSDL
Analyzer (of Oxygen XML Editor) it shows the next:
"Nested exception is javax.xml.stream.XMLStreamException: prefix cannot be
null or empty"
It only became to previous "normal" state when JDK was restored to 1.5.*
(Maybe someone met with that?)
So, migrating! ... possibly, to avoid above problems. And to upgrade right
away to upcoming project, not to xfire 2.*.
Production server has Spring 1.2.7 so I cannot use version 2.0> at the
moment.
In brief, I didn't delete Xfire libraries from release 1.1.2, added all jars
from CFX 2.0.2 except spring-2.0 related, then built the project and tried
to start tomcat:
12:49:49,234 [ERROR] [org.springframework.web.context.ContextLoader] -
Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: Line 10 in
XML document from ServletContext resource [/WEB-INF/test-CxfServlets.xml] is
invalid; nested exception is org.xml.sax.SAXParseException: Attribute
"xmlns" must be declared for element type "beans".
org.xml.sax.SAXParseException: Attribute "xmlns" must be declared for
element type "beans".
at
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
Source)
...............................
my test-CxfServlets.xml is:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.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="print_string"
implementor="uk.ltd.singles.datingengine.remoting.http.TestServiceImpl"
wsdlLocation="WEB-INF/wsdl/print_string.wsdl"
address="/print_string">
<jaxws:features>
<bean class="org.apache.cxf.feature.LoggingFeature"/>
</jaxws:features>
</jaxws:endpoint>
</beans>
Content of web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
...
/WEB-INF/applicationContext*.xml
classpath:org/codehaus/xfire/spring/xfire.xml
/WEB-INF/test-CxfServlets.xml
</param-value>
</context-param>
...
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
...
<!-- CXF SERVLETS Testing Configuration block Start -->
<servlet>
<servlet-name>CXFServlet</servlet-name>
<display-name>CXF Servlet</display-name>
<servlet-class>
org.apache.cxf.transport.servlet.CXFServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/cxfws/*</url-pattern>
</servlet-mapping>
<!-- CXF SERVLETS Testing Configuration block End -->
....
So, the questions are:
1) Is it possible to configure CFX with Spring less than 2.0 ?
2) Noticeable errors in code?
Any help would be appreciated, thanks.
--
View this message in context: http://www.nabble.com/Spring-1.2.7-%22beans%22-configuration-problems%2C-XFire--%3E-CXF-migration.-tf4527535.html#a12918521
Sent from the cxf-user mailing list archive at Nabble.com.
RE: Spring 1.2.7 "beans" configuration problems, XFire -> CXF migration.
Posted by "Jiang, Ning (Willem)" <Ni...@iona.com>.
Hi
I think you need upgrade the Spring version to 2.0.
CXF internal components configuration is aready the Spring 2.0 formate.
BTW, if you do not use the servlet transport , you can use the CXFBusFactory instead of SpringBusFactory.
Here[1] are some discussion about it.
[1]http://www.nabble.com/CXF-without-Spring--tf4470086.html#a12745335
Willem.
-----Original Message-----
From: volume [mailto:a.volume@gmail.com]
Sent: Thu 9/27/2007 20:32
To: cxf-user@incubator.apache.org
Subject: Re: Spring 1.2.7 "beans" configuration problems, XFire -> CXF migration.
Hi Jeff,
When trying the following
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<import resource="/cxf/cxf.xml" />
<import resource="/cxf/cxf-extension-soap.xml" />
<import resource="/cxf/cxf-servlet.xml" />
<bean class="uk.ltd.singles.datingengine.remoting.http.TestServiceImpl"
>
</bean>
</beans>
then exception occurs while parsing imported resources -
15:15:53,703 [ERROR] [org.springframework.web.context.ContextLoader] -
Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: Line 26 in
XML document from ServletContext resource [/WEB-INF/cxf/cxf.xml] is invalid;
nested exception is org.xml.sax.SAXParseException: Attribute "xmlns" must be
declared for element type "beans".
org.xml.sax.SAXParseException: Attribute "xmlns" must be declared for
element type "beans".
....
and the problem remains.
Jeff.Yu wrote:
>
> Hi,
>
> AFAIK, You can not use the xml config extension "<jaxws:endpoint>..."
> tag by using spring 1.x version. You need to translate it to the
> traditional xml config
>
> <bean ...>
> <....>
> </bean>
>
> I haven't tried it, but you can give it a shot this way.
>
> Thanks
> Jeff
>
> volume wrote:
>> Hi, all!
>>
>> Now I'm trying to migrate from XFire 1.1.2 to CXF 2.0.2.
>> All is under Spring 1.2.7, app-server Tomcat 5.5.14, Java - 1.5.0_09-b03
>>......
>> So, the questions are:
>> 1) Is it possible to configure CFX with Spring less than 2.0 ?
>> 2) Noticeable errors in code?
>>
>> Any help would be appreciated, thanks.
>>
>
>
--
View this message in context: http://www.nabble.com/Spring-1.2.7-%22beans%22-configuration-problems%2C-XFire--%3E-CXF-migration.-tf4527535.html#a12920280
Sent from the cxf-user mailing list archive at Nabble.com.
Re: Spring 1.2.7 "beans" configuration problems, XFire -> CXF
migration.
Posted by volume <a....@gmail.com>.
Hi Jeff,
When trying the following
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<import resource="/cxf/cxf.xml" />
<import resource="/cxf/cxf-extension-soap.xml" />
<import resource="/cxf/cxf-servlet.xml" />
<bean class="uk.ltd.singles.datingengine.remoting.http.TestServiceImpl"
>
</bean>
</beans>
then exception occurs while parsing imported resources -
15:15:53,703 [ERROR] [org.springframework.web.context.ContextLoader] -
Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: Line 26 in
XML document from ServletContext resource [/WEB-INF/cxf/cxf.xml] is invalid;
nested exception is org.xml.sax.SAXParseException: Attribute "xmlns" must be
declared for element type "beans".
org.xml.sax.SAXParseException: Attribute "xmlns" must be declared for
element type "beans".
....
and the problem remains.
Jeff.Yu wrote:
>
> Hi,
>
> AFAIK, You can not use the xml config extension "<jaxws:endpoint>..."
> tag by using spring 1.x version. You need to translate it to the
> traditional xml config
>
> <bean ...>
> <....>
> </bean>
>
> I haven't tried it, but you can give it a shot this way.
>
> Thanks
> Jeff
>
> volume wrote:
>> Hi, all!
>>
>> Now I'm trying to migrate from XFire 1.1.2 to CXF 2.0.2.
>> All is under Spring 1.2.7, app-server Tomcat 5.5.14, Java - 1.5.0_09-b03
>>......
>> So, the questions are:
>> 1) Is it possible to configure CFX with Spring less than 2.0 ?
>> 2) Noticeable errors in code?
>>
>> Any help would be appreciated, thanks.
>>
>
>
--
View this message in context: http://www.nabble.com/Spring-1.2.7-%22beans%22-configuration-problems%2C-XFire--%3E-CXF-migration.-tf4527535.html#a12920280
Sent from the cxf-user mailing list archive at Nabble.com.
Re: Spring 1.2.7 "beans" configuration problems, XFire -> CXF migration.
Posted by "Jeff.Yu" <je...@iona.com>.
Hi,
AFAIK, You can not use the xml config extension "<jaxws:endpoint>..."
tag by using spring 1.x version. You need to translate it to the
traditional xml config
<bean ...>
<....>
</bean>
I haven't tried it, but you can give it a shot this way.
Thanks
Jeff
volume wrote:
> Hi, all!
>
> Now I'm trying to migrate from XFire 1.1.2 to CXF 2.0.2.
> All is under Spring 1.2.7, app-server Tomcat 5.5.14, Java - 1.5.0_09-b03
>
> The main reason of this migration is that Xfire 1.1.2 with Java 1.6.* starts
> to return "nothing" on SOAP requests. When testing service with SOAP WSDL
> Analyzer (of Oxygen XML Editor) it shows the next:
> "Nested exception is javax.xml.stream.XMLStreamException: prefix cannot be
> null or empty"
> It only became to previous "normal" state when JDK was restored to 1.5.*
> (Maybe someone met with that?)
>
> So, migrating! ... possibly, to avoid above problems. And to upgrade right
> away to upcoming project, not to xfire 2.*.
>
> Production server has Spring 1.2.7 so I cannot use version 2.0> at the
> moment.
>
> In brief, I didn't delete Xfire libraries from release 1.1.2, added all jars
> from CFX 2.0.2 except spring-2.0 related, then built the project and tried
> to start tomcat:
>
> 12:49:49,234 [ERROR] [org.springframework.web.context.ContextLoader] -
> Context initialization failed
> org.springframework.beans.factory.BeanDefinitionStoreException: Line 10 in
> XML document from ServletContext resource [/WEB-INF/test-CxfServlets.xml] is
> invalid; nested exception is org.xml.sax.SAXParseException: Attribute
> "xmlns" must be declared for element type "beans".
> org.xml.sax.SAXParseException: Attribute "xmlns" must be declared for
> element type "beans".
> at
> org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
> Source)
> ...............................
>
>
> my test-CxfServlets.xml is:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
> "http://www.springframework.org/dtd/spring-beans.dtd">
>
> <beans xmlns="http://www.springframework.org/schema/beans"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:jaxws="http://cxf.apache.org/jaxws"
> xsi:schemaLocation="
> http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans.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="print_string"
>
> implementor="uk.ltd.singles.datingengine.remoting.http.TestServiceImpl"
> wsdlLocation="WEB-INF/wsdl/print_string.wsdl"
> address="/print_string">
> <jaxws:features>
> <bean class="org.apache.cxf.feature.LoggingFeature"/>
> </jaxws:features>
> </jaxws:endpoint>
> </beans>
>
>
> Content of web.xml:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
> version="2.4">
>
> <context-param>
> <param-name>contextConfigLocation</param-name>
> <param-value>
> ...
> /WEB-INF/applicationContext*.xml
> classpath:org/codehaus/xfire/spring/xfire.xml
> /WEB-INF/test-CxfServlets.xml
> </param-value>
> </context-param>
>
> ...
> <listener>
>
> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
> </listener>
> ...
>
> <!-- CXF SERVLETS Testing Configuration block Start -->
> <servlet>
> <servlet-name>CXFServlet</servlet-name>
> <display-name>CXF Servlet</display-name>
> <servlet-class>
> org.apache.cxf.transport.servlet.CXFServlet
> </servlet-class>
> <load-on-startup>1</load-on-startup>
> </servlet>
>
> <servlet-mapping>
> <servlet-name>CXFServlet</servlet-name>
> <url-pattern>/cxfws/*</url-pattern>
> </servlet-mapping>
> <!-- CXF SERVLETS Testing Configuration block End -->
> ....
>
>
> So, the questions are:
> 1) Is it possible to configure CFX with Spring less than 2.0 ?
> 2) Noticeable errors in code?
>
> Any help would be appreciated, thanks.
>