TobiasHabermann
Grünschnabel
I am using the log4j sucesfull with a FileAppender without a properties file but doing the configuration in the code:
this.filename = "log/logfile.dat";
logger = Logger.getLogger("myLog");
FileAppender fa=null;
try{
fa = new FileAppender(new MyLogLayout(),filename);
} catch(IOException e){
e.printStackTrace();
} catch(Exception e){System.out.println(e.getMessage());}
logger.addAppender(fa);
logger.setLevel(Level.ALL);
up to this everything works fine. But when i try to create a SMTPAppender with
SMTPAppender mail = new SMTPAppender();
i can compile the code but running it i get the error message:
"java.lang.NoClassDefFoundError: javax/mail/internet/AddressException"
this.filename = "log/logfile.dat";
logger = Logger.getLogger("myLog");
FileAppender fa=null;
try{
fa = new FileAppender(new MyLogLayout(),filename);
} catch(IOException e){
e.printStackTrace();
} catch(Exception e){System.out.println(e.getMessage());}
logger.addAppender(fa);
logger.setLevel(Level.ALL);
up to this everything works fine. But when i try to create a SMTPAppender with
SMTPAppender mail = new SMTPAppender();
i can compile the code but running it i get the error message:
"java.lang.NoClassDefFoundError: javax/mail/internet/AddressException"