我将cxf-dosgi-ri-singlebundle-distribution-1.3.jar
的捆绑包部署在一个独立的Felix框架实例中。
但是,如果我在glassfish 3.1.2中部署捆绑包,那么在设置glasfish域时会出现此错误:
[#|2012-03-10T22:55:29.310+0100|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=21;_ThreadName=pool-7-thread-2;|Exception in thread "pool-7-thread-2" |#]
[#|2012-03-10T22:55:29.312+0100|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=21;_ThreadName=pool-7-thread-2;|java.lang.ClassCastException:
org.apache.felix.eventadmin.impl.security.EventAdminSecurityDecorator cannot be cast to org.osgi.service.event.EventAdmin
at org.apache.cxf.dosgi.dsw.service.EventAdminHelper.getEventAdmins(EventAdminHelper.java:127)
at org.apache.cxf.dosgi.dsw.service.EventAdminHelper.notifyEventAdmin(EventAdminHelper.java:97)
at org.apache.cxf.dosgi.dsw.service.EventProducer.publishNotifcation(EventProducer.java:62)
at org.apache.cxf.dosgi.dsw.service.EventProducer.publishNotifcation(EventProducer.java:47)
at org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminCore.exportService(RemoteServiceAdminCore.java:265)
at org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminInstance$1.run(RemoteServiceAdminInstance.java:72)
at org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminInstance$1.run(RemoteServiceAdminInstance.java:67)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminInstance.exportService(RemoteServiceAdminInstance.java:66)
at org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminInstance.exportService(RemoteServiceAdminInstance.java:38)
at org.apache.cxf.dosgi.topologymanager.TopologyManager$2.run(TopologyManager.java:267)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
答案 0 :(得分:0)
EventAdminHelper可能连接到与GlassFish使用的事件管理服务不同的org.osgi.service.event包。检查封装布线详细信息,看看它们实际上是否使用相同的封装。