Reputation: 33
i am doing migration from jboss 5 to wildfly 12. i got stuck in one of my exceptions i am doing ejb (3.1) invocation using wildfly 12 with jndi in java 8 i have deployed .ear file on the wildfly console after that i am getting this exception. i am using java ee 5.
This is for a Wildfly 12 server, java 8. I have tried changes in jndi properties.
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);
I expect the output of migration and running the project successfully, but the actual output is
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
Upvotes: 3
Views: 19415
Reputation: 96
Probably the problem is not the InitialContext Configuration, it seems correct.
Try the lookup with this format:
ctx.lookup("ejb:EJBWildFly-1.0-SNAPSHOT/TextProcessorBean!com.gct.interfaces.TextProcessorRemote");
Format is:
context.lookup("ejb:" + appName + "/" + moduleName + "/" + distinctName + "/" + beanName + "!" + viewClassName);
Check this documentation example for more information: https://docs.jboss.org/author/display/WFLY8/EJB+invocations+from+a+remote+client+using+JNDI
Upvotes: 0
Reputation: 577
When you are using org.jboss.ejb.client.naming
, the connection is usually defined in a file named jboss-ejb-client.properties
. You provided it in the map for jndi.properties
. The jboss-ejb-client.properties
looks like this:
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
If this works, but you don't want to use a file for the connection-properties, you may take a look on https://developer.jboss.org/thread/202008
Upvotes: 0
Reputation: 572
You're initial context factory may be wrong, you don't show the value for that, but the name of that constant implies is still the only jnp protocol
Upvotes: 0