Log4j and JavaMail.

HI,
I am using log4j 1.2.8 for logging and I plan to use the SMTPAppender for sending mails of those exceptions.I am using javamail mail.jar version 1.3.
upon execution, i get the following error.
log4j:ERROR Error occured while sending e-mail notification.
javax.mail.NoSuchProviderException: smtp
     at javax.mail.Session.getService(Session.java:611)
     at javax.mail.Session.getTransport(Session.java:541)
     at javax.mail.Session.getTransport(Session.java:484)
     at javax.mail.Session.getTransport(Session.java:464)
     at javax.mail.Session.getTransport(Session.java:519)
     at javax.mail.Transport.send0(Transport.java:155)
     at javax.mail.Transport.send(Transport.java:81)
     at org.apache.log4j.net.SMTPAppender.sendBuffer(Unknown Source)
     at org.apache.log4j.net.SMTPAppender.append(Unknown Source)
     at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:221)
     at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:57)
     at org.apache.log4j.Category.callAppenders(Category.java:187)
     at org.apache.log4j.Category.forcedLog(Category.java:372)
     at org.apache.log4j.Category.error(Category.java:303)
     at com.saterisystems.api_selfcarev1r0.API_getServiceList.logon(API_getServiceList.java:93)
     at com.saterisystems.api_selfcarev1r0.API_getServiceList.main(API_getServiceList.java:427)
I have configured the mail server and related stuff in the log4j properties file.
Can anyone help me out please?
Thanks & Regards,
Anand Kapadi

Start here:
http://java.sun.com/products/javamail/FAQ.html#servletSecurityManager

Similar Messages

  • Using JSF and JavaMail to send Automated Email

    Hi All,
    Can any one please suggest I can use JSF and JavaMail to send automated email messages i.e after a person has successfully completed a form , a message is sent to his/her email address confirming that he has succesfully registered or completed a form. I have succesfull implemeted the use of javamail for sending email meassages in a JSF web application but cant seem to figure out how i can achieve automated sending of emails in JSF. Please any ideas, tutorials or source code would be very much appreciated.
    Thanks.

    I don't understand your problem:
    You have already been able to send e-mails from a JSF webapplication, but you are not capable of sending e-mails from a JSF webapplication?!
    Automated sending of e-mails will be exactly the same as non-automated.

  • Log4j and log4cxx together

    Hi,
    I'm using RollingFileAppender to append log4j and log4cxx logs in a common log file. This works only for the first log file. But, the subsequent log files which got created when the size exceeds the specified range, does not getting appended the log4cxx logs.
    I have referred http://www.dreamcubes.com/blog/?itemid=59#nucleus_cf
    Here is my config settings
    log4j:
    log4j.rootLogger=debug,console,file
    log4j.category.com.company.project=debug
    # File Appender
    # file is set to be a RollingFileAppender.
    log4j.appender.file=org.apache.log4j.RollingFileAppender
    log4j.appender.file.File=project.log
    log4j.appender.file.MaxFileSize=100KB
    # Keep one backup file
    log4j.appender.file.MaxBackupIndex=100
    # file uses PatternLayout.
    log4j.appender.file.layout=org.apache.log4j.PatternLayout
    log4j.appender.file.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss,SSS} - %m%nlog4cxx:
    <?xml version="1.0" encoding="UTF-8" ?>
    <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
         <!-- Output the log message to system console.
         -->
         <appender name="MyConsoleAppender" class="org.apache.log4j.ConsoleAppender">
              <param name="Target" value="System.out"/>
              <layout class="org.apache.log4j.PatternLayout">
                   <param name="ConversionPattern" value="%-5p %c{1} - %m%n"/>
              </layout>
         </appender>
         <!-- On application startup, a log file named "project.log" will be create if not exist.
              When the log file reach beyond 100KB, it will be renamed "project.log.1", when the log
              index reach "project.log.5", the next rename will be back to "project.log.1" and
              overite the old log.
         -->     
         <appender name="MyRollingAppenderSize" class="org.apache.log4j.RollingFileAppender">
              <param name="file" value="project.log"/>
              <param name="append" value="true"/>
              <param name="MaxFileSize" value="100KB"/>
              <param name="MaxBackupIndex" value="100"/>
              <layout class="org.apache.log4j.PatternLayout">
                   <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
              </layout>
         </appender>
         <!-- Setup the root category, add the appenders and set the default level
              5 level of logging,  ALL < DEBUG < INFO < WARN < ERROR < FATAL
              The root level is set with INFO, which mean any message greater or same
              as INFO will be log down, in this case, DEBUG is not logged.
              To log all regardless of logging level, set <priority value="ALL">
         -->
         <root>
              <priority value="all" />
              <appender-ref ref="MyRollingAppenderSize"/>
              <appender-ref ref="MyConsoleAppender"/>
         </root>
    </log4j:configuration>

    Logger experts,
    First of all, trying to point a common logging file from two different log configuration file is possible?
    If this is not at all possible, Keeping the two different log file would work, but it is cumbersome on debugging..
    Thanks and Regards,
    Ramesh

  • Log4j and WAS logging

    Hello all,
    Is there anyway to redirect log4j logging to WAS loggers.
    For example, axis needs log4j and may need to log to some appenders.
    Can we safely use SAP logging and how?
    Is there an example somewhere?
    Antoine

    There's an article "Integrating 3rd party logging Frameworks into SAP NetWeaver" (https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/36085e78-0801-0010-678d-8b4e89ddff3c)
    It mentions sample code and a tutorial for a "Log4j bridge", but I couldn't locate that. I have posted a separate question for that.
    Hope this helps,
    Michael

  • Log4j and Jboss are acting weird

    This question is reagards to Log4j and JBoss and I thought this is the best place to ask this question.
    I am using Jboss 3.2.3. My purpose was to log messages in a seperate file "developer.log" using Log4j. These messages has to be logged in this file only. So in my WAR's folder under WEB-INF/classes I created a file log4j.properties:
    log4j.logger.standard=DEBUG, devlog
    log4j.appender.devlog=org.apache.log4j.RollingFileAppender
    log4j.appender.devlog.File=C:/logs/developer.log
    log4j.appender.devlog.layout=org.apache.log4j.PatternLayout
    log4j.appender.devlog.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%nNow my code :
    import org.apache.log4j.Logger;
    private static Logger log = Logger.getLogger("standard");
    log.debug("a debug message");
    log.info("a info message");
    log.warn("a war message");I test run this code without Jboss and it works perfect. It created a file "developer.log" in the desired location and logs messages in it.
    Now i run with JBoss. JBoss does not create "developer.log" file at all. Instead it logs all the messages in server.log
    2005-09-30 23:07:35,459 DEBUG [standard] a debug message
    Jboss is recognizing that it is standard but after that it is not gving me the desired results. Any input on how to fix this problem?
    TIA

    You can tell it you don't want to inherit, by adding
    this to your "standard" category tag:
    <category name="standard" additivity="false">
    thanks. it works perfect.
    ok i got it working kind of. Jboss already comeswith
    a log4j.xml so i put my log4j stuff in this file :You should be able to deploy your own log4j.xml with
    your app's resource files and make it use yours when
    it is running your app.Ok I took out my stuff from Jboss log4j.xml, create a new xml progtest.log4j.xml like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
    <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
      <appender name="DEVLOG" class="org.apache.log4j.RollingFileAppender">
        <param name="File" value="${jboss.server.home.dir}/log/developer.log" />
        <param name="Append" value="true" />
        <layout class="org.apache.log4j.PatternLayout">
          <param name="ConversionPattern" value="%d{ABSOLUTE} %5p %c{1}:%L - %m%n" />
        </layout>
      </appender>
      <category name="standard" additivity="false">
        <priority value="INFO"/>
        <appender-ref ref="DEVLOG" />
      </category>
    </log4j:configuration>My web application is in a ProgTest.WAR folder. I put the above file "progtest.log4j.xml" under WEB-INF/classes in ProgTest.WAR folder. When i run the app the very first problem again arises that no developer.log file was created; instead the concerned messages were put into server.log and console.
    All my classes are in one jar file. I include progtest.log4j.xml in that jar file, redeploy it and test it but still the same problem.
    What i am doing wrong here?
    Thanks

  • Log4J and LogConfigurationException...

    I get an error when I try to deploy an old application to the newly updated Oracle Application Server 10.1.3. It has something to do with Log4J, and I've tried a lot of different things, but nothing seems to help.
    07/04/23 12:12:20.302 10.1.3.2.0 Started
    07/04/23 12:12:23.87 zoomgen: Error initializing servlet
    java.lang.ExceptionInInitializerError
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:242)
    at com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.java:2303)
    at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4810)
    at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4734)
    at com.evermind.server.http.HttpApplication.initPreloadServlets(HttpApplication.java:4922)
    at com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:1134)
    at com.evermind.server.http.HttpApplication.<init>(HttpApplication.java:738)
    at com.evermind.server.ApplicationStateRunning.getHttpApplication(ApplicationStateRunning.java:414)
    at com.evermind.server.Application.getHttpApplication(Application.java:571)
    at com.evermind.server.http.HttpSite$HttpApplicationRunTimeReference.createHttpApplicationFromReference(HttpSite.java:1990)
    at com.evermind.server.http.HttpSite$HttpApplicationRunTimeReference.<init>(HttpSite.java:1909)
    at com.evermind.server.http.HttpSite.addHttpApplication(HttpSite.java:1606)
    at oracle.oc4j.admin.internal.WebApplicationBinder.bindWebApp(WebApplicationBinder.java:238)
    at oracle.oc4j.admin.internal.WebApplicationBinder.bindWebApp(WebApplicationBinder.java:99)
    at oracle.oc4j.admin.internal.ApplicationDeployer.bindWebApp(ApplicationDeployer.java:547)
    at oracle.oc4j.admin.internal.ApplicationDeployer.doDeploy(ApplicationDeployer.java:202)
    at oracle.oc4j.admin.internal.DeployerBase.execute(DeployerBase.java:93)
    at oracle.oc4j.admin.jmx.server.mbeans.deploy.OC4JDeployerRunnable.doRun(OC4JDeployerRunnable.java:52)
    at oracle.oc4j.admin.jmx.server.mbeans.deploy.DeployerRunnable.run(DeployerRunnable.java:81)
    at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: No suitable
    Log constructor [Ljava.lang.Class;@14a4a1 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError
        : org/apache/log4j/Category) (Caused by org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang
        .Class;@14a4a1 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Category
        at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:543)
        at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
        at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
        at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
        at org.apache.struts.action.ActionServlet.<clinit>(ActionServlet.java:228)
        ... 22 more
    Caused by: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@14a4a1 for org.apache
        .commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Category)
        at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:413)
        at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
        ... 26 more
    Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Category
        at java.lang.Class.getDeclaredConstructors0(Native Method)
        at java.lang.Class.privateGetDeclaredConstructors(Class.java:2328)
        at java.lang.Class.getConstructor0(Class.java:2640)
        at java.lang.Class.getConstructor(Class.java:1629)
        at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:410)
        ... 27 more
    07/04/23 12:12:23.89 zoomgen: Error preloading servlet
    javax.servlet.ServletException: Error initializing servlet
        at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4837)
        at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4734)
        at com.evermind.server.http.HttpApplication.initPreloadServlets(HttpApplication.java:4922)
        at com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:1134)
        at com.evermind.server.http.HttpApplication.<init>(HttpApplication.java:738)
        at com.evermind.server.ApplicationStateRunning.getHttpApplication(ApplicationStateRunning.java:414)
        at com.evermind.server.Application.getHttpApplication(Application.java:571)
        at com.evermind.server.http.HttpSite$HttpApplicationRunTimeReference.createHttpApplicationFromReference(HttpSite.java:1990)
        at com.evermind.server.http.HttpSite$HttpApplicationRunTimeReference.<init>(HttpSite.java:1909)
        at com.evermind.server.http.HttpSite.addHttpApplication(HttpSite.java:1606)
        at oracle.oc4j.admin.internal.WebApplicationBinder.bindWebApp(WebApplicationBinder.java:238)
        at oracle.oc4j.admin.internal.WebApplicationBinder.bindWebApp(WebApplicationBinder.java:99)
        at oracle.oc4j.admin.internal.ApplicationDeployer.bindWebApp(ApplicationDeployer.java:547)
        at oracle.oc4j.admin.internal.ApplicationDeployer.doDeploy(ApplicationDeployer.java:202)
        at oracle.oc4j.admin.internal.DeployerBase.execute(DeployerBase.java:93)
        at oracle.oc4j.admin.jmx.server.mbeans.deploy.OC4JDeployerRunnable.doRun(OC4JDeployerRunnable.java:52)
        at oracle.oc4j.admin.jmx.server.mbeans.deploy.DeployerRunnable.run(DeployerRunnable.java:81)
        at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
        at java.lang.Thread.run(Thread.java:595)
    07/04/23 12:12:23.433 zoomgen: 10.1.3.2.0 Started
    Jan O                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Take a look here:
    Re: OC4J10.1.3 java.lang.NoClassDefFoundError: org/apache/log4j/Category

  • Log4j and Tomcat-problem

    Hi all,
    First I tried to add some logging to my simple Java code with a xml configuration file and it worked fine.
    Now I am trying to add logging to the whole java application in the same way which runs in tomcat and face with the foll problem.Tomcat is not able to find the configuration file.I tried to place the xml file in all feasible locations in tomcat and also tried to add in classpath but in vain.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
    Java Code(Which gets called in startup by another code)
    Java Code
    public class PublisherPoll implements Runnable {
    public static Logger logger = Logger.getLoggerPublisherPoll.class);//***********log4j
    public static Logger getLoggerInstance(){   //***********log4j
         return logger;
    static{
    DOMConfigurator.configure("sudarson.xml");//**********its telling it cant find/open this xml file
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Error(during starting tomcat)
    log4j:ERROR Could not open [sudarson.xml].
    java.io.FileNotFoundException: sudarson.xml (The system cannot find the file sp
    cified)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:106)
    at java.io.FileInputStream.<init>(FileInputStream.java:66)
    at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.jav
    :583)
    at org.apache.log4j.xml.DOMConfigurator.configure(DOMConfigurator.java:
    87)
    at SerenaStartupServlet.init(SerenaStartupServlet.java:44)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper
    java:1091)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:9
    5)

    DOMConfigurator.configure("sudarson.xml");//**********its telling it cant find/open this xml fileWhat does "sudarson.xml" mean to you? To me, it means a file name relative to the current directory. What do you think the current directory is when you're running this in Tomcat?
    You need to research the APIs more fully, to figure out how to give it a resource name relative to the application's classpath, and put that file in said classpath.
    If I were you, I would try to avoid explicitly calling DOMConfigurator.configure altogether, and just pass the appropriate Log4J system property to the commandline that starts up Tomcat. Let Log4J worry about loading the file, given the property. If I recall correctly, the system property name is "log4j.configuration", which defaults to "log4j.properties" if unspecified. Also, rather than have each application running in Tomcat have their own log4j configuration file name, I'd name them something more universal, like "log4j.xml" - then if you deploy multiple apps in Tomcat, they can all load their own log4j.xml file, as long as (again) you corrected the "log4j.configuration" system property.

  • JSP and JavaMail

    I have this Javamail program that I know works and I'm trying to put it into JSP. Since I'm still new to JSP, I can't figure out why I'm getting this error:
    org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
    C:\tomcat\work\localhost\ams\index$jsp.java:11: Package javax.mail not found in import.
    import javax.mail.*;
    ^
    C:\tomcat\work\localhost\ams\index$jsp.java:12: Package javax.mail.internet not found in import.
    import javax.mail.internet.*;
    I just can't get the javamail stuff to work in JSP. Could you tell me why?
    Thank you in advance,
    Mike

    hmm...no, I have the javamail package on my c:\
    This is what my CLASSPATH looks like:
    .;C:\ServletDevel;C:\tomcat\common\lib\servlet.jar;C:\javamail-1.2\mail.jar;C:\jaf-1.0.1\activation.jar
    Question 1
    Should I just change the location of the javamail and jaf folders to:
    C:\tomcat\lib or C:\tomcat\common\lib ???
    and change the CLASSPATH??
    Question 2
    or should I just download it again and add to the CLASSPATH rather than change it???? And again, which lib directory? C:\tomcat\lib or C:\tomcat\common\lib ???
    Thanks again,
    Mike

  • Log4j and jdk1.5

    log4j-1.2.8 and jdk1.5
    they don't seem to work together? too many errors/warnings
    any solutions?

    hehe
    thats a good solution thnx :)
    what i actually meant to ask was ... is there a way for jdk1.5 to work with log4j

  • Log4J and OAS 10.1.2.0.2

    Greetings, all!
    I've searched this forum and the OC4J forum and have not found any clues to help with my log4j woes. I'm hoping someone may have encountered similar issues and can share their thoughts.
    I am developing a web application and would like to use log4j. I have successfully integrated it in my development environment (JDev 10.1.2.1.0/Standalone OC4J 10.1.2.0.2) by placing the log4j jar (log4j-1.2.14) in WEB-INF/lib. I have not been successful in moving it to our staging OAS environment, however. We are running 10gR2 OAS (10.1.2.0.2) on Windows 2003.
    Since I read in the docs (http://download-west.oracle.com/docs/cd/B14099_19/web.1012/b14017/jkosfram.htm#sthref698)that the log4j jar should not be put in the applib directory of the OAS_HOME I have been trying to deploy the application with the jar file within the WEB-INF/lib location. Every time I try to deploy, I get the following error complaining that it cannot find the correct classes.
    Base Exception:
    com.evermind.server.rmi.OrionRemoteException
    Class not found: org.apache.commons.logging.LogConfigurationException; nested exception is:
    java.lang.ClassNotFoundException: org.apache.commons.logging.LogConfigurationException. Class not found: org.apache.commons.logging.LogConfigurationException; nested exception is:
    java.lang.ClassNotFoundException: org.apache.commons.logging.LogConfigurationException
    I understand it is probably a classloader issue, but using an orion-web.xml file with the search-local-classes-first set to true does not work either. I was successful in deploying the app and writing to a log when the log4j jar was in the applib directory, but since the docs state that this could cause conflicts with OEM, I removed the jar. I have also been able to log to the application.log file by using context.log() statements, but this is less than optimal.
    I know 10.1.3 may solve this issue, but we are not planning on that version for some time. How are others using log4j in the OAS? Should I just place the jar in the applib and hope for the best?
    TIA for any help or insight,
    Dixie.

    I resolved the problem and wanted to post the solution in case anyone had similar problems. The issue was related to the commons.logging package used by JSF. I had version 1.0.4 in the applib directory of the OAS_HOME along with the other jars needed for JSF. Once I upgraded to the 1.1 version of commons-logging I was able to deploy the app and use log4j. I received this metalink reference from a colleague and it helped me solve the problem: Note:413981.1
    Dixie.

  • Log4j and weblogic workshop server 8.1 ?

    Can someone please point out how to setup log4j in weblogic 8.1? I put the log4j.jar file in my server classpath, and in the server startup script I put -Dlog4j.configuration=/path/to/log4.properties in the JAVA_OPTIONS. I can't still get log messages to show in the console. log4j.properties content is:
    log4j.rootCategory=DEBUG, stdout
    log4j.appender.stdout=org.apache.log4j.ConsoleAppender
    log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
    log4j.appender.stdout.layout.ConversionPattern=%d [%t] %-5p %c{2} %x - %m%n
    In my code, I use the org.apache.log4j.Category class to log messages. For example, static Category cat = Category.getInstance(MyClass.class);
    cat.debug("a message");
    Is there something I'm doing wrong?
    Thanks.
    gtata

    In my setDomainEnv.cmd script which should be located where your workshop domain is installed, I did the following:
    # Commented out the following line
    @REM set JAVA_PROPERTIES=%JAVA_PROPERTIES% -Dlog4j.configuration=file:%LOG4J_CONFIG_FILE% %CLUSTER_PROPERTIES%
    # Set a variable LOG4J_PROPS_FILE to point to the location where my
    # log4j properties file is located. NOTE: Full Path required
    set LOG4J_PROPS_FILE=/bea/user_projects/domains/workshop/log4j.properties
    # Updated my JAVA_PROPERTIES variable to look like the following:
    set JAVA_PROPERTIES=%JAVA_PROPERTIES% -Dlog4j.configuration=file:%LOG4J_PROPS_FILE% %CLUSTER_PROPERTIES%
    Originally, I had everything setup correctly except for my JAVA_PROPERTIES. Note that the option
    -Dlog4j.configuration=file:%LOG4J_PROPS_FILE% %CLUSTER_PROPERTIES% has the word "file:" in it.
    What I had that was not working was -Dlog4j.configuration=%LOG4J_PROPS_FILE% %CLUSTER_PROPERTIES%
    so I added the file: infront of the LOG4J_PROPS_FILE variable.
    Hope this helps.
    Gabsaga

  • EJB and JavaMail

    Hi,
    I have developed an EJB for sending emails using the javamail api.
    My problem is that when i run the same code using the a standalone java application (i have pasted the code from the EJB) and try sending mails outside the my companies domain the mails are going.
    However when i try sending the mails using the JSP end EJB the mails are not going.
    I noticed that in the standalone java application the protected method getPasswordAuthentication gets called by the system. However the same is not getting called in the EJB.
    I am new to this technology. Can anyone please help me out here.
    I am sending the code also that i am using:-
    // Get all the system properties
    Properties props = System.getProperties();
    props.put("mail.smtp.host", "HOSTNAME");
    props.put("mail.smtp.auth", "true");
    SetAuthentication auth = new SetAuthentication();
    Session session = Session.getInstance(props, auth);
    session.setDebug(true);
    // Create a message
    Message msg = new MimeMessage(session);
    try {
    // Set the From Address
    Address addrFrom =new InternetAddress("[email protected]");
    msg.setFrom(addrFrom);
    // Set the TO address
    Address addrTo = new InternetAddress(strTo);
    msg.setRecipient(MimeMessage.RecipientType.TO, addrTo);
    // Set the subject of the mail
    msg.setSubject(strSubject);
    msg.setContent(strContent, "text/plain");
    msg.saveChanges();
    Transport.send(msg);
    // Code in class SetAuthentication
    private PasswordAuthentication auth;
    public SetAuthentication() {
    super();
    auth = new PasswordAuthentication("user", "password");
    protected PasswordAuthentication getPasswordAuthentication() {
    return auth;

    Hi,
    I have worked on JBoss and Weblogic app servers and one can initialize java mail settings in the app server,.I am sorry, i don't know how its done in the app server you are using.
    I would suggest you to try the following :
    static {
    /* Setting Properties for STMP host */
    props = System.getProperties();
    props.put("mail.smtp.host", "PUT SMTP SERVER HERE");
    props.put("mail.smtp.auth", "true");
    session = Session.getDefaultInstance(props, null);
    try {
    MimeMessage message = new MimeMessage(session);
    message.setRecipient(Message.RecipientType.TO,
    new InternetAddress(this.to));
    message.setFrom(new InternetAddress(this.from));
    message.setSubject(this.subject);
    message.setText(this.message);
    Transport transport = session.getTransport("smtp");
    transport.connect("PUT SMTP SERVER HERE", "PUT USERNAME HERE", "PUT PASSWORD HERE");
    message.saveChanges();
    transport.sendMessage(message, message.getAllRecipients());
    transport.close();
    } catch (MessagingException e) {
    throw new Exception(e.getMessage());

  • X.400 instead of SMTP Protocol and Javamail API

    We have developed a workflow application on Domino 5.0.7. The SmartHost is "MS Exchange Server", because the application will only be accessed by browsers, we are using javaagent to send the email notifications. Due to some domain restrictions on MS Exhchange servers we have implemented Javamail API on the domino server, and it worked fine (I mean the messages were received by the Exchange Clients, using the SMTP addresses like [email protected]). As we dont have available SMTP addresses for all end users in the company we need to use the X.400 addresses. Is there anyone, can help guide about either the avaiability of any X.400 javamail api, or how to use mapi etc? I know it is little bit challenging, but we are struck. thanks

    Currently, the latest version of the JavaMail 1.2 API, X.400 transport protocol is not supported yet. Only the transport SMTP - a message Transport protocol, for sending messages to a server, is supported.
    Allen Lai
    SUN Developer Technical Support

  • Log4j and managed servers

    This seems somewhat obvious, but...
              I have a Solaris based WLS 8.1.6 cluster with two managed servers.
              In the log4j.xml for BOTH managed servers, the logs for output from both go to the same file.
              What happens is one managed server writes to dctm_api.log and one writes to the previous log file.
              Is this as simple as Log4J in one of the Managed Servers has the file open and Log4J from two process can't have the same file open and write to it at the same time?
              Thanks,
              Michael Geiser

    Static fields won't get serialized.
              Peace,
              Cameron Purdy
              Tangosol, Inc.
              http://www.tangosol.com/coherence.jsp
              Tangosol Coherence: Clustered Replicated Cache for Weblogic
              "rohit" <[email protected]> wrote in message
              news:[email protected]..
              >
              > Hi, can someone please advice if using log4j in the clustered environment
              would
              > in any way result in the failure of in memory session replication. We are
              using
              > WL 7.0 and log4j is installed on each managed servers. The log4j class
              "org.apache.log4j.Logger"
              > is used as a static reference within java classes which are put in the
              session.
              > Any response greatly appreciated. Thanks. Rohit
              

  • Getting empty log files with log4j and WebLogic 10.0

    Hi!
    I get empty log files with log4j 1.2.13 and WebLogic 10.0. If I don't run the application in the application server, then the logging works fine.
    The properties file is located in a jar in the LIB folder of the deployed project. If I change the name of the log file name in the properties file, it just creates a new empty file.
    What could be wrong?
    Thanks!

    I assume that when you change the name of the expected log file in the properties file, the new empty file is that name, correct?
    That means you're at least getting that properties file loaded by log4j, which is a good sign.
    As the file ends up empty, it appears that no logger statements are being executed at a debug level high enough for the current debug level. Can you throw in a logger.error() call at a point you're certain is executed?

Maybe you are looking for

  • I am trying to install a game i bought and it wont

    I recently bought a game from bigfishgames website and it acts like it is downloading but does not show in my big fish games manager, i have tried some of the help menus and cant fix it. i am new to firefox so not sure what to do

  • How to run a java class from its package directory

    Hi, I hope someone can help me on the following .... Let say I have a Test.java class with the package definition: "package com.ams.eai.mq.fileAdapter;". I compiled the class into the directory c:\myJava\client\com\ams\eai\mq\fileAdapter. I have c:\m

  • Jboss configuration on Sun Cluster 3.1

    Hi. I am using generic Data Services to manage JBoss instance under Sun Cluster. the command is as follows. scrgadm -a -j jboss_resource -g cluster_failover_rg -t SUNW.gds \ -y Scalable=false -y Start_timeout=900 \ -y Stop_timeout=420 -x Probe_timeou

  • Permission problems. new to snow lepored

    Hi i just recently bought an appple mac pro from ebay it came with snow lepored installed. i have been having some permission problems and need some help fixing then. here are the problems that are not getting repaired through the disk utility. Permi

  • How to check the  timeshot of iProcurement approval request notification?

    Dear all: As the subject, how to check the timeshot of every iProcurement approval notification ? Can someone provide the SQL to check? Environment: Oracle R12.1.3 | Aix 6.1 Regards Terry Chen