geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephan Mehlhase <s.mehlh...@googlemail.com>
Subject Re: Message Driven Bean is not receiving messages
Date Thu, 27 Aug 2009 13:04:07 GMT
Hi everyone,

I think I got it.

The queue's name was different from its physical name and the geronimo
activemq environment was kind of trashed - so I reinstalled geronimo
and changed the names such that they match. It seems to work now.

So I had two problems:

1. Geronimo did not clean up the existing queues if the rar is
uninstalled in the webfrontend (using the J2EE Connectors module). Is
there any additional step needed to also clean up the mbeans of these
queues? (Somehow related: Why isn't it possible to edit the JMS
Resources?)
2. The name and the physical names of the queues have to match. If
they don't the EJB will consume the messages of the queue named like
the name and thus not receiving the messages from the producer which
will happily enqueue messages into a queue named like the physical
name of the queue. Is this a bug or did I again do something wrong in
the declaration where to drop the messages?
Both "problems" can be seen with JConsole.

Best,
Stephan

On Wed, Aug 26, 2009 at 10:26, Stephan
Mehlhase<s.mehlhase@googlemail.com> wrote:
> Hi,
>
> Okay, so I tried the Example from the documentation. It works out of
> the box. I then tried to change to the message queue I created and it
> stopped working - so I guess something is wrong there. So here is the
> deployment plan of the JMS Resources I created:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2">
>    <dep:environment
> xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2">
>        <dep:moduleId>
>            <dep:groupId>console.jms</dep:groupId>
>            <dep:artifactId>Test</dep:artifactId>
>            <dep:version>1.0</dep:version>
>            <dep:type>rar</dep:type>
>        </dep:moduleId>
>        <dep:dependencies>
>            <dep:dependency>
>                <dep:groupId>org.apache.geronimo.configs</dep:groupId>
>                <dep:artifactId>activemq-broker</dep:artifactId>
>                <dep:type>car</dep:type>
>            </dep:dependency>
>        </dep:dependencies>
>    </dep:environment>
>    <resourceadapter>
>        <resourceadapter-instance>
>            <resourceadapter-name>Test</resourceadapter-name>
>            <nam:workmanager
> xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2">
>                <nam:gbean-link>DefaultWorkManager</nam:gbean-link>
>            </nam:workmanager>
>        </resourceadapter-instance>
>        <outbound-resourceadapter>
>            <connection-definition>
>
> <connectionfactory-interface>javax.jms.ConnectionFactory</connectionfactory-interface>
>                <connectiondefinition-instance>
>                    <name>TestFactory</name>
>
> <implemented-interface>javax.jms.QueueConnectionFactory</implemented-interface>
>
> <implemented-interface>javax.jms.TopicConnectionFactory</implemented-interface>
>                    <connectionmanager>
>                        <xa-transaction>
>                            <transaction-caching/>
>                        </xa-transaction>
>                        <single-pool>
>                            <match-one/>
>                        </single-pool>
>                    </connectionmanager>
>                </connectiondefinition-instance>
>            </connection-definition>
>        </outbound-resourceadapter>
>    </resourceadapter>
>    <adminobject>
>        <adminobject-interface>javax.jms.Queue</adminobject-interface>
>        <adminobject-class>org.apache.activemq.command.ActiveMQQueue</adminobject-class>
>        <adminobject-instance>
>            <message-destination-name>TestQueue</message-destination-name>
>            <config-property-setting
> name="PhysicalName">testqueue</config-property-setting>
>        </adminobject-instance>
>    </adminobject>
>    <adminobject>
>        <adminobject-interface>javax.jms.Topic</adminobject-interface>
>        <adminobject-class>org.apache.activemq.command.ActiveMQTopic</adminobject-class>
>    </adminobject>
> </connector>
>
> I basically just left the defaults in it. However, the Servlet seems
> to work correctly as I see the following in the logs on hitting
> submit:
>
> 2009-08-26 10:17:13,713 DEBUG [ActiveMQSession] Sending message:
> ActiveMQTextMessage {commandId = 0, responseRequired = false,
> messageId = ID:yoda-55927-1251270725979-3:25:1:1:4,
> originalDestination = null, originalTransactionId = null, producerId =
> ID:yoda-55927-1251270725979-3:25:1:1, destination = queue://testqueue,
> transactionId = null, expiration = 0, timestamp = 1251274633713,
> arrival = 0, correlationId = null, replyTo = null, persistent = true,
> type = null, priority = 4, groupID = null, groupSequence = 0,
> targetConsumerId = null, compressed = false, userID = null, content =
> null, marshalledProperties = null, dataStructure = null,
> redeliveryCounter = 0, size = 0, properties = null, readOnlyProperties
> = true, readOnlyBody = true, droppable = false, text = userid:ghjfgh}
> 2009-08-26 10:17:13,714 DEBUG [testqueue] No subscriptions registered,
> will not dispatch message at this time.
>
> So the message arrives at the queue but won't be dispatched because my
> EJB is not registered. The plan for the EJB now looks like:
>
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <openejb-jar xmlns="http://www.openejb.org/xml/ns/openejb-jar-2.2"
>        xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2"
> xmlns:pkgen="http://www.openejb.org/xml/ns/pkgen-2.0"
>        xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.2"
> xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2">
>        <sys:environment>
>                <sys:moduleId>
>                        <sys:groupId>default</sys:groupId>
>                        <sys:artifactId>MessageDrivenBean</sys:artifactId>
>                        <sys:version>1.0</sys:version>
>                        <sys:type>car</sys:type>
>                </sys:moduleId>
>                <sys:dependencies>
>                        <sys:dependency>
>                                <sys:groupId>console.jms</sys:groupId>
>                                <sys:artifactId>Test</sys:artifactId>
>                                <sys:version>1.0</sys:version>
>                                <sys:type>rar</sys:type>
>                        </sys:dependency>
>                </sys:dependencies>
>        </sys:environment>
>        <enterprise-beans>
>                <message-driven>
>                        <ejb-name>AdminMDB</ejb-name>
>                        <nam:resource-adapter>
>                                <nam:resource-link>Test</nam:resource-link>
>                        </nam:resource-adapter>
>                        <activation-config>
>                                <activation-config-property>
>                                        <activation-config-property-name>
>                                                destination
>                                        </activation-config-property-name>
>                                        <activation-config-property-value>
>                                                TestQueue
>                                        </activation-config-property-value>
>                                </activation-config-property>
>                                <activation-config-property>
>                                        <activation-config-property-name>
>                                                destinationType
>                                        </activation-config-property-name>
>                                        <activation-config-property-value>
>                                                javax.jms.Queue
>                                        </activation-config-property-value>
>                                </activation-config-property>
>                        </activation-config>
>                </message-driven>
>        </enterprise-beans>
> </openejb-jar>
>
> (Sorry for spamming whole XML files here, I'm just not sure what is
> relevant for the problem and what isn't)
>
> The annotations of the MDB has been changed to
> @MessageDriven(name="AdminMDB", activationConfig = {
>            @ActivationConfigProperty(propertyName="destinationType",
> propertyValue="javax.jms.Queue"),
>            @ActivationConfigProperty(propertyName="destination",
> propertyValue="TestQueue")
>        })
> The rest of the EJB code hasn't been changed by me.
>
> Stephan
>
> On Wed, Aug 26, 2009 at 09:33, Stephan
> Mehlhase<s.mehlhase@googlemail.com> wrote:
>> Hi,
>>
>> thanks, but unfortunately this leads to the following while deploying:
>>
>> Resource Adapter for MDB 'MDB'not found:
>> ?j2eeType=JCAResourceAdapter,name=administeredObjectGroup#
>> org.apache.geronimo.common.DeploymentException: Resource Adapter for
>> MDB 'MDB'not found:
>> ?j2eeType=JCAResourceAdapter,name=administeredObjectGroup#
>>        at org.apache.geronimo.openejb.deployment.EjbModuleBuilder.setMdbContainerIds(EjbModuleBuilder.java:867)
>>        at org.apache.geronimo.openejb.deployment.EjbModuleBuilder.addGBeans(EjbModuleBuilder.java:818)
>>        at org.apache.geronimo.j2ee.deployment.EARConfigBuilder.buildConfiguration(EARConfigBuilder.java:647)
>>        at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:255)
>>        at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:134)
>>        at sun.reflect.GeneratedMethodAccessor205.invoke(Unknown Source)
>>        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>        at java.lang.reflect.Method.invoke(Method.java:597)
>>        at org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
>>        at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124)
>>        at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:867)
>>        at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:239)
>>        at org.apache.geronimo.deployment.plugin.local.AbstractDeployCommand.doDeploy(AbstractDeployCommand.java:116)
>>        at org.apache.geronimo.deployment.plugin.local.DistributeCommand.run(DistributeCommand.java:61)
>>        at java.lang.Thread.run(Thread.java:619)
>> Caused by: org.apache.geronimo.kernel.GBeanNotFoundException: No
>> matches for referencePatterns:
>> [?j2eeType=JCAResourceAdapter,name=administeredObjectGroup#]
>>        at org.apache.geronimo.kernel.config.Configuration.findGBeanData(Configuration.java:683)
>>        at org.apache.geronimo.kernel.config.Configuration.findGBean(Configuration.java:656)
>>        at org.apache.geronimo.kernel.config.Configuration.findGBean(Configuration.java:635)
>>        at org.apache.geronimo.deployment.DeploymentContext.findGBean(DeploymentContext.java:207)
>>        at org.apache.geronimo.openejb.deployment.EjbModuleBuilder.setMdbContainerIds(EjbModuleBuilder.java:865)
>>        ... 14 more
>>
>> Stephan
>>
>> On Tue, Aug 25, 2009 at 17:05, Jack Cai<greensight@gmail.com> wrote:
>>>        <dep:environment>
>>>                <dep:moduleId>
>>>                        <dep:groupId>default</dep:groupId>
>>>                        <dep:artifactId>TestEJB</dep:artifactId>
>>>                        <dep:version>1.0</dep:version>
>>>                        <dep:type>car</dep:type>
>>>                </dep:moduleId>
>>>                <dep:dependencies>
>>>                        <dep:dependency>
>>>                                <dep:groupId>org.apache.geronimo.configs
>>> </dep:groupId>
>>>                                <dep:artifactId>activemq-broker
>>> </dep:artifactId>
>>>                                <dep:type>car</dep:type>
>>>                        </dep:dependency>
>>>                </dep:dependencies>
>>>        </dep:environment>
>>>        <ejb:enterprise-beans>
>>>                <ejb:message-driven>
>>>                        <ejb:ejb-name>MDB</ejb:ejb-name>
>>>                        <ejb:resource-adapter>
>>>
>>>  <ejb:resource-link>administeredObjectGroup</ejb:resource-link>
>>>                        </ejb:resource-adapter>
>>>                </ejb:message-driven>
>>>        </ejb:enterprise-beans>
>>> </ejb:openejb-jar>
>>
>

Mime
View raw message