Deploy zipped EAR to Wildfly via scp - wildfly

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.

Related

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

OpenShift Wildfly war file deployement using SFTP

I am trying to deploy a war file in a WildFly gear through a SFTP client.
I have followed the directions described here:
https://www.openshift.com/kb/kb-e1088-how-to-deploy-pre-compiled-java-applications-war-and-ear-files-onto-your-openshift-gear but can't find anything about WildFly.
More specifically I was hoping to find app-root/dependencies/wildfly/deployments but as fas as I can tell there is no such directory.
Is there something I am missing or should I only use the git way for wildfly war deployement?
Thank you in advance
If you just want to easily deploy a war file, I would suggest using rhc port-forward (as shown here in the README https://github.com/openshift-cartridges/openshift-wildfly-cartridge/blob/master/README.md) and use the web interface to deploy it. I wrote that article and it does need to have WildFly added, I'll try to get it updated this week. From what I can see right off, you should put your war file into ~/wildfly/standalone/deployments to deploy it via SFTP. If you run this command find . -name "*deployed" when you ssh into your gear, you will see the ROOT.war.deployed in that directory.

How to do hot deployment in Jboss5

I have got a maven project.
So when ever there is a changes done in java file, we take a rebuild of the application .
Put our ear file in deploy folder of jboss and restart the Jboss.
This waste our lot of time in restarting jboss again and again .
I heard about hot deployment in Jboss .
Can any one tell how to do in my case .
Hot deploy is enabled by default in JBoss AS 5.
It should start automatically a couple of seconds after you put ear in deploy folder.
Maybe someone had previously disabled hot deployment on your instance.
Then see Turning off JBoss hot deploy service? and do the opposite.
As I understand, u need a class reloading solution, not auto redeployment.
I recently work out a solution with JBoss 4.x. It probably work with JBoss5.x too. In most of time when I change my code, it reflects immediatly and no redeployment in JBoss.
Here is how:
Turn off JBoss hot deploy service, u can google how.
Create a folder named project.war under JBoss deploy folder, it just works like a war file.
User a file sychronize tools(like FreeFileSync) to sychronize your_project_web_root folder to the project.war folder.
The most important part, use spring-loaded. It's easy and no need to change anything in your project.
4.1 Download springloaded.jar
4.2 If u are using eclipse, just add the following code in the VM arguments of the JBoss Run Configuration.
-javaagent:/springloaded-{VERSION}.jar -noverify
That's it. Now u modify/add methods or fields in a class and then sychronize the class file to the project.war folder, JBoss will reload it and the changes reflect immediately. But springloaded still got some limitation, read the FAQ.

How to deploy an ear in jboss from an URL?

The more I read about deploying ears and wars on JBoss the more confused I become. Apparently the deployers change on every major version.
What I'd like to do is to define an MBean or whatever with an xml snippet in the deploy folder which tell JBoss6 to fetch an ear or war from a remote URL like a jenkins artifact url or from a nexus repository.
The background is to keep the big binary blobs out of our cfengine configuration repository. This also means that copying a new ear in the deploy folder does not work, because cfengine checks every hour and restores the config if it has changed. With the xml-config file, we can undeploy and redeploy through JMX to reload new test versions (which always are on the same url in jenkins) or from the released versions from nexus.
So does anybody know where there is an example of how to achieve this?
thanks

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