Skip navigation

JBoss Tools

January 24, 2012 Previous day Next day
snjeza

JBoss Source Lookup

Posted by snjeza Jan 24, 2012

The JBoss Tools Source Lookup plugin automatically adds a source attachment when debugging JBoss AS servers.

The plugin has been tested with JBoss AS 7.x and JBoss AS 6.1.

 

Installing the JBoss Source Lookup plugin

 

 

Note: Since JBoss Tools 3.3 Beta3 JBoss Source Lookup is available and part of JBoss Tools Maven integration.

No need to install JBoss Source Lookup from the temporary updatesite anymore.

 

  • call Help>Install New Software..., click the Add button and enter the following update site:

https://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/org.jboss.tools.as.sourcelookup.updatesite/

lookupblog1.png

Install the JBoss Tools Source Lookup category and restart Eclipse.

 

Using the JBoss Source Lookup plugin

 

 

The use and debugging of this plugin is demonstrated in the following screencast: Debugging JBoss AS server.

 

The JBoss Source Lookup plugin enhances source attachment in the following way:

 

  • archive file doesn't have to be in the maven classpath
  • archive file doesn't have to be included in the classpath (jbossweb-*.jar, for instance). The JBoss Source Lookup plugin will find a class within a JBoss AS distribution and, if it is a Maven artifact, the plugin will attach the corresponding source.
  • archive file doesn't have to be in the m2e index (jbossjts-4.16.0.Final.jar, for instance)

 

You don't have to add any JBoss AS Runtime to the classpath. I have added it in order to ensure the classes within the runtime are included in the Java Search and in order to be easier to add a breakpoint.

 

Debugging Apache Tomcat and Glassfish servers

 

The JBoss Source plugin can serve to debug other servers.

If a server includes mavenized archives, the JBoss Source container will find, download, and show source files.
I have tested the Apache Tomcat 7.0.25 and Glassfish 3.1.1.

 

If you want to debug Apache Tomcat and/or Glassfish, you have to do the following:

 

  • create some Apache Tomcat/Glassfish server

    lookupblog3.png

  • open the server editor

    lookupblog4.png

  • click Open launch configuration and select the Source tab

    lookupblog5.png

  • click the Add button and select the JBoss AS Source Container

    lookupblog6.png

  • JBoss AS servers will be automatically recognized and you can choose them by clicking a server
    As to other servers, you need to click the Choose Home button, select all the directories in which the server's archives are placed.

        If you debug Tomcat, you can choose $TOMCAT_HOME/lib.  When debugging Glassfish, you can choose $GLASSFISH_HOME/lib and $GLASSFISH_HOME/modules.
        You can add as many JBoss AS Source containers as you want.

lookupblog7.png

 

  • move a JBoss Source container(s) to the end (optional)

    lookupblog8.png

  • you can add a Server Runtime container to the project's classpath (optional)

    lookupblog9.png

  • start the server in the debug mode

    lookupblog10.png

    StandardWrapper.java is placed in the glassfish's web-core.jar.  
    The Source Lookup plugin finds this archive's source and shows it in the editor.

 

In a similar way you can debug Apache Tomcat server.

lookupblog12.png

The ApplicationFilterChain.java is placed in the Tomcat's catalina.jar archive.

 

 

The Source Lookup plugin finds source for a mavenized archive as follows:

 

  • using the m2e API
  • using the archive's metadata (META-INF/maven)
  • using nexus repositories that can be defined using the Source Lookup preferences page

    lookupblog11.png

 

The Source Lookup preferences page enables you to add/remove, enable/disable and/or change ordering of Nexus repositories.

You can see that the helloworld project I have used in this blog, is not a maven project (it doesn't contain the maven icon).
JBoss Source Lookup plugin can be used to debug any Java project.

 

The plugin doesn't have to be used for debugging only.

It will find, download and open a source file for a mavenized archive included in the classpath when double-clicking a class file in the Package Explorer view, opening it using Navigate>Open Type or some other way.

 

The JBoss Source Lookup plugin can be used for any Java project and any launch configuration.

 

Note: When starting debugging the first time, it could take some time until m2e updates indexes and the JBoss Source lookup plugin scans the container's directory.

While everyone except me is having fun at JUDCon in India I thought it would be nice to let you know that there will be a few talks done by us/related to JBoss Tools in the near future elsewhere.

 

FOSDEM - 4-5. February, 2012, Brussels, Belgium

http://fosdem.org/2012/sites/all/themes/fosdem/images/logofosdem2.jpg

 

First up is FOSDEM in Brussels where there is a whole jboss.org DevRoom track of great talks, especially:

 

"JBoss Forge / Arquillian: Two Missing Links in Enterprise Java Development" by Koen Aers on Saturday, 4th February 2012 at 15:00.

 

Expect Koen to do show magic with his Forge Tooling which makes Forge and Eclipse work for you instead of against you.

 

EclipseCon, 26-29th March, 2012, Richmond Virginia

http://www.eclipsecon.org/2012/sites/all/themes/themes/econ2012/images/logo.png

 

This year EclipseCon is moving from "sunny" California on the west coast to Virginia on the east coast. Looking forward to see how the change of scenery will affect the conference.

 

"What's new in the OSGi Enterprise Release 5.0" by David Bosscheart (Red Hat) and Tim Diekmann (Tibco) on Tuesday, 27th March 2012 at 11:15

 

"Tycho - still good, bad or ugly ?" by Max Rydahl Andersen on Tuesday, 27th March 2012 at 16:15

 

"Ceylon - The language and it's tools" by Max Rydahl Andersen on Thursday, 29th March 2012 at 10:15

 

MOW2012, 18-20th April, 2012, Billund, Denmark

http://mow2012.dk/images/mow2012/images/logo_transparent.png

For the second year Miracle Open World which before was a dominantly "Oracle Database" conference is having tracks that includes other languages and especially Java middelware content. I was there last year and it was awesomely fun, even though very few had realized it was more than a database conference.

 

This year I and a few others from Red Hat will be presenting again so hope more will join in on the fun.

The following are the ones related to JBoss Tools, and titles being self-explanatory:

 

"Ceylon - say more, more clearly" by Max Rydahl Andersen on Thursday, 19th April 2012 at 11:00

 

"Death of the slow: 7 reasons to love AS 7" by Max Rydahl Andersen on Thursday, 19th April 2012 at 15:00

 

"JavaEE on the Cloud with OpenShift Express" by Thomas Heute on Friday, 20th April at 11:00

 

See you out there having fun!

Filter Blog

By date:
By tag: