javaweb测试HttpSessionBindingListener接口无法部署(部署错误)

来源:互联网 发布:js获取当前日期前一天 编辑:程序博客网 时间:2024/05/16 10:44

今天实验了HttpSessionBindingListener接口,但是单独实现这个接口后却无法部署到weblogic

提示大概如下的错误:

<BEA-101164> <User defined class com.xxx.xxx is not a listener, as it does not implement the correct interface(s).> <Error> <HTTP> <BEA-101163> <Could not load user defined listener: com.xxx.xxxjava.lang.IllegalArgumentException: [HTTP:101164]User defined class com.xxx.xxx is not a listener, as it does not implement the > Error is: "weblogic.application.ModuleException: java.lang.IllegalArgumentException: [HTTP:101164]User defined class com.xxx.xxx is not a listener, as it does not implement the correct interface(s)."weblogic.application.ModuleException: java.lang.IllegalArgumentException: [HTTP:101164]User defined class com.xxx.xxx is not a listener, as it does not implement the correct interface(s).Caused By: java.lang.IllegalArgumentException: [HTTP:101164]User defined class com.xxx.xxx is not a listener, as it does not implement the correct interface(s).> <Error> <Deployer> <BEA-149202> <Encountered an exception while attempting to commit the 7 task for the application "_auto_generated_ear_" on [partition-name: DOMAIN].> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating start task for application "_auto_generated_ear_".> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004weblogic.application.ModuleException: java.lang.IllegalArgumentException: [HTTP:101164]User defined class com.xxx.xxx is not a listener, as it does not implement the correct interface(s).Caused By: java.lang.IllegalArgumentException: [HTTP:101164]User defined class com.xxx.xxx is not a listener, as it does not implement the correct interface(s).

最后解决方案。将我实现HttpSessionBindingListener接口的类再实现一个接口,我是再实现了HttpSessionListener接口。最后就成功部署到了weblogic并运行了。具体问题的原因我也是不知道。

2016-4-24修改:今天知道了又有一个解决方案,就是如果只继承HttpSessionBindingListener接口的话,不需要在web.xml中配置listener。如果配置就会出现上述错误。

1 0
原创粉丝点击