1
[HTTP:101216]Servlet: "cxf" failed to preload on startup in Web application: "TestSpring-0.0.1-SNAPSHOT.war". org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'EmpInfo': Invocation of init method failed; nested exception is javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service. at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1403) at 

私の cxf.xml:

<?xml version="1.0" encoding="UTF-8"?>
<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="EmpInfo"
          implementor="#EmpInfoImpl"
          address="/EmpInfo"/> -->

           <jaxws:endpoint id="EmpInfo"
          implementor="com.test.example.impl.EmpInfoImpl"
          address="/EmpInfo"/>
    <!--  <bean id="EmpInfoImpl" class="com.test.example.impl.EmpInfoImpl" >
     <property name="emplist" ref="EmpList" />

 </bean>

 <bean id="EmpList" class="com.test.example.impl.EmployeeList" /> -->
      </beans>

@WebService(serviceName="EmpInfo",endpointInterface="com.test.example.EmpInfo",
portName="EmpInfoPortType", wsdlLocation="classpath:wsdl/EmpInfo.wsdl")
public class EmpInfoImpl implements EmpInfo{

private EmployeeList emplist;
public EmployeeList getEmplist() {
return emplist;
}

public void setEmplist(EmployeeList emplist) {
this.emplist = emplist;
 }

/**
 * @param args
 */
public static void main(String[] args) {
    // TODO Auto-generated method stub

}

public Employee getInfo(String id) {
    // TODO Auto-generated method stub
    return new Employee("Test","Test","888");
    //return emplist.getEmp(Integer.valueOf(id));
}

     }

私は CXF にかなり慣れていないので、どんな助けでも大歓迎です

4

1 に答える 1

0

This issue is resolved there was a issue in my code.

于 2013-04-26T21:39:40.293 に答える