Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/321.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java EJBCLIENT000409:没有更多可用的目标_Java_Wildfly_Jndi_Ejb 3.1 - Fatal编程技术网

Java EJBCLIENT000409:没有更多可用的目标

Java EJBCLIENT000409:没有更多可用的目标,java,wildfly,jndi,ejb-3.1,Java,Wildfly,Jndi,Ejb 3.1,我正在从JBoss5迁移到wildfly 12。 我陷入了一个例外 我正在使用wildfly 12和Java8中的jndi进行ejb(3.1)调用 我已经在wildfly控制台上部署了.ear文件 在那之后,我得到了这个例外。 我正在使用JavaEE5 这是针对Wildfly 12服务器的java 8。我尝试了jndi属性的更改 private final Properties config; config = new Properties(); config.put(Context.INI

我正在从JBoss5迁移到wildfly 12。 我陷入了一个例外 我正在使用wildfly 12和Java8中的jndi进行ejb(3.1)调用 我已经在wildfly控制台上部署了.ear文件 在那之后,我得到了这个例外。 我正在使用JavaEE5

这是针对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

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

当您使用
org.jboss.ejb.client.naming
时,连接通常在名为
jboss ejb client.properties
的文件中定义。您在
jndi.properties
的映射中提供了它。
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

如果这样做可行,但您不想使用文件作为连接属性,您可以查看一下

可能问题不在于InitialContext配置,它似乎是正确的

尝试使用以下格式进行查找:

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

context.lookup("ejb:" + appName + "/" + moduleName + "/" + distinctName + "/" + beanName + "!" + viewClassName);
有关更多信息,请查看此文档示例:

您尝试连接的是远程EJB吗?错误消息说您没有运行在8080上的任何东西可以连接。您好,是的,我正在尝试连接远程ejb。我已经成功地在wildfly控制台上部署了.ear文件,当我启动wildfly服务器时,它会在日志中显示以下行-----------------[org.wildfly.extension.undertow](MSC服务线程1-6)WFLYUT0006:Undertow HTTP listener默认监听127.0.0.1:8080这篇文章可能会对您有所帮助我已经使用这篇文章进行了更改,但仍然遇到了这个异常。请帮助我。当我在wildfly控制台上部署.ear文件时,我没有得到jndi名称空间日志java:global/EJBWildFly-1.0-SNAPSHOT/TextProcessorBean!com.gct.interfaces.textprocessorremotejava:app/EJBWildFly-1.0-SNAPSHOT/TextProcessorBean!com.gct.interfaces.TextProcessorRemote java:module/TextProcessorBean!com.gct.interfaces.textprocessorremotejava:jboss/exported/EJBWildFly-1.0-SNAPSHOT/TextProcessorBean!com.gct.interfaces.TextProcessorRemote java:global/EJBWildFly-1.0-SNAPSHOT/TextProcessorBean java:app/EJBWildFly-1.0-SNAPSHOT/TextProcessorBean java:module/TextProcessorBean实际上,我们正在将应用程序从jboss 5迁移到wildfly 12,并在线配置.put(Context.INITIAL\u Context\u FACTORY,JNP\u NAMING\u Context\u FACTORY);JNP_命名_上下文_工厂只是一个变量,JNP_命名_上下文_工厂的值=“org.wildfly.NAMING.client.WildFlyInitialContextFactory”;