2 u011674023 u011674023 于 2014.11.13 15:00 提问

Unable to create JAXBContext报错

各位大神:
求助!java用cxf方式把一个wsdl打成了一个包,但是我在源码里用main方法调用报错了。
public static void main(String[] args)throws Exception {
URL wsdlURL = new URL("http://197.3.176.63:50000/cmbcagent_bosent_baseline_webservice_web/AgentAgreementService?wsdl");
System.out.println("11111111");
AgentAgreementService ss = new AgentAgreementService(wsdlURL);
System.out.println("ZZZZZZZ");

    AgentAgreement service =ss.getAgentAgreementPort();//此处报错

}
为什么getAgentAgreementPort()这个get不出来?我只是把这个包的包名修改了。
控制台报错为
Exception in thread "main" javax.xml.ws.WebServiceException: Unable to create JAXBContext
at com.sun.xml.internal.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:153)
at com.sun.xml.internal.ws.model.AbstractSEIModelImpl.postProcess(AbstractSEIModelImpl.java:83)
at com.sun.xml.internal.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:244)
at com.sun.xml.internal.ws.client.WSServiceDelegate.createSEIPortInfo(WSServiceDelegate.java:688)
at com.sun.xml.internal.ws.client.WSServiceDelegate.addSEI(WSServiceDelegate.java:676)
at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:331)
at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:314)
at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:296)
at javax.xml.ws.Service.getPort(Service.java:99)
at com.bosent.agentframework.webservices.channel.agentagreement.AgentAgreementService.getAgentAgreementPort(AgentAgreementService.java:58)
at com.bosent.agentframework.webservices.channel.agentagreement.AgentAgreementService.main(AgentAgreementService.java:79)
Caused by: java.security.PrivilegedActionException: com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 110 counts of IllegalAnnotationExceptions
Two classes have the same XML type name "{http://bosent.com/agentframework/webservices/channel/agent/}wuHanBafpModifyPwdForThirdByChannelService". Use @XmlType.name and @XmlType.namespace to assign different names to them.
this problem is related to the following location:
万分感谢!!

1个回答

lovexlm0312
lovexlm0312   2015.07.22 10:42

删了客户端重新生成哈,我也修改文件中的包名报错,重新生成后就好了

Mj_wang_
Mj_wang_ 你说的太对了。。。
一年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片