java EJBCLIENT000409:没有更多可用的目的地

8wigbo56  于 2023-02-11  发布在  Java
关注(0)|答案(3)|浏览(125)

我正在执行从jboss 5到wildfly 12的迁移。我遇到了一个异常。我正在使用带有java 8中的jndi的wildfly 12执行ejb(3. 1)调用。我已经在wildfly控制台上部署了.ear文件。之后,我遇到了这个异常。我使用的是java ee 5。
这是一个Wildfly 12服务器,java 8。我已经尝试了jndi属性的更改。

private final Properties config;

config = new Properties();

config.put(Context.INITIAL_CONTEXT_FACTORY, JNP_NAMING_CONTEXT_FACTORY);
config.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
config.put(Context.PROVIDER_URL, "http-remoting://127.0.0.1:8080/");
//config.put(Context.PROVIDER_URL,"remote+http://127.0.0.1:8080");
config.put("jboss.naming.client.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT", "false");

config.put("jboss.naming.client.ejb.context", "true"); 
config.put(Context.SECURITY_PRINCIPAL, "wixxxxxx");
config.put(Context.SECURITY_CREDENTIALS, "xxxxxx123");

Context ctx = new InitialContext(config);

我期望迁移和成功运行项目的输出,但实际输出是

org.jboss.ejb.client.RequestSendFailedException: EJBCLIENT000409: No more destinations are available
    at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:567)
    at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:503)
    at org.jboss.ejb.protocol.remote.RemotingEJBClientInterceptor.handleInvocationResult(RemotingEJBClientInterceptor.java:56)
    at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:569)
    at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:503)
    at org.jboss.ejb.client.TransactionPostDiscoveryInterceptor.handleInvocationResult(TransactionPostDiscoveryInterceptor.java:133)
    at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:569)
    at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:503)
    at org.jboss.ejb.client.DiscoveryEJBClientInterceptor.handleInvocationResult(DiscoveryEJBClientInterceptor.java:108)
    at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:569)
    at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:503)
    at org.jboss.ejb.client.NamingEJBClientInterceptor.handleInvocationResult(NamingEJBClientInterceptor.java:78)
    at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:569)
    at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:503)
    at org.jboss.ejb.client.TransactionInterceptor.handleInvocationResult(TransactionInterceptor.java:172)
    at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:569)
    at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:503)
    at org.jboss.ejb.client.EJBClientInvocationContext.awaitResponse(EJBClientInvocationContext.java:913)
    at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:177)
    at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:112)
    at com.sun.proxy.$Proxy15.getServerInfo(Unknown Source)
    at com.verizon.delphi.hyperion.cli.CommLine$Info.cmdProc(CommLine.java:741)
    at tcl.lang.Parser.evalObjv(Parser.java)
    at tcl.lang.Parser.eval2(Parser.java)
    at tcl.lang.Interp.eval(Interp.java)
    at tcl.lang.Interp.eval(Interp.java)
    at com.verizon.delphi.hyperion.cli.CommLine.startInterpreter(CommLine.java:5638)
    at com.verizon.delphi.hyperion.cli.App.main(App.java:133)
    Suppressed: org.jboss.ejb.client.RequestSendFailedException: org.jboss.remoting3.ServiceOpenException: Unknown service name@http-remoting://127.0.0.1:8080
        at org.jboss.ejb.protocol.remote.RemoteEJBReceiver$1.lambda$handleDone$0(RemoteEJBReceiver.java:83)
        at org.xnio.AbstractIoFuture$NotifierRunnable.run(AbstractIoFuture.java:720)
        at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
        at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
        at java.lang.Thread.run(Thread.java:748)
Failed to get sys infoEJBCLIENT000409: No more destinations are available
fykwrbwg

fykwrbwg1#

你的初始上下文工厂可能是错误的,你没有显示它的值,但是这个常量的名称仍然是唯一的jnp协议

u4vypkhs

u4vypkhs2#

使用org.jboss.ejb.client.naming时,连接通常在名为jboss-ejb-client.properties的文件中定义。您在jndi.properties的Map中提供了该连接。jboss-ejb-client.properties如下所示:

remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
remote.connections=default
remote.connection.default.host=localhost
remote.connection.default.port = 8080
remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
remote.connection.two.host=localhost
remote.connection.two.port = 8080
remote.connection.two.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false

如果这样做有效,但是您不想使用connection-properties文件,那么可以查看https://developer.jboss.org/thread/202008

olhwl3o2

olhwl3o23#

问题可能不是InitialContext配置,它看起来是正确的。
尝试使用以下格式进行查找:

ctx.lookup("ejb:EJBWildFly-1.0-SNAPSHOT/TextProcessorBean!com.gct.interfaces.TextProcessorRemote");

格式为:

context.lookup("ejb:" + appName + "/" + moduleName + "/" + distinctName + "/" + beanName + "!" + viewClassName);

有关详细信息,请查看此文档示例:https://docs.jboss.org/author/display/WFLY8/EJB+invocations+from+a+remote+client+using+JNDI

相关问题