facebook

WebLogic 9.0 and log4j [Closed]

  1. MyEclipse Archived
  2.  > 
  3. Application Servers and Deployment
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #234111 Reply

    jheadley
    Member

    I am having another issue with MyEclipse and WebLogic 9 involving log4j. When I use MyEclipse to start WL 9, I receive this message:

    log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
    log4j:WARN Please initialize the log4j system properly.

    However, when I start WL 9 using BEA’s startup script (C:\bea\user_projects\domains\base_domain\startWebLogic.cmd on my machine) I get the logging messages as expected. The log4j.properties file is being deployed to the web-inf\classes folder and the log4j jar is in web-inf\lib if that matters.

    Below is the what I see at the beginning when starting WL 9 with BEA’s script:

    .
    .
    JAVA Memory arguments: -Xms256m -Xmx512m -XX:CompileThreshold=8000 -XX:PermSize=
    32m  -XX:MaxPermSize=128m
    .
    WLS Start Mode=Development
    .
    CLASSPATH=;C:\bea\patch_weblogic901\profiles\default\sys_manifest_classpath\webl
    ogic_patch.jar;C:\bea\JDK150~1\lib\tools.jar;C:\bea\WEBLOG~2\server\lib\weblogic
    _sp.jar;C:\bea\WEBLOG~2\server\lib\weblogic.jar;;C:\bea\WEBLOG~2\common\eval\poi
    ntbase\lib\pbclient51.jar;C:\bea\WEBLOG~2\server\lib\xqrl.jar;;C:\bea\WEBLOG~2\i
    ntegration\lib\util.jar;
    .
    PATH=C:\bea\WEBLOG~2\server\native\win\32;C:\bea\WEBLOG~2\server\bin;C:\bea\JDK1
    50~1\jre\bin;C:\bea\JDK150~1\bin;C:\oracle\ora81\bin;C:\oracle\ora81\jlib;C:\Pro
    gram Files\CMS\ESRD\SIMS Utilities;C:\Program Files\Seagate Software\NOTES\;C:\P
    rogram Files\Seagate Software\NOTES\DATA\;C:\PROGRA~1\CMS\ESRD\VISION;C:\PROGRA~
    1\CMS\ESRD\Common;C:\PROGRA~1\CMS\ESRD\SIMSUT~1;C:\WINNT\system32;C:\WINNT;C:\WI
    NNT\System32\Wbem;C:\Program Files\Common Files\Adaptec Shared\System;C:\Program
     Files\Microsoft SQL Server\80\Tools\BINN;C:\Program Files\Microsoft SQL Server\
    80\Tools\Binn\;C:\MSSQL7\BINN;C:\java\j2sdk1.4.2_08\bin;C:\Program Files\Microso
    ft SQL Server 2000 Driver for JDBC\lib;C:\java\apache-ant-1.6.5\bin;C:\java\mave
    n-1.0.2\bin;C:\Program Files\Microsoft Visual Studio\Common\Tools\WinNT;C:\Progr
    am Files\Microsoft Visual Studio\Common\MSDev98\Bin;C:\Program Files\Microsoft V
    isual Studio\Common\Tools;C:\Program Files\Microsoft Visual Studio\VC98\bin;C:\P
    rogram Files\Microsoft SQL Server 2000 Driver for JDBC\lib;C:\bea\WEBLOG~2\serve
    r\native\win\32\oci920_8
    .
    ***************************************************
    *  To start WebLogic Server, use a username and   *
    *  password assigned to an admin-level user.  For *
    *  server administration, use the WebLogic Server *
    *  console at http:\\hostname:port\console        *
    ***************************************************
    starting weblogic with Java version:
    java version "1.5.0_03"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_03-b07)
    Java HotSpot(TM) Client VM (build 1.5.0_03-b07, mixed mode)
    Starting WLS with line:
    C:\bea\JDK150~1\bin\java -client   -Xms256m -Xmx512m -XX:CompileThreshold=8000 -
    XX:PermSize=32m  -XX:MaxPermSize=128m  -Xverify:none  -da -Dplatform.home=C:\bea
    \WEBLOG~2 -Dwls.home=C:\bea\WEBLOG~2\server -Dwli.home=C:\bea\WEBLOG~2\integrati
    on  -Dweblogic.management.discover=true -Dweblogic.ProductionModeEnabled=  -Dwlw
    .iterativeDev= -Dwlw.testConsole= -Dwlw.logErrorsToConsole= -Dweblogic.ext.dirs=
    C:\bea\patch_weblogic901\profiles\default\sysext_manifest_classpath -Dweblogic.N
    ame=AdminServer -Djava.security.policy=C:\bea\WEBLOG~2\server\lib\weblogic.polic
    y   weblogic.Server

    Thanks,
    Jeff

    What operating system and version are you running? Windows 2000

    What Eclipse version and build id are you using? (Help > About Eclipse Platform) Version: 3.1.0
    Build id: I20050627-1435

    – Was Eclipse freshly installed for MyEclipse? Yes

    – Are any other external plugins installed? Subclipse

    – How many plugins in the <eclipse>/plugins directory are like org.eclipse.pde.* 9

    What MyEclipse version are you using? (Help > About Eclipse Platform > Features) Version: 3.9.211
    Build id: 20050627-4.0-Milestone-2

    What JDK version are you using to run Eclipse? (java -version) 1.5
    What JDK version are you using to launch your application server? 1.5

    What steps did you take that resulted in the issue? Configured WL 9

    #234120 Reply

    Riyad Kalla
    Member

    What is the contents of the log4j.properties file?

    #234141 Reply

    jheadley
    Member

    Below is the log4j.properties file. It works fine starting Weblogic 8.1.4 through MyEclipse and when we use BEA’s startup script for the 9.0 server.

    log4j.rootCategory=INFO, 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=[%t] %-5p %c - %m%n
    #234142 Reply

    Riyad Kalla
    Member

    I’m not that versed with Log4j configuration, but your original error was pertaining to a Spring class:

    log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).

    do you explicitly need to put something in the property file for it? Does BEA ship any of it’s own libs taht would interfere with this? Spring, Log4j or commons-logging?

    #234143 Reply

    jheadley
    Member

    No, in Weblogic 8.1 I just added the log4j.properties file to the classes folder and and that was all that was needed for spring/hibernate to log their messages when starting the app server through MyEclipse. When I started trying to run weblogic 9.0 through MyEclipse I got the warning message. However, when I use BEA’s script to start the app server; I get those log messages. So what I’m saying is; there is something different about how MyEclipse starts up the app server that is preventing log4j from initializing.

    #234147 Reply

    Scott Anderson
    Participant

    From your Classpath, you’re not running only WLS9 server; you’re running WebLogic Integration as well and this is the cause of the issue as the paths are set up differently between the two products.

    …C:\bea\WEBLOG~2\integration\lib\util.jar;

    To support integration, you’ll need to augment the classpath with the additional jars, like the one in the quote above, that are unique to WebLogic integration at Window > Preferences > MyEclipse > Application Servers > WebLogic > Paths. In prepend to classpath, add “C:\bea\patch_weblogic901\profiles\default\sys_manifest_classpath\weblogic_patch.jar” and in append to classpath add “C:\bea\WEBLOG~2\integration\lib\util.jar”

    You’ll also need to add “-Dweblogic.ext.dirs=C:\bea\patch_weblogic901\profiles\default\sysext_manifest_classpath” on the JDK page.

    #234149 Reply

    jheadley
    Member

    I see those paths too when I run BEA’s startup script, but those paths don’t exist. This is just a default installation. Maybe they’re there just in case the user has Integration? Anyway, those paths don’t exist on my machine; but I tried adding them to the options anyway. It didn’t fix it. If it helps, I have pasted the entire text of the startup script BEA installs (C:\bea\user_projects\domains\base_domain\bin\startWebLogic.cmd on my machine). Again, I just did the basic simple install and created a basic domain.

    @ECHO OFF
    
    @REM WARNING: This file is created by the Configuration Wizard.
    @REM Any changes to this script may be lost when adding extensions to this configuration.
    
    SETLOCAL
    
    @REM --- Start Functions ---
    
    GOTO :ENDFUNCTIONS
    
    :stopAll
        @REM We separate the stop commands into a function so we are able to use the trap command in Unix (calling a function) to stop these services
        if NOT "X%ALREADY_STOPPED%"=="X" (
            GOTO :EOF
        )
        @REM STOP POINTBASE (only if we started it)
        if "%POINTBASE_FLAG%"=="true" (
            echo Stopping Pointbase server...
            call "%WL_HOME%\common\bin\stopPointBase.cmd" -port=%POINTBASE_PORT% -name=%POINTBASE_DBNAME%  2>&1 >"%DOMAIN_HOME%\pointbaseShutdown.log" 
    
            echo Pointbase server stopped.
        )
    
        set ALREADY_STOPPED=true
        @REM Restore IP configuration the node manager starts IP Migration
        if NOT "%SERVER_IP%"=="" (
            call "%WL_HOME%\common\bin\wlsifconfig.cmd" -removeif "%IFNAME%" "%SERVER_IP%"
        )
    GOTO :EOF
    
    
    :ENDFUNCTIONS
    
    @REM --- End Functions ---
    
    @REM *************************************************************************
    @REM This script is used to start WebLogic Server for this domain.
    @REM 
    @REM To create your own start script for your domain, you can initialize the
    @REM environment by calling @USERDOMAINHOME\setDomainEnv.
    @REM 
    @REM setDomainEnv initializes or calls commEnv to initialize the following variables:
    @REM 
    @REM BEA_HOME       - The BEA home directory of your WebLogic installation.
    @REM JAVA_HOME      - Location of the version of Java used to start WebLogic
    @REM                  Server.
    @REM JAVA_VENDOR    - Vendor of the JVM (i.e. BEA, HP, IBM, Sun, etc.)
    @REM PATH           - JDK and WebLogic directories are added to system path.
    @REM WEBLOGIC_CLASSPATH
    @REM                - Classpath needed to start WebLogic Server.
    @REM JAVA_VM        - The java arg specifying the VM to run.  (i.e.
    @REM                - server, -hotspot, etc.)
    @REM USER_MEM_ARGS  - The variable to override the standard memory arguments
    @REM                  passed to java.
    @REM PRODUCTION_MODE - The variable that determines whether Weblogic Server is started in production mode.
    @REM POINTBASE_HOME - Point Base home directory.
    @REM POINTBASE_CLASSPATH
    @REM                - Classpath needed to start PointBase.
    @REM 
    @REM Other variables used in this script include:
    @REM SERVER_NAME    - Name of the weblogic server.
    @REM JAVA_OPTIONS   - Java command-line options for running the server. (These
    @REM                  will be tagged on to the end of the JAVA_VM and
    @REM                  MEM_ARGS)
    @REM 
    @REM For additional information, refer to the WebLogic Server Administration
    @REM Console Online Help(http://e-docs.bea.com/wls/docs90/ConsoleHelp/startstop.html).
    @REM *************************************************************************
    
    @REM Call setDomainEnv here.
    
    set DOMAIN_HOME=C:\bea\user_projects\domains\base_domain
    for %%i in ("%DOMAIN_HOME%") do set DOMAIN_HOME=%%~fsi
    
    call "%DOMAIN_HOME%\bin\setDomainEnv.cmd" %*
    
    set SAVE_JAVA_OPTIONS=%JAVA_OPTIONS%
    
    set SAVE_CLASSPATH=%CLASSPATH%
    
    @REM Start PointBase
    
    set PB_DEBUG_LEVEL=0
    
    if "%POINTBASE_FLAG%"=="true" (
        call "%WL_HOME%\common\bin\startPointBase.cmd" -port=%POINTBASE_PORT% -debug=%PB_DEBUG_LEVEL% -console=false -background=true -ini=%DOMAIN_HOME%\pointbase.ini  2>&1 >"%DOMAIN_HOME%\pointbase.log" 
    
    )
    
    set JAVA_OPTIONS=%SAVE_JAVA_OPTIONS%
    
    set SAVE_JAVA_OPTIONS=
    
    set CLASSPATH=%SAVE_CLASSPATH%
    
    set SAVE_CLASSPATH=
    
    if "%PRODUCTION_MODE%"=="true" (
        set WLS_DISPLAY_MODE=Production
    ) else (
        set WLS_DISPLAY_MODE=Development
    )
    
    if NOT "%WLS_USER%"=="" (
        set JAVA_OPTIONS=%JAVA_OPTIONS% -Dweblogic.management.username=%WLS_USER%
    )
    
    if NOT "%WLS_PW%"=="" (
        set JAVA_OPTIONS=%JAVA_OPTIONS% -Dweblogic.management.password=%WLS_PW%
    )
    
    set CLASSPATH=%CLASSPATH%;%MEDREC_WEBLOGIC_CLASSPATH%
    
    echo .
    
    echo .
    
    echo JAVA Memory arguments: %MEM_ARGS%
    
    echo .
    
    echo WLS Start Mode=%WLS_DISPLAY_MODE%
    
    echo .
    
    echo CLASSPATH=%CLASSPATH%
    
    echo .
    
    echo PATH=%PATH%
    
    echo .
    
    echo ***************************************************
    
    echo *  To start WebLogic Server, use a username and   *
    
    echo *  password assigned to an admin-level user.  For *
    
    echo *  server administration, use the WebLogic Server *
    
    echo *  console at http:\\hostname:port\console        *
    
    echo ***************************************************
    
    @REM Set up IP Migration related variables.
    
    @REM Set interface name.
    
    if NOT "%Interface%"=="" (
        set IFNAME=%Interface%
    ) else (
        set IFNAME=
    )
    
    @REM Set IP Mask.
    
    if NOT "%NetMask%"=="" (
        set IPMASK=%NetMask%
    ) else (
        set IPMASK=
    )
    
    @REM Perform IP Migration if SERVER_IP is set by node manager.
    
    if NOT "%SERVER_IP%"=="" (
        call "%WL_HOME%\common\bin\wlsifconfig.cmd" -addif "%IFNAME%" "%SERVER_IP%" "%IPMASK%"
    )
    
    @REM START WEBLOGIC
    
    echo starting weblogic with Java version:
    
    %JAVA_HOME%\bin\java %JAVA_VM% -version
    
    if "%WLS_REDIRECT_LOG%"=="" (
        echo Starting WLS with line:
        echo %JAVA_HOME%\bin\java %JAVA_VM% %MEM_ARGS% %JAVA_OPTIONS% -Dweblogic.Name=%SERVER_NAME% -Djava.security.policy=%WL_HOME%\server\lib\weblogic.policy  %PROXY_SETTINGS% %SERVER_CLASS%
        %JAVA_HOME%\bin\java %JAVA_VM% %MEM_ARGS% %JAVA_OPTIONS% -Dweblogic.Name=%SERVER_NAME% -Djava.security.policy=%WL_HOME%\server\lib\weblogic.policy %PROXY_SETTINGS% %SERVER_CLASS%
    ) else (
        echo Redirecting output from WLS window to %WLS_REDIRECT_LOG%
        %JAVA_HOME%\bin\java %JAVA_VM% %MEM_ARGS% %JAVA_OPTIONS% -Dweblogic.Name=%SERVER_NAME% -Djava.security.policy=%WL_HOME%\server\lib\weblogic.policy %PROXY_SETTINGS% %SERVER_CLASS%  2>&1 >"%WLS_REDIRECT_LOG%" 
    )
    
    CALL :stopAll
    
    popd
    
    @REM Exit this script only if we have been told to exit.
    
    if "%doExitFlag%"=="true" (
        exit
    )
    
    
    
    ENDLOCAL
    #234163 Reply

    Scott Anderson
    Participant

    I kicked this to development and it looks like BEA made some significant changes to the way WLS 9 is started between the way the final beta started up, which we used to build the connector in M2, and the final version that they just shipped. We’ve already made the required modifications internally and the fixed version will ship with 4.0M3 in about a week. Thanks for bringing this to our attention and sorry for the inconvenience in the interim

    #234164 Reply

    jheadley
    Member

    No problem, I suspected that is what happened. We can get by for a week.

    Thanks,
    Jeff

    #235107 Reply

    jheadley
    Member

    M3 is working great now. Thanks for fixing it.

    #235109 Reply

    Scott Anderson
    Participant

    No problem. Thanks for making us aware of the issue so we could! 🙂

Viewing 11 posts - 1 through 11 (of 11 total)
Reply To: WebLogic 9.0 and log4j [Closed]

You must be logged in to post in the forum log in