java - 在调用 ihe.iti.xds_b._2007.DocumentRepositoryService 对象的 getDocumentRepositoryPortSoap12 方法时,不能将 JaxbAccessorF_value 强制转换为...
问题描述
我正在修改/更正代码,以实现我们提供的xd-common
java 代码repo1.maven.org/maven2/org/nhind/xd-common/
当调用以下...
proxy = service.getDocumentRepositoryPortSoap12(new MTOMFeature(true, 1));
...日志显示
“axbAccessorF_value 无法转换为 com.sun.xml.internal.bind.v2.runtime.reflect.Accessor”
我已经查看了几个地方的解决方案。许多人认为问题可能与类路径上的重复 JAXB 库有关,并且在某些情况下,请求 Maven 依赖关系树来解决此问题。我已经包含了 Maven 依赖树;但是,我不知道如何从中分辨出重复的类路径。
错误发生在DocumentRepositoryProxy
类中org.nhindirect.xd.proxy
。
private void initProxy()
{
try
{
URL url = DocumentRepositoryProxy.class.getClassLoader().getResource(
"XDS.b_DocumentRepositoryWSDLSynchMTOM.wsdl");
LOGGER.info("url: " + url.toString());
QName qname = new QName("urn:ihe:iti:xds-b:2007", "DocumentRepository_Service");
DocumentRepositoryService service = new DocumentRepositoryService(url, qname);
if (handlerResolver != null)
service.setHandlerResolver(handlerResolver);
LOGGER.info("Before getDocumentRepositoryPortSoap12");
proxy = service.getDocumentRepositoryPortSoap12(new MTOMFeature(true, 1));
LOGGER.info("After getDocumentRepositoryPortSoap12");
BindingProvider bp = (BindingProvider) proxy;
SOAPBinding binding = (SOAPBinding) bp.getBinding();
binding.setMTOMEnabled(true);
bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpoint);
}
catch (Exception e)
{
LOGGER.error("Error initializing proxy.", e);
}
}
解决方案
推荐阅读
- javascript - 使用主键是否是一个好的解决方案
- html - 使用启动引导程序 5 免费管理模板无法单击单选按钮
- python - django ManyToManyField 中的 to_field 是否有替代方法?
- scala - ScalaTest 错误对象 flatspec 不是包 org.scalatest 的成员
- c++ - 如何在 C++ 中查找单个元素的字符数组位置
- sql - SQL 子查询替代
- c# - 计算所有欧洲语言中的元音
- php - 如何在运行时检测新的一天已经过去?
- javascript - 交换 JavaScript 列表
- reactjs - setState 比回调函数慢