JBoss cluster does not deploy war when infinispan/jgroups timeouts - jboss

I have a jboss cluster composed of two jboss eap 6.3.3 instances. In some cases because an application presents a bug two instances raises an exception and I must to restart these two instances (node1 - node 2).
In that situtation when I restart the node1, for instance, and the node 2 is not reachable because is stalled, the node1 start the deploy of my app war and logs the following exception.
ERROR [org.jboss.msc.service.fail] [] (ServerService Thread Pool -- 107) MSC000001:
Failed to start service jboss.persistenceunit."app.war#persistencename":
org.jboss.msc.service.StartException in service jboss.persistenceunit."app.war#persistencename":
org.infinispan.CacheException: Unable to invoke method public void
org.infinispan.statetransfer.StateTransferManagerImpl.start() throws
java.lang.Exception on object of type StateTransferManagerImpl
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:103)
...
Caused by: org.infinispan.CacheException: org.jgroups.TimeoutException: timeout sending
message to node2/hibernate
at org.infinispan.util.Util.rewrapAsCacheException(Util.java:542)
...
Caused by: org.jgroups.TimeoutException: timeout sending
message to node2/hibernate
at org.jgroups.blocks.MessageDispatcher.sendMessage(MessageDispatcher.java:392)
After that Jboss logs that the implementation of the war has failed.
If I restart the node 2 too, then the node1 starts without problems and deploys the war succesfully.
Why does the deployment stop if one node of the cluster is not reachable?

Related

Hibernate OGM mongodb example

I'm new to java ee, I'm searching for some example of hibernate OGM with Mongodb. I found this: https://github.com/fmarchioni/mastertheboss/tree/master/hibernateogm-mongo but I'm struggling trying to run it.
Those are the steps I've done:
import the project in Eclipse as Maven project
added JavaServer Faces and Dynamic Web Module in Project Facets
installed Wildfly as Server runtime
Trying to run the project I get this error
13:32:49,916 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001: Failed to start service jboss.deployment.unit."hibernateogm-mongo.war".FIRST_MODULE_USE: org.jboss.msc.service.StartException in service jboss.deployment.unit."hibernateogm-mongo.war".FIRST_MODULE_USE: WFLYSRV0153: Failed to process phase FIRST_MODULE_USE of deployment "hibernateogm-mongo.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:151)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1736)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1698)
at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1556)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYJPA0027: Persistence provider module load error org.hibernate.ogm (class org.hibernate.ogm.jpa.HibernateOgmPersistence)
at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.lookupProvider(PersistenceUnitServiceHandler.java:991)
at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.addPuService(PersistenceUnitServiceHandler.java:266)
at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.handleWarDeployment(PersistenceUnitServiceHandler.java:206)
at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.deploy(PersistenceUnitServiceHandler.java:134)
at org.jboss.as.jpa.processor.PersistenceBeginInstallProcessor.deploy(PersistenceBeginInstallProcessor.java:52)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:144)
... 8 more
Caused by: org.jboss.modules.ModuleNotFoundException: org.hibernate.ogm
at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:294)
at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:280)
at org.jboss.as.jpa.persistenceprovider.PersistenceProviderLoader.loadProviderModuleByName(PersistenceProviderLoader.java:65)
at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.lookupProvider(PersistenceUnitServiceHandler.java:987)
... 13 more
13:32:50,978 INFO [org.infinispan.factories.GlobalComponentRegistry] (MSC service thread 1-3) ISPN000128: Infinispan version: Infinispan 'Estrella Galicia' 9.3.1.Final
13:32:51,380 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 72) WFLYCLINF0002: Started client-mappings cache from ejb container
13:32:51,602 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 72) WFLYUT0021: Registered web context: '/wildflyDynamicProject' for server 'default-server'
13:32:51,612 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "hibernateogm-mongo.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"hibernateogm-mongo.war\".FIRST_MODULE_USE" => "WFLYSRV0153: Failed to process phase FIRST_MODULE_USE of deployment \"hibernateogm-mongo.war\"
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYJPA0027: Persistence provider module load error org.hibernate.ogm (class org.hibernate.ogm.jpa.HibernateOgmPersistence)
Caused by: org.jboss.modules.ModuleNotFoundException: org.hibernate.ogm"}}
You can see the actual error is org.jboss.modules.ModuleNotFoundException: org.hibernate.ogm
Now the questions:
I guess org.hibernate.ogm as Maven dependency is not enough, Widlfly needs org.hibernate.ogm module. How can I install it? All the informations I find are JBoss related and outdated.
can I run this project in Tomcat or this makes no sense? Is Wildfly necessary in this case? I get this error in case of Tomcat 8 runtime: java.lang.ClassNotFoundException: javax.faces.webapp.FacesServlet
That example is quite old, I've created an up-to-date example that I'm planning to inlcude in the project on my personal repository.
Here's the link: https://github.com/DavideD/hibernate-demos/tree/master/hibernate-ogm/nosql-with-hibernate-ogm-101/hibernate-ogm-demo-nosql-with-hibernate-ogm-101-part-3
This project shows how to setup a maven build that prepares WildFly 13 with the appropriate modules using the provisioning plugin. It also show a basic configuration for the persistence.xml and jboss deploy descriptor.
One thing to keep in mind, is that you need to start the server using the proprierty -Dee8.preview.mode=true as you can see in the arquillian.xml
I hope this help

Error while deploying EAR using Wildfly13.0.0.0

I've upgraded the server from "JBOSS-EAP 6" to "Wildfly 13.0.0.0", I've also set all needed configurations, but when starting to deploy EAR I get the below ERROR. What does it mean?
MSC000001: Failed to start service
jboss.deployment.subunit."mpaymentapp-ear.ear"."mpaymentapp-imt-service-0.0.1-SNAPSHOT.jar".INSTALL:
org.jboss.msc.service.StartException in service
jboss.deployment.subunit."mpaymentapp-ear.ear"."mpaymentapp-imt-service-0.0.1-SNAPSHOT.jar".INSTALL:
WFLYSRV0153: Failed to process phase INSTALL of subdeployment
"mpaymentapp-imt-service-0.0.1-SNAPSHOT.jar" of deployment
"mpaymentapp-ear.ear" at
org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.

JBPM6 WAR not Deploying on Jboss EAP 6.3.0 and EAP 6.2.0

I am unable to deploy the JBPM6 full-installer generated war file in to Jboss-EAP-6.3.0 and EAp-6.2.0.
Problem Statement
Whenever I deploy the generated WAR into Jboss-EAP-6.3.0 server, I get the following error. I have generated the war file from the jbpm-6.1.0.Final-installer-full.zip.
I have taken the WAR from
<i>jbpm-installer\lib\jbpm-console-6.1.0.Final </i>
and also tried with the
<i> jbpm-installer\wildfly-8.1.0.Final\standalone\deployments\jbpm-console.war </i>
ERROR
17:35:19,907 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001: Failed to start service jboss.deployment.unit."jbpm-console.war".STRUCTURE: org.jboss.msc.servi
ce.StartException in service jboss.deployment.unit."jbpm-console.war".STRUCTURE: JBAS018733: Failed to process phase STRUCTURE of deployment "jbpm-console.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:166) [jboss-as-server-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1980) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1913) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_72]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_72]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_72]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS018774: Error loading jboss-all.xml from D:\DevelopmentWorks\A - JBPM CLEAN\jboss-eap-6.3\standalo
ne\tmp\vfs\temp\tempf6aa08ac4728b487\content-ab7fc8043b0c6a18\META-INF\jboss-all.xml
at org.jboss.as.server.deployment.jbossallxml.JBossAllXMLParsingProcessor.parse(JBossAllXMLParsingProcessor.java:153) [jboss-as-server-7.4.0.Final-redhat-19.jar:7.4.0.Fina
l-redhat-19]
at org.jboss.as.server.deployment.jbossallxml.JBossAllXMLParsingProcessor.parse(JBossAllXMLParsingProcessor.java:128) [jboss-as-server-7.4.0.Final-redhat-19.jar:7.4.0.Fina
l-redhat-19]
at org.jboss.as.server.deployment.jbossallxml.JBossAllXMLParsingProcessor.deploy(JBossAllXMLParsingProcessor.java:96) [jboss-as-server-7.4.0.Final-redhat-19.jar:7.4.0.Fina
l-redhat-19]
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:159) [jboss-as-server-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
... 5 more
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[18,3]
Message: Unexpected element '{urn:jboss:weld:1.0}weld'
at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:108)
at org.jboss.staxmapper.XMLExtendedStreamReaderImpl.handleAny(XMLExtendedStreamReaderImpl.java:69)
at org.jboss.as.server.deployment.jbossallxml.JBossAllXMLParsingProcessor$Parser.parseJBossElement(JBossAllXMLParsingProcessor.java:203) [jboss-as-server-7.4.0.Final-redha
t-19.jar:7.4.0.Final-redhat-19]
at org.jboss.as.server.deployment.jbossallxml.JBossAllXMLParsingProcessor$Parser.readElement(JBossAllXMLParsingProcessor.java:192) [jboss-as-server-7.4.0.Final-redhat-19.j
ar:7.4.0.Final-redhat-19]
at org.jboss.as.server.deployment.jbossallxml.JBossAllXMLParsingProcessor$Parser.readElement(JBossAllXMLParsingProcessor.java:176) [jboss-as-server-7.4.0.Final-redhat-19.j
ar:7.4.0.Final-redhat-19]
at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110)
at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:69)
at org.jboss.as.server.deployment.jbossallxml.JBossAllXMLParsingProcessor.parse(JBossAllXMLParsingProcessor.java:148) [jboss-as-server-7.4.0.Final-redhat-19.jar:7.4.0.Fina
l-redhat-19]
... 8 more
17:35:19,937 ERROR [org.jboss.as.server] (HttpManagementService-threads - 2) JBAS015870: Deploy of deployment "jbpm-console.war" was rolled back with the following failure message
:
{"JBAS014671: Failed services" => {"jboss.deployment.unit.\"jbpm-console.war\".STRUCTURE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"jbpm-console.
war\".STRUCTURE: JBAS018733: Failed to process phase STRUCTURE of deployment \"jbpm-console.war\"
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS018774: Error loading jboss-all.xml from D:\\DevelopmentWorks\\A - JBPM CLEAN\\jboss-eap-6.3\\
standalone\\tmp\\vfs\\temp\\tempf6aa08ac4728b487\\content-ab7fc8043b0c6a18\\META-INF\\jboss-all.xml
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[18,3]
**Message: Unexpected element '{urn:jboss:weld:1.0}weld'"}}**
17:35:19,944 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015877: Stopped deployment jbpm-console.war (runtime-name: jbpm-console.war) in 6ms
17:35:19,955 INFO [org.jboss.as.controller] (HttpManagementService-threads - 2) JBAS014774: Service status report
JBAS014777: Services which failed to start: service jboss.deployment.unit."jbpm-console.war".STRUCTURE
That's because the war is prepared for wildfly (there are some specific dependencies that needs to be added to it to work), so you need to get the EAP distribution, or you can build that from the source code.
If you clone and build this repository: https://github.com/droolsjbpm/kie-wb-distributions/ (most specifically the kie-wb app) and look inside the kie-wb/kie-wb-distribution-wars, you will find the EAP ready war.
Or you can download the already built WAR for EAP including SNAPSHOTS and CR release from Nexus: https://repository.jboss.org/nexus/index.html#nexus-search;gav~org.kie~kie-wb-distribution-wars~~~~kw,versionexpand
(look at the link in the right most column for EAP 6_4 or 6_3 depending the version)

Apache Modcluster failed to drain active sessions

I'm am using JBoss EAP 6.2 as Webapplication server and Apace Modcluster for load balancing.
Whenever I try to undeploy my webapplication, I get the following warning
14:22:16,318 WARN [org.jboss.modcluster] (ServerService Thread Pool -- 136) MODCLUSTER000025: Failed to drain 2 remaining active sessions from default-host:/starrassist within 10.000000.1 seconds
14:22:16,319 INFO [org.jboss.modcluster] (ServerService Thread Pool -- 136) MODCLUSTER000021: All pending requests drained from default-host:/starrassist in 10.002000.1 seconds
and it takes forever to undeploy and the EAP server-group and node in which the application is deployed becomes unresponsive.
The only workaround is to restart the entire EAP server. My Question is, Is there an attribute that I can set in EAP or ModCluster so that the active sessions beyond a maxTimeOut would expire itself?
To control the timeout to stop a context you can use the following configuration value:
Stop Context Timeout
The amount of time, measure in units specified by
stopContextTimeoutUnit, for which to wait for clean shutdown of a
context (completion of pending requests for a distributable context;
or destruction/expiration of active sessions for a non-distributable
context).
CLI Command:
/profile=full-ha/subsystem=modcluster/mod-cluster-config=configuration/:write-attribute(name=stop-context-timeout,value=10)
Ref: Configure the mod_cluster Subsystem
Likewise if you are using JDK 8 take a look at this issue: Draining pending requests fails with Oracle JDK8

War File with Webservice is not deployed in JBOSS EAP 6.2 in Standalone server

I tried to build a war file which contains web servicesm which deploys in JBOSS AS 5 and 6 without any issues.
But, in JBOSS EAP (Standalone) it gave me the following error.
I dont have any clue where to look for the error message.
18:20:56,236 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC000001: Failed to start
service jboss.deployment.unit."service.war".PARSE: org.jboss.msc.service.StartException in service j
boss.deployment.unit."service.war".PARSE: JBAS018733: Failed to process phase PARSE of deployment "s
ervice.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseServic
e.java:127) [jboss-as-server-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.
java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746
) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1
.7.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1
.7.0_45]
at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_45]
Caused by: org.jboss.msc.service.ServiceNotFoundException: Service service jboss.ejb.default-resourc
e-adapter-name-service not found
at org.jboss.msc.service.ServiceContainerImpl.getRequiredService(ServiceContainerImpl.java:4
48) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
at org.jboss.as.ejb3.deployment.processors.MessageDrivenComponentDescriptionFactory.getDefau
ltResourceAdapterName(MessageDrivenComponentDescriptionFactory.java:270)
at org.jboss.as.ejb3.deployment.processors.MessageDrivenComponentDescriptionFactory.processM
essageBeans(MessageDrivenComponentDescriptionFactory.java:152)
at org.jboss.as.ejb3.deployment.processors.MessageDrivenComponentDescriptionFactory.processA
nnotations(MessageDrivenComponentDescriptionFactory.java:80)
at org.jboss.as.ejb3.deployment.processors.AnnotatedEJBComponentDescriptionDeploymentUnitPro
cessor.processAnnotations(AnnotatedEJBComponentDescriptionDeploymentUnitProcessor.java:58)
at org.jboss.as.ejb3.deployment.processors.AbstractDeploymentUnitProcessor.deploy(AbstractDe
ploymentUnitProcessor.java:81)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseServic
e.java:120) [jboss-as-server-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
... 5 more
18:20:56,245 ERROR [org.jboss.as.server] (HttpManagementService-threads - 2) JBAS015870: Deploy of d
eployment "service.war" was rolled back with the following failure message:
{"JBAS014671: Failed services" => {"jboss.deployment.unit.\"service.war\".PARSE" => "org.jboss.msc.s
ervice.StartException in service jboss.deployment.unit.\"service.war\".PARSE: JBAS018733: Failed to
process phase PARSE of deployment \"service.war\"
Caused by: org.jboss.msc.service.ServiceNotFoundException: Service service jboss.ejb.default-res
ource-adapter-name-service not found"}}
18:20:59,072 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015877: Stopped dep
loyment service.war (runtime-name: service.war) in 2827ms
What is wrong with my deployment or with my application.
Its CXF, Hibernate, Spring and MY SQL jar file.
please help me.
You need to add the MDB resource to the EJB subsystem. The following needs to be added to the EJB3 subsystem in your XML configuration. There might be a way in CLI or the web console as well.
<mdb>
<resource-adapter-ref resource-adapter-name="hornetq-ra"/>
<bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>
</mdb>