How to create a priority service thread pool in jboss - jboss

I have deployed 2 war files in jboss 6.4 (SupposeA.war and B.war) ,I want A.war to be deployed first then B deployment should start.
Is there any way to do it.
This is required as my B.war is dependent on A.war.

You can create a jboss-all.xml deployment file (located under B.war/WEB-INF/jboss-all.xml) and it should be something like:
<jboss umlns="urn:jboss:1.0">
<jboss-deployment-dependencies xmlns="urn:jboss:deployment-dependencies:1.0">
<dependency name="a.war" />
</jboss-deployment-dependencies>
</jboss>
Now B will start after A has been deployed. The same file works for any top level deployment, as an ear.

Related

How to deploy .war in node of own choice in Wildfly cluster?

I have deployed a .war and WF choose itself one of 3 node and deploys in same. (01,02,03)
I want to .war to shift from say 03 to 02 manually. (not redeploy again and again and see when it will choose).
As of now following file is there in jboss deployment:
<?xml version="1.0" encoding="UTF-8"?>
<singleton-deployment xmlns="urn:jboss:singleton-deployment:1.0"/>
How is it possible in Wildfly? (Wildfly 16)
Why do you care which node? If you only want to deploy to a single node, only place in the deployments directory of that node

How to fail war deployment if dependent war fails in wildfly

I have 2 war files as below
1st is for DB jndi registration (jndi-reg.war).
2nd war (actual application)
This war deployment depends on jndi-reg.war, so for this I have added jboss-all.xml under /WEB-INF/ of second war,
jboss-all.xml as below
<jboss umlns="urn:jboss:1.0">
<jboss-deployment-dependencies xmlns="urn:jboss:deployment-dependencies:1.0">
<dependency name="jndir-reg.war" />
</jboss-deployment-dependencies>
</jboss>
The problem is that I want to fail my application war if jndi-reg.war fails (like in case db credential is invalid)
But with above file war, under standalone/deployment/apple.war.deployed show war is deployed but not able to access it, So What things I should do to fail the application war in case if jndi-reg.war fails.

Set deployment order in Wildfly 10

I have 1 ear and some sar to deploy, I need to deploy sar1 before sar2, I tried to include jboss-all.xml inside Meta-INF in my sar2, but without results.
<?xml version="1.0" encoding="UTF-8"?>
<jboss xmlns="urn:jboss:1.0">
<jboss-deployment-dependencies xmlns="urn:jboss:deployment-dependencies:1.0">
<dependency name="sar1.sar" />
</jboss-deployment-dependencies>
</jboss>
How can I set the deployment order?
Thanks in advance
I have not tried it but the RedHat EAP docs indicate that there are several possibilities listed here: https://access.redhat.com/solutions/18317
From the article:
Filename based ordering
Default order of deployment
deployer
-deployer.xml
sar
-service.xml
rar
-ds.xml
har
jar
war
wsr
ear
zip
bsh
last
The DeploymentSorter can be changed by changing the configuration in $JBOSS_HOME/server/$PROFILE/conf/jboss-service.xml
Assuming it works for WildFly also, you might just try renaming them to get the depoyment sorter to pick them up for filename based ordering?

deploy.last in JBoss 5.1 in web configuration?

We have ear that depends on war file.
We use web configuration.
I put war file to <jboss_home>/server/web/deploy directory.
And I put ear file to <jboss_home>/server/web/deploy/deploy.last directory.
But ear starts prior to war.
Why?
I use a similar configuration to what you describe, though I put all the apps I want to deploy first in deploy/myapps and all the ones to deploy afterwards in deploy/myapps.last. This works correctly for me on JBoss 5.1.2.
Although I can't explain why it isn't working for you, I can offer an alternative solution. You can make the EAR declare a dependency on the WAR and JBoss will then ensure the WAR is deployed first.
First, add a file called aliases.txt into the META-INF directory of your WAR. This file should just contain a single line with an arbitrary name / identifier for your WAR. For example, if you have mywebapp.war, your META-INF/aliases.txt file could contain 'mywebapp'. It just needs to be something that won't clash with any other aliases declared by other apps deployed on the same server.
Next, add a jboss-dependency.xml file to the META-INF directory of your EAR, containing the following (subsituting 'mywebapp' for the alias you created above):
<dependency xmlns="urn:jboss:dependency:1.0">
<item whenRequired="Real" dependentState="Create">mywebapp</item>
</dependency>
This should ensure the WAR is deployed before the EAR.
Also, if you try to deploy the EAR without the WAR being present, JBoss will log a clear deployment error message telling you about the missing dependency.

How can I get JBoss to explode a deployed WAR file?

I am running JBoss 4.3 on Ubuntu under /usr/local/jboss-4.3/. I have deployed my application as a WAR file i.e. myapp.war, to /usr/local/jboss-4.3/server/myserver/deploy. However, there doesn't seem to be an 'exploded' /myapp directory under the deploy folder, how come?
I am used to Tomcat running on Windows so I am a bit new to JBoss. When you deply WAR to Tomcat, the physical contents of this WAR will be exploded to a /myapp directory. With this it is then possible to modify files under the web app, such as config settings etc.
How can I do this in JBoss?
You can unzip your .war contents in a "myapp.war" folder, which JBoss will consider a deployed application just as if it was a zipped war.
Even better, most IDEs (Eclipse for sure, but i guess other IDEs such as Netbeans) allow you to deploy the exploded package instead of the zipped .war, allowing you to change just the single files you modify instead of the whole .war package
This link can be useful:
http://community.jboss.org/wiki/DeployTipsAndBuildSampleScripts
Quick Summary of what the article concerns: When it comes application builds/deployments in JBoss, there are a plethora of viable approaches. This wiki highlights several build/deploy scenerios, along with steps and pertinent build script samples. The following approaches are covered:
Point/click deployment using JBossIDE - For users that don't like ANT build scripts
Exploded EAR, JAR, SAR, WAR deployment (Option 1) - Maximize development productivity by eliminating ANT copy tasks
Exploded EAR, JAR, SAR, WAR deployment (Option 2) - Separate IDE from the compile, build and deploy process
Normal EAR, JAR, SAR, WAR deployment - Deploy a zipped archive (Necessary when using Clustering/Farm Deployment
Same problem facing, when I export as .war file from Eclipse and copy it into (UAT or Prod) JBOSS Server 7.1.1 Final AS deployement directory, And Start Windows JBOSS Service
.war file deployed sucessfully but .war file not unpacked or exploded into deployment folder.
For This solution is copy example.war exploded folder (name of folder) into deployment folder and then start. And mentions auto-deploye-exploded=true in standalon.xml
it does this in a tmp folder......
but you can explode the file in the deploy directoy just name it "app.war"
I had exactly the same problem with JBoss 7. My ant script would copy the .war file to the JBoss deployments folder (jboss-as-7.1.1.Final/standalone/deployments in my system) but the .war wouldn't explode. The .war was perfectly deployable through the administration CLI so it wasn't an unsatisfied dependency or anything. It was solved when I instructed my Ant war task to not compress the war (set the property compress to false) as in:
...
<target name="war" depends="build">
<mkdir dir="${build.dir}"/>
<war
compress="false"
needxmlfile="false"
basedir="${webroot.dir}"
warfile="${build.dir}/${project.distname}.war">
<exclude name="WEB-INF/${build.dir}/**"/>
<exclude name="WEB-INF/src/**"/>
</war>
</target>
In the standalone.xml I do see only this part of the code:
<subsystem xmlns="urn:jboss:domain:deployment-scanner:1.1">
I do not see the deployment-scanner parameters like:
auto-deploy-exploded" => false,
"auto-deploy-zipped" => true,
"deployment-timeout" => 60L,
and so on.