1
votes

EJBCLIENT000409: Aucune autre destination n'est disponible

Je suis en train de migrer de jboss 5 vers wildfly 12. je suis resté coincé dans une de mes exceptions je fais l'invocation ejb (3.1) en utilisant wildfly 12 avec jndi en java 8 J'ai déployé le fichier .ear sur la console wildfly après cela, je reçois cette exception. J'utilise java ee 5.

Ceci est pour un serveur Wildfly 12, java 8. J'ai essayé des changements dans les propriétés jndi.

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

J'attends la sortie de la migration et exécuter le projet avec succès, mais la sortie réelle est

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);


8 commentaires

Est-ce un EJB distant que vous essayez de connecter? Le message d'erreur indique que vous n'avez rien en cours d'exécution sur 8080 auquel vous connecter.


salut oui j'essaye de connecter ejb à distance. J'ai déployé avec succès le fichier .ear sur la console wildfly et lorsque je démarre le serveur wildfly, il affiche la ligne ci-dessous dans les journaux ------------------------ --- [org.wildfly.extension.undertow] (thread de service MSC 1-6) WFLYUT0006: écoute par défaut de l'écouteur HTTP Undertow sur 127.0.0.1:8080


Cet article peut vous aider baeldung.com/wildfly-ejb-jndi


J'ai déjà apporté les modifications à l'aide de cet article, mais je reçois toujours cette exception. Sil te plait aide moi.


Lorsque je déploie le fichier .ear sur la console wildfly, je n'obtiens pas les journaux des espaces de noms jndi java: global / EJBWildFly-1.0-SNAPSHOT / TextProcessorBean! Com.gc‌ t.interfaces.TextPro‌ cessorRemote java: app / EJBWildFly-1.0-SNAPSHOT /TextProcessorBean!com.gct.‌ interfaces.TextProce‌ ssorRemote java: module / TextProcessorBean! Com.gct.interfaces.TextProces‌ sorRemote java: jboss / exporté / EJBWildFly-1.0-SNAPSHOT / TextProcessorBe‌ an! Com.gct.interfaces. S.TextProcessorRemot‌ e java: global / EJBWildFly-1.0-SNAPSHOT / TextProcessorBean java: app / EJBWildFly-1.0-SNAPSHOT / TextProcessorBean java: module / TextProcessorBean


Avez-vous la classe et l'interface requises avec les bonnes annotations?


Mon code ressemble à @Remote (MyRemote.class) @Stateless @RolesAllowed ("user") Classe publique MyAdminBean implémente MyRemote, MyLocal {} @Remote interface publique MyRemote étend MyAdminImpl {} @ L'interface publique locale MyLocal étend MyAdminImpl {}


J'essaierais de déployer l'exemple ejb à distance à partir des démarrages rapides, afin que vous sachiez que la configuration de votre serveur fonctionne, puis comparez leur code au vôtre. Souvenez-vous que c'est peut-être le chemin de classe qui pose problème plutôt que le code. Il est préférable d'utiliser la nomenclature ejb dans votre POM


3 Réponses :


0
votes

Votre fabrique de contexte initiale peut être erronée, vous ne montrez pas la valeur pour cela, mais le nom de cette constante implique que c'est toujours le seul protocole jnp


1 commentaires

En fait, nous migrons l'application de jboss 5 vers wildfly 12 et en ligne config.put (Context.INITIAL_CONTEXT_FACTORY, JNP_NAMING_CONTEXT_FACTORY); le JNP_NAMING_CONTEXT_FACTORY est juste une variable et la valeur de JNP_NAMING_CONTEXT_FACTORY = "org.wildfly.naming.client.WildFlyInitialContextFactory";



0
votes

Lorsque vous utilisez org.jboss.ejb.client.naming , la connexion est généralement définie dans un fichier nommé jboss-ejb-client.properties . Vous l'avez fourni dans la carte pour jndi.properties . Le jboss-ejb-client.properties ressemble à ceci:

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

Si cela fonctionne, mais que vous ne voulez pas utiliser de fichier pour les propriétés de connexion, vous pouvez jeter un œil sur https://developer.jboss.org/thread/202008


0 commentaires

0
votes

Le problème n'est probablement pas la configuration InitialContext, cela semble correct.

Essayez la recherche avec ce format:

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

Le format est:

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

Consultez cet exemple de documentation pour plus d'informations: https: // docs. jboss.org/author/display/WFLY8/EJB+invocations+from+a+remote+client+using+JNDI


0 commentaires