-
15. Re: JBoss AS7 HornetQ (XA, Spring, Hibernate)
ataylor Aug 21, 2012 1:09 PM (in response to renevanwijk)Are you kidding. How easy can it get: unzip a JBoss distribution, install a JDK
run standalone.sh, copy the module, open the console and deploy the war.
Actually I already have all of that installed, you included domain server configurations, wars, If its that simple please be clearer as to how to re create it, from what you have added im guessing
./standalone.sh -c standalone-full.xml
point browser at https://community.jboss.org/hostname:port/contextroot/testservlet
remember, this is free support I am giving you and taking time out of my day job to do it, so be nice and understand that we have lots of people to help and paying customers to support.
I will take a look tomorrow
-
16. Re: JBoss AS7 HornetQ (XA, Spring, Hibernate)
renevanwijk Aug 21, 2012 2:44 PM (in response to ataylor)Yes, I know it is free.
I am doing the same thing for another application server community (https://forums.oracle.com/forums/category.jspa?categoryID=193)
Also for the JBoss community - http://middlewaremagic.com/jboss/?p=1894. Why? Because I just want to help people.
To make things more clear:
- Install a JBossAS 7 distribution
- Install JDK
- Create springframework module:
- Create the following directory in the ${JBOSS_HOME}/modules directory: /org/springframework/main
- In this directory place the module.xml and spring related jars that are present in the zip (jboss-as-7.1.0.Final.zip) at jboss-as-7.1.0.Final\modules\org\springframework\main
- Use, for example, the standalone configuration:
- Include messaging, for example, by using the standalonefull.xml (not sure about the name) as the configuration
- They are probably already the present in the configuration:
- A (pooled XA enable) connection factory with java:/JmsXA as the JNDI name
- A queue with java:/queue/test as the JNDI name (to my knowledge these are already present in the example configuration files that come with a JBoss distribution)
- Start the server by using standalone.sh (you can edit standalone.conf, and set a different configuration -Djboss.server.default.config=standalone.xml)
- or: standalone.sh --server-config=AServerConfigurationFile.xml
- To deploy the application:
- Open the command-line interface (./jboss-cli.sh)
- connect to a server, for example, connect IP-ADDRESS:9999
- the application can be deployed by using: deploy ${JBOSS_HOME}/deploy/Test.war
- Here it is assumed the .war file is located in the deploy directory inside a JBoss installation
- The .war file is located at the jboss-as-7.1.0.Final\deploy\test location inside the zip (jboss-as-7.1.0.Final.zip)
- When the application is deployed successfully, the servlet (testservlet) can be executed by using hostname:port/Test/testservlet.
I hope I did not forget any steps.
Note that I am not in a hurry, so if you do not have time for this at the moment, no worries.
-
17. Re: JBoss AS7 HornetQ (XA, Spring, Hibernate)
renevanwijk Aug 22, 2012 7:28 AM (in response to ataylor)Got it!
It was one line of code in the MDP that ruined everything:
message.acknowledge();
The developer acknowledged the message again, while the DefaultMessageListenerContainer has it's acknowledgement mode set to AUTO_ACKNOWLEDGE
From the JavaDoc - http://static.springsource.org/spring/docs/3.1.x/javadoc-api/org/springframework/jms/listener/AbstractMessageListenerContainer.html
- "sessionAcknowledgeMode" set to "AUTO_ACKNOWLEDGE" (default): Automatic message acknowledgment before listener execution; no redelivery in case of exception thrown."
Thanks Andy for your willingness to help!
Just some conclusive evidence that it is working:
13:03:39,127 INFO [org.jboss.as.webservices] (ServerService Thread Pool -- 32) JBAS015537: Activating WebServices Extension
13:03:39,183 INFO [org.jboss.as.security] (ServerService Thread Pool -- 36) JBAS013101: Activating Security Subsystem
13:03:39,206 INFO [org.jboss.as.security] (MSC service thread 1-2) JBAS013100: Current PicketBox version=4.0.6.final
13:03:39,280 INFO [org.jboss.as.osgi] (ServerService Thread Pool -- 41) JBAS011940: Activating OSGi Subsystem
13:03:39,306 INFO [org.jboss.as.naming] (ServerService Thread Pool -- 42) JBAS011800: Activating Naming Subsystem
13:03:39,403 INFO [org.jboss.as.naming] (MSC service thread 1-1) JBAS011802: Starting Naming Service
13:03:39,411 INFO [org.jboss.as.mail.extension] (MSC service thread 1-2) JBAS015400: Bound mail session [java:jboss/mail/Default]
13:03:39,433 INFO [org.jboss.as.clustering.jgroups] (ServerService Thread Pool -- 49) JBAS010260: Activating JGroups subsystem.
13:03:39,622 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 55) JBAS010280: Activating Infinispan subsystem.
13:03:39,629 INFO [org.jboss.as.jacorb] (ServerService Thread Pool -- 54) JBAS016300: Activating JacORB Subsystem
13:03:39,736 INFO [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 58) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
13:03:39,772 INFO [org.jboss.as.configadmin] (ServerService Thread Pool -- 59) JBAS016200: Activating ConfigAdmin Subsystem
13:03:39,894 INFO [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-2) JBoss Web Services - Stack CXF Server 4.0.1.GA
13:03:39,924 INFO [org.jboss.as.connector] (MSC service thread 1-3) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.7.Final)
13:03:40,048 INFO [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 58) JBAS010403: Deploying JDBC-compliant driver class oracle.jdbc.OracleDriver (version 11.2)
13:03:40,130 INFO [org.jboss.as.jaxr] (MSC service thread 1-2) Binding JAXR ConnectionFactory: java:jboss/jaxr/ConnectionFactory
13:03:40,344 INFO [org.jboss.as.modcluster] (MSC service thread 1-4) JBAS011704: Mod_cluster uses default load balancer provider
13:03:40,353 INFO [org.apache.coyote.ajp.AjpAprProtocol] (MSC service thread 1-3) Starting Coyote AJP/1.3 on ajp--192.168.1.150-9081
13:03:40,494 INFO [org.jboss.modcluster.ModClusterService] (MSC service thread 1-4) Initializing mod_cluster 1.2.0.Final
13:03:40,543 INFO [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (ServerService Thread Pool -- 55) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be pasivated.
13:03:40,564 INFO [org.apache.coyote.http11.Http11AprProtocol] (MSC service thread 1-2) Starting Coyote HTTP/1.1 on http--192.168.1.150-8081
13:03:40,689 INFO [org.jboss.modcluster.advertise.impl.AdvertiseListenerImpl] (MSC service thread 1-4) Listening to proxy advertisements on 224.0.1.105:23364
13:03:40,704 INFO [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (ServerService Thread Pool -- 55) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be pasivated.
13:03:41,014 INFO [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-4) live server is starting with configuration HornetQ Configuration (clustered=false,backup=false,sharedStore=true,journalDirectory=/home/jboss/jboss-as-7.1.0.Final/domain/servers/cluster-server2/data/messagingjournal,bindingsDirectory=/home/jboss/jboss-as-7.1.0.Final/domain/servers/cluster-server2/data/messagingbindings,largeMessagesDirectory=/home/jboss/jboss-as-7.1.0.Final/domain/servers/cluster-server2/data/messaginglargemessages,pagingDirectory=/home/jboss/jboss-as-7.1.0.Final/domain/servers/cluster-server2/data/messagingpaging)
13:03:41,016 INFO [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-4) Waiting to obtain live lock
13:03:41,240 INFO [org.hornetq.core.persistence.impl.journal.JournalStorageManager] (MSC service thread 1-4) Using AIO Journal
13:03:41,471 INFO [org.jboss.as.jacorb] (MSC service thread 1-2) JBAS016330: CORBA ORB Service started
13:03:41,733 INFO [org.hornetq.core.server.impl.AIOFileLockNodeManager] (MSC service thread 1-4) Waiting to obtain live lock
13:03:41,733 INFO [org.hornetq.core.server.impl.AIOFileLockNodeManager] (MSC service thread 1-4) Live Server Obtained live lock
13:03:41,912 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]
13:03:41,938 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) JBAS010400: Bound data source [java:/jdbc/OracleDS]
13:03:42,080 INFO [org.jboss.as.jacorb] (MSC service thread 1-3) JBAS016328: CORBA Naming Service started
13:03:42,656 INFO [org.jboss.as.remoting] (MSC service thread 1-2) JBAS017100: Listening on axis-into-ict.nl/192.168.1.150:4448
13:03:43,384 INFO [org.hornetq.core.remoting.impl.netty.NettyAcceptor] (MSC service thread 1-4) Started Netty Acceptor version 3.2.5.Final-a96d88c axis-into-ict.nl:5456 for CORE protocol
13:03:43,385 INFO [org.hornetq.core.remoting.impl.netty.NettyAcceptor] (MSC service thread 1-4) Started Netty Acceptor version 3.2.5.Final-a96d88c axis-into-ict.nl:5446 for CORE protocol
13:03:43,387 INFO [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-4) Server is now live
13:03:43,387 INFO [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-4) HornetQ Server version 2.2.11.Final (HQ_2_2_11_FINAL_AS7, 122) [3f00f7a1-78e4-11e1-800d-000c2976c82d]) started
13:03:43,394 INFO [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-4) trying to deploy queue jms.queue.testQueue
13:03:43,406 INFO [org.jboss.as.messaging] (MSC service thread 1-4) JBAS011601: Bound messaging object to jndi name java:jboss/exported/jms/queue/test
13:03:43,407 INFO [org.jboss.as.messaging] (MSC service thread 1-4) JBAS011601: Bound messaging object to jndi name java:/queue/test
13:03:43,427 INFO [org.jboss.as.messaging] (MSC service thread 1-3) JBAS011601: Bound messaging object to jndi name java:jboss/exported/jms/RemoteConnectionFactory
13:03:43,428 INFO [org.jboss.as.messaging] (MSC service thread 1-3) JBAS011601: Bound messaging object to jndi name java:/RemoteConnectionFactory
13:03:43,429 INFO [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-1) trying to deploy queue jms.topic.testTopic
13:03:43,459 INFO [org.jboss.as.messaging] (MSC service thread 1-1) JBAS011601: Bound messaging object to jndi name java:/topic/test
13:03:43,460 INFO [org.jboss.as.messaging] (MSC service thread 1-1) JBAS011601: Bound messaging object to jndi name java:jboss/exported/jms/topic/test
13:03:43,461 INFO [org.jboss.as.messaging] (MSC service thread 1-2) JBAS011601: Bound messaging object to jndi name java:/ConnectionFactory
13:03:43,477 INFO [org.jboss.as.deployment.connector] (MSC service thread 1-3) JBAS010406: Registered connection factory java:/JmsXA
13:03:43,485 INFO [org.hornetq.ra.HornetQResourceAdapter] (MSC service thread 1-3) HornetQ resource adaptor started
13:03:43,486 INFO [org.jboss.as.connector.services.ResourceAdapterActivatorService$ResourceAdapterActivator] (MSC service thread 1-3) IJ020002: Deployed: file://RaActivatorhornetq-ra
13:03:43,488 INFO [org.jboss.as.deployment.connector] (MSC service thread 1-4) JBAS010401: Bound JCA ConnectionFactory [java:/JmsXA]
13:03:43,538 INFO [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss AS 7.1.0.Final "Thunder" started in 8264ms - Started 169 of 292 services (121 services are passive or on-demand)
13:03:50,019 INFO [org.jboss.modcluster.ModClusterService] (ContainerBackgroundProcessor[StandardEngine[jboss.web]]) Engine [jboss.web] will use jvmRoute: 4d87f106-10ff-342f-a6e6-eb2377d7c23f
13:05:17,834 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015876: Starting deployment of "SpringHibernate.war"
13:05:18,506 INFO [org.jboss.web] (MSC service thread 1-1) JBAS018210: Registering web context: /SpringHibernate
13:05:18,851 INFO [org.jboss.as.server] (host-controller-connection-threads - 4) JBAS018559: Deployed "SpringHibernate.war"
13:06:28,940 INFO [org.jboss.modcluster.ModClusterService] (MSC service thread 1-3) All active sessions drained from context [/SpringHibernate] in 0 seconds
13:06:28,995 INFO [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015877: Stopped deployment SpringHibernate.war in 63ms
13:06:29,025 INFO [org.jboss.as.repository] (host-controller-connection-threads - 4) JBAS014901: Content removed from location /home/jboss/jboss-as-7.1.0.Final/domain/servers/cluster-server2/data/content/26/9c7fbb35d6e7734848b98b38499883c72be942/content
13:06:29,026 INFO [org.jboss.as.server] (host-controller-connection-threads - 4) JBAS018558: Undeployed "SpringHibernate.war"
13:07:41,768 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Starting deployment of "SpringHibernate.war"
13:07:41,865 INFO [org.jboss.web] (MSC service thread 1-3) JBAS018210: Registering web context: /SpringHibernate
13:07:41,889 INFO [org.jboss.as.server] (host-controller-connection-threads - 6) JBAS018559: Deployed "SpringHibernate.war"
13:07:54,566 INFO [org.springframework.context.support.ClassPathXmlApplicationContext] (ajp--192.168.1.150-9081-5) Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@79e59f7c: startup date [Wed Aug 22 13:07:54 CEST 2012]; root of context hierarchy
13:07:54,607 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] (ajp--192.168.1.150-9081-5) Loading XML bean definitions from class path resource [spring-config.xml]
13:07:54,871 INFO [org.springframework.beans.factory.config.PropertyPlaceholderConfigurer] (ajp--192.168.1.150-9081-5) Loading properties file from class path resource [spring.properties]
13:07:54,890 INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory] (ajp--192.168.1.150-9081-5) Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@2fb4b69d: defining beans [company,sessionfactory,transactionManager,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,datasource,connectionfactory,destination,jmstemplate,org.springframework.jms.listener.DefaultMessageListenerContainer#0,companymdp,propertyConfigurer]; root of factory hierarchy
13:07:54,963 INFO [org.springframework.transaction.jta.JtaTransactionManager] (ajp--192.168.1.150-9081-5) Using JTA UserTransaction: org.jboss.tm.usertx.client.ServerVMClientUserTransaction@1bd871
13:07:54,964 INFO [org.springframework.transaction.jta.JtaTransactionManager] (ajp--192.168.1.150-9081-5) Using JTA TransactionManager: com.arjuna.ats.jbossatx.jta.TransactionManagerDelegate@1876e112
13:07:54,965 INFO [org.springframework.transaction.jta.JtaTransactionManager] (ajp--192.168.1.150-9081-5) Using JTA TransactionSynchronizationRegistry: com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionSynchronizationRegistryImple@7a1f0683
13:07:55,051 INFO [org.hibernate.annotations.common.Version] (ajp--192.168.1.150-9081-5) HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
13:07:55,055 INFO [org.hibernate.Version] (ajp--192.168.1.150-9081-5) HHH000412: Hibernate Core {4.0.1.Final}
13:07:55,057 INFO [org.hibernate.cfg.Environment] (ajp--192.168.1.150-9081-5) HHH000206: hibernate.properties not found
13:07:55,059 INFO [org.hibernate.cfg.Environment] (ajp--192.168.1.150-9081-5) HHH000021: Bytecode provider name : javassist
13:07:55,098 WARN [org.hibernate.internal.util.xml.DTDEntityResolver] (ajp--192.168.1.150-9081-5) HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
13:07:55,303 INFO [org.hibernate.dialect.Dialect] (ajp--192.168.1.150-9081-5) HHH000400: Using dialect: org.hibernate.dialect.Oracle10gDialect
13:07:55,321 INFO [org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory] (ajp--192.168.1.150-9081-5) HHH000397: Using ASTQueryTranslatorFactory
13:07:55,355 INFO [org.hibernate.validator.util.Version] (ajp--192.168.1.150-9081-5) Hibernate Validator 4.2.0.Final
13:07:55,699 INFO [org.springframework.context.support.DefaultLifecycleProcessor] (ajp--192.168.1.150-9081-5) Starting beans in phase 2147483647
13:07:55,970 INFO [stdout] (ajp--192.168.1.150-9081-5) INSERT 1qd0v6djn7tg9 1723
13:07:55,971 INFO [stdout] (ajp--192.168.1.150-9081-7) INSERT 8a42y69oal0h 8427
13:07:56,087 INFO [stdout] (org.springframework.jms.listener.DefaultMessageListenerContainer#0-1) YEP WE GOT THIS FAR OBJECT!
13:07:56,105 INFO [stdout] (org.springframework.jms.listener.DefaultMessageListenerContainer#0-1) RECEIVED OBJECT MESSAGE 8a42y69oal0h 8427
13:07:56,122 INFO [stdout] (org.springframework.jms.listener.DefaultMessageListenerContainer#0-1) YEP WE GOT THIS FAR OBJECT!
13:07:56,123 INFO [stdout] (org.springframework.jms.listener.DefaultMessageListenerContainer#0-1) RECEIVED OBJECT MESSAGE 1qd0v6djn7tg9 1723
13:07:57,088 INFO [stdout] (ajp--192.168.1.150-9081-5) INSERT 1pc8d7ue5ah9u 2935
13:07:57,173 INFO [stdout] (org.springframework.jms.listener.DefaultMessageListenerContainer#0-1) YEP WE GOT THIS FAR OBJECT!
13:07:57,175 INFO [stdout] (org.springframework.jms.listener.DefaultMessageListenerContainer#0-1) RECEIVED OBJECT MESSAGE 1pc8d7ue5ah9u 2935
13:07:58,215 INFO [stdout] (ajp--192.168.1.150-9081-5) INSERT 17amw6odvcrq9 9570
13:07:58,296 INFO [stdout] (org.springframework.jms.listener.DefaultMessageListenerContainer#0-1) YEP WE GOT THIS FAR OBJECT!
13:07:58,299 INFO [stdout] (org.springframework.jms.listener.DefaultMessageListenerContainer#0-1) RECEIVED OBJECT MESSAGE 17amw6odvcrq9 9570
13:07:58,882 INFO [stdout] (ajp--192.168.1.150-9081-5) UPDATE 1iey5he3bsp7m 5545
13:07:59,519 INFO [stdout] (ajp--192.168.1.150-9081-5) INSERT x3jjf9f6q5gb 4535
13:07:59,601 INFO [stdout] (org.springframework.jms.listener.DefaultMessageListenerContainer#0-1) YEP WE GOT THIS FAR OBJECT!
13:07:59,603 INFO [stdout] (org.springframework.jms.listener.DefaultMessageListenerContainer#0-1) RECEIVED OBJECT MESSAGE x3jjf9f6q5gb 4535
13:07:59,913 INFO [stdout] (ajp--192.168.1.150-9081-5) INSERT br5gcu4culv7 627
13:07:59,946 INFO [stdout] (org.springframework.jms.listener.DefaultMessageListenerContainer#0-1) YEP WE GOT THIS FAR OBJECT!
13:07:59,948 INFO [stdout] (org.springframework.jms.listener.DefaultMessageListenerContainer#0-1) RECEIVED OBJECT MESSAGE br5gcu4culv7 627
13:08:00,297 INFO [stdout] (ajp--192.168.1.150-9081-5) INSERT sgl7gjm8xvz0 8981
13:08:00,331 INFO [stdout] (org.springframework.jms.listener.DefaultMessageListenerContainer#0-1) YEP WE GOT THIS FAR OBJECT!
13:08:00,332 INFO [stdout] (org.springframework.jms.listener.DefaultMessageListenerContainer#0-1) RECEIVED OBJECT MESSAGE sgl7gjm8xvz0 8981
13:08:01,581 INFO [stdout] (ajp--192.168.1.150-9081-5) UPDATE 6ep4nn9fbple 8977
13:08:02,378 INFO [stdout] (ajp--192.168.1.150-9081-5) REMOVE 7mq231hw0cp6 9578
13:08:02,567 INFO [stdout] (org.springframework.jms.listener.DefaultMessageListenerContainer#0-1) YEP WE GOT THIS FAR OBJECT!
13:08:02,570 INFO [stdout] (org.springframework.jms.listener.DefaultMessageListenerContainer#0-1) RECEIVED OBJECT MESSAGE 7mq231hw0cp6 9578
13:08:03,189 INFO [stdout] (ajp--192.168.1.150-9081-5) UPDATE 52rm82lkl4ig 3192
13:08:03,990 INFO [stdout] (ajp--192.168.1.150-9081-5) INSERT tbpdm32hiar 8492
13:08:04,142 INFO [stdout] (org.springframework.jms.listener.DefaultMessageListenerContainer#0-1) YEP WE GOT THIS FAR OBJECT!
13:08:04,145 INFO [stdout] (org.springframework.jms.listener.DefaultMessageListenerContainer#0-1) RECEIVED OBJECT MESSAGE tbpdm32hiar 8492
13:08:04,820 INFO [stdout] (ajp--192.168.1.150-9081-5) UPDATE 19799jok9r3a6 1984
13:08:05,691 INFO [stdout] (ajp--192.168.1.150-9081-5) INSERT 1bwfygehmv3md 7655
13:08:05,785 INFO [stdout] (org.springframework.jms.listener.DefaultMessageListenerContainer#0-1) YEP WE GOT THIS FAR OBJECT!
13:08:05,788 INFO [stdout] (org.springframework.jms.listener.DefaultMessageListenerContainer#0-1) RECEIVED OBJECT MESSAGE 1bwfygehmv3md 7655
13:08:06,095 INFO [stdout] (ajp--192.168.1.150-9081-5) UPDATE p4p4vgwe99ss 8075
-
18. Re: JBoss AS7 HornetQ (XA, Spring, Hibernate)
ataylor Aug 22, 2012 7:45 AM (in response to renevanwijk)good stuff, glad you got it working, thanks for the feed back