springBoot+maven的webservice接口项目Error creating bean with name

csy665 2018-04-26 05:07:28
springBoot+maven的webservice接口服务,项目下8个接口,endpoint.publish发布
原本8个接口,服务运行正常,添加一个新的后就报Error creating bean with name 'endpointXyCheck' defined in class path resource [com/jsptpd/Project/service/CxfConfig.class]



新加的service接口

package com.jsptpd.Project.service;

import com.jsptpd.Project.pojo.XyCheckReturnInfo;


import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;

@WebService(targetNamespace = "http://Project.jsptpd.com")// 命名空间,一般是接口的包名
public interface XycheckService {

@WebMethod
void getX5Message(@WebParam(name = "XyCheckReturnInfo") XyCheckReturnInfo m);
}
...全文
688 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
csy665 2018-04-26
  • 打赏
  • 举报
回复
入口。 启动服务报错 报错行就是config标红的方法里endpoint.publish("/XycheckService"); package com.jsptpd.Project; import com.jsptpd.Project.mapper.AgreeMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.*; import org.springframework.boot.autoconfigure.*; import org.springframework.boot.web.servlet.ServletComponentScan; import org.springframework.web.bind.annotation.*; @SpringBootApplication @ServletComponentScan @RestController public class App { @Autowired AgreeMapper agreeMapper; public static void main(String[] args) throws Exception { SpringApplication.run(App.class, args); } }
csy665 2018-04-26
  • 打赏
  • 举报
回复
config类 package com.jsptpd.Project.service; import org.apache.cxf.jaxws.EndpointImpl; import org.apache.cxf.Bus; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import javax.xml.ws.Endpoint; @Configuration public class CxfConfig { @Autowired private Bus bus; @Autowired private ProjectServices projectServices; @Autowired private AgreeServices agreeServices; @Autowired private SubPrjServices subServices; @Autowired private SubPrjStatusServices subPrjStatusServices; @Autowired private XycheckService xycheckService; @Autowired private CooAgreeServices cooAgreeServices; @Autowired private WSMDMOutputSupperService WSMDMOutputSupperService; @Autowired private ProjectStatusServices projectStatusServices; @Autowired private WSCustomerInfo WSCustomerInfoService; @Bean public Endpoint endpoint() { EndpointImpl endpoint = new EndpointImpl(bus,projectServices); endpoint.publish("/ProjectServices");//接口发布在 /ProjectServices 目录下 return endpoint; } @Bean public Endpoint endpointProjectStatus() { EndpointImpl endpoint = new EndpointImpl(bus,projectStatusServices); endpoint.publish("/ProjectStatusServices");//接口发布在 /ProjectServices 目录下 return endpoint; } @Bean public Endpoint endpointAgree(){ EndpointImpl endpoint = new EndpointImpl(bus,agreeServices); endpoint.publish("/AgreeServices");//接口发布在 /AgreeServices 目录下 return endpoint; } @Bean public Endpoint endpointsubPrj(){ EndpointImpl endpoint = new EndpointImpl(bus,subServices); endpoint.publish("/SubPrjServices");//接口发布在 /AgreeServices 目录下 return endpoint; } @Bean public Endpoint endpointCooAgree(){ EndpointImpl endpoint = new EndpointImpl(bus,cooAgreeServices); endpoint.publish("/CooAgreeServices");//接口发布在 /CooAgreeServices 目录下 return endpoint; } @Bean public Endpoint endpointSubPrjStatus(){ EndpointImpl endpoint = new EndpointImpl(bus,subPrjStatusServices); endpoint.publish("/SubPrjStatusServices");//接口发布在 /SubPrjStatusServices 目录下 return endpoint; } @Bean public Endpoint endpointXyCheck(){ EndpointImpl endpoint = new EndpointImpl(bus, xycheckService); endpoint.publish("/XycheckService"); return endpoint; } @Bean public Endpoint endpointContractor(){ EndpointImpl endpoint = new EndpointImpl(bus, WSMDMOutputSupperService); endpoint.publish("/WSMDMOutputSupperServiceService");//接口发布在 /WSMDMOutputSupperServiceService 目录下 return endpoint; } @Bean public Endpoint endpointCustomer(){ EndpointImpl endpoint = new EndpointImpl(bus, WSCustomerInfoService); endpoint.publish("/WSCustomerInfoServiceService");//接口发布在 /WSCustomerInfoServiceService 目录下 return endpoint; } }
csy665 2018-04-26
  • 打赏
  • 举报
回复
接口实现类 package com.jsptpd.Project.service; import com.jsptpd.Project.mapper.XychecklogMapper; import com.jsptpd.Project.pojo.XyCheckReturnInfo; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import javax.jws.WebService; @WebService(serviceName = "XycheckService"//服务名 , targetNamespace = "http://Project.jsptpd.com"//报名倒叙,并且和接口定义保持一致 , endpointInterface = "com.jsptpd.Project.service.XycheckService")//包名 @Component public class XycheckServiceImpl implements XycheckService{ private static final Logger log = LoggerFactory.getLogger(XycheckServiceImpl.class); @Autowired XychecklogMapper xychecklogMapper; public void getX5Message(XyCheckReturnInfo m) { log.info("----进入结算返回结果方法-----id:"+m.getPpi_id()); } }

50,531

社区成员

发帖
与我相关
我的任务
社区描述
Java相关技术讨论
javaspring bootspring cloud 技术论坛(原bbs)
社区管理员
  • Java相关社区
  • 小虚竹
  • 谙忆
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧