java.lang.NoClassDefFoundError: org/jboss/remoting/InvokerLocator runtime error

java.lang.NoClassDefFoundError: org/jboss/remoting/InvokerLocator runtime error

我有客户端 class 但是当 class 被调用时,它得到一个
"java.lang.NoClassDefFoundError: org/jboss/remoting/InvokerLocator" 运行时错误。

import java.text.SimpleDateFormat;

import javax.inject.Inject;
import javax.inject.Named;
import org.jboss.remoting.Client;
import org.jboss.remoting.InvokerLocator;

@Named("esamDIDDClient")
public class ESAMDIDDWSClient {

    @Inject SystemProperyManager sysprop;

    private void sendMessageToJBRListener(String url, String message) throws Throwable {
        String locatorURI = url;
        InvokerLocator locator = new InvokerLocator(locatorURI);
        System.out.println("Calling JBoss Remoting Listener using locator URI: " + locatorURI);

        Client remotingClient = null;

        try {
            remotingClient = new Client(locator);
            remotingClient.connect();

            // Deliver the message to the listener...
            Object response = remotingClient.invoke(message);
            System.out.println("JBR Class: " + response.getClass().getName());
            System.out.println("Response from JBoss Remoting Listener '" + locatorURI + "' was '" + response + "'.");
        }  catch (Exception ex) {
            ex.printStackTrace();
            throw ex;
        } finally {
            if(remotingClient != null) {
                remotingClient.disconnect();
            }
        }
    }

我在 IDE 中有 org.jboss.remoting JAR,我也确实确认 InvokerLocator class 在那里。

我从 here 下载了 JAR 文件,这是我能找到的最多 recent/stable 的文件。

我是用错了remoting.jar,还是我遗漏了什么?

顺便说一下,这是使用 接缝。remoting.jar。删除接缝后,我不得不使用不同的 JAR。

当 RedHat 用 Wildfly 替换 JBoss AS 时,它也 replaced JBoss ESB with SwitchYard

因此,由于 JBoss AS7 即 there's no more support 用于 JBoss ESB。

根据您发布的代码,我假设您的服务实际上是一个网络服务。

因此,我认为您可能想要更改代码并开始使用 RemoveInvoker, with SOAP-based web service binding

作为起点,您可以看一下 this RedHat 的 SwitchYard 示例。