users@glassfish.java.net

Re: JMS Using Spring

From: Sahoo <Sahoo_at_Sun.COM>
Date: Tue, 20 Apr 2010 09:46:44 +0530

So you like so much of XML code as opposed to simple readable Java code?
Is writing a message listener that hard in Java with dependency
injection support of EE platform?

Sahoo

glassfish_at_javadesktop.org wrote:
> 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
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>