0
我想命中一个存储过程,但我得到这个错误信息:'javax.ejb.EJBException'...我从来没有使用存储过程,所以例外是有点希腊对我来说。命中存储过程 - javax.ejb.EJBException
任何人都可能对此有所了解?下面我粘贴,我写的代码:
@WebMethod(operationName = "getSpecimenResultsXml")
public String getSpecimenResultsXml(@WebParam(name = "specimenGuid") String specimenGuid, @WebParam(name = "publicationGuid") String publicationGuid, @WebParam(name = "forProvider") String forProvider) {
//Method variables
ResultSet rs = null;
String xml = null;
// 1) get server connection
Connection conn = dataBaseConnection.getConnection();
// 2) Pass recieved parameters to stored proc.
try {
CallableStatement proc =
conn.prepareCall("{ call getSpecimenReportXml(?, ?, ?) }");
proc.setString(1, specimenGuid);
proc.setString(2, publicationGuid);
proc.setString(3, forProvider);
proc.execute();
rs = proc.getResultSet();
} catch (SQLException e) {
System.out.println("--------------Error in getSpecimenResultsXml------------");
System.out.println("Cannot call stored proc: " + e);
System.out.println("--------------------------------------------------------");
}
// 3) Get String from result set
try {
xml = rs.getString(1);
} catch (SQLException e) {
System.out.println("--------------Error in getSpecimenResultsXml------------");
System.out.println("Cannot retrieve result set: " + e);
System.out.println("--------------------------------------------------------");
}
// 4) close connection
try {
conn.close();
} catch (Exception e) {
System.out.println("--------------Error in getSpecimenResultsXml------------");
System.out.println("Cannot close connection: " + e);
System.out.println("--------------------------------------------------------");
}
// 5) return the returned String
return xml;
}
哦,存储过程我们称为getSpecimenReportXml ...
这个例外对我们来说也是一个谜,因为我们看不到它。啊;这些评论是噪音,请使用日志而不是S.o.p.s. –
显然它是由NullPointerException引起的。但是,我不知道它会发生在哪里。如果你想要完整的例外,我可以发布它?但是它有相当多的几行。对于评论,它不会呆在那里,它现在只是为了帮助我保持跟踪。当我将我的更改提交给我们的CVS后,我将把它们带出...但除此之外...... – Tiwaz89
没有看到实际错误,任何人都无法提供帮助。 –