gpt4 book ai didi

java - 如何在 webMethods Integration Server 和 webMethods Designer 中添加用于开发 java 服务的外部 jar

转载 作者:塔克拉玛干 更新时间:2023-11-01 22:43:14 28 4
gpt4 key购买 nike

我想在某些 Java 服务(WebMethod 设计器 9.7)中使用外部 jar。我在 Internet 文档中看到我必须将我的 jar 放在集成服务器上的包/code/jars/路径中,以及我在 eclipse 中的项目的构建路径中。但我不知道该怎么做。

我试图将我的 jar 放在 $swag_instance$/packages/$package_name$/code/jars 中,并重新启动 IS,但我有编译时错误。

能否请您帮助我了解在 Java 服务中使用外部 jar 时我必须执行哪些操作?

最佳答案

SoftwareAG webMethods Designer 需要您将外部 JAR 添加到两者:

  1. Integration Server 包,位于 ./packages/<package>/code/jars/ 中或 ./packages/<package>/code/jars/static/文件夹,具体取决于您是需要动态加载 JAR 且仅可用于拥有的包,还是在服务器启动时静态加载并分别可用于所有包,以及
  2. 服务开发项目Designer 在 Eclipse 工作区中为包创建的文件夹

您可能还没有完成第二步,这就是您的服务无法编译或出现错误的原因。

webMethods 服务开发帮助 指南(9.8 版)的第 312 页有以下建议:

If your Java service requires additional classes to compile, you must add them, either as individual class files or in jar files, to both the Service Development Project and to Integration Server. If you set up IS package dependencies for the Java service in Integration Server and there are classes and/or jar files in the IS packages required so that the service can compile, you must manually add them to Service Development Project. For more information, see "Adding Classes to the Service Development Project" on page 317. For more information about adding classes to Integration Server and how Integration Server stores package information, see webMethods Integration Server Administrator’s Guide.

第 317 页然后描述了如何向服务添加类和 JAR开发项目:

Adding Classes to the Service Development Project

If a Java service requires additional classes to compile, you must add them to the following locations:

  • Service Development Project in the local workspace so that Designer can compile the service.
  • Integration Server so that the server can compile the service. Designer does not automatically propagate classes that you add to the Service Development Project to Integration Server; you must add them to Integration Server manually. For more information about adding classes to Integration Server, see information about managing IS packages and how Integration Server stores IS package information in webMethods Integration Server Administrator’s Guide.

Keep the following points in mind when adding classes to the Service Development Project:

  • You add individual class files to the classes folder of the Service Development Project.
  • If you have Java classes that are packaged together in jar files, you add the jar files to the lib folder of the Service Development Project.
  • If you set up IS package dependencies for a Java service in Integration Server and there are classes and/or jar files in the IS packages required so that the service can compile, you must manually add them to Service Development Project.

To add classes and jar files to the Service Development Project:

  1. Open the Project Explorer view.
  2. Expand the Service Development Project for the Java service. Service Development Project names use the following format, where packageName is the name of the IS package where the service resides, hostName is the host name of the Integration Server on which the service resides, and portNumber is the port number of the Integration Server:

    <packageName >[<hostName >_<portNumber >]

    For example, if you want to add class and jar files for the order.orderStatus:checkStatus service that resides in the IS package Accounting on the Integration Server with the host name and port number ServerA:5555, you would expand the Service Development Project with the following name:

    Accounting[ServerA_5555]

    For more information, see "Service Development Projects in the Local Workspace" on page 308.

  3. If you want to add class files to the Service Development Project, drag them from the file system into the classes folder of the Service Development Project in the Project Explorer view.

    When adding class files, ensure that you keep the structure of the Java package intact. For example, if you want to add com.accounting.orders.statusClass.class, you must first create the com, accounting, and orders folders within the classes folder as shown below:

    • classes
      • com
        • accounting
          • orders

    Then add the statusClass.class file to the orders folder.

  4. If you want to add jar files to the Service Development Project, drag them from the file system into the lib folder of the Service Development Project in the Project Explorer view.

关于java - 如何在 webMethods Integration Server 和 webMethods Designer 中添加用于开发 java 服务的外部 jar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31557770/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com