Hello,

I am trying to connect to a JMS queue from a method that I call from a servlet in a simple webapp.

Both the queue and the webapp seems to have been deployed correctly and the webapp works so far, but when trying to look up the ConnectionFactory I get a javax.naming.NameNotFoundException.

Below I'll paste my resource adapter XML and the relevant code, could somebody please tell me what I am doing wrong?

Thanks in advance,
Torsten



Context init = new InitialContext();
// Lookup below seems to succeed but...
ctx = (Context)init.lookup("java:comp/env");
// but this one fails: NameNotFoundException: jms/ConnectionFactory
factory = (QueueConnectionFactory)ctx.lookup("jms/ConnectionFactory");



<?xml version="1.0" encoding="UTF-8"?>
<connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector";
    version="1.5"
    configId="test/Queues"
    parentId="org/apache/geronimo/SystemJMS">
    <resourceadapter>
        <resourceadapter-instance>
            <resourceadapter-name>ActiveMQ RA</resourceadapter-name>
<config-property-setting name="ServerUrl">tcp://localhost:61616</config-property-setting> <!-- config-property-setting name="UserName">user</config-property-setting --> <!-- config-property-setting name="Password">pass</config-property-setting -->
            <workmanager>
                <gbean-link>DefaultWorkManager</gbean-link>
            </workmanager>
        </resourceadapter-instance>
        <outbound-resourceadapter>
            <connection-definition>

<connectionfactory-interface>javax.jms.ConnectionFactory</connectionfactory-interface>
                <connectiondefinition-instance>
                    <name>jms/ConnectionFactory</name>

<implemented-interface>javax.jms.QueueConnectionFactory</implemented-interface>

<implemented-interface>javax.jms.TopicConnectionFactory</implemented-interface>
                    <connectionmanager>
                        <xa-transaction>
                            <transaction-caching/>
                        </xa-transaction>
                        <single-pool>
                            <max-size>10</max-size>

<blocking-timeout-milliseconds>5000</blocking-timeout-milliseconds>
                            <match-one/>
                        </single-pool>
                    </connectionmanager>

<global-jndi-name>jms/ConnectionFactory</global-jndi-name>
                    <!--
<credential-interface>javax.resource.spi.security.PasswordCredential</credential-interface>
-->
                </connectiondefinition-instance>
            </connection-definition>
        </outbound-resourceadapter>
    </resourceadapter>
    <adminobject>
        <adminobject-interface>javax.jms.Queue</adminobject-interface>

<adminobject-class>org.codehaus.activemq.message.ActiveMQQueue</adminobject-class>
        <adminobject-instance>

<message-destination-name>jms/testQueue</message-destination-name>
            <config-property-setting
name="PhysicalName">jms/testQueue</config-property-setting>
        </adminobject-instance>
    </adminobject>

</connector>

Reply via email to