我有一个包含ApplicationLifecycleListener.这样的bean:
package vanzylvi.test;
import weblogic.application.ApplicationLifecycleEvent;
import weblogic.application.ApplicationLifecycleListener;
public class TestApplicationListener extends ApplicationLifecycleListener {
public void preStart(ApplicationLifecycleEvent evt) {
System.out.println("preStart GO GO GO");
}
}
在我的weblogic-application.xml中
<?xml version="1.0" encoding="UTF-8"?>
<weblogic-application xmlns="http://www.bea.com/ns/weblogic/90">
<listener>
<listener-class>vanzylvi.test.TestApplicationListener</listener-class>
</listener>
</weblogic-application>
我永远无法激发preStart的热情,任何帮助将不胜感激.
解决方法:
我很确定问题是java.lang.ClassNotFoundException,因为我过去也遇到过同样的问题.为了对其进行修复,请编译TestApplicationListener类并将其放在EarContent / APP-INF / classes下.您的EarContent / APP-INF / classs应该包含vanzylvi / test / TestApplicationListener.class.
您的weblogic-application.xml和TestApplicationListener是正确的.
我希望这可以帮助你.