users@glassfish.java.net

Re: JMS Using Spring

From: <glassfish_at_javadesktop.org>
Date: Mon, 19 Apr 2010 10:04:24 PDT

We had a previous project that was running under JBoss that had the following config:

        <bean id="jbossJNDIEnvironmentFactory"
                class="org.springframework.beans.factory.config.PropertiesFactoryBean">
                <property name="properties">
                        <props>
                                <prop key="java.naming.factory.initial">org.jnp.interfaces.NamingContextFactory</prop>
                                <prop key="java.naming.provider.url">jnp://localhost:1099"</prop>
                                <prop key="java.naming.factory.url.pkgs">org.jboss.naming:org.jnp.interfaces</prop>
                        </props>
                </property>
        </bean>

        <bean id="JNDIDestinationResolver" class="org.springframework.jms.support.destination.JndiDestinationResolver">
                <property name="jndiEnvironment" ref="jbossJNDIEnvironmentFactory" />
        </bean>

        <bean id="CachingFactory"
                class="org.springframework.jms.connection.CachingConnectionFactory"
                lazy-init="true">
                <property name="targetConnectionFactory"
                        ref="InternalJmsQueueConnectionFactory" />
        </bean>

        <alias name="CachingFactory" alias="JMSConnectionFactory" />

        <jee:jndi-lookup id="InternalJmsQueueConnectionFactory" jndi-name="java:XAConnectionFactory"/>

        <bean id="messageListener" class="some.package.MessageListener"></bean>

        <bean id="MessageContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
                <property name="pubSubDomain" value="false" />
                <property name="messageListener" ref="messageListener" />
                <property name="destinationName" value="/queue/Queue" />
                <property name="destinationResolver" ref="JNDIDestinationResolver" />
                <property name="connectionFactory" ref="InternalJmsQueueConnectionFactory" />
                <property name="sessionTransacted" value="true" />
                <property name="autoStartup" value="false" />
        </bean>

I'm trying to configure a message listener for Glassfish, and and having trouble. When I try to configure it like the above, the bundle that the message listener is in doesn't deploy properly (the services don't get registered). I'm trying to increase the logging to get some detailed error information, but I was also looking for an example that wasn't JBoss specific.
[Message sent by forum member 'ltouve']

http://forums.java.net/jive/thread.jspa?messageID=397860