微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!
package com.webservice.test;
import org.springframework.context.ApplicationContext;
import com.webservice.service.*;
class TestWebServiceClient {
void main(String[] args) {
String SPRING_CONfig="D:\\newla\\testWebServiceClien\\Webroot\\WEB-INF\\appContext.xml";
ApplicationContext context;
ContactUsService contactUsService;
context=new org.springframework.context.support.FileSystemXmlApplicationContext(SPRING_CONfig);
contactUsService=(ContactUsService) context.getBean("contactUsService");
System.out.println(contactUsService.getUserName());
System.out.println(contactUsService.getMessages().size());
运行结果
nofeng
2008-5-27 17:40:07 org.apache.cxf.phase.PhaseInterceptorChain doIntercept
信息: Interceptor has thrown exception, unwinding Now
org.apache.cxf.interceptor.Fault: Couldn't instantiate class. com.webservice.pojo.Message.
问题:为什么加了配置还是转换类型失败.上网查了很久都没答案.请大家会的也帮一下.