首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >扩展-SQL说“找不到Java方法”。

扩展-SQL说“找不到Java方法”。
EN

Stack Overflow用户
提问于 2019-03-20 12:36:31
回答 1查看 1.5K关注 0票数 0

我是IIB的新手,也是堆叠溢出的新手,我只是在玩一些流。我得到了一个错误The Java method 'MQDepth.getMQDepth' could not be found。我引用了这里,这是一种部署jar的方法,(i)将JAR文件添加到BAR文件中,(ii)将JAR文件存储在以下任一位置。我找不到任何网站来解释如何将jar添加到bar中,所以我选择了(ii)选项。下面解释我做了什么,以及我所犯的错误。任何帮助都将不胜感激。

我创建了一个流:

"TimeOut通知节点“设置为自动(例如1分钟)→计算节点→MQ输出节点

我想做的事:

自动检测队列的CurrDepth并暂时生成XML (这将更改为添加条件的邮件)。代码(esql)调用自定义过程(GetCurrDepth)。

计算节点代码:

代码语言:javascript
复制
DECLARE queueManager CHAR;
DECLARE queueName CHAR;
DECLARE queueDepth INT;

SET queueManager = 'DDMQBKD10';
SET queueName = 'INPUT';

CALL GetCurrDepth(queueManager, queueName, queueDepth);

IF queueDepth > 0 THEN
    SET OutputRoot.XMLNSC.Report.QManager = queueManager;
    SET OutputRoot.XMLNSC.Report.QName = queueName;
    SET OutputRoot.XMLNSC.Report.QDepth = queueDepth;
END IF;

调用GetCurrDepth :

代码语言:javascript
复制
CREATE PROCEDURE GetCurrDepth(IN qMgr  CHARACTER
                             ,IN qName CHARACTER
                             ,OUT qDepth INTEGER)
LANGUAGE JAVA 
EXTERNAL NAME "MQDepth.getMQDepth";

GetCurrDepth JAVA:

代码语言:javascript
复制
import com.ibm.mq.MQException;
import com.ibm.mq.MQQueue;
import com.ibm.mq.MQQueueManager;
import com.ibm.mq.constants.MQConstants;

public class MQDepth {

    public static void getMQDepth(String QManager, String Q, Integer QDepth) throws MQException
    {

        // define the name of the QueueManager
        final String qManager = QManager;
        // and define the name of the Queue
        final String qName = Q;

            // Create a connection to the QueueManager
            MQQueueManager qMgr = new MQQueueManager(qManager);

            // Now specify the queue that we wish to open and the open options
            MQQueue queue = qMgr.accessQueue(qName, MQConstants.MQOO_INQUIRE | MQConstants.MQOO_INPUT_AS_Q_DEF, null, null, null);

            // Check the currdepth of the queue
            try {
                QDepth = queue.getCurrentDepth();
            } catch (Exception e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }

            // Close the queue
            queue.close();

            // Disconnect from the QueueManager
            qMgr.disconnect();
    }
}

JAR :我创建了一个jar并将其保存在"C:\ProgramData\IBM\MQSI\shared-classes“中

错误:

代码语言:javascript
复制
BIP2087E: Integration node 'TESTNODE_Dipanjan' was unable to process the internal configuration message. 
The entire internal configuration message failed to be processed successfully. 
Use the messages following this message to determine the reasons for the failure. If the problem cannot be resolved after reviewing these messages, contact your IBM Support center. Enabling service trace may help determine the cause of the failure.
BIP4041E: Integration server 'default' received an administration request that encountered an exception. 
While attempting to process an administration request, an exception was encountered. No updates have been made to the configuration of the integration server. 
Review related error messages to determine why the administration request failed.
BIP3202E: (.GetCurrDepth, 1.1) : An error occurred when trying to resolve the Java class or method 'MQDepth.getMQDepth' which is referred to by the routine 'GetCurrDepth'. 
Further messages are generated that explain the error in more detail. 
Correct the syntax of your Java expression in node '.GetCurrDepth', around line and column '1.1', then redeploy the message flow.
BIP2946E: The Java method 'MQDepth.getMQDepth' could not be found 
The Java method 'MQDepth.getMQDepth' with the specified signature could not be found in the specified class. Ensure the method exists in the specified class and that it exactly matches its ESQL signature. 
Examine and correct the SQL program.
BIP2871I: The request made by user 'DESKTOP-6BQMC6G\Dipanjan' to 'deploy' the resource 'C:/Users/Dipanjan/IBM/IIBT10/workspace/GeneratedBarFiles/BigOneproject.generated.bar' of type 'BAR' on parent 'default' of type 'ExecutionGroup' has the status of 'FAILED'.
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-03-20 20:16:23

基于ESQL-to-Java数据类型映射表,ESQL OUT INTEGER映射到Java java.lang.Long[]

创建过程语句中的"Java例程示例2“解释了您的用例。

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

https://stackoverflow.com/questions/55260943

复制
相关文章

相似问题

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