Showing posts with label eclipse. Show all posts
Showing posts with label eclipse. Show all posts

Wednesday, March 09, 2011

JBoss – Pause at startup until debugger is attached

A tidbit I picked up today at ATG developer training: It’s possible to configure JBoss to pause at startup until a debugger is attached. To do this, specify suspend=y in JAVA_OPTS. (This can be done in <jbossdir>\bin\run.bat.) For example, the relevant line from the run.bat I’m using in the training class:

set JAVA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y %JAVA_OPTS%

With this setting, JBoss will automatically resume startup when it detects that a debugger (e.g. Eclipse) has been attached.

This is useful to be able to debug things that occur while JBoss is starting up.

Thursday, July 02, 2009

Installing m2eclipse in Eclipse 3.5

After newly installing Eclipse 3.5 (replacing my old Eclipse 3.3 install), when I tried to view a document with a Maven pom.xml file that I’d previously had open in my workspace, I got an error:

Could not open the editor: No editor descriptor for id org.maven.ide.eclipse.editor.MavenPomEditor

The fix was to install m2eclipse (the Maven plugin for Eclipse). I did this in Eclipse 3.5 as follows:

  • Help | Install New Software
  • In the "Install" dialog: click the Add button
  • In the "Add Site" dialog:
    • Name: m2eclipse
    • Location: http://m2eclipse.sonatype.org/update/
  • Click OK
  • Back in the "Install" dialog, in the "Add Site" dropdown, select: m2eclipse
  • Under "Maven Integration", I checked:
    • "Maven Integration for Eclipse (Required)"
    • "Maven POM Editor (Optional)"
    • "Maven POM XML Editor (Optional)"
  • Click Next, go through and complete the Install wizard.
  • When prompted, I restarted Eclipse.

That got my Maven POM editor up and running in Eclipse 3.5.

Tuesday, December 30, 2008

Fix: InvocationTargetException in Eclipse while using CVS

I ran into an issue while using Eclipse 3.3 today where Eclipse was throwing a java.lang.reflect.InvocationTargetException while trying to get another version of a project using Eclipse's built-in CVS client. I initially encountered the error after pressing the "Refresh Tags" button on the "Replace with Branch or Version" dialog.

InvocationTargetException thrown by Eclipse trying to do a 'Refresh Tags'

Some brief experimentation revealed that I wasn't able to do any CVS operations from within Eclipse. Either I would get the above error, or else the operation would just silently fail.

Checking the Eclipse log file (at workspace\.metadata\.log) showed that a "Connection refused: HTTP/1.1 403 Forbidden" error was occurring whenever I tried to perform a CVS operation.

This error message turned out to be the key; there was an issue with Eclipse's proxy settings. In the Preferences dialog (Window menu | Preferences), under General | Network Connections, in the "No Proxy for" section, I needed to add the hostname of my CVS server.

After adding the hostname of my proxy server in the Network Connections section of the Preferences dialog, CVS operations in Eclipse once again stared working properly.

Thursday, June 28, 2007

Howto: Disable auto-insertion of HTML end tags in Eclipse

In Eclipse (version 3.2.1), when editing an HTML page, Eclipse automatically completes HTML end tags that you are in the process of typing for you. For example, if you type:

<td></

Eclipse will immediately automatically add the rest of the tag -- in this case, td> -- for you, so that you end up with (with the part Eclipse added shown here in italics):

<td></td>

However, after years of typing HTML, I'm accustomed to quickly typing the entire HTML end tag myself without thinking about it. Over the last few days, since I've started to use Eclipse to edit HTML, I've frequently ended up with HTML like the following while I'm typing something out:

<td></td>td>

Eclipse adds the second td> automatically, but at the same time I'd typed it out myself without pausing to remember the fact that Eclipse is going to add it for me, and I'd end up with some broken HTML that I would have to either stop what I was doing to fix, or remember to go back and fix later. This got quite aggravating by the time it happened to me for about the 30th time. :-)

I started looking for a way to disable the end tag auto-insertion feature. I searched through the Window | Preferences settings in Eclipse, but couldn't find any setting that was responsible for the end tag auto-insertion. I also searched the Web with Google and Usenet with Google Groups, but couldn't come up with any relevant results even after trying several different variations on my search terms.

Finally, I posted my question to the Eclipse newsgroup eclipse.newcomer (free registration required to browse/post). Nitin Dahyabhai kindly responded and provided the solution:

The HTML end tag auto-insert feature is controlled by the "Smart Insert Mode" setting on the Eclipse Edit menu. You can uncheck the setting there to get Eclipse to stop automatically completing HTML end tags.

Having disabled the "Smart Insert Mode" setting, I'm now much happier while typing HTML into the Eclipse editor. Thanks, Nitin!