How to run .ear file in JBoss 6? - jboss

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

Related

Deploy zipped EAR to Wildfly via scp

I am (finally) upgrading from JBoss5.1 to Wildfly 9.0.2.Final (standalone). I am trying to learn how to redeploy a zipped EAR via scp, hoping to have it picked up by the deployment scanner. Per the documentation, all I have to do is set auto-deploy-zipped="true" in standalone.xml (in the deployment descriptor), then copy the .ear into the deployments folder. However, when I do so the scanner places a 'failed' file in the deployments folder with this message:
"There is already a deployment called EAR with the same runtime name EAR.ear"
It sounds like it will not automatically redeploy. I tried adding a signal file named Ear.ear.dodeploy to deployments, but this made no change.
I am able to deploy the EAR via the administration console, but I'm hoping to 'save time' with this scp approach. Hasn't saved time yet! :)
Thanks for any help.
Josh
I figured this out. It turns out that the auto-deploy scheme won't work if you originally deployed the .ear via the administration console. The fix was simply to remove the .ear via the administration console, then take the steps indicated above. Now it deploys and redeploys as expected.

Jboss EAP download deployed war file

I have deployed a war file through management console of JBOSS EAP to my company server. I lost my source code accidentally deleted. How can i download the file that's now running on the server to my local machine. Please help me
When you have access to JBoss directory and you pack source code into jars so:
You deploy a war file through the management console your archive is saved on path:
JBOSS_HOME/standalone/tmp/vfs/deployment (in case when you are in standalone mode)
There you can see unpacked war file with jars. But java source code is usually converted to bitecode and you can not get code from it. Maybe you compose your jar with source code and you can see source code.
But unfortunately I don't know way how to do it through Management console.
In the management console of JBoss, go to "Deployments", click the applicable deployment, click "View". Then you have the possibility to browse through all files in the war. Downloading the full war means clicking the war, and on the right, click "Download".
(all based on the 3.0.19.Final console version)

Can't get past Welcome to Jboss page Openshift

I'm trying to use Openshift to host my java webapps. The problem I am running into is every time I go to my application "http://omniticketmvc-leviliester.rhcloud.com/" it takes me to a "Welcome to your JBossEWS (Apache/Tomcat) application on OpenShift".
I thought maybe it was because my project had some sort of default .war that was being deployed instead of the one I wanted. To try to confirm that I followed this guide made by to deploy a pre-compiled War file. https://www.openshift.com/kb/kb-e1088-how-to-deploy-pre-compiled-java-applications-war-and-ear-files-onto-your-openshift-gear .
As you can imagine that did not work. The guide implies that I should be able to find my webapp running at app-domain.rhcloud.com/mywebsite with "mywebsite" being the name of the war file my project created. In this scenario my Application war file is name "OmniTicket". I can find that war file on the server using ssh but the directory hierarchy is confusing to me.
I also tried looking in logs on the server but I don't see any errors to indicate a malfunction in spring or database connections. Any help would be appreciated. Specifically when I deploy my application to the Jboss Server without any obvious errors, why can't I get to the application root?
I should also mention it is a SpringMVC restful service application that works locally.
Try following steps:
Rename your war name to ROOT.war
Delete the src and pom.xml. If pom.xml is present then OpenShift would try to build the maven project
Place the war in deployments folder under your application root folder
Commit the war and push changes to application Git repository.
Check the logs using rhc tail command

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.

tomcat do not unpack war file

i stopped tomcat
paste myapp.war into webapps folder.
start tomcat
call in browser
http://localhost:8080/myapp/index.jsf
see 404
also tomcat does not generate log files under logs directory.
I am using eclipse to start and stop tomcat, and my tomcat 7 is an unzipped version.
to be sure that my war file runs on server, i remove same project from tomcat in eclipse servers view.
repeating question, but i think my situation is a little different, tomcat does not generate logs.
a note: i generate war file by right click in eclipse-> export war file.
thanks for any idea.
If you are launching tomcat from within Eclipse (using the webtools tomcat server adapter) you will have to make sure you have changed the settings to use the installation directory to launch instead of the default which uses a separate location for loading and deploying webapps. So if you add a war directly into the webapps folder, the server launched from Eclipse server adapter wont have that directly setup in the server.xml configuration.
So you should use the startup.bat/startup.sh in the tomcat/bin folder. If you do, you need to make sure that you don't just copy the .war file into the webapps, but rather unzip the war file into a directory folder called "myapp"