Bonjour, j'ai tout testé mais je vois pas vraiment ou est le problème voici l'erreur:
nov. 13, 2018 11:42:11 AM org.jboss.ejb.client.EJBClient <clinit>
INFO: JBoss EJB Client version 2.0.1.Final
nov. 13, 2018 11:42:11 AM org.xnio.Xnio <clinit>
INFO: XNIO version 3.3.0.Final
nov. 13, 2018 11:42:11 AM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.3.0.Final
nov. 13, 2018 11:42:12 AM org.jboss.remoting3.EndpointImpl <clinit>
INFO: JBoss Remoting version 4.0.6.Final
nov. 13, 2018 11:42:13 AM org.jboss.ejb.client.remoting.VersionReceiver handleMessage
INFO: EJBCLIENT000017: Received server version 2 and marshalling strategies [river]
nov. 13, 2018 11:42:13 AM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver associate
INFO: EJBCLIENT000013: Successful version handshake completed for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext@6325a3ee, receiver=Remoting connection EJB receiver [connection=org.jboss.ejb.client.remoting.ConnectionPool$PooledConnection@1d16f93d,channel=jboss.ejb,nodename=desktop-htb1cpp]} on channel Channel ID f73a25f6 (outbound) of Remoting connection 57804422 to /127.0.0.1:8080
nov. 13, 2018 11:42:18 AM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver associate
INFO: EJBCLIENT000015: Initial module availability report for Remoting connection EJB receiver [connection=org.jboss.ejb.client.remoting.ConnectionPool$PooledConnection@1d16f93d,channel=jboss.ejb,nodename=desktop-htb1cpp] wasn't received during the receiver context association
javax.naming.NamingException: Failed to create proxy [Root exception is java.lang.IllegalStateException: EJBCLIENT000024: No EJB receiver available for handling [appName:, moduleName:jboss-as-ejb-remote-app, distinctName:] combination]
at org.jboss.ejb.client.naming.ejb.EjbNamingContext.createEjbProxy(EjbNamingContext.java:195)
at org.jboss.ejb.client.naming.ejb.EjbNamingContext.lookup(EjbNamingContext.java:176)
at javax.naming.InitialContext.lookup(Unknown Source)
at ClientRemote.main(ClientRemote.java:36)
Caused by: java.lang.IllegalStateException: EJBCLIENT000024: No EJB receiver available for handling [appName:, moduleName:jboss-as-ejb-remote-app, distinctName:] combination
at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:813)
at org.jboss.ejb.client.EJBClient.createSessionWithPossibleRetries(EJBClient.java:222)
at org.jboss.ejb.client.EJBClient.createSession(EJBClient.java:202)
at org.jboss.ejb.client.naming.ejb.EjbNamingContext.doCreateProxy(EjbNamingContext.java:216)
at org.jboss.ejb.client.naming.ejb.EjbNamingContext.createEjbProxy(EjbNamingContext.java:193)
... 3 more
classe ClienRemote:
import java.util.Hashtable;
import javax.naming.Context;
import javax.naming.InitialContext;
import metier.BanqueRemote;
import metier.entities.Compte;
public class ClientRemote {
public static void main(String[] args) {
try {
final Hashtable jndiProperties = new Hashtable();
jndiProperties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
final Context context = new InitialContext(jndiProperties);
String appName="";
String moduleName="BanqueeEJB";
String beanName="BK";
String remoteInterface=BanqueRemote.class.getName();
String name="ejb:"+appName+"/"+moduleName+"/"+beanName+"!"+remoteInterface;
BanqueRemote proxy=(BanqueRemote) context.lookup(name);
proxy.addCompte(new Compte());
proxy.addCompte(new Compte());
proxy.addCompte(new Compte());
} catch(Exception e){
e.printStackTrace();
}
}
}
Pas d'aide concernant le code par MP, le forum est là pour ça :)