【发布时间】:2020-06-10 06:02:37
【问题描述】:
AXL 12.5、Apache CXF 3.3.6、OpenJDK 14、Spring Boot 2.3.0,执行 SQL 查询
String sqlStmt = "SELECT name FROM typeuserlocale";
ExecuteSQLQueryReq executeSQLQueryReq = new ExecuteSQLQueryReq();
executeSQLQueryReq.setSql(sqlStmt);
ExecuteSQLQueryRes executeSQLQueryRes = axlPort.executeSQLQuery(executeSQLQueryReq);
List<Object> rows = executeSQLQueryRes.getReturn().getRow();
返回List<Object>,如何解析结果?将对象转换为什么?
调试显示它是ElementNSImpl。尝试将其强制转换为 ElementNSImpl 会导致 IDE 添加依赖项:
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.9.1</version>
</dependency>
但是强制转换它会导致异常:
java.lang.ClassCastException:
class com.sun.org.apache.xerces.internal.dom.ElementNSImpl cannot be cast to class org.apache.xerces.dom.ElementNSImpl (com.sun.org.apache.xerces.internal.dom.ElementNSImpl is in module java.xml of loader 'bootstrap';
org.apache.xerces.dom.ElementNSImpl is in unnamed module of loader 'app')
【问题讨论】:
标签: java spring-boot cisco-axl