Hotswap classes and resources of feature deployed to jboss fuse - eclipse

I am developing "features" with JBOSS Tools 9 (Eclipse) to be deployed on a fuse 6.2 (with fabric)
At the moment the features are deployed via deploy scripts and fuse downloads the feature from maven repository (profile-edit --repository mvn:...). I am able to remote debut the feature ("-Xdebug -Xrunjdwp:transport=dt_socket,address=5001,server=y,suspend=n").
The problem is if i change something i allways have to run mvn install. To see the changes taking effect.
Is there a way to use the Fuse Server integration (i already added the fuse installation to my Eclipse server view) to sync with my sources/resources like with webapp development.
(probably the deployment must be changed?)

You can turn on dev:watch * (I think the name of the command is) from the shell in JBoss Fuse, which turns on watching the maven repository for SNAPSHOT JARs being updated, and then automatic redeploy those in the JBoss Fuse server.
Then you can develop locally and build the code with mvn install to deploy to your local maven repository, which the dev:watch then triggers.
Mind I cannot 100% remember the command name if its dev:watch or something else with watch. Also the arguments to the command can maybe be to watch a specific name.

Related

Eclipse Luna with JBoss Tools does not export libraries

I'm attempting to upgrade our environment to Eclipse Luna w/ JBoss Tools from our current Indigo instance. Most things are sorted well enough, but I'm running into a wall when deploying our application to a JBoss server within Eclipse.
As far as I can see, the lib/ directory of the .ear file generated contains none of the transitive dependencies from maven that we would normally expect to see, and as a result the application does not deploy or run correctly on the server. For clarity, we use the 'use workspace metadata' deployment option on the JBoss server within Eclipse.
By contrast, if I right click on the relevant project within Eclipse and say Export... .ear file, the resulting .ear contains all the .jars that I'd expect inside the lib/ folder (there's over 50 of these things, so it's pretty easy to spot the difference). Subsequently dropping the .ear into the deploy directory of JBoss and starting a server manually has the application working fine.
Has anyone ever encountered this sort of issue within JBoss Tools / Luna, and if so what steps were taken to try and remediate it?
Cheers for any help.
Dave.
EDIT: For what it's worth, this is a JBoss Enterprise Application Platform 5.x server instance, and we're using JBoss EAP 5.2

Is it possible to do Hotswapping of ATG classes

The deployment we follow is that we use runAssembler.bat to build an ear file and deploy it in a app server. We are using weblogic and jboss for testing purposes of the modules we built. However for every small change, we need to run runAssembler and build a new ear and deploy it in app server and restart the server.
I would like to find out if anyone figured out a way to do Hotswapping of class files which are generated by the code we write in ATG environment in either weblogic or jboss.
By attaching your IDE to your Application server on the Debug port it is generally possible to do hotswapping. Setting this up on Eclipse and JBoss is documented here, here and here. There is some information for setting it up in WebLogic here.
Attach your debugger, edit the java file, click 'save' and with hot code replacement in your IDE it should now update the running class file. In Eclipse it usually gives a popup if it was unable to do the sync. If you are using Eclipse, make sure the 'Build Automatically' flag under projects is ticked or you'll be waiting forever. I've not had any issues doing this via JBOSS (exploded ATG EAR) and variable success in doing this on WebSphere 7. It may also be prudent to make sure the same JAVAC you use to compile your build is the one loaded into your IDE compile path.
Another way to at least reduce the build/deploy time would be to deploy an unpacked/exploded EAR and simply copy your class files across (you could use the Eclipse FileSync plugin) and restart the server.
There are also some commercial options available, like JRebel
In our organization, we had good success in using DCEVM. It simply patches your JDK (in Windows: jvm.dll).
Download and patch your JDK
Launch your JBoss/Weblogic with the patched JDK
Set up Eclipse's Installed JRE's to point to patched JDK (restart and rebuild once)
Start the server, Launch debugger and connect
Ensure Eclipse's Debug view shows "Dynamic Code Evolution VM" (instead of something like "HotSpot VM")
Change your code, and voila!
You can do this with JRebel. After hotswapping you don't need to restart the server, only reload you deployment from Weblogic.

Running Maven project on glassfish server

I want to run web based Maven project on glassfish server. I am totally new on maven. However, i have successfully build the maven project and glassfish server is up and running also. Moreover, there is WAR file also in target folder but i am confused what is the next step to run that project on glassfish ?
Any help will be highly appreciated.
You have different options to solve this task:
If you are new to Eclipse I suggest to change to NetBeans. It comes with integrated support for application server deployments. You just add your maven (or nearly any other type of project like WAR, EJB and EAR) project and your desired application server instance (Glassfish) and you are ready: Right-click your project and choose Deploy and it'll get deployed to your server. NetBeans also supports hot-deployment.
You can deploy your WAR file manually in GLASSFISH_ROOT/glassfish/domains/domain1/autodeploy and it'll get deployed if your server is running. But this is not very efficient during development.
If you want to stay with Eclipse you can use the maven-glassfish-plugin or this maven plugin to do the deployment for you. I'm not sure which one is better but this topic is also discussed in this question and this question.

One click build and deploy using Eclipse/Maven/JBoss AS 7

I was wondering if it is possible to make a Java EE application being managed by Maven and automatically deploy it to JBoss all from Eclipse. To my knowledge I current right click on my project and select "Make install". After that completes, I open the server pane and right click on my deployed ear and either select "Full Publish" or "Incremental Publish". Is there a way to condense these actions into one click? I tried to write a windows batch file but I didn't have much luck with that, and it would only work for our devs working on Windows machines. I know I can make run configurations but when I try to make one it is very intimidating and I get frustrated and give up.
Thanks for your help!
You can use JBoss Tools 3.3.0 (Current milestone M4) with the maven integration to easily deploy projects (wars or ears) to your AS7 server.
Once you defined your AS7 instance in eclipse, all you have to do is right click on your project > Run As ...> Run on Server. It'll start your app server if it's stopped, or just deploy your app if it's already running.
See http://vimeo.com/25768303
and http://community.jboss.org/en/tools/blog/2011/11/09/jboss-tools-shift-happens-in-m4
If you are using maven, you can use the cargo plugin: http://cargo.codehaus.org/Maven2+plugin
You just configure where the JBoss is installed, set the plugin to run in the phase you want (or make a new one) and you are all set.
You can also create different configurations for different profiles, so you have local, integration, test, production, etc... And just by running with the selected profile deploys the ear in the server, remote or local.
If you want more control, you can set the path of the container as a variable that you pass in the Eclipse run configuration, that way each developer can have their servers in different paths.

Remote deploy from Eclipse to JBoss AS and integration Eclipse with remote JBoss

I have the following situation. My JBoss server runs on the remote server under some bound address. I would like to run Eclipse on my local machine and deploy results of work to the remote server where I could test it and debug it. I'm working on enterprise Java project and I'm normally deploying one ear file.
I know how to provide remote debugging but what possibilities exist for integrating remove deploy in Eclipse?
I was trying for first the JBoss tools plugin. There is a deploy-only server for the only deploying the project. I'm connected on the network disk on the remote server where JBoss instance runs.
But this plugin deploys ear exploded and afterwards because of the one persistence.xml in my project where tag defines what jars contain entities and instead of the jar there are something.jar directories. Then hibernate isn't able to load entities.
Is there some possibility how to easily make a remote deploy directly from Eclipse? Or better is there possibility how to integrate work on remote JBoss server in Eclipse (I mean run JBoss server, stop it.)?