How to run .ear file in JBoss 6?

2019-07-11 04:55发布

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
2条回答
我只想做你的唯一
2楼-- · 2019-07-11 05:17

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.

查看更多
The star\"
3楼-- · 2019-07-11 05:17

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
查看更多
登录 后发表回答