Solved

tomcat, axis, eclipse and log4

Posted on 2004-10-29
3,874 Views
Last Modified: 2012-05-05



i installed tomcat, axis, eclipse like to be viewed under http://www.experts-exchange.com/Web/Q_21187468.html

now i want to get rid of

  log4j:WARN No appenders could be found for logger (org.apache.axis.i18n.ProjectResourceBundle).
  log4j:WARN Please initialize the log4j system properly.

in eclipse.

directories look like:

C:\Programme\Internet\Tomcat\webapps
C:\Programme\Internet\Tomcat\webapps\axis

any good ideas what to do?

where should i put log4j.properties?
0
Question by:drnick
    18 Comments
     
    LVL 35

    Accepted Solution

    by:
    somewhere in the classpath (ie:  webapps/axis/WEB-INF/classes) :-)
    0
     
    LVL 5

    Author Comment

    by:drnick
    nope, this time it's not working :-)

    log4j.properties contains:

    # Set root category priority to INFO and its only appender to CONSOLE.
    log4j.rootCategory=INFO, CONSOLE
    #log4j.rootCategory=INFO, CONSOLE, LOGFILE

    # Set the enterprise logger category to FATAL and its only appender to CONSOLE.
    log4j.logger.org.apache.axis.enterprise=FATAL, CONSOLE

    # CONSOLE is set to be a ConsoleAppender using a PatternLayout.
    log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
    log4j.appender.CONSOLE.Threshold=INFO
    log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
    log4j.appender.CONSOLE.layout.ConversionPattern=- %m%n

    # LOGFILE is set to be a File appender using a PatternLayout.
    log4j.appender.LOGFILE=org.apache.log4j.FileAppender
    log4j.appender.LOGFILE.File=axis.log
    log4j.appender.LOGFILE.Append=true
    log4j.appender.LOGFILE.Threshold=INFO
    log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
    log4j.appender.LOGFILE.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n

    moved it to where you said,
    but eclipse deploying in the style of the last example says:

    log4j:WARN No appenders could be found for logger (org.apache.axis.i18n.ProjectResourceBundle).
    log4j:WARN Please initialize the log4j system properly.
    Processing file deploy.wsdd
    <Admin>Done processing</Admin>

    which i would like to be solely:

    Processing file deploy.wsdd
    <Admin>Done processing</Admin>

    :-)
    0
     
    LVL 35

    Expert Comment

    by:TimYates
    What happens if you change:

    # Set the enterprise logger category to FATAL and its only appender to CONSOLE.
    log4j.logger.org.apache.axis.enterprise=FATAL, CONSOLE

    to

    # Set the enterprise logger category to FATAL and its only appender to CONSOLE.
    log4j.logger.org.apache.axis.enterprise=FATAL, CONSOLE
    log4j.logger.org.apache.axis.i18n=FATAL, CONSOLE

    ?
    0
     
    LVL 35

    Expert Comment

    by:TimYates
    >  nope, this time it's not working :-)

    hehehe...dang!  Still, as meatloaf said, "2 out of 3 aint bad" ;-)  

    hehehehe

    Hope that last line sorts it :-)
    0
     
    LVL 5

    Author Comment

    by:drnick
    ;-)
    i got C:\Programme\Internet\Tomcat\webapps\axis\WEB-INF\classes\log4j.properties
    now changed, so it looks like

    # Set root category priority to INFO and its only appender to CONSOLE.
    log4j.rootCategory=INFO, CONSOLE
    #log4j.rootCategory=INFO, CONSOLE, LOGFILE

    # Set the enterprise logger category to FATAL and its only appender to CONSOLE.
    log4j.logger.org.apache.axis.enterprise=FATAL, CONSOLE
    log4j.logger.org.apache.axis.i18n=FATAL, CONSOLE

    # CONSOLE is set to be a ConsoleAppender using a PatternLayout.
    log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
    log4j.appender.CONSOLE.Threshold=INFO
    log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
    log4j.appender.CONSOLE.layout.ConversionPattern=- %m%n

    # LOGFILE is set to be a File appender using a PatternLayout.
    log4j.appender.LOGFILE=org.apache.log4j.FileAppender
    log4j.appender.LOGFILE.File=axis.log
    log4j.appender.LOGFILE.Append=true
    log4j.appender.LOGFILE.Threshold=INFO
    log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
    log4j.appender.LOGFILE.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n


    i restarted tomcat just to be sure,
    then again did the
    org.apache.axis.client.AxisClient.class-deployment procedure from the example.

    it still says:

    log4j:WARN No appenders could be found for logger (org.apache.axis.i18n.ProjectResourceBundle).
    log4j:WARN Please initialize the log4j system properly.
    Processing file deploy.wsdd
    <Admin>Done processing</Admin>

    hihi, i'm going for that last warning, you know,
    want my installation instructions (now 24 steps) to be perfect
    for my fellows.
    0
     
    LVL 35

    Expert Comment

    by:TimYates
    Hmmmm...it should just work with log4j being in the classes directory (ignoring my previous comment) ;-)

    I am stumped as to why this isn't working :-(

    Bah!  Beaten at the last hurdle ;-)

    At least this is only a warning, so the "24 step plan" should work (just get a warning when it starts up) :-(

    Bah!

    Tim.
    0
     
    LVL 5

    Author Comment

    by:drnick
    i found a resource that seems to deal with the same problem,
    http://java2.5341.com/msg/32914.html,
    however, i don't quite catch the point of it,
    maybe because i'm installing and cursing and installing and whining for
    10 hours now.
    maybe you were right with your classpath-theory,
    and i just don't see.
    could you elaborate in short how i can check if classpath is
    correct?
    0
     
    LVL 35

    Expert Comment

    by:TimYates
    Hehehe, yeah...that says the same thing "put it in the classpath" ;-)

    Hmmm...have you tried

    webapps/axis/WEB-INF/lib

    ?

    (though it *should* work in

    webapps/axis/WEB-INF/classes

    :-(
    0
     
    LVL 5

    Author Comment

    by:drnick
    :-( still not working,
    where could i check the classpath?
    can i set it somehow?
    0
     
    LVL 35

    Expert Comment

    by:TimYates
    No, tomcat handles it...

    You could try copying it to

    tomcat/shared/classes

    or tomcat/shared/lib

    or tomcat/common/classes

    MAKE SURE THAT A FILE OF THE SAME NAME DOESN'T ALREADY EXIST IN THOSE DIRECTORIES

    Otherwise, you might get 2 warnings instead of 1 ;-)

    Tim
    0
     
    LVL 35

    Expert Comment

    by:TimYates
    you will have to restart tomcat as well, each time you move it :-(
    0
     
    LVL 5

    Author Comment

    by:drnick
    you know, if something like this totally refuses to work,
    i feat that this maybe indicates an other, more important error
    so i want to fix this for heavens sake
    0
     
    LVL 35

    Expert Comment

    by:TimYates
    > i feat that this maybe indicates an other, more important error

    Nah, this just means log4j isn't finding it's properties file ;-)

    So you can't control the logging...

    It isn't normally a biggie :-)

    Keep the faith ;-)

    Tim
    0
     
    LVL 5

    Author Comment

    by:drnick
    have done this already everytime :-)
    0
     
    LVL 5

    Author Comment

    by:drnick
    (to the previous post :-)
    0
     
    LVL 5

    Author Comment

    by:drnick
    harhar, got it hardcore solved:

    i unpacked the log4j-1.2.8.jar completely,
    put the log4j.properties inside and built a new
    log4j-1.2.8.jar.

    now it just says:

    Processing file deploy.wsdd
    <Admin>Done processing</Admin>

    :-)
    0
     
    LVL 5

    Author Comment

    by:drnick
    gonna give you the points anyway,
    and if an less hardcore method comes to your mind,
    just post it :-)
    0
     
    LVL 35

    Expert Comment

    by:TimYates
    Thanks!  Hee hee, what a hardcore bit of hackery :-D

    Glad it's working....I'll bookmark this question, and come back to it with the answer if ever I find it...

    Good luck with teaching everyone else :-D

    Tim
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Building “do-it-yourself” web sites has become an epidemic. There are so many blogs, web sites and even books that "teach" you how to build your web site in a few extremely simple and easy steps. Building a web site has become easier than boiling an…
    Accessibility and Usability are two concepts that seem to be closely related.  But, too many people seem to have a distorted perception of them. During last five years, those two words have come to the day-to-day work of almost every web develope…
    This video teaches users how to migrate an existing Wordpress website to a new domain.
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

    934 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now