You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by ptriller <pt...@soapwars.de> on 2007/06/11 22:43:06 UTC
MessageDriven Bean in EE5
Hello !
Is there anywhere a small simple demo app for message-driven beans with EE5
in Geronimo. I am failing utterly at mapping the required resources.
I always get the error
Unable to resolve resource reference 'ScheduleManagerQueue' (Could
not find resource 'ScheduleManagerQueue'. Perhaps it has not yet
been configured, or your application does not have a dependency
declared for that resource module?
and I have tried everything I can think of to map this resource.
I am using geronimo-tomcat6-jee5-2.0-M6-r1 but I got exactly the
same results using M5.
Thanks a lot
Peter Triller
--
View this message in context: http://www.nabble.com/MessageDriven-Bean-in-EE5-tf3903980s134.html#a11068434
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
Re: MessageDriven Bean in EE5
Posted by ptriller <pt...@soapwars.de>.
Hi !
Ok, now Its getting strange
<?xml version="1.0" encoding="UTF-8"?>
<openejb-jar xmlns="http://www.openejb.org/openejb-jar/1.1">
<ejb-deployment ejb-name="ScheduledTestEJB" deployment-id="deploymantId"
container-id="Default Stateless Container">
</ejb-deployment>
</openejb-jar>
this works... (taken from the openejb webpage, but this format does not
support any
geronimo stuff, so its not very usfull)
This on the other side:
<?xml version="1.0" encoding="UTF-8"?>
<openejb-jar xmlns="http://www.openejb.org/xml/ns/openejb-jar-2.2"
xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.2"
xmlns:security="http://geronimo.apache.org/xml/ns/security-1.2"
xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2">
<enterprise-beans>
<message-driven>
<ejb-name>ScheduledTestEJB</ejb-name>
</message-driven>
</enterprise-beans>
</openejb-jar>
(which contains about the same information)
gives me an:
H:\geronimo-tomcat6-jee5-2.0-M6>java -jar bin\deployer.jar -u system -p
manager
deploy h:\ejbworkspace\ScheduledEJB\target\ScheduledEJB-0.0.1-SNAPSHOT.jar
Error: Unable to distribute ScheduledEJB-0.0.1-SNAPSHOT.jar:
org.apache.geronimo.common.DeploymentException: Resource Adapter
defined for MDB 'ScheduledTestEJB'
Resource Adapter defined for MDB 'ScheduledTestEJB'
Thanks
Peter
--
View this message in context: http://www.nabble.com/MessageDriven-Bean-in-EE5-tf3903980s134.html#a11089489
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
Re: MessageDriven Bean in EE5
Posted by David Jencks <da...@yahoo.com>.
I'm not quite sure what you mean in this last comment. In any case,
there's a problem with the openejb plan you showed:
<message-driven>
<ejb-name>ScheduledTestEJB</ejb-name>
<naming:resource-adapter>
<naming:resource-link>ActiveMQ.tcp.default</naming:resource-link>
</naming:resource-adapter>
<naming:resource-ref>
<naming:ref-name>ScheduleTopicConnectionFactory</naming:ref-name>
<naming:resource-link>ScheduleTopicConnectionFactory</naming:resource-
link>
</naming:resource-ref>
<naming:resource-ref>
<naming:ref-name>ScheduleManagerQueue</naming:ref-name>
<naming:resource-link>ScheduleManagerQueue</naming:resource-link>
</naming:resource-ref>
<naming:resource-ref>
<naming:ref-name>ScheduledTopic</naming:ref-name>
<naming:resource-link>ScheduledTopic</naming:resource-link>
</naming:resource-ref>
</message-driven>
in that you are putting the admin objects (queue/topic) in as
resource-ref rather than resource-env-refs. However since the link
name is the same as the name the spec dd/annotations know about, you
can just leave them out and geronimo should link them for you. So,
<message-driven>
<ejb-name>ScheduledTestEJB</ejb-name>
<naming:resource-adapter>
<naming:resource-link>ActiveMQ.tcp.default</naming:resource-link>
</naming:resource-adapter>
</message-driven>
removes the error and
<message-driven>
<ejb-name>ScheduledTestEJB</ejb-name>
<naming:resource-adapter>
<naming:resource-link>ActiveMQ.tcp.default</naming:resource-link>
</naming:resource-adapter>
<naming:resource-ref>
<naming:ref-name>ScheduleTopicConnectionFactory</naming:ref-name>
<naming:resource-link>ScheduleTopicConnectionFactory</naming:resource-
link>
</naming:resource-ref>
<naming:resource-env-ref>
<naming:ref-name>ScheduleManagerQueue</naming:ref-name>
<naming:admin-object-link>ScheduleManagerQueue</naming:admin-
object-link>
</naming:resource-env-ref>
<naming:resource-env-ref>
<naming:ref-name>ScheduledTopic</naming:ref-name>
<naming:admin-object-link>ScheduledTopic</naming:admin-object-link>
</naming:resource-env-ref>
</message-driven>
should also work.
thanks
david jencks
On Jun 11, 2007, at 2:16 PM, ptriller wrote:
>
> Addendun:
>
> using an env-ref does not change anything at all.This is just a
> copy of my
> current working
> copy.. I probably should have searched for a "best effort" in my
> repository.
>
> Sorry
>
>
> Peter
>
> ptriller wrote:
>>
>> Ok,
>>
>> 1st I added a VM listener since its all in one appserver:
>> Console shows: ActiveMQ.vm.default ActiveMQ vm 666 running
>>
>> 2nd I added the ConnectionFactory and queue I needed:
>> console shows:
>> Connection Factory ScheduledQueueConnectionFactory Server-wide
>> running
>> Queue ScheduleManagerQueue Server-wide running
>> Topic ScheduledTopic Server-wide running
>>
>> then I made a bean:
>>
>> @MessageDriven(
>> name="ScheduledTestEJB",
>>
>> activationConfig = {
>> @ActivationConfigProperty(
>> propertyName="destinationType",
>> propertyValue="javax.jms.Topic"),
>> @ActivationConfigProperty(
>> propertyName="destination",
>> propertyValue="ScheduledTopic"),
>> @ActivationConfigProperty(
>> propertyName="destinationName",
>> propertyValue="ScheduledTopic")
>> })
>> public class ScheduledTestEJB implements MessageListener {
>>
>> @Resource(name="ScheduleManagerQueue")
>> private Destination jmsDestination;
>>
>> @Resource(name="ScheduledQueueConnectionFactory")
>> .
>> .
>> .
>>
>>
>> you see the Reference was done in a @Resource annotation,
>> but removing them (not that anything woudl work without them)
>> only changed the error .. now it cant map the resource-adapter
>>
>> right now my openejb-jar-xml snippet looks like that, but thats only
>> one of many incarnations
>> <message-driven>
>> <ejb-name>ScheduledTestEJB</ejb-name>
>> <naming:resource-adapter>
>> <naming:resource-link>ActiveMQ.tcp.default</naming:resource-link>
>> </naming:resource-adapter>
>> <naming:resource-ref>
>> <naming:ref-name>ScheduleTopicConnectionFactory</naming:ref-name>
>>
>> <naming:resource-link>ScheduleTopicConnectionFactory</
>> naming:resource-link>
>> </naming:resource-ref>
>> <naming:resource-ref>
>> <naming:ref-name>ScheduleManagerQueue</naming:ref-name>
>> <naming:resource-link>ScheduleManagerQueue</naming:resource-link>
>> </naming:resource-ref>
>> <naming:resource-ref>
>> <naming:ref-name>ScheduledTopic</naming:ref-name>
>> <naming:resource-link>ScheduledTopic</naming:resource-link>
>> </naming:resource-ref>
>> </message-driven>
>>
>>
>>
>>
>> thanks again
>>
>>
>> Peter
>>
>>
>> djencks wrote:
>>>
>>> dunno about examples but showing a bit of configuration might help.
>>> The message you show below suggests to me that perhaps you have
>>> tried
>>> to configure the queue in xml as a resource-ref rather than
>>> resource-
>>> env-ref or message-destination-ref. I've seen indications that this
>>> might work in some other app servers but it doesn't work in
>>> geronimo.
>>>
>>> On the other hand if you are using an @Resource annotation then
>>> geronimo should figure out what it is for you.
>>>
>>> thanks
>>> david jencks
>>>
>>> On Jun 11, 2007, at 1:43 PM, ptriller wrote:
>>>
>>>>
>>>> Hello !
>>>> Is there anywhere a small simple demo app for message-driven beans
>>>> with EE5
>>>> in Geronimo. I am failing utterly at mapping the required
>>>> resources.
>>>>
>>>> I always get the error
>>>>
>>>> Unable to resolve resource reference
>>>> 'ScheduleManagerQueue' (Could
>>>> not find resource 'ScheduleManagerQueue'. Perhaps it has not
>>>> yet
>>>> been configured, or your application does not have a dependency
>>>> declared for that resource module?
>>>>
>>>>
>>>> and I have tried everything I can think of to map this resource.
>>>>
>>>> I am using geronimo-tomcat6-jee5-2.0-M6-r1 but I got exactly the
>>>> same results using M5.
>>>>
>>>> Thanks a lot
>>>>
>>>>
>>>> Peter Triller
>>>> --
>>>> View this message in context: http://www.nabble.com/MessageDriven-
>>>> Bean-in-EE5-tf3903980s134.html#a11068434
>>>> Sent from the Apache Geronimo - Users mailing list archive at
>>>> Nabble.com.
>>>>
>>>
>>>
>>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/MessageDriven-
> Bean-in-EE5-tf3903980s134.html#a11068996
> Sent from the Apache Geronimo - Users mailing list archive at
> Nabble.com.
>
Re: MessageDriven Bean in EE5
Posted by ptriller <pt...@soapwars.de>.
Addendun:
using an env-ref does not change anything at all.This is just a copy of my
current working
copy.. I probably should have searched for a "best effort" in my repository.
Sorry
Peter
ptriller wrote:
>
> Ok,
>
> 1st I added a VM listener since its all in one appserver:
> Console shows: ActiveMQ.vm.default ActiveMQ vm 666 running
>
> 2nd I added the ConnectionFactory and queue I needed:
> console shows:
> Connection Factory ScheduledQueueConnectionFactory Server-wide running
> Queue ScheduleManagerQueue Server-wide running
> Topic ScheduledTopic Server-wide running
>
> then I made a bean:
>
> @MessageDriven(
> name="ScheduledTestEJB",
>
> activationConfig = {
> @ActivationConfigProperty(
> propertyName="destinationType",
> propertyValue="javax.jms.Topic"),
> @ActivationConfigProperty(
> propertyName="destination",
> propertyValue="ScheduledTopic"),
> @ActivationConfigProperty(
> propertyName="destinationName",
> propertyValue="ScheduledTopic")
> })
> public class ScheduledTestEJB implements MessageListener {
>
> @Resource(name="ScheduleManagerQueue")
> private Destination jmsDestination;
>
> @Resource(name="ScheduledQueueConnectionFactory")
> .
> .
> .
>
>
> you see the Reference was done in a @Resource annotation,
> but removing them (not that anything woudl work without them)
> only changed the error .. now it cant map the resource-adapter
>
> right now my openejb-jar-xml snippet looks like that, but thats only
> one of many incarnations
> <message-driven>
> <ejb-name>ScheduledTestEJB</ejb-name>
> <naming:resource-adapter>
> <naming:resource-link>ActiveMQ.tcp.default</naming:resource-link>
> </naming:resource-adapter>
> <naming:resource-ref>
> <naming:ref-name>ScheduleTopicConnectionFactory</naming:ref-name>
>
> <naming:resource-link>ScheduleTopicConnectionFactory</naming:resource-link>
> </naming:resource-ref>
> <naming:resource-ref>
> <naming:ref-name>ScheduleManagerQueue</naming:ref-name>
> <naming:resource-link>ScheduleManagerQueue</naming:resource-link>
> </naming:resource-ref>
> <naming:resource-ref>
> <naming:ref-name>ScheduledTopic</naming:ref-name>
> <naming:resource-link>ScheduledTopic</naming:resource-link>
> </naming:resource-ref>
> </message-driven>
>
>
>
>
> thanks again
>
>
> Peter
>
>
> djencks wrote:
>>
>> dunno about examples but showing a bit of configuration might help.
>> The message you show below suggests to me that perhaps you have tried
>> to configure the queue in xml as a resource-ref rather than resource-
>> env-ref or message-destination-ref. I've seen indications that this
>> might work in some other app servers but it doesn't work in geronimo.
>>
>> On the other hand if you are using an @Resource annotation then
>> geronimo should figure out what it is for you.
>>
>> thanks
>> david jencks
>>
>> On Jun 11, 2007, at 1:43 PM, ptriller wrote:
>>
>>>
>>> Hello !
>>> Is there anywhere a small simple demo app for message-driven beans
>>> with EE5
>>> in Geronimo. I am failing utterly at mapping the required resources.
>>>
>>> I always get the error
>>>
>>> Unable to resolve resource reference
>>> 'ScheduleManagerQueue' (Could
>>> not find resource 'ScheduleManagerQueue'. Perhaps it has not yet
>>> been configured, or your application does not have a dependency
>>> declared for that resource module?
>>>
>>>
>>> and I have tried everything I can think of to map this resource.
>>>
>>> I am using geronimo-tomcat6-jee5-2.0-M6-r1 but I got exactly the
>>> same results using M5.
>>>
>>> Thanks a lot
>>>
>>>
>>> Peter Triller
>>> --
>>> View this message in context: http://www.nabble.com/MessageDriven-
>>> Bean-in-EE5-tf3903980s134.html#a11068434
>>> Sent from the Apache Geronimo - Users mailing list archive at
>>> Nabble.com.
>>>
>>
>>
>>
>
>
--
View this message in context: http://www.nabble.com/MessageDriven-Bean-in-EE5-tf3903980s134.html#a11068996
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
Re: MessageDriven Bean in EE5
Posted by ptriller <pt...@soapwars.de>.
Ok,
1st I added a VM listener since its all in one appserver:
Console shows: ActiveMQ.vm.default ActiveMQ vm 666 running
2nd I added the ConnectionFactory and queue I needed:
console shows:
Connection Factory ScheduledQueueConnectionFactory Server-wide running
Queue ScheduleManagerQueue Server-wide running
Topic ScheduledTopic Server-wide running
then I made a bean:
@MessageDriven(
name="ScheduledTestEJB",
activationConfig = {
@ActivationConfigProperty(
propertyName="destinationType",
propertyValue="javax.jms.Topic"),
@ActivationConfigProperty(
propertyName="destination",
propertyValue="ScheduledTopic"),
@ActivationConfigProperty(
propertyName="destinationName",
propertyValue="ScheduledTopic")
})
public class ScheduledTestEJB implements MessageListener {
@Resource(name="ScheduleManagerQueue")
private Destination jmsDestination;
@Resource(name="ScheduledQueueConnectionFactory")
.
.
.
you see the Reference was done in a @Resource annotation,
but removing them (not that anything woudl work without them)
only changed the error .. now it cant map the resource-adapter
right now my openejb-jar-xml snippet looks like that, but thats only
one of many incarnations
<message-driven>
<ejb-name>ScheduledTestEJB</ejb-name>
<naming:resource-adapter>
<naming:resource-link>ActiveMQ.tcp.default</naming:resource-link>
</naming:resource-adapter>
<naming:resource-ref>
<naming:ref-name>ScheduleTopicConnectionFactory</naming:ref-name>
<naming:resource-link>ScheduleTopicConnectionFactory</naming:resource-link>
</naming:resource-ref>
<naming:resource-ref>
<naming:ref-name>ScheduleManagerQueue</naming:ref-name>
<naming:resource-link>ScheduleManagerQueue</naming:resource-link>
</naming:resource-ref>
<naming:resource-ref>
<naming:ref-name>ScheduledTopic</naming:ref-name>
<naming:resource-link>ScheduledTopic</naming:resource-link>
</naming:resource-ref>
</message-driven>
thanks again
Peter
djencks wrote:
>
> dunno about examples but showing a bit of configuration might help.
> The message you show below suggests to me that perhaps you have tried
> to configure the queue in xml as a resource-ref rather than resource-
> env-ref or message-destination-ref. I've seen indications that this
> might work in some other app servers but it doesn't work in geronimo.
>
> On the other hand if you are using an @Resource annotation then
> geronimo should figure out what it is for you.
>
> thanks
> david jencks
>
> On Jun 11, 2007, at 1:43 PM, ptriller wrote:
>
>>
>> Hello !
>> Is there anywhere a small simple demo app for message-driven beans
>> with EE5
>> in Geronimo. I am failing utterly at mapping the required resources.
>>
>> I always get the error
>>
>> Unable to resolve resource reference
>> 'ScheduleManagerQueue' (Could
>> not find resource 'ScheduleManagerQueue'. Perhaps it has not yet
>> been configured, or your application does not have a dependency
>> declared for that resource module?
>>
>>
>> and I have tried everything I can think of to map this resource.
>>
>> I am using geronimo-tomcat6-jee5-2.0-M6-r1 but I got exactly the
>> same results using M5.
>>
>> Thanks a lot
>>
>>
>> Peter Triller
>> --
>> View this message in context: http://www.nabble.com/MessageDriven-
>> Bean-in-EE5-tf3903980s134.html#a11068434
>> Sent from the Apache Geronimo - Users mailing list archive at
>> Nabble.com.
>>
>
>
>
--
View this message in context: http://www.nabble.com/MessageDriven-Bean-in-EE5-tf3903980s134.html#a11068884
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
Re: MessageDriven Bean in EE5
Posted by David Jencks <da...@yahoo.com>.
dunno about examples but showing a bit of configuration might help.
The message you show below suggests to me that perhaps you have tried
to configure the queue in xml as a resource-ref rather than resource-
env-ref or message-destination-ref. I've seen indications that this
might work in some other app servers but it doesn't work in geronimo.
On the other hand if you are using an @Resource annotation then
geronimo should figure out what it is for you.
thanks
david jencks
On Jun 11, 2007, at 1:43 PM, ptriller wrote:
>
> Hello !
> Is there anywhere a small simple demo app for message-driven beans
> with EE5
> in Geronimo. I am failing utterly at mapping the required resources.
>
> I always get the error
>
> Unable to resolve resource reference
> 'ScheduleManagerQueue' (Could
> not find resource 'ScheduleManagerQueue'. Perhaps it has not yet
> been configured, or your application does not have a dependency
> declared for that resource module?
>
>
> and I have tried everything I can think of to map this resource.
>
> I am using geronimo-tomcat6-jee5-2.0-M6-r1 but I got exactly the
> same results using M5.
>
> Thanks a lot
>
>
> Peter Triller
> --
> View this message in context: http://www.nabble.com/MessageDriven-
> Bean-in-EE5-tf3903980s134.html#a11068434
> Sent from the Apache Geronimo - Users mailing list archive at
> Nabble.com.
>