2

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?

Abdullah Khan
  • 12,010
  • 6
  • 65
  • 78
harishtps
  • 1,439
  • 7
  • 20
  • 35

2 Answers2

2

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
vmishra
  • 1,682
  • 2
  • 12
  • 10
  • This is valid for a standalone server but not for a domain server. I don't know that there is a directory for the domain server that you can drop an ear onto and have it deployed automatically the same way you can with a standalone server. – jkilgrow Oct 31 '17 at 16:06
2

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.

kostja
  • 60,521
  • 48
  • 179
  • 224
  • 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 have to change anything in my proj to make run the application in JBoss or just copying my .ear file in to the jBoss delopy folder is enough? – harishtps Apr 18 '11 at 12:37
  • if it is a .war you don't have to do any renaming. It may even be harmful, as JBoss might handle them differently while they are actually same. Just paste the war into the deploy folder and everything should be fine if it was before on tomcat. – kostja Apr 18 '11 at 12:45