Migrate JMS from JBoss5 to JBoss7
max010 Jan 9, 2013 10:54 PMI am trying to migrate from JBoss5 to JBoss7. In the server.log I get the following error:
15:40:47,006 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report
JBAS014775: New missing/unsatisfied dependencies:
service jboss.naming.context.java.module.myapp-web.myapp-web.env.topic.ImportStartTopic (missing) dependents: [service jboss.naming.context.java.module.myapp-web.myapp-web.env.jms.ImportStartTopic]
15:40:47,007 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS014654: Composite operation was rolled back
15:40:47,008 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.naming.context.java.module.myapp-web.myapp-web.env.jms.ImportStartTopicjboss.naming.context.java.module.myapp-web.myapp-web.env.topic.ImportStartTopicMissing[jboss.naming.context.java.module.myapp-web.myapp-web.env.jms.ImportStartTopicjboss.naming.context.java.module.myapp-web.myapp-web.env.topic.ImportStartTopic]"]}}}
I have a .war to deploy with a web.xml in the WEB-INF directory. Inside the web.xml I have the following jms config:
<resource-env-ref>
<resource-env-ref-name>jms/ImportStartTopic</resource-env-ref-name>
<resource-env-ref-type>javax.jms.Topic</resource-env-ref-type>
</resource-env-ref>
The JBoss5 destinations-service.xml contains:
<?xml version="1.0" encoding="UTF-8"?>
<server>
<mbean code="org.jboss.mq.server.jmx.Queue" name="jboss.mq.destination:service=Queue,name=ImporterQueue">
<depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
</mbean>
<mbean code="org.jboss.mq.server.jmx.Topic" name="jboss.mq.destination:service=Topic,name=ImportStartTopic">
<depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
</mbean>
</server>
In the ejb.jar in a java class I have a static reference:
public static final String IMPORT_START_TOPIC = "topic/ImportStartTopic";
that is used to lookup the TopicConnectionFactory:
InitialContext ic = new InitialContext();
TopicConnectionFactory topicConnectionFactory = ( TopicConnectionFactory ) ic.lookup( JNDINames.TOPIC_CONNECTION_FACTORY );
Topic importStartTopic = ( Topic ) ic.lookup( JNDINames.IMPORT_START_TOPIC );
I am trying to follow the instructions on how to migrate from https://docs.jboss.org/author/display/AS7/How+do+I+migrate+my+application+from+AS5+or+AS6+to+AS7. I am focusing on the section "Migrate from JBoss Messaging to HornetQ".
The JBoss5 connection-factories-service.xml has the following JMS connection factories:
<mbean code="org.jboss.jms.server.connectionfactory.ConnectionFactory"
name="jboss.messaging.connectionfactory:service=ConnectionFactory"
xmbean-dd="xmdesc/ConnectionFactory-xmbean.xml">
<depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
<depends optional-attribute-name="Connector">jboss.messaging:service=Connector,transport=bisocket</depends>
<depends>jboss.messaging:service=PostOffice</depends>
<attribute name="JNDIBindings">
<bindings>
<binding>/ConnectionFactory</binding>
<binding>/XAConnectionFactory</binding>
<binding>java:/ConnectionFactory</binding>
<binding>java:/XAConnectionFactory</binding>
</bindings>
</attribute>
</mbean>
<mbean code="org.jboss.jms.server.connectionfactory.ConnectionFactory"
name="jboss.messaging.connectionfactory:service=ClusteredConnectionFactory"
xmbean-dd="xmdesc/ConnectionFactory-xmbean.xml">
<depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
<depends optional-attribute-name="Connector">jboss.messaging:service=Connector,transport=bisocket</depends>
<depends>jboss.messaging:service=PostOffice</depends>
<attribute name="JNDIBindings">
<bindings>
<binding>/ClusteredConnectionFactory</binding>
<binding>/ClusteredXAConnectionFactory</binding>
<binding>java:/ClusteredConnectionFactory</binding>
<binding>java:/ClusteredXAConnectionFactory</binding>
</bindings>
</attribute>
<attribute name="SupportsFailover">true</attribute>
<attribute name="SupportsLoadBalancing">true</attribute>
</mbean>
<mbean code="org.jboss.jms.server.connectionfactory.ConnectionFactory"
name="jboss.messaging.connectionfactory:service=ClusterPullConnectionFactory"
xmbean-dd="xmdesc/ConnectionFactory-xmbean.xml">
<depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
<depends optional-attribute-name="Connector">jboss.messaging:service=Connector,transport=bisocket</depends>
<depends>jboss.messaging:service=PostOffice</depends>
<attribute name="SupportsFailover">false</attribute>
<attribute name="SupportsLoadBalancing">false</attribute>
</mbean>
I have tried to migrate the JMS configurations to HornetQ but I am guessing I am doing something wrong. The standalone.xml section for JMS has the following config:
<subsystem xmlns="urn:jboss:domain:messaging:1.1">
<hornetq-server>
<persistence-enabled>true</persistence-enabled>
<journal-file-size>102400</journal-file-size>
<journal-min-files>2</journal-min-files>
<connectors>
<netty-connector name="netty" socket-binding="messaging"/>
<netty-connector name="netty-throughput" socket-binding="messaging-throughput">
<param key="batch-delay" value="50"/>
</netty-connector>
<in-vm-connector name="in-vm" server-id="0"/>
</connectors>
<acceptors>
<netty-acceptor name="netty" socket-binding="messaging"/>
<netty-acceptor name="netty-throughput" socket-binding="messaging-throughput">
<param key="batch-delay" value="50"/>
<param key="direct-deliver" value="false"/>
</netty-acceptor>
<in-vm-acceptor name="in-vm" server-id="0"/>
</acceptors>
<security-settings>
<security-setting match="#">
<permission type="send" roles="guest"/>
<permission type="consume" roles="guest"/>
<permission type="createNonDurableQueue" roles="guest"/>
<permission type="deleteNonDurableQueue" roles="guest"/>
</security-setting>
</security-settings>
<address-settings>
<!--default for catch all-->
<address-setting match="#">
<dead-letter-address>jms.queue.DLQ</dead-letter-address>
<expiry-address>jms.queue.ExpiryQueue</expiry-address>
<redelivery-delay>0</redelivery-delay>
<max-size-bytes>10485760</max-size-bytes>
<address-full-policy>BLOCK</address-full-policy>
<message-counter-history-day-limit>10</message-counter-history-day-limit>
</address-setting>
</address-settings>
<jms-connection-factories>
<connection-factory name="InVmConnectionFactory">
<connectors>
<connector-ref connector-name="in-vm"/>
</connectors>
<entries>
<entry name="java:/ConnectionFactory"/>
</entries>
</connection-factory>
<connection-factory name="RemoteConnectionFactory">
<connectors>
<connector-ref connector-name="netty"/>
</connectors>
<entries>
<entry name="RemoteConnectionFactory"/>
<entry name="java:jboss/exported/jms/RemoteConnectionFactory"/>
</entries>
</connection-factory>
<pooled-connection-factory name="hornetq-ra">
<transaction mode="xa"/>
<connectors>
<connector-ref connector-name="in-vm"/>
</connectors>
<entries>
<entry name="java:/JmsXA"/>
</entries>
</pooled-connection-factory>
</jms-connection-factories>
<jms-destinations>
<jms-queue name="ImporterQueue">
<entry name="queue/ImporterQueue"/>
<entry name="java:jboss/exported/jms/queue/ImporterQueue"/>
</jms-queue>
<jms-topic name="ImportStartTopic">
<entry name="topic/ImportStartTopic"/>
<entry name="java:jboss/exported/jms/topic/ImportStartTopic"/>
</jms-topic>
</jms-destinations>
</hornetq-server>
</subsystem>
In the .war WEB-INF directory I also have a jboss-deployment-structure.xml with the following additional module dependencies:
<dependencies>
<module name="javax.activation.api"/>
<module name="javax.ejb.api"/>
<module name="javax.jms.api"/>
<module name="javax.mail.api"/>
<module name="javax.servlet.api"/>
<module name="javax.servlet.jsp.api"/>
<module name="org.dom4j"/>
<module name="org.jboss.logging"/>
<module name="com.myapp.ejb" />
</dependencies>
I am reading JMS and HornetQ documentation to see if I can understand what is going wrong. Can anyone help me with this issue?
If you need more info let me know.
Thanks,
Max