Is this the correct way to do it?  I have the Spring context loader servlet 
defined, spring mvc servlet, and the cxf servlet.  The CXF servlet and the 
context loader server reference the contextConfigLocation.
 
Currently I get this when trying to create a client:
 
java.lang.NullPointerException
        at 
org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpointInfo(AbstractWSDLBasedEndpointFactory.java:160)
        at 
org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:102)
        at 
org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:51)
        at 
org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:97)
 
I get "No service was found" when pointing a web browser to the CXF servlet.
 
 
Here is the 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</param-value>
        </context-param>
        <servlet>
                <servlet-name>context</servlet-name>
                <servlet-class>
                        org.springframework.web.context.ContextLoaderServlet
                </servlet-class>
                <load-on-startup>1</load-on-startup>
        </servlet>
        <servlet>
                <servlet-name>centraldispatcher</servlet-name>
                <servlet-class>
                        org.springframework.web.servlet.DispatcherServlet
                </servlet-class>
                <load-on-startup>2</load-on-startup>
        </servlet>
        <servlet-mapping>
        <servlet-name>dispatcher</servlet-name>
        <url-pattern>*.jsp</url-pattern>
    </servlet-mapping>
    <listener>
        <listener-class>
            org.springframework.web.context.ContextLoaderListener
        </listener-class>
    </listener>
    <servlet>
        <servlet-name>CXFServlet</servlet-name>
        <servlet-class>
            org.apache.cxf.transport.servlet.CXFServlet
        </servlet-class>
        <load-on-startup>2</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>CXFServlet</servlet-name>
        <url-pattern>/*</url-pattern>
    </servlet-mapping>
</web-app>


________________________________

From: Glen Mazza [mailto:[EMAIL PROTECTED]
Sent: Tue 4/22/2008 9:48 PM
To: [EMAIL PROTECTED]
Subject: Re: Using CXF In Existing Spring Context



Steps #7 and #8 here (look at the web.xml and ws-beans.xml file):
http://www.jroller.com/gmazza/date/20080417#WFstep7

Also, you can configure multiple config files separated by commas,
similar to here to keep your web service stuff separate:
http://www.jroller.com/gmazza/date/20061128

HTH,
Glen

2008-04-22 Urciolo, Kevin wrote:
> I would like to use CXF in an existing spring context.  The examples
> appear to have a CXF Servlet read a spring configuration file and create
> a separate context.  I want to inject beans I have defined in an
> existing context in to my CXF services.  What is the best way to
> accomplish this?
>
> Thanks



Reply via email to