在用JDeveloper向weblogic部署一个EJB应用时发生如下错误:
weblogic.management.DeploymentException: at weblogic.application.internal.flow.BaseLifecycleFlow$CreateListenerAction.run(BaseLifecycleFlow.java:176) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120) at weblogic.application.internal.flow.BaseLifecycleFlow$BaseAction.invoke(BaseLifecycleFlow.java:104) at weblogic.application.internal.flow.HeadLifecycleFlow.createListener(HeadLifecycleFlow.java:117) Truncated. see log file for complete stacktrace Caused By: java.lang.ClassNotFoundException: oracle.webcenter.lifecycle.listener.FeatureMetricApplicationListener at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:297) at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:270) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:179) Truncated. see log file for complete stacktrace > <2014-2-10 下午01时25分47秒 CST> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating deploy task for application 'j2ee-app'.> <2014-2-10 下午01时25分47秒 CST> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004 weblogic.management.DeploymentException: at weblogic.application.internal.flow.BaseLifecycleFlow$CreateListenerAction.run(BaseLifecycleFlow.java:176) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120) at weblogic.application.internal.flow.BaseLifecycleFlow$BaseAction.invoke(BaseLifecycleFlow.java:104) at weblogic.application.internal.flow.HeadLifecycleFlow.createListener(HeadLifecycleFlow.java:117) Truncated. see log file for complete stacktrace Caused By: java.lang.ClassNotFoundException: oracle.webcenter.lifecycle.listener.FeatureMetricApplicationListener at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:297) at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:270) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:179) Truncated. see log file for complete stacktrace >
JDeveloper在生成web.xml时,有时候发神经加一些莫名其妙的监听器,因此如果出现Lisenter无法加载首先想到的就是修改web.xml文件,去掉不必要的监听器。
在这个应用中没有web.xml文件,但有一个weblogic-application.xml文件,文件里面定义了日志中出现的监听器ADFApplicationLifecycleListener
<listener> <listener-class>oracle.adf.share.weblogic.listeners.ADFApplicationLifecycleListener</listener-class> </listener> <listener> <listener-class>oracle.mds.lcm.weblogic.WLLifecycleListener</listener-class> </listener> <listener> <listener-class>oracle.webcenter.lifecycle.listener.FeatureMetricApplicationListener</listener-class> </listener>
去掉该监听器,顺利部署