首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >OpenEJB忽略主题资源的配置属性

OpenEJB忽略主题资源的配置属性
EN

Stack Overflow用户
提问于 2013-08-16 19:46:57
回答 2查看 840关注 0票数 0

我正在尝试在OpenEJB上使用带有消息驱动bean的主题。因此,我将conf/openejb.xml编辑为:

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8"?>
<openejb>
    <Resource id="TrueUpdate" type="javax.jms.Topic">
        destination = TrueUpdate
        clientId = nevermind
    </Resource>
</openejb>

使用bin/openejb properties我得到:

代码语言:javascript
复制
# Resource(id=TrueUpdate)
# className: org.apache.activemq.command.ActiveMQTopic
# 
TrueUpdate = new://Resource?type=javax.jms.Topic
TrueUpdate.destination = TrueUpdate
TrueUpdate.clientId = nevermind

这个看起来很好。然而,在部署我的EAR文件时,我得到:

代码语言:javascript
复制
Exception: class org.apache.openejb.OpenEJBException: Unable to create activation spec: Invalid settings: subscriptionDurability cannot be set to: Durable when destinationType is set to javax.jms.Queue as it is only valid when destinationType is set to javax.jms.Topic. clientId must be set since durable subscription was requested.: Unable to create activation spec: Invalid settings: subscriptionDurability cannot be set to: Durable when destinationType is set to javax.jms.Queue as it is only valid when destinationType is set to javax.jms.Topic. clientId must be set since durable subscription was requested.
        at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:836)
        at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:546)
        at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:542)
        at org.apache.openejb.assembler.DeployerEjb.deploy(DeployerEjb.java:195)
        at org.apache.openejb.assembler.DeployerEjb.deploy(DeployerEjb.java:104)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)
        at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)
        at org.apache.openejb.security.internal.InternalSecurityInterceptor.invoke(InternalSecurityInterceptor.java:34)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)
        at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)
        at org.apache.openejb.cdi.CdiInterceptor.invoke(CdiInterceptor.java:126)
        at org.apache.openejb.cdi.CdiInterceptor.access$000(CdiInterceptor.java:42)
        at org.apache.openejb.cdi.CdiInterceptor$1.call(CdiInterceptor.java:63)
        at org.apache.openejb.cdi.CdiInterceptor.aroundInvoke(CdiInterceptor.java:69)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)
        at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)
        at org.apache.openejb.monitoring.StatsInterceptor.record(StatsInterceptor.java:176)
        at org.apache.openejb.monitoring.StatsInterceptor.invoke(StatsInterceptor.java:95)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)
        at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)
        at org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:138)
        at org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:239)
        at org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:191)
        at org.apache.openejb.server.ejbd.EjbRequestHandler.doEjbObject_BUSINESS_METHOD(EjbRequestHandler.java:290)
        at org.apache.openejb.server.ejbd.EjbRequestHandler.processRequest(EjbRequestHandler.java:140)
        at org.apache.openejb.server.ejbd.EjbDaemon.processEjbRequest(EjbDaemon.java:267)
        at org.apache.openejb.server.ejbd.EjbDaemon.service(EjbDaemon.java:191)
        at org.apache.openejb.server.ejbd.EjbServer.service(EjbServer.java:81)
        at org.apache.openejb.server.ejbd.KeepAliveServer$Session.service(KeepAliveServer.java:273)
        at org.apache.openejb.server.ejbd.KeepAliveServer$Session.access$1000(KeepAliveServer.java:192)
        at org.apache.openejb.server.ejbd.KeepAliveServer.service(KeepAliveServer.java:326)
        at org.apache.openejb.server.ejbd.EjbServer.service(EjbServer.java:72)
        at org.apache.openejb.server.ServerServiceFilter.service(ServerServiceFilter.java:64)
        at org.apache.openejb.server.ServerServiceFilter.service(ServerServiceFilter.java:64)
        at org.apache.openejb.server.ServiceStats.service(ServiceStats.java:54)
        at org.apache.openejb.server.ServerServiceFilter.service(ServerServiceFilter.java:64)
        at org.apache.openejb.server.ServiceLogger.service(ServiceLogger.java:92)
        at org.apache.openejb.server.ServerServiceFilter.service(ServerServiceFilter.java:64)
        at org.apache.openejb.server.ServicePool.access$201(ServicePool.java:35)
        at org.apache.openejb.server.ServicePool$3.run(ServicePool.java:174)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:724)
Caused by: org.apache.openejb.OpenEJBException: Error deploying 'MessageListenerBean'.  Exception: class org.apache.openejb.OpenEJBException: Unable to create activation spec: Invalid settings: subscriptionDurability cannot be set to: Durable when destinationType is set to javax.jms.Queue as it is only valid when destinationType is set to javax.jms.Topic. clientId must be set since durable subscription was requested.: Unable to create activation spec: Invalid settings: subscriptionDurability cannot be set to: Durable when destinationType is set to javax.jms.Queue as it is only valid when destinationType is set to javax.jms.Topic. clientId must be set since durable subscription was requested.
        at org.apache.openejb.assembler.classic.Assembler.startEjbs(Assembler.java:974)
        at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:730)
        ... 58 more
Caused by: org.apache.openejb.OpenEJBException: Unable to create activation spec: Invalid settings: subscriptionDurability cannot be set to: Durable when destinationType is set to javax.jms.Queue as it is only valid when destinationType is set to javax.jms.Topic. clientId must be set since durable subscription was requested.
        at org.apache.openejb.core.mdb.MdbContainer.createActivationSpec(MdbContainer.java:251)
        at org.apache.openejb.core.mdb.MdbContainer.deploy(MdbContainer.java:136)
        at org.apache.openejb.assembler.classic.Assembler.startEjbs(Assembler.java:961)
        ... 59 more
Caused by: javax.resource.spi.InvalidPropertyException: Invalid settings: subscriptionDurability cannot be set to: Durable when destinationType is set to javax.jms.Queue as it is only valid when destinationType is set to javax.jms.Topic. clientId must be set since durable subscription was requested.
        at org.apache.activemq.ra.ActiveMQActivationSpec.validate(ActiveMQActivationSpec.java:136)
        at org.apache.openejb.core.mdb.MdbContainer.createActivationSpec(MdbContainer.java:229)
        ... 61 more

这是我的豆子:

代码语言:javascript
复制
@MessageDriven(mappedName = "TrueUpdate",
        activationConfig = {
            @ActivationConfigProperty(propertyName = "messageSelector",
                                      propertyValue = "manager = true"),
            @ActivationConfigProperty(propertyName = "destinationType",
                                      propertyValue = "javax.jms.Topic"),
            @ActivationConfigProperty(propertyName = "destination",
                                      propertyValue = "TrueUpdate"),
            @ActivationConfigProperty(propertyName = "subscriptionDurability",
                                      propertyValue = "Durable"),
            @ActivationConfigProperty(propertyName = "subscriptionName",
                                      propertyValue = "TrueUpdate Manager"),
        })
public class MessageListenerBean implements MessageListener {
    ...
}

我在这里做错了什么?

EN

回答 2

Stack Overflow用户

发布于 2013-12-04 16:33:23

我遇到了同样的问题,我尝试了以下方法。然后它就能工作了:

  1. set clientId

@ "clientIdxxx")

  • update配置"DestinationType"

(propertyName = "clientId",propertyValue =ActivationConfigProperty "destinationType“to ActivationConfigProperty

票数 1
EN

Stack Overflow用户

发布于 2019-03-27 18:45:24

删除mappedName配置,否则openEjb会默认为队列而不是Topic。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18272597

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档