How can I make JBoss launch block until build workspace is complete?

354 views Asked by At

In my previous version of Eclipse, I could launch my JBoss server from the same run or debug configurations menu that I use for launching all my other programs, and if I launched the server while "build workspace" was going on, the launch would block until build workspace was complete.

Now that I have upgraded to Luna, if I want to launch JBoss , I have to go to the servers tab because JBoss is no longer listed in the run/debug menus with my other programs, and also, if I launch the server while "build workspace" is going on, the server launches immediately. Usually this causes a problem because after the build finishes, classes are replaced in the running server JVM, and I get a notice that the hot replace was not successful.

How can I get back to the old behavior for my server? Is it still possible to have the server launch wait for build workspace to complete?

3

There are 3 answers

1
martinez314 On

See Run/Debug > Launching in Preferences. Also see "Launch Groups" that allow you to daisy chain run config launches. More on Launch Groups here.

enter image description here

8
M A On

Launch configurations are stored in the workspace directory, under the ${workspace_dir}/.metadata/.plugins/org.eclipse.debug.core/.launches directory. You should be able to find the file corresponding to the launch that used to work there (unless it was deleted during the upgrade to Luna). The name of the file is the same name of the run configuration, e.g. LaunchServer.launch.

It could be that the workspace was somehow corrupted after upgrading Eclipse. If you locate the launch configuration file, you can import it by selecting File --> Import --> Launch Configurations and browsing the location of the .launch file.

A launch configuration can also be shared if you don't want to store it in the .metadata folder. From the configuration dialog, under the Common tab, select the Shared file radio button to point to the .launch file.

See How do I save Eclipse launch profiles across workspaces and How can I clean up Eclipse “run configurations”.

EDIT:

Based on the comments, the workspace seems to already contain the launch configuration file, but it's not showing in the menu. This could possibly be due to some corrupted metadata. You can try to do the following:

  1. Copy the existing .launch file from ${workspace_dir}/.metadata/.plugins/org.eclipse.debug.core/.launches to a backup file.

  2. Delete the .launch file.

  3. Restart Eclipse.

  4. Import the copied launch config file using File --> Import --> Launch Configurations.

2
E-Riz On

If your JBoss server launch isn't showing up in the Run Configurations (or Debug Configurations) dialog, it could be that it's being filtered out of the view. Look under Preferences > Run/Debug > Launching > Launch Configurations and see the Filter checked launch types option, checking if any of the filters might be hiding your server launch. enter image description here


Another possibility is that you don't have the JBoss tools plugins installed that populate JBoss server launches into the Run Configurations list. Make sure you have installed the JBoss Developer Studio or JBoss Tools plugins from Eclipse Marketplace (Help > Eclipse Marketplace then search for "jboss" (without quotes) in the Marketplace dialog).

Among the things that the JBoss plugins provide is an Eclipse WTP Server Adapter, which enables configuring and launching of JBoss servers in Eclipse Web Tools (see What are JST and WST server adapters? for some info on WST/JST adapters in Eclipse Web Tools). The JBoss tools provide other features to the IDE, among them might be UI enhancment to list JBoss launches; that's what I suspect you are missing in your Luna installation.