首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Java服务错误- webMethods

Java服务错误- webMethods
EN

Stack Overflow用户
提问于 2016-02-29 17:29:38
回答 1查看 666关注 0票数 0

在java服务中,如果没有函数声明,就会有一个函数调用,并且只会出现编译时错误。但输出与预期一致,没有运行时错误。那件事怎么可能?有谁能解释一下吗?

"The method functionName() is undefined“是它显示的错误。

下面是代码。

代码语言:javascript
复制
     public static final void documentToStringVals(IData pipeline)
        throws ServiceException {

    // pipeline
    IDataCursor pipelineCursor = pipeline.getCursor();
    String success = "false";
    IData inputDoc = null;
    String outputValue = "";
    String headerYN = "N"; 
    boolean headerValue = false;
    String delimiter = ","; 
    String newline = System.getProperty("line.separator");

    if (pipelineCursor.first("inputDocument") ) {
        inputDoc = (IData) pipelineCursor.getValue();
    }
    else {
        throw new ServiceException("inputDocument is a required parameter");
    }

    if (pipelineCursor.first("delimiter") ) {
        delimiter = (String) pipelineCursor.getValue();
    }

    if (pipelineCursor.first("headerYN") ) {
        headerYN = (String) pipelineCursor.getValue();
    }
    if (headerYN.equalsIgnoreCase("Y")) {
        headerValue = true;
    }

    try {

        outputValue = docValuesToString(inputDoc, headerValue, delimiter);  

        outputValue += newline;
        success = "true";
    }

    catch (Exception e) {
        System.out.println("Exception in getting string from document: " + e.getMessage());
        pipelineCursor.insertAfter("errorMessage", e.getMessage());
    }
    pipelineCursor.insertAfter("success", success);
    pipelineCursor.insertAfter("outputValue", outputValue);
    pipelineCursor.destroy();
}
EN

回答 1

Stack Overflow用户

发布于 2016-03-01 17:50:42

您发布的代码没有引用"functionName",所以我怀疑在共享代码部分或同一文件夹中的另一个Java服务中有对它的引用。假设文件夹中的所有Java服务都被编译到单个类中,因此所有这些服务都需要一起编译,这可能会导致在编译上面的服务时出现错误消息。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35695958

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档