开发者

Setting "java.util.logging.manager" during weblogic startup gives ClassNotFoundException

开发者 https://www.devze.com 2023-03-01 09:59 出处:网络
In-order to achieve custom loggin , am overriding java.util.logging.LogManager. Now i need to point \"java.util.logging.manager\" system property to my CustomLogManager class.

In-order to achieve custom loggin , am overriding java.util.logging.LogManager. Now i need to point "java.util.logging.manager" system property to my CustomLogManager class.

In jdev , its possobie by setting java options in project properties. "-Djava.util.logging.manager=project8.CustomLogManager" .

I edited the startWebLogic.sh , and added the same.

# START WEBLOGIC

echo "starting weblogic with Java version:"

${JAVA_HOME}/bin/java ${JAVA_VM} -version

if [ "${WLS_REDIRECT_LOG}" = "" ] ; then
    echo "Starting WLS with line:"
    echo "${JAVA_HOME}/bin/java ${JAVA_VM} ${MEM_ARGS} -Djava.util.logging.manager=project8.CustomLogManager -Dweblogic.Name=${SERVER_NAME} -Djava.security.policy=${WL_HOME}/server/lib/weblogic.policy ${JAVA_OPTIONS} ${PROXY_SETTINGS} ${SERVER_CLASS}"

But while starting the admin server ,am getting this error..

 weblogic.Server
Could not load Logmanager "project8.CustomLogManager "
java.lang.ClassNotFoundException: project8.CustomLogManager 
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:303)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
        at java.util.logging.LogManager$1.run(LogManager.java:167)
        at java.util.logging.LogManager.<clinit>(LogManager.java:156)
        at java.util.logging.Logger.getAnonymousLogger(Logger.java:342)
        at weblogic.kernel.KernelLogManager.createClientLogger(KernelLogManager.java:44)
        at weblogic.kernel.KernelLogManager.access$000(KernelLogManager.java:17)
        at weblogic.kernel.KernelLogManager$LoggerMaker.<clinit>(KernelLogManager.java:20)
        at weblogic.kernel.KernelLogManager.getLogger(KernelLogManager.java:26)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at weblogic.logging.MessageLogger.log(MessageLogger.java:96)
        at weblogic.logging.MessageLogger.log(MessageLogger.java:112)
        at weblogic.logging.WLMessageLogger.log(WLMessageLogger.java:53)
        at weblogic.kernel.T3SrvrLogger.logDomainLibPath(T3SrvrLogger.j开发者_开发技巧ava:2440)
        at weblogic.Server.appendToClassPath(Server.java:129)
        at weblogic.Server.intializeClassloader(Server.java:140)
        at weblogic.Server.main(Server.java:67)

But at the same time , right after that I can see my CustomLogManager.jar getting imported. I have the CustomLogManager.jar , under /domain-folder/bin/ .

<Notice> <WebLogicServer> <BEA-000395> <Following extensions directory contents added to the end of the classpath:
/export/......../CustomLogManager.jar

So any idea how I can avoid getting ClassNotFound error.?

Thanks in advance


Include your CustomLogManager.jar in your WEBLOGIC_CLASSPATH

0

精彩评论

暂无评论...
验证码 换一张
取 消