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.


Reply via email to