我有客户端类,但是当类被调用时,它会得到一个
"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类。
我从这里下载了JAR文件,这是我能找到的最新/稳定的JAR文件。
我是使用了错误的remoting.jar,还是遗漏了其他什么东西?
顺便说一下,这是一个使用seam.remoting.jar的。在移除缝后,我不得不使用另一个罐子。
发布于 2016-03-29 22:35:27
当RedHat用Wildfly代替JBoss时,它也用SwitchYard代替JBoss ESB。
因此,自JBoss AS7认为再也没有支持了为JBoss ESB。
根据您发布的代码,我假设您的服务实际上是一个web服务。
因此,我认为您可能想要更改代码,并开始使用RemoveInvoker和基于SOAP的web服务绑定。
作为一个起点,您可以看看这 RedHat的SwitchYard示例。
https://stackoverflow.com/questions/36267624
复制相似问题