How to deploy EAR into web configuration in JBoss? - jboss

We use "web" configuration of JBoss.
Now we deploy war files only.
But we are going to deploy ear to JBoss.
As far as I can see it is impossible to deploy ear on web configuration because there is no ear deployer in web configuration.
Will it be enough just to copy file default\deployers\ear-deployer-jboss-beans.xml to web\deployers directory?
Or some additional files should be copied too?

Instead of starting with the web configuration I will suggest to use the "default" configuration and trim it. For example, remove JMS.

Related

How to deploy two war files onto Jboss 6.4.0

I have two war files msg-producer and msg-consumer. How to deploy these two war files onto jboss 6.4.0 simultaneously?
currently deploying one war file like this:
copy war file into EAP\standalone\deployments folder
Run standalone.bat from EAP-6.4.0\bin.
Yes, you can deploy two or multiple WAR files into EAP\standalone\deployments folder.
Each web application will have a different context root, using context root you can access the application.
Yes, You can deploy two or more WAR/EAR files in the JBoss Application server.
Please go through the $JBOSS_ROOT/standalone/deployments/README.txt
There are two different modes 1. auto-deploy mode and 2. manual deploy mode
Manual deployment relies on a system of marker
files, with the user's addition or removal of a marker file serving as a sort
of command telling the scanner to deploy, undeploy or redeploy content.
Auto-deploy mode: The scanner will directly monitor the deployment content,
automatically deploying new content and redeploying content whose timestamp
has changed.
Read the README.txt for more details.
The simplest way I recommend is
Login the JBoss admin console
Under deployments tab, click on "add" and select the required msg-producer and msg-consumer war files. "Enable" checkbox to be selected.
Access the application http://localhost(or_servername):8080/contextroot/

Remote deploy artifact to Jboss AS using JRebel

Just trying to setup remote deployment of projects to Jboss AS 4.2.1 using Jrebel.
After enabling the JRebel for my project in eclipse along with the remoting feature, it asks for the deployed app's URL in the server. How do I get to know the URL of my project so that I can mention that in the JRebel remoting section?
I thought of looking it up in the JMX console but my project jar will reside in the lib folder of the EAR that's deployed to the server, so I wasn't able to locate it there. Can anyone help me out?
JRebel Remoting requires a HTTP facing component to function. It makes use of the HTTP protocol using the same port as the web container. This means zero conf (sort of) and no holes to poke into the firewall, but the downside is that it won't work for apps with no WAR module in them (yet :)).
I assume your app is a jar file inside an ear. All it needs is a war module in that ear. That war does not need to have rebel.xml nor rebel-remote.xml in it. Create the WAR if one does not exist.
The URL would be the address you have to enter in a web browser to access that webapp. For example http://example.org:8080/MyWar/
Also make sure you have the rebel.xml and rebel-remote.xml in the deployed library project (simply creating them in Eclipse is not enough, those two xml files have to end up in the server).
Also, you need to install and activate JRebel on the remote server machine, then start JBoss with the following JVM arguments: -javaagent:path/to/jrebel.jar -Drebel.remoting_plugin=true
where path/to/jrebel.jar points to the installed jrebel.jar file
More info: http://zeroturnaround.com/software/jrebel/remoting/
In your case the layout of the EAR could look like this:
- myapp.ear
- webapp.war
- someEJB.jar
- lib/
- yourApp.jar
- WEB-INF/classes/
- rebel.xml
- rebel-remote.xml
- someOtherLib.jar
--
Arnel
JRebel Remoting Tech Lead

JBoss 7 as deploys automatically

I put my jboss on the linux server, exported the war file and placed it on the deployments folder and it automatically deployed. I didn't even had to do it via command line. How is this working?
My jboss has ssl to it.
From the Application Deployment documentation:
The standalone/deployments directory in the JBoss Application Server 7 distribution is the location end users can place their deployment content (e.g. war, ear, jar, sar files) to have it automically deployed into the server runtime.
So, if you put a war file in standalone/deployments, JBoss will detect it and act as if you had manually deployed it. The documentation page has a lot more info about configuration if you want to change the defaults.

How to run .ear file in JBoss 6?

I have created myProj.ear file and copied it into the deploy folder of the JBoss server.. How to run my project after starting the jBoss server?
I have been using war file and
deploying it in Tomcat till now to run
my project.... I am having a new
requirement to run the project in
JBoss. So, I converted my war file
into an ear file using the command Jar
-cvf myProj.ear ., Should I change anything in my project to run
the application in JBoss or just
copying my .ear file in to the jBoss
deploy folder is enough?
JBoss normally support hot deployment - meaning that if your application was deployed correctly (watch the console), it can be accessed via the browser (if you have a UI) or via web services, managed beans or any other interface you have provided.You can see the status of your application on the JBoss Admin Console. You can reach it by typing the URL of your JBoss installation. If you run your vanilla JBoss locally, you should be able to find the console under http://127.0.0.1:8080/admin-console
To reiterate: there is no explicit startup necessary, JBoss handles it for you.
Deploying an application in JBoss is pretty straightforward. You just have to copy the EAR file to the deploy directory in the 'server configuration' directory of your choice. Most people deploy it to the 'default' configuration, by copying the EAR file to the JBOSS_DIR/jboss-as/server/default/deploy directory.
Once copied, just run run.sh from bin, you can use the following params to bind it to an ip (-b) or binding it to anything other port (-Djboss.service.binding.set)
./run.sh -b 9.xxx.xxx.xxx -Djboss.service.binding.set=ports-01
Once you run it, Look at the console for error message. If everything goes fine you'd see "Started J2EE application" after couple of seconds.
If there are any errors or exceptions, make a note of the error message. Check that the EAR is complete and inspect the WAR file and the EJB jar files to make sure they contain all the necessary components (classes, descriptors,
jboss-deployment-structure.xml etc.).
You can safely redeploy the application if it is already deployed. To undeploy it you just have to remove the archive from the deploy directory. There’s no need to restart the server in either case. If everything seems to have gone OK, then point your browser at the application URL.
http://localhost:8080/xyz

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.