设置“java.util.logging.manager”在 weblogic 启动期间给出 ClassNotFoundException

发布于 2024-11-04 03:20:10 字数 2948 浏览 5 评论 0原文

为了实现自定义 loggin ,我重写了 java.util.logging.LogManager 。 现在我需要将“java.util.logging.manager”系统属性指向我的 CustomLogManager 类。

在 jdev 中,可以通过在项目属性中设置 java 选项来实现。 “-Djava.util.logging.manager=project8.CustomLogManager”。

我编辑了 startWebLogic.sh ,并添加了相同的内容。

# 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}"

但是在启动管理服务器时,出现此错误。

 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.java:2440)
        at weblogic.Server.appendToClassPath(Server.java:129)
        at weblogic.Server.intializeClassloader(Server.java:140)
        at weblogic.Server.main(Server.java:67)

但与此同时,在那之后我可以看到我的 CustomLogManager.jar 被导入。 我有 CustomLogManager.jar ,位于 /domain-folder/bin/ 下。

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

那么知道如何避免出现 ClassNotFound 错误吗?

提前致谢

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.java: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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不醒的梦 2024-11-11 03:20:10

将 CustomLogManager.jar 包含在 WEBLOGIC_CLASSPATH 中

Include your CustomLogManager.jar in your WEBLOGIC_CLASSPATH

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文