jDeveloper ...无法部署jar进行工作(缺少库?)

时间:2019-03-19 16:38:47

标签: java xml oracle sqlxml

显然是部署配置文件问题,但是我要通过一个窗口来扔我的工作站。

包括:

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import javax.xml.stream.XMLStreamException;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
import javax.xml.xpath.XPathExpressionException;
import org.w3c.dom.Document;
import javax.xml.parsers.DocumentBuilder; 
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.soap.SOAPConnection;
import javax.xml.soap.SOAPConnectionFactory;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpression;
import javax.xml.xpath.XPathFactory;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;

(还有其他,但它们不相关)

private List<List<Object>> getPayloads(String url, String user, String pw) throws ClassNotFoundException, SQLException,
                                                                            NoClassDefFoundError {
    List<List<Object>> mismoPayloads = new ArrayList<List<Object>>();
    String DB_URL = url;
    String USER = user;
    String PASS = pw;
    Connection conn = null;
    Statement stmt = null;
    Class.forName("oracle.jdbc.driver.OracleDriver");
    conn = DriverManager.getConnection(DB_URL, USER, PASS);
    stmt = conn.createStatement();
    String sql;
    sql = "select fha_case_number, loan_number, replace(replace(to_char(score_dt),'/','-'),':',' ') as score_dt, aus, aq.total_mismo_payload.total_request_response from X04180.total_mismo_archive aq";
    ResultSet rs = stmt.executeQuery(sql);
    while (rs.next()) {
        //Retrieve by column name
        List<String> thisRow = new ArrayList<String>();
        String xmlContent = rs.getSQLXML("total_mismo_payload.total_request_response").getString();
        String loanNumber = rs.getString("loan_number");
        String caseNumber = rs.getString("fha_case_number");
        String ausID = rs.getString("aus");
        String scoreDate = rs.getString("score_dt");
        thisRow.add(scoreDate + "_" + caseNumber + "_" + loanNumber + "_" + ausID + ".xml");
        thisRow.add(xmlContent);
        mismoPayloads.add((List) thisRow);
    }
    rs.close();
    stmt.close();
    conn.close();
    return mismoPayloads;
}

清单上有这个:

Manifest-Version: 1.0
Class-Path: . .. 
 ./lib/ojdbc.policy 
 ./lib/ojdbc8.jar 
 ./lib/ons.jar 
 ./lib/oraclepki.jar 
 ./lib/orai18n.jar 
 ./lib/osdt_cert.jar 
 ./lib/osdt_core.jar 
 ./lib/simplefan.jar 
 ./lib/ucp.jar 
 ./lib/xdb6.jar 
 ./lib/oracle.xdk/oraclexsql.jar
 ./lib/oracle.xdk/oxquery-ee.jar
 ./lib/oracle.xdk/oxquery-xmlbeans-interop.jar
 ./lib/oracle.xdk/oxquery.jar
 ./lib/oracle.xdk/xml.jar
 ./lib/oracle.xdk/xmlmesg.jar
 ./lib/oracle.xdk/xmlparserv2.jar
 ./lib/oracle.xdk/xmlparserv2_jaxp_services.jar
 ./lib/oracle.xdk/xmlparserv2_sans_jaxp_services.jar
 ./lib/oracle.xdk/xqjapi.jar
 ./lib/oracle.xdk/xquery.jar
 ./lib/oracle.xdk/xsqlserializers.jar
 ./lib/oracle.xdk/xsu12.jar
Main-Class: f17.ProcessPayload

所有这些jar都确实存在于该“ lib”文件夹中。 “ lib”文件夹与可执行jar位于同一文件夹中。我已验证驱动程序(ojdbc8.jar)已加载(我可以通过移动它来更改错误消息。

我唯一想到的是jDeveloper正在加载其他一些依赖项,但是无法部署到jar中,但是我看不到它是什么。

该项目在工具集中运行良好,但是在作为可执行jar文件运行时会出现此类错误。

oracle/xml/binxml/BinXMLMetadataProvider
[oracle.jdbc.driver.NamedTypeAccessor$XMLFactory.createXML(NamedTypeAccessor.java:115)
 oracle.jdbc.driver.NamedTypeAccessor.getOracleObject(NamedTypeAccessor.java:233)
 oracle.jdbc.driver.NamedTypeAccessor.getSQLXML(NamedTypeAccessor.java:332)
 oracle.jdbc.driver.GeneratedStatement.getSQLXML(GeneratedStatement.java:278)
 oracle.jdbc.driver.GeneratedScrollableResultSet.getSQLXML(GeneratedScrollableResultSet.java:359)
 oracle.jdbc.driver.GeneratedResultSet.getSQLXML(GeneratedResultSet.java:590)
 f17.ProcessPayload.getPayloads(ProcessPayload.java:195)
 f17.ProcessPayload.main(ProcessPayload.java:115)]

我应该提到错误来自以下行:

String xmlContent = rs.getSQLXML("total_mismo_payload.total_request_response").getString();

1 个答案:

答案 0 :(得分:0)

我在Eclipse中重新创建了该项目,并部署了一个没有戏剧性的工作jar。 这是一个jDeveloper问题。

我的问题已解决,但jDeveloper显然存在问题。如果有人想了解从Eclipse进行部署和从jDeveloper进行部署之间的差异,那么对其他人可能会有所帮助。

我只使用jDeveloper,因为我们做了一些Oracle Fusion的事情。