IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Java Discussion :

SMSLib avec Bulk SMS


Sujet :

Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Homme Profil pro
    Étudiant
    Inscrit en
    Juin 2009
    Messages
    15
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juin 2009
    Messages : 15
    Par défaut SMSLib avec Bulk SMS
    Salut tout le monde,

    J’essaie de réaliser une application qui permet d'envoyer des SMS.

    Le problème que je rencontre est que lors de l’exécution, l'erreur suivante apparait :
    log4j:WARN No appenders could be found for logger (smslib)
    log4j:WARN Please initialize the log4j system properly.
    log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info
    Quelqu'un saurait-il m'indiquer s'il existe une solution à ce problème ?

    Merci d'avance

  2. #2
    Membre éprouvé

    Inscrit en
    Juin 2005
    Messages
    1 155
    Détails du profil
    Informations forums :
    Inscription : Juin 2005
    Messages : 1 155
    Par défaut
    ça n'est pas une erreur, juste un warning que t'envoi l'api log4j.
    ça me parait être très explicite par ailleurs: log4j ne trouve pas d'appender il est fort probable que ton fichier log4j.xml n'en contienne pas ou n'est pas bien configuré. Regardes ici:
    http://beuss.developpez.com/tutoriel...jakarta/log4j/
    ou ici:
    Cours et tutoriels de formation à la programmation Java : http://java.developpez.com/cours/

  3. #3
    Membre averti
    Homme Profil pro
    Étudiant
    Inscrit en
    Juin 2009
    Messages
    15
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juin 2009
    Messages : 15
    Par défaut
    J'ai trouvé ceci dans un article :

    Default Initialization Procedure

    The log4j library does not make any assumptions about its environment. In particular, there are no default log4j appenders. Under certain well-defined circumstances however, the static inializer of the Logger class will attempt to automatically configure log4j. The Java language guarantees that the static initializer of a class is called once and only once during the loading of a class into memory. It is important to remember that different classloaders may load distinct copies of the same class. These copies of the same class are considered as totally unrelated by the JVM.

    The default initialization is very useful in environments where the exact entry point to the application depends on the runtime environment. For example, the same application can be used as a stand-alone application, as an applet, or as a servlet under the control of a web-server.

    The exact default initialization algorithm is defined as follows:

    Setting the log4j.defaultInitOverride system property to any other value then "false" will cause log4j to skip the default initialization procedure (this procedure).
    Set the resource string variable to the value of the log4j.configuration system property. The preferred way to specify the default initialization file is through the log4j.configuration system property. In case the system property log4j.configuration is not defined, then set the string variable resource to its default value "log4j.properties".
    Attempt to convert the resource variable to a URL.
    If the resource variable cannot be converted to a URL, for example due to a MalformedURLException, then search for the resource from the classpath by calling org.apache.log4j.helpers.Loader.getResource(resource, Logger.class) which returns a URL. Note that the string "log4j.properties" constitutes a malformed URL.

    See Loader.getResource(java.lang.String) for the list of searched locations.
    If no URL could not be found, abort default initialization. Otherwise, configure log4j from the URL.

    The PropertyConfigurator will be used to parse the URL to configure log4j unless the URL ends with the ".xml" extension, in which case the DOMConfigurator will be used. You can optionaly specify a custom configurator. The value of the log4j.configuratorClass system property is taken as the fully qualified class name of your custom configurator. The custom configurator you specify must implement the Configurator interface.

    Est ce que quelqu'un pourrait me traduire cela, parce que je pense qu'il parle de la façon suivie pour configurer le log4J ..??

  4. #4
    Membre averti
    Homme Profil pro
    Étudiant
    Inscrit en
    Juin 2009
    Messages
    15
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juin 2009
    Messages : 15
    Par défaut
    Salut Djadey,

    Saurais-tu m'indiquer où dois-je copier le fichier log4j.properties après l'avoir créé ?

  5. #5
    Membre averti
    Homme Profil pro
    Étudiant
    Inscrit en
    Juin 2009
    Messages
    15
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juin 2009
    Messages : 15
    Par défaut
    J'ai résolu le problème.

    Il me reste une dernière chose..., comment éviter l'affichage du tableau suivant (il s'affiche automatiquement même si je ne l'avais pas créé) :

    Images attachées Images attachées  

  6. #6
    Membre éprouvé

    Inscrit en
    Juin 2005
    Messages
    1 155
    Détails du profil
    Informations forums :
    Inscription : Juin 2005
    Messages : 1 155
    Par défaut
    Tu aurais pris un minimum de temps pour lire le tuto tu aurais trouvé par toi même:
    http://beuss.developpez.com/tutoriel...og4j/#LIII.B.1

  7. #7
    Membre averti
    Homme Profil pro
    Étudiant
    Inscrit en
    Juin 2009
    Messages
    15
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juin 2009
    Messages : 15
    Par défaut
    Merci pour votre aide, vos liens m'ont apporté beaucoup d'aide.

    Il me reste une dernière chose c'est d'éviter l'affichage de la fenêtre. J'ai lu l'article mais je n'ai pas trouvé la solution.

  8. #8
    Membre averti
    Homme Profil pro
    Étudiant
    Inscrit en
    Juin 2009
    Messages
    15
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juin 2009
    Messages : 15
    Par défaut
    Ce tableau précédent s'affiche suite à l'instanciation suivante :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    private static Logger logger =Logger.getLogger(InitUsingLog4JProperties.class);

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Problème avec les SMS
    Par acacia dans le forum La taverne du Club : Humour et divers
    Réponses: 3
    Dernier message: 04/11/2007, 03h31
  2. Réponses: 27
    Dernier message: 25/10/2006, 12h10
  3. Message d'erreur avec Bulk Insert
    Par Shivas dans le forum Décisions SGBD
    Réponses: 2
    Dernier message: 18/07/2005, 12h03
  4. [Forms6i] Pb avec BULK COLLECT
    Par Kast dans le forum Forms
    Réponses: 3
    Dernier message: 27/12/2004, 16h55
  5. Réponses: 4
    Dernier message: 04/12/2003, 08h12

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo