Bonjour,

J'ai développé une application cliente j2se et un module EJB.
Lorsque je lance mon application en local depuis netbeans, tout marche bien.
Je déploie mon module EJB sur mon serveur local, et je lance mon client sans problème.

Par contre, quand je lance mon application directement depuis la console, avec la commande java -jar, j'obtiens l'erreur suivante:

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
22
23
24
25
26
27
28
29
30
31
32
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/logging/LogDomains
        at com.sun.enterprise.naming.impl.SerialInitContextFactory.<clinit>(Seri
alInitContextFactory.java:87)
        at com.sun.enterprise.naming.SerialInitContextFactory.<init>(SerialInitC
ontextFactory.java:62)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
 
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
 
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at java.lang.Class.newInstance0(Unknown Source)
        at java.lang.Class.newInstance(Unknown Source)
        at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
        at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
        at javax.naming.InitialContext.init(Unknown Source)
        at javax.naming.InitialContext.<init>(Unknown Source)
        at BusinessDelegate.ServiceLocator.<init>(ServiceLocator.java:68)
        at BusinessDelegate.ServiceLocator.<clinit>(ServiceLocator.java:36)
        at BusinessDelegate.CompteUtilisateurBD.getDAO(CompteUtilisateurBD.java:
71)
        at BusinessDelegate.CompteUtilisateurBD.doSomething(CompteUtilisateurBD.
java:80)
        at hotlineapplicationclient.Main.main(Main.java:30)
Caused by: java.lang.ClassNotFoundException: com.sun.logging.LogDomains
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 17 more
J'utilise Netbeans 7, avec un serveur Glassfish 3.1.

Les librairies de mon application sont, entre autres:

- le jar de mon module EJB
- gf-client.jar
- javax.ejb.jar
- appserv-rt.jar
- appclient.jar

Je ne sais plus quoi faire, je pense que ce doit être un problème de librairies ou de classpath, mais je n'ai pas réussi à trouver ce qui ne va pas.

Quelqu'un peut-il m'expliquer comment rendre mon application "executable" hors de netbeans?

Merci.