2013-01-09 63 views
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豆:BeanCreationException:錯誤創建名爲 'EmpInfo'

<?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,所以任何幫助將不勝感激

+0

實現類: – remo

+0

異常的根源是什麼?你可以編輯你的問題,並添加你得到的所有堆棧跟蹤? –

回答

0

此問題已解決,我的代碼中存在問題。

相關問題