Bonjour,
Je suis plutôt débutant en EJB3 mais je me suis bien renseigner.
J'ai un serveur jboss-4.0.5 sur linux.
Ou je déplois un EJB.
Tout les messages de déploiement sont ok .
j'ai : default remote binding has jndiName of LoginEAR/LoginEJB3Bean/remote
qui dit que le déploiement est ok
voici le code du client :
Voici la trace d'erreur coté client que j'avais :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 public static void main(String[] args) { try { Properties properties = new Properties(); properties.put(Context.PROVIDER_URL, "adresse_IP:1099"); properties.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory"); properties.put(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces"); return new InitialContext(properties); Context context = getContext(); String jndiName = "LoginEAR/LoginEJB3Bean/remote"; LoginEJB3 loginEJB3 = (LoginEJB3)context.lookup(jndiName); } catch (NamingException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 2007-09-03 11:26:13 DEBUG [SecurityAssociation/:143] Using ThreadLocal: false 2007-09-03 11:26:13 DEBUG [Client/:514] invoke called, but our invoker is disconnected, discarding and fetching another fresh invoker for: InvokerLocator [socket://127.0.0.1:3873/] 2007-09-03 11:26:13 DEBUG [SocketClientInvoker/:275] connect called for: org.jboss.remoting.transport.socket.SocketClientInvoker@b66cc Exception in thread "main" org.jboss.remoting.CannotConnectException: Can not get connection to server. Problem establishing socket connection. at org.jboss.remoting.transport.socket.SocketClientInvoker.transport(SocketClientInvoker.java:267) at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.java:143) at org.jboss.remoting.Client.invoke(Client.java:525) at org.jboss.remoting.Client.invoke(Client.java:488) at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:55) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98) at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98) at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:53) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98) at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:77) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98) at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:102) at $Proxy0.login(Unknown Source)
J'ai rajouté dans la ligne de lancement de jboss
car j'ai lu dans un forum que ca pouvait solutionner le pb :
Code : Sélectionner tout - Visualiser dans une fenêtre à part -Djava.rmi.server.hostname=adresseIPserveur"
maintenant, j'ai ce messaged 'erreur :
Je ne vois plus quoi faire car je pense que la configuration est ok et cela fonctionne lorque jboss est sur windows.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 Exception in thread "main" org.jboss.remoting.CannotConnectException: Can not get connection to server. Problem establishing socket connection. at org.jboss.remoting.transport.socket.SocketClientInvoker.transport(SocketClientInvoker.java:267) at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.java:143) at org.jboss.remoting.Client.invoke(Client.java:525) at org.jboss.remoting.Client.invoke(Client.java:488) at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:55) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98) at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98) at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:53) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98) at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:77) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98) at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:102) at $Proxy0.login(Unknown Source)
Partager